autosac

  • JTP
  • JTP's Avatar Topic Author
  • Offline
  • Platinum Boarder
  • Platinum Boarder
More
5 months 1 week ago - 5 months 1 week ago #7214 by JTP
JTP created the topic: autosac
Hi
    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: 5 months 1 week ago by JTP.

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

More
5 months 1 week ago #7215 by thomas
thomas replied the 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.

  • JTP
  • JTP's Avatar Topic Author
  • Offline
  • Platinum Boarder
  • Platinum Boarder
More
5 months 1 week ago #7218 by JTP
JTP replied the 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: 1.139 seconds