cursestree.lua

main 79 lines · 2.5 KB Raw
Alex Alex Commit Server upload 18/10/2026 23:38
1local NINHO_DIFICULTY = {
2 ["FACIL"] = {01, 30};
3 ["MEDIO"] = {02, 70};
4 ["DIFICIL"] = {03, 125};
5 ["IMPOSSIVEL"] = {04, 185};
6}
7function onSay(player, words, param)
8 local split = param:splitTrimmed(" ")
9 local Dificuldade = split[01]
10 local OnlineCoins = player:getStorageValue(_SYSTEM.ONLINE_COIN)
11 local CursedPoints = NINHO_DIFICULTY[Dificuldade][01]
12 local party = player:getParty()
13
14 if _DEBUG_MODE then
15 local _TYPE = {
16 ["1"] = 'Facil',
17 ["2"] = 'Medio',
18 ["3"] = 'Dificil',
19 ["4"] = 'Impossivel',
20 }
21
22 if _TYPE[split[01]] then
23 print("[TALK - CURSEDTREE] " ..player:getName().. " - " .._TYPE[split[01]])
24 else
25 print("[TALK - CURSEDTREE] " ..player:getName().. " - " ..split[01])
26 end
27 end
28 if party then
29
30 return false
31 end
32 if player:getLevel() < NINHO_DIFICULTY[Dificuldade][02] then
33
34 return false
35 end
36 if _CHEATS.CURSED_ONLINE_FREE or OnlineCoins >= CursedPoints then
37 local from = {x=4043, y=934, z=08}
38 local to = {x=4067, y=955, z=08}
39 for A = from.x, to.x do
40 for B = from.y, to.y do
41 for C = from.z, to.z do
42 local tile = Tile(A, B, C)
43 local creature = tile:getTopCreature()
44 if creature and creature:isPlayer() then
45
46 return false
47 end
48 end
49 end
50 end
51 for A = from.x, to.x do
52 for B = from.y, to.y do
53 for C = from.z, to.z do
54 local tile = Tile(A, B, C)
55 local creature = tile:getTopCreature()
56 if creature and creature:isMonster() then
57 doRemoveCreature(creature:getId())
58 end
59 end
60 end
61 end
62
63 if _CHEATS.CURSED_ONLINE_FREE == false then
64 player:setStorageValue(_SYSTEM.ONLINE_COIN, (OnlineCoins - CursedPoints))
65 end
66
67 player:setStorageValue(_SYSTEM.GLOBAL_INDEX[02], 00)
68 player:setStorageValue(_SYSTEM.CURSED_TREE, NINHO_DIFICULTY[Dificuldade][01])
69 player:setStorageValue(_SYSTEM.GLOBAL_INDEX[01], NINHO_DIFICULTY[Dificuldade][01])
70 player:teleportTo({x=4054, y=941, z=08})
71 player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
72 doBackpack(player, 11)
73 player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Clique nas partes da Arvore para dar inicio ao desafio.")
74 else
75
76 end
77 return false
78end
79
Top