Core/Spell: Add some missing cast results which require additional data when sent. And rename two researched castflags (thanks TOMRUS)

This commit is contained in:
kaelima
2012-03-16 08:59:18 +01:00
parent dce0a7d184
commit ef53bde176
2 changed files with 27 additions and 10 deletions
+25 -8
View File
@@ -3751,12 +3751,12 @@ void Spell::SendCastResult(Player* caster, SpellInfo const* spellInfo, uint8 cas
case SPELL_FAILED_TOO_MANY_OF_ITEM:
{
uint32 item = 0;
for (int8 x = 0; x < 3; x++)
if (spellInfo->Effects[x].ItemType)
item = spellInfo->Effects[x].ItemType;
ItemTemplate const* pProto = sObjectMgr->GetItemTemplate(item);
if (pProto && pProto->ItemLimitCategory)
data << uint32(pProto->ItemLimitCategory);
for (int8 eff = 0; eff < MAX_SPELL_EFFECTS; eff++)
if (spellInfo->Effects[eff].ItemType)
item = spellInfo->Effects[eff].ItemType;
ItemTemplate const* proto = sObjectMgr->GetItemTemplate(item);
if (proto && proto->ItemLimitCategory)
data << uint32(proto->ItemLimitCategory);
break;
}
case SPELL_FAILED_CUSTOM_ERROR:
@@ -3783,6 +3783,23 @@ void Spell::SendCastResult(Player* caster, SpellInfo const* spellInfo, uint8 cas
data << uint32(missingItem); // first missing item
break;
}
case SPELL_FAILED_PREVENTED_BY_MECHANIC:
data << uint32(spellInfo->Mechanic);
break;
case SPELL_FAILED_NEED_EXOTIC_AMMO:
data << uint32(spellInfo->EquippedItemSubClassMask);
break;
case SPELL_FAILED_NEED_MORE_ITEMS:
data << uint32(0); // Item entry
data << uint32(0); // Count
break;
case SPELL_FAILED_MIN_SKILL:
data << uint32(0); // SkillLine.dbc Id
data << uint32(0); // Amount
break;
case SPELL_FAILED_FISHING_TOO_LOW:
data << uint32(0); // Skill level
break;
default:
break;
}
@@ -3856,6 +3873,7 @@ void Spell::SendSpellGo()
if (m_spellInfo->Attributes & SPELL_ATTR0_REQ_AMMO)
castFlags |= CAST_FLAG_AMMO; // arrows/bullets visual
if ((m_caster->GetTypeId() == TYPEID_PLAYER ||
(m_caster->GetTypeId() == TYPEID_UNIT && m_caster->ToCreature()->isPet()))
&& m_spellInfo->PowerType != POWER_HEALTH)
@@ -3868,7 +3886,6 @@ void Spell::SendSpellGo()
{
castFlags |= CAST_FLAG_UNKNOWN_19; // same as in SMSG_SPELL_START
castFlags |= CAST_FLAG_RUNE_LIST; // rune cooldowns list
castFlags |= CAST_FLAG_UNKNOWN_9; // ??
}
if (m_spellInfo->HasEffect(SPELL_EFFECT_ACTIVATE_RUNE))
@@ -3931,7 +3948,7 @@ void Spell::SendSpellGo()
if (castFlags & CAST_FLAG_AMMO)
WriteAmmoToPacket(&data);
if (castFlags & CAST_FLAG_UNKNOWN_20)
if (castFlags & CAST_FLAG_VISUAL_CHAIN)
{
data << uint32(0);
data << uint32(0);
+2 -2
View File
@@ -57,14 +57,14 @@ enum SpellCastFlags
CAST_FLAG_UNKNOWN_17 = 0x00010000,
CAST_FLAG_ADJUST_MISSILE = 0x00020000,
CAST_FLAG_UNKNOWN_19 = 0x00040000,
CAST_FLAG_UNKNOWN_20 = 0x00080000,
CAST_FLAG_VISUAL_CHAIN = 0x00080000,
CAST_FLAG_UNKNOWN_21 = 0x00100000,
CAST_FLAG_RUNE_LIST = 0x00200000,
CAST_FLAG_UNKNOWN_23 = 0x00400000,
CAST_FLAG_UNKNOWN_24 = 0x00800000,
CAST_FLAG_UNKNOWN_25 = 0x01000000,
CAST_FLAG_UNKNOWN_26 = 0x02000000,
CAST_FLAG_UNKNOWN_27 = 0x04000000,
CAST_FLAG_IMMUNITY = 0x04000000,
CAST_FLAG_UNKNOWN_28 = 0x08000000,
CAST_FLAG_UNKNOWN_29 = 0x10000000,
CAST_FLAG_UNKNOWN_30 = 0x20000000,