-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPvEJetons.lua
More file actions
68 lines (63 loc) · 2.54 KB
/
Copy pathPvEJetons.lua
File metadata and controls
68 lines (63 loc) · 2.54 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
local NPC = 101023
local function OnGossipHello(event, player, object, unit)
local pName = player:GetName();
local pGuid = player:GetGUIDLow();
Query = CharDBQuery("SELECT JT1, JT2, JT3, JT4, JMM FROM characters WHERE guid = " .. pGuid ..";")
if(Query) then
repeat
local row = {
jt1 = Query:GetUInt32(0),
jt2 = Query:GetUInt32(1),
jt3 = Query:GetUInt32(2),
jt4 = Query:GetUInt32(3),
jmm = Query:GetUInt32(4)
}
if(row.jt1 == 0)then
player:GossipMenuAddItem(0, "|TInterface\\icons\\Ability_BossFelOrcs_Necromancer_Purple:40:40:-22:0|t Clef T1", 1, 1)
end
if(row.jt2 == 0)then
player:GossipMenuAddItem(0, "|TInterface\\icons\\Ability_BossFelOrcs_Necromancer_Green:40:40:-22:0|t Clef T2", 1, 2)
end
if(row.jt3 == 0)then
player:GossipMenuAddItem(0, "|TInterface\\icons\\Ability_BossFelOrcs_Necromancer_Orange:40:40:-22:0|t Clef T3", 1, 3)
end
-- if(row.jt4 == 0)then
-- player:GossipMenuAddItem(0, "|TInterface\\icons\\Ability_BossFelOrcs_Necromancer_Red:40:40:-22:0|t Clef T4", 1, 4)
-- end
-- if(row.jmm == 0)then
-- player:GossipMenuAddItem(0, "|TInterface\\icons\\Ability_BossFelOrcs_Necromancer_Blue:40:40:-22:0|t Clef Mythique", 1, 5)
-- end
until not Query:NextRow()
end
player:GossipSetText("Bonsoir " .. pName .. ", souhaitez vous récuperer vos jetons d'accès PvE quotidien ?" )
player:GossipSendMenu(0x7FFFFFFF, object, MenuId)
end
local function OnGossipSelect(event, player, object, sender, intid, code, menuid)
local pGuid = player:GetGUIDLow();
if(intid == 1)then
CharDBExecute("UPDATE characters SET JT1 = 1 WHERE guid = " .. pGuid ..";")
player:AddItem(3000004)
player:GossipComplete()
elseif(intid ==2)then
CharDBExecute("UPDATE characters SET JT2 = 1 WHERE guid = " .. pGuid ..";")
player:AddItem(3000005)
player:GossipComplete()
elseif(intid ==3)then
CharDBExecute("UPDATE characters SET JT3 = 1 WHERE guid = " .. pGuid ..";")
player:AddItem(3000006)
player:GossipComplete()
elseif(intid ==4)then
CharDBExecute("UPDATE characters SET JT4 = 1 WHERE guid = " .. pGuid ..";")
player:AddItem(3000007)
player:GossipComplete()
elseif(intid ==5)then
CharDBExecute("UPDATE characters SET JMM = 1 WHERE guid = " .. pGuid ..";")
player:AddItem(3000008)
player:GossipComplete()
end
object:SendUnitWhisper("Tenez ! Voila votre clef.", 0, player, true)
end
RegisterCreatureGossipEvent( NPC, 1, OnGossipHello )
RegisterCreatureGossipEvent( NPC, 2, OnGossipSelect )
local console = debug.getinfo (1, "S").short_src;
print("- "..console);