Core/Misc:
Clearing compile errors since UpdateFields were changed: - Completely remove ammo (Cataclysm change) - Revert some changes with power/maxpower and only store the 5 needed powers in db (the rest is useless) - Remove GuildId from corpse - Move PLAYER_GUILDID to character db (removed updatefield) Note: Compile is still not working as we need to change currency handling
This commit is contained in:
1 parent
9696d6ba7b
commit
ec54bb4895
22 files changed
+116
-383
No files matched your search
@@ -3738,8 +3738,6 @@ void Spell::SendSpellStart()
|
||||
if ((IsTriggered() && !m_spellInfo->IsAutoRepeatRangedSpell()) || m_triggeredByAuraSpell)
|
||||
castFlags |= CAST_FLAG_PENDING;
|
||||
|
||||
if (m_spellInfo->Attributes & SPELL_ATTR0_REQ_AMMO)
|
||||
castFlags |= CAST_FLAG_AMMO;
|
||||
if ((m_caster->GetTypeId() == TYPEID_PLAYER ||
|
||||
(m_caster->GetTypeId() == TYPEID_UNIT && m_caster->ToCreature()->isPet()))
|
||||
&& m_spellInfo->PowerType != POWER_HEALTH)
|
||||
@@ -3765,9 +3763,6 @@ void Spell::SendSpellStart()
|
||||
if (castFlags & CAST_FLAG_POWER_LEFT_SELF)
|
||||
data << uint32(m_caster->GetPower((Powers)m_spellInfo->PowerType));
|
||||
|
||||
if (castFlags & CAST_FLAG_AMMO)
|
||||
WriteAmmoToPacket(&data);
|
||||
|
||||
if (castFlags & CAST_FLAG_UNKNOWN_23)
|
||||
{
|
||||
data << uint32(0);
|
||||
@@ -3791,8 +3786,6 @@ void Spell::SendSpellGo()
|
||||
if ((IsTriggered() && !m_spellInfo->IsAutoRepeatRangedSpell()) || m_triggeredByAuraSpell)
|
||||
castFlags |= CAST_FLAG_PENDING;
|
||||
|
||||
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)
|
||||
@@ -3863,9 +3856,6 @@ void Spell::SendSpellGo()
|
||||
data << uint32(0);
|
||||
}
|
||||
|
||||
if (castFlags & CAST_FLAG_AMMO)
|
||||
WriteAmmoToPacket(&data);
|
||||
|
||||
if (castFlags & CAST_FLAG_UNKNOWN_20) // unknown wotlk
|
||||
{
|
||||
data << uint32(0);
|
||||
@@ -3880,78 +3870,6 @@ void Spell::SendSpellGo()
|
||||
m_caster->SendMessageToSet(&data, true);
|
||||
}
|
||||
|
||||
void Spell::WriteAmmoToPacket(WorldPacket* data)
|
||||
{
|
||||
uint32 ammoInventoryType = 0;
|
||||
uint32 ammoDisplayID = 0;
|
||||
|
||||
if (m_caster->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
Item* pItem = m_caster->ToPlayer()->GetWeaponForAttack(RANGED_ATTACK);
|
||||
if (pItem)
|
||||
{
|
||||
ammoInventoryType = pItem->GetTemplate()->InventoryType;
|
||||
if (ammoInventoryType == INVTYPE_THROWN)
|
||||
ammoDisplayID = pItem->GetTemplate()->DisplayInfoID;
|
||||
else
|
||||
{
|
||||
uint32 ammoID = m_caster->ToPlayer()->GetUInt32Value(PLAYER_AMMO_ID);
|
||||
if (ammoID)
|
||||
{
|
||||
ItemTemplate const* pProto = sObjectMgr->GetItemTemplate(ammoID);
|
||||
if (pProto)
|
||||
{
|
||||
ammoDisplayID = pProto->DisplayInfoID;
|
||||
ammoInventoryType = pProto->InventoryType;
|
||||
}
|
||||
}
|
||||
else if (m_caster->HasAura(46699)) // Requires No Ammo
|
||||
{
|
||||
ammoDisplayID = 5996; // normal arrow
|
||||
ammoInventoryType = INVTYPE_AMMO;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (uint8 i = 0; i < 3; ++i)
|
||||
{
|
||||
if (uint32 item_id = m_caster->GetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + i))
|
||||
{
|
||||
if (ItemEntry const* itemEntry = sItemStore.LookupEntry(item_id))
|
||||
{
|
||||
if (itemEntry->Class == ITEM_CLASS_WEAPON)
|
||||
{
|
||||
switch (itemEntry->SubClass)
|
||||
{
|
||||
case ITEM_SUBCLASS_WEAPON_THROWN:
|
||||
ammoDisplayID = itemEntry->DisplayId;
|
||||
ammoInventoryType = itemEntry->InventoryType;
|
||||
break;
|
||||
case ITEM_SUBCLASS_WEAPON_BOW:
|
||||
case ITEM_SUBCLASS_WEAPON_CROSSBOW:
|
||||
ammoDisplayID = 5996; // is this need fixing?
|
||||
ammoInventoryType = INVTYPE_AMMO;
|
||||
break;
|
||||
case ITEM_SUBCLASS_WEAPON_GUN:
|
||||
ammoDisplayID = 5998; // is this need fixing?
|
||||
ammoInventoryType = INVTYPE_AMMO;
|
||||
break;
|
||||
}
|
||||
|
||||
if (ammoDisplayID)
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
*data << uint32(ammoDisplayID);
|
||||
*data << uint32(ammoInventoryType);
|
||||
}
|
||||
|
||||
void Spell::WriteSpellGoTargets(WorldPacket* data)
|
||||
{
|
||||
// This function also fill data for channeled spells:
|
||||
@@ -4319,8 +4237,6 @@ void Spell::TakeAmmo()
|
||||
m_caster->ToPlayer()->DestroyItemCount(pItem, count, true);
|
||||
}
|
||||
}
|
||||
else if (uint32 ammo = m_caster->ToPlayer()->GetUInt32Value(PLAYER_AMMO_ID))
|
||||
m_caster->ToPlayer()->DestroyItemCount(ammo, 1, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6136,46 +6052,6 @@ SpellCastResult Spell::CheckItems()
|
||||
case ITEM_SUBCLASS_WEAPON_GUN:
|
||||
case ITEM_SUBCLASS_WEAPON_BOW:
|
||||
case ITEM_SUBCLASS_WEAPON_CROSSBOW:
|
||||
{
|
||||
uint32 ammo = m_caster->ToPlayer()->GetUInt32Value(PLAYER_AMMO_ID);
|
||||
if (!ammo)
|
||||
{
|
||||
// Requires No Ammo
|
||||
if (m_caster->HasAura(46699))
|
||||
break; // skip other checks
|
||||
|
||||
return SPELL_FAILED_NO_AMMO;
|
||||
}
|
||||
|
||||
ItemTemplate const* ammoProto = sObjectMgr->GetItemTemplate(ammo);
|
||||
if (!ammoProto)
|
||||
return SPELL_FAILED_NO_AMMO;
|
||||
|
||||
if (ammoProto->Class != ITEM_CLASS_PROJECTILE)
|
||||
return SPELL_FAILED_NO_AMMO;
|
||||
|
||||
// check ammo ws. weapon compatibility
|
||||
switch (pItem->GetTemplate()->SubClass)
|
||||
{
|
||||
case ITEM_SUBCLASS_WEAPON_BOW:
|
||||
case ITEM_SUBCLASS_WEAPON_CROSSBOW:
|
||||
if (ammoProto->SubClass != ITEM_SUBCLASS_ARROW)
|
||||
return SPELL_FAILED_NO_AMMO;
|
||||
break;
|
||||
case ITEM_SUBCLASS_WEAPON_GUN:
|
||||
if (ammoProto->SubClass != ITEM_SUBCLASS_BULLET)
|
||||
return SPELL_FAILED_NO_AMMO;
|
||||
break;
|
||||
default:
|
||||
return SPELL_FAILED_NO_AMMO;
|
||||
}
|
||||
|
||||
if (!m_caster->ToPlayer()->HasItemCount(ammo, 1))
|
||||
{
|
||||
m_caster->ToPlayer()->SetUInt32Value(PLAYER_AMMO_ID, 0);
|
||||
return SPELL_FAILED_NO_AMMO;
|
||||
}
|
||||
}; break;
|
||||
case ITEM_SUBCLASS_WEAPON_WAND:
|
||||
break;
|
||||
default:
|
||||
|
||||
Reference in new issue
Block a user