Jump to content
  • 0
Sign in to follow this  
gidzdlcrz

About the mushroom_event

Question

//===== rAthena Script ======================================= 
//= Find the Mushroom
//===== By: ================================================== 
//= Mysterious
//===== Current Version: ===================================== 
//= 3.6a
//===== Compatible With: ===================================== 
//= rAthena Project
//===== 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	1084,{
	mes "[ Find The Mushroom ]";
	if (.status == 1) {
		.@count = mobcount( .event_map$, strnpcinfo(0) + "::OnMobKilled" );
		if (.@count > 0) {
			mes "There are " + .@count + " Mushrooms left in " + .event_map$ + "!";
			mes "Find and kill the mushrooms to gain " + getitemname(.prize) + "!";
			close;
		}
		.event_map$ = "";
		.status = 0;
		mes "All the mushrooms are killed?";
	}
	mes "There is no event at the moment!";
	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:
	.prize = 512;	// Reward item ID
	.amount = 10;	// Reward item amount
	.GM = 60;		// GM level required to access NPC
	setarray .maps_list$[0],"izlude","geffen","morocc","prontera"; // Possible maps
	end;

OnMinute10:	// Start time (every hour)
	if (.status) end;
	.status = 1;
	.@spawn = rand(1,10);	// How many Mushrooms should spawn?
	.event_map$ = .maps_list$[ rand(getarraysize(.maps_list$)) ];
	.@label$ = strnpcinfo(0) + "::OnMobKilled";
	killmonster .event_map$, .@label$;
	monster .event_map$,0,0,"Please don't kill me!",1084,.@spawn, .@label$;
	announce "Find the Mushroom : Total of " + .@spawn + " Mushrooms have been spawned in " + .event_map$ + "!",0;
	sleep 2500;
	announce "Find the Mushroom : Every Mushroom you kill will give you " + getitemname(.prize) + "!",0;
	end;

OnMobKilled:
	if (playerattached() == 0)
		end;
	getitem .prize, .amount;
	.@spawn = mobcount( .event_map$, strnpcinfo(0) + "::OnMobKilled" );
	if (.@spawn > 0)
		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;
		.status = 0;
		.event_map$ = "";
	}
	end;
}

^ This is the whole script. Can we have an option to set time limit for this quest? Because it wont re start until all the mushroom has been slain. I am thinking to have 30 minutes for every event. Thanks!

Share this post


Link to post
Share on other sites

14 answers to this question

Recommended Posts

  • 4
OnMinute40:
	if (mobcount(.Map$, strnpcinfo(0)+"::OnMobKilled") == 0)
		end;
	killmonster .Map$, strnpcinfo(0)+"::OnMobKilled";
	announce "All left over mushroom has been removed", bc_all;
	end;

 

I don't use rAthena but should work

Share this post


Link to post
Share on other sites
  • 0

use annies solution 😁

Edited by evilpuncker
mine is crap

Share this post


Link to post
Share on other sites
  • 0
4 hours ago, evilpuncker said:

before the OnMobKilled: label add the following:

OnMinute40: killmonster .event_map$, "OnMobKilled"; end


OnMinute40:
	killmonster .event_map$, "OnMobKilled";
	end

 

I don't use rAthena but should work

 

Will test this. :)

*Edit

Doesn't work. I even tried OnTimer.. Hmmm

Edited by gidzdlcrz

Share this post


Link to post
Share on other sites
  • 0

we also have this on Herc as ive checked my fresh trunk.

 

//===== Hercules Script ======================================
//= Find the Mushroom
//===== By: ==================================================
//= Mysterious
//===== Current Version: =====================================
//= 3.6a
//===== 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	BLACK_MUSHROOM,{
	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(NPC_NAME)+"::OnMinute10";
	mes "[ Find The Mushroom ]";
	mes "Event started!";
	close;

OnInit:
	set .Prize,512;	// Reward item ID
	set .Amount,10;	// Reward item amount
	set .GM,60;	// GM level required to access NPC
	setarray .maps$[0],"izlude","geffen","morocc","prontera"; // Possible maps
	end;

OnMinute10:	// Start time (every hour)
	if (.status) end;
	set .status,1;
	set .Spawn,rand(1,10);	// 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(NPC_NAME)+"::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;
	if (playerattached() != 0) {
		getitem .Prize, .Amount;
		if (.Spawn)
			announce "[ "+strcharinfo(PC_NAME)+" ] has killed a Mushroom. There are now "+.Spawn+" Mushroom(s) left.",bc_map;
	}	
	if (!.Spawn) {
		announce "The Find the Mushroom Event has ended. All the Mushrooms have been killed.",0;
		set .status,0;
	}
	end;
}

Link: https://github.com/HerculesWS/Hercules/blob/stable/npc/custom/events/mushroom_event.txt

Share this post


Link to post
Share on other sites
  • 0
On 10/10/2020 at 10:53 PM, AnnieRuru said:

OnMinute40: if (mobcount(.Map$, strnpcinfo(0)+"::OnMobKilled") == 0) end; killmonster .Map$, strnpcinfo(0)+"::OnMobKilled"; announce "All left over mushroom has been removed", bc_all; end;


OnMinute40:
	if (mobcount(.Map$, strnpcinfo(0)+"::OnMobKilled") == 0)
		end;
	killmonster .Map$, strnpcinfo(0)+"::OnMobKilled";
	announce "All left over mushroom has been removed", bc_all;
	end;

 

I don't use rAthena but should work


Err! Why i didnt get notification for this. I will try @AnnieRuru. I'll give feedback after i test this. ♥

Share this post


Link to post
Share on other sites
  • 0

after all mushroom has been killed im having debug messages

[Debug]: (map_mapname2mapid) mapindex_name2id: Map "" not found in index list!

[Debug]: (map_mapname2mapid) mapindex_name2id: Map "" not found in index list!

Share this post


Link to post
Share on other sites
  • 0
2 hours ago, kalabasa said:

after all mushroom has been killed im having debug messages

[Debug]: (map_mapname2mapid) mapindex_name2id: Map "" not found in index list!

[Debug]: (map_mapname2mapid) mapindex_name2id: Map "" not found in index list!

maybe you have typo on this part

setarray .maps$[0],"izlude","geffen","morocc","prontera"; // Possible maps

Share this post


Link to post
Share on other sites
  • 0
1 hour ago, IndieRO said:

maybe you have typo on this part

setarray .maps$[0],"izlude","geffen","morocc","prontera"; // Possible maps

setarray .maps_list$[0],"izlude","geffen","morocc","prontera"; // Possible maps 

this is the code i was using

Share this post


Link to post
Share on other sites
  • 0
Just now, kalabasa said:

setarray .maps_list$[0],"izlude","geffen","morocc","prontera"; // Possible maps 

this is the code i was using

you can go there?

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.