The Depths vPA.0.4

*Code written by Sprocket T. and El Furriando

*If you use some or all of the code here please attribute thank you :)

*Working note.  to fix adding spawn points to the rooms set the floor to a different floor type before finilizing
*Use a set amount of monsters per level.  No spawners.  Still randamize.
*To cope with the lag spikes that can happen in the game and to promote stategy based gameplay create a semi turn based system.
*the premis being a stanima bar.  A single character can only make so many moves per second.  That way multiplayer groups
*won't be overwhelmed by monsters by just one player moving.
*Add treasure chests at all hall ends.



DSPK V04.00 Furcadia
(0:0) When everything is starting up,
    (5:300) set variable %step to the value 0.
    (5:300) set variable %inSafe to the value 0.
    (5:300) set variable %level to the value 1.
    (5:300) set variable %mobOne to the value 2408.
    (5:300) set variable %mobTwo to the value 2407.
    (5:300) set variable %mobThree to the value 2405.
    (5:300) set variable %stat to the value 1.
    (5:300) set variable %statTwo to the value 1.
    (5:300) set variable %statThree to the value 1.
    (5:300) set variable %Substep to the value 0.
    (5:250) set message ~nameHolder to { }.

    (5:166) make it impossible to pick up or drop items in region 5.
    (5:166) make it impossible to pick up or drop items in region 4.

    (5:54) make any furre present unable to lead and follow.
(0:58) When someone is summoned to the Dream,
    (5:112) make summoned furres arrive at the start of the Dream.

***********************************************************************************************************************
*Init timers* Clock Top
(0:0) When everything is starting up,
    (5:50) set countdown timer 400 to go off in 1 seconds.
    (5:300) set variable %npc_loop to the value 400.

*Tie all npc's to one tick of the game clock
*For each timer being used assign an npc to it
(0:49) When any countdown timer goes off,
    (5:327) set variable %timer to the number of the countdown timer that just went off.
    (5:301) copy the value of variable %timer into variable %wut_npc.
    (5:304) take variable %wut_npc and subtract 399 from it.
    (5:300) set variable %trig_npc to the value 0.
**************************************************************************************************************************



*if noone was in the dream when entered reset to generate new dungeon

(0:9) When someone arrives in the Dream,
 (1:200) and variable %inDream is equal to 0,
    (5:5) change item 2415 to item 0.
    (5:5) change item 2401 to item 0.
    (5:5) change item %mobOne to item 0.
    (5:5) change item %mobTwo to item 0.
    (5:5) change item %mobThree to item 0.
    (5:5) change item 305 to item 0.
    (5:5) change item 306 to item 0.
    (5:5) change item 307 to item 0.
    (5:5) change item 308 to item 0.
    (5:5) change item 309 to item 0.
    (5:5) change item 310 to item 0.
    (5:5) change item 58 to item 0.
*We are going to use a dummy player to track the stats of all npcs*
    (5:631) forget all PhoenixSpeak info about the player named {N}.
    (5:5) change item 1398 to item 0


    (5:139) show effects in region 6 to everyone that can see there.


   (4:1) only where the floor is 500,
    (5:150) place overlay effect 0.
    (5:120) make this/these location(s) part of region 5.
    (5:5) change item 1143 to item 0.
    (5:5) change item 1135 to item 0.
    (5:1) set the floor to 161.

   (4:0) clear all filtering,
    (5:300) set variable %step to the value 0.
    (5:300) set variable %hallCount to the value 0.
    (5:300) set variable %roomCount to the value 0.
    (5:300) set variable %debrisCount to the value 0.
    (5:300) set variable %mobCount to the value 0.
    (5:300) set variable %stat to the value 1.
    (5:300) set variable %statTwo to the value 1.
    (5:300) set variable %statThree to the value 1.
    (5:300) set variable %Substep to the value 0.
    (5:300) set variable %inDungeon to the value 0.

*In wanderer tuple, add in the shape variations for the npc*
*Variation number in () followed by the item number, and then a ( if its at the end of the string*
    (5:250) set message ~wanderer_tuple to { (1)305(2)306(3)307(4)308(5)309(6)310( }.
*set wanderer_diversity to the number of entries in wanderer_tuple*
    (5:300) set variable %wanderer_diversity to the value 6.

    (5:300) set variable %level to the value 1.

 
*Normal entry into dream.

(0:9) When a furre arrives in the dream,
    (5:302) take variable %inDream and add 1 to it.
    (5:302) take variable %inSafe and add 1 to it.
    (5:180) show the triggering furre's DragonSpeak Button 11.
    (5:180) show the triggering furre's DragonSpeak Button 12.
    (5:180) show the triggering furre's DragonSpeak Button 13.
    (5:180) show the triggering furre's DragonSpeak Button 14.
    (5:180) show the triggering furre's DragonSpeak Button 15.
    (5:180) show the triggering furre's DragonSpeak Button 16.
    (5:180) show the triggering furre's DragonSpeak Button 17.
    (5:180) show the triggering furre's DragonSpeak Button 18.
    (5:180) show the triggering furre's DragonSpeak Button 19.
    (5:180) show the triggering furre's DragonSpeak Button 20.

    (5:15) move the triggering furre to (18,28), or to someplace nearby if it's occupied.
    (5:200) emit message {Getting further in development, Basic Ai now functioning, 100 levels of randomly generated mazes.  The further down you go the bigger the maze.} to the triggering furre.

    (5:200) emit message {For more information on this project visit my blog here. Updates Saturdays, The F tab has remaining menu options} to the triggering furre.

    (5:76) place item 58 in the triggering furre's paws.





*badd Entry Solution?

(0:9) When someone arrives in the Dream,
 (1:185) and the triggering furre (didn't move from/isn't standing in) region 4,
    (5:15) move the triggering furre to (18,28), or to someplace nearby if it's occupied.







(0:10) When someone leaves the Dream,
 (1:85) and the triggering furre (moved from/is standing in) region 4,
    (5:304) take variable %inSafe and subtract 1 from it.

(0:10) When someone leaves the Dream,
    (5:304) take variable %inDream and subtract 1 from it.


(0:49) When any countdown timer goes off,
   (4:30) only in region 1,
    (5:1) set the floor to 161.



(0:49) When any countdown timer goes off,
    (5:433) jump the animation of DragonSpeak Button 11 to step %level for everyone in the Dream.


**SECTION**  Encyclopedia
*This area will hold all the data for enemies and weapons and such.  For easy pulling into loot tables and enemy tables
*so the code doesnt have to be reiterated for each level.

*monster information

*model

*hp

*behavior type

*name

*one model#, two hp, three ap, four class, five armor

(0:49) When any countdown timer goes off,
 (1:201) and variable %level is more than 0,
 (1:202) and variable %level is less than 101,
    (5:250) set message ~mobOne to { (1)2405(2)20(3)10(4)1(5)1( }.
    (5:250) set message ~mobTwo to { (1)2407(2)10(3)10(4)2(5)1( }.
    (5:250) set message ~mobThree to { (1)2408(2)30(3)10(4)1(5)1( }.


**SECTION**  Player Information

*When someone enters dream create stats for that individual.

*The stat system will not be based on GURPS.  There will be no underlaying stats to roll against.
*Combat will be basic rolls of Weapon strength versus armor class.  There will be situations where 0 damage will occur.
*As combat will be Time based players will have Action Points Comonly known as AP to perform between rounds.
*Action Points will be spent on movement and abilities.
*Stats will be given by equipment.
*Equipables will be Weapon, Armor, Clothes, 2 rings, 1 necklace


*Baseline

*hp - which always be 100 as in a percent of health.
*Armor class - From armor clothes and accessories
*Attack - random from weapon, plus baseline added from all equipment.
*Action points - base is 10 can be added to by acc and clothes and weapon and subtracted by armor


*initialize equipment

*Weapon # - draw from encyclopedia add to stats

*Armor # - draw from encylopedia add to stats

*clothes # - draw from encylopedia add to stats

*ring1 # - draw from encylopedia add to stats

*ring2 # - draw from encylpedia add to stats

*necklace1n # - draw from encylopedia add to stats




**SECTION**  Basic Player Actions
*currently in the works.

*forgot to mention in article code in basic player action also made by El Furriando

*basic F3 for testing and attacking*
*Depending on the direction the player is facing grab the position directly in front of them.
(0:16) When someone uses any item,
    (5:350) set variable %temp to the X,Y position the triggering player (moved from/is standing at).
(0:16) When someone uses any item,
 (1:13) and they are facing northeast (up and right),
    (5:352) move the position in variable %temp northeast (up and right) 1 step(s).
(0:16) When someone uses any item,
 (1:14) and they are facing southeast (down and right),
    (5:353) move the position in variable %temp southeast (down and right) 1 step(s).
(0:16) When someone uses any item,
 (1:15) and they are facing southwest (down and left),
    (5:354) move the position in variable %temp southwest (down and left) 1 step(s).
(0:16) When someone uses any item,
 (1:16) and they are facing northwest (up and left),
    (5:355) move the position in variable %temp northwest (up and left) 1 step(s).

*check to see if there is anything in the position in front of the player
*if there is information about that position and put it into a reference variable
*using the reference variable access the rest of the data Health(max),Sub Health,Action Points,Class,Defense, and turn
*perform the the attack check and commit that check to the database
*Then emit the information about the monster to the one who attacked it.
(0:16) When someone uses any item,
 (1:615) and the PhoenixSpeak info {%temp.x %temp.y} about the player named {N} exists,
    (5:611) remember the PhoenixSpeak info {%temp.x %temp.y} about the player named {N}, and put it in variable %temp1.
    (5:611) remember the PhoenixSpeak info {%temp1 h} about the player named {N}, and put it in variable %emit_health.
    (5:611) remember the PhoenixSpeak info {%temp1 h} about the player named {N}, and put it in variable %emit_sub_health.
    (5:611) remember the PhoenixSpeak info {%temp1 a} about the player named {N}, and put it in variable %emit_ap.
    (5:611) remember the PhoenixSpeak info {%temp1 c} about the player named {N}, and put it in variable %emit_class.
    (5:611) remember the PhoenixSpeak info {%temp1 d} about the player named {N}, and put it in variable %emit_defense.
    (5:611) remember the PhoenixSpeak info {%temp1 t} about the player named {N}, and put it in variable %emit_turn.
    (5:304) take variable %emit_sub_health and subtract 1 from it.
    (5:601) memorize that the PhoenixSpeak info {%temp1 h} about the player named {N} will now be %emit_sub_health.
    (5:200) emit message {My ID is %temp1} to the triggering player.
    (5:200) emit message {My HP was %emit_health, but its now %emit_sub_health} to the triggering player.
    (5:200) emit message {I have %emit_ap action points.} to the triggering player.
    (5:200) emit message {My class number is %emit_class} to the triggering player.
    (5:200) emit message {My defense is %emit_defense} to the triggering player.
    (5:200) emit message {I am on turn %emit_turn} to the triggering player.



**SECTION**  Level Initilization Protocal and map clear
 
*spoken Reload - clear map of all previous information


(0:3) When someone moves into item 1135,
    (5:901) popup a Yes/No dialog with request number 1 and message {Once you go to the safe room you can not re-enter this level. Proceed?} for the triggering furre.


(0:86) When someone clicks Yes for request number 1,
    (5:54) make any furre present unable to lead and follow.
    (5:15) move the triggering furre to (18,28), or to someplace nearby if it's occupied.
    (5:5) change item 1332 to item 1802.
    (5:302) take variable %inSafe and add 1 to it.

*bug workaround not elegent but it will fix a bug that happens when two people try to exit a dungeon level at the same time.



*temporary when level 100 reached go back to level one
(0:86) When someone clicks Yes for request number 1,
 (1:203) and variable %inSafe is equal to variable %inDream,
 (1:200) and variable %level is equal to 100,
    (5:31) play midi 2 to everyone on the map.
    (5:201) emit message {Congratulations!!!  You have cleared 100 Floors. :D} to any furre present.

    (5:300) set variable %level to the value 0.

*change to ds button to avoid horrible console bleep
*clear old map data to prepare space for new level, increment Level.
(0:86) When someone clicks Yes for request number 1,
 (1:203) and variable %inSafe is equal to variable %inDream,
    (5:5) change item 2415 to item 0.
    (5:5) change item 2401 to item 0.
    (5:5) change item %mobOne to item 0.
    (5:5) change item %mobTwo to item 0.
    (5:5) change item %mobThree to item 0.
    (5:5) change item 305 to item 0.
    (5:5) change item 306 to item 0.
    (5:5) change item 307 to item 0.
    (5:5) change item 308 to item 0.
    (5:5) change item 309 to item 0.
    (5:5) change item 310 to item 0.
    (5:5) change item 58 to item 0.
*We are going to use a dummy player to track the stats of all npcs*
    (5:631) forget all PhoenixSpeak info about the player named {N}.
    (5:5) change item 1398 to item 0


    (5:139) show effects in region 6 to everyone that can see there.


   (4:1) only where the floor is 500,
    (5:150) place overlay effect 0.
    (5:120) make this/these location(s) part of region 5.
    (5:5) change item 1143 to item 0.
    (5:5) change item 1135 to item 0.
    (5:1) set the floor to 161.
 
   (4:0) clear all filtering,
    (5:300) set variable %step to the value 0.
    (5:300) set variable %hallCount to the value 0.
    (5:300) set variable %roomCount to the value 0.
    (5:300) set variable %debrisCount to the value 0.
    (5:300) set variable %mobCount to the value 0.
    (5:300) set variable %stat to the value 1.
    (5:300) set variable %statTwo to the value 1.
    (5:300) set variable %statThree to the value 1.
    (5:300) set variable %Substep to the value 0.
    (5:300) set variable %inDungeon to the value 0.
    (5:250) set message ~nameHolder to { }.


*In wanderer tuple, add in the shape variations for the npc*
*Variation number in () followed by the item number, and then a ( if its at the end of the string*
    (5:250) set message ~wanderer_tuple to { (1)2405(2)2405(3)2405(4)2405(5)2405(6)2405( }.
*set wanderer_diversity to the number of entries in wanderer_tuple*
    (5:300) set variable %wanderer_diversity to the value 6.

    (5:302) take variable %level and add 1 to it.


 
*teleport into dream

(0:3) When someone moves into item 1332,
    (5:54) make any furre present unable to lead and follow.
    (5:15) move the triggering furre to (%entrance), or to someplace nearby if it's occupied.
    (5:302) take variable %inDungeon and add 1 to it.
    (5:252) set message ~newName to the triggering furre's name.
    (5:257) take message ~nameHolder and add {(%inDungeon)~newName} onto the end of it.
    (5:304) take variable %inSafe and subtract 1 from it.





*For Debuging

(0:32) When someone says something with {teleport} in it,
 (1:117) and the triggering furre (didn't move from/isn't standing at) floor 500,
   (4:2) only where the floor is not 8,
    (5:15) move the triggering furre to (%entrance), or to someplace nearby if it's occupied.

 
**SECTION**  Load Mob Data From Encyclopedia
*grabs data from the encyclopedia


(0:49) When any countdown timer goes off,
 (1:200) and variable %Substep is equal to 0,
    (5:251) copy message ~mobOne onto message ~temp.
    (5:283) set variable %temp to the total number of characters before {(%stat)} appears in message ~temp (or zero if not found).
    (5:274) chop off the beginning of message ~temp, removing the first %temp characters of it.
    (5:278) remove the first 1 copies of {(%stat)} from message ~temp.
    (5:282) set variable %mobOneSprt to the first number in ~temp.
    (5:302) take variable %stat and add 1 to it.

    (5:283) set variable %temp to the total number of characters before {(%stat)} appears in message ~temp (or zero if not found).
    (5:274) chop off the beginning of message ~temp, removing the first %temp characters of it.
    (5:278) remove the first 1 copies of {(%stat)} from message ~temp.
    (5:282) set variable %mobOneHP to the first number in ~temp.

    (5:302) take variable %stat and add 1 to it.

    (5:283) set variable %temp to the total number of characters before {(%stat)} appears in message ~temp (or zero if not found).
    (5:274) chop off the beginning of message ~temp, removing the first %temp characters of it.
    (5:278) remove the first 1 copies of {(%stat)} from message ~temp.
    (5:282) set variable %mobOneAP to the first number in ~temp.

    (5:302) take variable %stat and add 1 to it.

    (5:283) set variable %temp to the total number of characters before {(%stat)} appears in message ~temp (or zero if not found).
    (5:274) chop off the beginning of message ~temp, removing the first %temp characters of it.
    (5:278) remove the first 1 copies of {(%stat)} from message ~temp.
    (5:282) set variable %mobOneAI to the first number in ~temp.

    (5:302) take variable %stat and add 1 to it.

    (5:283) set variable %temp to the total number of characters before {(%stat)} appears in message ~temp (or zero if not found).
    (5:274) chop off the beginning of message ~temp, removing the first %temp characters of it.
    (5:278) remove the first 1 copies of {(%stat)} from message ~temp.
    (5:282) set variable %mobOneAC to the first number in ~temp.

    (5:302) take variable %Substep and add 1 to it.


*For second Mob
(0:49) When any countdown timer goes off,
 (1:200) and variable %Substep is equal to 1,
    (5:251) copy message ~mobTwo onto message ~tempTwo.
    (5:283) set variable %tempTwo to the total number of characters before {(%statTwo)} appears in message ~tempTwo (or zero if not found).
    (5:274) chop off the beginning of message ~tempTwo, removing the first %tempTwo characters of it.
    (5:278) remove the first 1 copies of {(%statTwo)} from message ~tempTwo.
    (5:282) set variable %mobTwoSprt to the first number in ~tempTwo.

    (5:302) take variable %statTwo and add 1 to it.

    (5:283) set variable %tempTwo to the total number of characters before {(%statTwo)} appears in message ~tempTwo (or zero if not found).
    (5:274) chop off the beginning of message ~tempTwo, removing the first %tempTwo characters of it.
    (5:278) remove the first 1 copies of {(%statTwo)} from message ~tempTwo.
    (5:282) set variable %mobTwoHP to the first number in ~tempTwo.

    (5:302) take variable %statTwo and add 1 to it.

    (5:283) set variable %tempTwo to the total number of characters before {(%statTwo)} appears in message ~tempTwo (or zero if not found).
    (5:274) chop off the beginning of message ~tempTwo, removing the first %tempTwo characters of it.
    (5:278) remove the first 1 copies of {(%statTwo)} from message ~tempTwo.
    (5:282) set variable %mobTwoAP to the first number in ~tempTwo.

    (5:302) take variable %statTwo and add 1 to it.

    (5:283) set variable %tempTwo to the total number of characters before {(%statTwo)} appears in message ~tempTwo (or zero if not found).
    (5:274) chop off the beginning of message ~tempTwo, removing the first %tempTwo characters of it.
    (5:278) remove the first 1 copies of {(%statTwo)} from message ~tempTwo.
    (5:282) set variable %mobTwoAI to the first number in ~tempTwo.

    (5:302) take variable %statTwo and add 1 to it.

    (5:283) set variable %tempTwo to the total number of characters before {(%statTwo)} appears in message ~tempTwo (or zero if not found).
    (5:274) chop off the beginning of message ~tempTwo, removing the first %tempTwo characters of it.
    (5:278) remove the first 1 copies of {(%statTwo)} from message ~tempTwo.
    (5:282) set variable %mobTwoAC to the first number in ~tempTwo.

    (5:302) take variable %Substep and add 1 to it.

*For Third Mob
(0:49) When any countdown timer goes off,
 (1:200) and variable %Substep is equal to 2,
    (5:251) copy message ~mobThree onto message ~tempThree.
    (5:283) set variable %tempThree to the total number of characters before {(%statThree)} appears in message ~tempThree (or zero if not found).
    (5:274) chop off the beginning of message ~tempThree, removing the first %tempThree characters of it.
    (5:278) remove the first 1 copies of {(%statThree)} from message ~tempThree.
    (5:282) set variable %mobThreeSprt to the first number in ~tempThree.

    (5:302) take variable %statThree and add 1 to it.

    (5:283) set variable %tempThree to the total number of characters before {(%statThree)} appears in message ~tempThree (or zero if not found).
    (5:274) chop off the beginning of message ~tempThree, removing the first %tempThree characters of it.
    (5:278) remove the first 1 copies of {(%statThree)} from message ~tempThree.
    (5:282) set variable %mobThreeHP to the first number in ~tempThree.

    (5:302) take variable %statThree and add 1 to it.

    (5:283) set variable %tempThree to the total number of characters before {(%statThree)} appears in message ~tempThree (or zero if not found).
    (5:274) chop off the beginning of message ~tempThree, removing the first %tempThree characters of it.
    (5:278) remove the first 1 copies of {(%statThree)} from message ~tempThree.
    (5:282) set variable %mobThreeAP to the first number in ~tempThree.

    (5:302) take variable %statThree and add 1 to it.

    (5:283) set variable %tempThree to the total number of characters before {(%statThree)} appears in message ~tempThree (or zero if not found).
    (5:274) chop off the beginning of message ~tempThree, removing the first %tempThree characters of it.
    (5:278) remove the first 1 copies of {(%statThree)} from message ~tempThree.
    (5:282) set variable %mobThreeAI to the first number in ~tempThree.

    (5:302) take variable %statThree and add 1 to it.

    (5:283) set variable %tempThree to the total number of characters before {(%statThree)} appears in message ~tempThree (or zero if not found).
    (5:274) chop off the beginning of message ~tempThree, removing the first %tempThree characters of it.
    (5:278) remove the first 1 copies of {(%statThree)} from message ~tempThree.
    (5:282) set variable %mobThreeAC to the first number in ~tempThree.

    (5:302) take variable %Substep and add 1 to it.

**SECTION**  Build Halls


*set up the paramaters for current dungeon.  Number of hallways and number of rooms. Fetch start position.
(0:49) When any countdown timer goes off,
 (1:200) and variable %step is equal to 0,
    (5:301) copy the value of variable %level into variable %halls.
    (5:302) take variable %halls and add 2 to it.

    (5:301) copy the value of variable %level into variable %rooms.
    (5:308) divide variable %rooms by 4 and put the remainder in variable %holdMe.

    (5:532) set variable %start to the X,Y position of a random spot where the item is 40 somewhere in the Dream.
    (5:300) set variable %step to the value 1.





*if to many attempts made move place item to a hall and try again.
(0:49) When any countdown timer goes off,
 (1:200) and variable %step is equal to 1,
 (1:200) and variable %attempt is equal to 2,
    (5:5) change item 40 to item 0.
    (5:300) set variable %attempt to the value 0.
   (4:1) only where the floor is 500,
    (5:512) set variable %newPath to the X,Y position of a random spot where the floor is 500 somewhere in the Dream.
    (5:41) place item 40 at (%newPath).
    (5:300) set variable %step to the value 0.


*if all halls are laid start building rooms

(0:49) When any countdown timer goes off,
 (1:200) and variable %step is equal to 1,
 (1:203) and variable %hallCount is equal to variable %halls,
    (5:300) set variable %step to the value 6.


*choose direction and distance for halway.
(0:49) When any countdown timer goes off,
 (1:200) and variable %step is equal to 1,
 (1:202) and variable %attempt is less than 2,

 (1:205) and variable %hallCount is less than variable %halls,
    (5:312) set variable %length to the total of rolling 1 dice with 3 sides plus 8.
    (5:312) set variable %direction to the total of rolling 1 dice with 4 sides plus 0.



    (5:301) copy the value of variable %start into variable %check.
    (5:301) copy the value of variable %start into variable %rightLane.
    (5:301) copy the value of variable %start into variable %leftLane.

    (5:300) set variable %checkR to the value 1.
    (5:300) set variable %checkF to the value 1.

    (5:300) set variable %step to the value 2.

*preload paramaters for checks and adjacent lanes depending on direction roll.

(0:49) When any countdown timer goes off,
 (1:200) and variable %step is equal to 2,
 (1:200) and variable %direction is equal to 1,
    (5:352) move the position in variable %check northeast (up and right) %length step(s).
    (5:355) move the position in variable %leftLane northwest (up and left) 1 step(s).
    (5:353) move the position in variable %rightLane southeast (down and right) 1 step(s).

    (5:320) set variable %checkR to the region number (%check) is part of.
    (5:380) set variable %checkF to the floor type at (%check).
    (5:300) set variable %step to the value 3.



(0:49) When any countdown timer goes off,
 (1:200) and variable %step is equal to 2,
 (1:200) and variable %direction is equal to 2,
    (5:353) move the position in variable %check southeast (down and right) %length step(s).
    (5:352) move the position in variable %leftLane northeast (up and right) 1 step(s).
    (5:354) move the position in variable %rightLane southwest (down and left) 1 step(s).

    (5:320) set variable %checkR to the region number (%check) is part of.
    (5:380) set variable %checkF to the floor type at (%check).

    (5:300) set variable %step to the value 3.


(0:49) When any countdown timer goes off,
 (1:200) and variable %step is equal to 2,
 (1:200) and variable %direction is equal to 3,
    (5:354) move the position in variable %check southwest (down and left) %length step(s).
    (5:353) move the position in variable %leftLane southeast (down and right) 1 step(s).
    (5:355) move the position in variable %rightLane northwest (up and left) 1 step(s).

    (5:320) set variable %checkR to the region number (%check) is part of.
    (5:380) set variable %checkF to the floor type at (%check).

    (5:300) set variable %step to the value 3.


(0:49) When any countdown timer goes off,
 (1:200) and variable %step is equal to 2,
 (1:200) and variable %direction is equal to 4,
    (5:355) move the position in variable %check northwest (up and left) %length step(s).
    (5:354) move the position in variable %leftLane southwest (down and left) 1 step(s).
    (5:352) move the position in variable %rightLane northeast (up and right) 1 step(s).

    (5:320) set variable %checkR to the region number (%check) is part of.
    (5:380) set variable %checkF to the floor type at (%check).

    (5:300) set variable %step to the value 3.


*check to make sure that the path will be made in an acceptable area.

(0:49) When any countdown timer goes off,
 (1:200) and variable %step is equal to 3,
 (1:200) and variable %checkR is equal to 1,
    (5:302) take variable %attempt and add 1 to it.

    (5:300) set variable %step to the value 1.

(0:49) When any countdown timer goes off,
 (1:200) and variable %step is equal to 3,
 (1:200) and variable %checkF is equal to 500,
    (5:302) take variable %attempt and add 1 to it.

    (5:300) set variable %step to the value 1.

(0:49) When any countdown timer goes off,
 (1:200) and variable %step is equal to 3,
 (1:200) and variable %checkR is equal to 5,
 (1:200) and variable %checkF is equal to 161,
    (5:300) set variable %step to the value 4.


*placemarkers at start and finish of each hallway for possible room placement

(0:49) When any countdown timer goes off,
 (1:200) and variable %step is equal to 4,
    (5:121) make location (%check) part of region 2.
    (5:41) place item 1324 at (%check).
    (5:121) make location (%start) part of region 2.
    (5:41) place item 0 at (%start).
    (5:300) set variable %step to the value 5.




*placefloors in the length and direction of the hallway one itteration for each lane ending with the the middle lane increasing the count and step.

*going northeast

(0:49) When any countdown timer goes off,
 (1:200) and variable %step is equal to 5,
 (1:200) and variable %direction is equal to 1,
  (3:16) in a line starting at (%leftLane) and going 1 more spaces southwest.
    (5:1) set the floor to 500.

(0:49) When any countdown timer goes off,
 (1:200) and variable %step is equal to 5,
 (1:200) and variable %direction is equal to 1,
  (3:14) in a line starting at (%leftLane) and going %length more spaces northeast.
    (5:1) set the floor to 500.

(0:49) When any countdown timer goes off,
 (1:200) and variable %step is equal to 5,
 (1:200) and variable %direction is equal to 1,
  (3:16) in a line starting at (%start) and going 1 more spaces southwest.
    (5:1) set the floor to 500.


(0:49) When any countdown timer goes off,
 (1:200) and variable %step is equal to 5,
 (1:200) and variable %direction is equal to 1,
  (3:16) in a line starting at (%rightLane) and going 1 more spaces southwest.
    (5:1) set the floor to 500.

(0:49) When any countdown timer goes off,
 (1:200) and variable %step is equal to 5,
 (1:200) and variable %direction is equal to 1,
  (3:14) in a line starting at (%rightLane) and going %length more spaces northeast.
    (5:1) set the floor to 500.

(0:49) When any countdown timer goes off,
 (1:200) and variable %step is equal to 5,
 (1:200) and variable %direction is equal to 1,
  (3:14) in a line starting at (%start) and going %length more spaces northeast.
    (5:1) set the floor to 500.
    (5:352) move the position in variable %start northeast (up and right) %length step(s).
    (5:302) take variable %hallCount and add 1 to it.
    (5:300) set variable %step to the value 1.




*going southeast

(0:49) When any countdown timer goes off,
 (1:200) and variable %step is equal to 5,
 (1:200) and variable %direction is equal to 2,
  (3:17) in a line starting at (%leftLane) and going 1 more spaces northwest.
    (5:1) set the floor to 500.

(0:49) When any countdown timer goes off,
 (1:200) and variable %step is equal to 5,
 (1:200) and variable %direction is equal to 2,
  (3:15) in a line starting at (%leftLane) and going %length more spaces southeast.
    (5:1) set the floor to 500.

(0:49) When any countdown timer goes off,
 (1:200) and variable %step is equal to 5,
 (1:200) and variable %direction is equal to 2,
  (3:17) in a line starting at (%start) and going 1 more spaces northwest.
    (5:1) set the floor to 500.

(0:49) When any countdown timer goes off,
 (1:200) and variable %step is equal to 5,
 (1:200) and variable %direction is equal to 2,
  (3:17) in a line starting at (%rightLane) and going 1 more spaces northwest.
    (5:1) set the floor to 500.

(0:49) When any countdown timer goes off,
 (1:200) and variable %step is equal to 5,
 (1:200) and variable %direction is equal to 2,
  (3:15) in a line starting at (%rightLane) and going %length more spaces southeast.
    (5:1) set the floor to 500.

(0:49) When any countdown timer goes off,
 (1:200) and variable %step is equal to 5,
 (1:200) and variable %direction is equal to 2,
  (3:15) in a line starting at (%start) and going %length more spaces southeast.
    (5:1) set the floor to 500.
    (5:353) move the position in variable %start southeast (down and right) %length step(s).
    (5:302) take variable %hallCount and add 1 to it.
    (5:300) set variable %step to the value 1.



*going southwest


(0:49) When any countdown timer goes off,
 (1:200) and variable %step is equal to 5,
 (1:200) and variable %direction is equal to 3,
  (3:14) in a line starting at (%leftLane) and going 1 more spaces northeast.
    (5:1) set the floor to 500.

(0:49) When any countdown timer goes off,
 (1:200) and variable %step is equal to 5,
 (1:200) and variable %direction is equal to 3,
  (3:16) in a line starting at (%leftLane) and going %length more spaces southwest.
    (5:1) set the floor to 500.

(0:49) When any countdown timer goes off,
 (1:200) and variable %step is equal to 5,
 (1:200) and variable %direction is equal to 3,
  (3:14) in a line starting at (%start) and going 1 more spaces northeast.
    (5:1) set the floor to 500.

(0:49) When any countdown timer goes off,
 (1:200) and variable %step is equal to 5,
 (1:200) and variable %direction is equal to 3,
  (3:14) in a line starting at (%rightLane) and going 1 more spaces northeast.
    (5:1) set the floor to 500.


(0:49) When any countdown timer goes off,
 (1:200) and variable %step is equal to 5,
 (1:200) and variable %direction is equal to 3,
  (3:16) in a line starting at (%rightLane) and going %length more spaces southwest.
    (5:1) set the floor to 500.


(0:49) When any countdown timer goes off,
 (1:200) and variable %step is equal to 5,
 (1:200) and variable %direction is equal to 3,
  (3:16) in a line starting at (%start) and going %length more spaces southwest.
    (5:1) set the floor to 500.
    (5:354) move the position in variable %start southwest (down and left) %length step(s).
    (5:302) take variable %hallCount and add 1 to it.
    (5:300) set variable %step to the value 1.



*going northwest

(0:49) When any countdown timer goes off,
 (1:200) and variable %step is equal to 5,
 (1:200) and variable %direction is equal to 4,
  (3:15) in a line starting at (%leftLane) and going 1 more spaces southeast.
    (5:1) set the floor to 500.


(0:49) When any countdown timer goes off,
 (1:200) and variable %step is equal to 5,
 (1:200) and variable %direction is equal to 4,
  (3:17) in a line starting at (%leftLane) and going %length more spaces northwest.
    (5:1) set the floor to 500.


(0:49) When any countdown timer goes off,
 (1:200) and variable %step is equal to 5,
 (1:200) and variable %direction is equal to 4,
  (3:15) in a line starting at (%start) and going 1 more spaces southeast.
    (5:1) set the floor to 500.

(0:49) When any countdown timer goes off,
 (1:200) and variable %step is equal to 5,
 (1:200) and variable %direction is equal to 4,
  (3:15) in a line starting at (%rightLane) and going 1 more spaces southeast.
    (5:1) set the floor to 500.


(0:49) When any countdown timer goes off,
 (1:200) and variable %step is equal to 5,
 (1:200) and variable %direction is equal to 4,
  (3:17) in a line starting at (%rightLane) and going %length more spaces northwest.
    (5:1) set the floor to 500.


(0:49) When any countdown timer goes off,
 (1:200) and variable %step is equal to 5,
 (1:200) and variable %direction is equal to 4,
  (3:17) in a line starting at (%start) and going %length more spaces northwest.
    (5:1) set the floor to 500.
    (5:355) move the position in variable %start northwest (up and left) %length step(s).
    (5:302) take variable %hallCount and add 1 to it.
    (5:300) set variable %step to the value 1.



**SECTION**  Entrance and Exit



*Put the entrance at the location of the building guide item and the exit at the end of a random hall
*replace end hall regions with standard hall regions for laying the floor.

(0:49) When any countdown timer goes off,
 (1:200) and variable %step is equal to 6,
  (3:30) in region 2,
    (5:512) set variable %placeStart to the X,Y position of a random spot where the floor is 500 somewhere in the Dream.
    (5:300) set variable %step to the value 7.

(0:49) When any countdown timer goes off,
 (1:200) and variable %step is equal to 7,
    (5:41) place item 1143 at (%placeStart).
    (5:300) set variable %step to the value 8.


(0:49) When any countdown timer goes off,
 (1:200) and variable %step is equal to 8,
  (3:30) in region 2,
    (5:532) set variable %placeStart to the X,Y position of a random spot where the item is 1324 somewhere in the Dream.
    (5:300) set variable %step to the value 9.

(0:49) When any countdown timer goes off,
 (1:200) and variable %step is equal to 9,
    (5:41) place item 1135 at (%placeStart).
    (5:151) set location (%placeStart) to overlay effect 194.

    (5:300) set variable %step to the value 10.

(0:49) When any countdown timer goes off,
 (1:200) and variable %step is equal to 10,
 
    (5:532) set variable %entrance to the X,Y position of a random spot where the item is 1143 somewhere in the Dream.
    (5:5) change item 1802 to item 1332.
    (5:138) hide all effects in region 6 from everybody.
    (5:300) set variable %step to the value 11.


**SECTION**  Build Rooms

*preload room paramaters

(0:49) When any countdown timer goes off,
 (1:200) and variable %step is equal to 11,
 (1:205) and variable %roomCount is less than variable %rooms,
  (3:30) in region 2,
   (4:1) only where the floor is 500,
    (5:512) set variable %roomCenter to the X,Y position of a random spot where the floor is 500 somewhere in the Dream.
    (5:312) set variable %radius to the total of rolling  2 dice with 2 sides plus 1.
    (5:306) multiply variable %radius by 2.

    (5:121) make location (%roomCenter) part of region 5.

    (5:301) copy the value of variable %roomCenter into variable %roomTop.
    (5:301) copy the value of variable %roomCenter into variable %roomBottom.


    (5:305) take variable %roomTop.y and subtract variable %radius from it.
    (5:303) take variable %roomBottom.y and add variable %radius to it.
 
    (5:300) set variable %step to the value 12.


*In the Diamond that is the room lay the floor

(0:49) When any countdown timer goes off,
 (1:200) and variable %step is equal to 12,
  (3:3) within the diamond (%roomTop) - (%roomBottom),
    (5:1) set the floor to 8.
    (5:302) take variable %roomCount and add 1 to it.
    (5:300) set variable %step to the value 11.

*place treasure Chests - just because it fits well into the algorithm here

(0:49) When any countdown timer goes off,
 (1:200) and variable %step is equal to 11,
 (1:202) and variable %treasureCount is less than %treasures,
  (3:532) at a random spot somewhere in the Dream where the item is 1324,
    (5:4) place item 1159.



*Escape loop.

(0:49) When any countdown timer goes off,
 (1:200) and variable %step is equal to 11,
 (1:203) and variable %roomCount is equal to variable %rooms,

    (5:300) set variable %step to the value 13.

**SECTION**  Place Enemies into Level.


*preload Enemy information for level.

(0:49) When any countdown timer goes off,
 (1:200) and variable %step is equal to 13,
    (5:312) set variable %mobs to the total of rolling %rooms dice with 4 sides plus 0.
    (5:301) copy the value of variable %mobs into variable %wanderers.
    (5:300) set variable %step to the value 14.


*Start of Loop
(0:49) When any countdown timer goes off,
 (1:200) and variable %step is equal to 14,
 (1:205) and variable %mobCount is less than variable %mobs,
    (5:312) set variable %choice to the total of rolling 1 dice with 6 sides plus 0.
------------------------------------------------------------------------------------
*for each choice select which monster will be spawned in
*this section preloads information pulled from encyclopedia for each monster type.
*For Monster Type one
(0:49) When any countdown timer goes off,
 (1:200) and variable %step is equal to 14,
 (1:201) and variable %choice is more than 0,
 (1:202) and variable %choice is less than 4,
    (5:301) copy the value of variable %mobOneSprt into variable %mobSprt.
    (5:301) copy the value of variable %mobOneHP into variable %mobHP.
    (5:301) copy the value of variable %mobOneAP into variable %mobAP.
    (5:301) copy the value of variable %mobOneAI into variable %mobAI.
    (5:301) copy the value of variable %mobOneAC into variable %mobAC.
*For Monster Type two
(0:49) When any countdown timer goes off,
 (1:200) and variable %step is equal to 14,
 (1:201) and variable %choice is more than 3,
 (1:202) and variable %choice is less than 6,
    (5:301) copy the value of variable %mobTwoSprt into variable %mobSprt.
    (5:301) copy the value of variable %mobTwoHP into variable %mobHP.
    (5:301) copy the value of variable %mobTwoAP into variable %mobAP.
    (5:301) copy the value of variable %mobTwoAI into variable %mobAI.
    (5:301) copy the value of variable %mobTwoAC into variable %mobAC.
*For Monster Type 3
(0:49) When any countdown timer goes off,
 (1:200) and variable %step is equal to 14,
 (1:200) and variable %choice is equal to 6,
    (5:301) copy the value of variable %mobThreeSprt into variable %mobSprt.
    (5:301) copy the value of variable %mobThreeHP into variable %mobHP.
    (5:301) copy the value of variable %mobThreeAP into variable %mobAP.
    (5:301) copy the value of variable %mobThreeAI into variable %mobAI.
    (5:301) copy the value of variable %mobThreeAC into variable %mobAC.
-------------------------------------------------------------------------------------------------
*might not need wanderers.x/y since have %npc_loc.x/y

*Spawn wanderers*
(0:49) When any countdown timer goes off,
 (1:201) and variable %wanderers is more than 0,
    (5:312) set variable %wanderer_type to the total of rolling 1 dice with %wanderer_diversity sides plus 0.
    (5:251) copy message ~wanderer_tuple onto message ~temp.
    (5:283) set variable %temp to the total number of characters before {(%wanderer_type)} appears in message ~temp (or zero if not found).
    (5:274) chop off the beginning of message ~temp, removing the first %temp characters of it.
    (5:278) remove the first 1 copies of {(%wanderer_type)} from message ~temp.
    (5:282) set variable %wanderer_item to the first number in ~temp.
  (3:502) at a random spot somewhere in the Dream,
   (4:1) only where the floor is 8,
   (4:8) only where there are no items,
    (5:4) place item 1398.
   (4:0) clear all filtering,
    (5:532) set variable %npc_loc to the X,Y position of a random spot where the item is 1398 somewhere in the Dream.
    (5:41) place item %mobSprt at (%npc_loc).
*                        ^was wanderer_item which was for placing di

*MEMORIZE WANDERER POS*
    (5:601) memorize that the PhoenixSpeak info {%wanderers x} about the player named {N} will now be %npc_loc.x
    (5:601) memorize that the PhoenixSpeak info {%wanderers y} about the player named {N} will now be %npc_loc.y
*MEMORIZE WANDERER HP, SET TO 10 FOR NOW*
    (5:601) memorize that the PhoenixSpeak info {%wanderers h} about the player named {N} will now be %mobHP
*MEMORIZE WANDERER ACTION POINTS, SET TO 10 FOR NOW*
    (5:601) memorize that the PhoenixSpeak info {%wanderers a} about the player named {N} will now be %mobAP
*MEMORIZE WANDERER CLASS, SET TO 1 FOR NOW*
*CLASS IS STORED AS A NUMBER TO CONSERVE PS SPACE, BUT YOU COULD USE THAT VALUE TO COMPARE IT TO A STRING*
    (5:601) memorize that the PhoenixSpeak info {%wanderers c} about the player named {N} will now be %mobAI
*MEMORIZE WANDERER ARMOUR, SET TO 1 FOR NOW(Used D for defence, A is already being used for action points)*
    (5:601) memorize that the PhoenixSpeak info {%wanderers d} about the player named {N} will now be %mobAC
*MEMORIZE WANDERER TURN, SET TO 30 FOR NOW(repleneshes AP every 30 seconds)*
    (5:601) memorize that the PhoenixSpeak info {%wanderers t} about the player named {N} will now be 30
*Memorize wanderer inverted coordinate(for referencing)
    (5:601) memorize that the PhoenixSpeak info {%npc_loc.x %npc_loc.y} about the player named {N} will now be %wanderers.
*subtract 1 from spawn
    (5:304) take variable %wanderers and subtract 1 from it.
    (5:302) take variable %mobCount and add 1 to it.

*(5:204) emitloud message {NPC loc is %npc_loc.x %npc_loc.y} to everyone on the map.




*break Loop
(0:49) When any countdown timer goes off,
 (1:200) and variable %step is equal to 14,
 (1:203) and variable %mobCount is equal to variable %mobs,
    (5:2) change floor 8 to floor 500.
    (5:300) set variable %step to the value 16.




**SECTION**  Place random objects into level

*preload debris paramaters
(0:49) When any countdown timer goes off,
 (1:200) and variable %step is equal to 16,
    (5:312) set variable %debris to the total of rolling 2 dice with 8 sides plus 3.
    (5:300) set variable %step to the value 17.




(0:49) When any countdown timer goes off,
 (1:200) and variable %step is equal to 17,
 (1:202) and variable %debrisCount is less than %debris,
  (3:502) at a random spot somewhere in the Dream,
   (4:1) only where the floor is 500,
   (4:8) only where there are no items,
    (5:13) place a random item type between 1127 and 1127.
    (5:302) take variable %debrisCount and add 1 to it.

*Escape Loop

(0:49) When any countdown timer goes off,
 (1:200) and variable %step is equal to 17,
 (1:203) and variable %debrisCount is equal to variable %debris,
    (5:300) set variable %step to the value 18.

*place treasure Chests - just because it fits well into the algorithm here

(0:49) When any countdown timer goes off,
 (1:200) and variable %step is equal to 18,
    (5:5) change item 1324 to item 1159.
    (5:300) set variable %step to the value 19.



*put all ground walls in when ready. Loop for effect.

(0:49) When any countdown timer goes off,
 (1:200) and variable %step is equal to 19,
 (1:203) and variable %roomCount is equal to variable %rooms,
  (3:30) in region 5,
   (4:1) only where the floor is 161,
    (5:4) place item 2415.
    (5:302) take variable %step and add 1 to it.


**SECTION**  Mob AI
*Because 100 clocks are going off 100 of these codes are processed almost instantly
*so each time the timer sets go off wut_npc is icremented then this goes through and checks stuff
*ok I am pretty tired but I swear I know what this does.


*Process wanderer's AI*
*Get current npc*
(0:49) When any countdown timer goes off,
 (1:201) and variable %wut_npc is more than 0,
 (1:202) and variable %wut_npc is less than 101,
 (1:615) and the PhoenixSpeak info {%wut_npc x} about the player named {N} exists,
 (1:610) and the PhoenixSpeak info {%wut_npc c} about the furre named {N} is equal to 1,
    (5:300) set variable %trig_npc to the value 1.
    (5:611) remember the PhoenixSpeak info {%wut_npc x} about the player named {N}, and put it in variable %npc.x
    (5:611) remember the PhoenixSpeak info {%wut_npc y} about the player named {N}, and put it in variable %npc.y
    (5:611) remember the PhoenixSpeak info {%wut_npc t} about the player named {N}, and put it in variable %npc_turn
    (5:611) remember the PhoenixSpeak info {%wut_npc a} about the player named {N}, and put it in variable %npc_ap
    (5:301) copy the value of variable %npc into variable %npc_NE
    (5:301) copy the value of variable %npc into variable %npc_SE
    (5:301) copy the value of variable %npc into variable %npc_SW
    (5:301) copy the value of variable %npc into variable %npc_NW
    (5:352) move the position in variable %npc_NE northeast (up and right) 1 step(s).
    (5:353) move the position in variable %npc_SE southeast (down and right) 1 step(s).
    (5:354) move the position in variable %npc_SW southwest (down and left) 1 step(s).
    (5:355) move the position in variable %npc_NW northwest (up and left) 1 step(s).
    (5:312) set variable %NPC_dir to the total of rolling 1 dice with 4 sides plus 0.
    (5:312) set variable %NPC_move to the total of rolling 1 dice with 3 sides plus 0.

*MOVE NE
(0:49) When any countdown timer goes off,
 (1:200) and variable %NPC_dir is equal to 1,
    (5:301) copy the value of variable %npc_NE into variable %new_pos.
*MOVE SE
(0:49) When any countdown timer goes off,
 (1:200) and variable %NPC_dir is equal to 2,
    (5:301) copy the value of variable %npc_SE into variable %new_pos.
*MOVE SW
(0:49) When any countdown timer goes off,
 (1:200) and variable %NPC_dir is equal to 3,
    (5:301) copy the value of variable %npc_SW into variable %new_pos.
*MOVE NW
(0:49) When any countdown timer goes off,
 (1:200) and variable %NPC_dir is equal to 4,
    (5:301) copy the value of variable %npc_NW into variable %new_pos.

(0:49) When any countdown timer goes off,
 (1:615) and the PhoenixSpeak info {%wut_npc x} about the player named {N} exists,
*make sure an NPC is being triggered
 (1:200) and variable %trig_npc is equal to 1,
*make sure the 33% chance was triggered
 (1:200) and variable %NPC_move is equal to 1,
*Check action points*
 (1:201) and variable %npc_ap is more than 0,
*Check to  make sure npc isn't adjacent to a player*
 (1:1101) and there's no one at (%npc_NE),
 (1:1101) and there's no one at (%npc_SE),
 (1:1101) and there's no one at (%npc_SW),
 (1:1101) and there's no one at (%npc_NW),
*check the new location to make sure its clear*
 (1:1011) and position (%new_pos) is floor 500,
 (1:1013) and position (%new_pos) is item 0,
*get old sprite*
    (5:381) set variable %npcitem to the item type at (%npc).
*clear old sprite*
    (5:41) place item 0 at (%npc).
*place new object*
    (5:41) place item %npcitem at (%new_pos).
*subtract action point*
    (5:304) take variable %npc_ap and subtract 1 from it.
*commit changes to memory*
    (5:601) memorize that the PhoenixSpeak info {%wut_npc x} about the player named {N} will now be %new_pos.x
    (5:601) memorize that the PhoenixSpeak info {%wut_npc y} about the player named {N} will now be %new_pos.y
    (5:601) memorize that the PhoenixSpeak info {%wut_npc a} about the player named {N} will now be %npc_ap.
    (5:635) forget the PhoenixSpeak info {%npc.x %npc.y} about the player named {N}.
    (5:601) memorize that the PhoenixSpeak info {%new_pos.x %new_pos.y} about the player named {N} will now be %wut_npc.

*Subtract 1 from turn*
(0:49) When any countdown timer goes off,
 (1:615) and the PhoenixSpeak info {%wut_npc x} about the player named {N} exists,
*make sure an NPC is being triggered
 (1:200) and variable %trig_npc is equal to 1,
 (1:201) and variable %npc_turn is more than 0,
    (5:304) take variable %npc_turn and subtract 1 from it.
    (5:601) memorize that the PhoenixSpeak info {%wut_npc t} about the player named {N} will now be %npc_turn.

*reset turns to 30 if at 0*
(0:49) When any countdown timer goes off,
 (1:615) and the PhoenixSpeak info {%wut_npc x} about the player named {N} exists,
*make sure an NPC is being triggered
 (1:200) and variable %trig_npc is equal to 1,
 (1:200) and variable %npc_turn is equal to 0,
    (5:601) memorize that the PhoenixSpeak info {%wut_npc t} about the player named {N} will now be 30.
    (5:601) memorize that the PhoenixSpeak info {%wut_npc a} about the player named {N} will now be 10.





**SECTION**  Vision

*Set Vision Area paramaters.  A that starts where furre is and goes two spaces down to the bottom of the diamond.



*break Loop
(0:49) When any countdown timer goes off,
 (1:201) and variable %nameCount is more than %inDungeon,
    (5:300) set variable %nameCount to the value 1.

*cleanup effect turns see through walls to solid walls again.
(0:49) When any countdown timer goes off,
 (1:201) and variable %timer is more than 399,
 (1:202) and variable %timer is less than 401,
    (5:5) change item 2401 to item 2415.

*top part protects against out of bounds
(0:49) When any countdown timer goes off,
 (1:201) and variable %timer is more than 399,
 (1:202) and variable %timer is less than 500,

*name holder comes from Level intiization code at bottom.  Names saved when Entered portal, Cleared when level resets.
*Finds names stored in booleon and seperates them using a numbered system.
    (5:301) copy the value of variable %nameCount into variable %nameID.
    (5:251) copy message ~nameHolder onto message ~nameGrab.
    (5:283) set variable %nameSpace to the total number of characters before {(%nameID)} appears in message ~nameGrab (or zero if not found).
    (5:274) chop off the beginning of message ~nameGrab, removing the first %nameSpace characters of it.
    (5:278) remove the first 1 copies of {(%nameID)} from message ~nameGrab.
    (5:302) take variable %nameID and add 1 to it.
    (5:284) set variable %nameSpace to the total number of characters after the first place {(%nameID)} appears in message ~nameGrab (or zero if not found).
    (5:273) chop off the end of message ~nameGrab, removing the last %nameSpace characters of it.
    (5:278) remove the first 1 copies of {(%nameID)} from message ~nameGrab.


    (5:56) make the furre named {~nameGrab} the new triggering furre, if they're in the Dream right now.
    (5:350) set variable %visionTop to the X,Y position the triggering furre (moved from/is standing at).
    (5:301) copy the value of variable %visionTop into variable %visionBottom.

    (5:304) take variable %visionTop.y and subtract 2 from it.
    (5:302) take variable %visionBottom.y and add 6 to it.

    (5:302) take variable %nameCount and add 1 to it.

*execute vision
(0:49) When any countdown timer goes off,
  (3:3) within the diamond (%visionTop) - (%visionBottom),
    (5:5) change item 2415 to item 2401.

*for smoother processing track moving player and clear area around them.
(0:1) Whenever someone moves,
    (5:350) set variable %visionTop to the X,Y position the triggering furre (moved from/is standing at).
    (5:301) copy the value of variable %visionTop into variable %visionBottom.

    (5:304) take variable %visionTop.y and subtract 2 from it.
    (5:302) take variable %visionBottom.y and add 6 to it.

(0:1) Whenever someone moves,
  (3:3) within the diamond (%visionTop) - (%visionBottom),
    (5:5) change item 2415 to item 2401.



















**SECTION**  New Clock




*Add to loop*
(0:49) When any countdown timer goes off,
 (1:201) and variable %timer is more than 399,
 (1:202) and variable %timer is less than 500,
 (1:202) and variable %npc_loop is less than 500,
    (5:302) take variable %npc_loop and add 1 to it.
    (5:50) set countdown timer %npc_loop to go off in 1 seconds.

(0:49) When any countdown timer goes off,
 (1:201) and variable %timer is more than 399,
 (1:202) and variable %timer is less than 500,
    (5:50) set countdown timer %timer to go off in 1 seconds.











**SECTION**  Debugging
*Status Checking Commands
(0:38) When someone says or emotes something with {!gnome} in it,
    (5:1200) change the triggering furre to localspecies 1.


(0:38) When someone says or emotes something with {!level100} in it,
    (5:300) set variable %level to the value 98.

(0:38) When someone says or emotes something with {!debug} in it,


    (5:200) emit message {In Dream In Safe,%inDream,%inSafe,} to the triggering furre.

    (5:200) emit message {Step,%step,} to the triggering furre.
    (5:200) emit message {Level,%level} to the triggering furre.
    (5:200) emit message {direction,%direction} to the triggering furre.
    (5:200) emit message {Hall Count, Halls,%hallCount,%halls} to the triggering furre.


(0:38) When someone says or emotes something with {!mobOne} in it,
    (5:200) emit message {Model,%mobOneSprt,} to the triggering furre.
    (5:200) emit message {HP,%mobOneHP,} to the triggering furre.
    (5:200) emit message {AP,%mobOneAP,} to the triggering furre.
    (5:200) emit message {AI,%mobOneAI,} to the triggering furre.
    (5:200) emit message {AC,%mobOneAC,} to the triggering furre.
(0:38) When someone says or emotes something with {!mobTwo} in it,
    (5:200) emit message {Model,%mobTwoSprt,} to the triggering furre.
    (5:200) emit message {HP,%mobTwoHP,} to the triggering furre.
    (5:200) emit message {AP,%mobTwoAP,} to the triggering furre.
    (5:200) emit message {AI,%mobTwoAI,} to the triggering furre.
    (5:200) emit message {AC,%mobTwoAC,} to the triggering furre.
(0:38) When someone says or emotes something with {!mobThree} in it,
    (5:200) emit message {Model,%mobThreeSprt,} to the triggering furre.
    (5:200) emit message {HP,%mobThreeHP,} to the triggering furre.
    (5:200) emit message {AP,%mobThreeAP,} to the triggering furre.
    (5:200) emit message {AI,%mobThreeAI,} to the triggering furre.
    (5:200) emit message {AC,%mobThreeAC,} to the triggering furre.

(0:38) When someone says or emotes something with {!name} in it,
    (5:200) emit message {~nameHolder} to the triggering furre.
   (5:200) emit message {~nameGrab} to the triggering furre.


*Endtriggers* 8888 *Endtriggers*

Comments

Popular Posts