OSDN Git Service

First version
[st-ro/stro.git] / npc / custom / events / holiday / uneasy_cemetery.txt
1 //===== rAthena Script ======================================= 
2 //= Uneasy Prontera Cemetery Quest
3 //===== By: ================================================== 
4 //= Lupus
5 //===== Current Version: ===================================== 
6 //= 1.2a (Tested and fully working!)
7 //===== Compatible With: ===================================== 
8 //= rAthena Project
9 //===== Description: ========================================= 
10 //= A periodical quest of the Uneasy Cemetery (Kill undead / Prevent their appearance)
11 //= Every day, at the midnight Prontera receive a wave of Undeads.
12 //= They come from Uneasy Cemetery of Prontera. To protect the players
13 //= from the undeads terror you may either kill the enemy. Or supply Mother Mathana
14 //= with needed amount of Holy Water. Every citizen can take his part in the 
15 //= saving of Prontera city. After some days of quiet life... the Cemetery strikes back.
16 //===== Additional Comments: ================================= 
17 //= 1.1 More advanced ver. Added some bonus the the one who'd kill the last walking undead
18 //= 1.2 Added coords to the script to make label OmMobDead working
19 //= 1.2a Changed item names to item IDs. [Samuray22]
20 //============================================================ 
21
22 prontera,3,3,3  script  Uneasy_Check    -1,{
23         end;
24
25 OnHour00:
26         set $UNEASY_DL,$UNEASY_DL-1;
27         set $UNEASY_BL,$UNEASY_BL+30; //add need of HW for 30 bottles per day
28         if ($UNEASY_BL>666) set $UNEASY_BL,666; //keep needed bottles not <=666
29         if ($UNEASY_DL < 0) goto L_Start_Undead;
30 //The Cemetery is OK yet.
31         disablenpc "Mother Mathana";
32         end;
33 OnInit:
34         if ($UNEASY_DL >= 0) disablenpc "Mother Mathana";
35         end;
36
37 OnHour06:
38         killmonsterall "prontera";      //The Sun kills undead in the morning
39         end;
40
41 OnHour01:
42         if ($@UNEASY_MOB > 0) mapannounce "prontera","[Mother Mathana]: In the name of Odin, please finish these roaming undead leftovers!",0;
43         end;
44
45 OnZombieDead:
46         set $@UNEASY_MOB,$@UNEASY_MOB-1;
47         if ($@UNEASY_MOB>0) end;
48         set $UNEASY_DL,0;
49         set $UNEASY_H$,strcharinfo(0);
50         if (Sex==SEX_MALE) mapannounce "prontera","[Mother Mathana]: Brave "+$UNEASY_H$+" has just killed the last undead in Prontera!",0;
51         else mapannounce "prontera","[Mother Mathana]: Lady "+$UNEASY_H$+" has just killed the last undead in Prontera!",0;
52         set JobExp,JobExp+100;
53         set BaseExp,BaseExp+50;
54         end;
55
56 L_Start_Undead:
57         killmonsterall "prontera";      //kills any left monsters
58         enablenpc "Mother Mathana";
59 //call some monsters in the city
60         set $@UNEASY_MOB, 65;
61         areamonster "prontera",0,0,0,0,"Zombie",1015,30,"Uneasy_Check::OnZombieDead";
62 //in the Cemetery
63         monster "prontera",268,349,"Zombie",1015,30,"Uneasy_Check::OnZombieDead";
64         monster "prontera",269,350,"Ghoul",1036,5,"Uneasy_Check::OnZombieDead";
65 //announce
66         mapannounce "prontera","[Mother Mathana]: The cememtery has become restless!  In the name of Odin, hurry to the Sanctuary! Save the city of Prontera!",0;
67 }
68
69 prontera,257,313,5      script  Mother Mathana  79,{
70         mes "[Mother Mathana]";
71         if ($UNEASY_DL <= 0) goto L_Undead_Walk;
72         mes "I'm afraid there's something wrong with our old cemetery...";
73         if ($UNEASY_H$==strcharinfo(0)) mes "But thanks to you, "+$UNEASY_H$+", we'll be able to sleep " + $UNEASY_DL + " nights!";
74         if ($UNEASY_H$!=strcharinfo(0)) mes "But thanks to "+$UNEASY_H$+"'s support, we've got " + $UNEASY_DL + " easy nights!";
75         emotion e_gasp;
76         close;
77
78 L_Undead_Walk:
79         if ($UNEASY_DL == 0) mes "THEY could return tomorrow's night again!";
80         if ($UNEASY_DL == 0 && $UNEASY_H$==strcharinfo(0)) mes "Thank you, "+$UNEASY_H$+"! Now we'll manage to rest till the next midnight!";
81         if ($UNEASY_DL == 0 && $UNEASY_H$!=strcharinfo(0)) mes "But due to "+$UNEASY_H$+"'s help we'll manage to rest till the next midnight!";
82         mes "To calm down the restless cemetery, we should pour all these graves with the Holy Water. But our sisters and broters have run out of it.";
83         mes "Could you supply us with Holy Water?";
84         next;
85         menu "Yes, have all my Holy Water!",-, "Nope, I need it.",M_NO, "I don't have any.",M_DONT_HAVE;
86
87         if ( countitem(523)<1 ) goto M_DONT_HAVE;
88         set $UNEASY_BL,$UNEASY_BL-countitem(523);
89         delitem 523,countitem(523);
90
91         if ( $UNEASY_BL > 0 ) goto L_NEED_MORE;
92 //set quiet days!!! no more undead for this period!
93         set $UNEASY_DL,5+((0-$UNEASY_BL)/30);
94         set $UNEASY_H$,strcharinfo(0);
95         mes "[Mother Mathana]";
96         mes "Thank you, "+$UNEASY_H$+"! Now we've got enough Holy Water!";
97         next;
98         mes "[Mother Mathana]";
99         mes "Upon pouring the cemetery with that water we'll get " + $UNEASY_DL + " safe nights!";
100         next;
101         killmonsterall "prontera";      //kills any left monsters
102         mes "[Mother Mathana]";
103         mes "See, "+ $UNEASY_H$ +"? They all are gone now!";
104         next;
105         mes "[Mother Mathana]";
106         mes "Our Church is going to thank you personally...";
107         next;
108         if (Sex==SEX_MALE) mapannounce "prontera","[Mother Mathana]: In the name of Odin we declare handsom "+$UNEASY_H$+" as a Prontera savior!",0;
109         else mapannounce "prontera","[Mother Mathana]: In the name of Odin we declare beautiful "+$UNEASY_H$+" as a Prontera savior!",0;
110         mes "[Mother Mathana]";
111         mes "In the name of Odin we bless you and decently present a modest gift just from Mareusis' wine-cellar.";
112         getitem 505,1; //Blue_Potion
113         set JobExp,JobExp+100;
114         set BaseExp,BaseExp+50;
115         close;
116
117 L_NEED_MORE:
118         mes "[Mother Mathana]";
119         mes "Thank you, good "+strcharinfo(0)+", but we still need " + $UNEASY_BL + " more Holy Water bottles.";
120         close;
121
122 M_NO:
123         mes "[Mother Mathana]";
124         mes "I'm afraid the old cemetery is going out of control soon... Please, get us all the Holy Water you can get.";
125         close;
126
127 M_DONT_HAVE:
128         mes "[Mother Mathana]";
129         mes "Alas! We still need " + $UNEASY_BL + " more bottles of Holy Water...  Why don't you go and ask other people for some extra Holy Water?";
130         mes "The old cemetery is going out of control soon...";
131         mes "Please, in the name of Odin, help Prontera city.";
132         close;
133 }