[svn] * Changed modelid_a/h(2) values to modelid1..4, display ids are no longer incorrectly chosen based on player faction. Patch provided by WarHead.

--HG--
branch : trunk
This commit is contained in:
w12x
2008-10-27 11:48:45 -05:00
parent 4cbc6f830a
commit fc77e2d761
7 changed files with 94 additions and 71 deletions
+13 -11
View File
@@ -56,21 +56,23 @@ void Totem::Update( uint32 time )
void Totem::Summon(Unit* owner)
{
sLog.outDebug("AddObject at Totem.cpp line 49");
CreatureInfo const *cinfo = GetCreatureInfo();
if (owner->GetTypeId()==TYPEID_PLAYER && cinfo)
{
if (uint32 modelid = cinfo->GetRandomValidModelId())
SetDisplayId(modelid);
else
{
sLog.outErrorDb("No displayid found for the totem with the entry %u! Can't summon it!", GetEntry());
return;
}
}
// Only add if a display exists.
sLog.outDebug("AddObject at Totem.cpp line 49");
SetInstanceId(owner->GetInstanceId());
owner->GetMap()->Add((Creature*)this);
// select totem model in dependent from owner team
CreatureInfo const *cinfo = GetCreatureInfo();
if(owner->GetTypeId()==TYPEID_PLAYER && cinfo)
{
if(((Player*)owner)->GetTeam()==HORDE)
SetDisplayId(cinfo->DisplayID_H);
else
SetDisplayId(cinfo->DisplayID_A);
}
WorldPacket data(SMSG_GAMEOBJECT_SPAWN_ANIM_OBSOLETE, 8);
data << GetGUID();
SendMessageToSet(&data,true);