Advertisement
Guest User

KvM A by suke

a guest
Jan 23rd, 2014
426
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 10.20 KB | None | 0 0
  1. // ==============================================================================
  2. // BattleGround System - KVM A - 5 vs 5
  3. // ==============================================================================
  4. // Tomando la Base de eAthena/Zephyrus_cr, Modificado por s4zuk3 - Suke
  5. // Registration NPC's
  6. // *********************************************************************
  7.  
  8.  
  9. bat_room,253,227,4  script  Registration::KvM01R_Guillaume  418,{ // KvM Guillaume
  10.     end;
  11.  
  12. OnInit:
  13.     waitingroom "Battle Station 5 Players",5,"KvM01_BG::OnGuillaumeJoin",1;
  14.     end;
  15.    
  16. OnEnterBG:
  17.     set $@KvM01BG_id1, waitingroom2bg("bat_c01",53,128,"KvM01_BG::OnGuillaumeQuit","KvM01_BG::OnGuillaumeDie");
  18.     end;
  19. }
  20.  
  21. bat_room,253,204,0  script  Registration::KvM01R_Croix  414,{ // KvM Croix
  22.     end;
  23.  
  24. OnInit:
  25.     waitingroom "Battle Station 5 Players",5,"KvM01_BG::OnCroixJoin",1;
  26.     end;
  27.  
  28. OnEnterBG:
  29.     set $@KvM01BG_id2, waitingroom2bg("bat_c01",146,55,"KvM01_BG::OnCroixQuit","KvM01_BG::OnCroixDie");
  30.     end;
  31. }
  32.  
  33. // Light Effects
  34. // *********************************************************************
  35.  
  36. bat_c01,54,123,0    script  #bat_c01a   111,{
  37.     end;
  38.  
  39. OnKvM01LightA: misceffect 54; end;
  40. OnKvM01LightB: misceffect 55; end;
  41. OnKvM01LightC: misceffect 56; end;
  42. }
  43.  
  44. bat_c01,56,125,0    duplicate(#bat_c01a)    #bat_c01b   111
  45. bat_c01,58,127,0    duplicate(#bat_c01a)    #bat_c01c   111
  46. bat_c01,141,56,0    duplicate(#bat_c01a)    #bat_c01d   111
  47. bat_c01,143,58,0    duplicate(#bat_c01a)    #bat_c01e   111
  48. bat_c01,145,60,0    duplicate(#bat_c01a)    #bat_c01f   111
  49.  
  50. // Battleground Engine
  51. // *********************************************************************
  52.  
  53. -   script  KvM01_BG    -1,{
  54.     end;
  55.  
  56. OnInit:
  57.     setwall "bat_c01",54,122,6,7,0,"batc01wall_a";
  58.     setwall "bat_c01",55,122,5,7,0,"batc01wall_b";
  59.     setwall "bat_c01",140,56,6,7,0,"batc01wall_c";
  60.     setwall "bat_c01",140,57,5,7,0,"batc01wall_d";
  61.     disablenpc "TherapistKvM01a";
  62.     disablenpc "TherapistKvM01b";
  63.     disablenpc "VintenarKvM01a";
  64.     disablenpc "VintenarKvM01b";
  65.     end;
  66.  
  67. OnGuillaumeJoin:
  68. OnCroixJoin:
  69.     donpcevent "KvM01_BG::OnReadyCheck";
  70.     end;
  71.  
  72. OnGuillaumeQuit:
  73.     set BG_Delay_Tick, gettimetick(2) + 1200;
  74. OnGuillaumeDie:
  75.     if( $@KvM01BG == 2 )
  76.     {
  77.         set .Guillaume_Count, .Guillaume_Count - 1;
  78.         set .Croix_Score, .Croix_Score + 1;
  79.         bg_updatescore "bat_c01",.Guillaume_Score,.Croix_Score;
  80.         if( .Guillaume_Count < 1 ) donpcevent "KvM01_BG::OnCroixWin";
  81.     }
  82.     end;
  83.  
  84. OnCroixQuit:
  85.     set BG_Delay_Tick, gettimetick(2) + 1200;
  86. OnCroixDie:
  87.     if( $@KvM01BG == 2 )
  88.     {
  89.         set .Croix_Count, .Croix_Count - 1;
  90.         set .Guillaume_Score, .Guillaume_Score + 1;
  91.         bg_updatescore "bat_c01",.Guillaume_Score,.Croix_Score;
  92.         if( .Croix_Count < 1 ) donpcevent "KvM01_BG::OnGuillaumeWin";
  93.     }
  94.     end;
  95.  
  96. OnReadyCheck:
  97.     if( $@KvM01BG )
  98.         end;
  99.     set .@Guillaume, getwaitingroomstate(0,"KvM01R_Guillaume");
  100.     set .@Croix, getwaitingroomstate(0,"KvM01R_Croix");
  101.  
  102.     if( .@Guillaume < 5 || .@Croix < 5 )
  103.     {
  104.         if( .@Guillaume > 3 && .@Croix > 3 && !agitcheck() && $@KvM_Flood < gettimetick(2) )
  105.         {
  106.             announce "Battleground -- Kreiger Von Midgard [5 vs 5] G: " + .@Guillaume + "/5, C: " + .@Croix + "/5",0,0x696969;
  107.             set $@KvM_Flood, gettimetick(2) + 15;
  108.         }
  109.         else
  110.             mapannounce "bat_room","Battleground -- Kreiger Von Midgard [5 vs 5] G: " + .@Guillaume + "/5, C: " + .@Croix + "/5",1,0x696969;
  111.         end;
  112.     }
  113.  
  114.     set $@KvM01BG, 1; // Starting
  115.     donpcevent "KvM01R_Croix::OnEnterBG";
  116.     donpcevent "KvM01R_Guillaume::OnEnterBG";
  117.     donpcevent "KvM01_BG::OnStart";
  118.     end;
  119.  
  120. OnStart:
  121.     announce "Battleground -- Kreiger Von Midgard [5 vs 5] has started!",0,0x696969;
  122.     enablenpc "TherapistKvM01a";
  123.     enablenpc "TherapistKvM01b";
  124.     disablenpc "VintenarKvM01a";
  125.     disablenpc "VintenarKvM01b";
  126.     set $@KvM01BG_Victory, 0;
  127.     // Warp Teams
  128.     bg_warp $@KvM01BG_id1,"bat_c01",53,128;
  129.     bg_warp $@KvM01BG_id2,"bat_c01",146,55;
  130.     // ScoreBoard
  131.     set .Guillaume_Score, 0;
  132.     set .Croix_Score, 0;
  133.     initnpctimer;
  134.     end;
  135.  
  136. OnTimer5000:
  137.     areapercentheal "bat_c01",50,123,58,131,100,100;
  138.     areapercentheal "bat_c01",141,52,149,60,100,100;
  139.     mapannounce "bat_c01","The Battle will start in 25 seconds!!",1,0x696969;
  140.     end;
  141.  
  142. OnTimer26000:
  143.     mapannounce "bat_c01","The Battle will start in 4 seconds!!",1,0x696969;
  144.     end;
  145.  
  146. OnTimer27000:
  147.     donpcevent "::OnKvM01LightA";
  148.     end;
  149.  
  150. OnTimer28000:
  151.     donpcevent "::OnKvM01LightB";
  152.     end;
  153.    
  154. OnTimer29000:
  155.     donpcevent "::OnKvM01LightC";
  156.     end;
  157.  
  158. OnTimer30000:
  159.     // Team Members
  160.     set .Guillaume_Count, bg_get_data($@KvM01BG_id1, 0);
  161.     set .Croix_Count, bg_get_data($@KvM01BG_id2, 0);
  162.     if( .Guillaume_Count < 5 || .Croix_Count < 5 )
  163.     {
  164.         set $@KvM01BG_Victory, 3;
  165.         set $@KvM01BG, 3;
  166.         mapannounce "bat_c01","There are not enough players to start the battle",1,0x696969;
  167.         stopnpctimer;
  168.         sleep 2000;
  169.         donpcevent "KvM01_BG::OnStop";
  170.         end;
  171.     }
  172.  
  173.     set $@KvM01BG, 2; // Playing
  174.     areapercentheal "bat_c01",50,123,58,131,100,100;
  175.     bg_warp $@KvM01BG_id1,"bat_c01",62,119;
  176.     areapercentheal "bat_c01",141,52,149,60,100,100;
  177.     bg_warp $@KvM01BG_id2,"bat_c01",137,64;
  178.     end;
  179.  
  180. OnTimer32000:
  181.     mapannounce "bat_c01","The Battle of Kreiger Von Midgard has begun!!",1,0x696969;
  182.     end;
  183.  
  184. OnTimer300000:
  185.     mapannounce "bat_c01","The Battle will ends in 30 seconds!!",1,0x696969;
  186.     end;
  187.  
  188. OnTimer330000:
  189.     if( .Croix_Count > .Guillaume_Count )
  190.         donpcevent "KvM01_BG::OnCroixWin";
  191.     else if( .Croix_Count < .Guillaume_Count )
  192.         donpcevent "KvM01_BG::OnGuillaumeWin";
  193.     else
  194.     { // Draw Game
  195.         set $@KvM01BG, 3;
  196.         set $@KvM01BG_Victory, 3;
  197.  
  198.         stopnpctimer;
  199.         sleep 2000;
  200.         mapannounce "bat_c01","The time is out! This is a Tie...",1,0x696969;
  201.         donpcevent "KvM01_BG::OnStop";
  202.     }
  203.     end;
  204.  
  205. OnGuillaumeWin:
  206.     set $@KvM01BG, 3;
  207.     set $@KvM01BG_Victory, 1;
  208.    
  209.     stopnpctimer;
  210.     sleep 2000;
  211.     mapannounce "bat_c01","The Guillaume Army has won the Battle of Kreiger Von Midgard",1,0x0000FF;
  212.     donpcevent "KvM01_BG::OnStop";
  213.     end;
  214.  
  215. OnCroixWin:
  216.     set $@KvM01BG, 3;
  217.     set $@KvM01BG_Victory, 2;
  218.  
  219.     stopnpctimer;
  220.     sleep 2000;
  221.     mapannounce "bat_c01","The Croix Army has won the Battle of Kreiger Von Midgard",1,0xFF0000;
  222.     donpcevent "KvM01_BG::OnStop";
  223.     end;
  224.  
  225. OnStop:
  226.     disablenpc "TherapistKvM01a";
  227.     disablenpc "TherapistKvM01b";
  228.     enablenpc "VintenarKvM01a";
  229.     enablenpc "VintenarKvM01b";
  230.     // Warp Teams
  231.     bg_warp $@KvM01BG_id1,"bat_c01",53,128;
  232.     bg_warp $@KvM01BG_id2,"bat_c01",146,55;
  233.     donpcevent "KvM01_BG_Out::OnBegin";
  234.     end;
  235.  
  236. OnReset:
  237.     stopnpctimer;
  238.     stopnpctimer "KvM01_BG_Out";
  239.     set .Croix_Count, 0;
  240.     set .Guillaume_Count, 0;
  241.     set .Croix_Score, 0;
  242.     set .Guillaume_Score, 0;
  243.     set $@KvM01BG_Victory, 0;
  244.     if( $@KvM01BG_id1 ) { bg_destroy $@KvM01BG_id1; set $@KvM01BG_id1, 0; }
  245.     if( $@KvM01BG_id2 ) { bg_destroy $@KvM01BG_id2; set $@KvM01BG_id2, 0; }
  246.     disablenpc "TherapistKvM01a";
  247.     disablenpc "TherapistKvM01b";
  248.     disablenpc "VintenarKvM01a";
  249.     disablenpc "VintenarKvM01b";
  250.     sleep 1000;
  251.     mapwarp "bat_c01","bat_room",155,150;
  252.     sleep 2000;
  253.     maprespawnguildid "bat_c01",0,3; // Just in case someone else
  254.     bg_updatescore "bat_c01",0,0;
  255.     sleep 2000;
  256.     set $@KvM01BG, 0;
  257.     donpcevent "KvM01_BG::OnReadyCheck"; // Maybe a game is ready to start
  258.     end;
  259. }
  260.  
  261. -   script  KvM01_BG_Out    -1,{
  262.     end;
  263.  
  264. OnBegin:
  265.     initnpctimer;
  266.     end;
  267.  
  268. OnTimer3000:
  269.     mapannounce "bat_c01","Battle of Kreiger Von Midgard will close in 1 minute!",1,0x696969;
  270.     end;
  271. OnTimer30000:
  272.     mapannounce "bat_c01","Battle of Kreiger Von Midgard will close in 30 seconds!",1,0x696969;
  273.     end;
  274. OnTimer50000:
  275.     mapannounce "bat_c01","Battle of Kreiger Von Midgard will close in 10 seconds!",1,0x696969;
  276.     end;
  277. OnTimer60000:
  278.     donpcevent "KvM01_BG::OnReset";
  279.     end;
  280. }
  281.  
  282. // Battleground Therapist
  283. // *********************************************************************
  284.  
  285. bat_c01,51,130,5    script  Therapist in battle::TherapistKvM01a    95,{
  286.     mes "[Therapist in battle]";
  287.     mes "Just close your eyes, and take a deep breathe.";
  288.     mes "You can be free from pain.";
  289.     specialeffect2 312;
  290.     close;
  291. }
  292.  
  293. bat_c01,148,53,1    script  Therapist in battle::TherapistKvM01b    95,{
  294.     mes "[Therapist in battle]";
  295.     mes "Just close your eyes, and take a deep breathe.";
  296.     mes "You can be free from pain.";
  297.     specialeffect2 312;
  298.     close;
  299. }
  300.  
  301. // Battleground rewards
  302. // *********************************************************************
  303.  
  304. bat_c01,51,130,5    script  Guillaume Vintenar::VintenarKvM01a  419,{
  305.     if( $@KvM01BG_Victory )
  306.     {
  307.         if( $@KvM01BG_Victory == 3 )
  308.         {
  309.             set KVMA_BG_Tick, gettimetick(2) + 300;
  310.             bg_leave;
  311.             warp "bat_room",155,150;
  312.             end;
  313.         }
  314.         else if( $@KvM01BG_Victory == Bat_Team )
  315.         { // Victory
  316.             set .@Reward, 5;
  317.             mes "[Swandery]";
  318.             mes "Blessed Guillaume!!";
  319.             mes "Let's enjoy our glorious victory!";
  320.             mes "" + strcharinfo(0) + ", its a sign reflecting victory";
  321.             close2;
  322.         }
  323.         else
  324.         { //
  325.             set .@Reward, 1;
  326.             mes "[Swandery]";
  327.             mes "You lost, but you're dedicated to this battle.";
  328.             mes "This is a reward for your great dedication by Guillaume Marollo!";
  329.             mes "Just take this defeat a lesson, and later you would definitely learn.";
  330.             close2;
  331.         }
  332.  
  333.         set KVMA_BG_Tick, gettimetick(2) + 300;
  334.         getitem 7773, .@Reward;
  335.         bg_leave;
  336.         warp "bat_room",155,150;
  337.         end;
  338.     }
  339.     end;
  340. }
  341.  
  342. bat_c01,148,53,1    script  Croix Vintenar::VintenarKvM01b  415,{
  343.     if( $@KvM01BG_Victory )
  344.     {
  345.         if( $@KvM01BG_Victory == 3 )
  346.         {
  347.             set KVMA_BG_Tick, gettimetick(2) + 300;
  348.             bg_leave;
  349.             warp "bat_room",155,150;
  350.             end;
  351.         }
  352.         else if( $@KvM01BG_Victory == Bat_Team )
  353.         { // Victory
  354.             set .@Reward, 5;
  355.             mes "[Swandery]";
  356.             mes "Blessed Croax!!";
  357.             mes "Let's enjoy our glorious victory!";
  358.             mes "" + strcharinfo(0) + ", its a sign reflecting victory";
  359.             close2;
  360.         }
  361.         else
  362.         { //
  363.             set .@Reward, 1;
  364.             mes "[Swandery]";
  365.             mes "Oh, " + strcharinfo(0) + ". Don't be sad.";
  366.             mes "Even though we didn't win, we did our best.";
  367.             mes "This is a Royal gift from Croix, and please don't forget this battle. We can win the next.";
  368.             close2;
  369.         }
  370.  
  371.         set KVMA_BG_Tick, gettimetick(2) + 300;
  372.         getitem 7773, .@Reward;
  373.         bg_leave;
  374.         warp "bat_room",155,150;
  375.         end;
  376.     }
  377.     end;
  378. }
  379.  
  380. // MapFlags
  381. // *********************************************************************
  382.  
  383. bat_c01 mapflag battleground    2
  384. bat_c01 mapflag nomemo
  385. bat_c01 mapflag nosave  SavePoint
  386. bat_c01 mapflag noteleport
  387. bat_c01 mapflag nowarp
  388. bat_c01 mapflag nowarpto
  389. bat_c01 mapflag noreturn
  390. bat_c01 mapflag nobranch
  391. bat_c01 mapflag nopenalty
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement