tarefas.lua

main 119 lines · 4.6 KB Raw
Alex Alex Commit Server upload 18/10/2026 23:38
1function onSay(player, words, param)
2 local BOX_ITEMS = {
3 [00] = {
4 [01] = {005000, 02, "Power Box #01", 01, 020};
5 [02] = {035000, 10, "Power Box #02", 01, 055};
6 [03] = {070000, 15, "Power Box #03", 02, 090};
7 [04] = {120000, 25, "Power Box #04", 03, 145};
8 [05] = {200000, 40, "Power Box #05", 03, 180};
9 };
10 -- 11, 20, 22, 29, 32, 42, 51, 53, 60, 61, 65
11 [01] = {10510, 10519, 10521, 10528, 10531, 10541, 10550, 10552, 10559, 10560, 10564};
12 -- 04, 06, 14, 19, 23, 35, 36, 37, 39, 40, 43 70
13 [02] = {10503, 10505, 10513, 10518, 10522, 10534, 10535, 10536, 10538, 10539, 10542, 10569};
14 -- 01, 02, 05, 07, 09, 13, 33, 41, 46, 52, 59 63
15 [03] = {10500, 10501, 10504, 10506, 10508, 10512, 10532, 10540, 10545, 10551, 10558, 10562};
16 -- 03, 12, 16, 17, 30, 44, 47, 55, 56, 58, 68
17 [04] = {10502, 10511, 10515, 10516, 10529, 10543, 10546, 10554, 10555, 10557, 10567};
18 -- 15, 21, 24, 25, 38, 45, 48, 49, 50, 66
19 [05] = {10514, 10520, 10523, 10524, 10537, 10544, 10547, 10548, 10549, 10565};
20 }
21 local split = param:splitTrimmed(" ")
22 local BOX_ID = tonumber(split[01])
23 local SaldoGold = PlayerGoldCoins(player, 00)
24 if _DEBUG_MODE then
25 print("[TALK - POWER BOX] " ..player:getName().. " - BoxID: " ..BOX_ID)
26 end
27
28 if _CHEATS.POWERBOX_GOLD_FREE == false then
29 if SaldoGold < BOX_ITEMS[00][BOX_ID][01] then
30 player:getPosition():sendMagicEffect(CONST_ME_POFF)
31
32 return false
33 end
34 end
35 if player:getLevel() < BOX_ITEMS[00][BOX_ID][05] then
36 player:getPosition():sendMagicEffect(CONST_ME_POFF)
37
38 return false
39 end
40 if _CHEATS.POWERBOX_TOKENS_FREE == false then
41 if BOX_ITEMS[00][BOX_ID][04] == 01 then
42 if player:getStorageValue(_SYSTEM.TASK[00].TASK_COIN_1) < BOX_ITEMS[00][BOX_ID][02] then
43 player:getPosition():sendMagicEffect(CONST_ME_POFF)
44
45 return false
46 end
47 elseif BOX_ITEMS[00][BOX_ID][04] == 02 then
48 if player:getStorageValue(_SYSTEM.TASK[00].TASK_COIN_2) < BOX_ITEMS[00][BOX_ID][02] then
49 player:getPosition():sendMagicEffect(CONST_ME_POFF)
50
51 return false
52 end
53 elseif BOX_ITEMS[00][BOX_ID][04] == 03 then
54 if player:getStorageValue(_SYSTEM.TASK[00].TASK_COIN_3) < BOX_ITEMS[00][BOX_ID][02] then
55 player:getPosition():sendMagicEffect(CONST_ME_POFF)
56
57 return false
58 end
59 end
60 end
61
62 local iid = BOX_ITEMS[BOX_ID][math.random(01, #BOX_ITEMS[BOX_ID])]
63 local slo = 03
64 local rar = _ITEMS[iid].RARE
65 local sta = 00
66 local qnt = 01
67 local ext = 00
68
69 if doBackpack(player, 00, slo, ext, 01) then
70 --doBackpack(player, 03, slo, ext, 01, iid) -- Procurar
71 if doBackpack(player, 01, slo, ext, 0, iid, rar, sta, qnt, true) then
72 player:getPosition():sendMagicEffect(14)
73 end
74
75 if player:getStorageValue(_QUESTLOG[32].UID_01) == 2 then
76 player:setStorageValue(_QUESTLOG[32].UID_01, 100)
77 player:setStorageValue(_QUESTLOG[76].UID_01, 01)
78 player:setStorageValue(_QUESTLOG[77].UID_01, 01)
79
80 player:getPosition():sendMagicEffect(14)
81 end
82 else
83 player:popupFYI("Sua Backpack esta cheia.")
84 player:getPosition():sendMagicEffect(03)
85 return false
86 end
87
88 if _CHEATS.POWERBOX_GOLD_FREE == false then
89 PlayerGoldCoins(player, 01, BOX_ITEMS[00][BOX_ID][01])
90 --player:setStorageValue(_SYSTEM.GOLD_COIN, player:getStorageValue(_SYSTEM.GOLD_COIN) - BOX_ITEMS[00][BOX_ID][01])
91 end
92 if _CHEATS.POWERBOX_TOKENS_FREE == false then
93 if BOX_ITEMS[00][BOX_ID][04] == 01 then
94 player:setStorageValue(_SYSTEM.TASK[00].TASK_COIN_1, player:getStorageValue(_SYSTEM.TASK[00].TASK_COIN_1) - BOX_ITEMS[00][BOX_ID][02])
95 elseif BOX_ITEMS[00][BOX_ID][04] == 02 then
96 player:setStorageValue(_SYSTEM.TASK[00].TASK_COIN_2, player:getStorageValue(_SYSTEM.TASK[00].TASK_COIN_2) - BOX_ITEMS[00][BOX_ID][02])
97 elseif BOX_ITEMS[00][BOX_ID][04] == 03 then
98 player:setStorageValue(_SYSTEM.TASK[00].TASK_COIN_3, player:getStorageValue(_SYSTEM.TASK[00].TASK_COIN_3) - BOX_ITEMS[00][BOX_ID][02])
99 end
100 end
101
102 -- DESAFIO
103 if player:getStorageValue(_DESAFIOS[00].DESAFIO_ID) > 00 then
104 if BOX_ID == 01 then
105 onPlayerDesafios(player, 49, 01)
106 elseif BOX_ID == 02 then
107 onPlayerDesafios(player, 50, 01)
108 elseif BOX_ID == 03 then
109 onPlayerDesafios(player, 51, 01)
110 elseif BOX_ID == 04 then
111 onPlayerDesafios(player, 52, 01)
112 elseif BOX_ID == 05 then
113 onPlayerDesafios(player, 53, 01)
114 end
115 end
116 doBackpack(player, 11)
117 return false
118end
119
Top