Code: Select all
damage = player:getMeleeHitDamage(target);
-- Returns -1 on miss
printf("Damage: %u",damage);
if(damage == -1 or damage == 0 or damage > 65000) then
-- Return miss message how? Try passing -1 eventually.
player:messageBasic(324,66,target);
return 0;
else
target:delHP(damage);
target:updateEnmityFromDamage(player,damage);
return damage;
end
Yes, even with my "damage > 65k."
I've also tried return -1, which did the same thing.
Edit:
First half still stands, I'd like to know if that's expected behavior. I'll report it properly if it's not.
Second half... yeesh. Don't sweat that too much. Jump needs a dedicated core function. Just... there would be so many missing caveats to regular behavior with getMeleeHitDamage. Dual-wielding, TP return, crits, en-spell damage, additional effects, gear modifying all of that... I can dump my research/code somewhere if someone wants to pick the baton up, but it needs a core function and I can't code that. Sorry. I better understand why nobody's coded Jump now.