Jump to content
  • 0

Store Buff remaining timer to globalreg


Question

Posted (edited)

Hi rAthena,

Question : Can someone help me on how to store buff 'remaining timer' to 'setglobalreg'?

I'm trying to make a global account buff

Thank you in advance!! :)

like :

Quote

 

if (type == SC_TESTBUFF)

setglobalreg(sd, add_str("remainingbuff"), <remaining timer>)

 

 

Edited by hakuren

2 answers to this question

Recommended Posts

  • 0
Posted (edited)

try this.


-	script	Sample	-1,{
	OnInit:
		.sc_id = SC_BLESSING;
		end;

	OnPCLoginEvent:
		if (#REMAINING_TIME_SC > 0) {
			if (getstatus(.sc_id, 5))
				sc_end .sc_id;
			sc_start .sc_id, #REMAINING_TIME_SC, 10;
			dispbottom "Buff Duration Left: "+(#REMAINING_TIME_SC / 1000)+" Second(s).";
		}
		end;
		
	OnPCLogoutEvent:
		#REMAINING_TIME_SC = getstatus(.sc_id,5);
		end;
}

 

EDIT: ops didnt realize its source support

Edited by Emistry
  • 0
Posted (edited)
On 9/12/2017 at 2:27 PM, Emistry said:

try this.



-	script	Sample	-1,{
	OnInit:
		.sc_id = SC_BLESSING;
		end;

	OnPCLoginEvent:
		if (#REMAINING_TIME_SC > 0) {
			if (getstatus(.sc_id, 5))
				sc_end .sc_id;
			sc_start .sc_id, #REMAINING_TIME_SC, 10;
			dispbottom "Buff Duration Left: "+(#REMAINING_TIME_SC / 1000)+" Second(s).";
		}
		end;
		
	OnPCLogoutEvent:
		#REMAINING_TIME_SC = getstatus(.sc_id,5);
		end;
}

 

EDIT: ops didnt realize its source support

thankyou for the script @Emistry 

but i need script inside the source but i really appreciate your script maybe if no body answer my question i will use your script instead :)

EDIT : and thank you i didn't notice that script command "getstatus" now i need to apply that to my script :)

Edited by hakuren

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...