stoneharry

Untitled

Jan 3rd, 2012
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.75 KB | None | 0 0
  1. ------------------------------------------
  2.  
  3. local GBVOERMoonwellTriggerZCA = nil
  4. local BIERBEDPedestralTriggerEVR = nil
  5. local OVIRVEWRVEMoonWellGetDistanceOMGZWE = nil
  6. local player = nil
  7.  
  8. local BRVCMoonwellTrigger_UnitEntryIDZCE = 90000
  9. local ICOQPedestralTrigger_QWCUnitEntryIDBVREVR = 90001
  10.  
  11. local VRSVSR_EmptyBottle_HCEEItemEntryID = 12814
  12. local NRTBRT_FilledBottle_WQEQItemEntryID = 9321
  13.  
  14. ----------- On Spawn Functions -----------
  15.  
  16. function BUVIOERZZ_MoonwellTriggerCEAC_OnSpawnCAECAE(pUnit, event)
  17.     GBVOERMoonwellTriggerZCA = pUnit
  18. end
  19.  
  20. function ERBEHRIO_PedestralTriggerBERV_OnSpawnNCEAIO(pUnit, event)
  21.     BIERBEDPedestralTriggerEVR = pUnit
  22. end
  23.  
  24. RegisterUnitEvent(BRVCMoonwellTrigger_UnitEntryIDZCE, 18, "BUVIOERZZ_MoonwellTriggerCEAC_OnSpawnCAECAE")
  25. RegisterUnitEvent(ICOQPedestralTrigger_QWCUnitEntryIDBVREVR, 18, "ERBEHRIO_PedestralTriggerBERV_OnSpawnNCEAIO")
  26.  
  27. ----------- OnItemUse Functions -----------
  28.  
  29. function IOHWQEVWQEV_CEACEmptyBottleItem_CIEAOnUse(pItem, event, player)
  30.     if (GBVOERMoonwellTriggerZCA ~= nil) then
  31.     local OVIRVEWRVEMoonWellGetDistanceOMGZWE = player:GetDistanceYards(GBVOERMoonwellTriggerZCA)
  32.         if (OVIRVEWRVEMoonWellGetDistanceOMGZWE ~= nil and OVIRVEWRVEMoonWellGetDistanceOMGZWE <= 6) then
  33.             player:RemoveItem(VRSVSR_EmptyBottle_HCEEItemEntryID, 1)
  34.             player:AddItem(NRTBRT_FilledBottle_WQEQItemEntryID, 1)
  35.             player:CastSpell(69665)
  36.                 if (player:HasQuest(90000) == true) then
  37.                     player:AdvanceQuestObjective(90000, 0)
  38.                 end
  39.                 player = nil
  40.         else
  41.             player:SendAreaTriggerMessage("|CFFff0000You need to be inside the Moonwell!|R")
  42.         end
  43.     end
  44. end
  45.  
  46. RegisterItemGossipEvent(VRSVSR_EmptyBottle_HCEEItemEntryID, 1, "IOHWQEVWQEV_CEACEmptyBottleItem_CIEAOnUse")
  47.  
  48. function ERBCWQECWE_FilledBottleItem_IOEVVOnUse(pItem, event, player)
  49.     if (BIERBEDPedestralTriggerEVR ~= nil) then
  50.         local AOCIHAECIAEPedestralGetDistanceIOBWCEwe = player:GetDistance(BIERBEDPedestralTriggerEVR)
  51.             if (AOCIHAECIAEPedestralGetDistanceIOBWCEwe ~= nil and AOCIHAECIAEPedestralGetDistanceIOBWCEwe <= 10) then
  52.                 player:CastSpellAoF(7997.309082, -2483.291992, 493.005646, 51661)
  53.                 BIERBEDPedestralTriggerEVR:SpawnGameObject(225505, 7997.424316, -2483.240234, 492.981659, 0.099132, 6000, 100)
  54.                 BIERBEDPedestralTriggerEVR:SpawnGameObject(183812, 7997.424316, -2483.240234, 492.981659, 0.099132, 6000, 100)
  55.                 player:RemoveItem(NRTBRT_FilledBottle_WQEQItemEntryID, 1)
  56.                     if (player:HasQuest(90000) == true) then
  57.                         player:AdvanceQuestObjective(90000, 1)
  58.                     end
  59.             else
  60.                 player:SendAreaTriggerMessage("|CFFff0000You need to be near Blessed Pedestral!|R")
  61.             end
  62.     end
  63. end
  64.  
  65. RegisterItemGossipEvent(NRTBRT_FilledBottle_WQEQItemEntryID, 1, "ERBCWQECWE_FilledBottleItem_IOEVVOnUse")
  66.  
  67. ----------- End Of The Script ----------- :)
Advertisement
Add Comment
Please, Sign In to add comment