Dunno if this is the right place to post it, or if there is forms to fulfil - feel free to move/correct me if I am doing anything wrong.
I have 2 situations where this is useful:
- an Auto Spell sage killing geographers (distant cast only, no auto spell damn those DEX plants)
- an Exorcist on Pyramids and maps with Drainliars, Familiars and the like - I'd rather use a stunner to kill them than use a Phen accessory (where I play, there is no Phen card drop - only thru ROPs; too expensive to let it get caught on a bot)
There are probably more situations where it could be useful, but those are my motives for patching
Enough talk, here is the snippet of code, added in AI.pm.
on function "sub attack", right after the "useWeapon' check in autoSwitches:
Code: Select all
if ($config{"autoSwitch_$i"."_useWeapon"} ne "") {
$ai_v{'attackUseWeapon'} = $config{'attackUseWeapon'};
$config{'attackUseWeapon'} = $config{"autoSwitch_$i"."_useWeapon"};
message TF("Change Attack useWeapon to : %s\n", $config{'attackUseWeapon'}), "equip";
}
# Patch starts here
if ($config{"autoSwitch_$i"."_runFromTarget"} ne "") {
$ai_v{'runFromTarget'} = $config{'runFromTarget'};
$config{'runFromTarget'} = $config{"autoSwitch_$i"."_runFromTarget"};
message TF("Change runFromTarget to : %s\n", $config{'runFromTarget'}), "equip";
}
if ($config{"autoSwitch_$i"."_runFromTarget_dist"} ne "") {
$ai_v{'runFromTarget_dist'} = $config{'runFromTarget_dist'};
$config{'runFromTarget_dist'} = $config{"autoSwitch_$i"."_runFromTarget_dist"};
message TF("Change runFromTarget_dist to : %s\n", $config{'runFromTarget_dist'}), "equip";
}
# Patch ends here
last AUTOEQUIP;
Code: Select all
if ($ai_v{'attackUseWeapon'} ne "" && $config{'attackUseWeapon'} != $ai_v{'attackUseWeapon'}) {
$config{'attackUseWeapon'} = $ai_v{'attackUseWeapon'};
message TF("Change Attack useWeapon to default : %s\n", $config{'attackUseWeapon'}), "equip";
}
# Patch starts here
if ($ai_v{'runFromTarget'} ne "" && $config{'runFromTarget'} != $ai_v{'runFromTarget'}) {
$config{'runFromTarget'} = $ai_v{'runFromTarget'};
message TF("Change runFromTarget to default : %s\n", $config{'runFromTarget'}), "equip";
}
if ($ai_v{'runFromTarget_dist'} ne "" && $config{'runFromTarget_dist'} != $ai_v{'runFromTarget_dist'}) {
$config{'runFromTarget_dist'} = $ai_v{'runFromTarget_dist'};
message TF("Change runFromTarget_dist to default : %s\n", $config{'runFromTarget_dist'}), "equip";
}
# Patch ends here
} #END OF BLOCK AUTOEQUIP
Code: Select all
autoSwitch Geographer,Flora {
useWeapon 0
runFromTarget 1
runFromTarget_dist 6
}