Welcome to the Builder Academy

Question Charmed MOBs and new Summoned MOBs not assisting master.

More
Today 05:23 #10932 by wlessard1
Basic problem is that Charmed MOBs are not assisting and additionally the new summoned mobs are not either.

I added a MOB flag
MOB_ASSIST
I set the flag, via NPC FLAGS. 

I have tried adding a check for "MOB_ASSIST"

But I am not sure I am writing it correctly or even putting it where it needs to go.
in fight.c under perform_violence
or
in spell_charm itself
or somewhere else?
Code:
    /* Auto-assist for mobs with MOB_ASSIST flag */     if (IS_NPC(ch) && MOB_FLAGGED(ch, MOB_ASSIST) && ch->master && IN_ROOM(ch) == IN_ROOM(ch->master)) {       if (FIGHTING(ch->master) && !FIGHTING(ch)) {         log("DEBUG: %s attempting to assist %s.", GET_NAME(ch), GET_NAME(ch->master));         do_assist(ch, GET_NAME(ch->master), 0, 0); // Call do_assist to join master's fight       } else {         log("DEBUG: %s not assisting: master not fighting or mob already fighting.", GET_NAME(ch));       }     } else {       log("DEBUG: %s failed MOB_ASSIST check: not NPC, no MOB_ASSIST, no master, or wrong room.", GET_NAME(ch));       }     if (GET_POS(ch) < POS_FIGHTING) {       send_to_char(ch, "You can't fight while sitting!!\r\n");       continue;     }

I put this in perform_violence in fight.c between get_mob_wait and if Group(ch)

BUT still no go with getting the mobs to assist.

Thanks for any help.

Just a guy coding a mud at home for no reason but the challenge.

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

More
Today 22:23 #10933 by thomas
I would put the check in perform_violence, after the block setting autoassist.

I think you need to check "the other way". The list you are checking there is the combat_list, and only those fighting are on it.
Instead, I'd loop over the followers list, check if they were in the same room, mobs, had the flag, not fighting. If all is true, set them fighting ch's target.

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

Time to create page: 0.202 seconds