Arena Code

From: Chi Hoai Tran (necro@progsoc.uts.edu.au)
Date: 10/19/96


  Okay, since I wrote a pretty nasty message earlier, I am feeling
  slightly guilty so I will write a how-to-code arena right here.
  You will probably need to know where each particular section
  will be, but you can grep it.

  create ROOM_ARENA flag.
  
  in fight.c -->  die() function,
    before everything else, check if ch is in ROOM_ARENA, and if so,
    then transfer him to the starting room (ie..real_room(3001)),
    else if char isnt in ROOM_ARENA then let the code do what it was
    supposed to do in the first place.

  now, make an area with every single room having the ROOM_ARENA flag.
  
  make a command, ACMD(do_openarena).  This function merely
  tells everyone the arena is open, and set a global variable
  (say arena_open = TRUE)

  make a command, ACMD(do_join).  If (arena_open) then let transfer
  ch into the arena area, else tell them arena isnt open.

  make a command, ACMD(do_closearena).  Function tells everyone
  arena closing, and arena_open = FALSE.

  NOW, in fight.c --> damage() function, where it says
  if (player_killing_allowed or something like that) add a check
  if player is in ROOM_ARENA, if not then dam = 0.  This makes sure
  that players can hurt each other (for those muds that dont allow
  pkilling).

  ALSO, if you dont want players to gain xps in arena (since they arent
  risking anything at all) then change gain_xp so that it checks
  if they are in arena or not, etc..

  You might like to also fully restore chars when they enter and leave
  the arena.

  And finally, for every single combat skill (like kick, kill, bash, etc)
  add a check if chars are in arena..if so, broadcast to everyone that
  the two players are fighting in arena ie.. Player 1 ENGAGES player 2 in
  ARENA!
  Player 1 has KILLED Player 2 in ARENA!.

  And there you have it...pure coding without having to worry about other
  people's bugs, whatever bug you have caused, its FROM YOU! *grin*


  Horus.


+-----------------------------------------------------------+
| Ensure that you have read the CircleMUD Mailing List FAQ: |
|   http://cspo.queensu.ca/~fletcher/Circle/list_faq.html   |
+-----------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/18/00 PST