/* Copyright (C) 2006 - 2008 ScriptDev2 * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* ScriptData SDName: cutom_item_scripts SD%Complete: 100 SDComment: Items for a range of different items. See content below (in script) SDCategory: Items EndScriptData */ /*##### # magneto Collector #####*/ #include "../../sc_defines.h" #include "../../../../../game/Player.h" #include "../../../../../game/Creature.h" #include "../../../../../game/Unit.h" #include "../../../../../game/Spell.h" #include "../../../../../shared/WorldPacket.h" /*##### # magneto Collector #####*/ bool ItemUse_item_magneto_collector(Player *player, Item* _Item, SpellCastTargets const& targets) { //allow use on creature id 21729 only if(((Creature*)targets.getUnitTarget())->GetEntry() == 21729) { return false; } // error player->SendEquipError(EQUIP_ERR_NONE,_Item,NULL); return true; } /* this is from Seline with some modifications from me bool ItemUse_item_magneto_collector(Player *player, Item* _Item, SpellCastTargets const& targets) { Quest *qinfo; //allow use on creature id 21729 only if(((Creature*)targets.getUnitTarget())->GetEntry() == 21729) { if(((Creature*)targets.getUnitTarget())->HasAura(37136, 0)) { player->KilledMonster(21729, ((Creature*)targets.getUnitTarget())->GetGUID()); return true; } else { qinfo->SrcSpell = 0; } return false; } // error player->SendEquipError(EQUIP_ERR_NONE,_Item,NULL); return true; } */ bool ItemUse_epl_stone(Player *player, Item* _Item, SpellCastTargets const& targets) { if ( (player->isAttacked()) && (player->isInFlight()) && (player->isDead()) && (player->IsMounted())) { player->SendEquipError(EQUIP_ERR_NOT_IN_COMBAT,_Item,NULL); return true; } else { player->RemoveSpellsCausingAura(SPELL_AURA_MOUNTED); player->TeleportTo(0, -13245,193,32,0); return false; } } void AddSC_custom_item_scripts() { Script *newscript; newscript = new Script; newscript->Name="item_magneto_collector"; newscript->pItemUse = ItemUse_item_magneto_collector; m_scripts[nrscripts++] = newscript; newscript = new Script; newscript->Name="epl_stone"; newscript->pItemUse = ItemUse_epl_stone; m_scripts[nrscripts++] = newscript; }