*Update summon system.

*Fix the bug that shaman cannot summon fire elemental.
*Fix the bug that totem meters cannot be displayed.

--HG--
branch : trunk
This commit is contained in:
megamage
2009-05-02 19:24:22 -05:00
parent abe9b27ee4
commit 122d944945
12 changed files with 124 additions and 98 deletions

View File

@@ -3264,8 +3264,6 @@ void Spell::EffectSummonType(uint32 i)
if(!summon || !summon->isTotem())
return;
summon->SetOwner(m_originalCaster, true);
if(damage) // if not spell info, DB values used
{
summon->SetMaxHealth(damage);
@@ -3288,19 +3286,14 @@ void Spell::EffectSummonType(uint32 i)
case SUMMON_TYPE_MINIPET:
{
summon = m_caster->GetMap()->SummonCreature(entry, x, y, z, m_caster->GetOrientation(), properties, duration, m_originalCaster);
if(!summon)
if(!summon || !summon->HasSummonMask(SUMMON_MASK_MINION))
return;
summon->SetOwner(m_originalCaster, true);
summon->SetCreatorGUID(m_originalCaster->GetGUID());
summon->setFaction(m_originalCaster->getFaction());
//summon->InitPetCreateSpells(); // e.g. disgusting oozeling has a create spell as summon...
summon->SetMaxHealth(1);
summon->SetHealth(1);
summon->SetLevel(1);
summon->SetReactState(REACT_PASSIVE);
summon->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
summon->GetMotionMaster()->MoveTargetedHome();
@@ -3960,7 +3953,7 @@ void Spell::EffectTameCreature(uint32 /*i*/)
pet->SetUInt32Value(UNIT_FIELD_LEVEL, level);
// caster have pet now
m_caster->SetGuardian(pet, true);
m_caster->SetMinion(pet, true);
if(m_caster->GetTypeId() == TYPEID_PLAYER)
{
@@ -6440,7 +6433,7 @@ void Spell::SummonGuardian(uint32 entry, SummonPropertiesEntry const *properties
{
Unit *caster = m_originalCaster;
if(caster && caster->GetTypeId() == TYPEID_UNIT && ((Creature*)caster)->isTotem())
caster = caster->GetOwner();
caster = ((Totem*)caster)->GetOwner();
if(!caster)
return;