summaryrefslogtreecommitdiff
path: root/npc/custom/events/mushroom_event.txt
blob: 6a8cbc59dbee5a215f8b55178356ec7483003520 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
//===== 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;
	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;
}