Code: Select all
SystemHookScript hooks/combat.ecl
{
Attack Attack
}Code: Select all
program Combat()
print("SystemHook enabled: Attack");
return 1;
endprogram
exported function Attack(attacker, defender)
print("This works just fine: " + attacker.name);
return;
endfunctionOn OSI the chance to hit is based on the attacker's combat skill vs the defender's' combat skill, or eval int and anatomy, and if the attack hits, parry is checked if the defender is using a melee weapon or shield (with some bushido weirdness thrown in there, but I'm not sure I'm going to use that). I'd handle this stuff in a hit script but the core still likes to make the hit sound even though the attack would have missed and is dealing no damage.
Another question: If I try to do this:
Code: Select all
print ("Weapon info - objtype: " + (attacker.weapon).objtype + " name: " + (attacker.weapon).name);