Advertisement
Guest User

Untitled

a guest
Oct 16th, 2012
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.82 KB | None | 0 0
  1. //===== eAthena Script ======================================================================
  2. //= Emperium Wars
  3. //===== Original By =========================================================================
  4. //= Toxic Aka Hellflaem
  5. //===== Credit =========================================================================
  6. //= Hellflaem
  7. //= ~AnnieRuru~ (Support)
  8. //= diedlikeahero (poring Ball)
  9. //= Any one I forgot.
  10. //===== Current Version: ====================================================================
  11. //= 1.0
  12. //===== Compatible With: ====================================================================
  13. //= Any eAthena
  14. //===== Description: ========================================================================
  15. //= This is just a fun little gvg game,
  16. //= Any one person from 2 different guilds can play it.
  17. //= First guild to kill the other emp 5 times wins.
  18. //= Killing your own Emp takes away points.
  19. //===== Comments================================================================
  20. //= Edit it to your servers likings.
  21. //=Own a Server? Add it to http://Top100Ros.com/
  22. //===========================================================================================
  23. quiz_02,363,356,4 script Emperium Wars::empwar 722,{
  24.  
  25. set $npcname$,"[Gaia Emperium Wars]";
  26. set $rewarditem, 20011;
  27.  
  28. mes $npcname$;
  29. mes "Hello "+strcharinfo(0)+" what do you want?";
  30. next;
  31. menu "^FF0000Sign Up^000000",L_signup,"^996600Enter^000000",L_enter,"^006699Information^000000",L_info,"^00AA00Nothing^000000",bye;
  32. close;
  33.  
  34. L_signup:
  35. if (($@state_match!=1) && ($@guildID1!=0) && ($@guildID2!=0) && (getguildname($@guildID1)!="null") && (getguildname($@guildID2)!="null")) {
  36. mes $npcname$;
  37. mes "Sorry "+strcharinfo(0)+" , Two Guilds are signed up for this event already.";
  38. close;
  39. }
  40.  
  41. mes $npcname$;
  42. mes "Hello "+strcharinfo(0)+" , Two Guilds are needed for this event.";
  43. mes "Would you like to Sign up yours?";
  44. mes "If so Please do so now.";
  45. menu "Guild 1",L_guild1,"Guild 2",L_guild2,"None",-;
  46. next;
  47. mes $npcname$;
  48. mes "Bye!";
  49. close;
  50.  
  51. L_guild1:
  52. // If a match is in play
  53. if ($@state_match >= 1) {
  54. mes $npcname$;
  55. mes "The warpers are currently unavailable because a match is in progress. Don't hesitate to try again in a few minutes!";
  56. close;
  57. }
  58.  
  59. // Does the player belong to a guild?
  60. if (getcharid(2)==0) {
  61. mes $npcname$;
  62. mes "This Event is for Guilds, and you're not in a Guild. Come back with a Guild!";
  63. close;
  64. }
  65.  
  66. // Is the group of the player subscribed as the other guild already?
  67. if (getcharid(2)==$@guildID2) {
  68. mes $npcname$;
  69. mes "Hey! A player from the opposing Guild! Get ready to face off one of the best Guilds!";
  70. mes "The formidable " + GetGuildName($@guildID1) + "";
  71. close;
  72. }
  73.  
  74. // If a team is already subscribed, and that team still exists
  75. if (($@guildID1!=0) && (getguildname($@guildID1)!="null")) {
  76.  
  77. // if the player belongs to that team that's already subscribed
  78. if ($@guildID1==getcharid(2)) {
  79. mes $npcname$;
  80. mes "Do you wish to unsubscribe your team?";
  81. next;
  82. if (select("Yes, we want to stop the match.","No, we're staying.")==2) close;
  83.  
  84. // if the player wishes to unsubscribe their team
  85. announce "Team " + GetGuildName($@guildID1) + " has disbanded. We need another Guild to sign up now!",bc_yellow|bc_map;
  86. set $@guildID1, 0;
  87. close;
  88. }
  89. mes $npcname$;
  90. mes "A Guild is already subscribed! It's Team "+getguildname($@guildID1)+".";
  91. close;
  92. }
  93.  
  94.  
  95. // if there are no teams subscribed and that the subscriptions are open
  96. mes $npcname$;
  97. mes "Do you wish to subscribe your team?";
  98. next;
  99. if (select("Yes, we want to subscribe.","No.")==2) close;
  100.  
  101. // Team subscription
  102. if ($@guildID1==0 || (getguildname($@guildID1)=="null")) {
  103. set $@guildID1, getcharid(2);
  104. mes $npcname$;
  105. mes "Your Guild is now subscribed, good luck!";
  106. announce "" + getguildname($@guildID1) + " Guild has subscribed For the Emperium War!",bc_yellow|bc_map;
  107. doevent "empwar::OnSubscriptionguild";
  108. close;
  109. } else {
  110. mes $npcname$;
  111. mes "I'm sorry! Another Guild has subscribed before you...";
  112. close;
  113. }
  114. end;
  115.  
  116.  
  117. L_guild2:
  118. // If a match is in play
  119. if ($@state_match >= 1) {
  120. mes $npcname$;
  121. mes "The warpers are currently unavailable because a match is in progress. Don't hesitate to try again in a few minutes!";
  122. close;
  123. }
  124.  
  125. // Does the player belong to a group?
  126. if (getcharid(2)==0) {
  127. mes $npcname$;
  128. mes "This Event is for Guilds, and you're not in a Guild. Come back with a Guild!";
  129. close;
  130. }
  131.  
  132. // Is the group of the player subscribed as the other guild already?
  133. if (getcharid(2)==$@guildID1) {
  134. mes $npcname$;
  135. mes "Hey! A player from the opposing Guild! Get ready to face off one of the best Guild!";
  136. mes "The formidable " + GetGuildName($@guildID2) + "";
  137. close;
  138. }
  139.  
  140. // If a team is already subscribed, and that team still exists
  141. if (($@guildID2!=0) && (getguildname($@guildID2)!="null")) {
  142. // if the player belongs to that team that's already subscribed
  143. if ($@guildID2==getcharid(2)) {
  144. mes $npcname$;
  145. mes "Do you wish to unsubscribe your guild?";
  146. next;
  147. if (select("Yes, we want to stop the match.","No, we're staying.")==2) close;
  148.  
  149. // if the player wishes to unsubscribe their team
  150. announce "Team "+getguildname($@guildID2)+" has disbanded. We need another Guild to sign up!",bc_yellow|bc_map;
  151. set $@guildID2, 0;
  152. close;
  153. }
  154. mes $npcname$;
  155. mes "A Guild is already subscribed! It's Team "+getguildname($@guildID2)+".";
  156. close;
  157. }
  158.  
  159. // if there are no teams subscribed and that the subscriptions are open
  160. mes $npcname$;
  161. mes "Do you wish to subscribe your Guild?";
  162. next;
  163. if (select("Yes, we want to subscribe.","No.")==2) close;
  164.  
  165. // Team subscription
  166. if ($@guildID2==0 || (getguildname($@guildID2)=="null")) {
  167. set $@guildID2, getcharid(2);
  168. mes $npcname$;
  169. mes "Your Guild is now subscribed, good luck!";
  170. announce ""+getguildname($@guildID2)+" Guild has subscribed to the Emperium War!",bc_yellow|bc_map;
  171. doevent "empwar::OnSubscriptionguild";
  172. close;
  173. } else {
  174. mes $npcname$;
  175. mes "I'm sorry! Another Guild has subscribed before you...";
  176. close;
  177. }
  178. end;
  179.  
  180.  
  181. L_enter:
  182. if (($@guildID1!=0) && ($@guildID2!=0) && (getguildname($@guildID1)!="null") && (getguildname($@guildID2)!="null")) {
  183.  
  184. if (getcharid(2)==$@guildID1) {
  185. savepoint "bat_a01",171,340;
  186. warp "bat_a01.gat", 171, 340; end;
  187. }
  188.  
  189. if (getcharid(2)==$@guildID2) {
  190. savepoint "bat_a01",155,48;
  191. warp "bat_a01.gat", 155, 48; end;
  192.  
  193. }
  194.  
  195. mes $npcname$;
  196. mes "Your not in one of the Signed up guilds";
  197. close;
  198.  
  199. }
  200. mes $npcname$;
  201. mes "There is not any guilds signed up";
  202. close;
  203.  
  204.  
  205.  
  206. L_info:
  207. mes $npcname$;
  208. mes "This Game is GvG";
  209. mes "A Guild Must Kill the other Guilds Emperium 5 times";
  210. mes "Before the other guild does.";
  211. mes "If your Guild wins the people in your Guild on the";
  212. mes "map when it ends gets the Prize by talking with one of the Exit npcs.";
  213. mes "Good Luck.";
  214. close;
  215.  
  216. bye:
  217. mes $npcname$;
  218. mes "Bye.";
  219. close;
  220.  
  221. // if the 2 guilds are subscribed
  222. OnSubscriptionguild:
  223. if (($@guildID1!=0) && ($@guildID2!=0) && (getguildname($@guildID1)!="null") && (getguildname($@guildID2)!="null")) {
  224. announce "Gaia Emperium War : We have 2 Guilds signed up now : "+getguildname($@guildID1)+" and "+getguildname($@guildID2)+".",bc_yellow|bc_map;
  225. announce "Gaia Emperium War : The members of each Guild can come Enter the War now.",bc_yellow|bc_map;
  226. set $@state_match, 1;
  227. donpcevent "Ew::OnBegin";
  228. end;
  229. }
  230.  
  231. }
  232.  
  233. //Exit
  234. bat_a01.gat,149,351,5 script Exit::Ewexit 88,{
  235. if(getcharid(2) == $Ewgid){
  236. getitem $rewarditem,rand(1,5);
  237. savepoint "Jazeera",158,127;
  238. warp "Jazeera", 158, 127; end;
  239. }
  240. savepoint "Jazeera",158,127;
  241. warp "Jazeera", 158, 127; end;
  242. }
  243.  
  244.  
  245. // function Ew Start
  246. - script Ew -1,{
  247.  
  248. OnBegin:
  249.  
  250. if (.points2 >= 5) {
  251. Announce "The Gaia Emperium War is over!",8;
  252. Announce "The Winner of Gaia Emperium War is the [" + GetGuildName($@guildID2) + "] guild.",0;
  253. set $Ewgid,getcharid(2);
  254. donpcevent "Ew::OnEnded";
  255. end;
  256. }
  257.  
  258. if (.points1 >= 5) {
  259. Announce "The Gaia Emperium War is over!",8;
  260. Announce "The Winner of Gaia Emperium War is the [" + GetGuildName($@guildID1) + "] guild.",0;
  261. set $Ewgid,getcharid(2);
  262. donpcevent "Ew::OnEnded";
  263. end;
  264. }
  265.  
  266. initnpctimer;
  267. MapRespawnGuildID "bat_a01",$Ewgid,7;
  268. monster "bat_a01",173,346,"EMPERIUM",1288,1,"Ew::OnEmpDead1";
  269. monster "bat_a01",165,50,"EMPERIUM",1288,1,"Ew::OnEmpDead2";
  270. end;
  271.  
  272. OnEmpDead2:
  273.  
  274. if ( getcharid(2) == $@guildID2 ) {
  275. stopnpctimer;
  276. set .points2, .points2 -1;
  277. dispbottom "Stop killing your own emp";
  278. Announce "The [" + GetGuildName($@guildID2) + "] guild has lost a Point for killing there own Emperium and now has [" + .points2 + "] Points!.",0;
  279. goto OnBegin;
  280. end;
  281.  
  282. } else {
  283.  
  284. stopnpctimer;
  285. set .points1, .points1 +1 ;
  286. Announce "The [" + GetGuildName($@guildID1) + "] guild has [" + .points1 + "] Points!.",0;
  287. goto OnBegin;
  288. end; }
  289.  
  290. OnEmpDead1:
  291.  
  292. if ( getcharid(2) == $@guildID1 ) {
  293. stopnpctimer;
  294. set .points1, .points1 -1;
  295. dispbottom "Stop killing your own emp";
  296. Announce "The [" + GetGuildName($@guildID1) + "] guild has lost a Point for killing there own Emperium and now has [" + .points1 + "] Points!.",0;
  297. goto OnBegin;
  298. end;
  299.  
  300. } else {
  301.  
  302. stopnpctimer;
  303. set .points2, .points2 +1 ;
  304. Announce "The [" + GetGuildName($@guildID2) + "] guild has [" + .points2 + "] Points!.",0;
  305. goto OnBegin;
  306. end; }
  307.  
  308. OnEnded:
  309. stopnpctimer;
  310. set $@state_match, 0;
  311. set .points1,0;
  312. set .points2,0;
  313. killmonsterall "bat_a01";
  314. end;
  315.  
  316. OnTimer900000:
  317. Announce "The Emperium War is over, No one was the winner!",8;
  318. set $Ewgid,0;
  319. donpcevent "Ew::OnEnded";
  320. end;
  321.  
  322. }
  323.  
  324.  
  325. //duplicates
  326. bat_a01.gat,363,266,0 duplicate(Ewexit) Ewexit#2 45,1,1
  327. bat_a01.gat,353,60,0 duplicate(Ewexit) Ewexit#3 45,1,1
  328. bat_a01.gat,138,57,0 duplicate(Ewexit) Ewexit#4 45,1,1
  329.  
  330. bat_a01 mapflag gvg
  331. bat_a01 mapflag nowarpto
  332. bat_a01 mapflag nowarp
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement