Server upload

RD Core / Commit #2

Commit Server upload

Alex Alex committed 18/10/2026 23:38 main Patch
1,106 files +223,404 -0
A data/talkactions/scripts/custom/trade.lua +177-0 View file
@@ -0,0 +1,177 @@
1+function onSay(player, words, param)
2+ local split = param:splitTrimmed("#")
3+ if _DEBUG_MODE then
4+ local _TYPE = {
5+ ["0"] = 'Convite para o Trade',
6+ ["1"] = 'Aceitando Convite para o Trade',
7+ ["2"] = 'Cancelando o Trade',
8+ ["3"] = 'Aguardando o Trade',
9+ ["4"] = 'Vendo se o alvo tem espa�o da Backpack',
10+ ["5"] = 'Enviando itens para o outro jogador',
11+ ["6"] = 'Fechando todas as janelas do Trade',
12+ ["7"] = 'Removendo item do Trade',
13+ ["8"] = 'Confirmando o Trade',
14+ ["9"] = 'Resetando o Trade',
15+ }
16+
17+ if _TYPE[split[01]] then
18+ print("[TALK - TRADE] " ..player:getName().. " - " .._TYPE[split[01]])
19+ else
20+ print("[TALK - TRADE] " ..player:getName().. " - " ..split[01])
21+ end
22+ end
23+ if split[01] == "0" then -- CONVITE PARA O TRADE
24+ local TRADER_NAME = split[02]
25+ local tid = Player(TRADER_NAME)
26+ if(not tid) then
27+ player:sendCancelMessage("@ClosedTrade")
28+ player:setStorageValue(_SYSTEM.PLAYER_TRADE_ACT, nil)
29+ player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. TRADER_NAME .. " not found.")
30+ return false
31+ end
32+
33+ player:setStorageValue(_SYSTEM.PLAYER_TRADE_ACT, getPlayerGUIDByName(tid:getName()))
34+ tid:sendTextMessage(MESSAGE_INFO_DESCR, "O Jogador(a) " .. player:getName().. " deseja iniciar uma Troca com voc�.")
35+ tid:sendCancelMessage("@InviteTrade-" ..player:getName())
36+
37+ elseif split[01] == "1" then -- ACEITANDO O CONVITE PARA TRADE
38+ local TRADER_NAME = split[02]
39+ local tid = Player(TRADER_NAME)
40+ if(not tid) then
41+ player:sendCancelMessage("@ClosedTrade")
42+ player:setStorageValue(_SYSTEM.PLAYER_TRADE_ACT, nil)
43+ player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. TRADER_NAME .. " not found.")
44+ return false
45+ end
46+
47+ player:setStorageValue(_SYSTEM.PLAYER_TRADE_ACT, getPlayerGUIDByName(tid:getName()))
48+ tid:sendCancelMessage("@AcceptTrade")
49+
50+ elseif split[01] == "2" then -- CANCELANDO TRADE
51+ local TRADER_NAME = split[02]
52+ local tid = Player(TRADER_NAME)
53+ if(not tid) then
54+ player:sendCancelMessage("@ClosedTrade")
55+ player:setStorageValue(_SYSTEM.PLAYER_TRADE_ACT, nil)
56+ player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. TRADER_NAME .. " not found.")
57+ return false
58+ end
59+
60+ player:setStorageValue(_SYSTEM.PLAYER_TRADE_ACT, nil)
61+ tid:setStorageValue(_SYSTEM.PLAYER_TRADE_ACT, nil)
62+ tid:sendCancelMessage("@ClosedTrade")
63+
64+ elseif split[01] == "3" then -- AGUARDANDO TRADE
65+ local TRADER_NAME = split[02]
66+ local tid = Player(TRADER_NAME)
67+ if(not tid) then
68+ player:sendCancelMessage("@ClosedTrade")
69+ player:setStorageValue(_SYSTEM.PLAYER_TRADE_ACT, nil)
70+ player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. TRADER_NAME .. " not found.")
71+ return false
72+ end
73+
74+ tid:sendCancelMessage("@WaitTrader")
75+
76+ elseif split[01] == "4" then -- CHECANDO SE O ALVO TEM ESPA�O SUFICIENTE NA BACKPACK
77+ local TRADER_NAME = split[02]
78+ local tid = Player(TRADER_NAME)
79+ if(not tid) then
80+ player:sendCancelMessage("@ClosedTrade")
81+ player:setStorageValue(_SYSTEM.PLAYER_TRADE_ACT, nil)
82+ player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. TRADER_NAME .. " not found.")
83+ return false
84+ end
85+
86+ tid:sendCancelMessage("@CheckEmpty-" ..player:getName())
87+
88+ elseif split[01] == "5" then -- ENVIANDO ITEMS PARA O OUTRO JOGADOR
89+ local TRADER_NAME = split[02]
90+ local tid = Player(TRADER_NAME)
91+ if(not tid) then
92+ player:setStorageValue(_SYSTEM.PLAYER_TRADE_ACT, nil)
93+ player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. TRADER_NAME .. " not found.")
94+ return false
95+ end
96+
97+ tid:sendCancelMessage("@TradeItems")
98+
99+ elseif split[01] == "6" then -- FECHANDO TODAS AS JANELAS DE TRADE
100+ local TRADER_NAME = split[02]
101+ local tid = Player(TRADER_NAME)
102+ if(not tid) then
103+ player:sendCancelMessage("@ClosedTrade")
104+ player:setStorageValue(_SYSTEM.PLAYER_TRADE_ACT, nil)
105+ player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. TRADER_NAME .. " not found.")
106+ return false
107+ end
108+
109+ tid:setStorageValue(_SYSTEM.PLAYER_TRADE_ACT, nil)
110+ player:setStorageValue(_SYSTEM.PLAYER_TRADE_ACT, nil)
111+ player:sendCancelMessage("@ClosedTrade")
112+ tid:sendCancelMessage("@ClosedTrade")
113+
114+ elseif split[01] == "7" then -- REMOVENDO ITEM DO TRADER
115+ local TRADER_NAME = split[02]
116+ local tid = Player(TRADER_NAME)
117+ if(not tid) then
118+ player:sendCancelMessage("@ClosedTrade")
119+ player:setStorageValue(_SYSTEM.PLAYER_TRADE_ACT, nil)
120+ player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. TRADER_NAME .. " not found.")
121+ return false
122+ end
123+
124+ tid:sendCancelMessage("@RefreshTradeItems " ..split[03])
125+
126+ elseif split[01] == "8" then -- ATUALIZANDO GOLD COINS
127+ local TRADER_NAME = split[02]
128+ local tid = Player(TRADER_NAME)
129+ if(not tid) then
130+ player:sendCancelMessage("@ClosedTrade")
131+ player:setStorageValue(_SYSTEM.PLAYER_TRADE_ACT, nil)
132+ player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. TRADER_NAME .. " not found.")
133+ return false
134+ end
135+
136+ tid:sendCancelMessage("@GoldAtualize " ..split[03].. " " ..split[04])
137+
138+
139+ elseif split[01] == "9" then -- CONFIRMANDO TRADE
140+ local TRADER_NAME = split[02]
141+ local tid = Player(TRADER_NAME)
142+ if(not tid) then
143+ player:sendCancelMessage("@ClosedTrade")
144+ player:setStorageValue(_SYSTEM.PLAYER_TRADE_ACT, nil)
145+ player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. TRADER_NAME .. " not found.")
146+ return false
147+ end
148+
149+ tid:sendCancelMessage("@CofirmTrade")
150+
151+ elseif split[01] == "10" then -- RESETANDO TRADE
152+ local TRADER_NAME = split[02]
153+ local tid = Player(TRADER_NAME)
154+ if(not tid) then
155+ player:sendCancelMessage("@ClosedTrade")
156+ player:setStorageValue(_SYSTEM.PLAYER_TRADE_ACT, nil)
157+ player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. TRADER_NAME .. " not found.")
158+ return false
159+ end
160+
161+ tid:sendCancelMessage("@ResetTrade")
162+
163+ elseif split[01] == "11" then -- MENSAGENS
164+ local MSG_TYPE = split[02]
165+
166+ if MSG_TYPE == "01" then
167+ player:popupFYI("Voc� n�o possui tanto gold coins.")
168+ elseif MSG_TYPE == "02" then
169+ player:popupFYI("Somente n�meros.")
170+ elseif MSG_TYPE == "03" then
171+ player:popupFYI("Voc� n�o possui tanto vip coins.")
172+ elseif MSG_TYPE == "04" then
173+ player:popupFYI("Limite de caracteres atingido.")
174+ end
175+ end
176+ return false
177+end
A data/talkactions/scripts/custom/upgrade.lua +428-0 View file
@@ -0,0 +1,428 @@
1+function onSay(player, words, param)
2+ local split = param:splitTrimmed(" ")
3+ local item_1, item_2, item_3, item_4, qnt_1, qnt_2, qnt_3, qnt_4, ext_1, ext_2, ext_3, ext_4, posb1, posb2, posb3, posb4 = false, false, false, false, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
4+ local oriqnt_1, oriqnt_2, oriqnt_3, oriqnt_4 = 0, 0, 0, 0
5+ if _DEBUG_MODE then
6+ print("[TALK - UPGRADE] " ..player:getName().. " - ItemID: " .._ITEMS[tonumber(split[02])].NAME)
7+ end
8+
9+ if split[01] == "00" then
10+ local PlayerCoin = PlayerGoldCoins(player, 00)
11+ local ITEM_ID = tonumber(split[02])
12+ local BAG_ID = tonumber(split[03])
13+ local EXT_ID = tonumber(split[04])
14+ local SLOT_ID = tonumber(split[05])
15+ local Temp_StarItem = tonumber(split[06])
16+ local LevelItem = tonumber(split[07])
17+ local IDENTIFICATION = tonumber(split[08])
18+ local target = tonumber(split[09])
19+ local sucessClick = tonumber(split[10])
20+ local rareGun = tonumber(split[11])
21+ for SearchItem = 01, 04 do
22+ local ProcurarID = 00
23+ local OriginQnt = 00
24+ local slot = 03
25+ local ext = 00
26+ if IDENTIFICATION == 01 then
27+ ProcurarID = _ITEMS[ITEM_ID].NUCLEO[01]
28+ OriginQnt = _ITEMS[ITEM_ID].NUCLEO[02]
29+ else
30+ ProcurarID = _ITEMS[ITEM_ID].UPGRADE[SearchItem][01]
31+ OriginQnt = _ITEMS[ITEM_ID].UPGRADE[SearchItem][02]
32+ end
33+
34+ local RARE_UPGRADE = {
35+ [-1] = 03,
36+ [00] = 03,
37+ [01] = 04,
38+ [02] = 05,
39+ [03] = 07,
40+ [04] = 10,
41+ }
42+
43+ doBackpack(player, 03, slot, ext, 01, ProcurarID) -- Procurar
44+ local QntBag = doBackpack(player, 04)
45+ local OrigTemp = 1
46+ --if Temp_StarItem < 1 then Temp_StarItem = 1 end
47+ --if LevelItem < 0 then LevelItem = 1 end
48+ if IDENTIFICATION == 01 then
49+ OrigTemp = OriginQnt--math.floor((OriginQnt * Temp_StarItem) / 2)
50+ else
51+ --print("((" ..OriginQnt.. " + 05) + " ..LevelItem.. ") * (" ..Temp_StarItem.. " + 01) + " ..RARE_UPGRADE[rareGun].. ")")
52+ OrigTemp = ((OriginQnt + 05) + LevelItem + 01) * (Temp_StarItem + 01) + RARE_UPGRADE[rareGun]
53+ --OrigTemp = math.floor((OriginQnt * (Temp_StarItem + 01) * (LevelItem + 01))) * 05
54+ end
55+ if OrigTemp < 1 then OrigTemp = 1 end
56+ local PosBag = doBackpack(player, 05)
57+ local ExtBag = doBackpack(player, 06)
58+
59+ if SearchItem == 01 then
60+ oriqnt_1 = OrigTemp
61+ elseif SearchItem == 02 then
62+ oriqnt_2 = OrigTemp
63+ elseif SearchItem == 03 then
64+ oriqnt_3 = OrigTemp
65+ elseif SearchItem == 04 then
66+ oriqnt_4 = OrigTemp
67+ end
68+ if _CHEATS.UPGRADE_ITEM_FREE then
69+ item_1 = true
70+ item_2 = true
71+ item_3 = true
72+ item_4 = true
73+ break
74+ else
75+ if ProcurarID > 0 then
76+ if QntBag >= OrigTemp then
77+ if SearchItem == 01 then
78+ item_1 = true
79+ qnt_1 = QntBag
80+ ext_1 = ExtBag
81+ posb1 = PosBag
82+ if IDENTIFICATION == 01 then
83+ item_2 = true
84+ item_3 = true
85+ item_4 = true
86+ break
87+ end
88+ elseif SearchItem == 02 then
89+ item_2 = true
90+ qnt_2 = QntBag
91+ ext_2 = ExtBag
92+ posb2 = PosBag
93+ elseif SearchItem == 03 then
94+ item_3 = true
95+ qnt_3 = QntBag
96+ ext_3 = ExtBag
97+ posb3 = PosBag
98+ elseif SearchItem == 04 then
99+ item_4 = true
100+ qnt_4 = QntBag
101+ ext_4 = ExtBag
102+ posb4 = PosBag
103+ end
104+ end
105+ else
106+ if SearchItem == 01 then
107+ item_1 = true
108+ elseif SearchItem == 02 then
109+ item_2 = true
110+ elseif SearchItem == 03 then
111+ item_3 = true
112+ elseif SearchItem == 04 then
113+ item_4 = true
114+ end
115+ end
116+ end
117+ end
118+
119+ if item_1 and item_2 and item_3 and item_4 then
120+ local ItemPrice = _ITEMS[ITEM_ID].UPGRADE[00][01]
121+ local YourChance = math.random(000, 100)
122+ local UpgradeCoin = math.floor(((ItemPrice * (Temp_StarItem + 01) * (LevelItem + 01))) * 25) * (rareGun + 01)
123+ local rateSucess = 95 - (((LevelItem + 02) * 02) + (Temp_StarItem * 20))
124+ rateSucess = rateSucess + ((sucessClick - 01) * 02)
125+ UpgradeCoin = UpgradeCoin * sucessClick
126+
127+ if _CHEATS.UPGRADE_COIN_FREE == false then
128+ --local UpgradeCoin = math.floor((ItemPrice * (Temp_StarItem/2)) + (LevelItem * (LevelItem * Temp_StarItem)))
129+ if PlayerCoin >= UpgradeCoin then
130+ PlayerGoldCoins(player, 01, UpgradeCoin)
131+ --player:setStorageValue(_SYSTEM.GOLD_COIN, (PlayerCoin - UpgradeCoin))
132+ else
133+ player:popupFYI("Voc� n�o possui dinheiro suficiente.")
134+ return false
135+ end
136+ end
137+ if _CHEATS.UPGRADE_ITEM_FREE == false then
138+ if qnt_1 > 0 then
139+ if qnt_1 > oriqnt_1 then
140+ player:setStorageValue(_BACKPACK[03][ext_1][posb1].UID_04, (qnt_1 - oriqnt_1))
141+ else
142+ doBackpack(player, 02, 03, ext_1, posb1)
143+ end
144+ end
145+ if qnt_2 > 0 then
146+ if qnt_2 > oriqnt_2 then
147+ player:setStorageValue(_BACKPACK[03][ext_2][posb2].UID_04, (qnt_2 - oriqnt_2))
148+ else
149+ doBackpack(player, 02, 03, ext_2, posb2)
150+ end
151+ end
152+ if qnt_3 > 0 then
153+ if qnt_3 > oriqnt_3 then
154+ player:setStorageValue(_BACKPACK[03][ext_3][posb3].UID_04, (qnt_3 - oriqnt_3))
155+ else
156+ doBackpack(player, 02, 03, ext_3, posb3)
157+ end
158+ end
159+ if qnt_4 > 0 then
160+ if qnt_4 > oriqnt_3 then
161+ player:setStorageValue(_BACKPACK[03][ext_4][posb4].UID_04, (qnt_4 - oriqnt_4))
162+ else
163+ doBackpack(player, 02, 03, ext_4, posb4)
164+ end
165+ end
166+ end
167+
168+ if YourChance <= rateSucess then
169+ if rateSucess > 100 then rateSucess = 100 end
170+ if IDENTIFICATION == 01 then -- STAR
171+ if SLOT_ID == 04 then
172+ if target == 00 then
173+ if player:getStorageValue(_SYSTEM.INVENTARIO[SLOT_ID].UID_03) < 00 then
174+ player:setStorageValue(_SYSTEM.INVENTARIO[SLOT_ID].UID_03, (player:getStorageValue(_SYSTEM.INVENTARIO[SLOT_ID].UID_03) + 2))
175+ else
176+ player:setStorageValue(_SYSTEM.INVENTARIO[SLOT_ID].UID_03, (player:getStorageValue(_SYSTEM.INVENTARIO[SLOT_ID].UID_03) + 1))
177+ end
178+ player:setStorageValue(_SYSTEM.INVENTARIO[SLOT_ID].UID_07, 0)
179+ else
180+ if player:getStorageValue(_BACKPACK[SLOT_ID][EXT_ID][BAG_ID].UID_03) < 00 then
181+ player:setStorageValue(_BACKPACK[SLOT_ID][EXT_ID][BAG_ID].UID_03, (player:getStorageValue(_BACKPACK[SLOT_ID][EXT_ID][BAG_ID].UID_03) + 2))
182+ else
183+ player:setStorageValue(_BACKPACK[SLOT_ID][EXT_ID][BAG_ID].UID_03, (player:getStorageValue(_BACKPACK[SLOT_ID][EXT_ID][BAG_ID].UID_03) + 1))
184+ end
185+ player:setStorageValue(_BACKPACK[SLOT_ID][EXT_ID][BAG_ID].UID_07, 0)
186+ end
187+ else
188+ if target == 00 then
189+ if player:getStorageValue(_SYSTEM.INVENTARIO[SLOT_ID].UID_03) < 00 then
190+ player:setStorageValue(_SYSTEM.INVENTARIO[SLOT_ID].UID_03, (player:getStorageValue(_SYSTEM.INVENTARIO[SLOT_ID].UID_03) + 2))
191+ else
192+ player:setStorageValue(_SYSTEM.INVENTARIO[SLOT_ID].UID_03, (player:getStorageValue(_SYSTEM.INVENTARIO[SLOT_ID].UID_03) + 1))
193+ end
194+ player:setStorageValue(_SYSTEM.INVENTARIO[SLOT_ID].UID_05, 0)
195+ else
196+ if player:getStorageValue(_BACKPACK[SLOT_ID][EXT_ID][BAG_ID].UID_03) < 00 then
197+ player:setStorageValue(_BACKPACK[SLOT_ID][EXT_ID][BAG_ID].UID_03, (player:getStorageValue(_BACKPACK[SLOT_ID][EXT_ID][BAG_ID].UID_03) + 2))
198+ else
199+ player:setStorageValue(_BACKPACK[SLOT_ID][EXT_ID][BAG_ID].UID_03, (player:getStorageValue(_BACKPACK[SLOT_ID][EXT_ID][BAG_ID].UID_03) + 1))
200+ end
201+ player:setStorageValue(_BACKPACK[SLOT_ID][EXT_ID][BAG_ID].UID_05, 0)
202+ end
203+ if player:getStorageValue(_QUESTLOG[75].UID_01) == 02 then
204+ player:setStorageValue(_QUESTLOG[75].UID_01, 100)
205+
206+ addEvent(function()
207+ PlayerGoldCoins(player, 02, 1000)
208+ player:addExperience(5000, true, true)
209+ player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Seu Quest Log foi atualizado.")
210+ player:getPosition():sendMagicEffect(14)
211+ player:sendCancelMessage("@LoadQuestWindows")
212+ end, 4000)
213+ end
214+ if player:getStorageValue(_QUESTLOG[102].UID_01) == 01 then
215+ if SLOT_ID == 01 then
216+ player:setStorageValue(_QUESTLOG[102].UID_01, 100)
217+
218+ addEvent(function()
219+ PlayerGoldCoins(player, 02, 10000)
220+ player:addExperience(55000, true, true)
221+ player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Seu Quest Log foi atualizado.")
222+ player:getPosition():sendMagicEffect(14)
223+ player:sendCancelMessage("@LoadQuestWindows")
224+ end, 3 * 1000)
225+ end
226+ end
227+ end
228+ player:popupFYI("Item aprimorado com sucesso.")
229+ else -- LEVEL
230+ local LevelItem = 0
231+ if target == 00 then
232+ LevelItem = player:getStorageValue(_SYSTEM.INVENTARIO[SLOT_ID].UID_05)
233+ else
234+ LevelItem = player:getStorageValue(_BACKPACK[SLOT_ID][EXT_ID][BAG_ID].UID_05)
235+ end
236+
237+ if SLOT_ID == 04 then
238+ if target == 00 then
239+ LevelItem = player:getStorageValue(_SYSTEM.INVENTARIO[SLOT_ID].UID_07)
240+ else
241+ LevelItem = player:getStorageValue(_BACKPACK[SLOT_ID][EXT_ID][BAG_ID].UID_07)
242+ end
243+ end
244+ if LevelItem < 0 then LevelItem = 0 end
245+ if SLOT_ID == 04 then
246+ if target == 00 then
247+ if player:getStorageValue(_SYSTEM.INVENTARIO[SLOT_ID].UID_07) < 00 then
248+ player:setStorageValue(_SYSTEM.INVENTARIO[SLOT_ID].UID_07, 01)
249+ else
250+ player:setStorageValue(_SYSTEM.INVENTARIO[SLOT_ID].UID_07, (LevelItem + 1))
251+ end
252+ else
253+ if player:getStorageValue(_BACKPACK[SLOT_ID][EXT_ID][BAG_ID].UID_07) < 00 then
254+ player:setStorageValue(_BACKPACK[SLOT_ID][EXT_ID][BAG_ID].UID_07, 01)
255+ else
256+ player:setStorageValue(_BACKPACK[SLOT_ID][EXT_ID][BAG_ID].UID_07, (LevelItem + 1))
257+ end
258+ end
259+
260+ -- DESAFIO
261+ if player:getStorageValue(_DESAFIOS[00].DESAFIO_ID) > 00 then
262+ if rareGun < 01 then
263+ onPlayerDesafios(player, 86, 01)
264+ elseif rareGun == 01 then
265+ onPlayerDesafios(player, 87, 01)
266+ elseif rareGun == 02 then
267+ onPlayerDesafios(player, 88, 01)
268+ elseif rareGun == 03 then
269+ onPlayerDesafios(player, 89, 01)
270+ elseif rareGun == 04 then
271+ onPlayerDesafios(player, 90, 01)
272+ end
273+ end
274+ else
275+ if target == 00 then
276+ if player:getStorageValue(_SYSTEM.INVENTARIO[SLOT_ID].UID_05) < 00 then
277+ player:setStorageValue(_SYSTEM.INVENTARIO[SLOT_ID].UID_05, 01)
278+ else
279+ player:setStorageValue(_SYSTEM.INVENTARIO[SLOT_ID].UID_05, (LevelItem + 1))
280+ end
281+ else
282+ if player:getStorageValue(_BACKPACK[SLOT_ID][EXT_ID][BAG_ID].UID_05) < 00 then
283+ player:setStorageValue(_BACKPACK[SLOT_ID][EXT_ID][BAG_ID].UID_05, 01)
284+ else
285+ player:setStorageValue(_BACKPACK[SLOT_ID][EXT_ID][BAG_ID].UID_05, (LevelItem + 1))
286+ end
287+ end
288+
289+ -- DESAFIO
290+ if player:getStorageValue(_DESAFIOS[00].DESAFIO_ID) > 00 then
291+ if rareGun < 01 then
292+ onPlayerDesafios(player, 81, 01)
293+ elseif rareGun == 01 then
294+ onPlayerDesafios(player, 82, 01)
295+ elseif rareGun == 02 then
296+ onPlayerDesafios(player, 83, 01)
297+ elseif rareGun == 03 then
298+ onPlayerDesafios(player, 84, 01)
299+ elseif rareGun == 04 then
300+ onPlayerDesafios(player, 85, 01)
301+ end
302+ end
303+ end
304+ if player:getStorageValue(_QUESTLOG[073].UID_01) == 03 then
305+ if target == 00 then
306+ player:setStorageValue(_QUESTLOG[73].UID_01, 100)
307+ player:setStorageValue(_QUESTLOG[74].UID_01, 01)
308+
309+ addEvent(function()
310+ player:addExperience(2000, true, true)
311+ player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Seu Quest Log foi atualizado.")
312+ player:getPosition():sendMagicEffect(14)
313+ player:sendCancelMessage("@LoadQuestWindows")
314+ end, 3 * 1000)
315+ else
316+ player:setStorageValue(_QUESTLOG[73].UID_01, 100)
317+ player:setStorageValue(_QUESTLOG[74].UID_01, 01)
318+
319+ addEvent(function()
320+ player:addExperience(2000, true, true)
321+ player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Seu Quest Log foi atualizado.")
322+ player:getPosition():sendMagicEffect(14)
323+ player:sendCancelMessage("@LoadQuestWindows")
324+ end, 3 * 1000)
325+ end
326+
327+ player:sendCancelMessage("@LoadQuestWindows")
328+ end
329+ if player:getStorageValue(_QUESTLOG[074].UID_01) == 01 then
330+ if target == 00 then
331+ if player:getStorageValue(_SYSTEM.INVENTARIO[SLOT_ID].UID_05) == 05 then
332+ player:setStorageValue(_QUESTLOG[74].UID_01, 100)
333+ --player:setStorageValue(_QUESTLOG[75].UID_01, 01)
334+
335+ addEvent(function()
336+ player:addExperience(10000, true, true)
337+ PlayerGoldCoins(player, 02, 2000)
338+ player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Seu Quest Log foi atualizado.")
339+ player:getPosition():sendMagicEffect(14)
340+ player:sendCancelMessage("@LoadQuestWindows")
341+ end, 3 * 1000)
342+ end
343+ else
344+ if player:getStorageValue(_BACKPACK[SLOT_ID][EXT_ID][BAG_ID].UID_05) == 05 then
345+ player:setStorageValue(_QUESTLOG[74].UID_01, 100)
346+ --player:setStorageValue(_QUESTLOG[75].UID_01, 01)
347+
348+ addEvent(function()
349+ player:addExperience(10000, true, true)
350+ PlayerGoldCoins(player, 02, 2000)
351+ player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Seu Quest Log foi atualizado.")
352+ player:getPosition():sendMagicEffect(14)
353+ player:sendCancelMessage("@LoadQuestWindows")
354+ end, 3 * 1000)
355+ end
356+ end
357+
358+ player:sendCancelMessage("@LoadQuestWindows")
359+ end
360+ if player:getStorageValue(_QUESTLOG[100].UID_01) == 01 then
361+ if target == 00 then
362+ if SLOT_ID == 01 then
363+ if player:getStorageValue(_SYSTEM.INVENTARIO[SLOT_ID].UID_05) > 0 then
364+ player:setStorageValue(_QUESTLOG[100].UID_01, 100)
365+ player:setStorageValue(_QUESTLOG[101].UID_01, 01)
366+ --player:setStorageValue(_QUESTLOG[102].UID_01, 01)
367+
368+ addEvent(function()
369+ player:addExperience(20000, true, true)
370+ player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Seu Quest Log foi atualizado.")
371+ player:getPosition():sendMagicEffect(14)
372+ player:sendCancelMessage("@LoadQuestWindows")
373+ end, 4000)
374+ end
375+ end
376+ else
377+ if SLOT_ID == 01 then
378+ if player:getStorageValue(_BACKPACK[SLOT_ID][EXT_ID][BAG_ID].UID_05) > 0 then
379+ player:setStorageValue(_QUESTLOG[100].UID_01, 100)
380+ player:setStorageValue(_QUESTLOG[101].UID_01, 01)
381+ --player:setStorageValue(_QUESTLOG[102].UID_01, 01)
382+
383+ addEvent(function()
384+ player:addExperience(20000, true, true)
385+ player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Seu Quest Log foi atualizado.")
386+ player:getPosition():sendMagicEffect(14)
387+ player:sendCancelMessage("@LoadQuestWindows")
388+ end, 4000)
389+ end
390+ end
391+ end
392+
393+ player:sendCancelMessage("@LoadQuestWindows")
394+ end
395+ player:popupFYI("Tentativa de upgrade com " ..rateSucess.. "% de chance de sucesso.\n\nItem aprimorado com sucesso.")
396+ end
397+
398+ player:sendCancelMessage("@AceptUpgrade")
399+ if target == 00 then
400+ doInventario(player, 00, SLOT_ID, EXT_ID)
401+ else
402+ doBackpack(player, 00, SLOT_ID, EXT_ID, 01)
403+ end
404+ if player:getStorageValue(_QUESTLOG[30].UID_01) == 2 then
405+ player:setStorageValue(_QUESTLOG[30].UID_01, 03)
406+
407+ player:getPosition():sendMagicEffect(14)
408+ player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Seu Quest Log foi atualizado.")
409+ end
410+ player:sendCancelMessage("@ReloadBackpack " ..SLOT_ID.. " 01")
411+
412+ doBackpack(player, 11)
413+ player:sendCancelMessage("@LoadTooltipInv")
414+ else
415+ player:sendCancelMessage("@AceptUpgrade")
416+ player:popupFYI("Tentativa de upgrade com " ..rateSucess.. "% de chance de sucesso.\n\nVoc� falhou em aprimorar este item.")
417+ player:sendCancelMessage("@ReloadBackpack " ..SLOT_ID.. " 01")
418+
419+ doBackpack(player, 11)
420+ player:sendCancelMessage("@LoadTooltipInv")
421+ end
422+ else
423+ player:popupFYI("Voc� n�o possui os itens necess�rios.")
424+ end
425+ end
426+
427+ return false
428+end
A data/talkactions/scripts/down.lua +10-0 View file
@@ -0,0 +1,10 @@
1+function onSay(player, words, param)
2+ if player:getGroup():getId() < 3 then
3+ return false
4+ end
5+
6+ local position = player:getPosition()
7+ position.z = position.z + 1
8+ player:teleportTo(position)
9+ return false
10+end
A data/talkactions/scripts/force_raid.lua +16-0 View file
@@ -0,0 +1,16 @@
1+function onSay(player, words, param)
2+ if player:getGroup():getId() < 3 then
3+ return false
4+ end
5+
6+ logCommand(player, words, param)
7+
8+ local returnValue = Game.startRaid(param)
9+ if returnValue ~= RETURNVALUE_NOERROR then
10+ player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, Game.getReturnMessage(returnValue))
11+ else
12+ player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Raid started.")
13+ end
14+
15+ return false
16+end
A data/talkactions/scripts/ghost.lua +19-0 View file
@@ -0,0 +1,19 @@
1+function onSay(player, words, param)
2+ if player:getGroup():getId() < 3 then
3+ return false
4+ end
5+
6+ local position = player:getPosition()
7+ local isGhost = not player:isInGhostMode()
8+
9+ player:setGhostMode(isGhost)
10+ if isGhost then
11+ player:sendTextMessage(MESSAGE_INFO_DESCR, "You are now invisible.")
12+ position:sendMagicEffect(CONST_ME_YALAHARIGHOST)
13+ else
14+ player:sendTextMessage(MESSAGE_INFO_DESCR, "You are visible again.")
15+ position.x = position.x + 1
16+ position:sendMagicEffect(CONST_ME_SMOKE)
17+ end
18+ return false
19+end
A data/talkactions/scripts/gstorage.lua +26-0 View file
@@ -0,0 +1,26 @@
1+function onSay(player, words, param)
2+ if player:getGroup():getId() < 3 then
3+ return false
4+ end
5+
6+ local t = param:splitTrimmed(" ")
7+ if(not t[1]) then
8+ player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Invalid param specified.")
9+ return false
10+ end
11+
12+ if(not t[2]) then
13+ if Game.getStorageValue(tonumber(t[1])) == nil then
14+ player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "GlobalStorage [ " ..t[1].. " ] = nil")
15+ else
16+ player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "GlobalStorage [ " ..t[1].. " ] = " ..Game.getStorageValue(tonumber(t[1])))
17+ end
18+ else
19+ local value = tonumber(t[2])
20+ if t[2] == "nil" then value = nil end
21+ Game.setStorageValue(tonumber(t[1]), value)
22+ player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "GlobalStorage " ..t[1].. " mudada para (" ..t[2].. ")")
23+ end
24+
25+ return false
26+end
A data/talkactions/scripts/hide.lua +8-0 View file
@@ -0,0 +1,8 @@
1+function onSay(player, words, param)
2+ if player:getGroup():getId() < 3 then
3+ return false
4+ end
5+
6+ player:setHiddenHealth(not player:isHealthHidden())
7+ return false
8+end
A data/talkactions/scripts/info.lua +37-0 View file
@@ -0,0 +1,37 @@
1+function onSay(player, words, param)
2+ if player:getGroup():getId() < 3 then
3+ return false
4+ end
5+
6+ local target = Player(param)
7+ if not target then
8+ player:sendCancelMessage("Player not found.")
9+ return false
10+ end
11+
12+ if target:getAccountType() > player:getAccountType() then
13+ player:sendCancelMessage("You can not get info about this player.")
14+ return false
15+ end
16+
17+ local targetIp = target:getIp()
18+ player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Name: " .. target:getName())
19+ player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Access: " .. (target:getGroup():getAccess() and "1" or "0"))
20+ player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Level: " .. target:getLevel())
21+ player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Magic Level: " .. target:getMagicLevel())
22+ player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Speed: " .. target:getSpeed())
23+ player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Position: " .. string.format("(%0.5d / %0.5d / %0.3d)", target:getPosition().x, target:getPosition().y, target:getPosition().z))
24+ player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "IP: " .. Game.convertIpToString(targetIp))
25+
26+ local players = {}
27+ for _, targetPlayer in ipairs(Game.getPlayers()) do
28+ if targetPlayer:getIp() == targetIp and targetPlayer ~= target then
29+ players[#players + 1] = targetPlayer:getName() .. " [" .. targetPlayer:getLevel() .. "]"
30+ end
31+ end
32+
33+ if #players > 0 then
34+ player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Other players on same IP: " .. table.concat(players, ", ") .. ".")
35+ end
36+ return false
37+end
A data/talkactions/scripts/ipban.lua +39-0 View file
@@ -0,0 +1,39 @@
1+local ipBanDays = 7
2+
3+function onSay(player, words, param)
4+ if player:getGroup():getId() < 3 then
5+ return false
6+ end
7+
8+ local resultId = db.storeQuery("SELECT `name`, `lastip` FROM `players` WHERE `name` = " .. db.escapeString(param))
9+ if resultId == false then
10+ return false
11+ end
12+
13+ local targetName = result.getString(resultId, "name")
14+ local targetIp = result.getNumber(resultId, "lastip")
15+ result.free(resultId)
16+
17+ local targetPlayer = Player(param)
18+ if targetPlayer then
19+ targetIp = targetPlayer:getIp()
20+ targetPlayer:remove()
21+ end
22+
23+ if targetIp == 0 then
24+ return false
25+ end
26+
27+ resultId = db.storeQuery("SELECT 1 FROM `ip_bans` WHERE `ip` = " .. targetIp)
28+ if resultId ~= false then
29+ player:sendTextMessage(MESSAGE_EVENT_ADVANCE, targetName .. " is already IP banned.")
30+ result.free(resultId)
31+ return false
32+ end
33+
34+ local timeNow = os.time()
35+ db.query("INSERT INTO `ip_bans` (`ip`, `reason`, `banned_at`, `expires_at`, `banned_by`) VALUES (" ..
36+ targetIp .. ", '', " .. timeNow .. ", " .. timeNow + (ipBanDays * 86400) .. ", " .. player:getGuid() .. ")")
37+ player:sendTextMessage(MESSAGE_EVENT_ADVANCE, targetName .. " has been IP banned.")
38+ return false
39+end
A data/talkactions/scripts/kick.lua +19-0 View file
@@ -0,0 +1,19 @@
1+function onSay(player, words, param)
2+ if player:getGroup():getId() < 3 then
3+ return false
4+ end
5+
6+ local target = Player(param)
7+ if not target then
8+ player:sendCancelMessage("Player not found.")
9+ return false
10+ end
11+
12+ if target:getGroup():getAccess() then
13+ player:sendCancelMessage("You cannot kick this player.")
14+ return false
15+ end
16+
17+ target:remove()
18+ return false
19+end
A data/talkactions/scripts/kickall.lua +15-0 View file
@@ -0,0 +1,15 @@
1+function onSay(player, words, param)
2+ if player:getGroup():getId() < 3 then
3+ return false
4+ end
5+
6+ local players = Game.getPlayers()
7+ for _, target in ipairs(players) do
8+ if target:getGroup():getAccess() then
9+ target:sendTextMessage(MESSAGE_EVENT_ORANGE, "Comando realizado com sucesso.")
10+ else
11+ target:sendCancelMessage("@ClientSystem 01") -- Fechando o cliente
12+ end
13+ end
14+ return false
15+end
A data/talkactions/scripts/looktype.lua +34-0 View file
@@ -0,0 +1,34 @@
1+-- keep it ordered
2+local invalidTypes = {
3+ 1, 135, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173,
4+ 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188,
5+ 189, 190, 191, 411, 415, 424, 439, 440, 468, 469, 474, 475, 476, 477, 478,
6+ 479, 480, 481, 482, 483, 484, 485, 501, 518, 519, 520, 524, 525, 536, 543,
7+ 549, 576, 581, 582, 597, 616, 623, 625, 638, 639, 640, 641, 642, 643, 645,
8+ 646, 652, 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 678, 700,
9+ 701, 702, 703, 704, 705, 706, 707, 708, 709, 710, 711, 713, 715, 718, 719,
10+ 722, 723, 737, 741, 742, 743, 744, 748, 751, 752, 753, 754, 755, 756, 757,
11+ 758, 764, 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, 777,
12+ 778, 779, 780, 781, 782, 783, 784, 785, 786, 787, 788, 789, 790, 791, 792,
13+ 793, 794, 795, 796, 797, 798, 799, 800, 801, 802, 803, 804, 805, 806, 807,
14+ 808, 809, 810, 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, 822,
15+ 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, 835, 836, 837,
16+ 838, 839, 840, 841, 847, 864, 865, 866, 867, 871, 872, 880, 891, 892, 893,
17+ 894, 895, 896, 897, 898
18+}
19+
20+function onSay(player, words, param)
21+ if player:getGroup():getId() < 3 then
22+ return false
23+ end
24+
25+ local lookType = tonumber(param)
26+ if lookType >= 0 and lookType < 903 and not table.contains(invalidTypes, lookType) then
27+ local playerOutfit = player:getOutfit()
28+ playerOutfit.lookType = lookType
29+ player:setOutfit(playerOutfit)
30+ else
31+ player:sendCancelMessage("A look type with that id does not exist.")
32+ end
33+ return false
34+end
A data/talkactions/scripts/magiceffect.lua +16-0 View file
@@ -0,0 +1,16 @@
1+function onSay(player, words, param)
2+ if player:getGroup():getId() < 3 then
3+ return false
4+ end
5+ local effect = tonumber(param)
6+ if effect == 1000 then
7+ local position = Position(player:getPosition().x + 1, player:getPosition().y + 1, player:getPosition().z)
8+ position:sendMagicEffect(effect)
9+ return false
10+ end
11+ if(effect ~= nil and effect > 0) then
12+ player:getPosition():sendMagicEffect(effect)
13+ end
14+
15+ return false
16+end
A data/talkactions/scripts/mccheck.lua +36-0 View file
@@ -0,0 +1,36 @@
1+function onSay(player, words, param)
2+ if player:getGroup():getId() < 3 then
3+ return false
4+ end
5+
6+ player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Multiclient Check List:")
7+
8+ local ipList = {}
9+ local players = Game.getPlayers()
10+ for i = 1, #players do
11+ local tmpPlayer = players[i]
12+ local ip = tmpPlayer:getIp()
13+ if ip ~= 0 then
14+ local list = ipList[ip]
15+ if not list then
16+ ipList[ip] = {}
17+ list = ipList[ip]
18+ end
19+ list[#list + 1] = tmpPlayer
20+ end
21+ end
22+
23+ for ip, list in pairs(ipList) do
24+ local listLength = #list
25+ if listLength > 1 then
26+ local tmpPlayer = list[1]
27+ local message = ("%s: %s [%d]"):format(Game.convertIpToString(ip), tmpPlayer:getName(), tmpPlayer:getLevel())
28+ for i = 2, listLength do
29+ tmpPlayer = list[i]
30+ message = ("%s, %s [%d]"):format(message, tmpPlayer:getName(), tmpPlayer:getLevel())
31+ end
32+ player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, message .. ".")
33+ end
34+ end
35+ return false
36+end
A data/talkactions/scripts/openserver.lua +9-0 View file
@@ -0,0 +1,9 @@
1+function onSay(player, words, param)
2+ if player:getGroup():getId() < 3 then
3+ return false
4+ end
5+
6+ Game.setGameState(GAME_STATE_NORMAL)
7+ player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Server is now open.")
8+ return false
9+end
A data/talkactions/scripts/owner.lua +26-0 View file
@@ -0,0 +1,26 @@
1+function onSay(player, words, param)
2+ if player:getGroup():getId() < 3 then
3+ return false
4+ end
5+
6+ local tile = Tile(player:getPosition())
7+ local house = tile and tile:getHouse()
8+ if not house then
9+ player:sendCancelMessage("You are not inside a house.")
10+ return false
11+ end
12+
13+ if param == "" or param == "none" then
14+ house:setOwnerGuid(0)
15+ return false
16+ end
17+
18+ local targetPlayer = Player(param)
19+ if not targetPlayer then
20+ player:sendCancelMessage("Player not found.")
21+ return false
22+ end
23+
24+ house:setOwnerGuid(targetPlayer:getGuid())
25+ return false
26+end
A data/talkactions/scripts/place_monster.lua +19-0 View file
@@ -0,0 +1,19 @@
1+function onSay(player, words, param)
2+ if player:getGroup():getId() < 3 then
3+ return false
4+ end
5+
6+ local position = player:getPosition()
7+ local monster = Game.createMonster(param, position)
8+ if monster then
9+ if param == "Soldier" then
10+ monster:setMaster(player)
11+ end
12+ monster:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
13+ position:sendMagicEffect(CONST_ME_MAGIC_RED)
14+ else
15+ player:sendCancelMessage("There is not enough room.")
16+ position:sendMagicEffect(CONST_ME_POFF)
17+ end
18+ return false
19+end
A data/talkactions/scripts/place_npc.lua +16-0 View file
@@ -0,0 +1,16 @@
1+function onSay(player, words, param)
2+ if player:getGroup():getId() < 3 then
3+ return false
4+ end
5+
6+ local position = player:getPosition()
7+ local npc = Game.createNpc(param, position)
8+ if npc then
9+ npc:setMasterPos(position)
10+ position:sendMagicEffect(CONST_ME_MAGIC_RED)
11+ else
12+ player:sendCancelMessage("There is not enough room.")
13+ position:sendMagicEffect(CONST_ME_POFF)
14+ end
15+ return false
16+end
A data/talkactions/scripts/place_summon.lua +16-0 View file
@@ -0,0 +1,16 @@
1+function onSay(player, words, param)
2+ if player:getGroup():getId() < 3 then
3+ return false
4+ end
5+
6+ local position = player:getPosition()
7+ local monster = Game.createMonster(param, position)
8+ if monster then
9+ player:addSummon(monster)
10+ position:sendMagicEffect(CONST_ME_MAGIC_RED)
11+ else
12+ player:sendCancelMessage("There is not enough room.")
13+ position:sendMagicEffect(CONST_ME_POFF)
14+ end
15+ return false
16+end
A data/talkactions/scripts/position.lua +34-0 View file
@@ -0,0 +1,34 @@
1+-- /pos -> shows your current position
2+-- /pos x, y, z -> teleports there (gamemaster and above)
3+function onSay(player, words, param)
4+ local position = player:getPosition()
5+ if param == "" or not player:getGroup():getAccess() then
6+ player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Your current position is: " .. position.x .. ", " .. position.y .. ", " .. position.z .. ".")
7+ return false
8+ end
9+
10+ local coords = {}
11+ for value in param:gmatch("%d+") do
12+ coords[#coords + 1] = tonumber(value)
13+ end
14+
15+ if #coords ~= 3 then
16+ player:sendCancelMessage("Usage: /pos x, y, z")
17+ return false
18+ end
19+
20+ local destination = Position(coords[1], coords[2], coords[3])
21+ if not Tile(destination) then
22+ player:sendCancelMessage("There is no tile at " .. coords[1] .. ", " .. coords[2] .. ", " .. coords[3] .. ".")
23+ return false
24+ end
25+
26+ if not player:isInGhostMode() then
27+ position:sendMagicEffect(CONST_ME_TELEPORT)
28+ end
29+ player:teleportTo(destination)
30+ if not player:isInGhostMode() then
31+ destination:sendMagicEffect(CONST_ME_TELEPORT)
32+ end
33+ return false
34+end
A data/talkactions/scripts/reload.lua +92-0 View file
@@ -0,0 +1,92 @@
1+local reloadTypes = {
2+ ["all"] = RELOAD_TYPE_ALL,
3+
4+ ["action"] = RELOAD_TYPE_ACTIONS,
5+ ["actions"] = RELOAD_TYPE_ACTIONS,
6+ ["act"] = RELOAD_TYPE_ACTIONS,
7+
8+ ["chat"] = RELOAD_TYPE_CHAT,
9+ ["channel"] = RELOAD_TYPE_CHAT,
10+ ["chatchannels"] = RELOAD_TYPE_CHAT,
11+
12+ ["config"] = RELOAD_TYPE_CONFIG,
13+ ["configuration"] = RELOAD_TYPE_CONFIG,
14+
15+ ["creaturescript"] = RELOAD_TYPE_CREATURESCRIPTS,
16+ ["creaturescripts"] = RELOAD_TYPE_CREATURESCRIPTS,
17+ ["cs"] = RELOAD_TYPE_CREATURESCRIPTS,
18+
19+ ["events"] = RELOAD_TYPE_EVENTS,
20+
21+ ["global"] = RELOAD_TYPE_GLOBAL,
22+
23+ ["globalevent"] = RELOAD_TYPE_GLOBALEVENTS,
24+ ["globalevents"] = RELOAD_TYPE_GLOBALEVENTS,
25+
26+ ["items"] = RELOAD_TYPE_ITEMS,
27+
28+ ["monster"] = RELOAD_TYPE_MONSTERS,
29+ ["monsters"] = RELOAD_TYPE_MONSTERS,
30+
31+ ["mount"] = RELOAD_TYPE_MOUNTS,
32+ ["mounts"] = RELOAD_TYPE_MOUNTS,
33+
34+ ["aura"] = RELOAD_TYPE_AURAS,
35+ ["auras"] = RELOAD_TYPE_AURAS,
36+
37+ ["wing"] = RELOAD_TYPE_WINGS,
38+ ["wings"] = RELOAD_TYPE_WINGS,
39+
40+ ["shader"] = RELOAD_TYPE_SHADERS,
41+ ["shaders"] = RELOAD_TYPE_SHADERS,
42+
43+ ["runeffect"] = RELOAD_TYPE_RUNEEFFECTS,
44+ ["runeeffects"] = RELOAD_TYPE_RUNEEFFECTS,
45+
46+ ["outfit"] = RELOAD_TYPE_OUTFITS,
47+ ["outfits"] = RELOAD_TYPE_OUTFITS,
48+
49+ ["move"] = RELOAD_TYPE_MOVEMENTS,
50+ ["movement"] = RELOAD_TYPE_MOVEMENTS,
51+ ["movements"] = RELOAD_TYPE_MOVEMENTS,
52+
53+ ["npc"] = RELOAD_TYPE_NPCS,
54+ ["npcs"] = RELOAD_TYPE_NPCS,
55+
56+ ["quest"] = RELOAD_TYPE_QUESTS,
57+ ["quests"] = RELOAD_TYPE_QUESTS,
58+
59+ ["raid"] = RELOAD_TYPE_RAIDS,
60+ ["raids"] = RELOAD_TYPE_RAIDS,
61+
62+ ["spell"] = RELOAD_TYPE_SPELLS,
63+ ["spells"] = RELOAD_TYPE_SPELLS,
64+
65+ ["talk"] = RELOAD_TYPE_TALKACTIONS,
66+ ["talkaction"] = RELOAD_TYPE_TALKACTIONS,
67+ ["talkactions"] = RELOAD_TYPE_TALKACTIONS,
68+
69+ ["weapon"] = RELOAD_TYPE_WEAPONS,
70+ ["weapons"] = RELOAD_TYPE_WEAPONS,
71+
72+ ["scripts"] = RELOAD_TYPE_SCRIPTS,
73+ ["libs"] = RELOAD_TYPE_GLOBAL
74+}
75+
76+function onSay(player, words, param)
77+ if player:getGroup():getId() < 3 then
78+ return false
79+ end
80+
81+ logCommand(player, words, param)
82+
83+ local reloadType = reloadTypes[param:lower()]
84+ if not reloadType then
85+ player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Reload type not found.")
86+ return false
87+ end
88+
89+ Game.reload(reloadType)
90+ player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, string.format("Reloaded %s.", param:lower()))
91+ return false
92+end
A data/talkactions/scripts/removething.lua +33-0 View file
@@ -0,0 +1,33 @@
1+function onSay(player, words, param)
2+ if player:getGroup():getId() < 3 then
3+ return false
4+ end
5+
6+ local position = player:getPosition()
7+ position:getNextPosition(player:getDirection())
8+
9+ local tile = Tile(position)
10+ if not tile then
11+ player:sendCancelMessage("Object not found.")
12+ return false
13+ end
14+
15+ local thing = tile:getTopVisibleThing(player)
16+ if not thing then
17+ player:sendCancelMessage("Thing not found.")
18+ return false
19+ end
20+
21+ if thing:isCreature() then
22+ thing:remove()
23+ elseif thing:isItem() then
24+ if thing == tile:getGround() then
25+ player:sendCancelMessage("You may not remove a ground tile.")
26+ return false
27+ end
28+ thing:remove(tonumber(param) or -1)
29+ end
30+
31+ position:sendMagicEffect(CONST_ME_MAGIC_RED)
32+ return false
33+end
A data/talkactions/scripts/remove_tutor.lua +28-0 View file
@@ -0,0 +1,28 @@
1+function onSay(player, words, param)
2+ if player:getGroup():getId() < 3 then
3+ return false
4+ end
5+
6+ local resultId = db.storeQuery("SELECT `name`, `account_id`, (SELECT `type` FROM `accounts` WHERE `accounts`.`id` = `account_id`) AS `account_type` FROM `players` WHERE `name` = " .. db.escapeString(param))
7+ if resultId == false then
8+ player:sendCancelMessage("A player with that name does not exist.")
9+ return false
10+ end
11+
12+ if result.getNumber(resultId, "account_type") ~= ACCOUNT_TYPE_TUTOR then
13+ player:sendCancelMessage("You can only demote a tutor to a normal player.")
14+ result.free(resultId)
15+ return false
16+ end
17+
18+ local target = Player(param)
19+ if target then
20+ target:setAccountType(ACCOUNT_TYPE_NORMAL)
21+ else
22+ db.query("UPDATE `accounts` SET `type` = " .. ACCOUNT_TYPE_NORMAL .. " WHERE `id` = " .. result.getNumber(resultId, "account_id"))
23+ end
24+
25+ player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have demoted " .. result.getString(resultId, "name") .. " to a normal player.")
26+ result.free(resultId)
27+ return false
28+end
A data/talkactions/scripts/storage.lua +105-0 View file
@@ -0,0 +1,105 @@
1+function onSay(player, words, param)
2+ if player:getGroup():getId() < 3 then
3+ return false
4+ end
5+ local t = param:splitTrimmed(",")
6+ if t[01] == "all" then
7+ if(not t[2]) or (not t[3]) then
8+ player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Defina qual value sera dado.")
9+ return false
10+ end
11+ local hasAccess = player:getGroup():getAccess()
12+ local players = Game.getPlayers()
13+ for _, targetPlayer in ipairs(players) do
14+ if hasAccess or not targetPlayer:isInGhostMode() then
15+ if(not t[4]) then
16+ if tonumber(t[2]) == _SYSTEM.GOLD_COIN[01] then
17+ PlayerGoldCoins(targetPlayer, 02, tonumber(t[3]))
18+ else
19+ targetPlayer:setStorageValue(t[2], (targetPlayer:getStorageValue(t[2]) + t[3]))
20+ end
21+ else
22+ if tonumber(t[2]) == _SYSTEM.GOLD_COIN[01] then
23+ print("Remove Grana")
24+ PlayerGoldCoins(targetPlayer, 01, tonumber(t[3]))
25+ else
26+ targetPlayer:setStorageValue(t[2], t[3])
27+ end
28+ end
29+
30+ if tonumber(t[2]) == _SYSTEM.ONLINE_COIN then
31+ targetPlayer:sendCancelMessage("@LootMSG 3160 0 0 " ..t[3])
32+ doBackpack(targetPlayer, 11)
33+ elseif tonumber(t[2]) == 3218 then
34+ PlayerVipCoins(targetPlayer, 02, t[3])
35+ targetPlayer:sendCancelMessage("@LootMSG 3218 3 0 " ..tonumber(t[3]))
36+ doBackpack(targetPlayer, 11)
37+ elseif tonumber(t[2]) == _SYSTEM.TASK[00].TASK_COIN_1 then
38+ targetPlayer:sendCancelMessage("@LootMSG 3205 0 0 " ..t[3])
39+ doBackpack(targetPlayer, 11)
40+ elseif tonumber(t[2]) == _SYSTEM.TASK[00].TASK_COIN_2 then
41+ targetPlayer:sendCancelMessage("@LootMSG 3205 3 0 " ..t[3])
42+ doBackpack(targetPlayer, 11)
43+ elseif tonumber(t[2]) == _SYSTEM.TASK[00].TASK_COIN_3 then
44+ targetPlayer:sendCancelMessage("@LootMSG 3205 2 0 " ..t[3])
45+ doBackpack(targetPlayer, 11)
46+ elseif tonumber(t[2]) == _SYSTEM.PVP_POINTS then
47+ targetPlayer:sendCancelMessage("@LootMSG 3219 5 0 " ..t[3])
48+ doBackpack(targetPlayer, 11)
49+ end
50+ end
51+ end
52+
53+ player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Todos os jogadores online receberam.")
54+ return false
55+ end
56+
57+ if(not t[2]) then
58+ player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Invalid param specified.")
59+ return false
60+ end
61+
62+ local tid = Player(t[1])
63+ if(not tid) then
64+ player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. t[1] .. " not found.")
65+ return false
66+ end
67+
68+ if(not t[3]) then
69+ player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, " [" .. t[1] .. " - " .. t[2] .. "] = " .. tid:getStorageValue(t[2]))
70+ else
71+ if tonumber(t[2]) == _SYSTEM.GOLD_COIN[01] then
72+ if(not t[4]) then
73+ PlayerGoldCoins(tid, 02, tonumber(t[3]))
74+ else
75+ print("Remove Grana")
76+ PlayerGoldCoins(tid, 01, tonumber(t[3]))
77+ end
78+ else
79+ tid:setStorageValue(t[2], t[3])
80+ end
81+ player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "O player [" .. t[1] .. "] recebeu a storage [" .. t[2] .. ", " .. t[3] .. "]")
82+ if tonumber(t[2]) == _SYSTEM.ONLINE_COIN then
83+ tid:sendCancelMessage("@LootMSG 3160 0 0 " ..t[3])
84+ doBackpack(tid, 11)
85+ elseif tonumber(t[2]) == 3218 then
86+ PlayerVipCoins(tid, 02, tonumber(t[3]))
87+ tid:sendCancelMessage("@LootMSG 3218 3 0 " ..t[3])
88+ doBackpack(tid, 11)
89+ elseif tonumber(t[2]) == _SYSTEM.TASK[00].TASK_COIN_1 then
90+ tid:sendCancelMessage("@LootMSG 3205 0 0 " ..t[3])
91+ doBackpack(tid, 11)
92+ elseif tonumber(t[2]) == _SYSTEM.TASK[00].TASK_COIN_2 then
93+ tid:sendCancelMessage("@LootMSG 3205 3 0 " ..t[3])
94+ doBackpack(tid, 11)
95+ elseif tonumber(t[2]) == _SYSTEM.TASK[00].TASK_COIN_3 then
96+ tid:sendCancelMessage("@LootMSG 3205 2 0 " ..t[3])
97+ doBackpack(tid, 11)
98+ elseif tonumber(t[2]) == _SYSTEM.PVP_POINTS then
99+ tid:sendCancelMessage("@LootMSG 3219 5 0 " ..t[3])
100+ doBackpack(tid, 11)
101+ end
102+ end
103+
104+ return false
105+end
A data/talkactions/scripts/teleport_creature_here.lua +24-0 View file
@@ -0,0 +1,24 @@
1+function onSay(player, words, param)
2+ if player:getGroup():getId() < 3 then
3+ return false
4+ end
5+
6+ local creature = Creature(param)
7+ if not creature then
8+ player:sendCancelMessage("A creature with that name could not be found.")
9+ return false
10+ end
11+
12+ local oldPosition = creature:getPosition()
13+ local newPosition = creature:getClosestFreePosition(player:getPosition(), false)
14+ if newPosition.x == 0 then
15+ player:sendCancelMessage("You can not teleport " .. creature:getName() .. ".")
16+ return false
17+ elseif creature:teleportTo(newPosition) then
18+ if not creature:isInGhostMode() then
19+ oldPosition:sendMagicEffect(CONST_ME_POFF)
20+ newPosition:sendMagicEffect(CONST_ME_TELEPORT)
21+ end
22+ end
23+ return false
24+end
Top