Advertisement
johnlol

Cubeception

May 10th, 2019
320
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //===== eAthena Script =======================================
  2. //= Mini-jeux basique pour Rose Of Sharon
  3. //===== Par: =================================================
  4. //= Hiero
  5. //===== Version du Script: ===================================
  6. //= 1.0 Obtimisation du code, corrections diverses
  7. //= 0.5 Ajout du monstre Bonus
  8. //= 0.4 Mis en place du système de récompence
  9. //= 0.2 Ajout d'un "Cubeception Count"
  10. //= 0.3 Ajout d'un killmonsterall
  11. //= 0.1 Commencement du script
  12. //===== Compatible Avec: =====================================
  13. //= eAthena TxT & SQL
  14. //===== Commentaires =========================================
  15. //
  16. //= Script automatique de l'event "Chercher le Cubeception".
  17. //= Actif toutes les deux heures à partir 00h00.
  18. prontera,163,292,3  script  Cubeception Guard   413,{
  19.     set .@GMLevel,60;   // GM level required to access NPC.
  20.     set .@npcname$, "[Cubceptionnist]";
  21.  
  22.     mes .@npcname$;
  23.  
  24.     if (getgmlevel()>=.@GMLevel) {
  25.         if ($@Cubeception_Actif == 0) {
  26.             mes "Event status: [^FF0000OFF^000000]";
  27.             mes "Do you wanna activate it ?";
  28.             next;
  29.             switch( select ("Yes:No") )
  30.             {
  31.                 case 1:
  32.                     mes .@npcname$;
  33.                     set $@Cubeception_Actif,2;
  34.                     mes "Allright, let's go !";
  35.                     close2;
  36.                     doevent "prtcub::OnGmSet";
  37.                     end;
  38.  
  39.                 case 2:
  40.                     mes .@npcname$;
  41.                     mes "Farewell then.";
  42.                     close;
  43.             }
  44.         }
  45.     }
  46.  
  47.     if ($@Cubeception_Actif == 1) {
  48.         mes "The event \"Find the Cubeception\" is currently on.";
  49.         mes "Do you want to be part of it ?"; next;
  50.         switch (select("Yes:No:See the rules")) {
  51.         case 1:
  52.             mes .@npcname$; mes "Perfect. Good luck !";
  53.             set $@event_cubeception_tabI,$@event_cubeception_tabI+1;
  54.             set $event_cubreception_playerInGame$[$@event_cubeception_tabI],strcharinfo(0);
  55.             close2;
  56.             $eventcubUsersAId[getarraysize(.eventUsersAId)] = getcharid(3);
  57.             warp .eventMap$,0,0;
  58.             end;
  59.  
  60.         case 2:
  61.             mes .@npcname$;
  62.       mes "Come see me again if you wanna be part of it.";
  63.       mes "See you soon!";
  64.             close;
  65.  
  66.         case 3:
  67.             mes .@npcname$;
  68.       mes "The principe is quite simple. Players are warped in a town full of Cubeceptions.";
  69.       mes "You'll simply have to find the good one.";
  70.       next;
  71.       mes .@npcname$;
  72.       mes "Sometimes, Bonus Monsters will appears. If you kill one, a random bonus or malus will be applied !";
  73.         close;
  74.  
  75.         }
  76.     } else {
  77.         mes "The event isn't active.";
  78.         switch (select("See the rules:Leave")) {
  79.         case 1:
  80.             mes .@npcname$;
  81.       mes "The principe is quite simple. Players are warped in a town full of Cubeceptions.";
  82.       mes "You'll simply have to find the good one.";
  83.       next;
  84.       mes .@npcname$;
  85.       mes "Sometimes, Bonus Monsters will appears. If you kill one, a random bonus or malus will be applied !";
  86.       close;
  87.  
  88.         case 2:
  89.             next; mes .@npcname$; mes "Come see me again when the event will be on.";
  90.       mes "A bientôt !";
  91.             close;
  92.         }
  93.     }
  94.  
  95.     OnInit:
  96.         set $event_cubreception_playerInGame$,0;
  97.         set $@event_cubeception_tabI,0;
  98.         set .eventMap$, "geffen";
  99.         setarray $eventcubUsersAId[0],0;
  100.         end;
  101. }
  102.  
  103. -   script  LancementCubeception::prtcub    -1,{
  104.  
  105.     OnWhisperGlobal:
  106. OnClock1200:
  107.     OnStartCubeception:
  108.     OnGmSet:
  109.  
  110.         if ($@Cubeception_Actif == 1 ) {
  111.             end; // Si par hasard, le Cubeception n'est pas tué lors de 1er lancement de l'event, le script ne sera pas réactivé une 2eme fois.
  112.         } else {
  113.             announce "The event \"Find the Cubeception\" will start in 3 minutes on the map '" + .eventMap$ + "'!",bc_all | bc_blue;
  114.             announce "Talk to the Cubceptionnist, near the Reset House (Nord East) of Prontera Village !",bc_all | bc_blue;
  115.             killmonsterall .eventMap$;
  116.             set $@Cubeception_Actif, 1; // Event actif si la variable $@Cubeception_Actif = 1
  117.             set .monster_countCubeception, 99; //Nombre de mauvais Cubeception sur la map
  118.             set .monster_eventCubeception, 1; // Nombre de bon Cubeception sur la map
  119.             set .monster_bonusCubeception, 5; // Nombre de monstre Bonus sur la map
  120.             sleep 60000;
  121.             announce "The event \"Find the Cubeception\" will start in 2 minutes !",bc_all | bc_blue;
  122.             sleep 60000;
  123.             announce "The event \"Find the Cubeception\" will start in 1 minutes !",bc_all | bc_blue;
  124.             sleep 5900;
  125.             announce "The event \"Find the Cubeception\" starts!",bc_all | bc_blue;
  126.             initnpctimer;
  127.             monster .eventMap$,0,0,"Cubeception",rand(1395,1398),.monster_countCubeception,"prtcub::OnThisMobDeath";
  128.             monster .eventMap$,0,0,"Cubeception",rand(1395,1398),.monster_eventCubeception,"prtcub::OnThisMobDeath2";
  129.             monster .eventMap$,0,0,"Bonus",rand(1395,1398),.monster_bonusCubeception,"prtcub::OnThisMobDeath3";
  130.  
  131.             setmapflag .eventMap$, 12;
  132.             setmapflag .eventMap$, 0;
  133.             setmapflag .eventMap$, 3;
  134.             setmapflag .eventMap$, 4;
  135.             setmapflag .eventMap$, 15;
  136.             setmapflag .eventMap$, 1;
  137.             setmapflag .eventMap$, 13;
  138.             setmapflag .eventMap$, 31;
  139.  
  140.             initnpctimer;
  141.  
  142.             end;
  143.  
  144.         OnTimer300000:
  145.             set $@Cubeception_Actif,0;
  146.             killmonsterall .eventMap$;
  147.             mapannounce .eventMap$,"Nobody win the event. What a shame !",bc_map | bc_blue;
  148.             sleep 3000;
  149.             for(set .@tmp1,1;.@tmp1<=$@event_cubeception_tabI;set .@tmp1,.@tmp1+1){
  150.                 charcommand "#size "+$event_cubreception_playerInGame$[.@tmp1];
  151.                 sleep 500;
  152.             }
  153.             sleep 2000;
  154.             deletearray $event_cubreception_playerInGame$,$@event_cubeception_tabI+1;
  155.             set $@event_cubeception_tabI,0;
  156.  
  157.             for (set .@i,0; .@i<getarraysize($eventcubUsersAId); set .@i,.@i+1)
  158.             {
  159.                 attachrid($eventcubUsersAId[.@i]);
  160.                 atcommand("@load");
  161.             }
  162.    
  163.             deletearray $eventcubUsersAId[0], getarraysize($eventcubUsersAId);
  164.             end;
  165.  
  166.         OnEventEnd:
  167.             removemapflag .eventMap$, 12;
  168.             removemapflag .eventMap$, 0;
  169.             removemapflag .eventMap$, 3;
  170.             removemapflag .eventMap$, 4;
  171.             removemapflag .eventMap$, 15;
  172.             removemapflag .eventMap$, 1;
  173.             removemapflag .eventMap$, 13;
  174.             removemapflag .eventMap$, 31;
  175.             end;
  176.  
  177.         OnThisMobDeath:
  178.             set .monster_countCubeception, .monster_countCubeception-1;
  179.             dispbottom "I'm not the good Cubeception.";
  180.             mapannounce .eventMap$,"There's still "+(.monster_countCubeception+.monster_eventCubeception)+" Cubeceptions on the map !",bc_blue|bc_map;
  181.             end;
  182.  
  183.         OnThisMobDeath2:
  184.             dispbottom "I am the good Cubeception !";
  185.            
  186.             if (.rewardMode == 0)
  187.             {
  188.                 logmes "[Cubeception] " + strcharinfo(0) + " wins the event and obtains " + .prizeAmt + " Currency Points.";
  189.                 callfunc ("AddPoints", getcharid(3), .prizeAmt);
  190.             }
  191.             else
  192.             {
  193.                 logmes "[CachePoring] " + strcharinfo(0) + " wins the event and obtains " + .prizeAmt + " " + getitemname(rewardId) + ".";
  194.                 getitem .rewardId, .prizeAmt;
  195.             }
  196.            
  197.             mapannounce .eventMap$,strcharinfo(0)+" just found the good Cubeception !",bc_map | bc_blue;
  198.             killmonsterall .eventMap$;
  199.             set $@Cubeception_Actif, 0;
  200.             for(set .@tmp1,1;.@tmp1<=$@event_cubeception_tabI;set .@tmp1,.@tmp1+1){
  201.                 charcommand "#size "+$event_cubreception_playerInGame$[.@tmp1];
  202.                 sleep 500;
  203.             }
  204.             sleep 2000;
  205.             deletearray $event_cubreception_playerInGame$,$@event_cubeception_tabI+1;
  206.             set $@event_cubeception_tabI,0;
  207.             for (set .@i,0; .@i<getarraysize($eventcubUsersAId); set .@i,.@i+1)
  208.             {
  209.                 attachrid($eventcubUsersAId[.@i]);
  210.                 atcommand("@load");
  211.             }
  212.    
  213.             deletearray $eventcubUsersAId[0], getarraysize($eventcubUsersAId);
  214.             goto OnEventEnd;
  215.             end;
  216.  
  217.         OnThisMobDeath3:
  218.             set .monster_bonusCubeception, .monster_bonusCubeception-1;
  219.             if (.monster_bonusCubeception >= 1)
  220.                 mapannounce .eventMap$,""+strcharinfo(0)+" found a bonus monster, there's still "+.monster_bonusCubeception+" !",bc_map | bc_blue;
  221.             else
  222.                 mapannounce .eventMap$,""+strcharinfo(0)+" found a bonus monster, there's no more !",bc_map | bc_blue;
  223.             switch (rand(1,4))
  224.             {
  225.                 case 1: set Zeny, Zeny + 25000; dispbottom "You're lucky, you become wealhtier !"; break;
  226.                 case 2:
  227.                     dispbottom "You're lucky !";
  228.                     if (.rewardMode == 0)
  229.                     {
  230.                         logmes "[Cubeception] " + strcharinfo(0) + " kills a bonus monster and obtains " + .prizeAmt + " Currency Points.";
  231.                         callfunc ("AddPoints", getcharid(3), .prizeAmt);
  232.                     }
  233.                     else
  234.                     {
  235.                         logmes "[CachePoring] " + strcharinfo(0) + " kills a bonus monster and obtains " + .prizeAmt + " " + getitemname(rewardId) + ".";
  236.                         getitem .rewardId, .prizeAmt;
  237.                     }
  238.                     break;
  239.                 case 3: percentheal -99, -99; specialeffect2 49,"strcharinfo(0)"; dispbottom "You're unlucky !"; break; // Malus HP/SP
  240.                 case 4: charcommand "#size "+strcharinfo(0)+" 1"; dispbottom "You're lucky, you're getter smaller !"; break; //
  241.             }
  242.             end;
  243.         }
  244.     OnInit:
  245.         set .eventMap$, "geffen";
  246.         set .rewardMode, 0;
  247.         set .rewardId, 675;
  248.         set .prizeAmt, 250;
  249.         end;
  250. }
  251.  
  252. //==============================================================
  253. //= Système de sécurité
  254. //==============================================================
  255.  
  256. -   script  mapload::cubmapload -1,{
  257.  
  258. OnPCLoginEvent:
  259.  
  260. getmapxy(.@map$,.@x,.@y,0);
  261.  
  262.     if (.@map$ == .eventMap$)
  263.     {
  264.         warp "prt_vilg02",157,130;
  265.     }
  266.     end;
  267. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement