*Add spell_bonus_data for lightwell - by Elron

*Add aura_required, aura_forbidden, user_type columns to npc_spellclick_spells table for additional requirement checks
*Remove workarounds from lightwell code and use new npc_spellclick_spells fields instead.

--HG--
branch : trunk
This commit is contained in:
QAston
2009-08-17 02:53:39 +02:00
parent 6359bfb27a
commit 41c12d173b
12 changed files with 145 additions and 115 deletions

View File

@@ -525,12 +525,12 @@ void WorldSession::HandleSpellClick( WorldPacket & recv_data )
SpellClickInfoMapBounds clickPair = objmgr.GetSpellClickInfoMapBounds(unit->GetEntry());
for(SpellClickInfoMap::const_iterator itr = clickPair.first; itr != clickPair.second; ++itr)
{
if(itr->second.IsFitToRequirements(_player))
if(itr->second.IsFitToRequirements(_player, unit))
{
Unit *caster = (itr->second.castFlags & 0x1) ? (Unit*)_player : (Unit*)unit;
Unit *target = (itr->second.castFlags & 0x2) ? (Unit*)_player : (Unit*)unit;
caster->CastSpell(target, itr->second.spellId, true);
Unit *caster = (itr->second.castFlags & NPC_CLICK_CAST_CASTER_PLAYER) ? (Unit*)_player : (Unit*)unit;
Unit *target = (itr->second.castFlags & NPC_CLICK_CAST_TARGET_PLAYER) ? (Unit*)_player : (Unit*)unit;
uint64 origCasterGUID = (itr->second.castFlags & NPC_CLICK_CAST_ORIG_CASTER_OWNER) ? unit->GetOwnerGUID() : 0;
caster->CastSpell(target, itr->second.spellId, true, NULL, NULL, origCasterGUID);
}
}