forked from ornfelt/azerothcore_lua_scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDinklestone2.lua
More file actions
51 lines (48 loc) · 1.75 KB
/
Dinklestone2.lua
File metadata and controls
51 lines (48 loc) · 1.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
function OnGossipHello(event, player, item)
if player:GetLevel() < 15 then
player:SendBroadcastMessage("You need to be level 15 or higher to use this item.")
return
end
player:GossipMenuAddItem(0, "|TInterface\\icons\\achievement_boss_lichking:37:37:-23|t|cff007d45Scourge Event|r", 150, 0)
player:GossipSendMenu(1, item)
end
local function OnGossipSelect(event, player, item, sender, intid, code)
if (sender == 150) then
-- Show Scourge Event menu
player:GossipMenuAddItem(0, "|TInterface\\icons\\spell_misc_emotionhappy:37:37:-23|t|cff007d45Start Event for Bonus Lich Runes|r", 100, 0)
player:GossipMenuAddItem(0, "|TInterface\\icons\\spell_misc_emotionsad:37:37:-23|t|cffC41F3BStop Event but Suffer|r", 101, 0)
player:GossipMenuAddItem(0, "Back", 0, 0)
player:GossipSendMenu(1, item)
return
elseif (sender == 100) then
-- Start the event
if IsGameEventActive(17) then
player:SendBroadcastMessage("The Scourge event is already active.")
else
player:AddItem(43949, 2)
StartGameEvent(17, true)
player:PlayDirectSound(14797)
end
player:GossipComplete()
elseif (sender == 101) then
-- Stop the event
if not IsGameEventActive(17) then
player:SendBroadcastMessage("The Scourge event is not currently active.")
else
StopGameEvent(17, true)
player:CastSpell(player, 15007, true)
player:RemoveItem(43949, 2)
player:SetLevel(player:GetLevel())
player:SendBroadcastMessage("2 Lich Runes have been removed, you've been given Resurrection Sickness and have lost your current level's experience progress. So sad :(")
player:PlayDirectSound(14776)
end
player:GossipComplete()
elseif (sender == 0) then
-- return to main menu
OnGossipHello(event, player, item)
return
end
player:GossipComplete()
end
RegisterItemGossipEvent(65001, 1, OnGossipHello)
RegisterItemGossipEvent(65001, 2, OnGossipSelect)