mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 22:37:03 +00:00
[9241] Implement AI/EventAI calls at summoned creature die/despawn
* New CreatureAI::SummonedCreatureJustDie called for owner at temporary summoned creature die. * New EVENT_T_SUMMONED_JUST_DIE (25) for proccess CreatureAI::SummonedCreatureJustDie event * New EVENT_T_SUMMONED_JUST_DESPAWN (26) for proccess CreatureAI::SummonedCreatureJustDespawn event * Some code cleanups.
This commit is contained in:
parent
75381e31f8
commit
36d90d6040
9 changed files with 110 additions and 42 deletions
|
|
@ -35,6 +35,7 @@
|
|||
#include "MapManager.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "CreatureAI.h"
|
||||
#include "TemporarySummon.h"
|
||||
#include "Formulas.h"
|
||||
#include "Pet.h"
|
||||
#include "Util.h"
|
||||
|
|
@ -684,6 +685,16 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa
|
|||
if (cVictim->AI())
|
||||
cVictim->AI()->JustDied(this);
|
||||
|
||||
if (cVictim->isTemporarySummon())
|
||||
{
|
||||
TemporarySummon* pSummon = (TemporarySummon*)cVictim;
|
||||
if (IS_CREATURE_GUID(pSummon->GetSummonerGUID()))
|
||||
if(Creature* pSummoner = cVictim->GetMap()->GetCreature(pSummon->GetSummonerGUID()))
|
||||
if (pSummoner->AI())
|
||||
pSummoner->AI()->SummonedCreatureJustDie(cVictim);
|
||||
}
|
||||
|
||||
|
||||
// Dungeon specific stuff, only applies to players killing creatures
|
||||
if(cVictim->GetInstanceId())
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue