Welcome to the Builder Academy

Question autosac

More
07 Dec 2017 21:46 - 07 Dec 2017 22:06 #7214 by JTP
autosac was created by JTP
Hi
Code:
if (IS_NPC(victim) && !IS_NPC(ch) && PRF_FLAGGED(ch, PRF_AUTOSAC)) { do_sac(ch,"corpse",0,0);

additional to corpse i have dust pile from undeads, how do i get autosac to sac either one, without first saying: It doesn't seem to be here.
To one of them ?


Additional how do i get autogold/autosplit/autoloot to get from both "corpse types"
Last edit: 07 Dec 2017 22:06 by JTP.

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

More
07 Dec 2017 22:42 #7215 by thomas
Replied by thomas on topic autosac
This is actually a slight bit tricky. The corpse (or dust pile) is created in make_corpse(), which is called from raw_kill() which again is called from die() which is called from damage(), where the autoloot code resides.

So, you will need to get the name of the object created in make_corpse() to bubble out to the damage() function.

My suggestion is to make all of the functions above return a struct obj_data* instead of void. So, make_corpse() returns the created corpse object, which is returned from raw_kill(), and again from die().
Then, in damage(), just either use it directly or use obj->name instead of the hardcoded "corpse".

This will require some rewriting inside fight.c, but mostly it's a question of changing return values and setting up variables.

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

More
07 Dec 2017 23:17 #7218 by JTP
Replied by JTP on topic autosac
Thanks alot Thomas...that made me solve it.

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

Time to create page: 0.279 seconds