[Package Index | Mudlib Index | Effect Index]
See also:
/std/effects/npc/good_fighter
.c
Written by Sin
void check_for_contracts()
int do_smart_fighter_move(object npc, string dir, int running_away)
void event_enter_check(object dest, string mess, object from)
void event_fight_in_progress(object attacker, object opponent)
Most of the intelligence is in the specific choice of attack, and there isn't a whole lot in that. It restricts itself to simply going through the attacks stored in the specials[] array (calculated in the call to good_fighter_setup()), finding which attacks are valid (based on whether the opponent is holding a weapon and which weapons are wielded by the NPC). Once it has a list of valid commands, it choses from them randomly.
Regardless, there is always the possibility that this function will
drop through and allow the combat handler to attack normally. That
chance is inversely proportional to the NPC's level.
void event_npc_cast_spell(object spell, object caster, object * targets, class spell_argument args, int stage)
void event_npc_consider(object player)
void event_ritual(object spell, class ritual ritual)
string inhume_command(string spec, object weapon, object dest)
int query_fighter_options()
string query_inhume_handler()
int query_is_smart_fighter()
string query_managed_specials(int type)
void set_inhume_handler(string handler)
varargs void set_smart_fighter(int weapon_type, int defence_type, int spell_options)
void setup_spell_options(int options)
void check_add_command(string command, string skill, int level, int type)
void check_skill(string skill, int level)
int check_weapon(object weapon, string command)
void smart_fighter_setup(int type)