TModLoader v1.4.4.9
TModLoader source code documentation
Loading...
Searching...
No Matches
Terraria.ModLoader.NPCLoader Class Reference

This serves as the central class from which NPC-related functions are carried out. It also stores a list of mod NPCs by ID. More...

+ Collaboration diagram for Terraria.ModLoader.NPCLoader:

Static Public Member Functions

static T AddModHook< T > (T hook)
 
static ModNPC GetNPC (int type)
 Gets the ModNPC template instance corresponding to the specified type (not the clone/new instance which gets added to NPCs as the game is played).
 
static void ApplyDifficultyAndPlayerScaling (NPC npc, int numPlayers, float balance, float bossAdjustment)
 
static void SetBestiary (NPC npc, BestiaryDatabase database, BestiaryEntry bestiaryEntry)
 
static void ModifyTownNPCProfile (NPC npc, ref ITownNPCProfile profile)
 
static void ResetEffects (NPC npc)
 
static void NPCAI (NPC npc)
 
static bool PreAI (NPC npc)
 
static void AI (NPC npc)
 
static void PostAI (NPC npc)
 
static void SendExtraAI (BinaryWriter writer, byte[] extraAI)
 
static byte[] WriteExtraAI (NPC npc)
 
static byte[] ReadExtraAI (BinaryReader reader)
 
static void ReceiveExtraAI (NPC npc, byte[] extraAI)
 
static void FindFrame (NPC npc, int frameHeight)
 
static void HitEffect (NPC npc, in NPC.HitInfo hit)
 
static void UpdateLifeRegen (NPC npc, ref int damage)
 
static bool CheckActive (NPC npc)
 
static bool CheckDead (NPC npc)
 
static bool SpecialOnKill (NPC npc)
 
static bool PreKill (NPC npc)
 
static void OnKill (NPC npc)
 
static void ModifyNPCLoot (NPC npc, NPCLoot npcLoot)
 
static void ModifyGlobalLoot (GlobalLoot globalLoot)
 
static void BossLoot (NPC npc, ref string name, ref int potionType)
 
static ? bool CanFallThroughPlatforms (NPC npc)
 
static ? bool CanBeCaughtBy (NPC npc, Item item, Player player)
 
static void OnCaughtBy (NPC npc, Player player, Item item, bool failed)
 
static ? int PickEmote (NPC npc, Player closestPlayer, List< int > emoteList, WorldUIAnchor anchor)
 
static bool CanHitPlayer (NPC npc, Player target, ref int cooldownSlot)
 
static void ModifyHitPlayer (NPC npc, Player target, ref Player.HurtModifiers modifiers)
 
static void OnHitPlayer (NPC npc, Player target, Player.HurtInfo hurtInfo)
 
static bool CanHitNPC (NPC npc, NPC target)
 
static void ModifyHitNPC (NPC npc, NPC target, ref NPC.HitModifiers modifiers)
 
static void OnHitNPC (NPC npc, NPC target, in NPC.HitInfo hit)
 
static ? bool CanBeHitByItem (NPC npc, Player player, Item item)
 
static ? bool CanCollideWithPlayerMeleeAttack (NPC npc, Player player, Item item, Rectangle meleeAttackHitbox)
 
static void ModifyHitByItem (NPC npc, Player player, Item item, ref NPC.HitModifiers modifiers)
 
static void OnHitByItem (NPC npc, Player player, Item item, in NPC.HitInfo hit, int damageDone)
 
static ? bool CanBeHitByProjectile (NPC npc, Projectile projectile)
 
static void ModifyHitByProjectile (NPC npc, Projectile projectile, ref NPC.HitModifiers modifiers)
 
static void OnHitByProjectile (NPC npc, Projectile projectile, in NPC.HitInfo hit, int damageDone)
 
static void ModifyIncomingHit (NPC npc, ref NPC.HitModifiers modifiers)
 
static void BossHeadSlot (NPC npc, ref int index)
 
static void BossHeadRotation (NPC npc, ref float rotation)
 
static void BossHeadSpriteEffects (NPC npc, ref SpriteEffects spriteEffects)
 
static ? Color GetAlpha (NPC npc, Color lightColor)
 
static void DrawEffects (NPC npc, ref Color drawColor)
 
static bool PreDraw (NPC npc, SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor)
 
static void PostDraw (NPC npc, SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor)
 
static bool DrawHealthBar (NPC npc, ref float scale)
 
static void EditSpawnRate (Player player, ref int spawnRate, ref int maxSpawns)
 
static void EditSpawnRange (Player player, ref int spawnRangeX, ref int spawnRangeY, ref int safeRangeX, ref int safeRangeY)
 
static ? int ChooseSpawn (NPCSpawnInfo spawnInfo)
 
static int SpawnNPC (int type, int tileX, int tileY)
 
static void CanTownNPCSpawn (int numTownNPCs)
 
static bool CheckConditions (int type)
 
static string ModifyTypeName (NPC npc, string typeName)
 
static void ModifyHoverBoundingBox (NPC npc, ref Rectangle boundingBox)
 
static List< string > ModifyNPCNameList (NPC npc, List< string > nameList)
 
static bool UsesPartyHat (NPC npc)
 
static ? bool CanChat (NPC npc)
 
static void GetChat (NPC npc, ref string chat)
 
static void SetChatButtons (ref string button, ref string button2)
 
static bool PreChatButtonClicked (bool firstButton)
 
static void OnChatButtonClicked (bool firstButton)
 
static void AddShops (int type)
 
static void ModifyShop (NPCShop shop)
 
static void ModifyActiveShop (NPC npc, string shopName, Item[] shopContents)
 
static void SetupTravelShop (int[] shop, ref int nextSlot)
 
static ? bool CanGoToStatue (NPC npc, bool toKingStatue)
 
static void OnGoToStatue (NPC npc, bool toKingStatue)
 
static void BuffTownNPC (ref float damageMult, ref int defense)
 
static void TownNPCAttackStrength (NPC npc, ref int damage, ref float knockback)
 
static void TownNPCAttackCooldown (NPC npc, ref int cooldown, ref int randExtraCooldown)
 
static void TownNPCAttackProj (NPC npc, ref int projType, ref int attackDelay)
 
static void TownNPCAttackProjSpeed (NPC npc, ref float multiplier, ref float gravityCorrection, ref float randomOffset)
 
static void TownNPCAttackShoot (NPC npc, ref bool inBetweenShots)
 
static void TownNPCAttackMagic (NPC npc, ref float auraLightMultiplier)
 
static void TownNPCAttackSwing (NPC npc, ref int itemWidth, ref int itemHeight)
 
static void DrawTownAttackGun (NPC npc, ref Texture2D item, ref Rectangle itemFrame, ref float scale, ref int horizontalHoldoutOffset)
 
static void DrawTownAttackSwing (NPC npc, ref Texture2D item, ref Rectangle itemFrame, ref int itemSize, ref float scale, ref Vector2 offset)
 
static bool ModifyCollisionData (NPC npc, Rectangle victimHitbox, ref int immunityCooldownSlot, ref float damageMultiplier, ref Rectangle npcHitbox)
 
static bool SavesAndLoads (NPC npc)
 

Static Public Attributes

static readonly IList< int > blockLoot = new List<int>()
 Allows you to stop an NPC from dropping loot by adding item IDs to this list. This list will be cleared whenever NPCLoot ends. Useful for either removing an item or change the drop rate of an item in the NPC's loot table. To change the drop rate of an item, use the PreNPCLoot hook, spawn the item yourself, then add the item's ID to this list.
 

Static Package Functions

static int Register (ModNPC npc)
 
static void ResizeArrays (bool unloading)
 
static void FinishSetup ()
 
static void RegisterTownNPCMoodLocalizations (ModNPC npc)
 
static void Unload ()
 
static bool IsModNPC (NPC npc)
 
static void SetDefaults (NPC npc, bool createModNPC=true)
 
static void OnSpawn (NPC npc, IEntitySource source)
 
static void DrawBehind (NPC npc, int index)
 

Static Package Attributes

static readonly IList< ModNPCnpcs = new List<ModNPC>()
 
static readonly IDictionary< int, int > bannerToItem = new Dictionary<int, int>()
 
static GlobalHookList< GlobalNPCHookSaveData = AddHook((Expression<Func<GlobalNPC, Action<NPC, TagCompound>>>)((GlobalNPC g) => g.SaveData))
 

Properties

static int NPCCount = NPCID.Count [get, private set]
 

Private Member Functions

delegate void DelegateSetBestiary (NPC npc, BestiaryDatabase database, BestiaryEntry bestiaryEntry)
 
delegate ITownNPCProfile DelegateModifyTownNPCProfile (NPC npc)
 
delegate void DelegateUpdateLifeRegen (NPC npc, ref int damage)
 
delegate bool DelegateCanHitPlayer (NPC npc, Player target, ref int cooldownSlot)
 
delegate void DelegateModifyHitPlayer (NPC npc, Player target, ref Player.HurtModifiers modifiers)
 
delegate void DelegateModifyHitNPC (NPC npc, NPC target, ref NPC.HitModifiers modifiers)
 
delegate void DelegateModifyHitByItem (NPC npc, Player player, Item item, ref NPC.HitModifiers modifiers)
 
delegate void DelegateModifyHitByProjectile (NPC npc, Projectile projectile, ref NPC.HitModifiers modifiers)
 
delegate void DelegateAddModifyIncomingHit (NPC npc, ref NPC.HitModifiers modifiers)
 
delegate void DelegateBossHeadSlot (NPC npc, ref int index)
 
delegate void DelegateBossHeadRotation (NPC npc, ref float rotation)
 
delegate void DelegateBossHeadSpriteEffects (NPC npc, ref SpriteEffects spriteEffects)
 
delegate void DelegateDrawEffects (NPC npc, ref Color drawColor)
 
delegate bool DelegatePreDraw (NPC npc, SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor)
 
delegate void DelegatePostDraw (NPC npc, SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor)
 
delegate? bool DelegateDrawHealthBar (NPC npc, byte bhPosition, ref float scale, ref Vector2 position)
 
delegate void DelegateEditSpawnRate (Player player, ref int spawnRate, ref int maxSpawns)
 
delegate void DelegateEditSpawnRange (Player player, ref int spawnRangeX, ref int spawnRangeY, ref int safeRangeX, ref int safeRangeY)
 
delegate void DelegateModifyTypeName (NPC npc, ref string typeName)
 
delegate void DelegateModifyHoverBoundingBox (NPC npc, ref Rectangle boundingBox)
 
delegate void DelegateGetChat (NPC npc, ref string chat)
 
delegate void DelegateOnChatButtonClicked (NPC npc, bool firstButton)
 
delegate void DelegateModifyShop (NPCShop shop)
 
delegate void DelegateModifyActiveShop (NPC npc, string shopName, Item[] items)
 
delegate void DelegateSetupTravelShop (int[] shop, ref int nextSlot)
 
delegate void DelegateBuffTownNPC (ref float damageMult, ref int defense)
 
delegate void DelegateTownNPCAttackStrength (NPC npc, ref int damage, ref float knockback)
 
delegate void DelegateTownNPCAttackCooldown (NPC npc, ref int cooldown, ref int randExtraCooldown)
 
delegate void DelegateTownNPCAttackProj (NPC npc, ref int projType, ref int attackDelay)
 
delegate void DelegateTownNPCAttackProjSpeed (NPC npc, ref float multiplier, ref float gravityCorrection, ref float randomOffset)
 
delegate void DelegateTownNPCAttackShoot (NPC npc, ref bool inBetweenShots)
 
delegate void DelegateTownNPCAttackMagic (NPC npc, ref float auraLightMultiplier)
 
delegate void DelegateTownNPCAttackSwing (NPC npc, ref int itemWidth, ref int itemHeight)
 
delegate void DelegateDrawTownAttackGun (NPC npc, ref Texture2D item, ref Rectangle itemFrame, ref float scale, ref int horizontalHoldoutOffset)
 
delegate void DelegateDrawTownAttackSwing (NPC npc, ref Texture2D item, ref Rectangle itemFrame, ref int itemSize, ref float scale, ref Vector2 offset)
 
delegate bool DelegateModifyCollisionData (NPC npc, Rectangle victimHitbox, ref int immunityCooldownSlot, ref MultipliableFloat damageMultiplier, ref Rectangle npcHitbox)
 
delegate bool DelegateNeedSaving (NPC npc)
 

Static Private Member Functions

static GlobalHookList< GlobalNPCAddHook< F > (Expression< Func< GlobalNPC, F > > func)
 
static void UpdateHookLists ()
 
static void DrawHealthBar (NPC npc, Vector2 position, float scale)
 

Static Private Attributes

static readonly List< GlobalHookList< GlobalNPC > > hooks = new List<GlobalHookList<GlobalNPC>>()
 
static readonly List< GlobalHookList< GlobalNPC > > modHooks = new List<GlobalHookList<GlobalNPC>>()
 
static GlobalHookList< GlobalNPCHookOnSpawn = AddHook((Expression<Func<GlobalNPC, Action<NPC, IEntitySource>>>)((GlobalNPC g) => g.OnSpawn))
 
static GlobalHookList< GlobalNPCHookApplyDifficultyAndPlayerScaling = AddHook((Expression<Func<GlobalNPC, Action<NPC, int, float, float>>>)((GlobalNPC g) => g.ApplyDifficultyAndPlayerScaling))
 
static GlobalHookList< GlobalNPCHookSetBestiary = AddHook((Expression<Func<GlobalNPC, DelegateSetBestiary>>)((GlobalNPC g) => g.SetBestiary))
 
static GlobalHookList< GlobalNPCHookModifyTownNPCProfile = AddHook((Expression<Func<GlobalNPC, DelegateModifyTownNPCProfile>>)((GlobalNPC g) => g.ModifyTownNPCProfile))
 
static GlobalHookList< GlobalNPCHookResetEffects = AddHook((Expression<Func<GlobalNPC, Action<NPC>>>)((GlobalNPC g) => g.ResetEffects))
 
static GlobalHookList< GlobalNPCHookPreAI = AddHook((Expression<Func<GlobalNPC, Func<NPC, bool>>>)((GlobalNPC g) => g.PreAI))
 
static GlobalHookList< GlobalNPCHookAI = AddHook((Expression<Func<GlobalNPC, Action<NPC>>>)((GlobalNPC g) => g.AI))
 
static GlobalHookList< GlobalNPCHookPostAI = AddHook((Expression<Func<GlobalNPC, Action<NPC>>>)((GlobalNPC g) => g.PostAI))
 
static GlobalHookList< GlobalNPCHookSendExtraAI = AddHook((Expression<Func<GlobalNPC, Action<NPC, BitWriter, BinaryWriter>>>)((GlobalNPC g) => g.SendExtraAI))
 
static GlobalHookList< GlobalNPCHookReceiveExtraAI = AddHook((Expression<Func<GlobalNPC, Action<NPC, BitReader, BinaryReader>>>)((GlobalNPC g) => g.ReceiveExtraAI))
 
static GlobalHookList< GlobalNPCHookFindFrame = AddHook((Expression<Func<GlobalNPC, Action<NPC, int>>>)((GlobalNPC g) => g.FindFrame))
 
static GlobalHookList< GlobalNPCHookHitEffect = AddHook((Expression<Func<GlobalNPC, Action<NPC, NPC.HitInfo>>>)((GlobalNPC g) => g.HitEffect))
 
static GlobalHookList< GlobalNPCHookUpdateLifeRegen = AddHook((Expression<Func<GlobalNPC, DelegateUpdateLifeRegen>>)((GlobalNPC g) => g.UpdateLifeRegen))
 
static GlobalHookList< GlobalNPCHookCheckActive = AddHook((Expression<Func<GlobalNPC, Func<NPC, bool>>>)((GlobalNPC g) => g.CheckActive))
 
static GlobalHookList< GlobalNPCHookCheckDead = AddHook((Expression<Func<GlobalNPC, Func<NPC, bool>>>)((GlobalNPC g) => g.CheckDead))
 
static GlobalHookList< GlobalNPCHookSpecialOnKill = AddHook((Expression<Func<GlobalNPC, Func<NPC, bool>>>)((GlobalNPC g) => g.SpecialOnKill))
 
static GlobalHookList< GlobalNPCHookPreKill = AddHook((Expression<Func<GlobalNPC, Func<NPC, bool>>>)((GlobalNPC g) => g.PreKill))
 
static GlobalHookList< GlobalNPCHookOnKill = AddHook((Expression<Func<GlobalNPC, Action<NPC>>>)((GlobalNPC g) => g.OnKill))
 
static GlobalHookList< GlobalNPCHookModifyNPCLoot = AddHook((Expression<Func<GlobalNPC, Action<NPC, NPCLoot>>>)((GlobalNPC g) => g.ModifyNPCLoot))
 
static GlobalHookList< GlobalNPCHookModifyGlobalLoot = AddHook((Expression<Func<GlobalNPC, Action<GlobalLoot>>>)((GlobalNPC g) => g.ModifyGlobalLoot))
 
static GlobalHookList< GlobalNPCHookCanFallThroughPlatforms = AddHook((Expression<Func<GlobalNPC, Func<NPC, bool?>>>)((GlobalNPC g) => g.CanFallThroughPlatforms))
 
static GlobalHookList< GlobalNPCHookCanBeCaughtBy = AddHook((Expression<Func<GlobalNPC, Func<NPC, Item, Player, bool?>>>)((GlobalNPC g) => g.CanBeCaughtBy))
 
static GlobalHookList< GlobalNPCHookOnCaughtBy = AddHook((Expression<Func<GlobalNPC, Action<NPC, Player, Item, bool>>>)((GlobalNPC g) => g.OnCaughtBy))
 
static GlobalHookList< GlobalNPCHookPickEmote = AddHook((Expression<Func<GlobalNPC, Func<NPC, Player, List<int>, WorldUIAnchor, int?>>>)((GlobalNPC g) => g.PickEmote))
 
static GlobalHookList< GlobalNPCHookCanHitPlayer = AddHook((Expression<Func<GlobalNPC, DelegateCanHitPlayer>>)((GlobalNPC g) => g.CanHitPlayer))
 
static GlobalHookList< GlobalNPCHookModifyHitPlayer = AddHook((Expression<Func<GlobalNPC, DelegateModifyHitPlayer>>)((GlobalNPC g) => g.ModifyHitPlayer))
 
static GlobalHookList< GlobalNPCHookOnHitPlayer = AddHook((Expression<Func<GlobalNPC, Action<NPC, Player, Player.HurtInfo>>>)((GlobalNPC g) => g.OnHitPlayer))
 
static GlobalHookList< GlobalNPCHookCanHitNPC = AddHook((Expression<Func<GlobalNPC, Func<NPC, NPC, bool>>>)((GlobalNPC g) => g.CanHitNPC))
 
static GlobalHookList< GlobalNPCHookCanBeHitByNPC = AddHook((Expression<Func<GlobalNPC, Func<NPC, NPC, bool>>>)((GlobalNPC g) => g.CanBeHitByNPC))
 
static GlobalHookList< GlobalNPCHookModifyHitNPC = AddHook((Expression<Func<GlobalNPC, DelegateModifyHitNPC>>)((GlobalNPC g) => g.ModifyHitNPC))
 
static GlobalHookList< GlobalNPCHookOnHitNPC = AddHook((Expression<Func<GlobalNPC, Action<NPC, NPC, NPC.HitInfo>>>)((GlobalNPC g) => g.OnHitNPC))
 
static GlobalHookList< GlobalNPCHookCanBeHitByItem = AddHook((Expression<Func<GlobalNPC, Func<NPC, Player, Item, bool?>>>)((GlobalNPC g) => g.CanBeHitByItem))
 
static GlobalHookList< GlobalNPCHookCanCollideWithPlayerMeleeAttack = AddHook((Expression<Func<GlobalNPC, Func<NPC, Player, Item, Rectangle, bool?>>>)((GlobalNPC g) => g.CanCollideWithPlayerMeleeAttack))
 
static GlobalHookList< GlobalNPCHookModifyHitByItem = AddHook((Expression<Func<GlobalNPC, DelegateModifyHitByItem>>)((GlobalNPC g) => g.ModifyHitByItem))
 
static GlobalHookList< GlobalNPCHookOnHitByItem = AddHook((Expression<Func<GlobalNPC, Action<NPC, Player, Item, NPC.HitInfo, int>>>)((GlobalNPC g) => g.OnHitByItem))
 
static GlobalHookList< GlobalNPCHookCanBeHitByProjectile = AddHook((Expression<Func<GlobalNPC, Func<NPC, Projectile, bool?>>>)((GlobalNPC g) => g.CanBeHitByProjectile))
 
static GlobalHookList< GlobalNPCHookModifyHitByProjectile = AddHook((Expression<Func<GlobalNPC, DelegateModifyHitByProjectile>>)((GlobalNPC g) => g.ModifyHitByProjectile))
 
static GlobalHookList< GlobalNPCHookOnHitByProjectile = AddHook((Expression<Func<GlobalNPC, Action<NPC, Projectile, NPC.HitInfo, int>>>)((GlobalNPC g) => g.OnHitByProjectile))
 
static GlobalHookList< GlobalNPCHookAddModifyIncomingHit = AddHook((Expression<Func<GlobalNPC, DelegateAddModifyIncomingHit>>)((GlobalNPC g) => g.ModifyIncomingHit))
 
static GlobalHookList< GlobalNPCHookBossHeadSlot = AddHook((Expression<Func<GlobalNPC, DelegateBossHeadSlot>>)((GlobalNPC g) => g.BossHeadSlot))
 
static GlobalHookList< GlobalNPCHookBossHeadRotation = AddHook((Expression<Func<GlobalNPC, DelegateBossHeadRotation>>)((GlobalNPC g) => g.BossHeadRotation))
 
static GlobalHookList< GlobalNPCHookBossHeadSpriteEffects = AddHook((Expression<Func<GlobalNPC, DelegateBossHeadSpriteEffects>>)((GlobalNPC g) => g.BossHeadSpriteEffects))
 
static GlobalHookList< GlobalNPCHookGetAlpha = AddHook((Expression<Func<GlobalNPC, Func<NPC, Color, Color?>>>)((GlobalNPC g) => g.GetAlpha))
 
static GlobalHookList< GlobalNPCHookDrawEffects = AddHook((Expression<Func<GlobalNPC, DelegateDrawEffects>>)((GlobalNPC g) => g.DrawEffects))
 
static GlobalHookList< GlobalNPCHookPreDraw = AddHook((Expression<Func<GlobalNPC, DelegatePreDraw>>)((GlobalNPC g) => g.PreDraw))
 
static GlobalHookList< GlobalNPCHookPostDraw = AddHook((Expression<Func<GlobalNPC, DelegatePostDraw>>)((GlobalNPC g) => g.PostDraw))
 
static GlobalHookList< GlobalNPCHookDrawBehind = AddHook((Expression<Func<GlobalNPC, Action<NPC, int>>>)((GlobalNPC g) => g.DrawBehind))
 
static GlobalHookList< GlobalNPCHookDrawHealthBar = AddHook((Expression<Func<GlobalNPC, DelegateDrawHealthBar>>)((GlobalNPC g) => g.DrawHealthBar))
 
static GlobalHookList< GlobalNPCHookEditSpawnRate = AddHook((Expression<Func<GlobalNPC, DelegateEditSpawnRate>>)((GlobalNPC g) => g.EditSpawnRate))
 
static GlobalHookList< GlobalNPCHookEditSpawnRange = AddHook((Expression<Func<GlobalNPC, DelegateEditSpawnRange>>)((GlobalNPC g) => g.EditSpawnRange))
 
static GlobalHookList< GlobalNPCHookEditSpawnPool = AddHook((Expression<Func<GlobalNPC, Action<Dictionary<int, float>, NPCSpawnInfo>>>)((GlobalNPC g) => g.EditSpawnPool))
 
static GlobalHookList< GlobalNPCHookSpawnNPC = AddHook((Expression<Func<GlobalNPC, Action<int, int, int>>>)((GlobalNPC g) => g.SpawnNPC))
 
static GlobalHookList< GlobalNPCHookModifyTypeName = AddHook((Expression<Func<GlobalNPC, DelegateModifyTypeName>>)((GlobalNPC g) => g.ModifyTypeName))
 
static GlobalHookList< GlobalNPCHookModifyHoverBoundingBox = AddHook((Expression<Func<GlobalNPC, DelegateModifyHoverBoundingBox>>)((GlobalNPC g) => g.ModifyHoverBoundingBox))
 
static GlobalHookList< GlobalNPCHookModifyNPCNameList = AddHook((Expression<Func<GlobalNPC, Action<NPC, List<string>>>>)((GlobalNPC g) => g.ModifyNPCNameList))
 
static GlobalHookList< GlobalNPCHookCanChat = AddHook((Expression<Func<GlobalNPC, Func<NPC, bool?>>>)((GlobalNPC g) => g.CanChat))
 
static GlobalHookList< GlobalNPCHookGetChat = AddHook((Expression<Func<GlobalNPC, DelegateGetChat>>)((GlobalNPC g) => g.GetChat))
 
static GlobalHookList< GlobalNPCHookPreChatButtonClicked = AddHook((Expression<Func<GlobalNPC, Func<NPC, bool, bool>>>)((GlobalNPC g) => g.PreChatButtonClicked))
 
static GlobalHookList< GlobalNPCHookOnChatButtonClicked = AddHook((Expression<Func<GlobalNPC, DelegateOnChatButtonClicked>>)((GlobalNPC g) => g.OnChatButtonClicked))
 
static GlobalHookList< GlobalNPCHookModifyShop = AddHook((Expression<Func<GlobalNPC, DelegateModifyShop>>)((GlobalNPC g) => g.ModifyShop))
 
static GlobalHookList< GlobalNPCHookModifyActiveShop = AddHook((Expression<Func<GlobalNPC, DelegateModifyActiveShop>>)((GlobalNPC g) => g.ModifyActiveShop))
 
static GlobalHookList< GlobalNPCHookSetupTravelShop = AddHook((Expression<Func<GlobalNPC, DelegateSetupTravelShop>>)((GlobalNPC g) => g.SetupTravelShop))
 
static GlobalHookList< GlobalNPCHookCanGoToStatue = AddHook((Expression<Func<GlobalNPC, Func<NPC, bool, bool?>>>)((GlobalNPC g) => g.CanGoToStatue))
 
static GlobalHookList< GlobalNPCHookOnGoToStatue = AddHook((Expression<Func<GlobalNPC, Action<NPC, bool>>>)((GlobalNPC g) => g.OnGoToStatue))
 
static GlobalHookList< GlobalNPCHookBuffTownNPC = AddHook((Expression<Func<GlobalNPC, DelegateBuffTownNPC>>)((GlobalNPC g) => g.BuffTownNPC))
 
static GlobalHookList< GlobalNPCHookTownNPCAttackStrength = AddHook((Expression<Func<GlobalNPC, DelegateTownNPCAttackStrength>>)((GlobalNPC g) => g.TownNPCAttackStrength))
 
static GlobalHookList< GlobalNPCHookTownNPCAttackCooldown = AddHook((Expression<Func<GlobalNPC, DelegateTownNPCAttackCooldown>>)((GlobalNPC g) => g.TownNPCAttackCooldown))
 
static GlobalHookList< GlobalNPCHookTownNPCAttackProj = AddHook((Expression<Func<GlobalNPC, DelegateTownNPCAttackProj>>)((GlobalNPC g) => g.TownNPCAttackProj))
 
static GlobalHookList< GlobalNPCHookTownNPCAttackProjSpeed = AddHook((Expression<Func<GlobalNPC, DelegateTownNPCAttackProjSpeed>>)((GlobalNPC g) => g.TownNPCAttackProjSpeed))
 
static GlobalHookList< GlobalNPCHookTownNPCAttackShoot = AddHook((Expression<Func<GlobalNPC, DelegateTownNPCAttackShoot>>)((GlobalNPC g) => g.TownNPCAttackShoot))
 
static GlobalHookList< GlobalNPCHookTownNPCAttackMagic = AddHook((Expression<Func<GlobalNPC, DelegateTownNPCAttackMagic>>)((GlobalNPC g) => g.TownNPCAttackMagic))
 
static GlobalHookList< GlobalNPCHookTownNPCAttackSwing = AddHook((Expression<Func<GlobalNPC, DelegateTownNPCAttackSwing>>)((GlobalNPC g) => g.TownNPCAttackSwing))
 
static GlobalHookList< GlobalNPCHookDrawTownAttackGun = AddHook((Expression<Func<GlobalNPC, DelegateDrawTownAttackGun>>)((GlobalNPC g) => g.DrawTownAttackGun))
 
static GlobalHookList< GlobalNPCHookDrawTownAttackSwing = AddHook((Expression<Func<GlobalNPC, DelegateDrawTownAttackSwing>>)((GlobalNPC g) => g.DrawTownAttackSwing))
 
static GlobalHookList< GlobalNPCHookModifyCollisionData = AddHook((Expression<Func<GlobalNPC, DelegateModifyCollisionData>>)((GlobalNPC g) => g.ModifyCollisionData))
 
static GlobalHookList< GlobalNPCHookNeedSaving = AddHook((Expression<Func<GlobalNPC, DelegateNeedSaving>>)((GlobalNPC g) => g.NeedSaving))
 

Detailed Description

This serves as the central class from which NPC-related functions are carried out. It also stores a list of mod NPCs by ID.

Definition at line 25 of file NPCLoader.cs.


The documentation for this class was generated from the following file: