[8096] Fixed dummy effect for 34665

* Removed dynamic cast
* Little effect code clean up

Signed-off-by: ApoC <apoc@nymfe.net>
This commit is contained in:
ApoC 2009-06-29 19:37:32 +02:00 committed by tomrus88
parent 81d0e303d2
commit 2d33a8d220
2 changed files with 15 additions and 22 deletions

View file

@ -1042,32 +1042,25 @@ void Spell::EffectDummy(uint32 i)
{ {
if(!unitTarget || m_caster->GetTypeId() != TYPEID_PLAYER ) if(!unitTarget || m_caster->GetTypeId() != TYPEID_PLAYER )
return; return;
// Spell has scriptable target but for sure.
if(!unitTarget) if (unitTarget->GetTypeId() != TYPEID_UNIT)
return; return;
TemporarySummon* tempSummon = dynamic_cast<TemporarySummon*>(unitTarget); uint32 health = unitTarget->GetHealth();
if(!tempSummon) float x, y, z, o;
return;
uint32 health = tempSummon->GetHealth(); unitTarget->GetPosition(x, y, z);
o = unitTarget->GetOrientation();
((Creature*)unitTarget)->ForcedDespawn();
float x = tempSummon->GetPositionX(); if (Creature* summon = m_caster->SummonCreature(16992, x, y, z, o,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,180000))
float y = tempSummon->GetPositionY(); {
float z = tempSummon->GetPositionZ(); summon->SetHealth(health);
float o = tempSummon->GetOrientation(); ((Player*)m_caster)->RewardPlayerAndGroupAtEvent(16992, summon);
tempSummon->UnSummon();
Creature* pCreature = m_caster->SummonCreature(16992, x, y, z, o,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,180000);
if (!pCreature)
return;
pCreature->SetHealth(health);
((Player*)m_caster)->RewardPlayerAndGroupAtEvent(16992, pCreature);
if (pCreature->AI())
pCreature->AI()->AttackStart(m_caster);
if (summon->AI())
summon->AI()->AttackStart(m_caster);
}
return; return;
} }
case 44997: // Converting Sentry case 44997: // Converting Sentry

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__ #ifndef __REVISION_NR_H__
#define __REVISION_NR_H__ #define __REVISION_NR_H__
#define REVISION_NR "8095" #define REVISION_NR "8096"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__