Core/Spells: Use ShapeshiftForm model IDs from DBC instead of as hardcoded values - fix by Kaelima

(Some shapeshifts need overrides due to missing DBC data, and needs hardcoding - already handled)
Closes issue 4832.

--HG--
branch : trunk
This commit is contained in:
click
2010-11-17 18:15:49 +01:00
parent 4fb572015a
commit 2e68705e22
4 changed files with 28 additions and 41 deletions
+2 -2
View File
@@ -1610,8 +1610,8 @@ struct SpellShapeshiftEntry
int32 creatureType; // 20 <= 0 humanoid, other normal creature types int32 creatureType; // 20 <= 0 humanoid, other normal creature types
//uint32 unk1; // 21 unused //uint32 unk1; // 21 unused
uint32 attackSpeed; // 22 uint32 attackSpeed; // 22
//uint32 modelID; // 23 unused, alliance modelid (where horde case?) uint32 modelID_A; // 23 alliance modelid
//uint32 unk2; // 24 unused uint32 modelID_H; // 24 horde modelid (only one form)
//uint32 unk3; // 25 unused //uint32 unk3; // 25 unused
//uint32 unk4; // 26 unused //uint32 unk4; // 26 unused
uint32 stanceSpell[MAX_SHAPESHIFT_SPELLS]; // 27 - 34 unused uint32 stanceSpell[MAX_SHAPESHIFT_SPELLS]; // 27 - 34 unused
+1 -1
View File
@@ -101,7 +101,7 @@ const char SpellItemEnchantmentConditionfmt[]="nbbbbbxxxxxbbbbbbbbbbiiiiiXXXXX";
const char SpellRadiusfmt[]="nfxf"; const char SpellRadiusfmt[]="nfxf";
const char SpellRangefmt[]="nffffixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; const char SpellRangefmt[]="nffffixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
const char SpellRuneCostfmt[]="niiii"; const char SpellRuneCostfmt[]="niiii";
const char SpellShapeshiftfmt[]="nxxxxxxxxxxxxxxxxxxiixixxxxiiiiiiii"; const char SpellShapeshiftfmt[]="nxxxxxxxxxxxxxxxxxxiixiiixxiiiiiiii";
const char StableSlotPricesfmt[] = "ni"; const char StableSlotPricesfmt[] = "ni";
const char SummonPropertiesfmt[] = "niiiii"; const char SummonPropertiesfmt[] = "niiiii";
const char TalentEntryfmt[]="niiiiiiiixxxxixxixxxxxx"; const char TalentEntryfmt[]="niiiiiiiixxxxixxixxxxxx";
+22 -36
View File
@@ -16340,51 +16340,37 @@ uint32 Unit::GetModelForForm(ShapeshiftForm form)
return 2281; return 2281;
else else
return 2289; return 2289;
case FORM_THARONJA_SKELETON:
return 1034;
case FORM_STEVES_GHOUL:
return 128;
case FORM_AMBIENT:
return 328;
case FORM_ZOMBIE:
return 26942;
case FORM_TRAVEL:
return 918;
case FORM_AQUA:
return 2428;
case FORM_GHOUL:
return 25527;
case FORM_CREATUREBEAR:
return 2281;
case FORM_CREATURECAT:
return 892;
case FORM_GHOSTWOLF:
return 4613;
case FORM_FLIGHT: case FORM_FLIGHT:
if (Player::TeamForRace(getRace()) == ALLIANCE) if (Player::TeamForRace(getRace()) == ALLIANCE)
return 20857; return 20857;
else
return 20872; return 20872;
case FORM_MOONKIN:
if (Player::TeamForRace(getRace()) == ALLIANCE)
return 15374;
else
return 15375;
case FORM_FLIGHT_EPIC: case FORM_FLIGHT_EPIC:
if (Player::TeamForRace(getRace()) == ALLIANCE) if (Player::TeamForRace(getRace()) == ALLIANCE)
return 21243; return 21243;
else
return 21244; return 21244;
case FORM_METAMORPHOSIS:
return 25277;
case FORM_MASTER_ANGLER:
return 17170;
case FORM_TREE:
return 864;
case FORM_SPIRITOFREDEMPTION:
return 16031;
default: default:
break; {
uint32 modelid = 0;
SpellShapeshiftEntry const* formEntry = sSpellShapeshiftStore.LookupEntry(form);
if (formEntry && formEntry->modelID_A)
{
// Take the alliance modelid as default
if (GetTypeId() != TYPEID_PLAYER)
return formEntry->modelID_A;
else
{
if (Player::TeamForRace(getRace()) == ALLIANCE)
modelid = formEntry->modelID_A;
else
modelid = formEntry->modelID_H;
// If the player is horde but there are no values for the horde modelid - take the alliance modelid
if (!modelid && Player::TeamForRace(getRace()) == HORDE)
modelid = formEntry->modelID_A;
}
}
return modelid;
}
} }
return 0; return 0;
} }
@@ -2942,6 +2942,7 @@ void AuraEffect::HandleAuraModShapeshift(AuraApplication const * aurApp, uint8 m
uint32 modelid = 0; uint32 modelid = 0;
Powers PowerType = POWER_MANA; Powers PowerType = POWER_MANA;
ShapeshiftForm form = ShapeshiftForm(GetMiscValue()); ShapeshiftForm form = ShapeshiftForm(GetMiscValue());
switch(form) switch(form)
{ {
case FORM_CAT: case FORM_CAT: