Racial advantage help

  • JTP
  • JTP's Avatar Topic Author
  • Offline
  • Platinum Boarder
  • Platinum Boarder
More
8 months 1 week ago #6876 by JTP
JTP created the topic: Racial advantage help
Wanna make a race naturally heal over time when they are wounded.

So if a RACE_ELF is below GET_MAX_HIT(ch) will heal 1hp per tick below lvl 10 and 2hp when being lvl 11 and 30 and 3hp when being above lvl 30 per tick.

How and where would that be done ?


Or an AFF that gives elf race it for X amount of ticks after killing a mob actually would be good.

Please Log in or Create an account to join the conversation.

More
8 months 1 week ago #6878 by thomas
thomas replied the topic: Racial advantage help
Updates to points is handled by the point_update() function. I suggest looking there first.

Please Log in or Create an account to join the conversation.

  • JTP
  • JTP's Avatar Topic Author
  • Offline
  • Platinum Boarder
  • Platinum Boarder
More
8 months 1 week ago #6879 by JTP
JTP replied the topic: Racial advantage help
Ok here is what i have so far. It works. But only happends on a tick, so maybe alittle slow.

How can i speed up just the part that adds +1 hp , so it happends faster ? Not on the normal tick.
    if (!IS_NPC(i)) {
      update_char_objects(i);
      (i->char_specials.timer)++;
      if (GET_LEVEL(i) < CONFIG_IDLE_MAX_LEVEL)
        check_idling(i);
    }
   if ((GET_RACE(i) == RACE_ELF) && GET_HIT(i) < GET_MAX_HIT(i)) {
     GET_HIT(i) += 1;
     send_to_char(i, "Your wounds seem to heal on their own.\r\n");
     act("$n's wounds seem to heal on their own.", TRUE, i, 0, 0, TO_ROOM);
   }
  }

Please Log in or Create an account to join the conversation.

More
8 months 1 week ago #6880 by thomas
thomas replied the topic: Racial advantage help
Ok, so not actually on ticks - this sounds like something for the event system.

Try reading this: github.com/tbamud/tbamud/blob/master/doc/dg_events.txt - it should give you a primer.

Please Log in or Create an account to join the conversation.

  • zusuk
  • zusuk's Avatar
  • Offline
  • Gold Boarder
  • Gold Boarder
  • LuminariMUD Developer
More
7 months 2 weeks ago #6942 by zusuk
zusuk replied the topic: Racial advantage help
If you do not want to use events, you can just add another pulse @ 1 second in your heartbeat (comm.c):
void heartbeat(int pulse) { blah; blah; }

add in there:
  if (!(pulse % (1 * PASSES_PER_SEC))) { 
    one_second_tick();
  }

Then wherever, like limits.c, just add a function, one_second_tick(), for anything in your MUD you want to happen every second.

Website
www.luminariMUD.com

Main Game Port
luminariMUD.com:4100

Please Log in or Create an account to join the conversation.

Time to create page: 1.465 seconds