This is the NPC Code that sends you to the map
mob
NPC
Person
icon = 'NPC.dmi'
icon_state = "Adventure"
Click()
if(src in oview(1))
if(usr.action)
return
else
usr.action = 1
if(usr.move == 0)
usr.action=0
return
else
if(usr.Pet)
usr.move=0
var/R = input("Where do you want to go","[src]")in list("Forest","Cancel")
switch(R)
if("Forest")
if(usr.Cash >= 15000) //if usr's gold is greater than or equal to 15000
var/H = input("Are you sure?It will cost $15000","[src]")in list("Yes","No")
switch(H)
if("Yes")
usr.move=1
usr.action=0
usr.Cash -= 15000 //takes 15000 away from usr's gold
usr.loc = locate(1,1,3)
usr.Energy = 50
if("No")
usr.move=1
usr.action=0
return
else
usr << "<Font size=1><font color=red>You dont have enough cash."
usr.move=1
usr.action=0
if("Cancel")
usr.move=1
usr.action=0
return
else
usr << "<font size=1><Font color=red>You dont have a pet to go adventuring with"
This is the code i have to check if the user is in The adventure area.
area
Adventure
Entered(mob/M)
if(M.client)
M.Energy -= 1
if(M.Energy <= 0)
usr.loc = locate(1,1,2)
usr << "You run out of energy and finish the adventure"
mob = the mob.
mob.loc = the turf the mob is in.
mob.loc.loc = the area the turf the mob is in is in.
You can chech mob.loc.loc.type to find out what kind of area the mob is in, and if the type equals this "adventure map" they're on, then it subtracts one energy. However you want to work that.