Jump to content
  • 0

sc_start on all characters


Limestone

Question


  • Group:  Members
  • Topic Count:  155
  • Topics Per Day:  0.03
  • Content Count:  647
  • Reputation:   16
  • Joined:  11/21/11
  • Last Seen:  

Hi all, pls help me with my problem, how can I make a script like this. If the npc sets sc_start (that has a time) on me, also all the characters that is online by that time will have my sc_start too.. if online, they will acquire it automatically, if not.. the OnPCLoadMapEvent (i think) will trigger the sc_start once the other character that does not have the sc_start. sorry for my bad english. Thanks!

Link to comment
Share on other sites

6 answers to this question

Recommended Posts


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

prontera,150,180,6	script	dfghgf	56,{
	if ( .global_buff - gettimetick(1) > 0 ) {
		mes "There is already a special buff. Come later !";
		close;
	}
	mes "Everyone will get a buff for 6 mins.";
	close2;
	.global_buff = gettimetick(1) + 360;// 360 secs
	addrid 0;
	sc_start SC_STRFood,360000,10;// 360 secs
	end;

OnPCLoginEvent:
	if ( .global_buff - gettimetick(1) > 0 ) {
		.@timer = ( .global_buff - gettimetick(1) ) * 1000;
		sc_start SC_STRFood, .@timer,10;
	}
	end;
OnPCLogoutEvent:
	if ( .global_buff - gettimetick(1) > 0 )// remove the buff to update the timer on login
		sc_end SC_STRFood;
	end;
}

 

if the sc ended and some of the characters are not yet logged in, once they logged in they will still recieve the sc? If yes, make it no, and is this possible? And let say the npc triggers the sc already and its 20 mins is passed after the npc activates thr sc. For the new log in characters, they will only recieve the remaining time.

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

prontera,150,180,6	script	dfghgf	56,{
	$global_buff++;
	addrid 0;
	sc_start SC_STRFood,360000,10;
	#my_buff = $global_buff;
	end;

OnPCLoginEvent:
	if ( $global_buff != #my_buff ) {
		sc_start SC_STRFood,360000,10;
		#my_buff = $global_buff;
	}
	end;
}

Not sure what you want to do. Only gm can set it ? (not the case in the script above)

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  48
  • Topics Per Day:  0.01
  • Content Count:  1443
  • Reputation:   337
  • Joined:  10/17/12
  • Last Seen:  

well i have already written my variant and Capuche posts so ill post anyways -..-

-	script	sc_server	-1,{
OnHour18:
	SC_Enable = 1;
	addrid(0);
	sc_start SC_SUMMER,-1,0;
end;
OnHour20:
	SC_Enable = 0;
	addrid(0);
	sc_end SC_SUMMER;
end;
OnPCLoginEvent:
	if(SC_Enable) sc_start SC_SUMMER,-1,0;
end;
}

this version automatically disables the SC after an alotted time


prontera,150,180,6	script	dfghgf	56,{
	$global_buff++;
	addrid 0;
	sc_start SC_STRFood,360000,10;
	#my_buff = $global_buff;
	end;

OnPCLoginEvent:
	if ( $global_buff != #my_buff ) {
		sc_start SC_STRFood,360000,10;
		#my_buff = $global_buff;
	}
	end;
}

Not sure what you want to do. Only gm can set it ? (not the case in the script above)

 

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  155
  • Topics Per Day:  0.03
  • Content Count:  647
  • Reputation:   16
  • Joined:  11/21/11
  • Last Seen:  

prontera,150,180,6	script	dfghgf	56,{
	$global_buff++;
	addrid 0;
	sc_start SC_STRFood,360000,10;
	#my_buff = $global_buff;
	end;

OnPCLoginEvent:
	if ( $global_buff != #my_buff ) {
		sc_start SC_STRFood,360000,10;
		#my_buff = $global_buff;
	}
	end;
}
Not sure what you want to do. Only gm can set it ? (not the case in the script above)

Hi capuche, thanks for your reply. Actually anyone can set it. One question your script, if the sc ended and some of the characters are not yet logged in, once they logged in they will still recieve the sc? If yes, make it no, and is this possible? And let say the npc triggers the sc already and its 20 mins is passed after the npc activates thr sc. For the new log in characters, they will only recieve the remaining time.

well i have already written my variant and Capuche posts so ill post anyways -..-

-	script	sc_server	-1,{
OnHour18:
	SC_Enable = 1;
	addrid(0);
	sc_start SC_SUMMER,-1,0;
end;
OnHour20:
	SC_Enable = 0;
	addrid(0);
	sc_end SC_SUMMER;
end;
OnPCLoginEvent:
	if(SC_Enable) sc_start SC_SUMMER,-1,0;
end;
}
this version automatically disables the SC after an alotted time
prontera,150,180,6	script	dfghgf	56,{
	$global_buff++;
	addrid 0;
	sc_start SC_STRFood,360000,10;
	#my_buff = $global_buff;
	end;

OnPCLoginEvent:
	if ( $global_buff != #my_buff ) {
		sc_start SC_STRFood,360000,10;
		#my_buff = $global_buff;
	}
	end;
}
Not sure what you want to do. Only gm can set it ? (not the case in the script above)

Hi Stalao, pls refer on my post above and also thanks for your reply.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  155
  • Topics Per Day:  0.03
  • Content Count:  647
  • Reputation:   16
  • Joined:  11/21/11
  • Last Seen:  

prontera,150,180,6	script	dfghgf	56,{
	if ( .global_buff - gettimetick(1) > 0 ) {
		mes "There is already a special buff. Come later !";
		close;
	}
	mes "Everyone will get a buff for 6 mins.";
	close2;
	.global_buff = gettimetick(1) + 360;// 360 secs
	addrid 0;
	sc_start SC_STRFood,360000,10;// 360 secs
	end;

OnPCLoginEvent:
	if ( .global_buff - gettimetick(1) > 0 ) {
		.@timer = ( .global_buff - gettimetick(1) ) * 1000;
		sc_start SC_STRFood, .@timer,10;
	}
	end;
OnPCLogoutEvent:
	if ( .global_buff - gettimetick(1) > 0 )// remove the buff to update the timer on login
		sc_end SC_STRFood;
	end;
}

 

if the sc ended and some of the characters are not yet logged in, once they logged in they will still recieve the sc? If yes, make it no, and is this possible? And let say the npc triggers the sc already and its 20 mins is passed after the npc activates thr sc. For the new log in characters, they will only recieve the remaining time.

 

 

<3 <3 <3

prontera,150,180,6	script	dfghgf	56,{
	if ( .global_buff - gettimetick(1) > 0 ) {
		mes "There is already a special buff. Come later !";
		close;
	}
	mes "Everyone will get a buff for 6 mins.";
	close2;
	.global_buff = gettimetick(1) + 360;// 360 secs
	addrid 0;
	sc_start SC_STRFood,360000,10;// 360 secs
	end;

OnPCLoginEvent:
	if ( .global_buff - gettimetick(1) > 0 ) {
		.@timer = ( .global_buff - gettimetick(1) ) * 1000;
		sc_start SC_STRFood, .@timer,10;
	}
	end;
OnPCLogoutEvent:
	if ( .global_buff - gettimetick(1) > 0 )// remove the buff to update the timer on login
		sc_end SC_STRFood;
	end;
}

 

if the sc ended and some of the characters are not yet logged in, once they logged in they will still recieve the sc? If yes, make it no, and is this possible? And let say the npc triggers the sc already and its 20 mins is passed after the npc activates thr sc. For the new log in characters, they will only recieve the remaining time.

 

 

Another request @Capuche, how to add announcement if the event is already finish?

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

prontera,150,180,6	script	dfghgf	56,{
	if ( .global_buff - gettimetick(1) > 0 ) {
		mes "There is already a special buff. Come later !";
		close;
	}
	mes "Everyone will get a buff for 6 mins.";
	close2;
	.global_buff = gettimetick(1) + 360;// 360 secs
	initnpctimer;
	addrid 0;
	sc_start SC_STRFood,360000,10;// 360 secs
	end;

OnTimer360000:
	announce "End of Event",bc_all;
	end;
OnPCLoginEvent:
	if ( .global_buff - gettimetick(1) > 0 ) {
		.@timer = ( .global_buff - gettimetick(1) ) * 1000;
		sc_start SC_STRFood, .@timer,10;
	}
	end;
OnPCLogoutEvent:
	if ( .global_buff - gettimetick(1) > 0 )// remove the buff to update the timer on login
		sc_end SC_STRFood;
	end;
}

Well.. an announce when the timer ends ?

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