aboutsummaryrefslogtreecommitdiff
path: root/src/game/Object.cpp
diff options
context:
space:
mode:
authormegamage <none@none>2009-05-06 13:34:11 -0500
committermegamage <none@none>2009-05-06 13:34:11 -0500
commitfa1dcd16cf8bc09cd0c0878020b59e7128e71d09 (patch)
tree46062e99b9b8494520351b83e8f71a8e77e2a818 /src/game/Object.cpp
parent5d3a64517eff8db5781f299ece29a338b6e2f7a2 (diff)
*Update summon system.
--HG-- branch : trunk
Diffstat (limited to 'src/game/Object.cpp')
-rw-r--r--src/game/Object.cpp16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/game/Object.cpp b/src/game/Object.cpp
index 7adc7d306bb..cb16a38baff 100644
--- a/src/game/Object.cpp
+++ b/src/game/Object.cpp
@@ -1658,8 +1658,9 @@ TempSummon *Map::SummonCreature(uint32 entry, float x, float y, float z, float a
return NULL;
}
+ summon->InitStats(duration);
Add((Creature*)summon);
- summon->InitSummon(duration);
+ summon->InitSummon();
//ObjectAccessor::UpdateObjectVisibility(summon);
@@ -1781,8 +1782,6 @@ Pet* Player::SummonPet(uint32 entry, float x, float y, float z, float ang, PetTy
// this enables pet details window (Shift+P)
pet->GetCharmInfo()->SetPetNumber(pet_number, false);
- map->Add((Creature*)pet);
-
pet->setPowerType(POWER_MANA);
pet->SetUInt32Value(UNIT_NPC_FLAGS , 0);
pet->SetUInt32Value(UNIT_FIELD_BYTES_1,0);
@@ -1801,6 +1800,17 @@ Pet* Player::SummonPet(uint32 entry, float x, float y, float z, float ang, PetTy
pet->SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, 1000);
pet->SetHealth(pet->GetMaxHealth());
pet->SetPower(POWER_MANA, pet->GetMaxPower(POWER_MANA));
+ break;
+ }
+
+ map->Add((Creature*)pet);
+
+ switch(petType)
+ {
+ case POSSESSED_PET:
+ pet->SetCharmedOrPossessedBy(this, true);
+ break;
+ case SUMMON_PET:
pet->InitPetCreateSpells();
pet->SavePetToDB(PET_SAVE_AS_CURRENT);
PetSpellInitialize();