Hello again and sorry for being too slowly to answer hehe. I have been able to finally match the system to my 51a purposes ^^. The issue got complicated since the pre delay is fire in 4 differents situations and not just in one like i thought at first. I have been spending more time this weeks testing with 51a than rather scripting in 0.56c to make damn sure it works 100%.
This system only should work for characters, npc´s should not use it if you want to replicate the old era.
Some info.
pre-delay fires when:
1)When attacking someone for my first time. When calling @hittry argn1 value is our pre-delay time also.(in tenths of seconds).
2)When getting hitted/hitmissed by someone for my first time. If my priority is not to attack other player i have been enganged in a fight before (and we are currently fighting).
So if both player are using the same weapon, second hit from attacker just happends at the same time at first attacked back hit once predelay is passed. (hitting each other at the same time).
3)If when fighting an opponent i switch to another one when being in fighting mode. Back to step 1) and 2).
4)If i´m going into peace mode because i fizzle a spell or whatever. Back to step 1) and 2).
When skipping this checkings it works like the 0.56c default sphere custom system using pre aos specs.No more additions needed to work properly.
The script:
Code:
[events e_51a_combat]
ON=@HitTry
if (<ctag0.restartstrike<uid>>)
ctag0.firststrike<uid>=1
ctag0.strikefire<uid>=<serv.time>
ctag0.restartstrike<uid>//clear the tag.
ctag0.combatstarted<uid>=1
return 1
endif
if (<ctag0.engaged<uid>>!=<src.uid>)
ctag0.firststrike<uid>=1
ctag0.strikefire<uid>=<serv.time>
ctag0.engaged<uid>=<src.uid>
ctag0.combatstarted<uid>=1
return 1
endif
if (<ctag0.firststrike<uid>>)
if (<serv.time> > <ctag0.strikefire<uid>>+<eval <dargn1>>-18)
ctag0.firststrike<uid>//clear the tag.
ctag0.strikefire<uid>//clear the tag.
return 0
else
return 1
endif
endif
On=@Userwarmode
if (<ctag0.combatstarted<uid>>)
if (<argn1>==1)
ctag0.restartstrike<uid>=1
ctag0.combatstarted<uid>//clear tag.
endif
endif
On=@Hitmiss
if !(<ctag0.firststrike<src>>) || (<ctag0.engaged<src>>!=<uid>)
src.attacker.add <uid>
endif
ON=@CombatAdd
ctag0.firststrike<uid>=1
ctag0.strikefire<uid>=<serv.time>
ctag0.combatstarted<uid>=1
local.animdelay and argn1 values are at your own since every 51a server is different even using this pre-delay system because these values.
I have checked the script ingame and it works very good for me. I don´t know if using <serv.time> many times like these can bring trouble, that is the clearest way for me to achieve it. I´m building my server for just a few friends so it doesn´t scare too much the hell out of me right now.
Any feedback, revision or idea just let me know, the goal is to run it without bugs. Thanks again to Khaos,XuN and Coruja. Their help has been very helpful, with these guys is really hard to give up.