mirror of
https://github.com/liyunfan1223/azerothcore-wotlk.git
synced 2026-08-09 08:17:56 +00:00
@@ -2197,7 +2197,12 @@ TempSummon* Map::SummonCreature(uint32 entry, Position const& pos, SummonPropert
|
||||
summon->SetHomePosition(pos);
|
||||
|
||||
summon->InitStats(duration);
|
||||
AddToMap(summon->ToCreature(), summon->GetOwnerGUID().IsPlayer() || (summoner && summoner->GetTransport()));
|
||||
if (!AddToMap(summon->ToCreature(), summon->GetOwnerGUID().IsPlayer() || (summoner && summoner->GetTransport())))
|
||||
{
|
||||
delete summon;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
summon->InitSummon();
|
||||
|
||||
//ObjectAccessor::UpdateObjectVisibility(summon);
|
||||
|
||||
@@ -857,16 +857,30 @@ public:
|
||||
{
|
||||
PreventHitEffect(effIndex);
|
||||
|
||||
uint32 entry = GetSpellInfo()->Effects[effIndex].MiscValue;
|
||||
SummonPropertiesEntry const* properties = sSummonPropertiesStore.LookupEntry(GetSpellInfo()->Effects[effIndex].MiscValueB);
|
||||
int32 duration = GetSpellInfo()->GetDuration();
|
||||
if (!GetOriginalCaster() || !properties)
|
||||
return;
|
||||
|
||||
if (TempSummon* summon = GetCaster()->GetMap()->SummonCreature(entry, *GetHitDest(), properties, duration, GetOriginalCaster(), GetSpellInfo()->Id))
|
||||
if (Unit* caster = GetCaster())
|
||||
{
|
||||
summon->SetCreatorGUID(GetOriginalCaster()->GetGUID());
|
||||
summon->HandleSpellClick(GetCaster());
|
||||
Unit* originalCaster = GetOriginalCaster();
|
||||
if (!originalCaster)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
SummonPropertiesEntry const* properties = sSummonPropertiesStore.LookupEntry(GetSpellInfo()->Effects[effIndex].MiscValueB);
|
||||
if (!properties)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
uint32 entry = GetSpellInfo()->Effects[effIndex].MiscValue;
|
||||
int32 duration = GetSpellInfo()->GetDuration();
|
||||
if (TempSummon* summon = caster->GetMap()->SummonCreature(entry, *GetHitDest(), properties, duration, originalCaster, GetSpellInfo()->Id))
|
||||
{
|
||||
if (summon->IsInMap(caster))
|
||||
{
|
||||
summon->SetCreatorGUID(originalCaster->GetGUID());
|
||||
summon->HandleSpellClick(caster);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user