

Return true to draw the health bar in the position specified by the position parameter (note that this is the world position, not screen position). Return false to stop the health bar from being drawn.
#CAN YOU LOAD ENBSERIES WITH MODLOADER CODE#
Return null to let the normal vanilla health-bar-drawing code to run. By default, it will be the normal 1f most bosses set this to 1.5f. The scale parameter is the health bar's size. The hbPosition parameter is the same as Main.hbPosition it determines whether the health bar gets drawn above or below the NPC by default. More.ĭrawHealthBar (NPC npc, byte hbPosition, ref float scale, ref Vector2 position)Īllows you to control how the health bar for the given NPC is drawn. More.ĭrawEffects (NPC npc, ref Color drawColor)Īllows you to add special visual effects to an NPC (such as creating dust), and modify the color in which the NPC is drawn. Add the index to one of Main.DrawCacheNPCsMoonMoon, DrawCacheNPCsOverPlayers, DrawCacheNPCProjectiles, or DrawCacheNPCsBehindNonSolidTiles. When used in conjunction with "npc.hide = true", allows you to specify that this npc should be drawn behind certain elements. Only called if CloneNewInstances & InstancePerEntity More. By default this will return a memberwise clone you will want to override this if your GlobalNPC contains object references. Return false to stop the NPC from being killed. You may program extra effects in this hook (for example, how Golem's head lifts up for the second phase of its fight). Whether or not an NPC should be killed when it reaches 0 health. Return false to stop the NPC from being despawned and to stop the NPC from counting towards the limit for how many NPCs can exist near a player. Whether or not to run the code for checking whether an NPC will remain active.


CooldownSlot determines which of the player's cooldown counters to use (-1, 0, or 1), and defaults to -1. Return false to block the NPC from hitting the target. More.ĬanHitPlayer (NPC npc, Player target, ref int cooldownSlot)Īllows you to determine whether an NPC can hit the given player. Return true to allow hitting the target, return false to block the NPC from hitting the target, and return null to use the vanilla code for whether the target can be hit. More.Īllows you to determine whether an NPC can hit the given friendly NPC. Return true to allow the NPC to teleport to the statue, return false to block this NPC from teleporting to the statue, and return null to use the vanilla code for whether the NPC can teleport to the statue. Whether this NPC can be telported a King or Queen statue. More.ĬanGoToStatue (NPC npc, bool toKingStatue) Return true to allow talking with the player, return false to block this NPC from talking with the player, and return null to use the vanilla code for whether the NPC can talk. More.Īllows you to determine whether this NPC can talk with the player. Return true to allow hitting the NPC, return false to block hitting the NPC, and return null to use the vanilla code for whether the NPC can be hit. More.ĬanBeHitByProjectile (NPC npc, Projectile projectile)Īllows you to determine whether an NPC can be hit by the given projectile. More.ĬanBeHitByItem (NPC npc, Player player, Item item)Īllows you to determine whether an NPC can be hit by the given melee weapon when swung. Useful for buffing town NPCs when certain bosses are defeated, etc. More.īuffTownNPC (ref float damageMult, ref int defense)Īllows you to modify the stats of town NPCs. More.īossHeadSpriteEffects (NPC npc, ref SpriteEffects spriteEffects)Īllows you to flip an NPC's boss head icon on the map. Set index to -1 to stop the texture from being displayed. More.Īllows you to customize the boss head texture used by an NPC based on its state. More.īossHeadRotation (NPC npc, ref float rotation)Īllows you to customize the rotation of an NPC's boss head icon on the map. Use this method to either force or stop an autoload or to control the internal name. Name is initialized to the overriding class name. Return true to allow autoloading by default returns the mod's autoload property. More.Īllows you to automatically load a GlobalNPC instead of using Mod.AddGlobalNPC. This will only be called if PreAI returns true. Allows you to determine how any NPC behaves.
