Welcome to the Builder Academy

Question Racial advantage help

More
11 Sep 2017 21:58 #6876 by JTP
Racial advantage help was created by JTP
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
12 Sep 2017 19:34 #6878 by thomas
Replied by thomas on 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.

More
12 Sep 2017 20:47 #6879 by JTP
Replied by JTP on 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.
Code:
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
12 Sep 2017 21:55 #6880 by thomas
Replied by thomas on 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.

More
01 Oct 2017 18:41 #6942 by zusuk
Replied by zusuk on 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:
Code:
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: 0.379 seconds