[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

@ -1488,18 +1488,11 @@ struct SpellShapeshiftEntry
int32 creatureType; // 20 <=0 humanoid, other normal creature types
//uint32 unk1; // 21 unused
uint32 attackSpeed; // 22
//uint32 modelID; // 23 unused, alliance modelid (where horde case?)
//uint32 unk2; // 24 unused
//uint32 unk3; // 25 unused
//uint32 unk4; // 26 unused
//uint32 unk5; // 27 unused
//uint32 unk6; // 28 unused
//uint32 unk7; // 29 unused
//uint32 unk8; // 30 unused
//uint32 unk9; // 31 unused
//uint32 unk10; // 32 unused
//uint32 unk11; // 33 unused
//uint32 unk12; // 34 unused
uint32 modelID_A; // 23 alliance modelid (0 means no model)
uint32 modelID_H; // 24 horde modelid (but only for one form)
//uint32 unk3; // 25 unused always 0
//uint32 unk4; // 26 unused always 0
//uint32 spell[8]; // 27-34 unused, spells which appear in the bar after shapeshifting
};
struct SpellDurationEntry

View file

@ -91,7 +91,7 @@ const char SpellItemEnchantmentConditionfmt[]="nbbbbbxxxxxbbbbbbbbbbiiiiiXXXXX";
const char SpellRadiusfmt[]="nfxf";
const char SpellRangefmt[]="nffffxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
const char SpellRuneCostfmt[]="niiii";
const char SpellShapeshiftfmt[]="nxxxxxxxxxxxxxxxxxxiixixxxxxxxxxxxx";
const char SpellShapeshiftfmt[]="nxxxxxxxxxxxxxxxxxxiixiiixxxxxxxxxx";
const char StableSlotPricesfmt[] = "ni";
const char SummonPropertiesfmt[] = "niiiii";
const char TalentEntryfmt[]="niiiiiiiixxxxixxixxxxxx";

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

View file

@ -311,6 +311,7 @@ void WorldSession::HandleCastSpellOpcode(WorldPacket& recvPacket)
// not have spell in spellbook or spell passive and not casted by client
if (!((Player*)mover)->HasActiveSpell (spellId) || IsPassiveSpell(spellId) )
{
sLog.outError("World: Player %u casts spell %u which he shouldn't have", mover->GetGUIDLow(), spellId);
//cheater? kick? ban?
recvPacket.rpos(recvPacket.wpos()); // prevent spam at ignore packet
return;

View file

@ -173,6 +173,11 @@ enum ShapeshiftForm
FORM_AMBIENT = 0x06,
FORM_GHOUL = 0x07,
FORM_DIREBEAR = 0x08,
FORM_STEVES_GHOUL = 0x09,
FORM_THARONJA_SKELETON = 0x0A,
FORM_TEST_OF_STRENGTH = 0x0B,
FORM_BLB_PLAYER = 0x0C,
FORM_SHADOW_DANCE = 0x0D,
FORM_CREATUREBEAR = 0x0E,
FORM_CREATURECAT = 0x0F,
FORM_GHOSTWOLF = 0x10,
@ -182,12 +187,14 @@ enum ShapeshiftForm
FORM_TEST = 0x14,
FORM_ZOMBIE = 0x15,
FORM_METAMORPHOSIS = 0x16,
FORM_UNDEAD = 0x19,
FORM_FRENZY = 0x1A,
FORM_FLIGHT_EPIC = 0x1B,
FORM_SHADOW = 0x1C,
FORM_FLIGHT = 0x1D,
FORM_STEALTH = 0x1E,
FORM_MOONKIN = 0x1F,
FORM_SPIRITOFREDEMPTION = 0x20
FORM_SPIRITOFREDEMPTION = 0x20,
};
// low byte ( 0 from 0..3 ) of UNIT_FIELD_BYTES_2

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "9007"
#define REVISION_NR "9008"
#endif // __REVISION_NR_H__