diff --git a/changelog b/changelog index 9e35fb4..273110e 100644 --- a/changelog +++ b/changelog @@ -35,6 +35,10 @@ export (QQ's a zone into a tarball) Xlist (mlist, olist, rlist, zlist, slist, tlist, qlist) (lots of major bugfixes too) @ +[Sep 19 2010] - Rumble + Updated World and files for 3.62 release. +[Sep 11 2010] - Rumble + Fixed non-unix file formats and permissions. (thanks Mirad) [Jul 26 2010] - Rumble Corrected several bad wear flags on objects. (thanks Insomnia) [Jul 12 2010] - Rumble @@ -1039,6 +1043,7 @@ CircleMUD 3.5 - Added buildwalk and dig. Release history: +Version 3.62 release: September, 2010 Version 3.61 release: January, 2010 Version 3.60 release: September, 2009 Version 3.59 release: April, 2009 diff --git a/lib/misc/bugs b/lib/misc/bugs index 946c58c..e69de29 100644 --- a/lib/misc/bugs +++ b/lib/misc/bugs @@ -1,8 +0,0 @@ -Text stuck in a room with no exits~ -Body I'm stuck in a room, that I suspect was supposed to be a death trap, in the deep, dark forest. three huge poinsonous spiders attacked me but I didn't die and now I'm in a room with no exits. -~ -Name Stickley~ -Level 8 -Room 6131 -Flags 0 0 0 0 -End diff --git a/lib/text/help/help.hlp b/lib/text/help/help.hlp index 7ec8022..5dd3f5e 100644 --- a/lib/text/help/help.hlp +++ b/lib/text/help/help.hlp @@ -1458,18 +1458,18 @@ ZONE-DELETION DELETION To prevent accidentally deleting someone's zone and causing conflicting OLC access I have made the following guide. If someone does not login to the mud -for over three months, and does not mudmail me (Rumble) to let me know of an +for over a year, and does not mudmail me (Rumble) to let me know of an expected absence their zone may be deleted. I use show areas to list all zones and then go through one by one using "last ". If they have not -logged in for over three months I then "stat file " and check that +logged in for over a year I then "stat file " and check that they have the proper OLC set, and that they do not have the NO_DEL flag (I set no_delete on players that tell me they are going to be absent for a while). If -they have not been on for three months and do not have NO_DEL set I then "show +they have not been on for over a year and do not have NO_DEL set I then "show zone #" to double-check the zone and builder assigned. I then use r/m/o/s/tlist -to check if they made anything of value that could be donated. - Once I am positive it is safe to delete their zone I set their OLC to -1. -"stat file " to be sure it worked and then delete the zone from the -server. +to check if they made anything of value that could be saved and donated. + Once I am positive it is safe to delete their zone I set their OLC to off. +"set file olc off" then "stat file " to be sure it +worked and then delete the zone from the server withe the RemoveWorld script. #31 BITVECTORS NOBITS BITS @@ -2751,7 +2751,7 @@ Gives a list of the special commands available to you or the name you provide. The following wizard commands are implemented with level in the brackets: [31]; [31]dig [31]invis [31]olist [31]roomflags [32]tcopy [31]vstat [33]advance [31]echo [32]last [32]pardon [31]saveall [33]tedit [31]wiznet -[32]aedit [34]export [32]links [31]peace [32]scopy [32]teleport [31]wizhelp +[32]aedit [34]export [32]links [31]peace [32]scopy [31]teleport [31]wizhelp [31]at [32]file [31]load [34]plist [31]sedit [33]thaw [34]wizlock [31]attach [32]force [32]mcopy [31]purge [32]send [31]tlist [33]wizupdate [33]ban [33]freeze [31]medit [34]qecho [32]set [32]transfer [31]zcheck @@ -2888,7 +2888,7 @@ Sets whether or not players can track through doors. See also: TOGGLE, TRACK #31 -WORLD-FORMATS ROOM-FORMATS WLD WORLD-FILES +WORLD-FORMATS ROOM-FORMATS WLD WLD-FORMAT WORLD-FILES @n# ~ @@ -2907,7 +2907,9 @@ E ~ -See also: Redit +http://www.circlemud.org/cdp/building/building-3.html#ss3.1 + +See also: MOB-FORMAT, OBJ-FORMAT, SHP-FORMAT, ZON-FORMAT, TRG-FORMAT, Redit #31 MOBILE-FORMATS MOB-FORMATS MOB-FILES @@ -3310,7 +3312,7 @@ if %actor.inventory(700)% %purge% %actor.inventory(700)% end -Alwasy purge at the end of a trigger. If you purge a mob/obj at the beginning +Always purge at the end of a trigger. If you purge a mob/obj at the beginning you can no longer access that mob/obj variables. Example: @RTSTAT 1375, 6300@n @@ -4188,7 +4190,7 @@ cha/con/dex/int - Checks the stat. @RHELP TRIG-STAT@n. Subfield adjusts. str/stradd/wis() () is a subfield and allows a change to the variable. alias - The list of aliases of the mob or the player name. align() - The actor's alignment @RHELP ALIGN@n. Subfield adjusts. -affect() - Checks the actor for the affect. @RHELP TRIG-AFFECT@n +affect() - Checks the actor for the affect. @RHELP AFFECT@n armor - Checks the actor's armor class. canbeseen - Checks if the the mob can see the actor. @RHELP CANBESEEN@n class - The actor's class, as a string. @@ -4683,7 +4685,8 @@ See also: TRIGEDIT-ROOM-GLOBAL, %TIME% TRIGEDIT-ROOM-LOGIN TRIGEDIT-LOGIN TRIG-ROOM-LOGIN Activated if a player enters the game in the room the trigger is attached to. -Note: New players enter the game at level 0, not level 1. +Note: New players enter the game at level 0, not level 1. Use a wait 1 sec to +allow the player to actually enter the game before the trig fires. Numeric Arg : percent chance this trigger will be activated. Argument : not used. @@ -4691,7 +4694,7 @@ Argument : not used. Variables: %self% - the room. -Example: @RTSTAT 199@n +Example: @RTSTAT 3017, 199@n See also: TRIG-TYPE #31 @@ -4904,7 +4907,7 @@ See also: MHUNT TRIGEDIT-MOB-LOAD TRIGEDIT-LOAD TRIG-LOAD Activated when this mobile is created, either by manual load, zreset or -or regular zone lifespan reset. +regular zone lifespan reset. Numeric Arg : percent chance this trigger will be activated. Argument : not used. @@ -7438,7 +7441,6 @@ E) Extra descriptions menu @RHELP OEDIT-EXTRA@n M) Min Level : @c0@n @RHELP OEDIT-MIN-LEVEL@n P) Perm Affects: @cNOBITS@n @RHELP OEDIT-PERM-AFFECTS@n S) Script : @cNot Set.@n @RHELP SCRIPT-MENU@n -X) Delete Object @RHELP OEDIT-DELETE@n Q) Quit Enter choice : @@ -7897,7 +7899,7 @@ Enter choice : REDIT-DELETE ROOMDELETE ROOM-DELETE ERASE DELETE-ROOM ODELETE OEDIT-DELETE MDELETE MEDIT-DELETE DELETE-OBJECT Deletes the current room, mobile, or object. Be careful and make sure you -are deleting the right vnum. +are deleting the right vnum. Do not delete objects in rent files. See also: OLC, AUTOSAVE, PURGE, VDELETE #31 @@ -8052,7 +8054,7 @@ The following room flags can be selected: can be set so that only they can wander on the first level of a dungeon by making the stairwells NO_MOB. A NO_MOB room will not prevent pets and charmed mobs from following players. A - mob can flee into a NO_MOB room. + mob can flee into a NO_MOB room. 4) INDOORS - Weather messages will not be sent to room, always lighted. Call lightning will not work. 5) PEACEFUL - No violence will work here. Use sparingly. @@ -8696,16 +8698,18 @@ rumble@@tbamud.com 325 REVELRY -- Kaan 6-30 326 Army PERIMETER -- Kaan 8-30 345 ASYLUM for the Insane -- Duluth 6-10 - + 555 ULTIMA -- Unknown Parna 1-30 + 556 Ultima II -- Unknown Parna 1-30 + Zone names CAPITALIZED are accessed by teleporter. i.e. "teleport sanctus" Uncapitalized zones are linked through a capitalized zone. Teleporter Trigger: 99 -The above world includes: (as of 2009): - 9967 mobiles 3613 prototypes - 10686 objects 4512 prototypes - 12029 rooms 183 zones - 1396 triggers 315 shops +The above world includes: (as of 2010): + 7181 mobiles 3674 prototypes + 7847 objects 4593 prototypes + 12179 rooms 184 zones + 1445 triggers 318 shops If you wish to see what standards we have used to balance these zones just stop by TBA or see the help files on OBJ-LIMITS, MOB-LIMITS. @@ -9808,7 +9812,7 @@ Example: > diagnose doctor -See also: HIT, KILL +See also: CONSIDER, HIT, KILL #0 DONATE @@ -12669,6 +12673,14 @@ develop our newly released tbaMUD codebase (the codebase formerly known as CircleMUD). See also: REVIEWS +#0 +SUBVERSION SVN + +To checkout the latest version: +svn checkout http://tbamud.com/svn/circlemud/circlemud tbamud + +Full details: http://www.tbamud.com/content/tbamuds-public-svn-repository + #0 TBA-ADVERTISING diff --git a/lib/world/mob/0.mob b/lib/world/mob/0.mob index f6a2df1..ac60389 100644 --- a/lib/world/mob/0.mob +++ b/lib/world/mob/0.mob @@ -1,7 +1,7 @@ #0 -An undefined string.~ -an undefined string.~ -An undefined string.~ +undefined~ +undefined~ +undefined~ An undefined string.~ 8 0 0 0 0 0 0 0 0 E 0 20 0 0d0+0 0d0+0 diff --git a/lib/world/mob/1.mob b/lib/world/mob/1.mob index b1c9cd3..4fa6d65 100644 --- a/lib/world/mob/1.mob +++ b/lib/world/mob/1.mob @@ -195,7 +195,7 @@ T 64 #113 old lady~ an old lady~ -An old lady is taking a break, just sitting on the ground +An old lady is taking a break, just sitting on the ground. ~ She looks frail and withered. The kind of lady you're supposed to help cross the road. diff --git a/lib/world/mob/288.mob b/lib/world/mob/288.mob index b7d55ed..00000cf 100644 --- a/lib/world/mob/288.mob +++ b/lib/world/mob/288.mob @@ -409,6 +409,7 @@ Cassiopeia, the queen of the Universe, is sitting on her throne. 300 90000 6 8 2 E +T 28801 #28831 cepheus king~ Cepheus the King~ @@ -422,6 +423,7 @@ weak and useless in front of him. 300 90000 6 8 1 E +T 28801 #28832 polaris polar star~ Polaris, the polar star~ diff --git a/lib/world/mob/39.mob b/lib/world/mob/39.mob index 49ec0d5..91a4a03 100644 --- a/lib/world/mob/39.mob +++ b/lib/world/mob/39.mob @@ -600,7 +600,7 @@ E #3949 cackling bum~ a cackling bum~ -A bum stands here, quitetly cackling. +A bum stands here, quietly cackling. ~ This bum has obviously gone insane, as he just stands here quietly cackling to himself. diff --git a/lib/world/obj/1.obj b/lib/world/obj/1.obj index 8b9bb90..fe29da8 100644 --- a/lib/world/obj/1.obj +++ b/lib/world/obj/1.obj @@ -1064,168 +1064,6 @@ visible. 0 0 0 0 0 0 0 0 0 E -may~ - . 8888 8888888 - 888888888888888888888888 - 8888:::8888888888888888888888888 - 8888::::::8888888888888888888888888888 - 88::::::::888:::8888888888888888888888888 - 88888888::::8:::::::::::88888888888888888888 - 888 8::888888::::::::::::::::::88888888888 888 - 88::::88888888::::m::::::::::88888888888 8 - 888888888888888888:M:::::::::::8888888888888 - 88888888888888888888::::::::::::M88888888888888 - 8888888888888888888888:::::::::M8888888888888888 - 8888888888888888888888:::::::M888888888888888888 - 8888888888888888::88888::::::M88888888888888888888 - 88888888888888888:::88888:::::M888888888888888 8888 - 88888888888888888:::88888::::M::;o*M*o;888888888 88 - 88888888888888888:::8888:::::M:::::::::::88888888 8 - 88888888888888888::::88::::::M:;:::::::::::888888888 - 8888888888888888888:::8::::::M::aAa::::::::M8888888888 8 - 88 8888888888::88::::8::::M:::::::::::::888888888888888 8888 - 88 88888888888:::8:::::::::M::::::::::;::88:88888888888888888 - 8 8888888888888:::::::::::M::"@@@@@@@"::::8w8888888888888888 - 88888888888:888::::::::::M:::::"@a@":::::M8i888888888888888 - 8888888888::::88:::::::::M88:::::::::::::M88z88888888888888888 - 8888888888:::::8:::::::::M88888:::::::::MM888!888888888888888888 - 888888888:::::8:::::::::M8888888MAmmmAMVMM888*88888888 88888888 - 888888 M:::::::::::::::M888888888:::::::MM88888888888888 8888888 - 8888 M::::::::::::::M88888888888::::::MM888888888888888 88888 - 888 M:::::::::::::M8888888888888M:::::mM888888888888888 8888 - 888 M::::::::::::M8888:888888888888::::m::Mm88888 888888 8888 - 88 M::::::::::::8888:88888888888888888::::::Mm8 88888 888 - 88 M::::::::::8888M::88888::888888888888:::::::Mm88888 88 - 8 MM::::::::8888M:::8888:::::888888888888::::::::Mm8 4 - 8M:::::::8888M:::::888:::::::88:::8888888::::::::Mm 2 - 88MM:::::8888M:::::::88::::::::8:::::888888:::M:::::M -~ -E -april~ - . :AMMMMMMMMMMMMA: - :AMMMMMMMMMHHHHHMMMMMMMMA: - :AMHMMMMHHMHIHHIMMMHMMMMHHA: - :AM'MMMMMMHHIHHHIMMMMMIMMHHHH: - AM:IMMMMMHHIHIHHHIMMHHHHHHHHHH - AMIIHMMMMMHIHHHIHHIHHHHHHHHHHHH: - MMIHHMMMMMHHIHHHIHHHHHHHHHHHHHHH - AMMMMMHHHHHHI;;;;;;;IHHHI;;IHHHHH - MMMMHIIII;":AMMMMA ,[[, HH - MMMMHII; AW"'''' :: HH - IHHIHIII;:'' ,GFMF[ [MM[: IH - AHHIHII;::': ";[P,[ ;; :::: IH - IHHHIHII;;:: :[;: ;H - AHHHHHII;;;:: : : [ : ;H - IHHIIHI:[;;;:: ; ; ; , , IH - IHHIIHH:[;;;: ; ;: ':"::" '; IH - IHHIIHI:[;;: ::: ; ,,,, ' HH - :IHHHIHHMMA;::: [;;""""""[; AMI - ;IHHHHIIHMM;: : : ;;[,,,,[; HHI - IIHHMMHHIHHM;:: '"""' AMHI - IIHHMMHMHHIIIM;:: AMMHI - IHHHMMHMHMHHHIHI;:: :AMMMHI - IHHHMMMMHMMHHHII;;;;:: :,;; MMMHHI - IHHHMMHHHHMMHHHI;:";;;;;;" MMMIH' - ;IHHMMHMMMMHF"HHII MMMHH - IHHMMHV;;:: HHII;: : MMHHI - IHHMV;;::: HHII;: : : MMHI; - IHMV;;:: : "HII;: :: MMI; - :IHV;:: : 'HI: :: MM; - IV;:: : : "II;: ; - IH;;::: : ;;;I: ; - ;M;;:::: : ';;;HI: ' - MH;;:::: : ';;HI: ; - IM;;;::: : :[; ';I"I: ; - M;;;::: : : [;;,: ' : ' - ;;:::: : ::'' : ': - ;;::: : : ': : - :;;:: : :: ':' -~ -E -march~ - . ,.--.. - ,::.'.. . . "VI:I:".':-.,. - ,I::. .. . 'VHMHII:.::;:.:,.. - :I:I:.. . . MHMHIHI:MHHI:I:'.:. - A:I::. ... . .MMHHIIHIHI:IHHII:.:, - .M:I::... .. . AMMMMMHI::IHII::II.::. - IMA"::.:.. . .MMMMMHHII:IMHIHIA:::"' - 'MV.:.:.. . AMMMMHMHI:I:HIHHIIIA;. - P.:.:.. . . .MMMMMMMHHIIMHHHIIHIIH. - :..:.. . . AMMMMMMMHHI:AMIVHI:HIII: - ,:.:.. . . MMMMMMMMMH:IHHI:HHI:HIIH. - :..:... . .MMMHP:""''':HHIH:HHH:HIII - ;.:..:.. . AMH:". ' ' ''":HII:HHH:HII: - ::..:.. . . .H:'.. . '".:VA:I:H::HI: - ;.:.:... .. A:.'... . ':HA:IHI::I: - ,::..:. . . .M::. . . ':HA:HH:II:. - ;.::... .. AML;,' . .:VHI:HI:I:; - ,:.:.:. . . .H. "PA, .:IHH:HHII::. - ,:.::... .. A:I:::";, . . ,ILIIIH:HI:I:I; - ,;:.:.:.. . . .H:TP"VB').. .,;T;,,::I:HI:I::: - ,::.:.:.. . . AI:.":IAAT:. .(':BB');V::IH:I:I; - ,::.:.:.. . . .H:. ' . . .. .":;AITP;I:IIH:I::;, - ,::.::.:. . . . A::. . ..:. . . ..:AI:IHII:I::;. - ;:.::.:.. . . AM:I:. ..:. .: . .::HIIIHIIHII::. - ,:::.:.:.. . .MM:I:.. .:, .:. .::HHIIIHIHII::' - ,::.:..:.. . . AMM:I:. . .'"-""''. ..::HIHI:HI:III: - ;:.::..:.. . . AMMM::. . ,,,, '.. '.::IMHIHIHIIHI::; - ,:::.:..:. . . MMMM:I:. ':::;;;::;' .::AMHIHIHHIHHI:" - ;::.:.:.. . . .:VMMV:A:. . ':;,,." .::AMMMIHIHHIHHII - ;::.:.:.. .. . .::VM:IHA:. .'' ' . ..:AMMMMHIHHHIHHII: - ;:::.:.. . .. . .::P::IHHAA.. . .. .:AMMMMMMMIIHHIHHI:: - ;::.:.. . . . ..:.:VIHHHIHHA::,,,,,:AMMMMMMMMMHIIHHHHII; - ;.::.. . . . ..:.:VHHIHI:IHIHHIHI:MMMMMMMMMMHIHHIHHII: - ::.:.. . .. ...:.::VHI:IIVIHIHII:MMMMMMMMMMMIHHIHHII:, - ;:..:. . .. . ..:.::::VAII:IIIIII:MMMMMMMMMMMIHHIIHIIHI - ';:.. . . .. ..:...:.VII::III:.VMMMMMMMMMHIHHHIHI::I, - ;:. . . ' . .. ... . .::.::V::II:..VMMMMMMMMHIHHHIHI::I; - ;:.. . . . .. ..:.. .::...:VIITPL:VMMMMMMMVIHHHIH:. :; - ;:. . . . .. ... . ..:.:.. .:IIIA:.MMMMMVI:HIHIH:. .: - I:. . . . .. . .. . . . . ..:.. ..::IIA.VMMMVIHIIHIV:. .' - I:.. . . .. .... . . . .. ... .:.:IA:.VMVIMHIHIH:..: - I.. . . . ..... . . . .. . .. .:IIAV:HIMHHIHII:.' -~ -E -february~ - . nHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHn. - .MS?MMMMMMMMMMMMMMMMMM?MM-MMMMMMMMMSHMMMMMMM - MMMMMH?MMMMMMMX*MM?MMX%MM/MMMMMM"HMMMMMMMMMMMM - MMMMMMMMMMMMMMMMMX*MX*MMMX?MMMMM(M!XMMMMMMMMMMMM - XMC)?MMMMMMMMMMMMMMMhX?!?MMMMX#MM!MXMMMMMMMMMMMML - MMMMMMMMMMMMMMMMMMMMMMMM!-`````-`-!?MMMM)MMMMMMMMx - MMM)MMMMMMMMMMMMMMMHhHH!- `#MM(MMMMMMMMMM> - HM!HMMMMMMMMMMMMMMMM?)? "MMMMMMMMMX - XM!MMMMMMMMMMMMMMMMMMM?- 'MMMMMMMM - M!MMMMMMMMMMMMMMMMMXH! MMMMXMMP - \!MMMMMMMSMHHHMM?XMM?- -:::xx.. M?XMM?" - MXMMMMMMMMMM!XHMMMM": ... `"%x XHHHMMM - \!MMMMMMMM?XMMMMMMX!'-L '%%%+:. ` ..MMMMM" - 'HMMMMMM?HMMMMM*XM! h -\).^\- .%""`MM?" - 'MMMMMMMMMMMMMXMMM! -X +%%!.MMMXk - ?MMMMMMMMMMMXMMMMM `. - `""'XMMMMX - !MMMMMMMMMMMMMMMMMX. ' XMkMMX> - XMMMMMMMMMMMMMMM?MXXXx.-` XXMMM! - MMMMMMMMMMMMMMMMXMXXXXXXx. -- MMMMM - XMMMMMMMMMMMM?MMXXXXXXXXX!` '+^ .MMM!P - 'MMM!MMMMMMMMMi?M!"` `-%HHHHxx. xMMMM" - :MMMMMMMMMMMMMMM" `\XMM .MMMMM - XMMMMMMMMMX?MM! `( HMMMMM - XMMMM)MMM" \- 'MMMMM* - 'MMMMfMMM" \- XMMM* - .MMMMMXMM" ^ `MMM - XMMMM!MM" MM> - HMMMMXM- MM> - ?MMMMM- Xf% - MMMMf %% \ - 4MMM % - `M % - % % - % % - % ! % - % ! % -~ -E january~ . .:IIIIHIHHIHHHII::I:. :IIIIHIHHHHHHMMHHIHHIIHHIII:. @@ -1277,6 +1115,168 @@ IHHHHMHMMMMMMMHHHHHI:IT:TI:..:HI:.. ..:. . :IHII :: .:. . . . ..:IHHMMMHMIHIH:IIHHHMHH::..:HHHHI:HHHHHHI:I:IIIHII; :. ... . . . ..::HHHMMHMHHII:HIIHHMMHH:..:HHHMHHIHHHI:: . :IHII:I ~ +E +february~ + . nHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHn. + .MS?MMMMMMMMMMMMMMMMMM?MM-MMMMMMMMMSHMMMMMMM + MMMMMH?MMMMMMMX*MM?MMX%MM/MMMMMM"HMMMMMMMMMMMM + MMMMMMMMMMMMMMMMMX*MX*MMMX?MMMMM(M!XMMMMMMMMMMMM + XMC)?MMMMMMMMMMMMMMMhX?!?MMMMX#MM!MXMMMMMMMMMMMML + MMMMMMMMMMMMMMMMMMMMMMMM!-`````-`-!?MMMM)MMMMMMMMx + MMM)MMMMMMMMMMMMMMMHhHH!- `#MM(MMMMMMMMMM> + HM!HMMMMMMMMMMMMMMMM?)? "MMMMMMMMMX + XM!MMMMMMMMMMMMMMMMMMM?- 'MMMMMMMM + M!MMMMMMMMMMMMMMMMMXH! MMMMXMMP + \!MMMMMMMSMHHHMM?XMM?- -:::xx.. M?XMM?" + MXMMMMMMMMMM!XHMMMM": ... `"%x XHHHMMM + \!MMMMMMMM?XMMMMMMX!'-L '%%%+:. ` ..MMMMM" + 'HMMMMMM?HMMMMM*XM! h -\).^\- .%""`MM?" + 'MMMMMMMMMMMMMXMMM! -X +%%!.MMMXk + ?MMMMMMMMMMMXMMMMM `. - `""'XMMMMX + !MMMMMMMMMMMMMMMMMX. ' XMkMMX> + XMMMMMMMMMMMMMMM?MXXXx.-` XXMMM! + MMMMMMMMMMMMMMMMXMXXXXXXx. -- MMMMM + XMMMMMMMMMMMM?MMXXXXXXXXX!` '+^ .MMM!P + 'MMM!MMMMMMMMMi?M!"` `-%HHHHxx. xMMMM" + :MMMMMMMMMMMMMMM" `\XMM .MMMMM + XMMMMMMMMMX?MM! `( HMMMMM + XMMMM)MMM" \- 'MMMMM* + 'MMMMfMMM" \- XMMM* + .MMMMMXMM" ^ `MMM + XMMMM!MM" MM> + HMMMMXM- MM> + ?MMMMM- Xf% + MMMMf %% \ + 4MMM % + `M % + % % + % % + % ! % + % ! % +~ +E +march~ + . ,.--.. + ,::.'.. . . "VI:I:".':-.,. + ,I::. .. . 'VHMHII:.::;:.:,.. + :I:I:.. . . MHMHIHI:MHHI:I:'.:. + A:I::. ... . .MMHHIIHIHI:IHHII:.:, + .M:I::... .. . AMMMMMHI::IHII::II.::. + IMA"::.:.. . .MMMMMHHII:IMHIHIA:::"' + 'MV.:.:.. . AMMMMHMHI:I:HIHHIIIA;. + P.:.:.. . . .MMMMMMMHHIIMHHHIIHIIH. + :..:.. . . AMMMMMMMHHI:AMIVHI:HIII: + ,:.:.. . . MMMMMMMMMH:IHHI:HHI:HIIH. + :..:... . .MMMHP:""''':HHIH:HHH:HIII + ;.:..:.. . AMH:". ' ' ''":HII:HHH:HII: + ::..:.. . . .H:'.. . '".:VA:I:H::HI: + ;.:.:... .. A:.'... . ':HA:IHI::I: + ,::..:. . . .M::. . . ':HA:HH:II:. + ;.::... .. AML;,' . .:VHI:HI:I:; + ,:.:.:. . . .H. "PA, .:IHH:HHII::. + ,:.::... .. A:I:::";, . . ,ILIIIH:HI:I:I; + ,;:.:.:.. . . .H:TP"VB').. .,;T;,,::I:HI:I::: + ,::.:.:.. . . AI:.":IAAT:. .(':BB');V::IH:I:I; + ,::.:.:.. . . .H:. ' . . .. .":;AITP;I:IIH:I::;, + ,::.::.:. . . . A::. . ..:. . . ..:AI:IHII:I::;. + ;:.::.:.. . . AM:I:. ..:. .: . .::HIIIHIIHII::. + ,:::.:.:.. . .MM:I:.. .:, .:. .::HHIIIHIHII::' + ,::.:..:.. . . AMM:I:. . .'"-""''. ..::HIHI:HI:III: + ;:.::..:.. . . AMMM::. . ,,,, '.. '.::IMHIHIHIIHI::; + ,:::.:..:. . . MMMM:I:. ':::;;;::;' .::AMHIHIHHIHHI:" + ;::.:.:.. . . .:VMMV:A:. . ':;,,." .::AMMMIHIHHIHHII + ;::.:.:.. .. . .::VM:IHA:. .'' ' . ..:AMMMMHIHHHIHHII: + ;:::.:.. . .. . .::P::IHHAA.. . .. .:AMMMMMMMIIHHIHHI:: + ;::.:.. . . . ..:.:VIHHHIHHA::,,,,,:AMMMMMMMMMHIIHHHHII; + ;.::.. . . . ..:.:VHHIHI:IHIHHIHI:MMMMMMMMMMHIHHIHHII: + ::.:.. . .. ...:.::VHI:IIVIHIHII:MMMMMMMMMMMIHHIHHII:, + ;:..:. . .. . ..:.::::VAII:IIIIII:MMMMMMMMMMMIHHIIHIIHI + ';:.. . . .. ..:...:.VII::III:.VMMMMMMMMMHIHHHIHI::I, + ;:. . . ' . .. ... . .::.::V::II:..VMMMMMMMMHIHHHIHI::I; + ;:.. . . . .. ..:.. .::...:VIITPL:VMMMMMMMVIHHHIH:. :; + ;:. . . . .. ... . ..:.:.. .:IIIA:.MMMMMVI:HIHIH:. .: + I:. . . . .. . .. . . . . ..:.. ..::IIA.VMMMVIHIIHIV:. .' + I:.. . . .. .... . . . .. ... .:.:IA:.VMVIMHIHIH:..: + I.. . . . ..... . . . .. . .. .:IIAV:HIMHHIHII:.' +~ +E +april~ + . :AMMMMMMMMMMMMA: + :AMMMMMMMMMHHHHHMMMMMMMMA: + :AMHMMMMHHMHIHHIMMMHMMMMHHA: + :AM'MMMMMMHHIHHHIMMMMMIMMHHHH: + AM:IMMMMMHHIHIHHHIMMHHHHHHHHHH + AMIIHMMMMMHIHHHIHHIHHHHHHHHHHHH: + MMIHHMMMMMHHIHHHIHHHHHHHHHHHHHHH + AMMMMMHHHHHHI;;;;;;;IHHHI;;IHHHHH + MMMMHIIII;":AMMMMA ,[[, HH + MMMMHII; AW"'''' :: HH + IHHIHIII;:'' ,GFMF[ [MM[: IH + AHHIHII;::': ";[P,[ ;; :::: IH + IHHHIHII;;:: :[;: ;H + AHHHHHII;;;:: : : [ : ;H + IHHIIHI:[;;;:: ; ; ; , , IH + IHHIIHH:[;;;: ; ;: ':"::" '; IH + IHHIIHI:[;;: ::: ; ,,,, ' HH + :IHHHIHHMMA;::: [;;""""""[; AMI + ;IHHHHIIHMM;: : : ;;[,,,,[; HHI + IIHHMMHHIHHM;:: '"""' AMHI + IIHHMMHMHHIIIM;:: AMMHI + IHHHMMHMHMHHHIHI;:: :AMMMHI + IHHHMMMMHMMHHHII;;;;:: :,;; MMMHHI + IHHHMMHHHHMMHHHI;:";;;;;;" MMMIH' + ;IHHMMHMMMMHF"HHII MMMHH + IHHMMHV;;:: HHII;: : MMHHI + IHHMV;;::: HHII;: : : MMHI; + IHMV;;:: : "HII;: :: MMI; + :IHV;:: : 'HI: :: MM; + IV;:: : : "II;: ; + IH;;::: : ;;;I: ; + ;M;;:::: : ';;;HI: ' + MH;;:::: : ';;HI: ; + IM;;;::: : :[; ';I"I: ; + M;;;::: : : [;;,: ' : ' + ;;:::: : ::'' : ': + ;;::: : : ': : + :;;:: : :: ':' +~ +E +may~ + . 8888 8888888 + 888888888888888888888888 + 8888:::8888888888888888888888888 + 8888::::::8888888888888888888888888888 + 88::::::::888:::8888888888888888888888888 + 88888888::::8:::::::::::88888888888888888888 + 888 8::888888::::::::::::::::::88888888888 888 + 88::::88888888::::m::::::::::88888888888 8 + 888888888888888888:M:::::::::::8888888888888 + 88888888888888888888::::::::::::M88888888888888 + 8888888888888888888888:::::::::M8888888888888888 + 8888888888888888888888:::::::M888888888888888888 + 8888888888888888::88888::::::M88888888888888888888 + 88888888888888888:::88888:::::M888888888888888 8888 + 88888888888888888:::88888::::M::;o*M*o;888888888 88 + 88888888888888888:::8888:::::M:::::::::::88888888 8 + 88888888888888888::::88::::::M:;:::::::::::888888888 + 8888888888888888888:::8::::::M::aAa::::::::M8888888888 8 + 88 8888888888::88::::8::::M:::::::::::::888888888888888 8888 + 88 88888888888:::8:::::::::M::::::::::;::88:88888888888888888 + 8 8888888888888:::::::::::M::"@@@@@@@"::::8w8888888888888888 + 88888888888:888::::::::::M:::::"@a@":::::M8i888888888888888 + 8888888888::::88:::::::::M88:::::::::::::M88z88888888888888888 + 8888888888:::::8:::::::::M88888:::::::::MM888!888888888888888888 + 888888888:::::8:::::::::M8888888MAmmmAMVMM888*88888888 88888888 + 888888 M:::::::::::::::M888888888:::::::MM88888888888888 8888888 + 8888 M::::::::::::::M88888888888::::::MM888888888888888 88888 + 888 M:::::::::::::M8888888888888M:::::mM888888888888888 8888 + 888 M::::::::::::M8888:888888888888::::m::Mm88888 888888 8888 + 88 M::::::::::::8888:88888888888888888::::::Mm8 88888 888 + 88 M::::::::::8888M::88888::888888888888:::::::Mm88888 88 + 8 MM::::::::8888M:::8888:::::888888888888::::::::Mm8 4 + 8M:::::::8888M:::::888:::::::88:::8888888::::::::Mm 2 + 88MM:::::8888M:::::::88::::::::8:::::888888:::M:::::M +~ #186 scroll poem irish~ an irish poem~ @@ -1338,17 +1338,17 @@ surface. The top has three claws meant to hold something. It is conspicuosly empty. ~ #190 -potion deep green remove curse~ -a potion of remove curse~ -A deep green potion has been left here.~ +scroll deep green remove curse~ +a scroll of remove curse~ +A deep green scroll has been left here.~ ~ -10 a 0 0 0 a 0 0 0 0 0 0 0 +2 a 0 0 0 a 0 0 0 0 0 0 0 1 35 -1 -1 2 1000 0 0 0 E -green deep potion~ - A potion that will remove any curses you may have been afflicted with. - ~ +scroll deep green~ + A scroll that will remove a curse from an object or person. +~ #191 orb topping~ an orb meant to top a staff~ diff --git a/lib/world/obj/257.obj b/lib/world/obj/257.obj index c52e50b..65b970a 100644 --- a/lib/world/obj/257.obj +++ b/lib/world/obj/257.obj @@ -905,12 +905,12 @@ A brilliant sapphire lies here, twinkling happily.~ 0 0 0 0 2 723 0 0 0 #25790 -potion green deep~ -a deep-green potion~ -A deep-green potion has been left here.~ +scroll deep green~ +a deep green scroll~ +A deep-green scroll has been left here.~ ~ -10 a 0 0 0 a 0 0 0 0 0 0 0 -1 35 35 35 +2 a 0 0 0 a 0 0 0 0 0 0 0 +30 35 -1 -1 2 20 0 0 0 #25791 nuts berries~ @@ -929,13 +929,13 @@ A large, sociable bulletin board is mounted on a wall here.~ 0 0 0 0 0 0 0 0 0 E -box~ - If you can read this, the drop box is not working. -~ -E drop box message~ Use 'look box' to write a message. ~ +E +box~ + If you can read this, the drop box is not working. +~ #25797 board frozen bulletin~ a frozen bulletin board~ @@ -945,13 +945,13 @@ A large bulletin board is here, carved from a block of ice.~ 0 0 0 0 0 0 0 0 0 E -board~ - If you can read this, the board is not working. -~ -E freeze bulletin~ Use 'look board' to read the board. ~ +E +board~ + If you can read this, the board is not working. +~ #25798 board holy bulletin~ a holy bulletin board~ @@ -961,13 +961,13 @@ A large bulletin board is mounted on a wall here. It glows with a faint aura.~ 0 0 0 0 0 0 0 0 0 E -board~ - If you can read this, the board is not working. -~ -E holy bulletin~ Use 'look board' to read the board. ~ +E +board~ + If you can read this, the board is not working. +~ #25799 board bulletin~ a bulletin board~ @@ -977,11 +977,11 @@ A large bulletin board is mounted on a wall here.~ 0 0 0 0 0 0 0 0 0 E -board~ - If you can read this, the board is not working. -~ -E bulletin~ Use 'look board' to read the board. ~ +E +board~ + If you can read this, the board is not working. +~ $~ diff --git a/lib/world/obj/264.obj b/lib/world/obj/264.obj index 4de5e80..b7f0b73 100644 --- a/lib/world/obj/264.obj +++ b/lib/world/obj/264.obj @@ -6,10 +6,11 @@ The Pool of Eternal Life sits centered in the boulevard, a wondrous beacon of li 23 a 0 0 0 0 0 0 0 0 0 0 0 1000 1000 15 0 0 0 0 0 0 +T 26400 E pool eternal life~ - Deep in it's mirrored depths, you think you may be able to see something past -yourself, something dark, sinister. + Deep in its mirrored depths, you think you may be able to see something past +yourself, something dark, sinister. ~ #26401 robe father~ @@ -170,14 +171,14 @@ A fine jacket has been left here.~ 10 0 0 0 8 800 0 20 0 E +buttons~ + The heavy buttons are engraved with small anchors. +~ +E stately jacket~ The dark jacket is really quite nice. The material is smooth and clean. Heavy metal buttons are sewn in a straight line from top to bottom. ~ -E -buttons~ - The heavy buttons are engraved with small anchors. -~ A 23 2 #26415 diff --git a/lib/world/obj/267.obj b/lib/world/obj/267.obj index eca8650..fcdeb8c 100644 --- a/lib/world/obj/267.obj +++ b/lib/world/obj/267.obj @@ -39,7 +39,7 @@ dress beige burlap~ an ugly beige burlap dress~ An ugly beige burlap dress looks very like a sack of potatoes on the ground.~ ~ -9 0 0 0 0 ak 0 0 0 0 0 0 0 +9 0 0 0 0 ad 0 0 0 0 0 0 0 1 0 0 0 5 300 0 0 0 E diff --git a/lib/world/trg/0.trg b/lib/world/trg/0.trg index aa4414d..b8f12ae 100644 --- a/lib/world/trg/0.trg +++ b/lib/world/trg/0.trg @@ -2806,7 +2806,7 @@ teleport~ %echoaround% %actor% %actor.name% attempts to manipulate space and time. wait 1 sec set sanctus 100 -set jade 400 +set jade 401 set newbie 500 set sea 600 set camelot 775 diff --git a/lib/world/trg/264.trg b/lib/world/trg/264.trg index ede8ae5..d515129 100644 --- a/lib/world/trg/264.trg +++ b/lib/world/trg/264.trg @@ -1 +1,27 @@ -$~ +#26400 +Healing Water~ +1 s 100 +~ +set currenthunger %actor.hunger% +set currentthirst %actor.thirst% +if %currenthunger% > 20 && %currentthirst% > 0 + %send% %actor% Your stomach can't contain anymore! +else + %send% %actor% The water seems to sparkle refreshingly as you drink. + %echoaround% %actor% The clear water seems to perk %actor.name% up. + %send% %actor% The clear water seems to perk %actor.name% up. + dg_cast 'cure light' %actor% + return 0 + if %actor.thirst% < 0 + else + eval newhunger %currenthunger% + 1 + eval newthirst %currentthirst% + 5 + nop %actor.thirst(%newthirst%)% + nop %actor.hunger(%newhunger%)% + if %newthirst% > 20 + %send% %actor% You don't feel thirsty any more. + end + end +end +~ +$~ diff --git a/lib/world/zon/39.zon b/lib/world/zon/39.zon index 2198765..95abefc 100644 --- a/lib/world/zon/39.zon +++ b/lib/world/zon/39.zon @@ -2,6 +2,89 @@ Nivan~ Haven~ 3900 3999 30 2 d 0 0 0 3 14 +M 0 3944 2 3922 (the disguised woman) +E 1 3964 100 16 (a curving dagger) +E 1 3960 100 6 (a fake moustache) +E 1 3966 100 5 (a black silk shirt) +E 1 3965 100 7 (a pair of black silk pants) +E 1 3906 99 17 (a low-burning candle) +M 0 3943 1 3922 (a small child) +E 1 3962 100 17 (a rusty cup) +E 1 3961 100 16 (a false peg leg) +M 0 3942 2 3922 (the pickpocket) +E 1 3963 100 16 (a short, curving sword) +E 1 3966 100 5 (a black silk shirt) +E 1 3910 100 8 (a pair of black leather boots) +E 1 3909 100 2 (the silver ring) +E 1 3909 100 1 (the silver ring) +E 1 3968 100 17 (a purse) +M 0 3940 1 3922 (the smiling woman) +E 1 3969 100 5 (an expensive red dress) +E 1 3910 100 8 (a pair of black leather boots) +E 1 3963 100 16 (a short, curving sword) +E 1 3906 99 17 (a low-burning candle) +D 0 3983 5 1 (Luna's Square) +M 0 3953 1 3983 (a raving lunatic) +E 1 3967 99 12 (some rags) +E 1 3961 100 16 (a false peg leg) +M 0 3950 1 3983 (the paraniod schizophrenic) +E 1 3967 99 12 (some rags) +E 1 3962 100 17 (a rusty cup) +M 0 3949 2 3983 (a cackling bum) +E 1 3967 99 12 (some rags) +E 1 3962 100 17 (a rusty cup) +E 1 3961 100 16 (a false peg leg) +M 0 3948 1 3983 (the King of Luna's Alley) +E 1 3967 99 12 (some rags) +E 1 3983 100 17 (a wooden spoon) +E 1 3949 100 3 (an old leather dog's collar) +E 1 3950 100 13 (a rat's tail) +M 0 3941 1 3983 (a filcher) +E 1 3963 100 16 (a short, curving sword) +E 1 3966 100 5 (a black silk shirt) +E 1 3910 100 8 (a pair of black leather boots) +E 1 3909 100 2 (the silver ring) +E 1 3909 100 1 (the silver ring) +E 1 3968 100 17 (a purse) +M 0 3913 1 3953 (the sightseer) +E 1 3970 100 16 (a sharp cutlass) +E 1 3984 100 5 (the sparkling chainmail) +E 1 3985 100 6 (a black bandana) +M 0 3914 2 3953 (the man) +E 1 3958 100 16 (a steel shortsword) +E 1 3968 100 17 (a purse) +M 0 3915 3 3953 (the woman) +E 1 3958 100 16 (a steel shortsword) +E 1 3957 100 10 (a banded steel bracer) +M 0 3961 2 3953 (the strolling citizen) +E 1 3995 100 16 (a commoner's sword) +E 1 3978 100 15 (a silver bracelet) +E 1 3968 100 17 (a purse) +M 0 3962 3 3953 (the strolling citizen) +E 1 3993 100 16 (a sparkling silver mace) +E 1 3911 100 6 (a silver helm) +E 1 3909 100 1 (the silver ring) +E 1 3974 100 17 (a wine glass) +M 0 3923 4 3953 (an elite guard) +E 1 3997 99 5 (a well-made leather vest) +E 1 3996 99 14 (a black leather bracer) +E 1 3999 100 16 (a gull-marked sword) +M 0 3923 4 3953 (an elite guard) +E 1 3997 99 5 (a well-made leather vest) +E 1 3996 99 14 (a black leather bracer) +E 1 3999 100 16 (a gull-marked sword) +M 0 3923 4 3953 (an elite guard) +E 1 3997 99 5 (a well-made leather vest) +E 1 3996 99 14 (a black leather bracer) +E 1 3999 100 16 (a gull-marked sword) +M 0 3925 2 3953 (the talented bard) +E 1 3915 100 17 (a stag carving) +E 1 3970 100 16 (a sharp cutlass) +E 1 3978 100 14 (a silver bracelet) +E 1 3996 99 15 (a black leather bracer) +M 0 3926 1 3953 (a tumbler) +E 1 3909 100 2 (the silver ring) +E 1 3909 100 1 (the silver ring) M 0 3923 1 3956 (an elite guard) E 1 3999 100 16 (a gull-marked sword) E 1 3997 99 5 (a well-made leather vest) @@ -66,45 +149,6 @@ M 0 3969 2 3995 (a man) E 1 3986 100 16 (a bullwhip) E 1 3977 100 17 (a wooden handcart) E 1 3909 100 1 (the silver ring) -M 0 3913 1 3953 (the sightseer) -E 1 3970 100 16 (a sharp cutlass) -E 1 3984 100 5 (the sparkling chainmail) -E 1 3985 100 6 (a black bandana) -M 0 3914 2 3953 (the man) -E 1 3958 100 16 (a steel shortsword) -E 1 3968 100 17 (a purse) -M 0 3915 3 3953 (the woman) -E 1 3958 100 16 (a steel shortsword) -E 1 3957 100 10 (a banded steel bracer) -M 0 3961 2 3953 (the strolling citizen) -E 1 3995 100 16 (a commoner's sword) -E 1 3978 100 15 (a silver bracelet) -E 1 3968 100 17 (a purse) -M 0 3962 3 3953 (the strolling citizen) -E 1 3993 100 16 (a sparkling silver mace) -E 1 3911 100 6 (a silver helm) -E 1 3909 100 1 (the silver ring) -E 1 3974 100 17 (a wine glass) -M 0 3923 4 3953 (an elite guard) -E 1 3997 99 5 (a well-made leather vest) -E 1 3996 99 14 (a black leather bracer) -E 1 3999 100 16 (a gull-marked sword) -M 0 3923 4 3953 (an elite guard) -E 1 3997 99 5 (a well-made leather vest) -E 1 3996 99 14 (a black leather bracer) -E 1 3999 100 16 (a gull-marked sword) -M 0 3923 4 3953 (an elite guard) -E 1 3997 99 5 (a well-made leather vest) -E 1 3996 99 14 (a black leather bracer) -E 1 3999 100 16 (a gull-marked sword) -M 0 3925 2 3953 (the talented bard) -E 1 3915 100 17 (a stag carving) -E 1 3970 100 16 (a sharp cutlass) -E 1 3978 100 14 (a silver bracelet) -E 1 3996 100 10 (a black leather bracer) -M 0 3926 1 3953 (a tumbler) -E 1 3909 100 2 (the silver ring) -E 1 3909 100 1 (the silver ring) M 0 3922 2 3994 (an elite patrolman) E 1 3997 99 5 (a well-made leather vest) E 1 3996 99 14 (a black leather bracer) @@ -262,29 +306,6 @@ E 1 3962 100 17 (a rusty cup) M 0 3950 1 3973 (the paraniod schizophrenic) E 1 3967 99 12 (some rags) E 1 3962 100 17 (a rusty cup) -D 0 3983 5 1 (Luna's Square) -M 0 3953 1 3983 (a raving lunatic) -E 1 3967 100 5 (some rags) -E 1 3961 100 16 (a false peg leg) -M 0 3950 1 3983 (the paraniod schizophrenic) -E 1 3967 99 12 (some rags) -E 1 3962 100 17 (a rusty cup) -M 0 3949 2 3983 (a cackling bum) -E 1 3967 99 12 (some rags) -E 1 3962 100 17 (a rusty cup) -E 1 3961 100 16 (a false peg leg) -M 0 3948 1 3983 (the King of Luna's Alley) -E 1 3967 99 12 (some rags) -E 1 3983 100 17 (a wooden spoon) -E 1 3949 100 3 (an old leather dog's collar) -E 1 3950 100 13 (a rat's tail) -M 0 3941 1 3983 (a filcher) -E 1 3963 100 16 (a short, curving sword) -E 1 3966 100 5 (a black silk shirt) -E 1 3910 100 8 (a pair of black leather boots) -E 1 3909 100 2 (the silver ring) -E 1 3909 100 1 (the silver ring) -E 1 3968 100 17 (a purse) M 0 3915 1 3965 (the woman) E 1 3958 100 16 (a steel shortsword) E 1 3957 100 10 (a banded steel bracer) @@ -307,27 +328,6 @@ M 0 3923 2 3963 (an elite guard) E 1 3997 99 5 (a well-made leather vest) E 1 3996 99 14 (a black leather bracer) E 1 3999 100 16 (a gull-marked sword) -M 0 3944 2 3922 (the disguised woman) -E 1 3964 100 16 (a curving dagger) -E 1 3960 100 6 (a fake moustache) -E 1 3966 100 5 (a black silk shirt) -E 1 3965 100 7 (a pair of black silk pants) -E 1 3906 99 17 (a low-burning candle) -M 0 3943 1 3922 (a small child) -E 1 3962 100 17 (a rusty cup) -E 1 3961 100 16 (a false peg leg) -M 0 3942 2 3922 (the pickpocket) -E 1 3963 100 16 (a short, curving sword) -E 1 3966 100 5 (a black silk shirt) -E 1 3910 100 8 (a pair of black leather boots) -E 1 3909 100 2 (the silver ring) -E 1 3909 100 1 (the silver ring) -E 1 3968 100 17 (a purse) -M 0 3940 1 3922 (the smiling woman) -E 1 3969 100 5 (an expensive red dress) -E 1 3910 100 8 (a pair of black leather boots) -E 1 3963 100 16 (a short, curving sword) -E 1 3906 100 10 (a low-burning candle) M 0 3922 4 3960 (an elite patrolman) E 1 3997 99 5 (a well-made leather vest) E 1 3996 99 14 (a black leather bracer) diff --git a/src/constants.c b/src/constants.c index 1efbb1f..9060ab5 100644 --- a/src/constants.c +++ b/src/constants.c @@ -24,7 +24,7 @@ * @todo cpp_extern isn't needed here (or anywhere) as the extern reserved word * works correctly with C compilers (at least in my Experience) * Jeremy Osborne 1/28/2008 */ -cpp_extern const char *tbamud_version = "tbaMUD 3.61"; +cpp_extern const char *tbamud_version = "tbaMUD 3.62"; /* strings corresponding to ordinals/bitvectors in structs.h */ /* (Note: strings for class definitions in class.c instead of here) */ diff --git a/src/genmob.c b/src/genmob.c index 84abad9..ba74661 100644 --- a/src/genmob.c +++ b/src/genmob.c @@ -395,6 +395,6 @@ void check_mobile_string(mob_vnum i, char **string, const char *desc) mudlog(BRF, LVL_GOD, TRUE, "%s", smbuf); if (*string) free(*string); - *string = strdup("An undefined string."); + *string = strdup("An undefined string.\n"); } } diff --git a/src/prefedit.c b/src/prefedit.c index 29eaf82..13691ca 100755 --- a/src/prefedit.c +++ b/src/prefedit.c @@ -1,919 +1,919 @@ -/************************************************************************** -* File: prefedit.c Part of tbaMUD * -* Usage: Player-level OLC for setting preferences and toggles * -* * -* Created by Jamdog for tbaMUD 3.59 * -* All rights reserved. See license for complete information. * -* * -* Copyright (C) 1993, 94 by the Trustees of the Johns Hopkins University * -* CircleMUD is based on DikuMUD, Copyright (C) 1990, 1991. * -**************************************************************************/ - -#include "conf.h" -#include "sysdep.h" -#include "structs.h" -#include "comm.h" -#include "utils.h" -#include "handler.h" -#include "interpreter.h" -#include "db.h" -#include "oasis.h" -#include "prefedit.h" -#include "screen.h" - -/* Internal (static) functions */ -static void prefedit_setup(struct descriptor_data *d, struct char_data *vict); -static void prefedit_save_to_char(struct descriptor_data *d); -static void prefedit_disp_main_menu(struct descriptor_data *d); -static void prefedit_disp_toggles_menu(struct descriptor_data *d); -static void prefedit_disp_prompt_menu(struct descriptor_data *d); -static void prefedit_disp_color_menu(struct descriptor_data *d); -static void prefedit_disp_syslog_menu(struct descriptor_data *d); - -/* Note: there is no setup_new, as you can ONLY edit an existing player */ -/* vict is normally = d->character, except when imps edit players */ -static void prefedit_setup(struct descriptor_data *d, struct char_data *vict) -{ - int i; - struct prefs_data *toggles; - - if (!vict) vict = d->character; - - /*. Build a copy of the player's toggles .*/ - CREATE (toggles, struct prefs_data, 1); - - /* no strings to allocate space for */ - for (i=0; ipref_flags[i] = PRF_FLAGS(vict)[i]; - - toggles->wimp_level = GET_WIMP_LEV(vict); - toggles->page_length = GET_PAGE_LENGTH(vict); - toggles->screen_width = GET_SCREEN_WIDTH(vict); - - toggles->ch = vict; - - /*. Attach toggles copy to editors descriptor .*/ - OLC_PREFS(d) = toggles; - OLC_VAL(d) = 0; - prefedit_disp_main_menu(d); -} - -static void prefedit_save_to_char(struct descriptor_data *d) -{ - int i; - struct char_data *vict; - - vict = PREFEDIT_GET_CHAR; - - if (vict && vict->desc && IS_PLAYING(vict->desc)) - { - for (i=0; ipref_flags[i]; - - GET_WIMP_LEV(vict) = OLC_PREFS(d)->wimp_level; - GET_PAGE_LENGTH(vict) = OLC_PREFS(d)->page_length; - GET_SCREEN_WIDTH(vict) = OLC_PREFS(d)->screen_width; - - save_char(vict); - } - else - { - if (!vict) { - mudlog(BRF, LVL_BUILDER, TRUE, "SYSERR: Unable to save toggles (no vict)"); - send_to_char(d->character, "Unable to save toggles (no vict)"); - } else if (!vict->desc) { - mudlog(BRF, LVL_BUILDER, TRUE, "SYSERR: Unable to save toggles (no vict descriptor)"); - send_to_char(d->character, "Unable to save toggles (no vict descriptor)"); - } else if (!IS_PLAYING(vict->desc)) { - mudlog(BRF, LVL_BUILDER, TRUE, "SYSERR: Unable to save toggles (vict not playing)"); - send_to_char(d->character, "Unable to save toggles (vict not playing)"); - } else { - mudlog(BRF, LVL_BUILDER, TRUE, "SYSERR: Unable to save toggles (unknown reason)"); - send_to_char(d->character, "Unable to save toggles (unknown reason)"); - } - } -} - -static void prefedit_disp_main_menu(struct descriptor_data *d) -{ - struct char_data *vict; - char prompt_string[10], color_string[10], syslog_string[10]; - const char *multi_types[] = { "Off", "Brief", "Normal", "Complete", "\n" }; - - /* Set up the required variables and strings */ - vict = PREFEDIT_GET_CHAR; - - sprintf(prompt_string, "%s%s%s", PREFEDIT_FLAGGED(PRF_DISPHP) ? "H" : "", PREFEDIT_FLAGGED(PRF_DISPMANA) ? "M" : "", - PREFEDIT_FLAGGED(PRF_DISPMOVE) ? "V" : "" ); - - sprintf(color_string, "%s", multi_types[(PREFEDIT_FLAGGED(PRF_COLOR_1) ? 1 : 0) + (PREFEDIT_FLAGGED(PRF_COLOR_2) ? 2 : 0)]); - - send_to_char(d->character, "\r\n%sPreferences for %s%s\r\n", - CCYEL(d->character, C_NRM), - GET_NAME(vict), - CCNRM(d->character, C_NRM) ); - - - /* The mortal preferences section of the actual menu */ - send_to_char(d->character, "\r\n" - "%sPreferences\r\n" - "%sP%s) Prompt : %s[%s%-3s%s] %sL%s) Pagelength : %s[%s%-3d%s]\r\n" - "%sC%s) Color : %s[%s%-8s%s] %sS%s) Screenwidth: %s[%s%-3d%s]\r\n" - "%sW%s) Wimpy : %s[%s%-4d%s]%s\r\n", - CCWHT(d->character, C_NRM), -/* Line 1 - prompt and pagelength */ - CBYEL(d->character, C_NRM), CCNRM(d->character, C_NRM), CCCYN(d->character, C_NRM), CCYEL(d->character, C_NRM), - prompt_string, CCCYN(d->character, C_NRM), CBYEL(d->character, C_NRM), CCNRM(d->character, C_NRM), - CCCYN(d->character, C_NRM), CCYEL(d->character, C_NRM), PREFEDIT_GET_PAGELENGTH, CCCYN(d->character, C_NRM), -/* Line 2 - color and screenwidth */ - CBYEL(d->character, C_NRM), CCNRM(d->character, C_NRM), CCCYN(d->character, C_NRM), CCYEL(d->character, C_NRM), - color_string, CCCYN(d->character, C_NRM), CBYEL(d->character, C_NRM), CCNRM(d->character, C_NRM), - CCCYN(d->character, C_NRM), CCYEL(d->character, C_NRM), PREFEDIT_GET_SCREENWIDTH, CCCYN(d->character, C_NRM), -/* Line 2 - wimpy */ - CBYEL(d->character, C_NRM), CCNRM(d->character, C_NRM), CCCYN(d->character, C_NRM), CCYEL(d->character, C_NRM), - PREFEDIT_GET_WIMP_LEV, CCCYN(d->character, C_NRM), CCNRM(d->character, C_NRM) - ); - - send_to_char(d->character, "%sT%s) Toggle Preferences...\r\n", - CBYEL(d->character, C_NRM), CCNRM(d->character, C_NRM) ); - - /* Imm Prefs */ - if (GET_LEVEL(PREFEDIT_GET_CHAR) >= LVL_IMMORT) - { - sprintf(syslog_string, "%s", multi_types[((PREFEDIT_FLAGGED(PRF_LOG1) ? 1 : 0)+ (PREFEDIT_FLAGGED(PRF_LOG2) ? 2 : 0))] ); - - send_to_char(d->character, "\r\n" - "%sImmortal Preferences\r\n" - "%s1%s) Syslog Level %s[%s%8s%s] %s4%s) ClsOLC %s[%s%3s%s]\r\n" - "%s2%s) Show Flags %s[%s%3s%s] %s5%s) No WizNet %s[%s%3s%s]\r\n" - "%s3%s) No Hassle %s[%s%3s%s] %s6%s) Holylight %s[%s%3s%s]\r\n", - CBWHT(d->character, C_NRM), -/* Line 1 - syslog and clsolc */ - CBYEL(d->character, C_NRM), CCNRM(d->character, C_NRM), CCCYN(d->character, C_NRM), CCYEL(d->character, C_NRM), - syslog_string, CCCYN(d->character, C_NRM), CBYEL(d->character, C_NRM), CCNRM(d->character, C_NRM), - CCCYN(d->character, C_NRM), CCYEL(d->character, C_NRM), ONOFF(PREFEDIT_FLAGGED(PRF_CLS)), CCCYN(d->character, C_NRM), -/* Line 2 - show vnums and nowiz */ - CBYEL(d->character, C_NRM), CCNRM(d->character, C_NRM), CCCYN(d->character, C_NRM), CCYEL(d->character, C_NRM), - ONOFF(PREFEDIT_FLAGGED(PRF_SHOWVNUMS)), CCCYN(d->character, C_NRM), CBYEL(d->character, C_NRM), CCNRM(d->character, C_NRM), - CCCYN(d->character, C_NRM), CCYEL(d->character, C_NRM), ONOFF(PREFEDIT_FLAGGED(PRF_NOWIZ)), CCCYN(d->character, C_NRM), -/* Line 3 - nohassle and holylight */ - CBYEL(d->character, C_NRM), CCNRM(d->character, C_NRM), CCCYN(d->character, C_NRM), CCYEL(d->character, C_NRM), - ONOFF(PREFEDIT_FLAGGED(PRF_NOHASSLE)), CCCYN(d->character, C_NRM), CBYEL(d->character, C_NRM), CCNRM(d->character, C_NRM), - CCCYN(d->character, C_NRM), CCYEL(d->character, C_NRM), ONOFF(PREFEDIT_FLAGGED(PRF_HOLYLIGHT)), CCCYN(d->character, C_NRM) - ); - } - -/* Finishing Off */ - send_to_char(d->character, "\r\n" - "%sD%s) Restore all default values\r\n" - "%sQ%s) Quit\r\n" - "\r\n", - CBYEL(d->character, C_NRM), CCNRM(d->character, C_NRM), - CBYEL(d->character, C_NRM), CCNRM(d->character, C_NRM) - ); - - - /* Bottom of the menu */ - - OLC_MODE(d) = PREFEDIT_MAIN_MENU; -} - -static void prefedit_disp_toggles_menu(struct descriptor_data *d) -{ - struct char_data *vict; - - /* Set up the required variables and strings */ - vict = OLC_PREFS(d)->ch; - - /* Top of the menu */ - send_to_char(d->character, "Toggle preferences for %s%-20s\r\n", - CBGRN(d->character, C_NRM), GET_NAME(vict)); - - send_to_char(d->character, "\r\n" - "%sAuto-flags Channels\r\n", - CBWHT(d->character, C_NRM)); - - /* The top section of the actual menu */ - send_to_char(d->character, "%s1%s) Autoexits %s[%s%3s%s] %sA%s) Gossip %s[%s%3s%s]\r\n" - "%s2%s) Autoloot %s[%s%3s%s] %sB%s) Shout %s[%s%3s%s]\r\n" - "%s3%s) Autogold %s[%s%3s%s] %sC%s) Tell %s[%s%3s%s]\r\n" - "%s4%s) Autosac %s[%s%3s%s] %sD%s) Auction %s[%s%3s%s]\r\n" - "%s5%s) Autoassist %s[%s%3s%s] %sE%s) Gratz %s[%s%3s%s]\r\n" - "%s6%s) Autosplit %s[%s%3s%s]\r\n", -/* Line 1 - autoexits and gossip */ - CBYEL(d->character, C_NRM), CCNRM(d->character, C_NRM), CCCYN(d->character, C_NRM), PREFEDIT_FLAGGED(PRF_AUTOEXIT) ? CBGRN(d->character, C_NRM) : CBRED(d->character, C_NRM), - ONOFF(PREFEDIT_FLAGGED(PRF_AUTOEXIT)), CCCYN(d->character, C_NRM), CBYEL(d->character, C_NRM), CCNRM(d->character, C_NRM), CCCYN(d->character, C_NRM), - PREFEDIT_FLAGGED(PRF_NOGOSS) ? CBRED(d->character, C_NRM) : CBGRN(d->character, C_NRM), ONOFF(!PREFEDIT_FLAGGED(PRF_NOGOSS)), CCCYN(d->character, C_NRM), -/* Line 2 - autoloot and shout */ - CBYEL(d->character, C_NRM), CCNRM(d->character, C_NRM), CCCYN(d->character, C_NRM), PREFEDIT_FLAGGED(PRF_AUTOLOOT) ? CBGRN(d->character, C_NRM) : CBRED(d->character, C_NRM), - ONOFF(PREFEDIT_FLAGGED(PRF_AUTOLOOT)), CCCYN(d->character, C_NRM), CBYEL(d->character, C_NRM), CCNRM(d->character, C_NRM), CCCYN(d->character, C_NRM), - PREFEDIT_FLAGGED(PRF_NOSHOUT) ? CBRED(d->character, C_NRM) : CBGRN(d->character, C_NRM), ONOFF(!PREFEDIT_FLAGGED(PRF_NOSHOUT)), CCCYN(d->character, C_NRM), -/* Line 3 - autogold and tell */ - CBYEL(d->character, C_NRM), CCNRM(d->character, C_NRM), CCCYN(d->character, C_NRM), PREFEDIT_FLAGGED(PRF_AUTOGOLD) ? CBGRN(d->character, C_NRM) : CBRED(d->character, C_NRM), - ONOFF(PREFEDIT_FLAGGED(PRF_AUTOGOLD)), CCCYN(d->character, C_NRM), CBYEL(d->character, C_NRM), CCNRM(d->character, C_NRM), CCCYN(d->character, C_NRM), - PREFEDIT_FLAGGED(PRF_NOTELL) ? CBRED(d->character, C_NRM) : CBGRN(d->character, C_NRM), ONOFF(!PREFEDIT_FLAGGED(PRF_NOTELL)), CCCYN(d->character, C_NRM), -/* Line 4 - autosac and auction */ - CBYEL(d->character, C_NRM), CCNRM(d->character, C_NRM), CCCYN(d->character, C_NRM), PREFEDIT_FLAGGED(PRF_AUTOSAC) ? CBGRN(d->character, C_NRM) : CBRED(d->character, C_NRM), - ONOFF(PREFEDIT_FLAGGED(PRF_AUTOSAC)), CCCYN(d->character, C_NRM), CBYEL(d->character, C_NRM), CCNRM(d->character, C_NRM), CCCYN(d->character, C_NRM), - PREFEDIT_FLAGGED(PRF_NOAUCT) ? CBRED(d->character, C_NRM) : CBGRN(d->character, C_NRM), ONOFF(!PREFEDIT_FLAGGED(PRF_NOAUCT)), CCCYN(d->character, C_NRM), -/* Line 5 - autoassist and grats */ - CBYEL(d->character, C_NRM), CCNRM(d->character, C_NRM), CCCYN(d->character, C_NRM), PREFEDIT_FLAGGED(PRF_AUTOASSIST) ? CBGRN(d->character, C_NRM) : CBRED(d->character, C_NRM), - ONOFF(PREFEDIT_FLAGGED(PRF_AUTOASSIST)), CCCYN(d->character, C_NRM), CBYEL(d->character, C_NRM), CCNRM(d->character, C_NRM), CCCYN(d->character, C_NRM), - PREFEDIT_FLAGGED(PRF_NOGRATZ) ? CBRED(d->character, C_NRM) : CBGRN(d->character, C_NRM), ONOFF(!PREFEDIT_FLAGGED(PRF_NOGRATZ)), CCCYN(d->character, C_NRM), -/* Line 6 - autosplit */ - CBYEL(d->character, C_NRM), CCNRM(d->character, C_NRM), CCCYN(d->character, C_NRM), PREFEDIT_FLAGGED(PRF_AUTOSPLIT) ? CBGRN(d->character, C_NRM) : CBRED(d->character, C_NRM), - ONOFF(PREFEDIT_FLAGGED(PRF_AUTOSPLIT)), CCCYN(d->character, C_NRM) - ); - - send_to_char(d->character, "%s7%s) Automap %s[%s%3s%s]\r\n" - "%s8%s) Autokey %s[%s%3s%s]\r\n" - "%s9%s) Autodoor %s[%s%3s%s]\r\n", -/* Line 7 - automap */ - CBYEL(d->character, C_NRM), CCNRM(d->character, C_NRM), CCCYN(d->character, C_NRM), PREFEDIT_FLAGGED(PRF_AUTOMAP) ? CBGRN(d->character, C_NRM) : CBRED(d->character, C_NRM), - ONOFF(PREFEDIT_FLAGGED(PRF_AUTOMAP)), CCCYN(d->character, C_NRM), -/* Line 8 - autokey */ - CBYEL(d->character, C_NRM), CCNRM(d->character, C_NRM), CCCYN(d->character, C_NRM), PREFEDIT_FLAGGED(PRF_AUTOKEY) ? CBGRN(d->character, C_NRM) : CBRED(d->character, C_NRM), - ONOFF(PREFEDIT_FLAGGED(PRF_AUTOKEY)), CCCYN(d->character, C_NRM), -/* Line 9 - autodoor */ - CBYEL(d->character, C_NRM), CCNRM(d->character, C_NRM), CCCYN(d->character, C_NRM), PREFEDIT_FLAGGED(PRF_AUTODOOR) ? CBGRN(d->character, C_NRM) : CBRED(d->character, C_NRM), - ONOFF(PREFEDIT_FLAGGED(PRF_AUTODOOR)), CCCYN(d->character, C_NRM) - ); - - /* The bottom section of the toggles menu */ - send_to_char(d->character, "\r\n" - "%sOther Flags\r\n" - "%sF%s) No Summon %s[%s%3s%s] %sH%s) Brief %s[%s%3s%s]\r\n" - "%sG%s) No Repeat %s[%s%3s%s] %sI%s) Compact %s[%s%3s%s]\r\n", - CBWHT(d->character, C_NRM), -/* Line 10 - nosummon and brief */ - CBYEL(d->character, C_NRM), CCNRM(d->character, C_NRM), CCCYN(d->character, C_NRM), CCYEL(d->character, C_NRM), - ONOFF(!PREFEDIT_FLAGGED(PRF_SUMMONABLE)), CCCYN(d->character, C_NRM), CBYEL(d->character, C_NRM), CCNRM(d->character, C_NRM), - CCCYN(d->character, C_NRM), CCYEL(d->character, C_NRM), ONOFF(PREFEDIT_FLAGGED(PRF_BRIEF)), CCCYN(d->character, C_NRM), -/* Line 11 - norepeat and compact */ - CBYEL(d->character, C_NRM), CCNRM(d->character, C_NRM), CCCYN(d->character, C_NRM), CCYEL(d->character, C_NRM), - ONOFF(PREFEDIT_FLAGGED(PRF_NOREPEAT)), CCCYN(d->character, C_NRM), CBYEL(d->character, C_NRM), CCNRM(d->character, C_NRM), - CCCYN(d->character, C_NRM), CCYEL(d->character, C_NRM), ONOFF(PREFEDIT_FLAGGED(PRF_COMPACT)), CCCYN(d->character, C_NRM) - ); - -/* Finishing Off */ - send_to_char(d->character, "%sQ%s) Quit toggle preferences...\r\n", - CBYEL(d->character, C_NRM), CCNRM(d->character, C_NRM) ); - - OLC_MODE(d) = PREFEDIT_TOGGLE_MENU; -} - -static void prefedit_disp_prompt_menu(struct descriptor_data *d) -{ - char prompt_string[7]; - - if (PREFEDIT_FLAGGED(PRF_DISPAUTO)) - sprintf(prompt_string, ""); - else - sprintf(prompt_string, "%s%s%s", PREFEDIT_FLAGGED(PRF_DISPHP) ? "H" : "", PREFEDIT_FLAGGED(PRF_DISPMANA) ? "M" : "", - PREFEDIT_FLAGGED(PRF_DISPMOVE) ? "V" : ""); - - send_to_char(d->character, "%sPrompt Settings\r\n" - "%s1%s) Toggle HP\r\n" - "%s2%s) Toggle Mana\r\n" - "%s3%s) Toggle Moves\r\n" - "%s4%s) Toggle auto flag\r\n\r\n" - "%sCurrent Prompt: %s%s%s\r\n\r\n" - "%s0%s) Quit (to main menu)\r\n", - CBWHT(d->character, C_NRM), CBYEL(d->character, C_NRM), CCNRM(d->character, C_NRM), - CBYEL(d->character, C_NRM), CCNRM(d->character, C_NRM), - CBYEL(d->character, C_NRM), CCNRM(d->character, C_NRM), - CBYEL(d->character, C_NRM), CCNRM(d->character, C_NRM), - CCNRM(d->character, C_NRM), CCCYN(d->character, C_NRM), prompt_string, CCNRM(d->character, C_NRM), - CBYEL(d->character, C_NRM), CCNRM(d->character, C_NRM) ); - - send_to_char(d->character, "Enter Choice :"); - OLC_MODE(d) = PREFEDIT_PROMPT; -} - -static void prefedit_disp_color_menu(struct descriptor_data *d) -{ - send_to_char(d->character, "%sColor level\r\n" - "%s1%s) Off %s(do not display any color - monochrome)%s\r\n" - "%s2%s) Brief %s(show minimal color where necessary)%s\r\n" - "%s3%s) Normal %s(show game-enhancing color)%s\r\n" - "%s4%s) On %s(show all colors whenever possible)%s\r\n", - CBWHT(d->character, C_NRM), - CBYEL(d->character, C_NRM), CCNRM(d->character, C_NRM), CCYEL(d->character, C_NRM), CCNRM(d->character, C_NRM), - CBYEL(d->character, C_NRM), CCNRM(d->character, C_NRM), CCYEL(d->character, C_NRM), CCNRM(d->character, C_NRM), - CBYEL(d->character, C_NRM), CCNRM(d->character, C_NRM), CCYEL(d->character, C_NRM), CCNRM(d->character, C_NRM), - CBYEL(d->character, C_NRM), CCNRM(d->character, C_NRM), CCYEL(d->character, C_NRM), CCNRM(d->character, C_NRM) ); - - send_to_char(d->character, "Enter Choice :"); - OLC_MODE(d) = PREFEDIT_COLOR; -} - -static void prefedit_disp_syslog_menu(struct descriptor_data *d) -{ - send_to_char(d->character, "%sSyslog level\r\n" - "%s1%s) Off %s(do not display any logs or error messages)%s\r\n" - "%s2%s) Brief %s(show only important warnings or errors)%s\r\n" - "%s3%s) Normal %s(show all warnings and errors)%s\r\n" - "%s4%s) Complete %s(show all logged information for your level)%s\r\n", - CBWHT(d->character, C_NRM), - CBYEL(d->character, C_NRM), CCNRM(d->character, C_NRM), CCYEL(d->character, C_NRM), CCNRM(d->character, C_NRM), - CBYEL(d->character, C_NRM), CCNRM(d->character, C_NRM), CCYEL(d->character, C_NRM), CCNRM(d->character, C_NRM), - CBYEL(d->character, C_NRM), CCNRM(d->character, C_NRM), CCYEL(d->character, C_NRM), CCNRM(d->character, C_NRM), - CBYEL(d->character, C_NRM), CCNRM(d->character, C_NRM), CCYEL(d->character, C_NRM), CCNRM(d->character, C_NRM) ); - - send_to_char(d->character, "Enter Choice :"); - OLC_MODE(d) = PREFEDIT_SYSLOG; -} - -void prefedit_parse(struct descriptor_data * d, char *arg) -{ - int number; - - switch (OLC_MODE(d)) { - case PREFEDIT_CONFIRM_SAVE: - switch (*arg) { - case 'y': - case 'Y': - prefedit_save_to_char(d); - mudlog(CMP, LVL_BUILDER, TRUE, "OLC: %s edits toggles for %s", GET_NAME(d->character), GET_NAME(OLC_PREFS(d)->ch)); - /*. No strings to save - cleanup all .*/ - cleanup_olc(d, CLEANUP_ALL); - break; - case 'n': - case 'N': - /* don't save to char, just free everything up */ - cleanup_olc(d, CLEANUP_ALL); - break; - default: - send_to_char(d->character, "Invalid choice!\r\n"); - send_to_char(d->character, "Do you wish to save these toggle settings? : "); - break; - } - return; - - case PREFEDIT_MAIN_MENU: - switch (*arg) { - case 'q': - case 'Q': - if (OLC_VAL(d)) - { /*. Something has been modified .*/ - send_to_char(d->character, "Do you wish to save these toggle settings? : "); - OLC_MODE(d) = PREFEDIT_CONFIRM_SAVE; - } else - cleanup_olc(d, CLEANUP_ALL); - return; - - case 'p': - case 'P': - prefedit_disp_prompt_menu(d); - return; - - case 'c': - case 'C': - prefedit_disp_color_menu(d); - return; - - case 'l': - case 'L': - send_to_char(d->character, "Enter number of lines per page (10-60): "); - OLC_MODE(d) = PREFEDIT_PAGELENGTH; - return; - - case 's': - case 'S': - send_to_char(d->character, "Enter number of columns per page (40-120): "); - OLC_MODE(d) = PREFEDIT_SCREENWIDTH; - return; - - case 'w': - case 'W': - send_to_char(d->character, "Enter HP at which to flee (0-%d): ", MIN(GET_MAX_HIT(d->character)/2, 500)); - OLC_MODE(d) = PREFEDIT_WIMPY; - return; - - case 't': - case 'T': - prefedit_disp_toggles_menu(d); - return; - - case 'd': - case 'D': - prefedit_Restore_Defaults(d); - break; - - /* Below this point are Imm-only toggles */ - case '1': - if (GET_LEVEL(PREFEDIT_GET_CHAR) < LVL_IMMORT) - { - send_to_char(d->character, "%sInvalid choice!%s\r\n", CBRED(d->character, C_NRM), CCNRM(d->character, C_NRM)); - prefedit_disp_main_menu(d); - } - else - { - prefedit_disp_syslog_menu(d); - return; - } - break; - - case '2': - if (GET_LEVEL(PREFEDIT_GET_CHAR) < LVL_IMMORT) - { - send_to_char(d->character, "%sInvalid choice!%s\r\n", CBRED(d->character, C_NRM), CCNRM(d->character, C_NRM)); - prefedit_disp_main_menu(d); - } - else - { - TOGGLE_BIT_AR(PREFEDIT_GET_FLAGS, PRF_SHOWVNUMS); - } - break; - - case '3': - if (GET_LEVEL(PREFEDIT_GET_CHAR) < LVL_IMMORT) - { - send_to_char(d->character, "%sInvalid choice!%s\r\n", CBRED(d->character, C_NRM), CCNRM(d->character, C_NRM)); - prefedit_disp_main_menu(d); - } - else - { - TOGGLE_BIT_AR(PREFEDIT_GET_FLAGS, PRF_NOHASSLE); - } - break; - - case '4': - if (GET_LEVEL(PREFEDIT_GET_CHAR) < LVL_IMMORT) - { - send_to_char(d->character, "%sInvalid choice!%s\r\n", CBRED(d->character, C_NRM), CCNRM(d->character, C_NRM)); - prefedit_disp_main_menu(d); - } - else - { - TOGGLE_BIT_AR(PREFEDIT_GET_FLAGS, PRF_CLS); - } - break; - - case '5': - if (GET_LEVEL(PREFEDIT_GET_CHAR) < LVL_IMMORT) - { - send_to_char(d->character, "%sInvalid choice!%s\r\n", CBRED(d->character, C_NRM), CCNRM(d->character, C_NRM)); - prefedit_disp_main_menu(d); - } - else - { - TOGGLE_BIT_AR(PREFEDIT_GET_FLAGS, PRF_NOWIZ); - } - break; - - case '6': - if (GET_LEVEL(PREFEDIT_GET_CHAR) < LVL_IMMORT) - { - send_to_char(d->character, "%sInvalid choice!%s\r\n", CBRED(d->character, C_NRM), CCNRM(d->character, C_NRM)); - prefedit_disp_main_menu(d); - } - else - { - TOGGLE_BIT_AR(PREFEDIT_GET_FLAGS, PRF_HOLYLIGHT); - } - break; - - default: - send_to_char(d->character, "%sInvalid choice!%s\r\n", CBRED(d->character, C_NRM), CCNRM(d->character, C_NRM)); - prefedit_disp_main_menu(d); - break; - } - break; - - case PREFEDIT_PAGELENGTH: - number = atoi(arg); - OLC_PREFS(d)->page_length = MAX(10, MIN(number, 60)); - break; - - case PREFEDIT_SCREENWIDTH: - number = atoi(arg); - OLC_PREFS(d)->screen_width = MAX(40, MIN(number, 120)); - break; - - case PREFEDIT_WIMPY: - number = atoi(arg); - OLC_PREFS(d)->wimp_level = MAX(0, MIN(number, 500)); - break; - - case PREFEDIT_COLOR: - number = atoi(arg) - 1; - if ((number < 0) || (number > 3)) { - send_to_char(d->character, "%sThat's not a valid choice!%s\r\n", CBRED(d->character, C_NRM), CCNRM(d->character, C_NRM)); - prefedit_disp_color_menu(d); - return; - } - REMOVE_BIT_AR(PREFEDIT_GET_FLAGS, PRF_COLOR_1); - REMOVE_BIT_AR(PREFEDIT_GET_FLAGS, PRF_COLOR_2); - if (number % 2) SET_BIT_AR(PREFEDIT_GET_FLAGS, PRF_COLOR_1); - if (number >= 2) SET_BIT_AR(PREFEDIT_GET_FLAGS, PRF_COLOR_2); - - break; - - case PREFEDIT_TOGGLE_MENU: - switch (*arg) { - case 'q': - case 'Q': - case 'x' : - case 'X' : prefedit_disp_main_menu(d); - return; - - case '1': - TOGGLE_BIT_AR(PREFEDIT_GET_FLAGS, PRF_AUTOEXIT); - break; - - case '2': - TOGGLE_BIT_AR(PREFEDIT_GET_FLAGS, PRF_AUTOLOOT); - break; - - case '3': - TOGGLE_BIT_AR(PREFEDIT_GET_FLAGS, PRF_AUTOGOLD); - break; - - case '4': - TOGGLE_BIT_AR(PREFEDIT_GET_FLAGS, PRF_AUTOSAC); - break; - - case '5': - TOGGLE_BIT_AR(PREFEDIT_GET_FLAGS, PRF_AUTOASSIST); - break; - - case '6': - TOGGLE_BIT_AR(PREFEDIT_GET_FLAGS, PRF_AUTOSPLIT); - break; - - case '7': - TOGGLE_BIT_AR(PREFEDIT_GET_FLAGS, PRF_AUTOMAP); - break; - - case '8': - TOGGLE_BIT_AR(PREFEDIT_GET_FLAGS, PRF_AUTOKEY); - break; - - case '9': - TOGGLE_BIT_AR(PREFEDIT_GET_FLAGS, PRF_AUTODOOR); - break; - - case 'a': - case 'A': - TOGGLE_BIT_AR(PREFEDIT_GET_FLAGS, PRF_NOGOSS); - break; - - case 'b': - case 'B': - TOGGLE_BIT_AR(PREFEDIT_GET_FLAGS, PRF_NOSHOUT); - break; - - case 'c': - case 'C': - TOGGLE_BIT_AR(PREFEDIT_GET_FLAGS, PRF_NOTELL); - break; - - case 'd': - case 'D': - TOGGLE_BIT_AR(PREFEDIT_GET_FLAGS, PRF_NOAUCT); - break; - - case 'e': - case 'E': - TOGGLE_BIT_AR(PREFEDIT_GET_FLAGS, PRF_NOGRATZ); - break; - - case 'f': - case 'F': - TOGGLE_BIT_AR(PREFEDIT_GET_FLAGS, PRF_SUMMONABLE); - break; - - case 'g': - case 'G': - TOGGLE_BIT_AR(PREFEDIT_GET_FLAGS, PRF_NOREPEAT); - break; - - case 'h': - case 'H': - TOGGLE_BIT_AR(PREFEDIT_GET_FLAGS, PRF_BRIEF); - break; - - case 'i': - case 'I': - TOGGLE_BIT_AR(PREFEDIT_GET_FLAGS, PRF_COMPACT); - break; - - default : send_to_char(d->character, "Invalid Choice, try again (Q to Quit to main menu): "); - return; - } - /* Set the 'value has changed' flag thing */ - OLC_VAL(d) = 1; - prefedit_disp_toggles_menu(d); - - return; - - case PREFEDIT_SYSLOG: - number = atoi(arg) - 1; - if ((number < 0) || (number > 3)) { - send_to_char(d->character, "%sThat's not a valid choice!%s\r\n", CBRED(d->character, C_NRM), CCNRM(d->character, C_NRM)); - prefedit_disp_color_menu(d); - return; - } - - if ((number % 2) == 1) SET_BIT_AR(PREFEDIT_GET_FLAGS, PRF_LOG1); - else REMOVE_BIT_AR(PREFEDIT_GET_FLAGS, PRF_LOG1); - - if (number >= 2) SET_BIT_AR(PREFEDIT_GET_FLAGS, PRF_LOG2); - else REMOVE_BIT_AR(PREFEDIT_GET_FLAGS, PRF_LOG2); - - break; - - /* Sub-menu's and flag toggle menu's */ - case PREFEDIT_PROMPT: - number = atoi(arg); - if ((number < 0) || (number > 7)) { - send_to_char(d->character, "%sThat's not a valid choice!%s\r\n", CBRED(d->character, C_NRM), CCNRM(d->character, C_NRM)); - prefedit_disp_prompt_menu(d); - } else { - if (number == 0) - break; - else - { - /* toggle bits */ - if (number == 1) - { - if (PREFEDIT_FLAGGED(PRF_DISPHP)) - REMOVE_BIT_AR(PREFEDIT_GET_FLAGS, PRF_DISPHP); - else - SET_BIT_AR(PREFEDIT_GET_FLAGS, PRF_DISPHP); - } - else if (number == 2) - { - if (PREFEDIT_FLAGGED(PRF_DISPMANA)) - REMOVE_BIT_AR(PREFEDIT_GET_FLAGS, PRF_DISPMANA); - else - SET_BIT_AR(PREFEDIT_GET_FLAGS, PRF_DISPMANA); - } - else if (number == 3) - { - if (PREFEDIT_FLAGGED(PRF_DISPMOVE)) - REMOVE_BIT_AR(PREFEDIT_GET_FLAGS, PRF_DISPMOVE); - else - SET_BIT_AR(PREFEDIT_GET_FLAGS, PRF_DISPMOVE); - } - else if (number == 4) - { - if (PREFEDIT_FLAGGED(PRF_DISPAUTO)) - REMOVE_BIT_AR(PREFEDIT_GET_FLAGS, PRF_DISPAUTO); - else - SET_BIT_AR(PREFEDIT_GET_FLAGS, PRF_DISPAUTO); - } - prefedit_disp_prompt_menu(d); - } - } - return; - - default: - /* we should never get here */ - mudlog(BRF,LVL_BUILDER,TRUE,"SYSERR: Reached default case in parse_prefedit"); - break; - } - /*. If we get this far, something has be changed .*/ - OLC_VAL(d) = 1; - prefedit_disp_main_menu(d); -} - -void prefedit_Restore_Defaults(struct descriptor_data *d) -{ - /* Let's do toggles one at a time */ - /* PRF_BRIEF - Off */ - if (PREFEDIT_FLAGGED(PRF_BRIEF)) - REMOVE_BIT_AR(PREFEDIT_GET_FLAGS, PRF_BRIEF); - - /* PRF_COMPACT - Off */ - if (PREFEDIT_FLAGGED(PRF_COMPACT)) - REMOVE_BIT_AR(PREFEDIT_GET_FLAGS, PRF_COMPACT); - - /* PRF_NOSHOUT - Off */ - if (PREFEDIT_FLAGGED(PRF_NOSHOUT)) - REMOVE_BIT_AR(PREFEDIT_GET_FLAGS, PRF_NOSHOUT); - - /* PRF_NOTELL - Off */ - if (PREFEDIT_FLAGGED(PRF_NOTELL)) - REMOVE_BIT_AR(PREFEDIT_GET_FLAGS, PRF_NOTELL); - - /* PRF_DISPHP - On */ - if (!PREFEDIT_FLAGGED(PRF_DISPHP)) - SET_BIT_AR(PREFEDIT_GET_FLAGS, PRF_DISPHP); - - /* PRF_DISPMANA - On */ - if (!PREFEDIT_FLAGGED(PRF_DISPMANA)) - SET_BIT_AR(PREFEDIT_GET_FLAGS, PRF_DISPMANA); - - /* PRF_DISPMOVE - On */ - if (!PREFEDIT_FLAGGED(PRF_DISPMOVE)) - SET_BIT_AR(PREFEDIT_GET_FLAGS, PRF_DISPMOVE); - - /* PRF_AUTOEXIT - On */ - if (!PREFEDIT_FLAGGED(PRF_AUTOEXIT)) - SET_BIT_AR(PREFEDIT_GET_FLAGS, PRF_AUTOEXIT); - - /* PRF_NOHASSLE - On for Imms */ - if (!PREFEDIT_FLAGGED(PRF_NOHASSLE) && GET_LEVEL(PREFEDIT_GET_CHAR) > LVL_IMMORT) - SET_BIT_AR(PREFEDIT_GET_FLAGS, PRF_NOHASSLE); - else - REMOVE_BIT_AR(PREFEDIT_GET_FLAGS, PRF_NOHASSLE); - - /* PRF_QUEST - Off */ - if (PREFEDIT_FLAGGED(PRF_QUEST)) - REMOVE_BIT_AR(PREFEDIT_GET_FLAGS, PRF_QUEST); - - /* PRF_SUMMONABLE - Off */ - if (PREFEDIT_FLAGGED(PRF_SUMMONABLE)) - REMOVE_BIT_AR(PREFEDIT_GET_FLAGS, PRF_SUMMONABLE); - - /* PRF_NOREPEAT - Off */ - if (PREFEDIT_FLAGGED(PRF_NOREPEAT)) - REMOVE_BIT_AR(PREFEDIT_GET_FLAGS, PRF_NOREPEAT); - - /* PRF_HOLYLIGHT - On for Imms */ - if (!PREFEDIT_FLAGGED(PRF_HOLYLIGHT) && GET_LEVEL(PREFEDIT_GET_CHAR) > LVL_IMMORT) - SET_BIT_AR(PREFEDIT_GET_FLAGS, PRF_HOLYLIGHT); - else - REMOVE_BIT_AR(PREFEDIT_GET_FLAGS, PRF_HOLYLIGHT); - - /* PRF_COLOR - On (Complete) */ - if (!PREFEDIT_FLAGGED(PRF_COLOR_1)) - SET_BIT_AR(PREFEDIT_GET_FLAGS, PRF_COLOR_1); - if (!PREFEDIT_FLAGGED(PRF_COLOR_2)) - SET_BIT_AR(PREFEDIT_GET_FLAGS, PRF_COLOR_2); - - /* PRF_NOWIZ - Off */ - if (PREFEDIT_FLAGGED(PRF_NOWIZ)) - REMOVE_BIT_AR(PREFEDIT_GET_FLAGS, PRF_NOWIZ); - - /* PRF_LOG1 - Off */ - if (PREFEDIT_FLAGGED(PRF_LOG1)) - REMOVE_BIT_AR(PREFEDIT_GET_FLAGS, PRF_LOG1); - - /* PRF_LOG2 - Off */ - if (PREFEDIT_FLAGGED(PRF_LOG2)) - REMOVE_BIT_AR(PREFEDIT_GET_FLAGS, PRF_LOG2); - - /* PRF_NOAUCT - Off */ - if (PREFEDIT_FLAGGED(PRF_NOAUCT)) - REMOVE_BIT_AR(PREFEDIT_GET_FLAGS, PRF_NOAUCT); - - /* PRF_NOGOSS - Off */ - if (PREFEDIT_FLAGGED(PRF_NOGOSS)) - REMOVE_BIT_AR(PREFEDIT_GET_FLAGS, PRF_NOGOSS); - - /* PRF_NOGRATZ - Off */ - if (PREFEDIT_FLAGGED(PRF_NOGRATZ)) - REMOVE_BIT_AR(PREFEDIT_GET_FLAGS, PRF_NOGRATZ); - - /* PRF_SHOWVNUMS - On for Imms */ - if (!PREFEDIT_FLAGGED(PRF_SHOWVNUMS) && GET_LEVEL(PREFEDIT_GET_CHAR) > LVL_IMMORT) - SET_BIT_AR(PREFEDIT_GET_FLAGS, PRF_SHOWVNUMS); - else - REMOVE_BIT_AR(PREFEDIT_GET_FLAGS, PRF_SHOWVNUMS); - - /* PRF_DISPAUTO - Off */ - if (PREFEDIT_FLAGGED(PRF_DISPAUTO)) - REMOVE_BIT_AR(PREFEDIT_GET_FLAGS, PRF_DISPAUTO); - - /* PRF_CLS - Off */ - if (PREFEDIT_FLAGGED(PRF_CLS)) - REMOVE_BIT_AR(PREFEDIT_GET_FLAGS, PRF_CLS); - - /* PRF_AFK - Off */ - if (PREFEDIT_FLAGGED(PRF_AFK)) - REMOVE_BIT_AR(PREFEDIT_GET_FLAGS, PRF_AFK); - - /* PRF_AUTOLOOT - On */ - if (!PREFEDIT_FLAGGED(PRF_AUTOLOOT)) - SET_BIT_AR(PREFEDIT_GET_FLAGS, PRF_AUTOLOOT); - - /* PRF_AUTOGOLD - On */ - if (!PREFEDIT_FLAGGED(PRF_AUTOGOLD)) - SET_BIT_AR(PREFEDIT_GET_FLAGS, PRF_AUTOGOLD); - - /* PRF_AUTOSPLIT - Off */ - if (PREFEDIT_FLAGGED(PRF_AUTOSPLIT)) - REMOVE_BIT_AR(PREFEDIT_GET_FLAGS, PRF_AUTOSPLIT); - - /* PRF_AUTOSAC - Off */ - if (PREFEDIT_FLAGGED(PRF_AUTOSAC)) - REMOVE_BIT_AR(PREFEDIT_GET_FLAGS, PRF_AUTOSAC); - - /* PRF_AUTOASSIST - Off */ - if (PREFEDIT_FLAGGED(PRF_AUTOASSIST)) - REMOVE_BIT_AR(PREFEDIT_GET_FLAGS, PRF_AUTOASSIST); - - /* PRF_AUTOMAP - On */ - if (PREFEDIT_FLAGGED(PRF_AUTOMAP)) - SET_BIT_AR(PREFEDIT_GET_FLAGS, PRF_AUTOMAP); - - /* PRF_AUTOKEY - On */ - if (PREFEDIT_FLAGGED(PRF_AUTOKEY)) - SET_BIT_AR(PREFEDIT_GET_FLAGS, PRF_AUTOKEY); - - /* PRF_AUTODOOR - On */ - if (PREFEDIT_FLAGGED(PRF_AUTODOOR)) - SET_BIT_AR(PREFEDIT_GET_FLAGS, PRF_AUTODOOR); - - /* Other (non-toggle) options */ - PREFEDIT_GET_WIMP_LEV = 0; /* Wimpy off by default */ - PREFEDIT_GET_PAGELENGTH = 22; /* Default telnet screen is 22 lines */ - PREFEDIT_GET_SCREENWIDTH = 80; /* Default telnet screen is 80 columns */ -} - -ACMD(do_oasis_prefedit) -{ - struct descriptor_data *d; - struct char_data *vict; - char *buf3; - char buf1[MAX_STRING_LENGTH]; - char buf2[MAX_STRING_LENGTH]; - - /****************************************************************************/ - /** Parse any arguments. **/ - /****************************************************************************/ - buf3 = two_arguments(argument, buf1, buf2); - - /****************************************************************************/ - /** If there aren't any arguments...well...they can only modify their **/ - /** own toggles, can't they? **/ - /****************************************************************************/ - if (!*buf1) { - vict = ch; - } - else if (GET_LEVEL(ch) >= LVL_IMPL) - { - if ((vict = get_player_vis(ch, buf1, NULL, FIND_CHAR_WORLD)) == NULL) - { - send_to_char(ch, "There is no-one here by that name.\r\n"); - return; - } - } - else - { - send_to_char(ch, "You can't do that!\r\n"); - return; - } - - if (IS_NPC(vict)) - { - send_to_char(ch, "Don't be ridiculous! Mobs don't have toggles.\r\n"); - return; - } - - /****************************************************************************/ - /** Check that whatever it is isn't already being edited. **/ - /****************************************************************************/ - for (d = descriptor_list; d; d = d->next) { - if (STATE(d) == CON_PREFEDIT) { - if (d->olc && OLC_PREFS(d)->ch == vict) { - if (ch == vict) - send_to_char(ch, "Your preferences are currently being edited by %s.\r\n", PERS(d->character, ch)); - else - send_to_char(ch, "Their preferences are currently being edited by %s.\r\n", PERS(d->character, ch)); - return; - } - } - } - - /****************************************************************************/ - /** Point d to the builder's descriptor (for easier typing later). **/ - /****************************************************************************/ - d = ch->desc; - - /****************************************************************************/ - /** Give the descriptor an OLC structure. **/ - /****************************************************************************/ - if (d->olc) { - mudlog(BRF, LVL_IMMORT, TRUE, "SYSERR: do_oasis_prefedit: Player already had olc structure."); - free(d->olc); - } - - CREATE(d->olc, struct oasis_olc_data, 1); - - OLC_NUM(d) = 0; - - /****************************************************************************/ - /** If this is a new quest, setup a new quest, otherwise setup the **/ - /** existing quest. **/ - /****************************************************************************/ - prefedit_setup(d, vict); - - STATE(d) = CON_PREFEDIT; - - /****************************************************************************/ - /** Send the OLC message to the players in the same room as the builder. **/ - /****************************************************************************/ - act("$n starts editing toggles.", TRUE, d->character, 0, 0, TO_ROOM); - SET_BIT_AR(PLR_FLAGS(ch), PLR_WRITING); - - /****************************************************************************/ - /** Log the OLC message. **/ - /****************************************************************************/ -/* No need - done elsewhere */ -// mudlog(CMP, LVL_IMMORT, TRUE, "OLC: (prefedit) %s starts editing toggles for %s", GET_NAME(ch), GET_NAME(vict)); -} - +/************************************************************************** +* File: prefedit.c Part of tbaMUD * +* Usage: Player-level OLC for setting preferences and toggles * +* * +* Created by Jamdog for tbaMUD 3.59 * +* All rights reserved. See license for complete information. * +* * +* Copyright (C) 1993, 94 by the Trustees of the Johns Hopkins University * +* CircleMUD is based on DikuMUD, Copyright (C) 1990, 1991. * +**************************************************************************/ + +#include "conf.h" +#include "sysdep.h" +#include "structs.h" +#include "comm.h" +#include "utils.h" +#include "handler.h" +#include "interpreter.h" +#include "db.h" +#include "oasis.h" +#include "prefedit.h" +#include "screen.h" + +/* Internal (static) functions */ +static void prefedit_setup(struct descriptor_data *d, struct char_data *vict); +static void prefedit_save_to_char(struct descriptor_data *d); +static void prefedit_disp_main_menu(struct descriptor_data *d); +static void prefedit_disp_toggles_menu(struct descriptor_data *d); +static void prefedit_disp_prompt_menu(struct descriptor_data *d); +static void prefedit_disp_color_menu(struct descriptor_data *d); +static void prefedit_disp_syslog_menu(struct descriptor_data *d); + +/* Note: there is no setup_new, as you can ONLY edit an existing player */ +/* vict is normally = d->character, except when imps edit players */ +static void prefedit_setup(struct descriptor_data *d, struct char_data *vict) +{ + int i; + struct prefs_data *toggles; + + if (!vict) vict = d->character; + + /*. Build a copy of the player's toggles .*/ + CREATE (toggles, struct prefs_data, 1); + + /* no strings to allocate space for */ + for (i=0; ipref_flags[i] = PRF_FLAGS(vict)[i]; + + toggles->wimp_level = GET_WIMP_LEV(vict); + toggles->page_length = GET_PAGE_LENGTH(vict); + toggles->screen_width = GET_SCREEN_WIDTH(vict); + + toggles->ch = vict; + + /*. Attach toggles copy to editors descriptor .*/ + OLC_PREFS(d) = toggles; + OLC_VAL(d) = 0; + prefedit_disp_main_menu(d); +} + +static void prefedit_save_to_char(struct descriptor_data *d) +{ + int i; + struct char_data *vict; + + vict = PREFEDIT_GET_CHAR; + + if (vict && vict->desc && IS_PLAYING(vict->desc)) + { + for (i=0; ipref_flags[i]; + + GET_WIMP_LEV(vict) = OLC_PREFS(d)->wimp_level; + GET_PAGE_LENGTH(vict) = OLC_PREFS(d)->page_length; + GET_SCREEN_WIDTH(vict) = OLC_PREFS(d)->screen_width; + + save_char(vict); + } + else + { + if (!vict) { + mudlog(BRF, LVL_BUILDER, TRUE, "SYSERR: Unable to save toggles (no vict)"); + send_to_char(d->character, "Unable to save toggles (no vict)"); + } else if (!vict->desc) { + mudlog(BRF, LVL_BUILDER, TRUE, "SYSERR: Unable to save toggles (no vict descriptor)"); + send_to_char(d->character, "Unable to save toggles (no vict descriptor)"); + } else if (!IS_PLAYING(vict->desc)) { + mudlog(BRF, LVL_BUILDER, TRUE, "SYSERR: Unable to save toggles (vict not playing)"); + send_to_char(d->character, "Unable to save toggles (vict not playing)"); + } else { + mudlog(BRF, LVL_BUILDER, TRUE, "SYSERR: Unable to save toggles (unknown reason)"); + send_to_char(d->character, "Unable to save toggles (unknown reason)"); + } + } +} + +static void prefedit_disp_main_menu(struct descriptor_data *d) +{ + struct char_data *vict; + char prompt_string[10], color_string[10], syslog_string[10]; + const char *multi_types[] = { "Off", "Brief", "Normal", "Complete", "\n" }; + + /* Set up the required variables and strings */ + vict = PREFEDIT_GET_CHAR; + + sprintf(prompt_string, "%s%s%s", PREFEDIT_FLAGGED(PRF_DISPHP) ? "H" : "", PREFEDIT_FLAGGED(PRF_DISPMANA) ? "M" : "", + PREFEDIT_FLAGGED(PRF_DISPMOVE) ? "V" : "" ); + + sprintf(color_string, "%s", multi_types[(PREFEDIT_FLAGGED(PRF_COLOR_1) ? 1 : 0) + (PREFEDIT_FLAGGED(PRF_COLOR_2) ? 2 : 0)]); + + send_to_char(d->character, "\r\n%sPreferences for %s%s\r\n", + CCYEL(d->character, C_NRM), + GET_NAME(vict), + CCNRM(d->character, C_NRM) ); + + + /* The mortal preferences section of the actual menu */ + send_to_char(d->character, "\r\n" + "%sPreferences\r\n" + "%sP%s) Prompt : %s[%s%-3s%s] %sL%s) Pagelength : %s[%s%-3d%s]\r\n" + "%sC%s) Color : %s[%s%-8s%s] %sS%s) Screenwidth: %s[%s%-3d%s]\r\n" + "%sW%s) Wimpy : %s[%s%-4d%s]%s\r\n", + CCWHT(d->character, C_NRM), +/* Line 1 - prompt and pagelength */ + CBYEL(d->character, C_NRM), CCNRM(d->character, C_NRM), CCCYN(d->character, C_NRM), CCYEL(d->character, C_NRM), + prompt_string, CCCYN(d->character, C_NRM), CBYEL(d->character, C_NRM), CCNRM(d->character, C_NRM), + CCCYN(d->character, C_NRM), CCYEL(d->character, C_NRM), PREFEDIT_GET_PAGELENGTH, CCCYN(d->character, C_NRM), +/* Line 2 - color and screenwidth */ + CBYEL(d->character, C_NRM), CCNRM(d->character, C_NRM), CCCYN(d->character, C_NRM), CCYEL(d->character, C_NRM), + color_string, CCCYN(d->character, C_NRM), CBYEL(d->character, C_NRM), CCNRM(d->character, C_NRM), + CCCYN(d->character, C_NRM), CCYEL(d->character, C_NRM), PREFEDIT_GET_SCREENWIDTH, CCCYN(d->character, C_NRM), +/* Line 2 - wimpy */ + CBYEL(d->character, C_NRM), CCNRM(d->character, C_NRM), CCCYN(d->character, C_NRM), CCYEL(d->character, C_NRM), + PREFEDIT_GET_WIMP_LEV, CCCYN(d->character, C_NRM), CCNRM(d->character, C_NRM) + ); + + send_to_char(d->character, "%sT%s) Toggle Preferences...\r\n", + CBYEL(d->character, C_NRM), CCNRM(d->character, C_NRM) ); + + /* Imm Prefs */ + if (GET_LEVEL(PREFEDIT_GET_CHAR) >= LVL_IMMORT) + { + sprintf(syslog_string, "%s", multi_types[((PREFEDIT_FLAGGED(PRF_LOG1) ? 1 : 0)+ (PREFEDIT_FLAGGED(PRF_LOG2) ? 2 : 0))] ); + + send_to_char(d->character, "\r\n" + "%sImmortal Preferences\r\n" + "%s1%s) Syslog Level %s[%s%8s%s] %s4%s) ClsOLC %s[%s%3s%s]\r\n" + "%s2%s) Show Flags %s[%s%3s%s] %s5%s) No WizNet %s[%s%3s%s]\r\n" + "%s3%s) No Hassle %s[%s%3s%s] %s6%s) Holylight %s[%s%3s%s]\r\n", + CBWHT(d->character, C_NRM), +/* Line 1 - syslog and clsolc */ + CBYEL(d->character, C_NRM), CCNRM(d->character, C_NRM), CCCYN(d->character, C_NRM), CCYEL(d->character, C_NRM), + syslog_string, CCCYN(d->character, C_NRM), CBYEL(d->character, C_NRM), CCNRM(d->character, C_NRM), + CCCYN(d->character, C_NRM), CCYEL(d->character, C_NRM), ONOFF(PREFEDIT_FLAGGED(PRF_CLS)), CCCYN(d->character, C_NRM), +/* Line 2 - show vnums and nowiz */ + CBYEL(d->character, C_NRM), CCNRM(d->character, C_NRM), CCCYN(d->character, C_NRM), CCYEL(d->character, C_NRM), + ONOFF(PREFEDIT_FLAGGED(PRF_SHOWVNUMS)), CCCYN(d->character, C_NRM), CBYEL(d->character, C_NRM), CCNRM(d->character, C_NRM), + CCCYN(d->character, C_NRM), CCYEL(d->character, C_NRM), ONOFF(PREFEDIT_FLAGGED(PRF_NOWIZ)), CCCYN(d->character, C_NRM), +/* Line 3 - nohassle and holylight */ + CBYEL(d->character, C_NRM), CCNRM(d->character, C_NRM), CCCYN(d->character, C_NRM), CCYEL(d->character, C_NRM), + ONOFF(PREFEDIT_FLAGGED(PRF_NOHASSLE)), CCCYN(d->character, C_NRM), CBYEL(d->character, C_NRM), CCNRM(d->character, C_NRM), + CCCYN(d->character, C_NRM), CCYEL(d->character, C_NRM), ONOFF(PREFEDIT_FLAGGED(PRF_HOLYLIGHT)), CCCYN(d->character, C_NRM) + ); + } + +/* Finishing Off */ + send_to_char(d->character, "\r\n" + "%sD%s) Restore all default values\r\n" + "%sQ%s) Quit\r\n" + "\r\n", + CBYEL(d->character, C_NRM), CCNRM(d->character, C_NRM), + CBYEL(d->character, C_NRM), CCNRM(d->character, C_NRM) + ); + + + /* Bottom of the menu */ + + OLC_MODE(d) = PREFEDIT_MAIN_MENU; +} + +static void prefedit_disp_toggles_menu(struct descriptor_data *d) +{ + struct char_data *vict; + + /* Set up the required variables and strings */ + vict = OLC_PREFS(d)->ch; + + /* Top of the menu */ + send_to_char(d->character, "Toggle preferences for %s%-20s\r\n", + CBGRN(d->character, C_NRM), GET_NAME(vict)); + + send_to_char(d->character, "\r\n" + "%sAuto-flags Channels\r\n", + CBWHT(d->character, C_NRM)); + + /* The top section of the actual menu */ + send_to_char(d->character, "%s1%s) Autoexits %s[%s%3s%s] %sA%s) Gossip %s[%s%3s%s]\r\n" + "%s2%s) Autoloot %s[%s%3s%s] %sB%s) Shout %s[%s%3s%s]\r\n" + "%s3%s) Autogold %s[%s%3s%s] %sC%s) Tell %s[%s%3s%s]\r\n" + "%s4%s) Autosac %s[%s%3s%s] %sD%s) Auction %s[%s%3s%s]\r\n" + "%s5%s) Autoassist %s[%s%3s%s] %sE%s) Gratz %s[%s%3s%s]\r\n" + "%s6%s) Autosplit %s[%s%3s%s]\r\n", +/* Line 1 - autoexits and gossip */ + CBYEL(d->character, C_NRM), CCNRM(d->character, C_NRM), CCCYN(d->character, C_NRM), PREFEDIT_FLAGGED(PRF_AUTOEXIT) ? CBGRN(d->character, C_NRM) : CBRED(d->character, C_NRM), + ONOFF(PREFEDIT_FLAGGED(PRF_AUTOEXIT)), CCCYN(d->character, C_NRM), CBYEL(d->character, C_NRM), CCNRM(d->character, C_NRM), CCCYN(d->character, C_NRM), + PREFEDIT_FLAGGED(PRF_NOGOSS) ? CBRED(d->character, C_NRM) : CBGRN(d->character, C_NRM), ONOFF(!PREFEDIT_FLAGGED(PRF_NOGOSS)), CCCYN(d->character, C_NRM), +/* Line 2 - autoloot and shout */ + CBYEL(d->character, C_NRM), CCNRM(d->character, C_NRM), CCCYN(d->character, C_NRM), PREFEDIT_FLAGGED(PRF_AUTOLOOT) ? CBGRN(d->character, C_NRM) : CBRED(d->character, C_NRM), + ONOFF(PREFEDIT_FLAGGED(PRF_AUTOLOOT)), CCCYN(d->character, C_NRM), CBYEL(d->character, C_NRM), CCNRM(d->character, C_NRM), CCCYN(d->character, C_NRM), + PREFEDIT_FLAGGED(PRF_NOSHOUT) ? CBRED(d->character, C_NRM) : CBGRN(d->character, C_NRM), ONOFF(!PREFEDIT_FLAGGED(PRF_NOSHOUT)), CCCYN(d->character, C_NRM), +/* Line 3 - autogold and tell */ + CBYEL(d->character, C_NRM), CCNRM(d->character, C_NRM), CCCYN(d->character, C_NRM), PREFEDIT_FLAGGED(PRF_AUTOGOLD) ? CBGRN(d->character, C_NRM) : CBRED(d->character, C_NRM), + ONOFF(PREFEDIT_FLAGGED(PRF_AUTOGOLD)), CCCYN(d->character, C_NRM), CBYEL(d->character, C_NRM), CCNRM(d->character, C_NRM), CCCYN(d->character, C_NRM), + PREFEDIT_FLAGGED(PRF_NOTELL) ? CBRED(d->character, C_NRM) : CBGRN(d->character, C_NRM), ONOFF(!PREFEDIT_FLAGGED(PRF_NOTELL)), CCCYN(d->character, C_NRM), +/* Line 4 - autosac and auction */ + CBYEL(d->character, C_NRM), CCNRM(d->character, C_NRM), CCCYN(d->character, C_NRM), PREFEDIT_FLAGGED(PRF_AUTOSAC) ? CBGRN(d->character, C_NRM) : CBRED(d->character, C_NRM), + ONOFF(PREFEDIT_FLAGGED(PRF_AUTOSAC)), CCCYN(d->character, C_NRM), CBYEL(d->character, C_NRM), CCNRM(d->character, C_NRM), CCCYN(d->character, C_NRM), + PREFEDIT_FLAGGED(PRF_NOAUCT) ? CBRED(d->character, C_NRM) : CBGRN(d->character, C_NRM), ONOFF(!PREFEDIT_FLAGGED(PRF_NOAUCT)), CCCYN(d->character, C_NRM), +/* Line 5 - autoassist and grats */ + CBYEL(d->character, C_NRM), CCNRM(d->character, C_NRM), CCCYN(d->character, C_NRM), PREFEDIT_FLAGGED(PRF_AUTOASSIST) ? CBGRN(d->character, C_NRM) : CBRED(d->character, C_NRM), + ONOFF(PREFEDIT_FLAGGED(PRF_AUTOASSIST)), CCCYN(d->character, C_NRM), CBYEL(d->character, C_NRM), CCNRM(d->character, C_NRM), CCCYN(d->character, C_NRM), + PREFEDIT_FLAGGED(PRF_NOGRATZ) ? CBRED(d->character, C_NRM) : CBGRN(d->character, C_NRM), ONOFF(!PREFEDIT_FLAGGED(PRF_NOGRATZ)), CCCYN(d->character, C_NRM), +/* Line 6 - autosplit */ + CBYEL(d->character, C_NRM), CCNRM(d->character, C_NRM), CCCYN(d->character, C_NRM), PREFEDIT_FLAGGED(PRF_AUTOSPLIT) ? CBGRN(d->character, C_NRM) : CBRED(d->character, C_NRM), + ONOFF(PREFEDIT_FLAGGED(PRF_AUTOSPLIT)), CCCYN(d->character, C_NRM) + ); + + send_to_char(d->character, "%s7%s) Automap %s[%s%3s%s]\r\n" + "%s8%s) Autokey %s[%s%3s%s]\r\n" + "%s9%s) Autodoor %s[%s%3s%s]\r\n", +/* Line 7 - automap */ + CBYEL(d->character, C_NRM), CCNRM(d->character, C_NRM), CCCYN(d->character, C_NRM), PREFEDIT_FLAGGED(PRF_AUTOMAP) ? CBGRN(d->character, C_NRM) : CBRED(d->character, C_NRM), + ONOFF(PREFEDIT_FLAGGED(PRF_AUTOMAP)), CCCYN(d->character, C_NRM), +/* Line 8 - autokey */ + CBYEL(d->character, C_NRM), CCNRM(d->character, C_NRM), CCCYN(d->character, C_NRM), PREFEDIT_FLAGGED(PRF_AUTOKEY) ? CBGRN(d->character, C_NRM) : CBRED(d->character, C_NRM), + ONOFF(PREFEDIT_FLAGGED(PRF_AUTOKEY)), CCCYN(d->character, C_NRM), +/* Line 9 - autodoor */ + CBYEL(d->character, C_NRM), CCNRM(d->character, C_NRM), CCCYN(d->character, C_NRM), PREFEDIT_FLAGGED(PRF_AUTODOOR) ? CBGRN(d->character, C_NRM) : CBRED(d->character, C_NRM), + ONOFF(PREFEDIT_FLAGGED(PRF_AUTODOOR)), CCCYN(d->character, C_NRM) + ); + + /* The bottom section of the toggles menu */ + send_to_char(d->character, "\r\n" + "%sOther Flags\r\n" + "%sF%s) No Summon %s[%s%3s%s] %sH%s) Brief %s[%s%3s%s]\r\n" + "%sG%s) No Repeat %s[%s%3s%s] %sI%s) Compact %s[%s%3s%s]\r\n", + CBWHT(d->character, C_NRM), +/* Line 10 - nosummon and brief */ + CBYEL(d->character, C_NRM), CCNRM(d->character, C_NRM), CCCYN(d->character, C_NRM), CCYEL(d->character, C_NRM), + ONOFF(!PREFEDIT_FLAGGED(PRF_SUMMONABLE)), CCCYN(d->character, C_NRM), CBYEL(d->character, C_NRM), CCNRM(d->character, C_NRM), + CCCYN(d->character, C_NRM), CCYEL(d->character, C_NRM), ONOFF(PREFEDIT_FLAGGED(PRF_BRIEF)), CCCYN(d->character, C_NRM), +/* Line 11 - norepeat and compact */ + CBYEL(d->character, C_NRM), CCNRM(d->character, C_NRM), CCCYN(d->character, C_NRM), CCYEL(d->character, C_NRM), + ONOFF(PREFEDIT_FLAGGED(PRF_NOREPEAT)), CCCYN(d->character, C_NRM), CBYEL(d->character, C_NRM), CCNRM(d->character, C_NRM), + CCCYN(d->character, C_NRM), CCYEL(d->character, C_NRM), ONOFF(PREFEDIT_FLAGGED(PRF_COMPACT)), CCCYN(d->character, C_NRM) + ); + +/* Finishing Off */ + send_to_char(d->character, "%sQ%s) Quit toggle preferences...\r\n", + CBYEL(d->character, C_NRM), CCNRM(d->character, C_NRM) ); + + OLC_MODE(d) = PREFEDIT_TOGGLE_MENU; +} + +static void prefedit_disp_prompt_menu(struct descriptor_data *d) +{ + char prompt_string[7]; + + if (PREFEDIT_FLAGGED(PRF_DISPAUTO)) + sprintf(prompt_string, ""); + else + sprintf(prompt_string, "%s%s%s", PREFEDIT_FLAGGED(PRF_DISPHP) ? "H" : "", PREFEDIT_FLAGGED(PRF_DISPMANA) ? "M" : "", + PREFEDIT_FLAGGED(PRF_DISPMOVE) ? "V" : ""); + + send_to_char(d->character, "%sPrompt Settings\r\n" + "%s1%s) Toggle HP\r\n" + "%s2%s) Toggle Mana\r\n" + "%s3%s) Toggle Moves\r\n" + "%s4%s) Toggle auto flag\r\n\r\n" + "%sCurrent Prompt: %s%s%s\r\n\r\n" + "%s0%s) Quit (to main menu)\r\n", + CBWHT(d->character, C_NRM), CBYEL(d->character, C_NRM), CCNRM(d->character, C_NRM), + CBYEL(d->character, C_NRM), CCNRM(d->character, C_NRM), + CBYEL(d->character, C_NRM), CCNRM(d->character, C_NRM), + CBYEL(d->character, C_NRM), CCNRM(d->character, C_NRM), + CCNRM(d->character, C_NRM), CCCYN(d->character, C_NRM), prompt_string, CCNRM(d->character, C_NRM), + CBYEL(d->character, C_NRM), CCNRM(d->character, C_NRM) ); + + send_to_char(d->character, "Enter Choice :"); + OLC_MODE(d) = PREFEDIT_PROMPT; +} + +static void prefedit_disp_color_menu(struct descriptor_data *d) +{ + send_to_char(d->character, "%sColor level\r\n" + "%s1%s) Off %s(do not display any color - monochrome)%s\r\n" + "%s2%s) Brief %s(show minimal color where necessary)%s\r\n" + "%s3%s) Normal %s(show game-enhancing color)%s\r\n" + "%s4%s) On %s(show all colors whenever possible)%s\r\n", + CBWHT(d->character, C_NRM), + CBYEL(d->character, C_NRM), CCNRM(d->character, C_NRM), CCYEL(d->character, C_NRM), CCNRM(d->character, C_NRM), + CBYEL(d->character, C_NRM), CCNRM(d->character, C_NRM), CCYEL(d->character, C_NRM), CCNRM(d->character, C_NRM), + CBYEL(d->character, C_NRM), CCNRM(d->character, C_NRM), CCYEL(d->character, C_NRM), CCNRM(d->character, C_NRM), + CBYEL(d->character, C_NRM), CCNRM(d->character, C_NRM), CCYEL(d->character, C_NRM), CCNRM(d->character, C_NRM) ); + + send_to_char(d->character, "Enter Choice :"); + OLC_MODE(d) = PREFEDIT_COLOR; +} + +static void prefedit_disp_syslog_menu(struct descriptor_data *d) +{ + send_to_char(d->character, "%sSyslog level\r\n" + "%s1%s) Off %s(do not display any logs or error messages)%s\r\n" + "%s2%s) Brief %s(show only important warnings or errors)%s\r\n" + "%s3%s) Normal %s(show all warnings and errors)%s\r\n" + "%s4%s) Complete %s(show all logged information for your level)%s\r\n", + CBWHT(d->character, C_NRM), + CBYEL(d->character, C_NRM), CCNRM(d->character, C_NRM), CCYEL(d->character, C_NRM), CCNRM(d->character, C_NRM), + CBYEL(d->character, C_NRM), CCNRM(d->character, C_NRM), CCYEL(d->character, C_NRM), CCNRM(d->character, C_NRM), + CBYEL(d->character, C_NRM), CCNRM(d->character, C_NRM), CCYEL(d->character, C_NRM), CCNRM(d->character, C_NRM), + CBYEL(d->character, C_NRM), CCNRM(d->character, C_NRM), CCYEL(d->character, C_NRM), CCNRM(d->character, C_NRM) ); + + send_to_char(d->character, "Enter Choice :"); + OLC_MODE(d) = PREFEDIT_SYSLOG; +} + +void prefedit_parse(struct descriptor_data * d, char *arg) +{ + int number; + + switch (OLC_MODE(d)) { + case PREFEDIT_CONFIRM_SAVE: + switch (*arg) { + case 'y': + case 'Y': + prefedit_save_to_char(d); + mudlog(CMP, LVL_BUILDER, TRUE, "OLC: %s edits toggles for %s", GET_NAME(d->character), GET_NAME(OLC_PREFS(d)->ch)); + /*. No strings to save - cleanup all .*/ + cleanup_olc(d, CLEANUP_ALL); + break; + case 'n': + case 'N': + /* don't save to char, just free everything up */ + cleanup_olc(d, CLEANUP_ALL); + break; + default: + send_to_char(d->character, "Invalid choice!\r\n"); + send_to_char(d->character, "Do you wish to save these toggle settings? : "); + break; + } + return; + + case PREFEDIT_MAIN_MENU: + switch (*arg) { + case 'q': + case 'Q': + if (OLC_VAL(d)) + { /*. Something has been modified .*/ + send_to_char(d->character, "Do you wish to save these toggle settings? : "); + OLC_MODE(d) = PREFEDIT_CONFIRM_SAVE; + } else + cleanup_olc(d, CLEANUP_ALL); + return; + + case 'p': + case 'P': + prefedit_disp_prompt_menu(d); + return; + + case 'c': + case 'C': + prefedit_disp_color_menu(d); + return; + + case 'l': + case 'L': + send_to_char(d->character, "Enter number of lines per page (10-60): "); + OLC_MODE(d) = PREFEDIT_PAGELENGTH; + return; + + case 's': + case 'S': + send_to_char(d->character, "Enter number of columns per page (40-120): "); + OLC_MODE(d) = PREFEDIT_SCREENWIDTH; + return; + + case 'w': + case 'W': + send_to_char(d->character, "Enter HP at which to flee (0-%d): ", MIN(GET_MAX_HIT(d->character)/2, 500)); + OLC_MODE(d) = PREFEDIT_WIMPY; + return; + + case 't': + case 'T': + prefedit_disp_toggles_menu(d); + return; + + case 'd': + case 'D': + prefedit_Restore_Defaults(d); + break; + + /* Below this point are Imm-only toggles */ + case '1': + if (GET_LEVEL(PREFEDIT_GET_CHAR) < LVL_IMMORT) + { + send_to_char(d->character, "%sInvalid choice!%s\r\n", CBRED(d->character, C_NRM), CCNRM(d->character, C_NRM)); + prefedit_disp_main_menu(d); + } + else + { + prefedit_disp_syslog_menu(d); + return; + } + break; + + case '2': + if (GET_LEVEL(PREFEDIT_GET_CHAR) < LVL_IMMORT) + { + send_to_char(d->character, "%sInvalid choice!%s\r\n", CBRED(d->character, C_NRM), CCNRM(d->character, C_NRM)); + prefedit_disp_main_menu(d); + } + else + { + TOGGLE_BIT_AR(PREFEDIT_GET_FLAGS, PRF_SHOWVNUMS); + } + break; + + case '3': + if (GET_LEVEL(PREFEDIT_GET_CHAR) < LVL_IMMORT) + { + send_to_char(d->character, "%sInvalid choice!%s\r\n", CBRED(d->character, C_NRM), CCNRM(d->character, C_NRM)); + prefedit_disp_main_menu(d); + } + else + { + TOGGLE_BIT_AR(PREFEDIT_GET_FLAGS, PRF_NOHASSLE); + } + break; + + case '4': + if (GET_LEVEL(PREFEDIT_GET_CHAR) < LVL_IMMORT) + { + send_to_char(d->character, "%sInvalid choice!%s\r\n", CBRED(d->character, C_NRM), CCNRM(d->character, C_NRM)); + prefedit_disp_main_menu(d); + } + else + { + TOGGLE_BIT_AR(PREFEDIT_GET_FLAGS, PRF_CLS); + } + break; + + case '5': + if (GET_LEVEL(PREFEDIT_GET_CHAR) < LVL_IMMORT) + { + send_to_char(d->character, "%sInvalid choice!%s\r\n", CBRED(d->character, C_NRM), CCNRM(d->character, C_NRM)); + prefedit_disp_main_menu(d); + } + else + { + TOGGLE_BIT_AR(PREFEDIT_GET_FLAGS, PRF_NOWIZ); + } + break; + + case '6': + if (GET_LEVEL(PREFEDIT_GET_CHAR) < LVL_IMMORT) + { + send_to_char(d->character, "%sInvalid choice!%s\r\n", CBRED(d->character, C_NRM), CCNRM(d->character, C_NRM)); + prefedit_disp_main_menu(d); + } + else + { + TOGGLE_BIT_AR(PREFEDIT_GET_FLAGS, PRF_HOLYLIGHT); + } + break; + + default: + send_to_char(d->character, "%sInvalid choice!%s\r\n", CBRED(d->character, C_NRM), CCNRM(d->character, C_NRM)); + prefedit_disp_main_menu(d); + break; + } + break; + + case PREFEDIT_PAGELENGTH: + number = atoi(arg); + OLC_PREFS(d)->page_length = MAX(10, MIN(number, 60)); + break; + + case PREFEDIT_SCREENWIDTH: + number = atoi(arg); + OLC_PREFS(d)->screen_width = MAX(40, MIN(number, 120)); + break; + + case PREFEDIT_WIMPY: + number = atoi(arg); + OLC_PREFS(d)->wimp_level = MAX(0, MIN(number, 500)); + break; + + case PREFEDIT_COLOR: + number = atoi(arg) - 1; + if ((number < 0) || (number > 3)) { + send_to_char(d->character, "%sThat's not a valid choice!%s\r\n", CBRED(d->character, C_NRM), CCNRM(d->character, C_NRM)); + prefedit_disp_color_menu(d); + return; + } + REMOVE_BIT_AR(PREFEDIT_GET_FLAGS, PRF_COLOR_1); + REMOVE_BIT_AR(PREFEDIT_GET_FLAGS, PRF_COLOR_2); + if (number % 2) SET_BIT_AR(PREFEDIT_GET_FLAGS, PRF_COLOR_1); + if (number >= 2) SET_BIT_AR(PREFEDIT_GET_FLAGS, PRF_COLOR_2); + + break; + + case PREFEDIT_TOGGLE_MENU: + switch (*arg) { + case 'q': + case 'Q': + case 'x' : + case 'X' : prefedit_disp_main_menu(d); + return; + + case '1': + TOGGLE_BIT_AR(PREFEDIT_GET_FLAGS, PRF_AUTOEXIT); + break; + + case '2': + TOGGLE_BIT_AR(PREFEDIT_GET_FLAGS, PRF_AUTOLOOT); + break; + + case '3': + TOGGLE_BIT_AR(PREFEDIT_GET_FLAGS, PRF_AUTOGOLD); + break; + + case '4': + TOGGLE_BIT_AR(PREFEDIT_GET_FLAGS, PRF_AUTOSAC); + break; + + case '5': + TOGGLE_BIT_AR(PREFEDIT_GET_FLAGS, PRF_AUTOASSIST); + break; + + case '6': + TOGGLE_BIT_AR(PREFEDIT_GET_FLAGS, PRF_AUTOSPLIT); + break; + + case '7': + TOGGLE_BIT_AR(PREFEDIT_GET_FLAGS, PRF_AUTOMAP); + break; + + case '8': + TOGGLE_BIT_AR(PREFEDIT_GET_FLAGS, PRF_AUTOKEY); + break; + + case '9': + TOGGLE_BIT_AR(PREFEDIT_GET_FLAGS, PRF_AUTODOOR); + break; + + case 'a': + case 'A': + TOGGLE_BIT_AR(PREFEDIT_GET_FLAGS, PRF_NOGOSS); + break; + + case 'b': + case 'B': + TOGGLE_BIT_AR(PREFEDIT_GET_FLAGS, PRF_NOSHOUT); + break; + + case 'c': + case 'C': + TOGGLE_BIT_AR(PREFEDIT_GET_FLAGS, PRF_NOTELL); + break; + + case 'd': + case 'D': + TOGGLE_BIT_AR(PREFEDIT_GET_FLAGS, PRF_NOAUCT); + break; + + case 'e': + case 'E': + TOGGLE_BIT_AR(PREFEDIT_GET_FLAGS, PRF_NOGRATZ); + break; + + case 'f': + case 'F': + TOGGLE_BIT_AR(PREFEDIT_GET_FLAGS, PRF_SUMMONABLE); + break; + + case 'g': + case 'G': + TOGGLE_BIT_AR(PREFEDIT_GET_FLAGS, PRF_NOREPEAT); + break; + + case 'h': + case 'H': + TOGGLE_BIT_AR(PREFEDIT_GET_FLAGS, PRF_BRIEF); + break; + + case 'i': + case 'I': + TOGGLE_BIT_AR(PREFEDIT_GET_FLAGS, PRF_COMPACT); + break; + + default : send_to_char(d->character, "Invalid Choice, try again (Q to Quit to main menu): "); + return; + } + /* Set the 'value has changed' flag thing */ + OLC_VAL(d) = 1; + prefedit_disp_toggles_menu(d); + + return; + + case PREFEDIT_SYSLOG: + number = atoi(arg) - 1; + if ((number < 0) || (number > 3)) { + send_to_char(d->character, "%sThat's not a valid choice!%s\r\n", CBRED(d->character, C_NRM), CCNRM(d->character, C_NRM)); + prefedit_disp_color_menu(d); + return; + } + + if ((number % 2) == 1) SET_BIT_AR(PREFEDIT_GET_FLAGS, PRF_LOG1); + else REMOVE_BIT_AR(PREFEDIT_GET_FLAGS, PRF_LOG1); + + if (number >= 2) SET_BIT_AR(PREFEDIT_GET_FLAGS, PRF_LOG2); + else REMOVE_BIT_AR(PREFEDIT_GET_FLAGS, PRF_LOG2); + + break; + + /* Sub-menu's and flag toggle menu's */ + case PREFEDIT_PROMPT: + number = atoi(arg); + if ((number < 0) || (number > 7)) { + send_to_char(d->character, "%sThat's not a valid choice!%s\r\n", CBRED(d->character, C_NRM), CCNRM(d->character, C_NRM)); + prefedit_disp_prompt_menu(d); + } else { + if (number == 0) + break; + else + { + /* toggle bits */ + if (number == 1) + { + if (PREFEDIT_FLAGGED(PRF_DISPHP)) + REMOVE_BIT_AR(PREFEDIT_GET_FLAGS, PRF_DISPHP); + else + SET_BIT_AR(PREFEDIT_GET_FLAGS, PRF_DISPHP); + } + else if (number == 2) + { + if (PREFEDIT_FLAGGED(PRF_DISPMANA)) + REMOVE_BIT_AR(PREFEDIT_GET_FLAGS, PRF_DISPMANA); + else + SET_BIT_AR(PREFEDIT_GET_FLAGS, PRF_DISPMANA); + } + else if (number == 3) + { + if (PREFEDIT_FLAGGED(PRF_DISPMOVE)) + REMOVE_BIT_AR(PREFEDIT_GET_FLAGS, PRF_DISPMOVE); + else + SET_BIT_AR(PREFEDIT_GET_FLAGS, PRF_DISPMOVE); + } + else if (number == 4) + { + if (PREFEDIT_FLAGGED(PRF_DISPAUTO)) + REMOVE_BIT_AR(PREFEDIT_GET_FLAGS, PRF_DISPAUTO); + else + SET_BIT_AR(PREFEDIT_GET_FLAGS, PRF_DISPAUTO); + } + prefedit_disp_prompt_menu(d); + } + } + return; + + default: + /* we should never get here */ + mudlog(BRF,LVL_BUILDER,TRUE,"SYSERR: Reached default case in parse_prefedit"); + break; + } + /*. If we get this far, something has be changed .*/ + OLC_VAL(d) = 1; + prefedit_disp_main_menu(d); +} + +void prefedit_Restore_Defaults(struct descriptor_data *d) +{ + /* Let's do toggles one at a time */ + /* PRF_BRIEF - Off */ + if (PREFEDIT_FLAGGED(PRF_BRIEF)) + REMOVE_BIT_AR(PREFEDIT_GET_FLAGS, PRF_BRIEF); + + /* PRF_COMPACT - Off */ + if (PREFEDIT_FLAGGED(PRF_COMPACT)) + REMOVE_BIT_AR(PREFEDIT_GET_FLAGS, PRF_COMPACT); + + /* PRF_NOSHOUT - Off */ + if (PREFEDIT_FLAGGED(PRF_NOSHOUT)) + REMOVE_BIT_AR(PREFEDIT_GET_FLAGS, PRF_NOSHOUT); + + /* PRF_NOTELL - Off */ + if (PREFEDIT_FLAGGED(PRF_NOTELL)) + REMOVE_BIT_AR(PREFEDIT_GET_FLAGS, PRF_NOTELL); + + /* PRF_DISPHP - On */ + if (!PREFEDIT_FLAGGED(PRF_DISPHP)) + SET_BIT_AR(PREFEDIT_GET_FLAGS, PRF_DISPHP); + + /* PRF_DISPMANA - On */ + if (!PREFEDIT_FLAGGED(PRF_DISPMANA)) + SET_BIT_AR(PREFEDIT_GET_FLAGS, PRF_DISPMANA); + + /* PRF_DISPMOVE - On */ + if (!PREFEDIT_FLAGGED(PRF_DISPMOVE)) + SET_BIT_AR(PREFEDIT_GET_FLAGS, PRF_DISPMOVE); + + /* PRF_AUTOEXIT - On */ + if (!PREFEDIT_FLAGGED(PRF_AUTOEXIT)) + SET_BIT_AR(PREFEDIT_GET_FLAGS, PRF_AUTOEXIT); + + /* PRF_NOHASSLE - On for Imms */ + if (!PREFEDIT_FLAGGED(PRF_NOHASSLE) && GET_LEVEL(PREFEDIT_GET_CHAR) > LVL_IMMORT) + SET_BIT_AR(PREFEDIT_GET_FLAGS, PRF_NOHASSLE); + else + REMOVE_BIT_AR(PREFEDIT_GET_FLAGS, PRF_NOHASSLE); + + /* PRF_QUEST - Off */ + if (PREFEDIT_FLAGGED(PRF_QUEST)) + REMOVE_BIT_AR(PREFEDIT_GET_FLAGS, PRF_QUEST); + + /* PRF_SUMMONABLE - Off */ + if (PREFEDIT_FLAGGED(PRF_SUMMONABLE)) + REMOVE_BIT_AR(PREFEDIT_GET_FLAGS, PRF_SUMMONABLE); + + /* PRF_NOREPEAT - Off */ + if (PREFEDIT_FLAGGED(PRF_NOREPEAT)) + REMOVE_BIT_AR(PREFEDIT_GET_FLAGS, PRF_NOREPEAT); + + /* PRF_HOLYLIGHT - On for Imms */ + if (!PREFEDIT_FLAGGED(PRF_HOLYLIGHT) && GET_LEVEL(PREFEDIT_GET_CHAR) > LVL_IMMORT) + SET_BIT_AR(PREFEDIT_GET_FLAGS, PRF_HOLYLIGHT); + else + REMOVE_BIT_AR(PREFEDIT_GET_FLAGS, PRF_HOLYLIGHT); + + /* PRF_COLOR - On (Complete) */ + if (!PREFEDIT_FLAGGED(PRF_COLOR_1)) + SET_BIT_AR(PREFEDIT_GET_FLAGS, PRF_COLOR_1); + if (!PREFEDIT_FLAGGED(PRF_COLOR_2)) + SET_BIT_AR(PREFEDIT_GET_FLAGS, PRF_COLOR_2); + + /* PRF_NOWIZ - Off */ + if (PREFEDIT_FLAGGED(PRF_NOWIZ)) + REMOVE_BIT_AR(PREFEDIT_GET_FLAGS, PRF_NOWIZ); + + /* PRF_LOG1 - Off */ + if (PREFEDIT_FLAGGED(PRF_LOG1)) + REMOVE_BIT_AR(PREFEDIT_GET_FLAGS, PRF_LOG1); + + /* PRF_LOG2 - Off */ + if (PREFEDIT_FLAGGED(PRF_LOG2)) + REMOVE_BIT_AR(PREFEDIT_GET_FLAGS, PRF_LOG2); + + /* PRF_NOAUCT - Off */ + if (PREFEDIT_FLAGGED(PRF_NOAUCT)) + REMOVE_BIT_AR(PREFEDIT_GET_FLAGS, PRF_NOAUCT); + + /* PRF_NOGOSS - Off */ + if (PREFEDIT_FLAGGED(PRF_NOGOSS)) + REMOVE_BIT_AR(PREFEDIT_GET_FLAGS, PRF_NOGOSS); + + /* PRF_NOGRATZ - Off */ + if (PREFEDIT_FLAGGED(PRF_NOGRATZ)) + REMOVE_BIT_AR(PREFEDIT_GET_FLAGS, PRF_NOGRATZ); + + /* PRF_SHOWVNUMS - On for Imms */ + if (!PREFEDIT_FLAGGED(PRF_SHOWVNUMS) && GET_LEVEL(PREFEDIT_GET_CHAR) > LVL_IMMORT) + SET_BIT_AR(PREFEDIT_GET_FLAGS, PRF_SHOWVNUMS); + else + REMOVE_BIT_AR(PREFEDIT_GET_FLAGS, PRF_SHOWVNUMS); + + /* PRF_DISPAUTO - Off */ + if (PREFEDIT_FLAGGED(PRF_DISPAUTO)) + REMOVE_BIT_AR(PREFEDIT_GET_FLAGS, PRF_DISPAUTO); + + /* PRF_CLS - Off */ + if (PREFEDIT_FLAGGED(PRF_CLS)) + REMOVE_BIT_AR(PREFEDIT_GET_FLAGS, PRF_CLS); + + /* PRF_AFK - Off */ + if (PREFEDIT_FLAGGED(PRF_AFK)) + REMOVE_BIT_AR(PREFEDIT_GET_FLAGS, PRF_AFK); + + /* PRF_AUTOLOOT - On */ + if (!PREFEDIT_FLAGGED(PRF_AUTOLOOT)) + SET_BIT_AR(PREFEDIT_GET_FLAGS, PRF_AUTOLOOT); + + /* PRF_AUTOGOLD - On */ + if (!PREFEDIT_FLAGGED(PRF_AUTOGOLD)) + SET_BIT_AR(PREFEDIT_GET_FLAGS, PRF_AUTOGOLD); + + /* PRF_AUTOSPLIT - Off */ + if (PREFEDIT_FLAGGED(PRF_AUTOSPLIT)) + REMOVE_BIT_AR(PREFEDIT_GET_FLAGS, PRF_AUTOSPLIT); + + /* PRF_AUTOSAC - Off */ + if (PREFEDIT_FLAGGED(PRF_AUTOSAC)) + REMOVE_BIT_AR(PREFEDIT_GET_FLAGS, PRF_AUTOSAC); + + /* PRF_AUTOASSIST - Off */ + if (PREFEDIT_FLAGGED(PRF_AUTOASSIST)) + REMOVE_BIT_AR(PREFEDIT_GET_FLAGS, PRF_AUTOASSIST); + + /* PRF_AUTOMAP - On */ + if (PREFEDIT_FLAGGED(PRF_AUTOMAP)) + SET_BIT_AR(PREFEDIT_GET_FLAGS, PRF_AUTOMAP); + + /* PRF_AUTOKEY - On */ + if (PREFEDIT_FLAGGED(PRF_AUTOKEY)) + SET_BIT_AR(PREFEDIT_GET_FLAGS, PRF_AUTOKEY); + + /* PRF_AUTODOOR - On */ + if (PREFEDIT_FLAGGED(PRF_AUTODOOR)) + SET_BIT_AR(PREFEDIT_GET_FLAGS, PRF_AUTODOOR); + + /* Other (non-toggle) options */ + PREFEDIT_GET_WIMP_LEV = 0; /* Wimpy off by default */ + PREFEDIT_GET_PAGELENGTH = 22; /* Default telnet screen is 22 lines */ + PREFEDIT_GET_SCREENWIDTH = 80; /* Default telnet screen is 80 columns */ +} + +ACMD(do_oasis_prefedit) +{ + struct descriptor_data *d; + struct char_data *vict; + char *buf3; + char buf1[MAX_STRING_LENGTH]; + char buf2[MAX_STRING_LENGTH]; + + /****************************************************************************/ + /** Parse any arguments. **/ + /****************************************************************************/ + buf3 = two_arguments(argument, buf1, buf2); + + /****************************************************************************/ + /** If there aren't any arguments...well...they can only modify their **/ + /** own toggles, can't they? **/ + /****************************************************************************/ + if (!*buf1) { + vict = ch; + } + else if (GET_LEVEL(ch) >= LVL_IMPL) + { + if ((vict = get_player_vis(ch, buf1, NULL, FIND_CHAR_WORLD)) == NULL) + { + send_to_char(ch, "There is no-one here by that name.\r\n"); + return; + } + } + else + { + send_to_char(ch, "You can't do that!\r\n"); + return; + } + + if (IS_NPC(vict)) + { + send_to_char(ch, "Don't be ridiculous! Mobs don't have toggles.\r\n"); + return; + } + + /****************************************************************************/ + /** Check that whatever it is isn't already being edited. **/ + /****************************************************************************/ + for (d = descriptor_list; d; d = d->next) { + if (STATE(d) == CON_PREFEDIT) { + if (d->olc && OLC_PREFS(d)->ch == vict) { + if (ch == vict) + send_to_char(ch, "Your preferences are currently being edited by %s.\r\n", PERS(d->character, ch)); + else + send_to_char(ch, "Their preferences are currently being edited by %s.\r\n", PERS(d->character, ch)); + return; + } + } + } + + /****************************************************************************/ + /** Point d to the builder's descriptor (for easier typing later). **/ + /****************************************************************************/ + d = ch->desc; + + /****************************************************************************/ + /** Give the descriptor an OLC structure. **/ + /****************************************************************************/ + if (d->olc) { + mudlog(BRF, LVL_IMMORT, TRUE, "SYSERR: do_oasis_prefedit: Player already had olc structure."); + free(d->olc); + } + + CREATE(d->olc, struct oasis_olc_data, 1); + + OLC_NUM(d) = 0; + + /****************************************************************************/ + /** If this is a new quest, setup a new quest, otherwise setup the **/ + /** existing quest. **/ + /****************************************************************************/ + prefedit_setup(d, vict); + + STATE(d) = CON_PREFEDIT; + + /****************************************************************************/ + /** Send the OLC message to the players in the same room as the builder. **/ + /****************************************************************************/ + act("$n starts editing toggles.", TRUE, d->character, 0, 0, TO_ROOM); + SET_BIT_AR(PLR_FLAGS(ch), PLR_WRITING); + + /****************************************************************************/ + /** Log the OLC message. **/ + /****************************************************************************/ +/* No need - done elsewhere */ +// mudlog(CMP, LVL_IMMORT, TRUE, "OLC: (prefedit) %s starts editing toggles for %s", GET_NAME(ch), GET_NAME(vict)); +} + diff --git a/src/prefedit.h b/src/prefedit.h index 6eda4d9..4ae2ccc 100755 --- a/src/prefedit.h +++ b/src/prefedit.h @@ -1,60 +1,60 @@ -/************************************************************************** -* File: prefedit.c Part of tbaMUD * -* Usage: Player-level OLC for setting preferences and toggles * -* * -* Created by Jamdog for tbaMUD 3.59 * -* All rights reserved. See license for complete information. * -* * -* Copyright (C) 1993, 94 by the Trustees of the Johns Hopkins University * -* CircleMUD is based on DikuMUD, Copyright (C) 1990, 1991. * -**************************************************************************/ - -/* Toggle structure held for OLC purposes */ -struct prefs_data -{ - struct char_data *ch; /* Pointer to char being edited */ - int pref_flags[PR_ARRAY_MAX]; /* Copy of player's pref flags */ - int wimp_level; /* Copy of player's wimp level */ - int page_length; /* Copy of player's pagelength */ - int screen_width; /* Copy of player's screenwidth */ -}; - -/* Prefedit utility macros */ - -/** Get the character being edited */ -#define PREFEDIT_GET_CHAR (OLC_PREFS(d)->ch ? (OLC_PREFS(d)->ch) : (d->character)) - -/** Get a pointer to the pref toggles of the character being edited */ -#define PREFEDIT_GET_FLAGS OLC_PREFS(d)->pref_flags - -/** Get the wimpy level of the character being edited */ -#define PREFEDIT_GET_WIMP_LEV OLC_PREFS(d)->wimp_level - -/** Get the page length of the character being edited */ -#define PREFEDIT_GET_PAGELENGTH OLC_PREFS(d)->page_length - -/** Get the screen width of the character being edited */ -#define PREFEDIT_GET_SCREENWIDTH OLC_PREFS(d)->screen_width - -/** Get one of the flag array elements for the character being edited */ -#define PREFEDIT_GET_FLAG(i) OLC_PREFS(d)->pref_flags[(i)] - -/** Get the state of a flag (on/off) for the character being edited */ -#define PREFEDIT_FLAGGED(flag) IS_SET_AR(PREFEDIT_GET_FLAGS, (flag)) - -/* Prefedit OLC sub-modes */ -#define PREFEDIT_MAIN_MENU 0 -#define PREFEDIT_PROMPT 1 -#define PREFEDIT_COLOR 2 -#define PREFEDIT_PAGELENGTH 3 -#define PREFEDIT_SCREENWIDTH 4 -#define PREFEDIT_WIMPY 5 -#define PREFEDIT_CONFIRM_SAVE 6 -#define PREFEDIT_SYSLOG 7 -#define PREFEDIT_TOGGLE_MENU 8 - -/* External Functions in prefedit.c */ -void prefedit_Restore_Defaults(struct descriptor_data *d); -void prefedit_parse(struct descriptor_data * d, char *arg); -ACMD(do_oasis_prefedit); - +/************************************************************************** +* File: prefedit.c Part of tbaMUD * +* Usage: Player-level OLC for setting preferences and toggles * +* * +* Created by Jamdog for tbaMUD 3.59 * +* All rights reserved. See license for complete information. * +* * +* Copyright (C) 1993, 94 by the Trustees of the Johns Hopkins University * +* CircleMUD is based on DikuMUD, Copyright (C) 1990, 1991. * +**************************************************************************/ + +/* Toggle structure held for OLC purposes */ +struct prefs_data +{ + struct char_data *ch; /* Pointer to char being edited */ + int pref_flags[PR_ARRAY_MAX]; /* Copy of player's pref flags */ + int wimp_level; /* Copy of player's wimp level */ + int page_length; /* Copy of player's pagelength */ + int screen_width; /* Copy of player's screenwidth */ +}; + +/* Prefedit utility macros */ + +/** Get the character being edited */ +#define PREFEDIT_GET_CHAR (OLC_PREFS(d)->ch ? (OLC_PREFS(d)->ch) : (d->character)) + +/** Get a pointer to the pref toggles of the character being edited */ +#define PREFEDIT_GET_FLAGS OLC_PREFS(d)->pref_flags + +/** Get the wimpy level of the character being edited */ +#define PREFEDIT_GET_WIMP_LEV OLC_PREFS(d)->wimp_level + +/** Get the page length of the character being edited */ +#define PREFEDIT_GET_PAGELENGTH OLC_PREFS(d)->page_length + +/** Get the screen width of the character being edited */ +#define PREFEDIT_GET_SCREENWIDTH OLC_PREFS(d)->screen_width + +/** Get one of the flag array elements for the character being edited */ +#define PREFEDIT_GET_FLAG(i) OLC_PREFS(d)->pref_flags[(i)] + +/** Get the state of a flag (on/off) for the character being edited */ +#define PREFEDIT_FLAGGED(flag) IS_SET_AR(PREFEDIT_GET_FLAGS, (flag)) + +/* Prefedit OLC sub-modes */ +#define PREFEDIT_MAIN_MENU 0 +#define PREFEDIT_PROMPT 1 +#define PREFEDIT_COLOR 2 +#define PREFEDIT_PAGELENGTH 3 +#define PREFEDIT_SCREENWIDTH 4 +#define PREFEDIT_WIMPY 5 +#define PREFEDIT_CONFIRM_SAVE 6 +#define PREFEDIT_SYSLOG 7 +#define PREFEDIT_TOGGLE_MENU 8 + +/* External Functions in prefedit.c */ +void prefedit_Restore_Defaults(struct descriptor_data *d); +void prefedit_parse(struct descriptor_data * d, char *arg); +ACMD(do_oasis_prefedit); + diff --git a/src/structs.h b/src/structs.h index 5513a29..ab1d182 100644 --- a/src/structs.h +++ b/src/structs.h @@ -19,7 +19,7 @@ * on an older version. You are supposed to compare this with the macro * TBAMUD_VERSION() in utils.h. * It is read as Major/Minor/Patchlevel - MMmmPP */ -#define _TBAMUD 0x030610 +#define _TBAMUD 0x030620 /** If you want equipment to be automatically equipped to the same place * it was when players rented, set the define below to 1 because