Below is what I had when I stopped working on it, along with the notes I had jotted down. It does work, unless I broke something cleaning up my notes. It just doesn't come remotely close to retail.
I'm just hoping the code/research will be useful to someone.
Code: Select all
function OnUseAbility(player, target, ability)
-- Crit rate
-- Ryunohige always crits (19004, 19073, 19093, 19625, 19723, 19832, 19961)
-- Ignores Crit Defense Bonus
-- Distance (9.5)
-- Should be possible to skill up.
-- Should NOT proc damage spikes if the target has them.
-- Spirit Surge (defense -20% on target, probably can't be resisted, overwrites Angon)
-- -30% on BGWiki
-- Can't do anything about animations, personally. Either handled differently, or animation ID > 255 (unlikely)
-- Purple on regular hit, green on crit, if I remember right. The colors matter.
-- Animation varies depending on melee weapon.
-- Delphinius (L99, 19794) should give an additional effect of Stun.
-- Accuracy
-- Volans Greaves grant +4 acc (15347)
damage = player:getMeleeHitDamage(target);
-- Returns -1 on miss
vit = player:getStat(MOD_VIT);
printf("Damage: %i",damage);
if(damage == -1) then
-- Return miss message how? Try passing -1 eventually.
-- Needs to pass to all players. This is not a solution.
player:messageBasic(324,66,target);
--return 0;
else
-- Calculate damage
-- floor((base damage)*(vit/256+1)
-- Formula is disputed in Drake Ring research on FFXIAH, but nothing new provided
damage = math.floor((damage)*(vit/256+1));
printf("Modified damage: %u",damage);
-- Gear that changes the formula
-- AF/+1 feet grant +10% attack (14102, 15365)
-- Skanda boots needs verification, but same +10%? (15700)
-- Drake Ring is just unknown. Possibly +Atk or Acc or both.
-- Double/Triple Attack, Enspells, Occ Attacks X., Additional Effects
-- Vougier's contus (L89) has a double attack % during jump. (16854)
-- Dual-wield/H2H should have both attacks
-- Calculate returned TP
-- Does not grant target TP (seems to be covered)
-- Gear that modifies TP returned
-- Barone (body 14416, legs 14317) +2 each
-- Conte (body 14417, legs 14318) +2.5 each
-- Skystrider (18128) +5
-- These grants TP even on a 0 damage hit...
target:delHP(damage);
target:updateEnmityFromDamage(player,damage);
return damage;
end
end;