[FIXED] Issues with the peacemaking skill

Here we stuff all the bugs we've managed to squash/squish/squelch.
Post Reply
User avatar
Xuri
Site Admin
Posts: 3704
Joined: Mon Jun 02, 2003 9:11 am
Location: Norway
Has thanked: 48 times
Been thanked: 8 times
Contact:

Issues with the peacemaking skill

Post by Xuri »

The effects of the peacemaking skill are very hard to notice when used on aggressive NPCs, seeing as all it does is take the affected NPCs out of combat for a split second before they locate a new target.

On the official shards the peacemaking skill works a bit differently, in that it disables the affected NPCs ability to enter combat for a while. If they are damaged/attacked while "peacemaked", there's a chance (increasingly big for each time they're damaged) that they'll break out of it.

We need a way to stop them from acquiring new targets for a while after the peacemaking skill has effectively been used, and should possibly implement the "increasing chance of breaking peace" feature as well.

Another problem has been that there's been no difference between using peacemaking on a sheep and on a dragon, but after Grimson added the TOPEACE DFN tag and the .skillToPeace JS property, I've modified the PeaceMakeArea function of peacemaking.js script to make sure it checks the peacemaking skill against their TOPEACE value.
Last edited by Xuri on Wed Apr 05, 2006 2:17 pm, edited 1 time in total.
-= Ho Eyo He Hum =-
Grimson
Developer
Posts: 802
Joined: Sat Jun 04, 2005 1:52 am
Location: Germany
Has thanked: 0
Been thanked: 0

Post by Grimson »

Xuri wrote:We need a way to stop them from acquiring new targets for a while after the peacemaking skill has effectively been used, and should possibly implement the "increasing chance of breaking peace" feature as well.
Would a simple JS property .canAttack be enough? I think the delay before allowing a new attack can be handled by a JS timer and the chance to break out of it earlier by the onAttack event.
User avatar
Xuri
Site Admin
Posts: 3704
Joined: Mon Jun 02, 2003 9:11 am
Location: Norway
Has thanked: 48 times
Been thanked: 8 times
Contact:

Post by Xuri »

So, as long as the .canAttack property is false, they wouldn't be able to acquire new targets/fight back? As for the onAttack event, that'd have to be a default, global event then.
-= Ho Eyo He Hum =-
Grimson
Developer
Posts: 802
Joined: Sat Jun 04, 2005 1:52 am
Location: Germany
Has thanked: 0
Been thanked: 0

Post by Grimson »

Xuri wrote:So, as long as the .canAttack property is false, they wouldn't be able to acquire new targets/fight back?
Yes.
Xuri wrote:As for the onAttack event, that'd have to be a default, global event then.
Hmmm, maybe it's better when I add a timer and handle this in the server code.
Grimson
Developer
Posts: 802
Joined: Sat Jun 04, 2005 1:52 am
Location: Germany
Has thanked: 0
Been thanked: 0

Post by Grimson »

Ok, this is how it will work:

there is a new JS property for chars .canAttack if this is set to 0 the char cannot attack a target.

The time after this is lifted has to be set using a js timer.

The chance that it is lifted will be calculated by the server code.

You can set the chance gain on hits by giving the TOPEACE tag a second number (as always use a space as seperator for the numbers).

For players the chance gain will be their own peacemaking skill.
giwo
Developer
Posts: 1780
Joined: Fri Jun 18, 2004 4:17 pm
Location: California
Has thanked: 0
Been thanked: 0

Post by giwo »

mChar.SetTimer( 0, numMiliSecsUntilCanAttack );


Try that...
Scott
User avatar
Xuri
Site Admin
Posts: 3704
Joined: Mon Jun 02, 2003 9:11 am
Location: Norway
Has thanked: 48 times
Been thanked: 8 times
Contact:

Post by Xuri »

There's a timer for it already?
-= Ho Eyo He Hum =-
Grimson
Developer
Posts: 802
Joined: Sat Jun 04, 2005 1:52 am
Location: Germany
Has thanked: 0
Been thanked: 0

Post by Grimson »

Xuri wrote:There's a timer for it already?
So what now, should I make the timer server code or do you want to make it in JS?
giwo
Developer
Posts: 1780
Joined: Fri Jun 18, 2004 4:17 pm
Location: California
Has thanked: 0
Been thanked: 0

Post by giwo »

That's combat timeout. We set it on every swing based on your dex and weapon speed. If you want it to temporarily "paralyze" a creature and stop them from fighting, that would be the timer to use.

As a side note, just remember anytime you are talking about something like combat, that is VERY time-intensive and handled by UOX3 constantly, so be careful what areas you are letting JS handle.....
Scott
Grimson
Developer
Posts: 802
Joined: Sat Jun 04, 2005 1:52 am
Location: Germany
Has thanked: 0
Been thanked: 0

Post by Grimson »

giwo wrote:That's combat timeout. We set it on every swing based on your dex and weapon speed. If you want it to temporarily "paralyze" a creature and stop them from fighting, that would be the timer to use.
But this wouldn't stop them from using magic, or am I wrong?
giwo wrote:As a side note, just remember anytime you are talking about something like combat, that is VERY time-intensive and handled by UOX3 constantly, so be careful what areas you are letting JS handle.....
Could you have a look at my latest CVS commit and give some comments? Maybe there is a better way to handle this.
giwo
Developer
Posts: 1780
Joined: Fri Jun 18, 2004 4:17 pm
Location: California
Has thanked: 0
Been thanked: 0

Post by giwo »

What's the status of this as of 0.98-3.6?
Scott
User avatar
Xuri
Site Admin
Posts: 3704
Joined: Mon Jun 02, 2003 9:11 am
Location: Norway
Has thanked: 48 times
Been thanked: 8 times
Contact:

Post by Xuri »

The code for when exactly characters break out of the peacemaking effect during combat might have to be tweaked a bit, but at least it seems to be working, for both players and npcs =)
-= Ho Eyo He Hum =-
Post Reply