From 40b643b7d568bd77124e181e0847905e015ca1d5 Mon Sep 17 00:00:00 2001 From: Rumble Date: Thu, 4 Oct 2007 18:37:07 +0000 Subject: [PATCH] tbaMUD 3.54 [Oct 04 2007] - Rumble Changed autoexit to display doors as Exits: n (e) w s. DISP_CLOSED_DOORS added to cedit. Added rcopy, ocopy, etc. for all forms of OLC. (thanks Neme) [Oct 01 2007] - Rumble Added trigedit variables %zonename% and %zonenumber%. (thanks Drefs) Fixed memory leak in do_dig. (thanks Neme) Added trigedit variables %roomflag% and object %affects%. (thanks Jamdog) [Sep 27 2007] - Rumble Update to do_hit to prevent crash if the player is AFF_CHARM somehow without a master. (thanks Jamdog) Removed alias.c. New ASCII aliases handled in players.c and saved in plrfiles. --- changelog | 10 ++ lib/world/obj/12.obj | 33 ++++- lib/world/trg/0.trg | 2 + lib/world/trg/12.trg | 212 ++++++++++++++++++++++++---- lib/world/wld/12.wld | 318 +++++++++++++++++++++++++++++++++--------- lib/world/wld/308.wld | 10 +- src/Makefile.amiga | 4 +- src/Makefile.arc | 4 +- src/Makefile.bcc | 7 - src/Makefile.bcc55 | 7 - src/Makefile.in | 4 +- src/Makefile.lcc | 12 -- src/Makefile.msvc | 4 +- src/Makefile.os2 | 4 +- src/act.informative.c | 22 +-- src/act.offensive.c | 10 +- src/alias.c | 191 ------------------------- src/cedit.c | 19 ++- src/config.c | 4 + src/db.c | 6 +- src/db.h | 3 - src/dg_olc.c | 5 +- src/dg_scripts.c | 14 ++ src/dg_variables.c | 28 +++- src/genwld.c | 35 ----- src/interpreter.c | 21 +-- src/medit.c | 10 +- src/oasis_copy.c | 243 ++++++++++++++++++-------------- src/oedit.c | 5 +- src/players.c | 65 ++++++++- src/redit.c | 10 +- src/sedit.c | 3 +- src/structs.h | 1 + src/utils.c | 4 - src/utils.h | 8 +- 35 files changed, 798 insertions(+), 540 deletions(-) delete mode 100644 src/alias.c diff --git a/changelog b/changelog index 7e8e29a..3bfbc1b 100644 --- a/changelog +++ b/changelog @@ -5,6 +5,16 @@ The Builder Academy builderacademy.net 9091 tbaMUD 3.54 +[Oct 04 2007] - Rumble + Changed autoexit to display doors as Exits: n (e) w s. DISP_CLOSED_DOORS added to cedit. + Added rcopy, ocopy, etc. for all forms of OLC. (thanks Neme) +[Oct 01 2007] - Rumble + Added trigedit variables %zonename% and %zonenumber%. (thanks Drefs) + Fixed memory leak in do_dig. (thanks Neme) + Added trigedit variables %roomflag% and object %affects%. (thanks Jamdog) +[Sep 27 2007] - Rumble + Update to do_hit to prevent crash if the player is AFF_CHARM somehow without a master. (thanks Jamdog) + Removed alias.c. New ASCII aliases handled in players.c and saved in plrfiles. [Sep 25 2007] - Rumble Added set/not set to extra descriptions menu in oedit so a builder can tell if they exist or not without having to enter the extra desc menu or stat the object. Replaced [TRIG] flag (showvnum enabled) with [T] to make things easier to stat. diff --git a/lib/world/obj/12.obj b/lib/world/obj/12.obj index 5f7ebb2..ccf3598 100644 --- a/lib/world/obj/12.obj +++ b/lib/world/obj/12.obj @@ -148,6 +148,31 @@ A 6 2 A 2 1 +#1223 +scholar's guide jeweler's loop quest~ +Scholar's Guide~ +The Guide to all Gnomish knowledge hums here quietly.~ +~ +11 abdgq 0 0 0 aco 0 0 0 0 0 0 0 +0 0 0 0 +3 1000 0 20 +E +scholar's guide jeweler's loop quest~ + You are looking at what could quite possibly be one of the most beautiful +peaces of artistry ever made. This finely crafted jeweler's loop is suspended +from a chain of golden links. The loop itself is a perfectly made combination +of grounned glass, perfectly crafted silver, and precision gnomish workmanship. +It is so simple as to be elegant. A tiny plaque hangs from the chain that +suspends the loop. "To you who would sacrifice for life, join me. To you who +would become a slave to wonder, hold me. To you who seek riches through +learning, I am yours. " +~ +A +3 3 +A +12 50 +A +4 3 #1226 boards builder's bulletin gen_boards~ a builder's bulletin board~ @@ -315,14 +340,14 @@ A piece of fireworks is planted in a champagne bottle.~ 0 0 0 0 T 1297 E +firework new year piece~ + This large rocket is about to go up! Strange colours will fill the sky! +~ +E bottle champagne~ The bottle is filled partially with water so it doesn't tilt over. Someone has obviously drunk the champagne first. ~ -E -firework new year piece~ - This large rocket is about to go up! Strange colours will fill the sky! -~ #1299 christmas tree~ a christmas tree~ diff --git a/lib/world/trg/0.trg b/lib/world/trg/0.trg index 36db114..0714cfc 100644 --- a/lib/world/trg/0.trg +++ b/lib/world/trg/0.trg @@ -726,6 +726,8 @@ Room Variables Example~ %echo% WEATHER: %self.weather% %echo% SECTOR: %self.sector% %echo% CONTENTS: %self.contents% +%echo% ZONENAME: %self.zonename% +%echo% ZONEID: %self.zoneid% ~ #30 Text Variables Example~ diff --git a/lib/world/trg/12.trg b/lib/world/trg/12.trg index c7af265..8e50c7d 100644 --- a/lib/world/trg/12.trg +++ b/lib/world/trg/12.trg @@ -763,31 +763,45 @@ done Hunger, Thirst, Drunk Test Trigger~ 2 g 100 ~ -wait 1 -%echo% Hello %actor.name% -%echo% Hunger: %actor.hunger% Thirst: %actor.thirst% Drunk: %actor.drunk% -nop %actor.hunger(50) -nop %actor.thirst(50) -nop %actor.drunk(50) -%echo% Hunger: %actor.hunger% Thirst: %actor.thirst% Drunk: %actor.drunk% -nop %actor.hunger(-10) -nop %actor.thirst(-10) -nop %actor.drunk(-10) -%echo% Hunger: %actor.hunger% Thirst: %actor.thirst% Drunk: %actor.drunk% -nop %actor.hunger(20) -nop %actor.thirst(21) -nop %actor.drunk(22) -%echo% Hunger: %actor.hunger% Thirst: %actor.thirst% Drunk: %actor.drunk% -* -while %actor.hunger% >= 0 - nop %actor.hunger(-1) -done -while %actor.thirst% >= 0 - nop %actor.thirst(-1) -done -while %actor.drunk% >= 0 - nop %actor.drunk(-1) -done +if %self.roomflag(DARK)% +%echo% This is a dark room. +end +if %self.roomflag(DEATH)% +%echo% This is a death trap - goodbye! +end +if %self.roomflag(NO_MOB)% +%echo% Mobiles cannot enter this room. +end +if %self.roomflag(INDOORS)% +%echo% This room is indoors. +end +if %self.roomflag(PEACEFUL)% +%echo% You can't kill anything in this room. +end +if %self.roomflag(NO_TRACK)% +%echo% You cannot track anything through this room. +end +if %self.roomflag(NO_MAGIC)% +%echo% You cannot cast spells in here! +end +if %self.roomflag(TUNNEL)% +%echo% This room is a narrow tunnel. +end +if %self.roomflag(PRIVATE)% +%echo% This is a private room. +end +if %self.roomflag(GODROOM)% +%echo% Only Gods can enter this room. +end +if %self.roomflag(HOUSE)% +%echo% This is a house. +end +if %self.roomflag(HCRSH)% +%echo% This is a house which will crash-save. +end +if %self.roomflag(ATRIUM)% +%echo% This is an atrium for a house. +end ~ #1217 new trigger~ @@ -913,6 +927,154 @@ elseif %direction% == west %echoaround% %actor% The door slides open, %actor.name% walks out, and the door slides shut. end ~ +#1256 +Mob Quote Using Arrays~ +0 d 100 +quote~ +* By Jamie Nelson from the forum http://groups.yahoo.com/group/dg_scripts/ +eval w1max %random.20% +eval w2max %random.20% +eval w3max %random.20% +eval w4max %random.20% +eval w5max %random.11% +eval w6max %random.20% +set w1[0] phenomenal +set w1[1] rapid +set w1[2] chilling +set w1[3] insipid +set w1[4] nauseating +set w1[5] astronomical +set w1[6] austere +set w1[7] inevitable +set w1[8] inescapable +set w1[9] reckless +set w1[10] haphazard +set w1[11] accelerating +set w1[12] profound +set w1[13] awesome +set w1[14] terrifying +set w1[15] ubiquitous +set w1[16] ignominious +set w1[17] unprecedented +set w1[18] unparalleled +set w1[19] insidious +set w1[20] broad +set w2[0] growth +set w2[1] decline +set w2[2] prospects +set w2[3] acceleration +set w2[4] threat +set w2[5] expansion +set w2[6] oneness +set w2[7] outgrowth +set w2[8] madness +set w2[9] evacuation +set w2[10] diminishment +set w2[11] consumption +set w2[12] decay +set w2[13] putrefaction +set w2[14] vapidity +set w2[15] downsizing +set w2[16] degeneration +set w2[17] litigation +set w2[18] declivity +set w2[19] hastening +set w2[20] paradigm shifting +set w3[0] the Internet +set w3[1] urban tax dollars +set w3[2] new technologies +set w3[3] gender identification disorders +set w3[4] censorship +set w3[5] interpersonal communications +set w3[6] modern life +set w3[7] rampant paradigm shifts +set w3[8] consumer spending +set w3[9] rain forests +set w3[10] human literacy +set w3[11] natural resources +set w3[12] traditional values +set w3[13] media junk food +set w3[14] family values +set w3[15] corporate mentality +set w3[16] the American justice system +set w3[17] technological change +set w3[18] the ozone layer +set w3[19] human resources +set w3[20] current epistemologies +set w4[0] forever dissipate +set w4[1] escalate +set w4[2] aggrandize +set w4[3] overhaul +set w4[4] deteriorate +set w4[5] revolutionize +set w4[6] uglify +set w4[7] put an end to +set w4[8] enslave +set w4[9] bankrupt +set w4[10] truncate +set w4[11] nullify +set w4[12] sabotage +set w4[13] destabilize +set w4[14] incapacitate +set w4[15] hasten +set w4[16] dehumanize +set w4[17] evaporate +set w4[18] indenture +set w4[19] intensify +set w4[20] undermine +set w5[0] today's +set w5[1] tomorrow's +set w5[2] the entrenchment of our +set w5[3] worldwide +set w5[4] our children's +set w5[5] modern +set w5[6] all of our +set w5[7] our future +set w5[8] our +set w5[9] the demise of our +set w5[10] our grandchildren's +set w5[11] all hope for +set w6[0] business models +set w6[1] re-ruralization +set w6[2] human condition +set w6[3] family values +set w6[4] self-esteem +set w6[5] medical insights +set w6[6] human psyche +set w6[7] human depth +set w6[8] egalitarianism +set w6[9] World Wide Web +set w6[10] future values +set w6[11] hopes and dreams +set w6[12] business models +set w6[13] political climate +set w6[14] education +set w6[15] cultural heritage +set w6[16] lifestyles +set w6[17] fiduciary responsibility +set w6[18] genetic diversity +set w6[19] intestinal fortitude +set w6[20] computer literacy +set w1 %%w1[%w1max%]%% +eval w1 %w1% +set msg The %w1% +set w2 %%w2[%w2max%]%% +eval w2 %w2% +set msg %msg% %w2% of +set w3 %%w3[%w3max%]%% +eval w3 %w3% +set msg %msg% %w3% +set w4 %%w4[%w4max%]%% +eval w4 %w4% +set msg %msg% will %w4% +set w5 %%w5[%w5max%]%% +eval w5 %w5% +set msg %msg% %w5% +set w6 %%w6[%w6max%]%% +eval w6 %w6% +set msg %msg% %w6% +say %msg% +~ #1267 secret drawer magic~ 1 c 4 diff --git a/lib/world/wld/12.wld b/lib/world/wld/12.wld index 1349aa3..fb4fcaa 100644 --- a/lib/world/wld/12.wld +++ b/lib/world/wld/12.wld @@ -9,7 +9,7 @@ D0 The Immortal Board Room can be seen to the north. ~ ~ -0 -1 1204 +0 -1 -1 S #1201 The Inn Of The Gods~ @@ -23,7 +23,7 @@ D2 The Immortal Board Room can be seen to the south. ~ ~ -0 -1 1204 +0 -1 -1 S #1202 The Ice Box Of The Gods~ @@ -43,65 +43,7 @@ D3 The Immortal Board Room can be seen to the west. ~ ~ -0 -1 1204 -S -#1204 -The Immortal Board Room~ - The main hang out of the Gods, the Immortal Board Room is the place to be. -Gods exchange messages here most every day. The mortal board room is to the -east and the meeting room for the gods is to the south. To the north is the -Gods' Inn and to the west is a post office for Gods. In the northeast corner -you spot a small staircase leading upwards. -~ -12 8 0 0 0 0 -D0 -The Gods' Inn can be seen just to the north. -~ -~ -0 -1 1201 -D1 -The Immortal Board Hall can be seen just to the east. -~ -~ -0 -1 1290 -D2 -The Gods' Meeting Room is located to the south. -~ -~ -0 -1 1200 -D3 -The Gods' Post Office is just to the west. -~ -~ -0 -1 1205 -D4 -There is a small stair in the corner leading up to the social room of -the Gods. -~ -~ -0 -1 1206 -E -original~ - The main hang out of the Gods, the Immortal Board Room is the place to be. -Gods exchange messages here most every day. The mortal board room is to the -east and the meeting room for the gods is to the south. To the north is the -Gods' Inn and to the west is a post office for Gods. In the northeast corner -you spot a small staircase leading upwards. -~ -S -#1205 -The Post Office Of The Gods~ - The Post Office Of The Gods is the same as most Post Offices except that -it is not as slow. Even the Postal service knows not to anger the Gods. -Piles of junk mail line the walls. I guess even Gods get on mailing lists. -The Immortal Board Room is to the east. -~ -12 8 0 0 0 0 -D1 -The Immortal Board Room is just to the east. -~ -~ -0 -1 1204 +0 -1 -1 S #1206 The Social Gathering Room~ @@ -114,7 +56,7 @@ The Immortal Board Room is just down through the floor. Funny how you didn't notice that exit before isn't it? ~ ~ -0 -1 1204 +0 -1 -1 S #1290 The Immortal Board Hall~ @@ -134,7 +76,7 @@ D2 D3 ~ ~ -0 0 1204 +0 0 -1 S #1291 The Builders' Board Room~ @@ -173,4 +115,254 @@ D0 ~ 0 0 1290 S +#1297 +6~ + The mark of the immature man is that he wants to die nobly for a cause, +while the mark of the mature man is that he wants to live humbly for one. +--Wilhelm Stekel +~ +12 8 0 0 0 0 +D0 +~ +~ +0 0 33 +D2 +~ +~ +0 0 33 +E +Catcher Rye~ + The mark of the immature man is that he wants to die nobly for a cause, +while the mark of the mature man is that he wants to live humbly for one. +--Wilhelm Stekel + + ...you'll find that you're not the first person who was ever confused and +frighteneed and even sickened by human behavior. You're by no means alone on +that score, you'll be excited and stimulated to know. Many, many men have been +just as troubled morally and spiritually as you are right now. Happily, some +of them kept records of their troubles. You'll learn from them-if you want to. +Just as someday, if you have something to offer, someone will learn something +from you. It's a beautiful reciprocal arrangement. +--The Catcher in the Rye +~ +E +old glory flag~ + I fly atop the world's tallest buildings. I stand watch in America's Halls +of Justice. I fly majestically over great institutions of learning. I stand +guard with the greatest military power in the world. Look up and see me! I +stand for peace, honor, truth, and justice. I stand for freedom. I am +confident, I am arrogant, I am proud. When I am flown with my banners, my head +is a little higher, my colors a little truer, I bow to no one! I am recognized +all over the world. I am worshipped, I am loved, and I am feared! I have +fought in every battle of every war for more than 200 years: Gettysburg, +Shiloh, Appomattox, San Juan Hill, the trenches of France, the Argonne Forest, +Anzio, Rome, the beaches of Normandy, Guam, Okinawa, Japan, Korea, Vietnam, the +Persian Gulf, and a score of places long forgotten by all, but those who were +there with me... I was there! I led my Soldiers, Sailors, Airmen, and +Marines. I followed them and watched over them. They loved me. I was on a +small hill in Iwo Jima. I was dirty, battle-worn, and tired. But my Soldiers +cheered me! And I was proud! I have been soiled, burned, torn, and trampled +on the streets of countries that I have helped set free. It does not hurt, for +I am invincible. I have also been soiled, burned, torn, and trampled on the +streets of my own country and, when it is by those whom I have served with in +battle-it hurts. But I shall overcome, for I am strong! I have slipped the +bonds of Earth and, from my vantage point on the Moon, I stand watch over the +uncharted new frontiers of Space. I have been a silent witness to all of +America's finest hours. But my finest hour comes when I am torn in strips to +be used as bandages for my wounded comrades on the field of battle-when I fly +at half-mast to honor my Soldiers, Sailors, Airmen, and Marines, and-when I lie +in the trembling arms of a grieving mother, at the gravesite of her fallen son +or daughter-I am proud. My name is Old Glory-long may I wave. Dear God, long +may I wave. +~ +E +war~ + War is an ugly thing, but not the ugliest of things. The decayed and +degraded state of moral and patriotic feeling which thinks that nothing is +worth war is much worse. The person who has nothing for which he is willing to +fight, nothing which is more important than his own personal safety, is a +miserable creature and has no chance of being free unless made and kept so by +the exertions of better men than himself. + +John Stuart Mill +~ +E +builder~ + +There is one timeless way of building. + +It is thousands of years old, and the same today as it has always been. + + The great traditional buildings of the past, the villages and tents and +temples in which man feels at home, have always been made by people who were +very close to the center of this way. It is not possible to make great +buildings, or great towns, beautiful places, places where you feel yourself, +places where you feel alive, except by following this way. And, as you will +see, this way will lead anyone who looks for it to buildings which are +themselves as ancient in their form, as the trees and hills, and as our faces +are. + --The Timeless Way of Building +~ +E +oath~ + I do solemnly swear that I will support and defend the Constitution of the +United States against all enemies, foreign and domestic, and to bear true faith +and allegiance to the same that I take this obligation freely, without any +mental reservation or purpose of evasion, and that I will well and faithfully +discharge the duties of the office upon which I am about to enter. +~ +E +july4~ + On July 4, 1776, we claimed our independence from England and Democracy was +born. Every day thousands leave their homeland to come to the "land of the +free and the home of the brave" so they can begin their American Dream. The +United States is truly a diverse nation made up of dynamic people. Each year +on July 4, Americans celebrate that freedom and indepen-dence with barbecues, +picnics, and family ga-therings. Through the Internet we are learning about +and communicat-ing with people of different nations, with different languages +and different races throughout the world. Bringing the world closer with +understanding and knowledge can only benefit all nations. We invite all +nations to celebrate with Americans online this Fourth of July. Happy +Birthday, America! +~ +E +.test~ +can you see this with look around? +~ +S +T 1201 +#1298 +6~ + The mark of the immature man is that he wants to die nobly for a cause, +while the mark of the mature man is that he wants to live humbly for one. +--Wilhelm Stekel +~ +12 8 0 0 0 0 +D0 +~ +~ +0 0 33 +D2 +~ +~ +0 0 33 +E +Catcher Rye~ + The mark of the immature man is that he wants to die nobly for a cause, +while the mark of the mature man is that he wants to live humbly for one. +--Wilhelm Stekel + + ...you'll find that you're not the first person who was ever confused and +frighteneed and even sickened by human behavior. You're by no means alone on +that score, you'll be excited and stimulated to know. Many, many men have been +just as troubled morally and spiritually as you are right now. Happily, some +of them kept records of their troubles. You'll learn from them-if you want to. +Just as someday, if you have something to offer, someone will learn something +from you. It's a beautiful reciprocal arrangement. +--The Catcher in the Rye +~ +E +old glory flag~ + I fly atop the world's tallest buildings. I stand watch in America's Halls +of Justice. I fly majestically over great institutions of learning. I stand +guard with the greatest military power in the world. Look up and see me! I +stand for peace, honor, truth, and justice. I stand for freedom. I am +confident, I am arrogant, I am proud. When I am flown with my banners, my head +is a little higher, my colors a little truer, I bow to no one! I am recognized +all over the world. I am worshipped, I am loved, and I am feared! I have +fought in every battle of every war for more than 200 years: Gettysburg, +Shiloh, Appomattox, San Juan Hill, the trenches of France, the Argonne Forest, +Anzio, Rome, the beaches of Normandy, Guam, Okinawa, Japan, Korea, Vietnam, the +Persian Gulf, and a score of places long forgotten by all, but those who were +there with me... I was there! I led my Soldiers, Sailors, Airmen, and +Marines. I followed them and watched over them. They loved me. I was on a +small hill in Iwo Jima. I was dirty, battle-worn, and tired. But my Soldiers +cheered me! And I was proud! I have been soiled, burned, torn, and trampled +on the streets of countries that I have helped set free. It does not hurt, for +I am invincible. I have also been soiled, burned, torn, and trampled on the +streets of my own country and, when it is by those whom I have served with in +battle-it hurts. But I shall overcome, for I am strong! I have slipped the +bonds of Earth and, from my vantage point on the Moon, I stand watch over the +uncharted new frontiers of Space. I have been a silent witness to all of +America's finest hours. But my finest hour comes when I am torn in strips to +be used as bandages for my wounded comrades on the field of battle-when I fly +at half-mast to honor my Soldiers, Sailors, Airmen, and Marines, and-when I lie +in the trembling arms of a grieving mother, at the gravesite of her fallen son +or daughter-I am proud. My name is Old Glory-long may I wave. Dear God, long +may I wave. +~ +E +war~ + War is an ugly thing, but not the ugliest of things. The decayed and +degraded state of moral and patriotic feeling which thinks that nothing is +worth war is much worse. The person who has nothing for which he is willing to +fight, nothing which is more important than his own personal safety, is a +miserable creature and has no chance of being free unless made and kept so by +the exertions of better men than himself. + +John Stuart Mill +~ +E +builder~ + +There is one timeless way of building. + +It is thousands of years old, and the same today as it has always been. + + The great traditional buildings of the past, the villages and tents and +temples in which man feels at home, have always been made by people who were +very close to the center of this way. It is not possible to make great +buildings, or great towns, beautiful places, places where you feel yourself, +places where you feel alive, except by following this way. And, as you will +see, this way will lead anyone who looks for it to buildings which are +themselves as ancient in their form, as the trees and hills, and as our faces +are. + --The Timeless Way of Building +~ +E +oath~ + I do solemnly swear that I will support and defend the Constitution of the +United States against all enemies, foreign and domestic, and to bear true faith +and allegiance to the same that I take this obligation freely, without any +mental reservation or purpose of evasion, and that I will well and faithfully +discharge the duties of the office upon which I am about to enter. +~ +E +july4~ + On July 4, 1776, we claimed our independence from England and Democracy was +born. Every day thousands leave their homeland to come to the "land of the +free and the home of the brave" so they can begin their American Dream. The +United States is truly a diverse nation made up of dynamic people. Each year +on July 4, Americans celebrate that freedom and indepen-dence with barbecues, +picnics, and family ga-therings. Through the Internet we are learning about +and communicat-ing with people of different nations, with different languages +and different races throughout the world. Bringing the world closer with +understanding and knowledge can only benefit all nations. We invite all +nations to celebrate with Americans online this Fourth of July. Happy +Birthday, America! +~ +E +.test~ +can you see this with look around? +~ +S +T 1201 +#1299 +The Immortal Board Room~ + The main hang out of the Gods, the Immortal Board Room is the place to be. +Gods exchange messages here most every day. The mortal board room is to the +east and the meeting room for the gods is to the south. To the north is the +Gods' Inn and to the west is a post office for Gods. In the northeast corner +you spot a small staircase leading upwards. +~ +12 65535 0 0 0 0 +E +original~ + The main hang out of the Gods, the Immortal Board Room is the place to be. +Gods exchange messages here most every day. The mortal board room is to the +east and the meeting room for the gods is to the south. To the north is the +Gods' Inn and to the west is a post office for Gods. In the northeast corner +you spot a small staircase leading upwards. +~ +S $~ diff --git a/lib/world/wld/308.wld b/lib/world/wld/308.wld index 8be0eb3..6f2a0e5 100644 --- a/lib/world/wld/308.wld +++ b/lib/world/wld/308.wld @@ -1228,11 +1228,6 @@ D4 fireplace~ 1 0 30875 E -stones~ - They look as if they aren't anchored all that well, as if they might be able -to be moved or jarred free. -~ -E fireplace~ It is a huge piece of work, spanning the entire length of the room. The place where the firewood is actually kept and burnt only takes up about a @@ -1240,6 +1235,11 @@ quarter of the space that it could, the rest of it is just ornate. Most of the rocks are made from regular, grayish stone but there is a particular run of them that are a bit darker than the rest. ~ +E +stones~ + They look as if they aren't anchored all that well, as if they might be able +to be moved or jarred free. +~ S #30872 Cailveh's Private Chambers~ diff --git a/src/Makefile.amiga b/src/Makefile.amiga index 4e9b8d0..483332a 100644 --- a/src/Makefile.amiga +++ b/src/Makefile.amiga @@ -24,7 +24,7 @@ OBJFILES = comm.o act.comm.o act.informative.o act.movement.o act.item.o \ castle.o class.o config.o constants.o db.o fight.o graph.o handler.o \ house.o interpreter.o limits.o magic.o mail.o mobact.o modify.o \ objsave.o shop.o spec_assign.o spec_procs.o spell_parser.o \ - spells.o utils.o weather.o alias.o players.o + spells.o utils.o weather.o players.o default: .accepted $(MAKE) ../bin/circle @@ -91,8 +91,6 @@ clean: # Dependencies for the object files (automagically generated with # gcc -MM) -alias.o: alias.c conf.h sysdep.h structs.h utils.h interpreter.h db.h - $(CC) -c $(CFLAGS) alias.c act.comm.o: act.comm.c conf.h sysdep.h structs.h utils.h comm.h interpreter.h \ handler.h db.h screen.h $(CC) -c $(CFLAGS) act.comm.c diff --git a/src/Makefile.arc b/src/Makefile.arc index f60e9e0..01d2cda 100644 --- a/src/Makefile.arc +++ b/src/Makefile.arc @@ -26,7 +26,7 @@ OBJFILES = o.comm act.o.comm act.o.informative act.o.movement act.o.item \ o.castle o.class o.config o.constants o.db o.fight o.graph o.handler \ o.house o.interpreter o.limits o.magic o.mail o.mobact o.modify \ o.objsave o.random o.shop o.spec_assign o.spec_procs \ - o.spell_parser o.spells o.utils o.weather o.players o.alias + o.spell_parser o.spells o.utils o.weather o.players default: all @@ -41,8 +41,6 @@ clean: # Dependencies for the object files (automagically generated with # gcc -MM) -o.alias: c.alias h.conf h.sysdep h.structs h.utils h.interpreter h.db - $(CC) -c $(CFLAGS) c.alias -o o.alias act.o.comm: act.c.comm h.conf h.sysdep h.structs \ h.utils h.comm h.interpreter h.handler \ h.db h.screen diff --git a/src/Makefile.bcc b/src/Makefile.bcc index 3d13968..7486e24 100644 --- a/src/Makefile.bcc +++ b/src/Makefile.bcc @@ -43,7 +43,6 @@ circle : BccW32.cfg $(Dep_circle) echo MakeNode Dep_circledexe = \ - alias.obj\ act.comm.obj\ act.movement.obj\ act.item.obj\ @@ -85,7 +84,6 @@ circle.exe : $(Dep_circledexe) $(TLINK32) @&&| /v $(IDE_LinkFLAGS32) $(LinkerOptsAt_circledexe) $(LinkerInheritOptsAt_circledexe) + C:\BC5\LIB\c0x32.obj+ -alias.obj+ act.comm.obj+ act.movement.obj+ act.item.obj+ @@ -129,11 +127,6 @@ C:\BC5\LIB\cw32i.lib | -alias.obj : alias.c - $(BCC32) -P- -c @&&| - $(CompOptsAt_circledexe) $(CompInheritOptsAt_circledexe) -o$@ alias.c -| - act.comm.obj : act.comm.c $(BCC32) -P- -c @&&| $(CompOptsAt_circledexe) $(CompInheritOptsAt_circledexe) -o$@ act.comm.c diff --git a/src/Makefile.bcc55 b/src/Makefile.bcc55 index b7df4f9..f5cca7e 100644 --- a/src/Makefile.bcc55 +++ b/src/Makefile.bcc55 @@ -44,7 +44,6 @@ circle : BccW32.cfg $(Dep_circle) echo MakeNode Dep_circledexe = \ - alias.obj\ act.comm.obj\ act.movement.obj\ act.item.obj\ @@ -86,7 +85,6 @@ circle.exe : $(Dep_circledexe) $(TLINK32) @&&| /v $(IDE_LinkFLAGS32) $(LinkerOptsAt_circledexe) $(LinkerInheritOptsAt_circledexe) + C:\BORLAND\BCC55\LIB\c0x32.obj+ -alias.obj+ act.comm.obj+ act.movement.obj+ act.item.obj+ @@ -128,11 +126,6 @@ C:\BORLAND\BCC55\LIB\import32.lib+ C:\BORLAND\BCC55\LIB\cw32i.lib | -alias.obj : alias.c - $(BCC32) -P- -c @&&| - $(CompOptsAt_circledexe) $(CompInheritOptsAt_circledexe) -o$@ alias.c -| - act.comm.obj : act.comm.c $(BCC32) -P- -c @&&| $(CompOptsAt_circledexe) $(CompInheritOptsAt_circledexe) -o$@ act.comm.c diff --git a/src/Makefile.in b/src/Makefile.in index b810758..4b8e1f5 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -24,7 +24,7 @@ CFLAGS = @CFLAGS@ $(MYFLAGS) $(PROFILE) LIBS = @LIBS@ @CRYPTLIB@ @NETLIB@ OBJFILES = act.comm.o act.informative.o act.item.o act.movement.o \ - act.offensive.o act.other.o act.social.o act.wizard.o aedit.o alias.o \ + act.offensive.o act.other.o act.social.o act.wizard.o aedit.o \ ban.o boards.o bsd-snprintf.o castle.o cedit.o class.o comm.o config.o \ constants.o db.o dg_comm.o dg_db_scripts.o dg_event.o \ dg_handler.o dg_misc.o dg_mobcmd.o dg_objcmd.o dg_olc.o dg_scripts.o \ @@ -37,7 +37,7 @@ OBJFILES = act.comm.o act.informative.o act.item.o act.movement.o \ weather.o zedit.o zmalloc.o CXREF_FILES = act.comm.c act.informative.c act.item.c act.movement.c \ - act.offensive.c act.other.c act.social.c act.wizard.c aedit.c alias.c \ + act.offensive.c act.other.c act.social.c act.wizard.c aedit.c \ ban.c boards.c bsd-snprintf.c castle.c cedit.c class.c comm.c config.c \ constants.c db.c dg_comm.c dg_db_scripts.c dg_event.c \ dg_handler.c dg_misc.c dg_mobcmd.c dg_objcmd.c dg_olc.c dg_scripts.c \ diff --git a/src/Makefile.lcc b/src/Makefile.lcc index e748b42..64eb015 100644 --- a/src/Makefile.lcc +++ b/src/Makefile.lcc @@ -52,7 +52,6 @@ OBJS=\ act.item.obj \ act.informative.obj \ act.comm.obj \ - alias.obj LIBS=$(LCCDIR)\lib\wsock32.lib @@ -551,14 +550,3 @@ ACT_COMM_C=\ act.comm.obj: $(ACT_COMM_C) $(DISTDIR)\src\act.comm.c $(CC) $(CFLAGS) $(DISTDIR)\src\act.comm.c -# Build ALIAS.C -ALIAS_C=\ - $(DISTDIR)\src\sysdep.h\ - $(DISTDIR)\src\structs.h\ - $(DISTDIR)\src\utils.h\ - $(DISTDIR)\src\interpreter.h\ - $(DISTDIR)\src\db.h\ - -alias.obj: $(ALIAS_C) $(DISTDIR)\src\alias.c - $(CC) $(CFLAGS) $(DISTDIR)\src\alias.c - diff --git a/src/Makefile.msvc b/src/Makefile.msvc index 9f3d5b3..9cc38e2 100644 --- a/src/Makefile.msvc +++ b/src/Makefile.msvc @@ -40,7 +40,7 @@ OBJFILES = comm.obj act.comm.obj act.informative.obj act.movement.obj act.item.o castle.obj class.obj config.obj constants.obj db.obj fight.obj graph.obj handler.obj \ house.obj interpreter.obj limits.obj magic.obj mail.obj mobact.obj modify.obj \ objsave.obj shop.obj spec_assign.obj spec_procs.obj spell_parser.obj \ - spells.obj utils.obj weather.obj random.obj alias.obj players.obj + spells.obj utils.obj weather.obj random.obj players.obj default: circle.exe $(MAKE) circle.exe @@ -52,8 +52,6 @@ circle.exe : $(OBJFILES) # Dependencies for the object files (automagically generated with # gcc -MM) -alias.obj: alias.c conf.h sysdep.h structs.h utils.h interpreter.h db.h - $(CC) -c $(CFLAGS) alias.c act.comm.obj: act.comm.c conf.h sysdep.h structs.h utils.h comm.h interpreter.h \ handler.h db.h screen.h $(CC) -c $(CFLAGS) act.comm.c diff --git a/src/Makefile.os2 b/src/Makefile.os2 index 60931fd..88ebcf7 100644 --- a/src/Makefile.os2 +++ b/src/Makefile.os2 @@ -26,7 +26,7 @@ OBJFILES = comm.o act.comm.o act.informative.o act.movement.o act.item.o \ castle.o class.o config.o constants.o db.o fight.o graph.o handler.o \ house.o interpreter.o limits.o magic.o mail.o mobact.o modify.o \ objsave.o shop.o spec_assign.o spec_procs.o spell_parser.o \ - spells.o utils.o weather.o random.o alias.o players.o + spells.o utils.o weather.o random.o players.o default: .accepted $(MAKE) ../bin/circle @@ -93,8 +93,6 @@ clean: # Dependencies for the object files (automagically generated with # gcc -MM) -alias.o: alias.c conf.h sysdep.h structs.h utils.h interpreter.h db.h - $(CC) -c $(CFLAGS) alias.c act.comm.o: act.comm.c conf.h sysdep.h structs.h utils.h comm.h interpreter.h \ handler.h db.h screen.h $(CC) -c $(CFLAGS) act.comm.c diff --git a/src/act.informative.c b/src/act.informative.c index e257097..dc4c2f7 100644 --- a/src/act.informative.c +++ b/src/act.informative.c @@ -434,10 +434,12 @@ void do_auto_exits(struct char_data *ch) for (door = 0; door < NUM_OF_DIRS; door++) { if (!EXIT(ch, door) || EXIT(ch, door)->to_room == NOWHERE) continue; - if (EXIT_FLAGGED(EXIT(ch, door), EX_CLOSED)) + if (EXIT_FLAGGED(EXIT(ch, door), EX_CLOSED) && !CONFIG_DISP_CLOSED_DOORS) continue; - - send_to_char(ch, "%c ", LOWER(*dirs[door])); + if (EXIT_FLAGGED(EXIT(ch, door), EX_CLOSED)) + send_to_char(ch, "%s(%c)%s ", CCRED(ch, C_NRM), LOWER(*dirs[door]), CCCYN(ch, C_NRM)); + else + send_to_char(ch, "%c ", LOWER(*dirs[door])); slen++; } @@ -458,14 +460,18 @@ ACMD(do_exits) for (door = 0; door < NUM_OF_DIRS; door++) { if (!EXIT(ch, door) || EXIT(ch, door)->to_room == NOWHERE) continue; - if (EXIT_FLAGGED(EXIT(ch, door), EX_CLOSED)) + if (EXIT_FLAGGED(EXIT(ch, door), EX_CLOSED) && !CONFIG_DISP_CLOSED_DOORS) continue; len++; - if (!IS_NPC(ch) && PRF_FLAGGED(ch, PRF_SHOWVNUMS)) - send_to_char(ch, "%-5s - [%5d] %s\r\n", dirs[door], GET_ROOM_VNUM(EXIT(ch, door)->to_room), - world[EXIT(ch, door)->to_room].name); + if (!IS_NPC(ch) && PRF_FLAGGED(ch, PRF_SHOWVNUMS) && !EXIT_FLAGGED(EXIT(ch, door), EX_CLOSED)) + send_to_char(ch, "%-5s - [%5d] %s\r\n", dirs[door], GET_ROOM_VNUM(EXIT(ch, door)->to_room), world[EXIT(ch, door)->to_room].name); + else if (CONFIG_DISP_CLOSED_DOORS && EXIT_FLAGGED(EXIT(ch, door), EX_CLOSED)) { + /* But we tell them the door is closed */ + send_to_char(ch, "%-5s - The %s is closed.\r\n", dirs[door], + (EXIT(ch, door)->keyword)? fname(EXIT(ch, door)->keyword) : "opening" ); + } else send_to_char(ch, "%-5s - %s\r\n", dirs[door], IS_DARK(EXIT(ch, door)->to_room) && !CAN_SEE_IN_DARK(ch) ? "Too dark to tell." : world[EXIT(ch, door)->to_room].name); @@ -1607,7 +1613,7 @@ void perform_immort_where(struct char_data *ch, char *arg) send_to_char(ch, "M%3d. %-25s%s - [%5d] %-25s%s", ++num, GET_NAME(i), QNRM, GET_ROOM_VNUM(IN_ROOM(i)), world[IN_ROOM(i)].name, QNRM); if (SCRIPT(i)) - send_to_char(ch, "[T%d] ", i->proto_script->vnum); + send_to_char(ch, "[T%5d] ", i->proto_script->vnum); send_to_char(ch, "%s\r\n", QNRM); } for (num = 0, k = object_list; k; k = k->next) diff --git a/src/act.offensive.c b/src/act.offensive.c index eac0f53..b6fd454 100644 --- a/src/act.offensive.c +++ b/src/act.offensive.c @@ -105,7 +105,7 @@ ACMD(do_hit) check_killer(ch, vict); } } - if (AFF_FLAGGED(ch, AFF_CHARM) && !IS_NPC(ch->master) && !IS_NPC(vict)) + if (AFF_FLAGGED(ch, AFF_CHARM) && ch->master && !IS_NPC(ch->master) && vict && !IS_NPC(vict)) return; /* you can't order a charmed pet to attack a * player */ } @@ -273,9 +273,11 @@ ACMD(do_flee) loss = GET_MAX_HIT(was_fighting) - GET_HIT(was_fighting); loss *= GET_LEVEL(was_fighting); gain_exp(ch, -loss); - stop_fighting(ch); - stop_fighting(was_fighting); - } + } + if (FIGHTING(ch)) + stop_fighting(ch); + if (was_fighting && ch == FIGHTING(was_fighting)) + stop_fighting(was_fighting); } else { act("$n tries to flee, but can't!", TRUE, ch, 0, 0, TO_ROOM); } diff --git a/src/alias.c b/src/alias.c deleted file mode 100644 index 5ce147a..0000000 --- a/src/alias.c +++ /dev/null @@ -1,191 +0,0 @@ -/************************************************************************* -* File: alias.c Part of tbaMUD * -* Usage: Writing/reading player's aliases. * -* * -* Copyright (C) 1993, 94 by the Trustees of the Johns Hopkins University * -* CircleMUD is based on DikuMUD, Copyright (C) 1990, 1991. * -* by Jeremy Hess, Chad Thompson, and George Greer * -**************************************************************************/ - -#include "conf.h" -#include "sysdep.h" -#include "structs.h" -#include "utils.h" -#include "interpreter.h" -#include "db.h" - -void write_aliases(struct char_data *ch); -void read_aliases(struct char_data *ch); -void delete_aliases(const char *charname); - -void write_aliases(struct char_data *ch) -{ - FILE *file; - char fn[MAX_STRING_LENGTH]; - struct alias_data *temp; - - get_filename(fn, sizeof(fn), ALIAS_FILE, GET_NAME(ch)); - remove(fn); - - if (GET_ALIASES(ch) == NULL) - return; - - if ((file = fopen(fn, "w")) == NULL) { - log("SYSERR: Couldn't save aliases for %s in '%s': %s", GET_NAME(ch), fn, strerror(errno)); - /* SYSERR_DESC: This error occurs when the server fails to open the relevant - * alias file for writing. The text at the end of the error should give a - * valid reason why. */ - return; - } - - for (temp = GET_ALIASES(ch); temp; temp = temp->next) { - int aliaslen = strlen(temp->alias); - int repllen = strlen(temp->replacement) - 1; - - fprintf(file, "%d\n%s\n" /* Alias */ - "%d\n%s\n" /* Replacement */ - "%d\n", /* Type */ - aliaslen, temp->alias, - repllen, temp->replacement + 1, - temp->type); - } - - fclose(file); -} - -void read_aliases(struct char_data *ch) -{ - FILE *file; - char xbuf[MAX_STRING_LENGTH]; - struct alias_data *t2, *prev = NULL; - int length; - - get_filename(xbuf, sizeof(xbuf), ALIAS_FILE, GET_NAME(ch)); - - if ((file = fopen(xbuf, "r")) == NULL) { - if (errno != ENOENT) { - log("SYSERR: Couldn't open alias file '%s' for %s: %s", xbuf, GET_NAME(ch), strerror(errno)); - /* SYSERR_DESC: This error occurs when the server fails to open the - * relevant alias file for reading. The text at the end version should - * give a valid reason why. */ - } - return; - } - - CREATE(GET_ALIASES(ch), struct alias_data, 1); - t2 = GET_ALIASES(ch); - - for (;;) { - /* Read the aliased command. */ - if (fscanf(file, "%d\n", &length) != 1) - goto read_alias_error; - - fgets(xbuf, length + 1, file); - t2->alias = strdup(xbuf); - - /* Build the replacement. */ - if (fscanf(file, "%d\n", &length) != 1) - goto read_alias_error; - - *xbuf = ' '; /* Doesn't need terminated, fgets() will. */ - fgets(xbuf + 1, length + 1, file); - t2->replacement = strdup(xbuf); - - /* Figure out the alias type. */ - if (fscanf(file, "%d\n", &length) != 1) - goto read_alias_error; - - t2->type = length; - - if (feof(file)) - break; - - CREATE(t2->next, struct alias_data, 1); - prev = t2; - t2 = t2->next; - }; - - fclose(file); - return; - -read_alias_error: - if (t2->alias) - free(t2->alias); - free(t2); - if (prev) - prev->next = NULL; - fclose(file); -} - -void delete_aliases(const char *charname) -{ - char filename[PATH_MAX]; - - if (!get_filename(filename, sizeof(filename), ALIAS_FILE, charname)) - return; - - if (remove(filename) < 0 && errno != ENOENT) - log("SYSERR: deleting alias file %s: %s", filename, strerror(errno)); - /* SYSERR_DESC: When an alias file cannot be removed, this error will occur, - * and the reason why will be the tail end of the error. */ -} - -/* until further notice, the alias->pfiles save and load functions will - * function along side the old seperate alias file load, for compatibility. */ -void write_aliases_ascii(FILE *file, struct char_data *ch) -{ - struct alias_data *temp; - int count = 0; - - if (GET_ALIASES(ch) == NULL) - return; - - for (temp = GET_ALIASES(ch); temp; temp = temp->next) - count++; - - fprintf(file, "Alis: %d\n", count); - /* the +1 thing below is due to alias replacements having a space prepended - * in memory. The reason for this escapes me. Welcor 27/12/06 */ - for (temp = GET_ALIASES(ch); temp; temp = temp->next) { - fprintf(file, "%s\n" /* Alias */ - "%s\n" /* Replacement */ - "%d\n", /* Type */ - temp->alias, - temp->replacement+1, - temp->type); - } -} - -void read_aliases_ascii(FILE *file, struct char_data *ch, int count) -{ - int i; - struct alias_data *temp; - char abuf[MAX_INPUT_LENGTH], rbuf[MAX_INPUT_LENGTH+1], tbuf[MAX_INPUT_LENGTH]; - - if (count == 0) { - GET_ALIASES(ch) = NULL; - return; /* No aliases in the list. */ - } - - for (i = 0; i < count; i++) { - /* Read the aliased command. */ - get_line(file, abuf); - - /* Read the replacement. */ - get_line(file, tbuf); - strcpy(rbuf, " "); - strcat(rbuf, tbuf); /* strcat: OK */ - - /* read the type */ - get_line(file, tbuf); - - if (abuf && *abuf && tbuf && *tbuf && rbuf && *rbuf) { - CREATE(temp, struct alias_data, 1); - temp->alias = strdup(abuf); - temp->replacement = strdup(rbuf); - temp->type = atoi(tbuf); - temp->next = GET_ALIASES(ch); - GET_ALIASES(ch) = temp; - } - } -} diff --git a/src/cedit.c b/src/cedit.c index c49932e..d8f8fea 100644 --- a/src/cedit.c +++ b/src/cedit.c @@ -102,6 +102,7 @@ void cedit_setup(struct descriptor_data *d) OLC_CONFIG(d)->play.load_into_inventory = CONFIG_LOAD_INVENTORY; OLC_CONFIG(d)->play.track_through_doors = CONFIG_TRACK_T_DOORS; OLC_CONFIG(d)->play.no_mort_to_immort = CONFIG_NO_MORT_TO_IMMORT; + OLC_CONFIG(d)->play.disp_closed_doors = CONFIG_DISP_CLOSED_DOORS; /* Crash Saves */ OLC_CONFIG(d)->csd.free_rent = CONFIG_FREE_RENT; @@ -194,6 +195,7 @@ void cedit_save_internally(struct descriptor_data *d) CONFIG_LOAD_INVENTORY = OLC_CONFIG(d)->play.load_into_inventory; CONFIG_TRACK_T_DOORS = OLC_CONFIG(d)->play.track_through_doors; CONFIG_NO_MORT_TO_IMMORT = OLC_CONFIG(d)->play.no_mort_to_immort; + CONFIG_DISP_CLOSED_DOORS = OLC_CONFIG(d)->play.disp_closed_doors; /* Crash Saves */ CONFIG_FREE_RENT = OLC_CONFIG(d)->csd.free_rent; @@ -350,6 +352,8 @@ int save_config( IDXTYPE nowhere ) "track_through_doors = %d\n\n", CONFIG_TRACK_T_DOORS); fprintf(fl, "* Should players who reach enough exp automatically level to immortal?\n" "no_mort_to_immort = %d\n\n", CONFIG_NO_MORT_TO_IMMORT); + fprintf(fl, "* Should closed doors be shown on autoexit / exit?\n" + "disp_closed_doors = %d\n\n", CONFIG_DISP_CLOSED_DOORS); strcpy(buf, CONFIG_OK); strip_cr(buf); @@ -568,8 +572,9 @@ void cedit_disp_game_play_options(struct descriptor_data *d) "%sM%s) Death Traps Junk Items : %s%s\r\n" "%sN%s) Objects Load Into Inventory : %s%s\r\n" "%sO%s) Track Through Doors : %s%s\r\n" - "%sP%s) Mortals Level To Immortal : %s%s\r\n" - "%s1%s) OK Message Text : %s%s" + "%sP%s) Display Closed Doors : %s%s\r\n" + "%sR%s) Mortals Level To Immortal : %s%s\r\n" + "%s1%s) OK Message Text : %s%s" "%s2%s) NOPERSON Message Text : %s%s" "%s3%s) NOEFFECT Message Text : %s%s" "%sQ%s) Exit To The Main Menu\r\n" @@ -590,7 +595,8 @@ void cedit_disp_game_play_options(struct descriptor_data *d) grn, nrm, cyn, CHECK_VAR(OLC_CONFIG(d)->play.dts_are_dumps), grn, nrm, cyn, CHECK_VAR(OLC_CONFIG(d)->play.load_into_inventory), grn, nrm, cyn, CHECK_VAR(OLC_CONFIG(d)->play.track_through_doors), - grn, nrm, cyn, CHECK_VAR(OLC_CONFIG(d)->play.no_mort_to_immort), + grn, nrm, cyn, CHECK_VAR(OLC_CONFIG(d)->play.disp_closed_doors), + grn, nrm, cyn, CHECK_VAR(OLC_CONFIG(d)->play.no_mort_to_immort), grn, nrm, cyn, OLC_CONFIG(d)->play.OK, grn, nrm, cyn, OLC_CONFIG(d)->play.NOPERSON, @@ -881,7 +887,12 @@ void cedit_parse(struct descriptor_data *d, char *arg) case 'p': case 'P': - TOGGLE_VAR(OLC_CONFIG(d)->play.no_mort_to_immort); + TOGGLE_VAR(OLC_CONFIG(d)->play.disp_closed_doors); + break; + + case 'r': + case 'R': + TOGGLE_VAR(OLC_CONFIG(d)->play.no_mort_to_immort); break; case '1': diff --git a/src/config.c b/src/config.c index b75129b..81ef368 100644 --- a/src/config.c +++ b/src/config.c @@ -298,3 +298,7 @@ int use_autowiz = YES; /* If yes, what is the lowest level which should be on the wizlist? (All immort * levels below the level you specify will go on the immlist instead.) */ int min_wizlist_lev = LVL_GOD; + +/* To mimic stack behavior set to NO. To allow mortals to see doors in exits + * set to YES. */ +int display_closed_doors = YES; diff --git a/src/db.c b/src/db.c index b7a5598..201e4ee 100644 --- a/src/db.c +++ b/src/db.c @@ -169,6 +169,7 @@ extern int bitsavetodisk; extern struct player_index_element *player_table; extern int top_of_p_table; extern long top_idnum; +extern int display_closed_doors; /* external ASCII Player Files vars */ extern int auto_pwipe; @@ -3364,6 +3365,7 @@ void load_default_config( void ) CONFIG_NOEFFECT = strdup(NOEFFECT); CONFIG_TRACK_T_DOORS = track_through_doors; CONFIG_NO_MORT_TO_IMMORT = no_mort_to_immort; + CONFIG_DISP_CLOSED_DOORS = display_closed_doors; /* Rent / crashsave options. */ CONFIG_FREE_RENT = free_rent; @@ -3451,7 +3453,9 @@ void load_config( void ) break; case 'd': - if (!str_cmp(tag, "dts_are_dumps")) + if (!str_cmp(tag, "display_closed_doors")) + CONFIG_DISP_CLOSED_DOORS = num; + else if (!str_cmp(tag, "dts_are_dumps")) CONFIG_DTS_ARE_DUMPS = num; else if (!str_cmp(tag, "donation_room_1")) if (num == -1) diff --git a/src/db.h b/src/db.h index 15eabb6..eccfc07 100644 --- a/src/db.h +++ b/src/db.h @@ -26,7 +26,6 @@ #define LIB_PLRTEXT ":plrtext:" #define LIB_PLROBJS ":plrobjs:" #define LIB_PLRVARS ":plrvars:" -#define LIB_PLRALIAS ":plralias:" #define LIB_PLRFILES ":plrfiles:" #define LIB_HOUSE ":house:" #define SLASH ":" @@ -39,7 +38,6 @@ #define LIB_PLRTEXT "plrtext/" #define LIB_PLROBJS "plrobjs/" #define LIB_PLRVARS "plrvars/" -#define LIB_PLRALIAS "plralias/" #define LIB_HOUSE "house/" #define LIB_PLRFILES "plrfiles/" #define SLASH "/" @@ -49,7 +47,6 @@ #define SUF_OBJS "objs" #define SUF_TEXT "text" -#define SUF_ALIAS "alias" #define SUF_MEM "mem" #define SUF_PLR "plr" diff --git a/src/dg_olc.c b/src/dg_olc.c index cdde501..081c95c 100644 --- a/src/dg_olc.c +++ b/src/dg_olc.c @@ -96,6 +96,7 @@ ACMD(do_oasis_trigedit) else trigedit_setup_existing(d, real_num); + trigedit_disp_menu(d); STATE(d) = CON_TRIGEDIT; act("$n starts using OLC.", TRUE, d->character, 0, 0, TO_ROOM); @@ -150,8 +151,6 @@ void trigedit_setup_new(struct descriptor_data *d) OLC_TRIG(d) = trig; OLC_VAL(d) = 0; /* Has changed flag. (It hasn't so far, we just made it.) */ - - trigedit_disp_menu(d); } void trigedit_setup_existing(struct descriptor_data *d, int rtrg_num) @@ -179,8 +178,6 @@ void trigedit_setup_existing(struct descriptor_data *d, int rtrg_num) OLC_TRIG(d) = trig; OLC_VAL(d) = 0; /* Has changed flag. (It hasn't so far, we just made it.) */ - - trigedit_disp_menu(d); } void trigedit_disp_menu(struct descriptor_data *d) diff --git a/src/dg_scripts.c b/src/dg_scripts.c index 2850c0f..9ba1e12 100644 --- a/src/dg_scripts.c +++ b/src/dg_scripts.c @@ -2984,3 +2984,17 @@ void remove_from_lookup_table(long uid) log("remove_from_lookup. UID %ld not found.", uid); } + +bool check_flags_by_name_ar(int *array, int numflags, char *search, const char *namelist[]) +{ + int i, item=-1; + + for (i=0; icontains) ? "1" : "0")); else *str = '\0'; } + else if (!str_cmp(field, "zonenumber")) + snprintf(str, slen, "%d", zone_table[r->zone].number); + else if (!str_cmp(field, "zonename")) + snprintf(str, slen, "%s", zone_table[r->zone].name); + else if (!str_cmp(field, "roomflag")) { + if (subfield && *subfield) { + room_rnum thisroom = real_room(r->number); + if (check_flags_by_name_ar(ROOM_FLAGS(thisroom), NUM_ROOM_FLAGS, subfield, room_bits) == TRUE) + snprintf(str, slen, "1"); + else + snprintf(str, slen, "0"); + } else + snprintf(str, slen, "0"); + } else if (!str_cmp(field, "north")) { if (R_EXIT(r, NORTH)) { if (subfield && *subfield) { diff --git a/src/genwld.c b/src/genwld.c index 883a9c3..a45ea3f 100644 --- a/src/genwld.c +++ b/src/genwld.c @@ -382,41 +382,6 @@ int copy_room(struct room_data *to, struct room_data *from) return TRUE; } -/* Idea by Cris Jacob. */ -room_rnum duplicate_room(room_vnum dest_vnum, room_rnum orig) -{ - int new_rnum, znum; - struct room_data nroom; - -#if CIRCLE_UNSIGNED_INDEX - if (orig == NOWHERE || orig > top_of_world) { -#else - if (orig < 0 || orig > top_of_world) { -#endif - log("SYSERR: GenOLC: copy_room: Given bad original real room."); - return NOWHERE; - } else if ((znum = real_zone_by_thing(dest_vnum)) == NOWHERE) { - log("SYSERR: GenOLC: copy_room: No such destination zone."); - return NOWHERE; - } - - /* add_room will make its own copies of strings. */ - if ((new_rnum = add_room(&nroom)) == NOWHERE) { - log("SYSERR: GenOLC: copy_room: Problem adding room."); - return NOWHERE; - } - - nroom = world[new_rnum]; - nroom.number = dest_vnum; - nroom.zone = znum; - - /* So the people and objects aren't in two places at once. */ - nroom.contents = NULL; - nroom.people = NULL; - - return new_rnum; -} - /* Copy strings over so bad things don't happen. We do not free the existing * strings here because copy_room() did a shallow copy previously and we'd be * freeing the very strings we're copying. If this function is used elsewhere, diff --git a/src/interpreter.c b/src/interpreter.c index aeddb22..0ab4a33 100644 --- a/src/interpreter.c +++ b/src/interpreter.c @@ -49,8 +49,6 @@ int parse_class(char arg); int special(struct char_data *ch, int cmd, char *arg); int isbanned(char *hostname); int valid_name(char *newname); -void read_aliases(struct char_data *ch); -void delete_aliases(const char *charname); void remove_player(int pfilepos); /* local functions */ @@ -62,7 +60,6 @@ int perform_alias(struct descriptor_data *d, char *orig, size_t maxlen); int reserved_word(char *argument); int _parse_name(char *arg, char *name); int enter_player_game (struct descriptor_data *d); -void write_aliases(struct char_data *ch); /* prototypes for all do_x functions. */ ACMD(do_action); @@ -157,6 +154,7 @@ ACMD(do_mtransform); ACMD(do_mzoneecho); ACMD(do_mrecho); ACMD(do_not_here); +ACMD(do_oasis_copy); ACMD(do_order); ACMD(do_page); ACMD(do_peace); @@ -175,7 +173,6 @@ ACMD(do_rescue); ACMD(do_rest); ACMD(do_restore); ACMD(do_return); -ACMD(do_room_copy); ACMD(do_save); ACMD(do_saveall); ACMD(do_say); @@ -366,6 +363,7 @@ cpp_extern const struct command_info cmd_info[] = { { "mail" , "mail" , POS_STANDING, do_not_here , 1, 0 }, { "medit" , "med" , POS_DEAD , do_oasis_medit, LVL_BUILDER, 0 }, { "mlist" , "mlist" , POS_DEAD , do_oasis_list , LVL_BUILDER, SCMD_OASIS_MLIST }, + { "mcopy" , "mcopy" , POS_DEAD , do_oasis_copy, LVL_GOD, CON_MEDIT }, { "mute" , "mute" , POS_DEAD , do_wizutil , LVL_GOD, SCMD_MUTE }, { "news" , "news" , POS_SLEEPING, do_gen_ps , 0, SCMD_NEWS }, @@ -386,6 +384,7 @@ cpp_extern const struct command_info cmd_info[] = { { "olc" , "olc" , POS_DEAD , do_show_save_list, LVL_BUILDER, 0 }, { "olist" , "olist" , POS_DEAD , do_oasis_list, LVL_BUILDER, SCMD_OASIS_OLIST }, { "oedit" , "oedit" , POS_DEAD , do_oasis_oedit, LVL_BUILDER, 0 }, + { "ocopy" , "ocopy" , POS_DEAD , do_oasis_copy, LVL_GOD, CON_OEDIT }, { "put" , "p" , POS_RESTING , do_put , 0, 0 }, { "peace" , "pe" , POS_DEAD , do_peace , LVL_BUILDER, 0 }, @@ -421,11 +420,12 @@ cpp_extern const struct command_info cmd_info[] = { { "return" , "retu" , POS_DEAD , do_return , 0, 0 }, { "redit" , "redit" , POS_DEAD , do_oasis_redit, LVL_BUILDER, 0 }, { "rlist" , "rlist" , POS_DEAD , do_oasis_list, LVL_BUILDER, SCMD_OASIS_RLIST }, - { "rclone" , "rclone" , POS_DEAD , do_room_copy, LVL_BUILDER, 0 }, + { "rcopy" , "rcopy" , POS_DEAD , do_oasis_copy, LVL_GOD, CON_REDIT }, { "roomflags", "roomflags", POS_DEAD , do_gen_tog , LVL_IMMORT, SCMD_SHOWVNUMS }, { "say" , "s" , POS_RESTING , do_say , 0, 0 }, { "score" , "sc" , POS_DEAD , do_score , 0, 0 }, + { "scopy" , "scopy" , POS_DEAD , do_oasis_copy, LVL_GOD, CON_SEDIT }, { "sit" , "si" , POS_RESTING , do_sit , 0, 0 }, { "'" , "'" , POS_RESTING , do_say , 0, 0 }, { "save" , "sav" , POS_SLEEPING, do_save , 0, 0 }, @@ -465,6 +465,7 @@ cpp_extern const struct command_info cmd_info[] = { { "trigedit" , "trigedit", POS_DEAD , do_oasis_trigedit, LVL_BUILDER, 0 }, { "typo" , "typo" , POS_DEAD , do_gen_write, 0, SCMD_TYPO }, { "tlist" , "tlist" , POS_DEAD , do_oasis_list, LVL_BUILDER, SCMD_OASIS_TLIST }, + { "tcopy" , "tcopy" , POS_DEAD , do_oasis_copy, LVL_GOD, CON_TRIGEDIT }, { "tstat" , "tstat" , POS_DEAD , do_tstat , LVL_BUILDER, 0 }, { "unlock" , "unlock" , POS_SITTING , do_gen_door , 0, SCMD_UNLOCK }, @@ -1250,19 +1251,10 @@ int perform_dupe_check(struct descriptor_data *d) /* load the player, put them in the right room - used by copyover_recover too */ int enter_player_game (struct descriptor_data *d) { - int load_result; room_vnum load_room; reset_char(d->character); - /* See if there might be some aliases in the old alias file. Only do this - * if there were no aliases in the pfile. */ - if (GET_ALIASES(d->character) == NULL) - { - read_aliases(d->character); - /* delete the old file - player will be saved in a second. */ - delete_aliases(GET_NAME(d->character)); - } if (PLR_FLAGGED(d->character, PLR_INVSTART)) GET_INVIS_LEV(d->character) = GET_LEVEL(d->character); @@ -1731,7 +1723,6 @@ void nanny(struct descriptor_data *d, char *arg) remove_player(player_i); } - delete_aliases(GET_NAME(d->character)); delete_variables(GET_NAME(d->character)); write_to_output(d, "Character '%s' deleted! Goodbye.\r\n", GET_NAME(d->character)); mudlog(NRM, LVL_GOD, TRUE, "%s (lev %d) has self-deleted.", GET_NAME(d->character), GET_LEVEL(d->character)); diff --git a/src/medit.c b/src/medit.c index de1f2bf..9fb5bba 100644 --- a/src/medit.c +++ b/src/medit.c @@ -155,6 +155,7 @@ ACMD(do_oasis_medit) else medit_setup_existing(d, real_num); + medit_disp_menu(d); STATE(d) = CON_MEDIT; /* Display the OLC messages to the players in the same room as the @@ -193,8 +194,6 @@ void medit_setup_new(struct descriptor_data *d) /* Has changed flag. (It hasn't so far, we just made it.) */ OLC_VAL(d) = FALSE; OLC_ITEM_TYPE(d) = MOB_TRIGGER; - - medit_disp_menu(d); } void medit_setup_existing(struct descriptor_data *d, int rmob_num) @@ -215,8 +214,6 @@ void medit_setup_existing(struct descriptor_data *d, int rmob_num) */ SCRIPT(mob) = NULL; OLC_MOB(d)->proto_script = NULL; - - medit_disp_menu(d); } /* Ideally, this function should be in db.c, but I'll put it here for portability. */ @@ -787,8 +784,8 @@ void medit_parse(struct descriptor_data *d, char *arg) return; } else write_to_output(d, "Please answer 'Y' or 'N': "); - break; - + break; + default: /* We should never get here. */ cleanup_olc(d, CLEANUP_ALL); @@ -814,4 +811,3 @@ void medit_string_cleanup(struct descriptor_data *d, int terminator) break; } } - diff --git a/src/oasis_copy.c b/src/oasis_copy.c index 449f530..78b74cd 100644 --- a/src/oasis_copy.c +++ b/src/oasis_copy.c @@ -14,19 +14,153 @@ #include "interpreter.h" #include "handler.h" #include "db.h" +#include "shop.h" +#include "genshp.h" #include "genolc.h" #include "genzon.h" #include "genwld.h" #include "oasis.h" #include "improved-edit.h" #include "constants.h" +#include "dg_scripts.h" /* Internal Functions */ ACMD(do_dig); -ACMD(do_room_copy); room_vnum redit_find_new_vnum(zone_rnum zone); int buildwalk(struct char_data *ch, int dir); +/* External Functions */ +void trigedit_save(struct descriptor_data *d); +void redit_save_internally(struct descriptor_data *d); +void oedit_save_internally(struct descriptor_data *d); +void medit_save_internally(struct descriptor_data *d); +void sedit_save_internally(struct descriptor_data *d); +void trigedit_setup_existing(struct descriptor_data *d, int rnum); +void redit_setup_existing(struct descriptor_data *d, int rnum); +void oedit_setup_existing(struct descriptor_data *d, int rnum); +void medit_setup_existing(struct descriptor_data *d, int rnum); +void sedit_setup_existing(struct descriptor_data *d, int rnum); + + +/*********************************************************** +* This function makes use of the high level OLC functions * +* to copy most types of mud objects. The type of data is * +* determined by the subcmd variable and the functions are * +* looked up in a table. * +***********************************************************/ +ACMD(do_oasis_copy) +{ + int i, src_vnum, src_rnum, dst_vnum, dst_rnum; + char buf1[MAX_INPUT_LENGTH]; + char buf2[MAX_INPUT_LENGTH]; + struct descriptor_data *d; + + struct { + int con_type; + IDXTYPE (*binary_search)(IDXTYPE vnum); + void (*save_func)(struct descriptor_data *d); + void (*setup_existing)(struct descriptor_data *d, int rnum); + const char *command; + const char *text; + } oasis_copy_info[] = { + { CON_REDIT, real_room, redit_save_internally, redit_setup_existing, "rcopy", "room" }, + { CON_OEDIT, real_object, oedit_save_internally, oedit_setup_existing, "ocopy", "object" }, + { CON_MEDIT, real_mobile, medit_save_internally, medit_setup_existing, "mcopy", "mobile" }, + { CON_SEDIT, real_shop, sedit_save_internally, sedit_setup_existing, "scopy", "shop" }, + { CON_TRIGEDIT, real_trigger, trigedit_save, trigedit_setup_existing, "tcopy", "trigger" }, + { -1, NULL, NULL, NULL, "\n", "\n" } + }; + + /* Find the given connection type in the table (passed in subcmd). */ + for (i = 0; *(oasis_copy_info[i].text) != '\n'; i++) + if (subcmd == oasis_copy_info[i].con_type) + break; + /* If not found, we don't support copying that type of data. */ + if (*(oasis_copy_info[i].text) == '\n') + return; + + /* No copying as a mob or while being forced. */ + if (IS_NPC(ch) || !ch->desc || STATE(ch->desc) != CON_PLAYING) + return; + + /* We need two arguments. */ + two_arguments(argument, buf1, buf2); + + /* Both arguments are required and they must be numeric. */ + if (!*buf2 || !is_number(buf1) || !is_number(buf2)) { + send_to_char(ch, "Syntax: %s \r\n", oasis_copy_info[i].command); + return; + } + + /* We can't copy non-existing data. */ + /* Note: the source data can be in any zone. It's not restricted */ + /* to the builder's designated OLC zone. */ + src_vnum = atoi(buf1); + src_rnum = (*oasis_copy_info[i].binary_search)(src_vnum); + if (src_rnum == NOWHERE) { + send_to_char(ch, "The source %s (#%d) does not exist.\r\n", oasis_copy_info[i].text, src_vnum); + return; + } + + /* Don't copy if the target already exists. */ + dst_vnum = atoi(buf2); + dst_rnum = (*oasis_copy_info[i].binary_search)(dst_vnum); + if (dst_rnum != NOWHERE) { + send_to_char(ch, "The target %s (#%d) already exists.\r\n", oasis_copy_info[i].text, dst_vnum); + return; + } + + /* Check that whatever it is isn't already being edited. */ + for (d = descriptor_list; d; d = d->next) { + if (STATE(d) == subcmd) { + if (d->olc && OLC_NUM(d) == dst_vnum) { + send_to_char(ch, "The target %s (#%d) is currently being edited by %s.\r\n", + oasis_copy_info[i].text, dst_vnum, GET_NAME(d->character)); + return; + } + } + } + + d = ch->desc; + + /* Give the descriptor an OLC structure. */ + if (d->olc) { + mudlog(BRF, LVL_IMMORT, TRUE, "SYSERR: do_oasis_copy: Player already had olc structure."); + free(d->olc); + } + + /* Create the OLC structure. */ + CREATE(d->olc, struct oasis_olc_data, 1); + + /* Find the zone. */ + if ((OLC_ZNUM(d) = real_zone_by_thing(dst_vnum)) == NOWHERE) { + send_to_char(ch, "Sorry, there is no zone for the given vnum (#%d)!\r\n", dst_vnum); + free(d->olc); + d->olc = NULL; + return; + } + + /* Make sure the builder is allowed to modify the target zone. */ + if (!can_edit_zone(ch, OLC_ZNUM(d))) { + send_cannot_edit(ch, zone_table[OLC_ZNUM(d)].number); + free(d->olc); + d->olc = NULL; + return; + } + + /* We tell the OLC functions that we want to save to the target vnum. */ + OLC_NUM(d) = dst_vnum; + + /* Perform the copy. */ + send_to_char(ch, "Copying %s: source: #%d, dest: #%d.\r\n", oasis_copy_info[i].text, src_vnum, dst_vnum); + (*oasis_copy_info[i].setup_existing)(d, src_rnum); + (*oasis_copy_info[i].save_func)(d); + + /* Currently CLEANUP_ALL should be used for everything. */ + cleanup_olc(d, CLEANUP_ALL); + send_to_char(ch, "Done.\r\n"); +} + /* Commands */ ACMD(do_dig) { @@ -138,7 +272,7 @@ ACMD(do_dig) OLC_VAL(d) = 0; send_to_char(ch, "New room (%d) created.\r\n", rvnum); - cleanup_olc(d, CLEANUP_STRUCTS); + cleanup_olc(d, CLEANUP_ALL); /* Update rrnum to the correct room rnum after adding the room. */ rrnum = real_room(rvnum); } @@ -166,111 +300,6 @@ ACMD(do_dig) } } -ACMD(do_room_copy) -{ - struct room_data *room_src, *room_dst; - int room_num, j, buf_num, taeller; - zone_rnum dst_zone; - struct descriptor_data *dsc; - char buf[MAX_INPUT_LENGTH]; - - one_argument(argument, buf); - - if (!*buf) { - send_to_char(ch, "Usage: rclone \r\n"); - return; - } - - if (real_room((buf_num = atoi(buf))) != NOWHERE) { - send_to_char(ch, "That room already exist!\r\n"); - return; - } - - if ((dst_zone = real_zone_by_thing(buf_num)) == NOWHERE) { - send_to_char(ch, "Sorry, there is no zone for that number!\r\n"); - return; - } - - if (!can_edit_zone(ch, dst_zone) || - !can_edit_zone(ch, world[IN_ROOM(ch)].zone) ) { - send_to_char(ch, "You may only copy rooms within your designated zone(s)!\r\n"); - return; - } - - - room_src = &world[IN_ROOM(ch)]; - CREATE(room_dst, struct room_data, 1); - - room_dst->zone = dst_zone; - - /* Allocate space for all strings. */ - send_to_char(ch, "Cloning room....\r\n"); - - room_dst->name = str_udup(world[IN_ROOM(ch)].name); - room_dst->description = str_udup(world[IN_ROOM(ch)].description); - room_dst->description = str_udup(world[IN_ROOM(ch)].description); - room_dst->number = buf_num; - room_dst->sector_type = world[IN_ROOM(ch)].sector_type; - for(taeller=0; taeller < RF_ARRAY_MAX; taeller++) - room_dst->room_flags[taeller] = ROOM_FLAGS(IN_ROOM(ch))[taeller]; - - /* Extra descriptions, if necessary. */ - send_to_char(ch, "Cloning extra descriptions....\r\n"); - if (world[IN_ROOM(ch)].ex_description) { - struct extra_descr_data *tdesc, *temp, *temp2; - CREATE(temp, struct extra_descr_data, 1); - - room_dst->ex_description = temp; - for (tdesc = world[IN_ROOM(ch)].ex_description; tdesc; tdesc = tdesc->next) { - temp->keyword = strdup(tdesc->keyword); - temp->description = strdup(tdesc->description); - if (tdesc->next) { - CREATE(temp2, struct extra_descr_data, 1); - temp->next = temp2; - temp = temp2; - } else - temp->next = NULL; - } - } - /* Now save the room in the right place. */ - send_to_char(ch, "Saving new room...\r\n"); - - if ((room_num = add_room(room_dst)) == NOWHERE) { - send_to_char(ch, "Something went wrong...\r\n"); - log("SYSERR: do_room_copy: Something failed! (%d)", room_num); - return; - } - /* Idea contributed by C.Raehl. */ - for (dsc = descriptor_list; dsc; dsc = dsc->next) { - if (dsc == ch->desc) - continue; - - if (STATE(dsc) == CON_ZEDIT) { - for (j = 0; OLC_ZONE(dsc)->cmd[j].command != 'S'; j++) - switch (OLC_ZONE(dsc)->cmd[j].command) { - case 'O': - case 'M': - OLC_ZONE(dsc)->cmd[j].arg3 += (OLC_ZONE(dsc)->cmd[j].arg3 >= room_num); - break; - case 'D': - OLC_ZONE(dsc)->cmd[j].arg2 += (OLC_ZONE(dsc)->cmd[j].arg2 >= room_num); - /* Fall through */ - case 'R': - OLC_ZONE(dsc)->cmd[j].arg1 += (OLC_ZONE(dsc)->cmd[j].arg1 >= room_num); - break; - } - } else if (STATE(dsc) == CON_REDIT) { - for (j = 0; j < NUM_OF_DIRS; j++) - if (OLC_ROOM(dsc)->dir_option[j]) - if (OLC_ROOM(dsc)->dir_option[j]->to_room >= room_num) - OLC_ROOM(dsc)->dir_option[j]->to_room++; - } - } - add_to_save_list(real_zone_by_thing(atoi(buf)), SL_WLD); - redit_save_to_disk(real_zone_by_thing(atoi(buf))); - send_to_char(ch, "Room cloned to %d.\r\nAll Done.\r\n", buf_num); -} - /* BuildWalk - OasisOLC Extension by D. Tyler Barnes. */ /* For buildwalk. Finds the next free vnum in the zone */ room_vnum redit_find_new_vnum(zone_rnum zone) diff --git a/src/oedit.c b/src/oedit.c index bfd3946..8b18560 100644 --- a/src/oedit.c +++ b/src/oedit.c @@ -170,6 +170,7 @@ ACMD(do_oasis_oedit) else oedit_setup_new(d); + oedit_disp_menu(d); STATE(d) = CON_OEDIT; /* Send the OLC message to the players in the same room as the builder. */ @@ -195,8 +196,6 @@ void oedit_setup_new(struct descriptor_data *d) SCRIPT(OLC_OBJ(d)) = NULL; OLC_OBJ(d)->proto_script = OLC_SCRIPT(d) = NULL; - - oedit_disp_menu(d); } void oedit_setup_existing(struct descriptor_data *d, int real_num) @@ -216,8 +215,6 @@ void oedit_setup_existing(struct descriptor_data *d, int real_num) * obj later, after editing. */ SCRIPT(obj) = NULL; OLC_OBJ(d)->proto_script = NULL; - - oedit_disp_menu(d); } void oedit_save_internally(struct descriptor_data *d) diff --git a/src/players.c b/src/players.c index 1718958..5fbd9b9 100644 --- a/src/players.c +++ b/src/players.c @@ -31,12 +31,12 @@ void tag_argument(char *argument, char *tag); void load_affects(FILE *fl, struct char_data *ch); void load_skills(FILE *fl, struct char_data *ch); void load_HMVS(struct char_data *ch, const char *line, int mode); +void write_aliases_ascii(FILE *file, struct char_data *ch); +void read_aliases_ascii(FILE *file, struct char_data *ch, int count); /* external fuctions */ bitvector_t asciiflag_conv(char *flag); void save_char_vars(struct char_data *ch); -void write_aliases_ascii(FILE *file, struct char_data *ch); -void read_aliases_ascii(FILE *file, struct char_data *ch, int count); void save_char_vars_ascii(FILE *file, struct char_data *ch); void read_saved_vars_ascii(FILE *file, struct char_data *ch, int count); void strip_cr(char *buffer); @@ -100,7 +100,6 @@ int create_entry(char *name) int i, pos; if (top_of_p_table == -1) { /* no table */ - CREATE(player_table, struct player_index_element, 1); pos = top_of_p_table = 0; } else if ((pos = get_ptable_by_name(name)) == -1) { /* new name */ i = ++top_of_p_table + 1; @@ -813,3 +812,63 @@ void load_HMVS(struct char_data *ch, const char *line, int mode) break; } } + +/* until further notice, the alias->pfiles save and load functions will + * * function along side the old seperate alias file load, for compatibility. */ +void write_aliases_ascii(FILE *file, struct char_data *ch) +{ + struct alias_data *temp; + int count = 0; + + if (GET_ALIASES(ch) == NULL) + return; + + for (temp = GET_ALIASES(ch); temp; temp = temp->next) + count++; + + fprintf(file, "Alis: %d\n", count); + /* the +1 thing below is due to alias replacements having a space prepended + * * in memory. The reason for this escapes me. Welcor 27/12/06 */ + for (temp = GET_ALIASES(ch); temp; temp = temp->next) { + fprintf(file, "%s\n" /* Alias */ + "%s\n" /* Replacement */ + "%d\n", /* Type */ + temp->alias, + temp->replacement+1, + temp->type); + } +} + +void read_aliases_ascii(FILE *file, struct char_data *ch, int count) +{ + int i; + struct alias_data *temp; + char abuf[MAX_INPUT_LENGTH], rbuf[MAX_INPUT_LENGTH+1], tbuf[MAX_INPUT_LENGTH]; + + if (count == 0) { + GET_ALIASES(ch) = NULL; + return; /* No aliases in the list. */ + } + + for (i = 0; i < count; i++) { + /* Read the aliased command. */ + get_line(file, abuf); + + /* Read the replacement. */ + get_line(file, tbuf); + strcpy(rbuf, " "); + strcat(rbuf, tbuf); /* strcat: OK */ + + /* read the type */ + get_line(file, tbuf); + + if (abuf && *abuf && tbuf && *tbuf && rbuf && *rbuf) { + CREATE(temp, struct alias_data, 1); + temp->alias = strdup(abuf); + temp->replacement = strdup(rbuf); + temp->type = atoi(tbuf); + temp->next = GET_ALIASES(ch); + GET_ALIASES(ch) = temp; + } + } + } diff --git a/src/redit.c b/src/redit.c index aea2b24..fd28450 100644 --- a/src/redit.c +++ b/src/redit.c @@ -139,6 +139,7 @@ ACMD(do_oasis_redit) else redit_setup_new(d); + redit_disp_menu(d); STATE(d) = CON_REDIT; act("$n starts using OLC.", TRUE, d->character, 0, 0, TO_ROOM); SET_BIT_AR(PLR_FLAGS(ch), PLR_WRITING); @@ -157,7 +158,6 @@ void redit_setup_new(struct descriptor_data *d) OLC_ITEM_TYPE(d) = WLD_TRIGGER; OLC_ROOM(d)->proto_script = OLC_SCRIPT(d) = NULL; - redit_disp_menu(d); OLC_VAL(d) = 0; } @@ -215,8 +215,6 @@ void redit_setup_existing(struct descriptor_data *d, int real_num) dg_olc_script_copy(d); room->proto_script = NULL; SCRIPT(room) = NULL; - - redit_disp_menu(d); } void redit_save_internally(struct descriptor_data *d) @@ -224,10 +222,10 @@ void redit_save_internally(struct descriptor_data *d) int j, room_num, new_room = FALSE; struct descriptor_data *dsc; - if (OLC_ROOM(d)->number == NOWHERE) { + if (OLC_ROOM(d)->number == NOWHERE) new_room = TRUE; - OLC_ROOM(d)->number = OLC_NUM(d); - } + + OLC_ROOM(d)->number = OLC_NUM(d); /* FIXME: Why is this not set elsewhere? */ OLC_ROOM(d)->zone = OLC_ZNUM(d); diff --git a/src/sedit.c b/src/sedit.c index 5feb3c4..7beed20 100644 --- a/src/sedit.c +++ b/src/sedit.c @@ -164,6 +164,7 @@ ACMD(do_oasis_sedit) else sedit_setup_new(d); + sedit_disp_menu(d); STATE(d) = CON_SEDIT; act("$n starts using OLC.", TRUE, d->character, 0, 0, TO_ROOM); @@ -206,7 +207,6 @@ void sedit_setup_new(struct descriptor_data *d) /* Presto! A shop. */ OLC_SHOP(d) = shop; - sedit_disp_menu(d); } void sedit_setup_existing(struct descriptor_data *d, int rshop_num) @@ -216,7 +216,6 @@ void sedit_setup_existing(struct descriptor_data *d, int rshop_num) /* don't waste time trying to free NULL strings -- Welcor */ copy_shop(OLC_SHOP(d), shop_index + rshop_num, FALSE); - sedit_disp_menu(d); } /* Menu functions */ diff --git a/src/structs.h b/src/structs.h index e7803fd..429e113 100644 --- a/src/structs.h +++ b/src/structs.h @@ -1047,6 +1047,7 @@ struct game_data { int load_into_inventory;/* Objects load in immortals inventory. */ int track_through_doors;/* Track through doors while closed? */ int no_mort_to_immort; /* Prevent mortals leveling to imms? */ + int disp_closed_doors; /* Display closed doors in autoexit? */ char *OK; /* When player receives 'Okay.' text. */ char *NOPERSON; /* 'No one by that name here.' */ diff --git a/src/utils.c b/src/utils.c index 6b92d6e..ddc4c05 100644 --- a/src/utils.c +++ b/src/utils.c @@ -526,10 +526,6 @@ int get_filename(char *filename, size_t fbufsize, int mode, const char *orig_nam prefix = LIB_PLROBJS; suffix = SUF_OBJS; break; - case ALIAS_FILE: - prefix = LIB_PLRALIAS; - suffix = SUF_ALIAS; - break; case ETEXT_FILE: prefix = LIB_PLRTEXT; suffix = SUF_TEXT; diff --git a/src/utils.h b/src/utils.h index 2140f0b..235b7dc 100644 --- a/src/utils.h +++ b/src/utils.h @@ -108,10 +108,9 @@ void char_from_furniture(struct char_data *ch); /* get_filename() */ #define CRASH_FILE 0 #define ETEXT_FILE 1 -#define ALIAS_FILE 2 -#define SCRIPT_VARS_FILE 3 -#define PLR_FILE 4 -#define MAX_FILES 5 +#define SCRIPT_VARS_FILE 2 +#define PLR_FILE 3 +#define MAX_FILES 4 /* breadth-first searching */ #define BFS_ERROR (-1) @@ -548,6 +547,7 @@ void char_from_furniture(struct char_data *ch); #define CONFIG_OK config_info.play.OK #define CONFIG_NOPERSON config_info.play.NOPERSON #define CONFIG_NOEFFECT config_info.play.NOEFFECT +#define CONFIG_DISP_CLOSED_DOORS config_info.play.disp_closed_doors /* Crash Saves */ #define CONFIG_FREE_RENT config_info.csd.free_rent