mirror of
https://github.com/mangosfour/server.git
synced 2025-12-23 07:37:01 +00:00
[7490] Implement expected multiply summon case support with proper duration for EffectSummonDemon
This commit is contained in:
parent
7589bf7263
commit
8228161197
2 changed files with 45 additions and 16 deletions
|
|
@ -6375,12 +6375,40 @@ void Spell::EffectSkill(uint32 /*i*/)
|
||||||
|
|
||||||
void Spell::EffectSummonDemon(uint32 i)
|
void Spell::EffectSummonDemon(uint32 i)
|
||||||
{
|
{
|
||||||
float px = m_targets.m_destX;
|
// select center of summon position
|
||||||
float py = m_targets.m_destY;
|
float center_x = m_targets.m_destX;
|
||||||
float pz = m_targets.m_destZ;
|
float center_y = m_targets.m_destY;
|
||||||
|
float center_z = m_targets.m_destZ;
|
||||||
|
|
||||||
Creature* Charmed = m_caster->SummonCreature(m_spellInfo->EffectMiscValue[i], px, py, pz, m_caster->GetOrientation(),TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,3600000);
|
float radius = GetSpellRadius(sSpellRadiusStore.LookupEntry(m_spellInfo->EffectRadiusIndex[i]));
|
||||||
if (!Charmed)
|
|
||||||
|
int32 amount = damage > 0 ? damage : 1;
|
||||||
|
|
||||||
|
for(int32 count = 0; count < amount; ++count)
|
||||||
|
{
|
||||||
|
float px, py, pz;
|
||||||
|
// If dest location if present
|
||||||
|
if (m_targets.m_targetMask & TARGET_FLAG_DEST_LOCATION)
|
||||||
|
{
|
||||||
|
// Summon 1 unit in dest location
|
||||||
|
if (count == 0)
|
||||||
|
{
|
||||||
|
px = m_targets.m_destX;
|
||||||
|
py = m_targets.m_destY;
|
||||||
|
pz = m_targets.m_destZ;
|
||||||
|
}
|
||||||
|
// Summon in random point all other units if location present
|
||||||
|
else
|
||||||
|
m_caster->GetRandomPoint(center_x,center_y,center_z,radius,px,py,pz);
|
||||||
|
}
|
||||||
|
// Summon if dest location not present near caster
|
||||||
|
else
|
||||||
|
m_caster->GetClosePoint(px,py,pz,3.0f);
|
||||||
|
|
||||||
|
int32 duration = GetSpellDuration(m_spellInfo);
|
||||||
|
|
||||||
|
Creature* Charmed = m_caster->SummonCreature(m_spellInfo->EffectMiscValue[i], px, py, pz, m_caster->GetOrientation(),TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,duration);
|
||||||
|
if (!Charmed) // something fatal, not attempt more
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// might not always work correctly, maybe the creature that dies from CoD casts the effect on itself and is therefore the caster?
|
// might not always work correctly, maybe the creature that dies from CoD casts the effect on itself and is therefore the caster?
|
||||||
|
|
@ -6396,6 +6424,7 @@ void Spell::EffectSummonDemon(uint32 i)
|
||||||
// Inferno effect
|
// Inferno effect
|
||||||
Charmed->CastSpell(Charmed, 22703, true, 0);
|
Charmed->CastSpell(Charmed, 22703, true, 0);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* There is currently no need for this effect. We handle it in BattleGround.cpp
|
/* There is currently no need for this effect. We handle it in BattleGround.cpp
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "7489"
|
#define REVISION_NR "7490"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue