Monday, January 7, 2019

Basic script command comparison between rAthena & Hercules


Ever since Hercules forked from rAthena since Jan 2013,
Hercules has driven further away from its rAthena parent, many systems and features are now very much different

These are difference of script commands and constants use by both emulator, that throw non-sensible error when you switch from one to another

1. rAthena can use numbers and constants for npc ID, but hercules MUST use constants for it
for a full list, see http://nn.ai4rei.net/dev/npclist/


2. rAthena has *specialeffect, *specialeffect2 and *misceffect. Hercules only has one *specialeffect
3. rAthena uses *pow, hercules uses ** exponentiation operator
see hercules deprecation notice


4. rAthena use *preg_match, hercules use *pcre_match
 Note: rathena put pattern first, hercules put string first


5. for *monster script command, rAthena push $@mobid variable, hercules has to declare your own variable



6. rAthena *checkcart/*setfalcon and so on has {,<char_id>} support, hercules missing them


7. rAthena can use *addrid or *getunits, hercules has to use *getunits with BL_PC flag


8. hercules is missing OnPCStatCalcEvent: label


9. hercules is missing *bonus_script script command


10. rathena use *mail, hercules use *rodex_sendmail


11. rathena missing *swap script command


12. hercules missing *inarray script command, although my pull request is still ...


13. hercules use *getvariableofpc, rathena use *getvar


14. rathena missing OnUnTouch: label


Constants 

the least obvious one, you have to watch out for these
1. rAthena use SC_SPIRIT, Hercules use SC_SOULLINK constant


2. status change script commands, rAthena uses SCSTART_ , hercules use SCFLAG_


3. *gettime script commands, rAthena uses DT_, hercules use GETTIME_


... and the rest are quite obvious like hercules has getcharid(CHAR_ID_ACCOUNT), rathena still use getcharid(3)
... rathena also has a bunch of constants for *getmapflag, *guild_has_permission ...

Hercules also encourage using Item/Mob AegisName instead of using integer ID, although I also agree a little bit overkill ...


See also

A simple comparison between rAthena & Hercules battleground script
Compare *getunitdata on rAthena & Hercules
Compare Instance script between rAthena & Hercules
Compare dynamic shop between rAthena & Hercules 
 

2 comments:

  1. I think rAthena use constant for NPC too.

    ReplyDelete
  2. yeah, I know. I think its problem on how I word it. Fix

    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...