From 16b39c1ebf920ce0b290dfeaa617e59eba9abbfc Mon Sep 17 00:00:00 2001 From: balrok Date: Wed, 16 Dec 2009 14:52:24 +0100 Subject: [PATCH] [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 --- src/game/DBCStructure.h | 17 ++---- src/game/DBCfmt.h | 2 +- src/game/SpellAuras.cpp | 116 ++++++++++++++++---------------------- src/game/SpellHandler.cpp | 1 + src/game/Unit.h | 9 ++- src/shared/revision_nr.h | 2 +- 6 files changed, 65 insertions(+), 82 deletions(-) diff --git a/src/game/DBCStructure.h b/src/game/DBCStructure.h index 2e0ce9043..1fd3f3680 100644 --- a/src/game/DBCStructure.h +++ b/src/game/DBCStructure.h @@ -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 diff --git a/src/game/DBCfmt.h b/src/game/DBCfmt.h index 53667b17c..d6a8d48f5 100644 --- a/src/game/DBCfmt.h +++ b/src/game/DBCfmt.h @@ -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"; diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index f559e175e..993753eb3 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -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 diff --git a/src/game/SpellHandler.cpp b/src/game/SpellHandler.cpp index da998c78f..ce6b3f715 100644 --- a/src/game/SpellHandler.cpp +++ b/src/game/SpellHandler.cpp @@ -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; diff --git a/src/game/Unit.h b/src/game/Unit.h index 3f942586e..669916759 100644 --- a/src/game/Unit.h +++ b/src/game/Unit.h @@ -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 diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 48b666f1b..0eb20d595 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "9007" + #define REVISION_NR "9008" #endif // __REVISION_NR_H__