[9013] shapeshift spells

some shapeshift forms will give the player spells
so we need to tell the server that the player has those new
spells else he can't cast them since the server is thinking the player is
cheating

ps forms with spells:
FORM_GHOUL
FORM_THARONJA_SKELETON
FORM_TEST_OF_STRENGTH
FORM_BLB_PLAYER
FORM_TEST
FORM_ZOMBIE

--
so this mostly won't affect any ingame experience.. but good to have this
feature anyway.. :)

also changed errormessage if player has no reagents for spell..
thx to nofantasy
This commit is contained in:
balrok 2009-12-17 11:34:37 +01:00
parent 7c4acf31e2
commit 0502de55af
7 changed files with 33 additions and 12 deletions

View file

@ -2925,7 +2925,13 @@ void Aura::HandleAuraModShapeshift(bool apply, bool Real)
ShapeshiftForm form = ShapeshiftForm(m_modifier.m_miscvalue);
SpellShapeshiftEntry const* ssEntry = sSpellShapeshiftStore.LookupEntry(form);
if(ssEntry && ssEntry->modelID_A)
if (!ssEntry)
{
sLog.outError("Unknown shapeshift form %u in spell %u", form, GetId());
return;
}
if (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
@ -3112,6 +3118,14 @@ void Aura::HandleAuraModShapeshift(bool apply, bool Real)
m_target->m_ShapeShiftFormSpellId = GetId();
m_target->m_form = form;
// a form can give the player a new castbar with some spells.. this is a clientside process..
// serverside just needs to register the new spells so that player isn't kicked as cheater
if (m_target->GetTypeId() == TYPEID_PLAYER)
for (uint32 i = 0; i < 8; ++i)
if (ssEntry->spellId[i])
((Player*)m_target)->addSpell(ssEntry->spellId[i], true, false, false, false);
}
else
{
@ -3140,6 +3154,13 @@ void Aura::HandleAuraModShapeshift(bool apply, bool Real)
default:
break;
}
// look at the comment in apply-part
if (m_target->GetTypeId() == TYPEID_PLAYER)
for (uint32 i = 0; i < 8; ++i)
if (ssEntry->spellId[i])
((Player*)m_target)->removeSpell(ssEntry->spellId[i], false, false, false);
}
// adding/removing linked auras