Advertisement
johnlol

Instance_PvP

May 22nd, 2019
279
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //===================================================
  2. //=  __  __                  __                     =
  3. //= /\ \/\ \                /\ \      __            =
  4. //= \ \ `\\ \    ___     ___\ \ \____/\_\     __    =
  5. //=  \ \ , ` \  / __`\  / __`\ \ '__`\/\ \  /'__`\  =
  6. //=   \ \ \`\ \/\ \_\ \/\ \_\ \ \ \_\ \ \ \/\  __/  =
  7. //=    \ \_\ \_\ \____/\ \____/\ \_,__/\ \_\ \____\ =
  8. //=     \/_/\/_/\/___/  \/___/  \/___/  \/_/\/____/ =
  9. //===================================================
  10. //= Instance PvP                                    =
  11. //= Created by Noobie                               =
  12. //= Created for FlurryRO                            =
  13. //= Language: English                               =
  14. //= Map: 1@pvp                                      =
  15. //= for eAthena                                     =
  16. //= Revision 14006 or above                         =
  17. //===================================================
  18. //= Credits                                         =
  19. //= Masao for his Support on the script             =
  20. //= Davven for creating the used Map                =
  21. //===================================================
  22. //= Version 1.0                                     =
  23. //===================================================
  24. //= Changelog                                       =
  25. //===================================================
  26. //= 0.9                                             =
  27. //= First Version                                   =
  28. //= 1.0                                             =
  29. //= Release~                                        =
  30. //===================================================
  31. // = Settings - Modify them as you feel you should  =
  32. // ==================================================
  33. -   script  PD_Settings -1,{
  34. OnInit:
  35.     set $PD_Timelimit,600;  // Seconds for entering
  36.     set $PD_Minparty,2;     // # of players a party must have
  37.     //set $PD_ItemID,969;   // ItemID //Not working yet
  38.     end;
  39. }
  40.  
  41. brasilis,200,258,5  script  Duel PVP    406,{
  42.  
  43.     set .@name$,"^0000FFPvP Warper^000000";
  44.  
  45.     getpartymember(getcharid(1));
  46.     if(!getcharid(1) || $@partymembercount < $PD_Minparty){
  47.             mes .@name$;
  48.             mes "Make or join the party with exactly "+$PD_Minparty+" member or try again.";
  49.         set PD_makeparty,1;
  50.         close;
  51.     }
  52.     if(PD_makeparty){
  53.         mes .@name$;
  54.         mes "Confirmed. You are in a party. What would you like to do?";
  55.         set PD_makeparty,0;
  56.         next;
  57.     }
  58.     mes .@name$;
  59.     mes "If you have generated the PvP Duel already, you can enter it.";
  60.     next;
  61.     if(getpartyleader(getcharid(1),2) == getcharid(0)){
  62.         select("Generate PvP Duel Instance:Enter the PvP Duel Instance:Return to Brasilis:Cancel");
  63.     } else {
  64.         select(":Enter the PvP Duel Instance:Return to Brasilis:Cancel");
  65.     }
  66.     switch(@menu){
  67.     case 1:
  68.         if(instance_id(1)){
  69.             if(has_instance("1@pvp") == ""){
  70.                 mes .@name$;
  71.                 mes "Your group is already registered at an other instance.";
  72.                 close;
  73.             }
  74.             mes .@name$;
  75.             mes "Your group is already registered.";
  76.             mes "Select ^0000FFEnter the Duel^000000 in the main menu to enter.";
  77.             close;
  78.         }
  79.         mes .@name$;
  80.         mes "^0000FFPvP Duel Instance^000000 - Try to reserve";
  81.         mes "After making a reservation, you have to talk to NPC behind and";
  82.         mes "select the menu 'Enter the Duel' to enter the PvP Duel";
  83.         close2;
  84.         set .@instance_id,instance_create("PvP_Duel",getcharid(1));
  85.         if(.@instance_id < 0){
  86.             mes .@name$;
  87.             mes "Failed to create PvP Duel Intsance.";
  88.             mes "^FF0000PvP Duel Instances reached its limit.^000000";
  89.             mes "Please report this error to an administrator or GM.";
  90.             close;
  91.         }
  92.         instance_attachmap("1@pvp",.@instance_id);
  93.         instance_set_timeout $PD_Timelimit,600,.@instance_id;
  94.         instance_init .@instance_id;
  95.         instance_attach instance_id(1);
  96.         end;
  97.     case 2:
  98.         if(!instance_id(1) || has_instance("1@pvp") == ""){
  99.             mes .@name$;
  100.             mes "The PvP Duel Instance does not exist.";
  101.             mes "Please confirm with your party leader wether the memorial dungeon";
  102.             mes "has been destructed or if the time given for entering has been expired.";
  103.             close;
  104.         }
  105.         instance_attach instance_id(1);
  106.         set PD_Lastinstid,instance_id(1);
  107.         set PD_map,1;
  108.         set @id,getcharid(1);
  109.         donpcevent instance_npcname("PD_Manager")+"::OnInstanceInit";
  110.         warpparty "1@pvp",51,46,@id;
  111.         //warp has_instance("1@pvp"),0,0;
  112.         close;
  113.     case 3:
  114.         warp "brasilis",195,259;
  115.         close;
  116.     case 4:
  117.         close;
  118.     }
  119. }
  120.  
  121. 1@pvp,0,0,0 script  PD_Manager  -1,{
  122.     end;
  123.  
  124. OnInstanceInit:
  125.     if(strnpcinfo(3) == "PD_Manager")
  126.         end;
  127.     sleep 3000;
  128.     instance_announce .@instance_id,"Get Ready...",0x00FF00;
  129.     sleep 3000;
  130.     instance_announce .@instance_id,"4",0x00FF00;
  131.     sleep 3000;
  132.     instance_announce .@instance_id,"3",0x00FF00;
  133.     sleep 3000;
  134.     instance_announce .@instance_id,"2",0x00FF00;
  135.     sleep 3000;
  136.     instance_announce .@instance_id,"1",0x00FF00;
  137.     sleep 3000;
  138.     instance_announce .@instance_id,"GO!",0x00FF00;
  139.     atcommand "@pvpon";
  140.     end;
  141.  
  142. OnPCKillEvent:
  143.     if(PD_map==1){
  144.     //getitem $PD_ItemID,1; //Not working yet
  145.     pvpoff "1@pvp";
  146.     sleep2 1000;
  147.     instance_attach instance_id(1);
  148.     instance_warpall "brasilis",195,259;
  149.     instance_destroy instance_id(1);
  150.     set PD_map,0;
  151.     end;
  152.     }
  153.     end;
  154. OnPCLogoutEvent:
  155.     if(PD_map==1){
  156.     pvpoff "1@pvp";
  157.     instance_attach instance_id(1);
  158.     instance_warpall "brasilis",195,259;
  159.     instance_destroy instance_id(1);
  160.     set PD_map,0;
  161.     end;
  162. }
  163.     end;
  164.  
  165. OnPCDieEvent:
  166.     if(PD_map==1){
  167.     pvpoff "1@pvp";
  168.     sleep2 1000;
  169.     instance_attach instance_id(1);
  170.     instance_warpall "brasilis",195,259;
  171.     instance_destroy instance_id(1);
  172.     set PD_map,0;
  173.     end;
  174. }
  175.     end;
  176.    
  177. OnPCLoginEvent:
  178.     set PD_map,0;
  179.     end;
  180. }
  181.  
  182. 1@pvp   mapflag pvp_noparty
  183. 1@pvp   mapflag pvp_noguild
  184. 1@pvp   mapflag partylock
  185. 1@pvp   mapflag nowarp
  186. 1@pvp   mapflag nowarpto
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement