[11260] Add wrapper for creature vistual item set.

This commit is contained in:
VladimirMangos 2011-03-16 20:19:36 +03:00
parent a6d155fc54
commit b588ea9db3
6 changed files with 41 additions and 36 deletions

View file

@ -6311,13 +6311,10 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx)
if (Item* pItem = ((Player*)unitTarget)->GetWeaponForAttack(BASE_ATTACK))
{
if (const ItemEntry *dbcitem = sItemStore.LookupEntry(pItem->GetProto()->ItemId))
{
m_caster->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 0, dbcitem->ID);
((Creature*)m_caster)->SetVirtualItem(VIRTUAL_ITEM_SLOT_0, pItem->GetEntry());
// Unclear what this spell should do
unitTarget->CastSpell(m_caster, m_spellInfo->CalculateSimpleValue(eff_idx), true);
}
// Unclear what this spell should do
unitTarget->CastSpell(m_caster, m_spellInfo->CalculateSimpleValue(eff_idx), true);
}
return;
@ -6426,13 +6423,10 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx)
if (Item* pItem = ((Player*)unitTarget)->GetWeaponForAttack(OFF_ATTACK))
{
if (const ItemEntry *dbcitem = sItemStore.LookupEntry(pItem->GetProto()->ItemId))
{
m_caster->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1, dbcitem->ID);
((Creature*)m_caster)->SetVirtualItem(VIRTUAL_ITEM_SLOT_1, pItem->GetEntry());
// Unclear what this spell should do
unitTarget->CastSpell(m_caster, m_spellInfo->CalculateSimpleValue(eff_idx), true);
}
// Unclear what this spell should do
unitTarget->CastSpell(m_caster, m_spellInfo->CalculateSimpleValue(eff_idx), true);
}
return;