void EnchantWithSpell(Player* player, uint32 spell_id, Item* item) { SpellCastTargets* targets = new SpellCastTargets(); targets->SetItemTarget(item); player->CastSpell(*targets, sSpellMgr->GetSpellInfo(spell_id), NULL, TRIGGERED_IGNORE_POWER_AND_REAGENT_COST); }
void EnchantWithItem(Player* player, uint32 item_id, Item* target) { Item* item = PlayerAddItem(player, item_id); SpellCastTargets* targets = new SpellCastTargets(); targets->SetItemTarget(target); player->CastItemUseSpell(item, *targets, 1, 0); }