Jump to content

athron

Members
  • Content Count

    2
  • Joined


Reputation Activity

  1. Upvote
    athron reacted to AnnieRuru in OnPCStatCalcEvent   
    rathena already has this by default -> https://github.com/rathena/rathena/commit/27a0f3f
    someone else has tried to pull request in hercules, -> https://github.com/HerculesWS/Hercules/pull/351
    but it was denied, so have to leave this as plugin
    UPDATE: rathena has taken out -> https://github.com/rathena/rathena/commit/b65443d8f564175196d57ef9bc1d000a5661fbdc
     
    Download : 2.1
    plugin
     
    Tested with:
    conf\import\OnPCStatCalcEvent.conf
    both `@reloadscript` and `@reloadonpcstatcalcevent` command can reload conf\import\OnPCStatCalcEvent.conf file 
     
    `@reloadscript` = reload everything -> cause destruction on live server
    `@reloadonpcstatcalcevent` = only reload conf\import\OnPCStatCalcEvent.conf file , combine with `@reloadnpc` command -> not so destructive
    script: ( { // give GM permanent bonus ? OnPCStatCalcEvent: <" bonus bVit, 1234; end; "> }, { // for xxx event OnPCStatCalcEvent: <" skill TF_HIDING, 1; end; "> }, { // npc/custom/xxxevent.txt OnPCStatCalcEvent: <" if (@a) { bonus bStr, 1000; skill WZ_ICEWALL, 1; } end; "> }, ) script
    prontera,158,185,5 script djk2sfhsd 1_F_MARIA,{ @a ^= 1; mes "hmm..."; recalculatestat(); next; mes "what ?"; @a ^= 1; recalculatestat(); next; mes "maybe..."; @a ^= 1; recalculatestat(); next; mes "probably..."; @a ^= 1; recalculatestat(); next; mes "yeah..."; @a ^= 1; recalculatestat(); close; } yes, this actually works !!
     
    with version 2.0 onwards,
    no more spamming <npc name>::OnPCStatCalcEvent !!
    and even `*skill` working perfectly fine now
     
     
  2. Upvote
    athron reacted to Ind in HPM Hooking Now Available!   
    Hercules Plugin Manager: Hooking
     
    Hello~! What?!
    In March 1st we started the Hercules Renewal Phase One, in order to prepare Hercules for this update, and now 7 months later it's fully complete, we've gone all over the map-server's code, taken hundreds of notes, modified thousands of lines, and have greatly improved our knowledge, making it very much worth the effort. HPM Hooking
    Zero Processing OverheadNormally programs that avail hooking end up paying a price for it, processing-time-wise, HPM Design frees Hercules from that toll -- absolutely no processing overhead to functions not being hooked to. Smart, Flexible Design Hooks receive all function params as pointers, whereas the original is int pc_dropitem(struct map_session_data *sd,int n,int amount)the one for the hook shall be (struct map_session_data *sd,int *n,int *amount)which allows for hooks to modify any and all data as it pleases.
    postHooks receive one additional param, which accounts for the result of the original function, int <name>(int retVal, struct map_session_data *sd,int *n,int *amount)In this case it'd allow for the postHook to react properly to what the original returned, in this case (for pc_dropitem) 0 (failure) or 1 (success) Hooking is a simple operation, it is possible to hook an infinite number of times to the over 2k hookable functions (all the interfaced ones, accounting for over 99% of map server) HPExport void plugin_init (void) {     addHookPre("pc->dropitem",my_pc_dropitem_preHook);  /* int my_pc_dropitem_preHook(struct map_session_data *sd,int *n,int *amount) */     addHookPost("pc->dropitem",my_pc_dropitem_postHook);/* int my_pc_dropitem_postHook(int retVal, struct map_session_data *sd,int *n,int *amount) */ } DocumentationThe sample plugin has already been updated to demonstrate hooking, the documentation present in the wiki will be updated shortly. Hercules-Hooks Updates This covers how we'll maintain the hookable points up to date with the game server's code The cache that boosts the hooks -- Made Possible Thanks to Haruna! -- is maintained by an application, for a couple days it will remain like that so we can keep an eye on it and debug as we go, once we're confident with it we'll enable its standalone mode, which will make the process automatic (without the need for developers to proofread and approve) and able to follow up on any new commits within seconds of it landing on the repository. Also in
    Haruna has redesigned the Makefile for plugins, so those of you not using windows will need to re-enter your plugins in it (its much easier now, Haruna provided a very straight-forward documentation in the file) Pre-existing plugins will need to be recompiled, given the chances in the Hercules Plugin Manager, attempting to load any not-recompiled plugin will lead to it not being loaded (and a warning in console will be displayed) Design by
    Haruna, Xgear, Gepard and Ind Special Thanks to
    Hercules Team, Contributors, for all have contributed to us getting here, Thank you all very much! Takkun for the MSVC-2012 project files Haruna for the MSVC-2010 project files Link~u!
    Commit And - On the Horizon
    Script Engine UpdatesThose of you who lurk our page on github probably have already noticed some stuff from it, we'll soon be resuming, for those of you not familiar with it: Many syntax additions and improvements (Thanks to Haruna!) Limitless array support, improvements to array storage and processing Support for Char and Account variable arrays (and no more limit on amount of char/acc vars), improvements to processing and storage of char/acc variables. Catching UpWe hear you, we're lagging on staying up to date with the releases of other projects, we'll be prioritising towards catching up with them. Hercules Stress Test ServerI'll be delaying the release of our Stress Test Server, while it is now viable thanks to hooking, I'd like to prioritise catching up with other releases
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.