Jump to content
  • 0

Adding killing time to Mushroom Event


eboni001

Question


  • Group:  Members
  • Topic Count:  79
  • Topics Per Day:  0.02
  • Content Count:  327
  • Reputation:   4
  • Joined:  06/22/13
  • Last Seen:  

Hey guys, how can I add a 30 minutes limit time to the find the mushroom event? sometimes it pass hours and players dont kill all the mushrooms so the event doesn't start again.

I would like the script auto kills the rest of the mushrooms on the map without drops, after 30 minutes, so they have to rush to kill them all and win the prizes.

 

this is the script im using:

//===== rAthena Script ======================================= 
//= Find the Mushroom
//===== By: ================================================== 
//= Mysterious
//===== Current Version: ===================================== 
//= 3.6a
//===== Compatible With: ===================================== 
//= rAthena SVN
//===== Description: ========================================= 
//= Find the Mushroom - random amount of Mushrooms spawns in random maps.
//= Players need to find these mushrooms and kill them to gain prizes!
//===== Additional Comments: =================================
//= 3.0 Fully Functional with Rewritten script. [Mysterious]
//= 3.6a Slightly edited. [Euphy]
//============================================================ 

prontera,142,228,6	script	Find the Mushroom	1014,{
	mes "[ Find The Mushroom ]";
	if (!.Status)
		mes "There is no event at the moment!";
	else {
		mes "There are "+.Spawn+" Mushrooms left in "+.Map$+"!";
		mes "Find and kill the mushrooms to gain "+getitemname(.Prize)+"!";
	}
	if (.Status || getgmlevel() < .GM) close;
	mes "Start the event?";
	next;
	if(select("- No:- Yes") == 1) close;
	donpcevent strnpcinfo(0)+"::OnMinute10";
	mes "[ Find The Mushroom ]";
	mes "Event started!";
	close;

OnInit:
	set .Prize,677;	// Reward item ID
	set .Amount,1;	// Reward item amount
	set .GM,60;	// GM level required to access NPC
	setarray .Maps$[0],"izlude","geffen","morocc","prontera","payon","lighthalzen","aldebaran","hyrule"; // Possible maps
	end;

OnMinute10:	// Start time (every hour)
	if (.Status) end;
	set .Status,1;
	set .Spawn,rand(1,5);	// How many Mushrooms should spawn?
	set .Map$,.Maps$[rand(getarraysize(.Maps$))];
	killmonster .Map$,"All";
	monster .Map$,0,0,"Please don't kill me!",1084,.Spawn,strnpcinfo(0)+"::OnMobKilled";
	announce "Find the Mushroom : Total of "+.Spawn+" Mushrooms have been spawned in "+.Map$+"!",0;
	sleep 2500;
	announce "Find the Mushroom : Every Mushroom you kill will give you "+getitemname(.Prize)+"!",0;
	end;

OnMobKilled:
	set .Spawn, .Spawn - 1;
	getitem .Prize, .Amount;
	if (.Spawn) announce "[ "+strcharinfo(0)+" ] has killed a Mushroom. There are now "+.Spawn+" Mushroom(s) left.",bc_map;
	else {
		announce "The Find the Mushroom Event has ended. All the Mushrooms have been killed.",0;
		set .Status,0;
	}
	end;
}

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  42
  • Topics Per Day:  0.01
  • Content Count:  1096
  • Reputation:   345
  • Joined:  02/26/12
  • Last Seen:  

something like that

//===== rAthena Script ======================================= 
//= Find the Mushroom
//===== By: ================================================== 
//= Mysterious
//===== Current Version: ===================================== 
//= 3.6a
//===== Compatible With: ===================================== 
//= rAthena SVN
//===== Description: ========================================= 
//= Find the Mushroom - random amount of Mushrooms spawns in random maps.
//= Players need to find these mushrooms and kill them to gain prizes!
//===== Additional Comments: =================================
//= 3.0 Fully Functional with Rewritten script. [Mysterious]
//= 3.6a Slightly edited. [Euphy]
//============================================================ 

prontera,142,228,6	script	Find the Mushroom	1014,{
	mes "[ Find The Mushroom ]";
	if (!.Status)
		mes "There is no event at the moment!";
	else {
		mes "There are "+.Spawn+" Mushrooms left in "+.Map$+"!";
		mes "Find and kill the mushrooms to gain "+getitemname(.Prize)+"!";
	}
	if (.Status || getgmlevel() < .GM) close;
	mes "Start the event?";
	next;
	if(select("- No:- Yes") == 1) close;
	donpcevent strnpcinfo(0)+"::OnMinute10";
	mes "[ Find The Mushroom ]";
	mes "Event started!";
	close;

OnInit:
	set .Prize,677;	// Reward item ID
	set .Amount,1;	// Reward item amount
	set .GM,60;	// GM level required to access NPC
	setarray .Maps$[0],"izlude","geffen","morocc","prontera","payon","lighthalzen","aldebaran","hyrule"; // Possible maps
	end;

OnMinute10:	// Start time (every hour)
	if (.Status) end;
	set .Status,1;
	set .Spawn,rand(1,5);	// How many Mushrooms should spawn?
	set .Map$,.Maps$[rand(getarraysize(.Maps$))];
	killmonster .Map$,"All";

	initnpctimer; // start timer

	monster .Map$,0,0,"Please don't kill me!",1084,.Spawn,strnpcinfo(0)+"::OnMobKilled";
	announce "Find the Mushroom : Total of "+.Spawn+" Mushrooms have been spawned in "+.Map$+"!",0;
	sleep 2500;
	announce "Find the Mushroom : Every Mushroom you kill will give you "+getitemname(.Prize)+"!",0;
	end;

// If nobody kill all mobs
// 1800 seconds = 30 minutes
OnTimer1800000:
	stopnpctimer;
	if(.Spawn || .Status) {
		killmonster .Map$,"All";
		announce "The Find the Mushroom Event has ended. All the Mushrooms have been killed.",0;
		set .Status,0;
	}
	end;

OnMobKilled:
	stopnpctimer;
	set .Spawn, .Spawn - 1;
	getitem .Prize, .Amount;
	if (.Spawn) announce "[ "+strcharinfo(0)+" ] has killed a Mushroom. There are now "+.Spawn+" Mushroom(s) left.",bc_map;
	else {
		announce "The Find the Mushroom Event has ended. All the Mushrooms have been killed.",0;
		set .Status,0;
	}
	end;
}
  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  79
  • Topics Per Day:  0.02
  • Content Count:  327
  • Reputation:   4
  • Joined:  06/22/13
  • Last Seen:  

 

something like that

//===== rAthena Script ======================================= 
//= Find the Mushroom
//===== By: ================================================== 
//= Mysterious
//===== Current Version: ===================================== 
//= 3.6a
//===== Compatible With: ===================================== 
//= rAthena SVN
//===== Description: ========================================= 
//= Find the Mushroom - random amount of Mushrooms spawns in random maps.
//= Players need to find these mushrooms and kill them to gain prizes!
//===== Additional Comments: =================================
//= 3.0 Fully Functional with Rewritten script. [Mysterious]
//= 3.6a Slightly edited. [Euphy]
//============================================================ 

prontera,142,228,6	script	Find the Mushroom	1014,{
	mes "[ Find The Mushroom ]";
	if (!.Status)
		mes "There is no event at the moment!";
	else {
		mes "There are "+.Spawn+" Mushrooms left in "+.Map$+"!";
		mes "Find and kill the mushrooms to gain "+getitemname(.Prize)+"!";
	}
	if (.Status || getgmlevel() < .GM) close;
	mes "Start the event?";
	next;
	if(select("- No:- Yes") == 1) close;
	donpcevent strnpcinfo(0)+"::OnMinute10";
	mes "[ Find The Mushroom ]";
	mes "Event started!";
	close;

OnInit:
	set .Prize,677;	// Reward item ID
	set .Amount,1;	// Reward item amount
	set .GM,60;	// GM level required to access NPC
	setarray .Maps$[0],"izlude","geffen","morocc","prontera","payon","lighthalzen","aldebaran","hyrule"; // Possible maps
	end;

OnMinute10:	// Start time (every hour)
	if (.Status) end;
	set .Status,1;
	set .Spawn,rand(1,5);	// How many Mushrooms should spawn?
	set .Map$,.Maps$[rand(getarraysize(.Maps$))];
	killmonster .Map$,"All";

	initnpctimer; // start timer

	monster .Map$,0,0,"Please don't kill me!",1084,.Spawn,strnpcinfo(0)+"::OnMobKilled";
	announce "Find the Mushroom : Total of "+.Spawn+" Mushrooms have been spawned in "+.Map$+"!",0;
	sleep 2500;
	announce "Find the Mushroom : Every Mushroom you kill will give you "+getitemname(.Prize)+"!",0;
	end;

// If nobody kill all mobs
// 1800 seconds = 30 minutes
OnTimer1800000:
	stopnpctimer;
	if(.Spawn || .Status) {
		killmonster .Map$,"All";
		announce "The Find the Mushroom Event has ended. All the Mushrooms have been killed.",0;
		set .Status,0;
	}
	end;

OnMobKilled:
	stopnpctimer;
	set .Spawn, .Spawn - 1;
	getitem .Prize, .Amount;
	if (.Spawn) announce "[ "+strcharinfo(0)+" ] has killed a Mushroom. There are now "+.Spawn+" Mushroom(s) left.",bc_map;
	else {
		announce "The Find the Mushroom Event has ended. All the Mushrooms have been killed.",0;
		set .Status,0;
	}
	end;
}

Thank you very much, this worked like a charm.

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