[9008] modelids for shapeshifts from dbc

this will correct some modelids:
form         old model, new model
FORM_TRAVEL: 632   --> 918      (now a bit smaller)
FORM_GHOUL:  10045 --> 25527    (whisp --> ghoul)
FORM_CREATUREBEAR: 902 --> 2281 (old brown horse -> bear)

implement shapeshift for spell 24347

this commit also
fix the errormessages with: "Race %u not found in DBC: wrong DBC files"
which were triggered from this code
and will fix the modelid for creature 2038
since it's also using a shapeshift aura and only got the horde-modelid

+ some new entries in ShapeshiftForm-enum
+ some research for the shapeshift.dbc
This commit is contained in:
balrok 2009-12-16 14:52:24 +01:00
parent 4b8664ab5a
commit 16b39c1ebf
6 changed files with 65 additions and 82 deletions

View file

@ -2923,86 +2923,68 @@ void Aura::HandleAuraModShapeshift(bool apply, bool Real)
uint32 modelid = 0;
Powers PowerType = POWER_MANA;
ShapeshiftForm form = ShapeshiftForm(m_modifier.m_miscvalue);
SpellShapeshiftEntry const* ssEntry = sSpellShapeshiftStore.LookupEntry(form);
if(ssEntry && ssEntry->modelID_A)
{
// i will asume that creatures will always take the defined model from the dbc
// since no field in creature_templates describes wether an alliance or
// horde modelid should be used at shapeshifting
if (m_target->GetTypeId() != TYPEID_PLAYER)
modelid = ssEntry->modelID_A;
else
{
// players are a bit difficult since the dbc has seldomly an horde modelid
// so we add hacks here to set the right model
if (Player::TeamForRace(m_target->getRace()) == ALLIANCE)
modelid = ssEntry->modelID_A;
else // 3.2.3 only the moonkin form has this information
modelid = ssEntry->modelID_H;
// no model found, if player is horde we look here for our hardcoded modelids
if (!modelid && Player::TeamForRace(m_target->getRace()) == HORDE)
{
switch(form)
{
case FORM_CAT:
modelid = 8571;
break;
case FORM_BEAR:
case FORM_DIREBEAR:
modelid = 2289;
break;
case FORM_FLIGHT:
modelid = 20872;
break;
case FORM_FLIGHT_EPIC:
modelid = 21244;
break;
// per default use alliance modelid
// mostly horde and alliance share the same
default:
modelid = ssEntry->modelID_A;
break;
}
}
}
}
// now only powertype must be set
switch(form)
{
case FORM_CAT:
if(Player::TeamForRace(m_target->getRace()) == ALLIANCE)
modelid = 892;
else
modelid = 8571;
PowerType = POWER_ENERGY;
break;
case FORM_TRAVEL:
modelid = 632;
break;
case FORM_AQUA:
if(Player::TeamForRace(m_target->getRace()) == ALLIANCE)
modelid = 2428;
else
modelid = 2428;
break;
case FORM_BEAR:
if(Player::TeamForRace(m_target->getRace()) == ALLIANCE)
modelid = 2281;
else
modelid = 2289;
PowerType = POWER_RAGE;
break;
case FORM_GHOUL:
if(Player::TeamForRace(m_target->getRace()) == ALLIANCE)
modelid = 10045;
break;
case FORM_DIREBEAR:
if(Player::TeamForRace(m_target->getRace()) == ALLIANCE)
modelid = 2281;
else
modelid = 2289;
PowerType = POWER_RAGE;
break;
case FORM_CREATUREBEAR:
modelid = 902;
break;
case FORM_GHOSTWOLF:
modelid = 4613;
break;
case FORM_FLIGHT:
if(Player::TeamForRace(m_target->getRace()) == ALLIANCE)
modelid = 20857;
else
modelid = 20872;
break;
case FORM_MOONKIN:
if(Player::TeamForRace(m_target->getRace()) == ALLIANCE)
modelid = 15374;
else
modelid = 15375;
break;
case FORM_FLIGHT_EPIC:
if(Player::TeamForRace(m_target->getRace()) == ALLIANCE)
modelid = 21243;
else
modelid = 21244;
break;
case FORM_METAMORPHOSIS:
modelid = 25277;
break;
case FORM_AMBIENT:
case FORM_SHADOW:
case FORM_STEALTH:
break;
case FORM_TREE:
modelid = 864;
break;
case FORM_BATTLESTANCE:
case FORM_BERSERKERSTANCE:
case FORM_DEFENSIVESTANCE:
PowerType = POWER_RAGE;
break;
case FORM_SPIRITOFREDEMPTION:
modelid = 16031;
break;
default:
sLog.outError("Auras: Unknown Shapeshift Type: %u, SpellId %u.", m_modifier.m_miscvalue, GetId());
break;
}
// remove polymorph before changing display id to keep new display id