ROOM ID 301 NOPAINTING NAME "Stat Store" PICT "dndstor.gif" PICTURE ID 1 NAME "arrowll.gif" TRANSCOLOR 0 ENDPICTURE PICTURE ID 2 NAME "arrowrr.gif" TRANSCOLOR 0 ENDPICTURE SPOT ID 1 NAME "1416170708154304" OUTLINE 357,14 387,14 387,38 357,38 LOC 140,207 SCRIPT ; 1. To use this room, first create the room and make the NAMEs of spots 1,5 and 8 "0". ; NOTE: if you are doing this in "authoring mode", do NOT add the quotes, ; just put the number zero as the name in each of the spots! ; 2. Make sure you are wizzed up, and wearing your badge! Then invite the player into the ; room and have them say "mystats" to them. This will force them to put the proper names for ; spots 1, 5 and 8 in the log. (If allscray is installed, you can whisper: ; ;ao "mystats" SAY ; to them. ; 3 Change the names of the spots to what is shown in the log. ; 4. Say "reset". This will set the spots in the room according to what names you have given ; to spots 1, 5 and 8. ; 5. If the server is shut down and the spotstates are invalid, you will be paged, and a message ; will appear on the status bar telling whomever is in the room that the room needs to be reset. ; Come back into the room, wizzed up and say "reset" to reset the room. ; ; About this particular spot: ; This spot's name stores the values of Strength, Intelligence, Wisdom, Dexterity, ; Constitution, Charisma, Race, Class and Dicetype, in that order. Each of the first ; 6 items is stored as a two-digit number between 03 and 18. Race and Class are ; single digits, and Dicetype is 2 digits. (If the Dicetype is less than 10, the number ; is preceded by a 0. ; Note: numbers less than 10 are preceded by a zero for everything EXCEPT Race and Class! ; ; This spot's state stores the values of Strength and Intelligence in 1ssii order, ; where ss = Strength and ii = Intelligence. ; The numbers are preceded by the number one, so 0 values aren't lost. ENDSCRIPT ENDSPOT SPOT ID 2 NAME "wwdd" OUTLINE 409,20 439,20 439,39 409,39 LOC 386,97 SCRIPT ; This spot's state stores the values of Wisdom and Dexterity in 1wwdd order, ; where ww = Wisdom and dd = Dexterity ; The numbers are preceded by the number one, so 0 values aren't lost. ENDSCRIPT ENDSPOT SPOT ID 3 NAME "CCcc" OUTLINE 454,16 486,16 486,37 454,37 LOC 391,85 SCRIPT ; This spot's state stores the values of Constitution and Charisma in 1CCcc order, ; where CC = Constitution and cc = Charisma ; The numbers are preceded by the number one, so 0 values aren't lost. ENDSCRIPT ENDSPOT SPOT ID 4 NAME "rcdd" OUTLINE 360,56 387,56 387,78 360,78 LOC 281,129 SCRIPT ; This spot's state stores the values of Race, Class, and Dicetype in rcdd order, ; where r = Race, c = Class, dd = Dicetype ; Note: the number of Hitdice and Level are calculated from Experience Points! ENDSCRIPT ENDSPOT SPOT ID 5 NAME "123456" OUTLINE 41,24 74,24 74,43 41,43 LOC 0,91 SCRIPT ; This spot's name stores the value for the number of cumulative Experience Points the ; player has so far. ; Experience points are the combined values of spots 5, 6 and 7 ; This spot's state stores the value nnn,000,000 ENDSCRIPT ENDSPOT SPOT ID 6 NAME "000nnn000" OUTLINE 90,23 112,23 112,43 90,43 LOC 199,107 SCRIPT ; Experience points are the combined values of spots 5, 6 and 7 ; This spot's state stores the values 000,nnn,000 ENDSCRIPT ENDSPOT SPOT ID 7 NAME "000000nnn" OUTLINE 125,23 151,23 151,43 125,43 LOC 256,188 SCRIPT ; Experience points are the combined values of spots 5, 6 and 7 ; This spot's state stores the values 000,000,nnn ENDSCRIPT ENDSPOT SPOT ID 8 NAME "7654" OUTLINE 409,122 435,122 435,142 409,142 LOC 505,193 SCRIPT ; This spot's name stores the value for the number of Gold Points the player has so far. ; Gold points are the combined values of spots 8 and 9. ; This spot stores the values nnn,000 ENDSCRIPT ENDSPOT SPOT ID 9 NAME "000nnn" OUTLINE 449,123 473,123 473,143 449,143 LOC 362,195 SCRIPT ; Gold points are the combined values of spots 8 and 9 ; This spot stores the values 000,nnn ENDSCRIPT ENDSPOT SPOT ID 10 NAME "Scripts" DONTMOVEHERE OUTLINE 125,112 381,112 381,319 125,319 LOC 253,208 SCRIPT ON ENTER { abilities GLOBAL abdesc GLOBAL racenames GLOBAL classnames GLOBAL [ 0 0 0 0 0 0 0 0 ] spnames { "[ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ]" abilities = } 0 abilities == IF [ "Strength: " "Intelligence: " "Wisdom: " "Dexterity: " "Constitution: " "Charisma: " "Race: " "Class: " ] abdesc = [ "Dwarven" "Elven" "Gnome" "Half-Elven" "Halfling" "Half-Orc" "Human" ] racenames = [ "Cleric" "Fighter" "Magic-User" "Thief" ] classnames = 68 306 SETPOS { "`page Room " ROOMID ITOA + ", " + ROOMNAME + ", needs to be reset!" + SAY "Reset Needed!" STATUSMSG } 0 1 GETSPOTSTATE == IF } ON OUTCHAT { abilities GLOBAL abdesc GLOBAL racenames GLOBAL classnames GLOBAL sp1 GLOBAL sp5 GLOBAL sp8 GLOBAL rmarray GLOBAL "@" POSX ITOA + "," + POSY ITOA + prestr = prestr "There is something wrong with the name of spot" + warn = prestr "You have to be wearing your Wizard's badge!" + badgewarn = prestr "You have to be a wizard to access this function!" + wizwarn = prestr "Information is in your log." + loginfo = { sp1 = sp5 = sp8 = { "1" "$1$2" GREPSUB + ATOI 1 SETSPOTSTATE "1" "$3$4" GREPSUB + ATOI 2 SETSPOTSTATE "1" "$5$6" GREPSUB + ATOI 3 SETSPOTSTATE "$7" GREPSUB ATOI 4 SETSPOTSTATE sp5 atoi num = num 1000 % 7 SETSPOTSTATE num a - 1000 / 1000 % 6 SETSPOTSTATE num a - b 1000 * - 1000000 / 5 SETSPOTSTATE sp8 atoi num = num 1000 % 9 SETSPOTSTATE num a - 1000 / 1000 % 8 SETSPOTSTATE } { warn " 1." + LOCALMSG } sp1 "^(..)(..)(..)(..)(..)(..)(....)$" GREPSTR IFELSE } names2spots = { [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ] rmarray = 0 i = 1 GETSPOTSTATE ITOA 2 GETSPOTSTATE ITOA + 3 GETSPOTSTATE ITOA + 4 GETSPOTSTATE ITOA + nm1 = { { "$" i 1 + ITOA + GREPSUB ATOI rmarray i PUT i ++ } { 8 i > } WHILE "$9" GREPSUB ATOI rmarray 9 PUT } nm1 "^1(..)(..)1(..)(..)1(..)(..)(.)(.)(..)$" GREPSTR IF 5 GETSPOTSTATE 100000000 * 6 GETSPOTSTATE 100000 * + 7 GETSPOTSTATE + rmarray 12 PUT 8 GETSPOTSTATE 100000 * 9 GETSPOTSTATE + rmarray 13 PUT } spots2array = { ary = "" sp1 = "" sp5 = "" sp8 = 0 i = { { "0" ary i GET ITOA + } { ary i GET ITOA } ary i GET 10 < IFELSE sp1 += i ++ } { 6 i > } WHILE ary 6 GET ITOA ary 7 GET ITOA + sp1 += { "0" ary 9 GET ITOA + } { ary 9 GET ITOA } ary 9 GET 10 < IFELSE sp1 += ary 12 GET ITOA sp5 += ary 13 GET ITOA sp8 += } array2names = { ary = 0 i = { abdesc i GET ary i GET ITOA + LOGMSG i ++ } { 6 i > } WHILE abdesc i GET racenames ary i GET 1 - GET + LOGMSG i ++ abdesc i GET classnames ary i GET 1 - GET + LOGMSG "Dicetype: " ary 9 GET ITOA + "d" + LOGMSG "Experience: " ary 12 GET ITOA + LOGMSG "Gold: " ary 13 GET ITOA + "\x0d" + LOGMSG } disparray = { { { 8 SPOTNAME 5 SPOTNAME 1 SPOTNAME names2spots EXEC prestr "Room has been updated from spotnames." + LOCALMSG } { badgewarn LOCALMSG } USERNAME "^[*]" GREPSTR IFELSE } { wizwarn LOCALMSG } ISWIZARD IFELSE "" CHATSTR = } CHATSTR "reset" == IF { abilities STRTOATOM EXEC array2names EXEC ";Spot1:" sp1 + SAY ";Spot5:" sp5 + SAY ";Spot8:" sp8 + SAY loginfo LOCALMSG "" CHATSTR = } CHATSTR "mystats" == IF { "\x0dThe values stored in the spots in this room are:" LOGMSG spots2array EXEC rmarray disparray EXEC loginfo LOCALMSG "" CHATSTR = } CHATSTR "show room" == IF { abilities STRTOATOM EXEC temp = "" CHATSTR = { "\x0dYour current statistics are:" LOGMSG temp disparray EXEC loginfo LOCALMSG } { prestr "All your values are zero!" + LOCALMSG } 0 temp 0 GET < IFELSE } CHATSTR "show me" == IF { abilities STRTOATOM EXEC stuff = "" CHATSTR = { stuff array2names EXEC sp8 sp5 sp1 names2spots EXEC "`page " USERNAME + " has updated room \x22" + ROOMNAME + "\x22 to " + "Spot1:" + sp1 + " Spot5:" + sp5 + " Spot8:" + sp8 + SAY prestr "This room has been updated from your statistics!" + LOCALMSG } { prestr "You don't want to do that. All your values are zeroes!" + LOCALMSG } 0 stuff 0 GET < IFELSE } CHATSTR "update room" == IF { "" CHATSTR = spots2array EXEC { "[ " abilities = { ITOA " " + abilities += } rmarray FOREACH "]" abilities += prestr "Your statistics have been updated from the spots in the room." + LOCALMSG } { prestr "You can't because the room needs to be reset! All the values are zeroes." + LOCALMSG } 0 rmarray 0 GET < IFELSE } CHATSTR "update me" == IF { "\x0dThe following command is available for Wizards ONLY:" LOGMSG "reset: Resets the spot values in the room from the spot names." LOGMSG "The following commands are available for everyone:" LOGMSG "mystats: Creates new spot names from your statistics and displays them in the log." LOGMSG "show room: Displays the values stored in the spots in the room." LOGMSG "show me: Displays the values YOU are carrying around with you." LOGMSG "update room: Stores the values YOU are carrying in the spots in the room." LOGMSG " this command also pages the new values so they are stored in the log." LOGMSG "update me: Puts the values in the spots in the room into your statistics." LOGMSG "roomhelp: Displays this list.\x0d" LOGMSG "" CHATSTR = loginfo LOCALMSG } CHATSTR "roomhelp" == IF } ENDSCRIPT ENDSPOT DOOR ID 11 DONTMOVEHERE DEST 300 OUTLINE 5,356 61,356 61,380 5,380 LOC 34,368 PICTS 1,0,0 ENDPICTS SCRIPT ON ENTER { { CLEARLOOSEPROPS PAINTCLEAR } NBRROOMUSERS 2 < IF } ENDSCRIPT ENDDOOR DOOR ID 12 DONTMOVEHERE DEST 214 OUTLINE 449,361 507,361 507,380 449,380 LOC 479,370 PICTS 2,0,0 ENDPICTS ENDDOOR ENDROOM