Advertisement
Rochet2

CreatureHooks

Feb 23rd, 2013
232
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 3.77 KB | None | 0 0
  1.  
  2. //Called for reaction at enter to combat if not in combat yet (enemy can be NULL)
  3. //Called at creature aggro either by MoveInLOS or Attack Start
  4. void EnterCombat(Unit* target)
  5. [CREATURE_EVENT_ON_ENTER_COMBAT]
  6. }
  7.  
  8. // Called at any Damage from any attacker (before damage apply)
  9. void DamageTaken(Unit* attacker, uint32& damage)
  10. [CREATURE_EVENT_ON_DAMAGE_TAKEN]
  11.  
  12. //Called at World update tick
  13. void UpdateAI(uint32 const diff)
  14.  
  15. [CREATURE_EVENT_ON_AIUPDATE]
  16. }
  17.  
  18. //Called at creature death
  19. void JustDied(Unit* killer)
  20. [CREATURE_EVENT_ON_DIED]
  21. }
  22.  
  23. //Called at creature killing another unit
  24. void KilledUnit(Unit* victim)
  25. [CREATURE_EVENT_ON_TARGET_DIED]
  26. }
  27.  
  28. // Called when the creature summon successfully other creature
  29. void JustSummoned(Creature* summon)
  30. [CREATURE_EVENT_ON_JUST_SUMMONED_CREATURE]
  31. }
  32.  
  33. // Called when a summoned creature is despawned
  34. void SummonedCreatureDespawn(Creature* summon)
  35. [CREATURE_EVENT_ON_SUMMONED_CREATURE_DESPAWN]
  36. }
  37.  
  38. // Called when hit by a spell
  39. void SpellHit(Unit* caster, SpellInfo const* spell)
  40. [CREATURE_EVENT_ON_HIT_BY_SPELL]
  41.  
  42. // Called when spell hits a target
  43. void SpellHitTarget(Unit* target, SpellInfo const* spell)
  44. [CREATURE_EVENT_ON_SPELL_HIT_TARGET]
  45.  
  46. //Called at waypoint reached or PointMovement end
  47. void MovementInform(uint32 type, uint32 id)
  48. [CREATURE_EVENT_ON_REACH_WP]
  49.  
  50. // Called when AI is temporarily replaced or put back when possess is applied or removed
  51. void OnPossess(bool apply)
  52. [CREATURE_EVENT_ON_POSSESS]
  53. }
  54.  
  55. //Called at creature reset either by death or evade
  56. void Reset()
  57. [CREATURE_EVENT_ON_RESET]
  58.  
  59. // Called before EnterCombat even before the creature is in combat.
  60. void AttackStart(Unit* target)
  61. [CREATURE_EVENT_ON_PRE_COMBAT]
  62. }
  63.  
  64. // Called in Creature::Update when deathstate = DEAD. Inherited classes may maniuplate the ability to respawn based on scripted events.
  65. bool CanRespawn()
  66.  
  67. [CREATURE_EVENT_ON_CAN_RESPAWN]
  68. }
  69.  
  70. // Called for reaction at stopping attack at no attackers or targets
  71. void EnterEvadeMode()
  72. [CREATURE_EVENT_ON_LEAVE_COMBAT]
  73.  
  74. // Called when the creature is summoned successfully by other creature
  75. void IsSummonedBy(Unit* summoner)
  76. [CREATURE_EVENT_ON_SUMMONED]
  77. }
  78.  
  79. void SummonedCreatureDies(Creature* summon, Unit* killer)
  80. [CREATURE_EVENT_ON_SUMMONED_CREATURE_DIED]
  81.  
  82. // Called when the creature is target of hostile action: swing, hostile spell landed, fear/etc)
  83. void AttackedBy(Unit* attacker)
  84. [CREATURE_EVENT_ON_ATTACKED_AT]
  85. }
  86.  
  87. // Called when creature is spawned or respawned (for reseting variables)
  88. void JustRespawned()
  89. [CREATURE_EVENT_ON_SPAWN]
  90. }
  91.  
  92. void OnCharmed(bool apply)
  93. [CREATURE_EVENT_ON_CHARMED]
  94. }
  95.  
  96. // Called at reaching home after evade
  97. void JustReachedHome()
  98. [CREATURE_EVENT_ON_REACH_HOME]
  99.  
  100. // Called at text emote receive from player
  101. void ReceiveEmote(Player* player, uint32 emoteId)
  102. [CREATURE_EVENT_ON_RECEIVE_EMOTE]
  103.  
  104. // Called when owner takes damage
  105. void OwnerAttackedBy(Unit* attacker)
  106. [CREATURE_EVENT_ON_OWNER_ATTACKED_AT]
  107. }
  108.  
  109. // Called when owner attacks something
  110. void OwnerAttacked(Unit* target)
  111. [CREATURE_EVENT_ON_OWNER_ATTACKED_AT]
  112. }
  113.  
  114. // called when the corpse of this creature gets removed
  115. void CorpseRemoved(uint32& respawnDelay)
  116. [CREATURE_EVENT_ON_CORPSE_REMOVED]
  117. }
  118.  
  119. // Called when victim entered water and creature can not enter water
  120. bool canReachByRangeAttack(Unit* target)
  121.  
  122. [CREATURE_EVENT_ON_CANT_REACH_TARGET]
  123.  
  124. void PassengerBoarded(Unit* passenger, int8 seatId, bool apply)
  125. CREATURE_EVENT_ON_PASSANGER_BOARDED]
  126. }
  127.  
  128. void OnSpellClick(Unit* clicker)
  129. [CREATURE_EVENT_ON_SPELL_CLICK]
  130. }
  131.  
  132. void MoveInLineOfSight(Unit* who)
  133. [CREATURE_EVENT_ON_MOVE_IN_LOS]
  134. }
  135.  
  136. // Called if IsVisible(Unit* who) is true at each who move, reaction at visibility zone enter
  137. void MoveInLineOfSight_Safe(Unit* who)
  138. [CREATURE_EVENT_ON_MOVE_IN_LOS]
  139. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement