Jump to content
  • 5

VIP STATUS ICON ERROR (status_change_start: Invalid status change (1500)!)


funtwocrasher

Question


  • Group:  Members
  • Topic Count:  57
  • Topics Per Day:  0.01
  • Content Count:  143
  • Reputation:   4
  • Joined:  06/17/12
  • Last Seen:  

Hi! I added a custom status icon (VIP Users). But I have trouble implementing them. This is what I did.

1. src/map/status.cpp
Added 
case SC_VIPSTATE:
After
case SC_JEXPBOOST:

2. src/map/status.hpp
Added
SC_VIPSTATE = 1500,
Before
SC_MAX,

3. src/map/status.hpp
Added
EFST_VIPSTATE = 1500,
Before
EFST_MAX,

4. src/map/script_constants.hpp

Added the following on their respective lines.
export_constant(SC_VIPSTATE);
export_deprecated_constant2("SI_VIPSTATE",1500);
export_constant(EFST_VIPSTATE);

5. efstids.lub

EFST_VIPSTATE = 1500,

 stateiconimginfo.lub
[EFST_IDs.EFST_VIPSTATE] = "vip.tga",

 stateiconinfo.lub

StateIconList[EFST_IDs.EFST_VIPSTATE] = {
    haveTimeLimit = 1,
    posTimeLimitStr = 2,
    descript = {
        { "VIP MEMBER", COLOR_TITLE_BUFF },
        { "Exp Bonus 10%" },
        { "Job Exp Bonus 10%" },
        { "Drop Rate Bonus 10%" },
        { "Additional 300 Storage Slot" },
        { "Can use command" },
        { "@autoattack" },
        { "@autotrade" },
        { "@autoloot" },
        { "Can get Fairy Buff for +5 All stats" }
    }
    
}


6. Iteminfo.yml

 Script: |
      vip_time(1440); sc_start SC_VIPSTATE,-1,0;






I did all these things but i still receive an error and nothing works,
image.png.e4fdbca5d1f2939a832aa51f1e27cd9e.png

If anyone can help me, I would really appreciate it. Thank you very much!

Edited by funtwocrasher
  • Upvote 1
Link to comment
Share on other sites

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  55
  • Reputation:   3
  • Joined:  11/29/13
  • Last Seen:  

image.thumb.png.607d3ffb082b656f4c2ecb4ff054ad72.png

Ok, i solved this.

First of all, just follow the guide from @funtwocrasher on the first page.
The only difference is, i used id of 2001 instead of 1500.

Once you followed the guide step-by-step, you need to add your custom status in db\status.yml and put it on the latest status like below:

  - Status: VIPSTATE
    Icon: EFST_VIPSTATE
    Flags:
      NoDispell: true
      NoBanishingBuster: true

Note: If there is nothing in your status.yml, you have to add it like this:

Body:
  - Status: VIPSTATE
    Icon: EFST_VIPSTATE
    Flags:
      NoDispell: true
      NoBanishingBuster: true

That is what caused the error log on the console - status_change_start: Invalid status change (1500)!.

Now, recompile your server.
Once you've done, you are supposed to be able to use sc_start SC_VIPSTATE now.

However, you might notice the timer and the actual timer for the VIP is not in sync.
To solve this problem, i created a custom function which you can call from your item or npc:

function	script	vip_system	{
	set .@time, getarg(0); // retrieve the time (in seconds) from index 0 of the argument
	set .@current_time, vip_status(3); // get the actual vip remaining time
	set .@renew_time, .@time + .@current_time;

	dispbottom "Welcome to the VIP club!";
	atcommand "@vip +" + .@time + "s " + strcharinfo(0) + "";

	if (!vip_status(1)) {
		sc_start SC_VIPSTATE,.@time * 1000,0;
		dispbottom "You are now a VIP member!";
	} else {
		sc_start SC_VIPSTATE,.@renew_time * 1000,0;
		dispbottom "You have succesfully extends your VIP membership.";
	}
}

To use the function, simply call it like this:

Script: |
      callfunc "vip_system",30;

But using this function alone is not enough, you need to create another npc to detect and update the buff icon timer whenever the user logged in to resync the timer:

-	script	VipStatus	-1,{
OnPCLoginEvent:
	set .@current_time, vip_status(3);

	sc_end EFST_VIPSTATE;
	sc_start SC_VIPSTATE,.@current_time * 1000,0;
    end;
}

Voila! It is done.

Some common issues:
1. If somehow, using sc_start still does not show the buff status icon, you can use the same thing that @Louis T Steinhil mentioned before:

// replace every sc_start SC_VIPSTATE with this one
bonus_script "{}",.@time,0,0,EFST_VIPSTATE2;

// replace every sc_end EFST_VIPSTATE with this one
bonus_script_clear 1;

docs regarding this can be found here:
https://raw.githubusercontent.com/rathena/rathena/master/doc/script_commands.txt

2. I haven't tested the timer if the timer exceed a few weeks.
3. This is a known issues since early days of rAthena and also at Hercules. Once the VIP ends, it does not really end directly. You need to wait a couple of minutes before it completely expires or if the user re-login. There is nothing that i can do to solve this. More info regarding this issue can be found in Hercules forum: https://board.herc.ws/topic/250-official-vip-system/
4. If somehow your custom status icon does not appear. Try to do double check on your client config. More info regarding this can be learned from here:

 

Edited by Jesky
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.01
  • Content Count:  10
  • Reputation:   0
  • Joined:  11/11/24
  • Last Seen:  

On 10/9/2024 at 8:52 PM, Jesky said:

image.thumb.png.607d3ffb082b656f4c2ecb4ff054ad72.png

Ok, i solved this.

First of all, just follow the guide from @funtwocrasher on the first page.
The only difference is, i used id of 2001 instead of 1500.

Once you followed the guide step-by-step, you need to add your custom status in db\status.yml and put it on the latest status like below:

  - Status: VIPSTATE
    Icon: EFST_VIPSTATE
    Flags:
      NoDispell: true
      NoBanishingBuster: true

Note: If there is nothing in your status.yml, you have to add it like this:

Body:
  - Status: VIPSTATE
    Icon: EFST_VIPSTATE
    Flags:
      NoDispell: true
      NoBanishingBuster: true

That is what caused the error log on the console - status_change_start: Invalid status change (1500)!.

Now, recompile your server.
Once you've done, you are supposed to be able to use sc_start SC_VIPSTATE now.

However, you might notice the timer and the actual timer for the VIP is not in sync.
To solve this problem, i created a custom function which you can call from your item or npc:

function	script	vip_system	{
	set .@time, getarg(0); // retrieve the time (in seconds) from index 0 of the argument
	set .@current_time, vip_status(3); // get the actual vip remaining time
	set .@renew_time, .@time + .@current_time;

	dispbottom "Welcome to the VIP club!";
	atcommand "@vip +" + .@time + "s " + strcharinfo(0) + "";

	if (!vip_status(1)) {
		sc_start SC_VIPSTATE,.@time * 1000,0;
		dispbottom "You are now a VIP member!";
	} else {
		sc_start SC_VIPSTATE,.@renew_time * 1000,0;
		dispbottom "You have succesfully extends your VIP membership.";
	}
}

To use the function, simply call it like this:

Script: |
      callfunc "vip_system",30;

But using this function alone is not enough, you need to create another npc to detect and update the buff icon timer whenever the user logged in to resync the timer:

-	script	VipStatus	-1,{
OnPCLoginEvent:
	set .@current_time, vip_status(3);

	sc_end EFST_VIPSTATE;
	sc_start SC_VIPSTATE,.@current_time * 1000,0;
    end;
}

Voila! It is done.

Some common issues:
1. If somehow, using sc_start still does not show the buff status icon, you can use the same thing that @Louis T Steinhil mentioned before:

// replace every sc_start SC_VIPSTATE with this one
bonus_script "{}",.@time,0,0,EFST_VIPSTATE2;

// replace every sc_end EFST_VIPSTATE with this one
bonus_script_clear 1;

docs regarding this can be found here:
https://raw.githubusercontent.com/rathena/rathena/master/doc/script_commands.txt

2. I haven't tested the timer if the timer exceed a few weeks.
3. This is a known issues since early days of rAthena and also at Hercules. Once the VIP ends, it does not really end directly. You need to wait a couple of minutes before it completely expires or if the user re-login. There is nothing that i can do to solve this. More info regarding this issue can be found in Hercules forum: https://board.herc.ws/topic/250-official-vip-system/
4. If somehow your custom status icon does not appear. Try to do double check on your client config. More info regarding this can be learned from here:

 

Did it all and still not showing  =(

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...