Jump to content
  • 0

R>how to add @startevent function


topechi

Question


  • Group:  Members
  • Topic Count:  24
  • Topics Per Day:  0.01
  • Content Count:  52
  • Reputation:   2
  • Joined:  11/13/16
  • Last Seen:  

Hi. just wanna know how to add @startevent command with its function thanks in advance! :)

Link to comment
Share on other sites

6 answers to this question

Recommended Posts

  • 0

  • Group:  Forum Moderator
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  1268
  • Reputation:   382
  • Joined:  02/03/12
  • Last Seen:  

https://github.com/rathena/rathena/blob/master/doc/script_commands.txt#L7171

Use the bindatcmd and direct it to a label that starts the event.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  24
  • Topics Per Day:  0.01
  • Content Count:  52
  • Reputation:   2
  • Joined:  11/13/16
  • Last Seen:  

1 hour ago, Skorm said:

https://github.com/rathena/rathena/blob/master/doc/script_commands.txt#L7171

Use the bindatcmd and direct it to a label that starts the event.

sir can you possibly make a sample for this script? thank you very much sir i'd appreciate it very much.

// -----------------------------//
// ------- Free For All --------//
// -------- By : Butch ---------//
// A simple Free for all script //
// -----------------------------//

guild_vs5,48,51,6	script	FFA Master	999,{
if(getmapusers("guild_vs5") != 1) 
	{
		mes "[^FF0000FFA Master^000000]";
		mes "Current players - ^FF0000"+ getmapusers("guild_vs5") +"^000000.";
		close;
	}
	else if(getmapusers("guild_vs5") == 1)
	{
		
		dispbottom "You are a winner of Event Free for all. Congratz!";
		donpcevent "Free For All::OnStopEvent";
		announce "Free for all winner : "+ strcharinfo(0) +"", bc_all, "0xFFCE00";
		getitem 25002,1; // Reward
		warp "prontera", 156,149;
		end;
	}
}

// ------ FFA Warper -------//
		
prontera,147,149,6	script	Free For All	999,{

	if (.start != 1) {
	mes "[^FF0000Agent Mil^000000]";
	mes "Free for all is not available at the moment";
	close;
	}
		mes "[^FF0000Agent Mil^000000]";
		mes "What do you want?";
		switch(select("Free for all")) {
			case 1:
				if( getcharid(1) ) { mes "Please leave your party."; close; }
				if( getcharid(2) ) { mes "Please leave your guild."; close; }
					else switch(rand(3)) {
						case 0: .@x = 18; .@y = 50; break;
						case 1: .@x = 50; .@y = 77; break;
						case 2: .@x = 81; .@y = 49; break;
						case 3: .@x = 49; .@y = 22; break; 
					}
					warp "guild_vs5", .@x,.@y;
				break;				
		}
	close;
	
OnStartEvent:	
OnClock1245:
OnClock1645:
OnClock2045:
OnClock0045:
OnClock0445:
OnClock0845:
	.start = 1;
	disablenpc "FFA Master";
	announce "Free for all will start in 5 minutes.", bc_all, "0x00b89d";
	sleep 120000;
	announce "Free for all will start in 3 minutes.", bc_all, "0x00b89d";
	sleep 120000;
	announce "Free for all will start in 1 minute.", bc_all, "0x00b89d";
	sleep 60000;
	announce "Free for all has started!", bc_all, "0x00b89d";
	.start = 2;
	enablenpc "FFA Master";
	sleep 2000;
	if ( !getmapusers("guild_vs5") ) goto OnStopEvent;
	mapannounce "guild_vs5", "FFA starts in 5", bc_map;
	sleep 1000;
	mapannounce "guild_vs5", "FFA starts in 4", bc_map;
	sleep 1000;
	mapannounce "guild_vs5", "FFA starts in 3", bc_map;
	sleep 1000;
	mapannounce "guild_vs5", "FFA starts in 2", bc_map;
	sleep 1000;
	mapannounce "guild_vs5", "FFA starts in 1", bc_map;
	sleep 1000;
	mapannounce "guild_vs5", "GO! Kill all!", bc_map;
	setmapflag "guild_vs5", mf_gvg;
	removemapflag "guild_vs5", mf_noskill;
	end;
	
OnStopEvent:
	.start = 0;
	disablenpc "FFA Master";
	removemapflag "guild_vs5", mf_gvg;
	setmapflag "guild_vs5", mf_noskill;
	end;
		
OnInit:
	waitingroom "[Free For All]",0;
	end;
}

guild_vs5	mapflag	partylock
guild_vs5	mapflag	guildlock
guild_vs5	mapflag	notrade
guild_vs5	mapflag	nodrop

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  308
  • Reputation:   24
  • Joined:  11/26/12
  • Last Seen:  

// -----------------------------//
// ------- Free For All --------//
// -------- By : Butch ---------//
// A simple Free for all script //
// -----------------------------//

guild_vs5,48,51,6	script	FFA Master	999,{
if(getmapusers("guild_vs5") != 1) 
	{
		mes "[^FF0000FFA Master^000000]";
		mes "Current players - ^FF0000"+ getmapusers("guild_vs5") +"^000000.";
		close;
	}
	else if(getmapusers("guild_vs5") == 1)
	{
		
		dispbottom "You are a winner of Event Free for all. Congratz!";
		donpcevent "Free For All::OnStopEvent";
		announce "Free for all winner : "+ strcharinfo(0) +"", bc_all, "0xFFCE00";
		getitem 25002,1; // Reward
		warp "prontera", 156,149;
		end;
	}
}

// ------ FFA Warper -------//
		
prontera,147,149,6	script	Free For All	999,{

	if (.start != 1) {
	mes "[^FF0000Agent Mil^000000]";
	mes "Free for all is not available at the moment";
	close;
	}
		mes "[^FF0000Agent Mil^000000]";
		mes "What do you want?";
		switch(select("Free for all")) {
			case 1:
				if( getcharid(1) ) { mes "Please leave your party."; close; }
				if( getcharid(2) ) { mes "Please leave your guild."; close; }
					else switch(rand(3)) {
						case 0: .@x = 18; .@y = 50; break;
						case 1: .@x = 50; .@y = 77; break;
						case 2: .@x = 81; .@y = 49; break;
						case 3: .@x = 49; .@y = 22; break; 
					}
					warp "guild_vs5", .@x,.@y;
				break;				
		}
	close;
	
OnStartEvent:	
OnClock1245:
OnClock1645:
OnClock2045:
OnClock0045:
OnClock0445:
OnClock0845:
	.start = 1;
	disablenpc "FFA Master";
	announce "Free for all will start in 5 minutes.", bc_all, "0x00b89d";
	sleep 120000;
	announce "Free for all will start in 3 minutes.", bc_all, "0x00b89d";
	sleep 120000;
	announce "Free for all will start in 1 minute.", bc_all, "0x00b89d";
	sleep 60000;
	announce "Free for all has started!", bc_all, "0x00b89d";
	.start = 2;
	enablenpc "FFA Master";
	sleep 2000;
	if ( !getmapusers("guild_vs5") ) goto OnStopEvent;
	mapannounce "guild_vs5", "FFA starts in 5", bc_map;
	sleep 1000;
	mapannounce "guild_vs5", "FFA starts in 4", bc_map;
	sleep 1000;
	mapannounce "guild_vs5", "FFA starts in 3", bc_map;
	sleep 1000;
	mapannounce "guild_vs5", "FFA starts in 2", bc_map;
	sleep 1000;
	mapannounce "guild_vs5", "FFA starts in 1", bc_map;
	sleep 1000;
	mapannounce "guild_vs5", "GO! Kill all!", bc_map;
	setmapflag "guild_vs5", mf_gvg;
	removemapflag "guild_vs5", mf_noskill;
	end;
	
OnStopEvent:
	.start = 0;
	disablenpc "FFA Master";
	removemapflag "guild_vs5", mf_gvg;
	setmapflag "guild_vs5", mf_noskill;
	end;
		
OnInit:
	bindatcmd("startevent",strnpcinfo(1)+"::OnStartEvent",60,99);
	waitingroom "[Free For All]",0;
	end;
}

guild_vs5	mapflag	partylock
guild_vs5	mapflag	guildlock
guild_vs5	mapflag	notrade
guild_vs5	mapflag	nodrop

there you go dude!

  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  24
  • Topics Per Day:  0.01
  • Content Count:  52
  • Reputation:   2
  • Joined:  11/13/16
  • Last Seen:  

20 hours ago, chatterboy said:

// -----------------------------//
// ------- Free For All --------//
// -------- By : Butch ---------//
// A simple Free for all script //
// -----------------------------//

guild_vs5,48,51,6	script	FFA Master	999,{
if(getmapusers("guild_vs5") != 1) 
	{
		mes "[^FF0000FFA Master^000000]";
		mes "Current players - ^FF0000"+ getmapusers("guild_vs5") +"^000000.";
		close;
	}
	else if(getmapusers("guild_vs5") == 1)
	{
		
		dispbottom "You are a winner of Event Free for all. Congratz!";
		donpcevent "Free For All::OnStopEvent";
		announce "Free for all winner : "+ strcharinfo(0) +"", bc_all, "0xFFCE00";
		getitem 25002,1; // Reward
		warp "prontera", 156,149;
		end;
	}
}

// ------ FFA Warper -------//
		
prontera,147,149,6	script	Free For All	999,{

	if (.start != 1) {
	mes "[^FF0000Agent Mil^000000]";
	mes "Free for all is not available at the moment";
	close;
	}
		mes "[^FF0000Agent Mil^000000]";
		mes "What do you want?";
		switch(select("Free for all")) {
			case 1:
				if( getcharid(1) ) { mes "Please leave your party."; close; }
				if( getcharid(2) ) { mes "Please leave your guild."; close; }
					else switch(rand(3)) {
						case 0: .@x = 18; .@y = 50; break;
						case 1: .@x = 50; .@y = 77; break;
						case 2: .@x = 81; .@y = 49; break;
						case 3: .@x = 49; .@y = 22; break; 
					}
					warp "guild_vs5", .@x,.@y;
				break;				
		}
	close;
	
OnStartEvent:	
OnClock1245:
OnClock1645:
OnClock2045:
OnClock0045:
OnClock0445:
OnClock0845:
	.start = 1;
	disablenpc "FFA Master";
	announce "Free for all will start in 5 minutes.", bc_all, "0x00b89d";
	sleep 120000;
	announce "Free for all will start in 3 minutes.", bc_all, "0x00b89d";
	sleep 120000;
	announce "Free for all will start in 1 minute.", bc_all, "0x00b89d";
	sleep 60000;
	announce "Free for all has started!", bc_all, "0x00b89d";
	.start = 2;
	enablenpc "FFA Master";
	sleep 2000;
	if ( !getmapusers("guild_vs5") ) goto OnStopEvent;
	mapannounce "guild_vs5", "FFA starts in 5", bc_map;
	sleep 1000;
	mapannounce "guild_vs5", "FFA starts in 4", bc_map;
	sleep 1000;
	mapannounce "guild_vs5", "FFA starts in 3", bc_map;
	sleep 1000;
	mapannounce "guild_vs5", "FFA starts in 2", bc_map;
	sleep 1000;
	mapannounce "guild_vs5", "FFA starts in 1", bc_map;
	sleep 1000;
	mapannounce "guild_vs5", "GO! Kill all!", bc_map;
	setmapflag "guild_vs5", mf_gvg;
	removemapflag "guild_vs5", mf_noskill;
	end;
	
OnStopEvent:
	.start = 0;
	disablenpc "FFA Master";
	removemapflag "guild_vs5", mf_gvg;
	setmapflag "guild_vs5", mf_noskill;
	end;
		
OnInit:
	bindatcmd("startevent",strnpcinfo(1)+"::OnStartEvent",60,99);
	waitingroom "[Free For All]",0;
	end;
}

guild_vs5	mapflag	partylock
guild_vs5	mapflag	guildlock
guild_vs5	mapflag	notrade
guild_vs5	mapflag	nodrop

there you go dude!

Thanks sir. ill go try it out.

btw sir, how can i enable it all the time? so players can use it anytime. thanks in advance!

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

  • 0

  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  308
  • Reputation:   24
  • Joined:  11/26/12
  • Last Seen:  

use the command?

  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  24
  • Topics Per Day:  0.01
  • Content Count:  52
  • Reputation:   2
  • Joined:  11/13/16
  • Last Seen:  

On 2/4/2017 at 1:01 PM, chatterboy said:

use the command?

Is there a way how to enable the npc all the time without activating it everytime when using it?

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