Scripts/Deadmines: Fix OnUse hook usage, thanks zaphod, closes issue 3942.

Note: If you spot similar errors (forgotten changes for hooks) in other scripts, please report them

--HG--
branch : trunk
This commit is contained in:
Shocker
2010-09-13 01:59:09 +03:00
parent 4908187578
commit 61c11f8f9b
@@ -36,13 +36,13 @@ class item_defias_gunpowder : public ItemScript
public: public:
item_defias_gunpowder() : ItemScript("item_defias_gunpowder") { } item_defias_gunpowder() : ItemScript("item_defias_gunpowder") { }
bool ItemUse(Player* pPlayer, Item* pItem, SpellCastTargets const& targets) bool OnUse(Player* player, Item* item, SpellCastTargets const& targets)
{ {
InstanceScript *pInstance = pPlayer->GetInstanceScript(); InstanceScript *pInstance = player->GetInstanceScript();
if (!pInstance) if (!pInstance)
{ {
pPlayer->GetSession()->SendNotification("Instance script not initialized"); player->GetSession()->SendNotification("Instance script not initialized");
return true; return true;
} }
if (pInstance->GetData(EVENT_STATE)!= CANNON_NOT_USED) if (pInstance->GetData(EVENT_STATE)!= CANNON_NOT_USED)
@@ -53,7 +53,7 @@ public:
pInstance->SetData(EVENT_STATE, CANNON_GUNPOWDER_USED); pInstance->SetData(EVENT_STATE, CANNON_GUNPOWDER_USED);
} }
pPlayer->DestroyItemCount(pItem->GetEntry(), 1, true); player->DestroyItemCount(item->GetEntry(), 1, true);
return true; return true;
} }