コード例 #1
0
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);
}
コード例 #2
0
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);
}