1local windows = {
2 [5303] = 6448, [5304] = 6449, [6438] = 6436, [6436] = 6438,
3 [6439] = 6437, [6437] = 6439, [6442] = 6440, [6440] = 6442,
4 [6443] = 6441, [6441] = 6443, [6446] = 6444, [6444] = 6446,
5 [6447] = 6445, [6445] = 6447, [6448] = 5303, [6449] = 5304,
6 [6452] = 6450, [6450] = 6452, [6453] = 6451, [6451] = 6453,
7 [6456] = 6454, [6454] = 6456, [6457] = 6455, [6455] = 6457,
8 [6460] = 6458, [6458] = 6460, [6461] = 6459, [6459] = 6461,
9 [6464] = 6462, [6462] = 6464, [6465] = 6463, [6463] = 6465,
10 [6468] = 6466, [6466] = 6468, [6469] = 6467, [6467] = 6469,
11 [6472] = 6470, [6470] = 6472, [6473] = 6471, [6471] = 6473,
12 [6790] = 6788, [6788] = 6790, [6791] = 6789, [6789] = 6791,
13 [7027] = 7025, [7025] = 7027, [7028] = 7026, [7026] = 7028,
14 [7031] = 7029, [7029] = 7031, [7032] = 7030, [7030] = 7032,
15 [10264] = 10266, [10266] = 10264, [10265] = 10267, [10267] = 10265,
16 [10488] = 10490, [10490] = 10488, [10489] = 10491, [10491] = 10489,
17 [19427] = 19447, [19428] = 19448, [19441] = 19450, [19440] = 19449,
18 [19443] = 20180, [19444] = 20181, [19445] = 20183, [19446] = 20184,
19 [19447] = 19427, [19448] = 19428, [19449] = 19440, [19450] = 19441,
20 [19974] = 20182, [19975] = 20185, [20180] = 19443, [20181] = 19444,
21 [20182] = 19974, [20183] = 19445, [20184] = 19446, [20185] = 19975
22}
23
24function onUse(player, item, fromPosition, target, toPosition, isHotkey)
25 local window = windows[item:getId()]
26 if not window then
27 return false
28 end
29
30 local tile = Tile(fromPosition)
31 local house = tile and tile:getHouse()
32 if not house then
33 fromPosition.y = fromPosition.y - 1
34 tile = Tile(fromPosition)
35 house = tile and tile:getHouse()
36 if not house then
37 fromPosition.y = fromPosition.y + 1
38 fromPosition.x = fromPosition.x - 1
39 tile = Tile(fromPosition)
40 house = tile and tile:getHouse()
41 end
42 end
43
44 if house and player:getTile():getHouse() ~= house and player:getAccountType() < ACCOUNT_TYPE_GAMEMASTER then
45 return false
46 end
47
48 player:addAchievementProgress("Do Not Disturb", 100)
49 player:addAchievementProgress("Let the Sunshine In", 100)
50 item:transform(window)
51 return true
52end
53