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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
NPCs[20].func = function(npc, id, words, state)
	if words == "hi" then
		NPCspeak(npc, "Welcome Do you want enter a Dungeon ?")
		PLAYERS[id].tmp.npcstate = {npc, 1}
	elseif state == 1 then
		if words=="no" then
			NPCspeak(npc, "Bye then.")
			PLAYERS[id].tmp.npcstate = {npc, 0}
		elseif words == "yes" then
			NPCspeak(npc, "Dungeons :")
			NPCspeak(npc, "[1] <- Lvl 30-50")
			NPCspeak(npc, "[2] <- Lvl 55-75")
			NPCspeak(npc, "[3] <- Lvl 80-100")
			PLAYERS[id].tmp.npcstate = {npc, 2}
		end
	elseif state == 2 then
		if words == "anywhere" or words == "nowhere" then
			NPCspeak(npc, "Bye then.")
			PLAYERS[id].tmp.npcstate = {npc, 0}
		elseif words == "1" then
			NPCspeak(npc, "So you want to Lvl 30-50 Dungeon ?")
			NPCspeak(npc, "It's cost only 20.000$.")
			NPCspeak(npc, "Do you want teleport ?")
			PLAYERS[id].tmp.npcstate = {npc, 3}
		elseif words == "2" then
			NPCspeak(npc, "So you want to Lvl 55-75 Dungeon ?")
			NPCspeak(npc, "It's cost only 40.000$.")
			NPCspeak(npc, "Do you want teleport ?")
			PLAYERS[id].tmp.npcstate = {npc, 4}
		elseif words == "3" then
			NPCspeak(npc, "So you want to Lvl 80-100 Dungeon ?")
			NPCspeak(npc, "It's cost only 100.000$.")
			NPCspeak(npc, "Do you want teleport ?")
			PLAYERS[id].tmp.npcstate = {npc, 5}
		end
	elseif state == 3 then
		if words == "no" then
			NPCspeak(npc, "Bye then.")
			PLAYERS[id].tmp.npcstate = {npc, 0}
		elseif words == "yes" then
			if addmoney(id,-20000) then
				NPCspeak(npc, "Have Fun !!!")
				parse('setpos '..id..' 6000 6035')
				PLAYERS[id].tmp.npcstate = {npc, 0}
			else
				NPCspeak(npc, "You don't have enought money bye !")
				PLAYERS[id].tmp.npcstate = {npc, 0}
			end
		end
	elseif state == 4 then
		if words == "no" then
			NPCspeak(npc, "Bye then.")
			PLAYERS[id].tmp.npcstate = {npc, 0}
		elseif words == "yes" then
			if addmoney(id,-40000) then
				NPCspeak(npc, "Have Fun !!!")
				parse('setpos '..id..' 5742 5043')
				PLAYERS[id].tmp.npcstate = {npc, 0}
			else
				NPCspeak(npc, "You don't have enought money bye !")
				PLAYERS[id].tmp.npcstate = {npc, 0}
			end
		end
	elseif state == 5 then
		if words == "no" then
			NPCspeak(npc, "Bye then.")
			PLAYERS[id].tmp.npcstate = {npc, 0}
		elseif words == "yes" then
			if addmoney(id,-100000) then
				NPCspeak(npc, "Have Fun !!!")
				parse('setpos '..id..' 5904 4020')
				PLAYERS[id].tmp.npcstate = {npc, 0}
			else
				NPCspeak(npc, "You don't have enought money bye !")
				PLAYERS[id].tmp.npcstate = {npc, 0}
			end
		end
	end
end