Date sent: Wed, 16 Jul 1997 18:41:53 -0200 To: "Liner/Nosferatu" From: Rick Rogers (by way of Rick Rogers ) Subject: RCL: (Ronin Coder List) Introduction/Automatic Commands/Player Commands Introduction ------------ Ok all, here we go. First I'm assuming everyone has some fundamental knowledge of the C programming language. It isn't my intention to teach C. Actually even if you don't know C very well, you'll pick the basics up fairly quickly from example. Automatic Commands ------------------ In order to code specs, you need to have an understanding of how the main code works and how it signals players and mobs. Everything is command driven. By a command I don't mean only what a player types. The code sends itself commands automatically. We write specs to do something if a certain command is seen. Its easiest to just list these automated commands and explain them as I go. You might see gaps in the numbers, thats so I don't confuse you with unnecessary stuff. :P MSG_LEAVE -9 MSG_ENTER -8 These two commands are sent to a room and to the characters in that room whenever a mob or character enters or leaves that room. For example we could use this to trigger a mob attacking a player as soon as that player comes in the room. MSG_BEING_REMOVED -7 This is a message that is sent to an object a player is trying to remove. Currently the only spec that uses this is the TZ dagger. Most other specs like the Unholy Symbol just block the main remove command. - More on that later. MSG_TICK -3 This is the first of the truely automatic commands. Every minute (60 seconds) the code sends MSG_TICK to every loaded zone. From each zone, the tick is sent to every room in that zone. From the room, its send to every mob/player/item in the room. >From the mob/player, its sent to every piece of equipment the player has equipped or in inventory (but not to stuff in containers). The sleeves of healing spec uses the TICK command for its flash. MSG_DIE -1 This one is pretty self explanatory. When a mob/PC dies, this message is sent to all equipment that character has in inventory or equipped. The bone shield uses this command to block death and rescue the player. MSG_MOBACT 0 This is perhaps the most important automatic command for use in specs. It is very similar to MSG_TICK in that its sent to all zones - rooms - characters/items - objects. The only difference is that its sent every 10 seconds instead of every 60. This command is used to control virtually all of the damage specs that exist. Player Commands --------------- The following commands require input from a player. When a player types a certain command, that command is sent to the current room, then sent to all players/mobs in the room and to all the items those players/mobs have equipped or in direct inv. Finally the command is sent to all items in the room. The commands are very self explanatory so for the most part I'll just list them. I've left many out since they are unimpt for specs. CMD_NORTH 1 CMD_EAST 2 CMD_SOUTH 3 CMD_WEST 4 CMD_UP 5 CMD_DOWN 6 CMD_ENTER 7 CMD_EXITS 8 CMD_NOKILL 9 CMD_GET 10 CMD_DRINK 11 CMD_EAT 12 CMD_WEAR 13 CMD_WIELD 14 CMD_LOOK 15 CMD_SCORE 16 CMD_SAY 17 CMD_SHOUT 18 CMD_TELL 19 CMD_INVENTORY 20 CMD_PUMMEL 22 CMD_INSULT 23 CMD_CIRCLE 24 CMD_KILL 25 CMD_FIREBREATH 26 CMD_WHISPER 34 CMD_LEAVE 35 CMD_WRITE 36 CMD_INFO 37 CMD_HELP 38 CMD_WHO 39 CMD_EMOTE 40 CMD_STAND 42 CMD_SIT 43 CMD_REST 44 CMD_SLEEP 45 CMD_WAKE 46 CMD_EQUIPMENT 55 CMD_BUY 56 CMD_SELL 57 CMD_VALUE 58 CMD_LIST 59 CMD_DROP 60 CMD_WEATHER 62 CMD_READ 63 CMD_POUR 64 CMD_GRAB 65 CMD_REMOVE 66 CMD_PUT 67 CMD_HIT 70 CMD_GIVE 72 CMD_POSE 75 CMD_CAST 84 CMD_ASK 86 CMD_ORDER 87 CMD_SIP 88 CMD_TASTE 89 CMD_PUNCH 91 CMD_OFFER 93 CMD_REPORT 94 CMD_TITLE 96 CMD_SPLIT 97 CMD_FILL 98 CMD_OPEN 99 CMD_CLOSE 100 CMD_LOCK 101 CMD_UNLOCK 102 CMD_WITHDRAW 104 CMD_DEPOSIT 105 CMD_BALANCE 106 CMD_GLANCE 107 CMD_WIMPY 108 CMD_PEEK 121 CMD_GOSSIP 122 CMD_AUCTION 123 CMD_KNOCK 124 CMD_SUBDUE 125 CMD_RIDE 126 CMD_DISMOUNT 127 CMD_DISARM 128 CMD_TRAP 129 CMD_BUTCHER 130 CMD_NOSUMMON 132 CMD_NOMESSAGE 133 CMD_THROW 134 CMD_BLOCK 135 CMD_SHOOT 136 CMD_RELOAD 137 CMD_ASSIST 138 CMD_FOLLOW 139 CMD_AFFECT 140 CMD_JUNK 148 CMD_MAIL 150 CMD_FLEE 151 CMD_SNEAK 152 CMD_HIDE 153 CMD_BACKSTAB 154 CMD_PICK 155 CMD_STEAL 156 CMD_BASH 157 CMD_RESCUE 158 CMD_KICK 159 CMD_PRACTICE 164 CMD_YELL 165 CMD_EXAMINE 166 CMD_TAKE 167 CMD_USE 172 CMD_WHERE 173 CMD_WHOIS 177 CMD_DISPLAY 178 CMD_ASSAULT 182 CMD_SPIN 184 CMD_BID 185 CMD_COLLECT 186 CMD_DONATE 187 CMD_COLOR 190 CMD_CONSIDER 191 CMD_GROUP 192 CMD_QUAFF 194 CMD_RECITE 195 CMD_SONG 196 CMD_REFOLLOW 197 CMD_ACTION 198 CMD_AMBUSH 199 CMD_DESCRIPT 200 CMD_VOTE 201 CMD_FREE 206 CMD_IDENTIFY 211 CMD_UNKNOWN 216 CMD_CRAWL 217 CMD_JUMP 218 CMD_CLIMB 219 CMD_MOVE 220 CMD_DISEMBOWEL 221 CMD_POST 222 CMD_STORE 224 CMD_RECOVER 225 Quite a few commands. I'm sure you recognise most of them. Most you'll never use for a spec, but I've listed them anyway. Also we've recently added a special command called CMD_UNKNOWN (216) This will allow spec writers to use any form of command they can think of. For example, we don't have a flush command. If I wanted to make a toilet that would only work when the player typed "flush toilet" (don't laugh, the spec is written already), I would have the code for the toilet intercept CMD_UNKNOWN and see if indeed a player typed "flush toilet". Here is a very quick piece of code to try and illustrate what I mean. This little thing would block the command north. Don't worry about the details of where the variables come from, thats for later. if (cmd==CMD_NORTH) { send_to_char("The guard pushes you back.\n\r",ch); return TRUE; } Anyway thats it for this message. I don't know if I've confused anyone with all the detail. Just remember that the code uses commands to run and the specs we write intercepts those commands to do what we want. Perhaps the weekend I'll send out the next one which will deal with the initial structure each spec requires. If anyone has any questions, just email. Rick (Ranger)