1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
addhook("movetile","EXPmovetile")
function EXPmovetile(id,x,y)
	if entity(x, y, "typename") == "Info_T" or entity(x, y, "typename") == "Info_CT" then
		return
	end
	if tile(x, y, 'frame') == 34 or PLAYERS[id].tmp.paralyse then
		if not (PLAYERS[id].Equipment[7] and ITEMS[PLAYERS[id].Equipment[7]].water) then
			setpos(id,PLAYERS[id].x*32+16,PLAYERS[id].y*32+16)
			return
		end
	end
	local tile = gettile(x, y)
	if tile.HOUSE then
		if not PLAYERS[id].Tutorial.house then
			message(id, "This is a house. For more information about houses, type !house", "255128000")
			PLAYERS[id].Tutorial.house = true
		end
		house = HOUSES[tile.HOUSE]
		if not house.owner then
			setpos(id, PLAYERS[id].x*32+16, PLAYERS[id].y*32+16)
			message(id, "This house has no owner. Type \"!house\" for a list of house commands.", "255255255")
			return
		elseif not (player(id, "usgn") == house.owner or inarray(house.allow, player(id, "usgn"))) then
			setpos(id, house.ent[1]*32+16, house.ent[2]*32+16)
			message(id, "You are not invited into " .. PLAYERCACHE[house.owner].name .. "'s house. Type \"!house\" for a list of house commands.", "255255255")
			return
		end
	end
	if not PLAYERS[id].Tutorial.pick then
		if GROUNDITEMS[y][x][1] then
			message(id, "You have stumbled upon something. Press the drop weapon button (default G) to pick it up.", "255128000")
		end
	end
	hudtxt2(id, CONFIG.HUDTXT.SAFE, (tile.SAFE and "SAFE") or (tile.PVP and "PVP") or "","255064000", 320, 200, 1)
	if not PLAYERS[id].Tutorial.safe then
		if not tile.SAFE then
			message(id, "You have left a SAFE zone. From now, you will be able to both damage and be damaged.", "255128000")
			PLAYERS[id].Tutorial.safe = true
		end
	elseif not PLAYERS[id].Tutorial.pvp then
		if tile.PVP then
			message(id, "You have entered a PVP zone. In this area, you may fight for money. If you die here, you will drop $100.", "255128000")
			PLAYERS[id].Tutorial.pvp = true
		end
	end
	PLAYERS[id].x, PLAYERS[id].y = x, y
end