mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 07:37:01 +00:00
Merge commit 'origin/master' into 310
This commit is contained in:
commit
05b1bda879
20 changed files with 299 additions and 38 deletions
|
|
@ -2862,18 +2862,26 @@ void Spell::SendCastResult(SpellCastResult result)
|
|||
if(((Player*)m_caster)->GetSession()->PlayerLoading()) // don't send cast results at loading time
|
||||
return;
|
||||
|
||||
SendCastResult((Player*)m_caster,m_spellInfo,m_cast_count,result);
|
||||
}
|
||||
|
||||
void Spell::SendCastResult(Player* caster, SpellEntry const* spellInfo, uint8 cast_count, SpellCastResult result)
|
||||
{
|
||||
if(result == SPELL_CAST_OK)
|
||||
return;
|
||||
|
||||
WorldPacket data(SMSG_CAST_FAILED, (4+1+1));
|
||||
data << uint8(m_cast_count); // single cast or multi 2.3 (0/1)
|
||||
data << uint32(m_spellInfo->Id);
|
||||
data << uint8(cast_count); // single cast or multi 2.3 (0/1)
|
||||
data << uint32(spellInfo->Id);
|
||||
data << uint8(result); // problem
|
||||
switch (result)
|
||||
{
|
||||
case SPELL_FAILED_REQUIRES_SPELL_FOCUS:
|
||||
data << uint32(m_spellInfo->RequiresSpellFocus);
|
||||
data << uint32(spellInfo->RequiresSpellFocus);
|
||||
break;
|
||||
case SPELL_FAILED_REQUIRES_AREA:
|
||||
// hardcode areas limitation case
|
||||
switch(m_spellInfo->Id)
|
||||
switch(spellInfo->Id)
|
||||
{
|
||||
case 41617: // Cenarion Mana Salve
|
||||
case 41619: // Cenarion Healing Salve
|
||||
|
|
@ -2892,26 +2900,26 @@ void Spell::SendCastResult(SpellCastResult result)
|
|||
}
|
||||
break;
|
||||
case SPELL_FAILED_TOTEMS:
|
||||
if(m_spellInfo->Totem[0])
|
||||
data << uint32(m_spellInfo->Totem[0]);
|
||||
if(m_spellInfo->Totem[1])
|
||||
data << uint32(m_spellInfo->Totem[1]);
|
||||
if(spellInfo->Totem[0])
|
||||
data << uint32(spellInfo->Totem[0]);
|
||||
if(spellInfo->Totem[1])
|
||||
data << uint32(spellInfo->Totem[1]);
|
||||
break;
|
||||
case SPELL_FAILED_TOTEM_CATEGORY:
|
||||
if(m_spellInfo->TotemCategory[0])
|
||||
data << uint32(m_spellInfo->TotemCategory[0]);
|
||||
if(m_spellInfo->TotemCategory[1])
|
||||
data << uint32(m_spellInfo->TotemCategory[1]);
|
||||
if(spellInfo->TotemCategory[0])
|
||||
data << uint32(spellInfo->TotemCategory[0]);
|
||||
if(spellInfo->TotemCategory[1])
|
||||
data << uint32(spellInfo->TotemCategory[1]);
|
||||
break;
|
||||
case SPELL_FAILED_EQUIPPED_ITEM_CLASS:
|
||||
data << uint32(m_spellInfo->EquippedItemClass);
|
||||
data << uint32(m_spellInfo->EquippedItemSubClassMask);
|
||||
//data << uint32(m_spellInfo->EquippedItemInventoryTypeMask);
|
||||
data << uint32(spellInfo->EquippedItemClass);
|
||||
data << uint32(spellInfo->EquippedItemSubClassMask);
|
||||
//data << uint32(spellInfo->EquippedItemInventoryTypeMask);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
((Player*)m_caster)->GetSession()->SendPacket(&data);
|
||||
caster->GetSession()->SendPacket(&data);
|
||||
}
|
||||
|
||||
void Spell::SendSpellStart()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue