Hello. I wonder how to make insta -hit on my server. Now when i attack someone i must wait weapon delay to hit someone
Example
wearing hally and have war off
switch war on and attack player which is next to me
must wait about 3s to first attack
I want to have first hit at beggining of the war on ( or when i am in meele range and didnt hit yet ) and then wait weapon delay. I waschecking many files where is it or where does pol inflicts weapon delays but couldn't find it. Please help. Sorry for my english .
hmmm and is there any way to check when player swtich war off/on ? (is there any packet which is sending when war is switching? ). I know player.warmode but i want to do smth when player switch his warmode on/off (maybe is there script which handle it?).
1. Instead of speed, define delay (in ms) to weapons' itemdesc element.
2. Hook request attack packet (0x05), in it, set character.delay_mod to or over the weapon.delay value, but negative (eg. delay is 1000 -> -1000). You probably want to do some checking regarding instahitting, too. Return 0, so core works on it.
3. Hook allow/refuse attack packet (0xAA), check if the attack was allowed. If it wasn't, undo the just set character.delay_mod. Return 0.
4. Hook attack (syshook), and in it's script, undo the character.delay_mod, so next swing won't happen instantly. Return value depends of your combat system.
It should work out like so. Never did exactly the same, so be sure to tell if and how you got it to work.
Not sure how applicable this will be to you, but this is basically how it's done on my shard.
If you want to calculate how much damage a weapon will do over a given amount of time, ie, given that all weapons have a speed factor which is also critical, here is a good example on how to go about calculating that factor in.
This isn't factoring-in any DEX modifiers. You would add any DEX modifier to 'EffectiveDex' variable right at the top of this example.
In this example as given, the weapon will deal it's calculated damage once every 2.857 seconds. Any weapons damage is re-calculated for every swing. Other calculations are done for resistances and Armor of the target being hit.
That number you see above your head when hitting things is the final result of damage being dealt as a result of quite a few calculations, and they are done every swing/use of the weapon.