Friday, February 1, 2019

OnPCStatCalcEvent

Let's have a little history lesson shall we ?

it all started by me, found this modification in this topic
about update character's status


since then I have been using it VERY frequently
I'm sure those of you dealing with patch understand this,
I have to upkeep the patch to the latest server revision
eventually I was so fed up, and finally brought it to the development suggestion
See -> OnPCStatCalcEvent <- that's how rAthena got it

When I switch to Hercules, somebody else actually made a pull request on it
https://github.com/HerculesWS/Hercules/pull/351
but it was denied, and thus I released it as a plugin

For a long period of time, the *recalculatestat script command is still broken,
but I finally fix it during my time in Hercules period

Download:

Hercules Plugin

here's the catch
the reason why the *recalculatestat is still broken on rathena,
is because how the way script handling the event queue

Supposedly, we want the bonuses from the OnPCStatCalcEvent: to execute before running the status_calc_pc function
but what actually happen is the script queue up the OnPCStatCalcEvent: label, execute status_calc_pc first
thus all the bonuses from equipment/job bonuses etc has been applied, then OnPCStatCalcEvent: come in too late

since I figure it out, my little trick is delay the OnPCStatCalcEvent: to run AFTER the script execution finish, using a delay timer
I actually explained this to Secret, rathena developer, but she doesn't agree with my method, because this is not thread safe
but whatever ~ at least it working for me


OnPCStatCalcEvent can't run during npc dialog, and spam map-server error along with it


easy to reproduce during the npc dialog, keep change the equipment, you'll lose the str bonus and map-server spam error

conf/map/battle/items.conf
change this to false should stop it

1 comment:

  1. Hi Annie,

    I have a script ingame a script that will give all the skills of a trans class to every player and on that Script i use OnPCStatCalcEvent to give the skills permanently but every time i clicked the buffer NPC that using a SC_START. all skills that was given by OnPCStatCalcEvent is been remove and if i relog or use @skillall the skills return. do you have any idea how i can fix this so the effect of SC_START will not remove the OnPCStatCalcEvent ?

    ReplyDelete

Linux compiler error that never shown on Visual Studio

let's just admit Visual Studio sux ... ok ? right now, if you want to host a Private Ragnarok Online server, its just better to choose...