Friday, February 22, 2019

List pet eggs in your inventory

Just like signed items, which use 255 or 254 in the card1 field


Hercules Pet egg uses -256 in the card1 field
rathena use 256 ... without the negative

the earliest ... traceable topic is over here
https://rathena.org/board/topic/76954-can-i-request-script-evolution-pet/?sortby=date

and now for the latest script available...
https://drive.google.com/file/d/1hQgJO4MbHIQtymKxnsrxsi37nkJ1eruz/view

the way to retrieve the pet ID is almost similar to the signed item

Signed Item
card1 = 255 or 254
card2 = star crumb + element
card3 = CHAR_ID & (( 1 << 16 ) -1)
card4 = CHAR_ID >> 16

Pet ID
card1 = -256 (Hercules) or 256 (rAthena)
card2 = CHAR_ID & (( 1 << 16 ) -1)
card3 = CHAR_ID >> 16
card4 = 0


External Links:

Pet egg renewal fixing

Saturday, February 16, 2019

Hercules script engine is case-sensitive, rAthena isn't

I still remember when I was still Scripting Moderator in rAthena, there was this old bug report ...
...  after rAthena switched to IPB4 ... forum bug tracker down ....
anyway, it goes like this

Joseph open a bug report, claiming some official script doesn't execute the monster label properly
after some debate between the developers, I posted a script and prove them it is true
make one npc with the capital letter, and another one without capital letter -> OnDead - Ondead
click on 'asdf' npc, after kill the monster, the map-server.exe spam error
BrianL immediately add tag [Confirmed] and [Severity-Medium] to this bug report
within a few weeks, both Euphy and Joseph fix all the npc scripts in the emulator, and they mark it as [Solved]

..... the truth is, if you try the above script in latest rAthena, this bug still happen TODAY
this bug can't reproduce in Hercules because Hercules has case-sensitive script engine



Now let's talk about how crazy the script can be, if the script engine is not case-sensitive

other than npc header, 'prontera' and '1_F_MARIA',
script commands, labels, variables and constants are case-insensitive in rAthena
strings that enclosed in " double-quotation mark are not affected
means "this" "--ja--" "all" "All" still has to retain its format


This will throw duplicate label error in rAthena
in Hercules, click on the npc will display "2" properly

So, rAthena users, remember, don't simply use Onmobdead: label in your scripts
because official script already uses OnMobDead, OnMyMobDead, ... etc
... anyways, any official script already using that label name, Don't change into small letters in your scripts


... btw, SQL commands are still case-insensitive,
so me as Hercules user still uses small letters in *query_sql script commands


External Links:

Player Checker NPC
... once rAthena forum bug tracker up, will post that bug tracker ID here ...

Friday, February 15, 2019

messagecolor

make the NPC or monster object display chat-box in colorize message


Download :

Hercules Plugin
rAthena Patch

Note: this 0.3 version can display chat-box for the player
however the chat-box above your head isn't colorize because there are no known way to do it

Hercules' @fontcolor actually use a trick to disguise the player
https://github.com/HerculesWS/Hercules/issues/1217
https://github.com/HerculesWS/Hercules/issues/1930
and it has some bugs, so its better not to emulate that pattern
.... apparently rAthena @fontcolor is broken ...

Saturday, February 9, 2019

What is dynamic_mob and how it affects scripts

What is dynamic_mob ?

conf/map/battle/monster.conf

This setting means, monsters only spawn on the map when there is a player warp in.
if the map is left empty for 5 minutes, all dynamic spawned monsters, except spawn by boss_monster will remove from the map

it is recommend to turn on dynamic_mob because it help save memory on your live server

Example:

Let's say you login in Prontera town, and type "@asdf", poring and golden_bug are not spawn, only poporing has been spawn
"@rura guild_vs2", warp into the map, all 3 monsters are spawned
"@go 0", return to prontera, after 5 minutes, the poring is remove from the map, only golden_bug and poporing remain
"@reloadscript", return everything as normal, only poporing remain

This means :-
1. All monster spawn dynamically are affected by dynamic_mob, *monster script command are not affected
2. once a player warp into the map, all monsters will spawn normally
3. after 5 minutes the map left empty, all non-boss_monster will be remove

This can cause problem to the script if you want to count how many monsters left in the map
because dynamic_mob will NOT load the monster until a player warp into the map


External Links:

mobs on server start
MVP board

Wednesday, February 6, 2019

Allow OnNPCKillEvent to increase kill counter for party members

I still see a lot members struggle with this issue,
however this is entirely done with scripting alone

this is a normal template to increase kill counter normally for the killer alone

and this is for party support


Now to break it down part by part



this part is obvious, prevent *getpartymember throw error when the player doesn't own a party



change the scope of the killedrid from player based to script state
so there is no need to use *getvariableofpc (hercules) or *getvar (rAthena)


copy paste this part from script commands.txt

// loop through both and use 'isloggedin' to count online party members
    for (.@i = 0; .@i < $@partymembercount; ++.@i)
        if (isloggedin($@partymemberaid[.@i], $@partymembercid[.@i]))
            .@count_online++;
// We search accountID & charID because a single party can have
// multiple characters from the same account. Without searching
// through the charID, if a player has 2 characters from the same
// account inside the party but only 1 char online, it would count
// their online char twice.



the first 2 conditions is to check the party members are within range of the killer
means if the attached party member having same map with the killer, and within 30 cells of the killer

Why 30 ?? this is actually a magical number
you see, because the OnNPCKillEvent return the mob ID (1002) instead of game ID (11000021)
we can't really use mob controller system to retrieve the coordinate of the monster
so we use the range from the killer instead
I have actually tried to use getbattleflag("area_size") before, but players complained it doesn't work
so I increased the distance to 30 (about twice the length), and they say the script is fixed
weird ... I know, so the number 30 is kinda stuck in most of my scripts

1 possible explanation is this

if the Archer shoot long distances, like using a bow, throw arrow, or mage firebolt, crusader throw shield
then the party member from across the screen should gets the kill
"area_size" is 14, so 14+14 = 28, so 30 works for them


Hp ... you don't want the counter to increase for dead party member
so if that player is dead, Hp is 0, and the condition will become false there
this is to prevent having players increase the kill count by just AFK there


External Links:

Euphy's Hunting Mission ( check this line )
Party Share Kill ( tr0n's Quest Board )

Regular Expression Replace in Notepad++

Notepad++ can search strings and replace them using regular expression
Regular_Expression (Wikipedia)
it can be use to :-
1. generate a huge list of mapflags
2. fix outdated format on the script commands
3. apply a quick fix on CVS style database
4. convert client side item list into array




Example 1. Generate a huge list of mapflags


1. goto db/map_index.txt, copy over the map list

2. there are some lines commented, so find the line with // and remove them by doing this
Find with regular expression Replace with empty string, this effectively leave the line blank

3. Edit -> Line Operations -> Remove Empty lines

4. Find with regular expression Replace with


Example 2. Fix outdated format on the script commands


Find with regular expression Replace with

Example 3. Apply a quick fix on CVS style database

rathena only, Hercules has switched to libconfig format
goto db/re/item_db.txt

Find with regular expression Replace with Find with regular expression Replace with Find with regular expression Replace with


Example 4: Convert client side item list into array

goto kro/data/cardprefixnametable.txt

Find with regular expression Replace with


External Links:

Disable dead branch (Example 1) 
Convert pow(a,b) into a**b (Example 2)
Swap item type IT_ARMOR and IT_WEAPON (Example 3)
getitemname2 function (Example 4)

Saturday, February 2, 2019

One Character per GM account

Download:

Hercules Patch
Hercules Plugin

Very simple trick, only allow them to create/login their character on slot 0

if you want to make them limit to 3 characters, then allow them to only use slot 0,1,2

 

External Links:

One char per GM Account

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

showdigit

official documentation from script_commands.txt

there is much more than this

because the decremental counter for type 3 runs 2 ticks per seconds, it is not advise to use type 3
type 2 is much preferred, but it risk in going into negative value, so this is usually how I do it
use showdigit type 2 for the countdown, then sleep for the duration, type 3 with 0 value will remove it

and to use this practically for an event, let's say the event only last 5 minute

========================================================

Now for the weird part of this script command

No.1 it run together with pvp counter

if you enter a PVP map, and try to showdigit, it actually show both of them
 so NEVER use showdigit inside a PVP map


No.2 log out and log in , the counter continues

this is another weird bug about *showdigit, it only send a value to the client
the countdown is totally handle by the client

for example from the script above,
if you log out inside the guild_vs2 map, just change character, log in back, the counter still shows
OnPCLogoutEvent also fail to remove it


External Links:

How to put countdown
showdigit will continue to countdown if the player logout

Tuesday, January 29, 2019

Units move diagonally then move in straight line

I'm sure those who have play firewall mage understand this
Because it is moving in such a weird behavior,
a normal distance script command, or Pythagoras distance check isn't accurate

When input X +5, Y -10, phythagoras distance function expected 1650 mili-seconds,
but travel_time function expected 1800 mili-seconds
the result is 1872 mili-seconds

Thus travel_time function should be use instead,
simple, just  (2min)² + (max - min) where min is X or Y, which one is smaller, and the opposite for max


See also:

Ragnarok Online use number of Squares to count distance  
A simple walking npc script

Monday, January 28, 2019

Daily Quest - use gettimetick(2) or gettimestr ?

Most people when thinking about Daily Quest, they think it as a quest repeatable every 24-hours


but my experience playing other MMORPG games, it actually reset at 12am
yes, I can finish this quest by 11.59pm, and redo it again at 12.00am



I would prefer to use *gettimestr method, unless being explicitly ask redeem the prize every 24 hours
I prefer *gettimestr over gettime(GETTIME_DAYOFYEAR) because I can read the value clearly
gettimestr("%Y%m%d", 9) return 20190128 



External Link:

OnHour00 players value recover 
Daily Rewards
Delete on char_reg_num on a specific time

Sunday, January 27, 2019

The importance of *gettimestr

*gettimestr is probably another underused script command,
because members always think *gettime can do the same, but actually its the opposite

it can simplify an hourly announcer script
into



This is the script tested on Microsoft Visual Studio 2017Note: if you found some other format, then you have to try it out yourself
if it crash, means not compatible


External Links:

https://herc.ws/wiki/Gettimestr

How to create your own WOE castle map

This is the simplest woe script I could make, remember to add a line in db/castle_db.txt !!
There are too many things to cover in this article, so have to break it down bits-by-bits

gvg_castle mapflag is the unique mapflag meant for this situation, this is what is does
1. with agitcheck() on, players with different guild ID can kill each other
2. the emperium unable to kill by its own guild member
the rest are all done by scripting, example like emperium spawn in empty castle, refresh of the guild emblem ...
remember the guild MUST have Guild Approval skill learned to hit the emperium !!

GUILD_FLAG(722) is a special npc ID that can shows the emblem of the guild, and it can be use outside of woe script
1. *flagemblem script command only works on this npc ID
2. donpcevent "::On1234" can be use to execute all npc with this label name, this can be use in other situation too
3. *requestguildinfo script command is needed when you want to show the emblem during server start-up -> OnAgitInit:

OnAgitInit: label only execute when the map-server successfully connect to char-server
the reason for using OnAgitInit: is because the guild information are usually store in char-server,
so map-server doesn't need to load unneeded information

if you trying to use OnInit: expecting to load the flag emblem during server startup, you'll find it is not loading the emblem
BUT it can solve the problem if you want the emblem to shows during @reloadscript

*setcastledata script command has a bunch of info that can use, all these are done with scripting,
there is totally nothing in the source code to change this whatsoever
in other words, if you want to make a custom woe script, you can abuse value 6/7/8 which is currently unused to use for your custom idea !
Note: in rAthena they are constant names CD_NEXT_TIME, CD_PAY_TIME, CD_CREATE_TIME

OnGuildBreak: works when the guild disband and the guild owns a castle, it will run this label
it is directly run from the source when the guild master /breakguild "guild name"


External Link:

woe auto assign on guild (script

Thursday, January 24, 2019

classchange - npc shown only to certain players

The npc is shown only to 1 player, this screenshot must be fake !!

just kidding, this script command is available since the new novice training ground released

And again ... as always, Hercules and rAthena having different ways to do this

Hercules


rAthena


---- This has been tested on both Hercules and rAthena, both behave the same way -----

*classchange ... the way is works is ...
IF you are within the sight range of the npc, it will change its sprite ID

as example above, this npc was visible from the beginning, and hides upon clicking it
BUT if you walk away from it, and come back again, it will mysteriously appear again

so in order to have only selective players can see this npc, (GMs, players with variables)
the only way I think of, is using OnTouch


even with that, my test result shows certain npc ID are unable to change sprite. These are :-
1. FAKE_NPC (-1)
2. WARPNPC (45)
3. HIDDEN_NPC (111)

HIDDEN_WARP_NPC (139) works fine, make this is the only npc ID that hides your npc

-------------------------------------------------------

another thing I want to make note is ...
because Hercules use <char id> instead of  bc_flag, seems can do like this
but actually it is not.
If you load the script upon server startup, and login later, you wont able to see the npc
after all, *classchange only effective if you are standing in range with the npc

How to compare a value within an array

setarray .@abc[0], 1,2,6,8,9,11,21,34,55,61;
how to determine the value 6 is in the array ?

I'm sure most people will loop it
yeah ~ this is so basic ~

Now let me show you 3 other methods

 

Method No.1 -> use while loop




Method No.2 -> compare with strings




Method No.3 -> use array as pointers




And of course don't forget, rAthena's *countinarray

OK seriously this one is cheating


-------------------------------------------------------

Of course all 3 methods has its own weakness

Method no.1 - it run an extra index within the while-loop

this one will throw error


Method no.2 - when using *countstr, countstr("#1#1#1#", "#1#"); will return 2
means, "#1#1#1#" is for *compare script command,
"#1##1##1#" is for *countstr


Method no.3 cannot use string, like IP address
.@abc["127.0.0.1"]  <-- of course doesn't work

External Links:

Help removing duplicate value from array
How to make list ID for mobs (method No. 1)
Special Party Warper (method No.2)
Please help this script about mac-address (method No.2)
getitemname2 function (method No.3)
party soul link (method No.3)

Stylist

updated Stylist script with Summoner Class range support, and 3rd class body style support
Current version is 1.4
Hercules Download
rAthena Download


this time doesn't use blacklist range, but use allow range in CSV format
This means, the ID range for hair style is 0,1,2,3,4,5,11,12,13,14,15,16,17,18,20,21,22,23
2nd line means Summoner job can only use clothing range 0 and 1, this prevent crash client


1.0 - script
- there is a bug on Euphy's stylist npc, the style number should start with 0, but his script always start with 1
- and the naming sense very bad, .@style and .@styles, should be avoided

1.1 - script
- allow blacklist certain styles

1.2 - script
- change from blacklist into CSV format, this one is understood by many

1.3 - Hercules . rAthena
- add Job_Summoner, to prevent client crash from invalid cloth color

1.4 - Hercules . rAthena
- add 3rd job body style change

Wednesday, January 23, 2019

The reason why *getmapxy uses UNITTYPE constants

Ever wonder why *getmapxy introduced a new constant using the same value as *getunittype ?

That reason is because I wanted to allow *getmapxy can retrieve the coordinate of the unit

You see, the *getunitdata script command can only return integer value,
thus the map name return as string is not recommended
- although *getmonsterinfo with MOB_NAME can return string while others return integer...
--- I wonder why aleos never think about it ?

And ... with my Pull Request merge, Hercules can do like this
however this cannot be done in rAthena

so rAthena has to stuck with *getunitdata
the worst thing is it doesn't return map name, it return map ID
and have to use another script command *mapid2name to turn map ID into map name



Update, it seems rAthena has updated *getmapxy script command, and changed UNITTYPE_ into BL_
however it still couldn't search with BL_MOB type, so it doesn't change much

External Links:

https://github.com/HerculesWS/Hercules/pull/871
https://github.com/rathena/rathena/issues/3100

Tuesday, January 22, 2019

mapmoblist - script version

Since the source modification are untrustworthy ... always break in updates,
sometimes its better to do in script version if possible
so I made the script version for this

rAthena


when converted into Hercules however, I found out *getunits doesn't catch dead monsters being alive


So this is another difference between Hercules<->rAthena

On a side note, when I did a forum search on Hercules,
this script incidentally solve the question on the board :P

External Links

I got error when applying custom commands
Dastgir's Plugin Collections

The meaning behind the value of movement speed

Note: due to Hercules' mob controller system broken, this guide is demonstrate in rAthena

The value of normal player movement speed is 150
if type @speed 150, even you have agi up buff, it says your movement speed return to normal
so what is the meaning of 150 ?

simple, it means it take 150 mili-seconds to walk 1 cell (horizontal/vertically)
mathematics !! 5 cells = 150 * 5 = 750 mili-seconds reach there

now for poring ... it is set to 400 means, it takes 400 mili-seconds to walk 1 cell
scorpion is 200, means 200 mili-seconds to walk 1 cell
in other words, poring in 2 seconds can walk 5 cells, and scorpion can walk 10 cells in 2 seconds

walk 5 cells at 400 speed = sleep 400 * 5; = 2000 mili-seconds
walk 10 cells at 200 speed = sleep 200 * 10; = 2000 mili-seconds

and here I make this script for fun to demonstrate the distance-time relations



See Also

Ragnarok Online use number of Squares to count distance 

External Links:

walking monster

Mathematics - Pythagorean theorem

in previous article, we cover why monster take 7 cells to the right is same amount of time moving 5 cells diagonally

reason ? Pythagorean theorem
A² + B² = C²
since monster is moving diagonally (45º), A = B
5² + 5² = C²
2(25) = C²
50^½ = C
C = 7.07106...

so, what if it is the opposite ?
let's say I have 30 cells to the right, and I want to know how many cells needed to travel diagonally in the same amount of time
the formula is
2(A²) = C²
where C = 30
2(A²) = 30²
2(A²) = 900
A² = 450
A =  21.21320....

Monday, January 21, 2019

Run a macro in Notepad++

Notepad++ has macro feature, very useful if you want to repeat the same action over again in a file
A fine example is generate a huge array list

Example 1: Generate a full map list in your server

1. goto db/map_index.txt, copy over the map list
2. there are some lines commented, so find the line with // and remove them
3. start the line with setarray .map$, "
4. on the Macro menu, select Start Recording
5. now the macro will record your action. Input the follow keystroke in sequence
 a. double quotation mark
 b. comma
 c. double quotation mark
 d. delete key
 e. End key
6. on the Macro menu, select Stop Recording
7. on the Macro menu, select Run a Macro multiple times
8. Select Run until the end of the file

Example 2: Generate a list from SQL database

1. run the SQL command.
2. export the record set into external format
.... and repeat the above process

External Links:

kill 20k mobs to summon a world boss invasion
npc mix cards

Display Item description inside npc dialog

very unpopular, yet useful for displaying item names inside npc dialog




Note: This link doesn't show the Item Slot
example, Item ID 1201,1202,1203 are all Knife with different amount of slots
when you have these items in your inventory, it display the slot just below the item description
but when you display it inside mes, right click on it, it doesn't show the slot

External Link:

Add F_MesItemInfo function to show item name with description link

Ragnarok Online use number of Squares to count distance

This is something very weird with Ragnarok Online
the distance check in straight line and diagonally are the same value

both return 5 !!
even though the 2nd one should return 7

and this causes some problem when we try to count the time needed to move from point A to B

Here is a script that you can test

let's say input 5, go to the right takes 827 mili-seconds in-game
go to the down-right actually takes 1123 mili-seconds -> means longer

to actually make the travel time same for straight line and diagonal line
the straight line needs 7 cells distance to match the 5 cells distance diagonally - 1123 mili-seconds
same, straight line takes 14 cells distance to match 10 cells distance diagonally - 2168 mili-seconds

There IS a circular check in the source code where you can enable it
however, the circular check, I'm not so sure about its accuracy
that formula is taken from here


All 3 gave different answer. When test in-game however,
the straight line needs 11 cells distance to match 8 cells distance diagonally - 1747 mili-seconds
means the formula encode inside our emulator, it might calculate the distance wrong ??
well ... I think this is minor though, because I think nobody actually compile with CIRCULAR_AREA enabled


PS: Currently this feature cannot test on Hercules server because Hercules mob controller is still broken


See also :

Previous -> The meaning behind the value of movement speed
Mathematics - Phythagorean Theorem
next article -> Units move diagonally then move in straight line

Tuesday, January 15, 2019

MVP vs MVP Event




Looks fun ?
however this event is not control by scripts, but entirely control by GM commands

This is how you do it

Step 1:

login multi 2 GM clients, then @hide both of them

Step 2:

@warp g_room1-1 75 153
then @duel between them

Step 3:

one GM "@summon 1916 60", another GM "@summon 2022 60"



Enjoy the result

Note: have to "@summon 1916 60" with the 60 on it,
without it, it will last only 1 minute, but with 60, it will last 60 minutes


External Links:
Request MVP tournament
MVP vs MVP event




weird, the retaliate to master is no longer needed, I leave it as yes

Monday, January 14, 2019

Dressing Girl

Dressing Room script

Players can preview these headgear from the array
the reason why I didn't use dynamic shop is because player can abuse it


version 1.1 has tested in rAthena, just change the Item constants into Item ID


Hercules has version 1.3



the room part isn't done however, this is just the npc

Sunday, January 13, 2019

The reason why *checkwall exist

During that time, I was cleaning up my battleground script template,
I didn't notice the *delwall script command was used twice <-- thanks to Atemo !
thus I made a pull request to throw a debug message when *delwall use twice

it was done that way because I thought *delwall script command is only meant for event script
when event commence = *setwall, and when start = *delwall ... simple as that

then I immediately receive complaints many server throw errors on them because of my pull request
when I ask how they get the error, answer was shocking for me
they actually use the *setwall/*delwall for Utility script !!

I can't remember the conversation or the script, but its something like this


Honestly I have no answer for them at the time ...

and thus the *checkwall script command was added later to fix this issue


Moral of the story : never underestimate the creativity of the community =/
well ... enablenpc/disablenpc ... this script command also doesn't throw error when use multiple times
imagine if we actually throw error for the *disablenpc .... hahaha~

Saturday, January 12, 2019

Bitmask


This was a good discussion topic while I was still rAthena scripting moderator


Basically, script_commands.txt already explained quite well
I also had a template script to play around with it


one example that explained not so well in script_commands.txt about getnameditem
basically, what he is trying to tell, is just like this


both Hercules and rAthena script engine has every script variable as int signed, which is 31 bits
but with this template provided by Keyworld, the upper limit becomes 2040 bits (255*8=2040)
I remember Keyworld said that might be useful for saving a player's skill tree into SQL table, but he never complete it

Thursday, January 10, 2019

A simple walking npc script



External Links:
Walking NPC script

Wednesday, January 9, 2019

Compare dynamic shop between rathena & hercules

I wonder how many of you still remember that old dynamic shop script ?

because no one is using this method anymore ~ so long eAthena legacy ~



Hercules

rAthena



Hercules seems longer because Hercules encourage use Item/Mob constants instead of numbers, for better readability

This one is pretty straightforward
if you want to learn more, refer to script_commands.txt for more detail information

Compare Instance script between rAthena & Hercules

Hercules

  1. Hercules has more instance related script commands, but also make this more flexible and versatile once you learn to use them
    • Hercules has *instance_attach script command, make sure this script command is added AFTER *instance_init if you want the script to do some other stuffs inside the instance during the registration phase.
    • Hercules has to emulate the map name with *instance_attachmap if the map name doesn't follow the syntax <number>@<5 string limit>
  2. Hercules instance ID start from 0, rathena instance ID start from 1
    • Make sure the instance_announce is set to -1
-------------------------------

rAthena


  1. rathena has instance_db.yml file ... make sure you add these line then @reloadinstancedb 
    • dealing with .yml file in rathena is really a headche, sometimes it spits error that doesn't make sense, and all you have to do is add/remove a single space or new line ...
  2. rAthena relies on instance_id(IM_type) to know which instance ID the player belongs in.
  3. rathena has much less instance related script command, making rathena instance script easier to learn, but there is a drawback
    • not as flexible as hercules having *instance_timeout script command ... this value is hardcoded into database so all party has to use the same timeout value
  4.  rathena instance ID start from 1, hercules instance ID start from 0
    • make sure the instance_announce is set to 0 
rAthena *instance_enter doesn't work with IM_NONE .... wait is rathena only works with IM_PARTY, all other types doesn't work at this moment

Note: I didn't file a bug report because I was assuming they going to fix in this pull request rAthena has a bug that prevents you from entering multiple instance


Player A has same party with player B.
Player A has same guild with player C.

Player B create Instance ONE for party.
Player C create Instance TWO for guild.

Player A supposedly can go in both instance, but player A can only go to the party instance, not the guild
Hercules doesn't suffer from this issue.

External Links

Help learning instance and how it works - rAthena & Hercules
Doubt about instance_create command

Tuesday, January 8, 2019

Private MVP Room

not much to say about this ...
other than ... my scripts buried deep inside Script Request section ...
at this moment lazy to write a detail description about ... ahhh ~~ just lazy



Private MVP room 1.4b
https://rathena.org/board/topic/72376-mvp-summon-script/?do=findComment&comment=245270

Private MVP room 1.4c
http://herc.ws/board/topic/4841-annies-mvp-room-disable-spawn/


and of course the cleanest version, thanks to Euphy for asking ~
https://github.com/rathena/rathena/blob/master/npc/custom/etc/mvp_room.txt


when I feel like do instance ... urgh .... rathena and hercules has different methods ... damn

How to install a plugin

Step 1

Download the YourProject.c file in the \src\plugins\ folder

Step 2

If using MSVC 2017, navigate to \vcproj-15\

Step 3

Select plugin-sample.vcxproj, copy paste it

Step 4

Rename plugin-sample - Copy.vcxproj into YourProject.vcxproj
While renaming, Highlight the word YourProject and Copy it by Ctrl+C

Step 5

Right-Click on YourFile.vcxproj, Select Edit with Notepad++, or Microsoft Notepad

Step 6

Find this line
<ProjectName>plugin-sample</ProjectName>


Rename plugin-sample to YourProject by Ctrl+V

Step 7

Find this line
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">sample</TargetName>

Rename sample to YourProject by Ctrl+V
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">YourProject</TargetName>

Step 8

Find this line
<ClCompile Include="..\src\plugins\sample.c" /> 

Rename sample to YourProject by Ctrl+V

Step 9

Press Ctrl+S to save the file.

Step 10

Open Hercules-15.sln,


Step 11

Right-click Hercules-10', Select Add -> Existing Project...

Step 12

Select YourProject.vcxproj in the \vcproj-15\ folder

Step 13

Right-click Hercules-10, Select Build-Solution
 

External Link:

http://herc.ws/wiki/Building_HPM_Plugin_for_MSVC

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