Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /////////////////
- //PlayerVars
- //20 - inCave 0 = no, 1 = yes
- //21 - Row
- //22 - Column
- //
- //
- #include fp_NewbCave.mit //Specify floorplan filename
- //GLOBAL $mapHeight = 20
- //GLOBAL $mapWidth = 20
- event ("accessbuilding","7")
- {
- $gPlayerVar[20] = 1
- $gPlayerVar[21] = 15
- $gPlayerVar[22] = 20
- CaveInit($gPlayerVar[21],$gPlayerVar[22])
- }
- $mapHeight = 20
- $mapWidth = 20
- $m_MapData[ ] = {
- 1,1,1,1,1,1,1,1,7,0,0,0,0,0,0,0,0,0,0,0
- 0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0
- 0,0,0,0,0,0,0,0,2,0,0,0,0,0,"E",0,0,0,0,0
- 0,0,E,0,0,0,0,0,2,0,0,0,0,0,2,0,0,0,0,0
- 0,0,2,0,0,0,0,0,2,0,0,0,0,0,2,0,0,0,0,0
- 0,0,2,0,0,0,0,0,2,0,0,0,0,0,2,0,0,0,0,0
- 0,0,9,1,1,1,1,1,A,1,1,1,1,1,8,0,0,0,0,0
- 0,0,2,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0
- 0,0,9,1,1,1,B,1,1,1,F,0,0,0,2,0,0,0,0,0
- 0,0,2,0,0,0,2,0,0,0,0,0,0,0,2,0,0,0,0,0
- 0,0,2,0,0,0,2,0,0,0,0,0,0,0,2,0,0,0,0,0
- 0,0,2,0,0,0,2,0,0,0,0,0,0,0,2,0,0,0,0,0
- 0,0,2,0,0,0,2,0,0,0,0,0,0,0,2,0,0,0,0,0
- 0,0,2,0,0,0,2,0,0,0,0,0,0,0,2,0,0,0,0,0
- 0,0,2,0,0,0,5,1,1,1,1,1,1,1,3,1,1,1,1,1
- 0,0,2,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0
- 0,0,C,D,1,1,7,0,0,0,0,0,0,0,2,0,0,0,0,0
- 0,0,0,0,0,0,5,1,1,1,1,1,1,0,2,0,0,0,0,0
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0
- 0,D,1,1,1,1,1,1,1,1,1,1,1,1,4,0,0,0,0,0
- }
- Function CaveInit($row,$col)
- {
- osdcreate(osdbuilding,"Cave1","A Cavern")
- osdaddat(osdbigtext,50,100,500,50,"","Directions of movement available")
- CheckBlock($row,$col)
- }
- Function CheckBlock($row,$col)
- {
- //*say $row row
- //*say $col col
- $pos1 =$row - 1
- $pos2 = $pos1 * $mapWidth
- $playerPos = $pos2 + $col
- //*say $playerPos Pos
- GetButtons($m_MapData[$playerPos])
- }
- Function GetButtons($type)
- {
- *say $type celltype
- if ($type = 0)
- {
- }
- else if ($type = 1)
- {
- AddButton(3)
- AddButton(1)
- }
- else if ($type = 2)
- {
- AddButton(0)
- AddButton(2)
- }
- else if ($type = 3)
- {
- AddButton(0)
- AddButton(1)
- AddButton(2)
- AddButton(3)
- }
- else if ($type = 4)
- {
- AddButton(0)
- AddButton(3)
- }
- else if ($type = 5)
- {
- AddButton(0)
- AddButton(1)
- }
- else if ($type = 6)
- {
- AddButton(1)
- AddButton(2)
- }
- else if ($type = 7)
- {
- AddButton(2)
- AddButton(3)
- }
- else if ($type = 8)
- {
- AddButton(0)
- AddButton(2)
- AddButton(3)
- }
- else if ($type = 9)
- {
- AddButton(0)
- AddButton(1)
- AddButton(2)
- }
- else if ($type = "A")
- {
- //*say wat
- AddButton(0)
- AddButton(1)
- AddButton(3)
- }
- else if ($type = "B")
- {
- AddButton(1)
- AddButton(2)
- AddButton(3)
- }
- else if ($type = "C")
- {
- AddButton(0)
- }
- else if ($type = "D")
- {
- AddButton(1)
- }
- else if ($type = "E")
- {
- AddButton(2)
- }
- else if ($type = "F")
- {
- AddButton(3)
- }
- OSDACTIVATE()
- }
- function AddButton($dir)
- {
- if ($dir = 0)
- {
- osdaddat(osdbutton,250,130,75,35,"North","Go North")
- }
- if ($dir = 1)
- {
- osdaddat(osdbutton,335,180,60,35,"East","Go East")
- }
- if ($dir = 2)
- {
- osdaddat(osdbutton,250,240,75,35,"South","Go South")
- }
- if ($dir = 3)
- {
- osdaddat(osdbutton,180,180,60,35,"West","Go West")
- }
- }
- event("osdselect","Cave1:North")
- {
- $gplayervar[21] -= 1
- CaveInit($gPlayerVar[21],$gPlayerVar[22])
- }
- event("osdselect","Cave1:South")
- {
- $gplayervar[21] += 1
- CaveInit($gPlayerVar[21],$gPlayerVar[22])
- }
- event("osdselect","Cave1:West")
- {
- $gplayervar[22] -= 1
- CaveInit($gPlayerVar[21],$gPlayerVar[22])
- }
- event("osdselect","Cave1:East")
- {
- $gplayervar[22] += 1
- CaveInit($gPlayerVar[21],$gPlayerVar[22])
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement