[10381] Implement generic system for racial model selection

Table creature_model_info store creature entry to use model from (or explicit model). The selection is based on a base modelId and racemask.

Hacks for shapeshift models removed (data included in SQL update)
Dropped no longer needed creature_model_info.modelid_other_team, as creature_model_info can and should be used instead (sorry, this is what happen when author doesn't do full research :) )

Signed-off-by: NoFantasy <nofantasy@nf.no>
This commit is contained in:
NoFantasy 2010-08-19 16:57:48 +02:00
parent 22b515718f
commit d0df25fd8c
13 changed files with 243 additions and 82 deletions

View file

@ -2779,39 +2779,18 @@ void Aura::HandleAuraModShapeshift(bool apply, bool Real)
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(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(target->getRace()) == HORDE)
// players are a bit different since the dbc has seldomly an horde modelid
if (Player::TeamForRace(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;
}
if (ssEntry->modelID_H)
modelid = ssEntry->modelID_H; // 3.2.3 only the moonkin form has this information
else // get model for race
modelid = sObjectMgr.GetModelForRace(ssEntry->modelID_A, target->getRaceMask());
}
// nothing found in above, so use default
if (!modelid)
modelid = ssEntry->modelID_A;
}
}