Jump to content
  • 0

Store Buff remaining timer to globalreg


hakuren

Question


  • Group:  Members
  • Topic Count:  120
  • Topics Per Day:  0.02
  • Content Count:  295
  • Reputation:   6
  • Joined:  12/02/11
  • Last Seen:  

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
Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10018
  • Reputation:   2369
  • Joined:  10/28/11
  • Last Seen:  

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
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  120
  • Topics Per Day:  0.02
  • Content Count:  295
  • Reputation:   6
  • Joined:  12/02/11
  • Last Seen:  

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