Update: Working on the latest rathena version as of the date I'm typing this.
// SERVER SIDE
1. Open src/map/status.cpp
find and add after case SC_JEXPBOOST:
case SC_EXPBOOST:
case SC_JEXPBOOST:
case SC_VIPSTATE: // VIP Status Icon
case SC_PERIOD_RECEIVEITEM_2ND:
case SC_PERIOD_PLUSEXP_2ND:
2. Open src/map/status.hpp
find and add before SC_MAX,
SC_OVERCOMING_CRISIS,
SC_VIPSTATE = 2000, // VIP Status Icon
SC_MAX, //Automatically updated max, used in for's to check we are within bounds.
find and add before EFST_MAX,
/// Do not modify code above this, since it will be automatically generated by the API again
EFST_VIPSTATE = 2000, // VIP Status Icon
EFST_MAX,
3. Open src/map/script_constants.hpp
find and add after export_constant(SC_OVERCOMING_CRISIS);
export_constant(SC_CONTENTS_20);
export_constant(SC_OVERCOMING_CRISIS);
export_constant(SC_VIPSTATE); // VIP Status Icon
/// Do not modify code below this, until the end of the API hook, since it will be automatically generated again
find and add after export_constant(EFST_C_BUFF_9);
export_constant(EFST_C_BUFF_9);
export_constant(EFST_VIPSTATE); // VIP Status Icon
/// @APIHOOK_END
4. Open db/import/status.yml
copy and paste (your status.yml should look like this if you haven't added any custom sc_status)
Header:
Type: STATUS_DB
Version: 4
Body:
- Status: Vipstate
Icon: EFST_VIPSTATE
Flags:
NoRemoveOnDead: true
NoDispell: true
NoBanishingBuster: true
NoClearance: true
5. Open db/import/item_db.yml or db/pre-re/item_db_usable.yml (up to you)
- Id: 30000
AegisName: Vip_Card_3D
Name: VIP Card 3D
Type: Cash
Buy: 20
Weight: 10
Trade:
NoDrop: true
NoSell: true
NoGuildStorage: true
NoMail: true
NoAuction: true
Script: |
if (vip_status(VIP_STATUS_ACTIVE)) {
dispbottom "You have extended your VIP duration.";
} else {
dispbottom "You have successfully become a VIP member.";
sc_start SC_VIPSTATE,-1,1;
}
vip_time 4320;
- Id: 30001
AegisName: Vip_Card_7D
Name: VIP Card 7D
Type: Cash
Buy: 20
Weight: 10
Trade:
NoDrop: true
NoSell: true
NoGuildStorage: true
NoMail: true
NoAuction: true
Script: |
if (vip_status(VIP_STATUS_ACTIVE)) {
dispbottom "You have extended your VIP duration.";
} else {
dispbottom "You have successfully become a VIP member.";
sc_start SC_VIPSTATE,-1,1;
}
vip_time 10080;
- Id: 30002
AegisName: Vip_Card_30D
Name: VIP Card 30D
Type: Cash
Buy: 20
Weight: 10
Trade:
NoDrop: true
NoSell: true
NoGuildStorage: true
NoMail: true
NoAuction: true
Script: |
if (vip_status(VIP_STATUS_ACTIVE)) {
dispbottom "You have extended your VIP duration.";
} else {
dispbottom "You have successfully become a VIP member.";
sc_start SC_VIPSTATE,-1,1;
}
vip_time 43200;
6. Open npc/custom and add a text file named vip_system.txt
copy and paste
- script VIP_TIME -1,{
OnPCLoginEvent:
if (vip_status(1)) {
.@remain = vip_status(VIP_STATUS_REMAINING); // seconds
dispbottom "Remaining VIP duration: " + Time2Str(vip_status(VIP_STATUS_REMAINING) + gettimetick(2));
sc_start SC_VIPSTATE, .@remain * 1000, 1;
end;
}
OnPCLogoutEvent:
if (vip_status(1)) {
sc_end SC_VIPSTATE; // remove the buff to update the timer on login
}
end;
}
7. Open npc/scripts_custom.conf
add to the last line
npc: npc/custom/vip_system.txt
8. Recompile your server
// CLIENT SIDE
1. You need four files from your RO GRF. Locate and extract them first from luafiles514/lua files/stateicon/
efstids.lub
stateiconimginfo.lub
stateiconinfo.lub
stateiconinfo_f.lub // I'm not sure if this one is necessary but I decided to include it anyway xD
2. Edit efstids.lub
Scroll down last line and add.
EFST_VIPSTATE = 2000,
3. Edit stateiconimginfo.lub
Scroll down last line and add. Edit to your liking.
StateIconList[EFST_IDs.EFST_VIPSTATE] = {
haveTimeLimit = 1,
posTimeLimitStr = 2,
descript = {
{ "VIP", COLOR_TITLE_BUFF },
{ "%s", COLOR_TIME },
{ "Base EXP Rate +50%" },
{ "Job EXP Rate +50%" },
{ "Drop Rate +50%" },
{ "Additional 300 Storage Slot" },
{ "Ignore gemstone requirement for skills" },
{ "Max character limit increase" },
{ "Auto Attack Feature" },
}
}
4. Edit stateiconinfo.lub
Scroll down last line and add.
[EFST_IDs.EFST_VIPSTATE] = "vipicon.tga",
5. Edit stateiconinfo_f.lub
Scroll down last line and add.
EFST_IDs.EFST_VIPSTATE,
Done! Congratulations!
Free VIP Icon from here. Put it inside your grf - data\texture\effect
Note: The timer on the VIP status icon will not be displayed if the duration exceeds 24 days and 19 hours. Unfortunately, I don't know how to make this possible either.