1function onUse(player, item, fromPosition, target, toPosition, isHotkey)
2 if item.itemid == 1945 then
3 local Position_1 = Position(3815, 969, 6)
4 local Lamp_1 = Tile(Position_1):getItemById(3945)
5 local Position_2 = Position(3824, 968, 6)
6 local Lamp_2 = Tile(Position_2):getItemById(3945)
7 local Position_3 = Position(3826, 973, 6)
8 local Lamp_3 = Tile(Position_3):getItemById(3945)
9 local Position_4 = Position(3822, 964, 6)
10 local Lamp_4 = Tile(Position_4):getItemById(3945)
11 local Position_5 = Position(3828, 961, 6)
12 local Lamp_5 = Tile(Position_5):getItemById(3945)
13 local Position_6 = Position(3818, 960, 6)
14 local Lamp_6 = Tile(Position_6):getItemById(3945)
15
16 local Position_7 = Position(3824, 978, 6)
17 local Lamp_7 = Tile(Position_7):getItemById(3946)
18 local Position_8 = Position(3825, 976, 6)
19 local Lamp_8 = Tile(Position_8):getItemById(3946)
20 local Position_9 = Position(3828, 970, 6)
21 local Lamp_9 = Tile(Position_9):getItemById(3946)
22 local Position_10 = Position(3825, 965, 6)
23 local Lamp_10 = Tile(Position_10):getItemById(3946)
24 local Position_11 = Position(3827, 963, 6)
25 local Lamp_11 = Tile(Position_11):getItemById(3946)
26 local Position_12 = Position(3820, 967, 6)
27 local Lamp_12 = Tile(Position_12):getItemById(3946)
28 local Position_13 = Position(3821, 961, 6)
29 local Lamp_13 = Tile(Position_13):getItemById(3946)
30 local Position_14 = Position(3821, 958, 6)
31 local Lamp_14 = Tile(Position_14):getItemById(3946)
32 local Position_15 = Position(3818, 965, 6)
33 local Lamp_15 = Tile(Position_14):getItemById(3946)
34
35 if Lamp_1 and Lamp_2 and Lamp_3 and Lamp_4 and Lamp_5 and Lamp_6 then
36 if Lamp_7 and Lamp_8 and Lamp_9 and Lamp_10 and Lamp_11 and Lamp_12 then
37 player:teleportTo({x=3800, y=1025, z=07})
38 player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
39
40 Lamp_1:transform(3946)
41 Lamp_2:transform(3946)
42 Lamp_3:transform(3946)
43 Lamp_4:transform(3946)
44 Lamp_5:transform(3946)
45 Lamp_6:transform(3946)
46
47 Lamp_7:transform(3946)
48 Lamp_8:transform(3946)
49 Lamp_9:transform(3946)
50 Lamp_10:transform(3946)
51 Lamp_11:transform(3946)
52 Lamp_12:transform(3946)
53 Lamp_13:transform(3946)
54 Lamp_14:transform(3946)
55 Lamp_15:transform(3946)
56 else
57 player:getPosition():sendMagicEffect(03)
58 end
59 else
60 player:getPosition():sendMagicEffect(03)
61 end
62 end
63
64 if item.itemid == 1945 then
65 item:transform(item.itemid + 1)
66 else
67 item:transform(item.itemid - 1)
68 end
69end