Changeset 123 for trunk/src/game/Totem.cpp
- Timestamp:
- 11/19/08 13:38:18 (17 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/game/Totem.cpp
r111 r123 57 57 void Totem::Summon(Unit* owner) 58 58 { 59 CreatureInfo const *cinfo = GetCreatureInfo(); 60 if (owner->GetTypeId()==TYPEID_PLAYER && cinfo) 61 { 62 if (uint32 modelid = cinfo->GetRandomValidModelId()) 63 SetDisplayId(modelid); 64 else 65 { 66 sLog.outErrorDb("No displayid found for the totem with the entry %u! Can't summon it!", GetEntry()); 67 return; 68 } 69 } 70 71 // Only add if a display exists. 59 72 sLog.outDebug("AddObject at Totem.cpp line 49"); 60 61 73 SetInstanceId(owner->GetInstanceId()); 62 74 owner->GetMap()->Add((Creature*)this); 63 64 // select totem model in dependent from owner team65 CreatureInfo const *cinfo = GetCreatureInfo();66 if(owner->GetTypeId()==TYPEID_PLAYER && cinfo)67 {68 if(((Player*)owner)->GetTeam()==HORDE)69 SetDisplayId(cinfo->DisplayID_H);70 else71 SetDisplayId(cinfo->DisplayID_A);72 }73 75 74 76 WorldPacket data(SMSG_GAMEOBJECT_SPAWN_ANIM_OBSOLETE, 8);