Advertisement
Guest User

Untitled

a guest
Feb 10th, 2012
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 3.31 KB | None | 0 0
  1. prontera,157,190,4[TAB]script[TAB]Garden[TAB]Entrance 793,{
  2.     if(gettime(4)==6) && (gettime(3)==12) {
  3.         //enablenpc "Garden Entrance"; //this must be an issue, since if we here it's obiously enable
  4.         Announce "The Mystical Gate of the Secret Garden has opened! Fifteen players may enter.",bc_all || bc_blue;
  5.         mes "Rumor has it that there was once an ancient secret garden located near prontera!";
  6.         if(countitem(7559) < 1) close;
  7.         next;
  8.         mes "I see that you have the key... Very well, since you have the key, I can warp you to the gate.";
  9.         next;
  10.         mes "Do you want me to? Only [" + .playersmax - .playersin + "] can enter.";
  11.         next;
  12.         if(select("Yes:No") == 2) close;
  13.         set .playersin,getmapusers(.garden$); //updated to auto ajust for players leaving etc
  14.         if(.playersin == .playersmax) {
  15.             mes "Sorry the max players has been reached.";
  16.         } else {
  17.             warp .garden$,.x,.y;
  18.             //set .playersin,.playersin + 1;
  19.         }
  20.         close;
  21.     } else {
  22.         disablenpc "Garden Entrance";
  23.     }
  24.     end;
  25.  
  26. OnInit: //been move so we can click on NPC
  27.     set .garden$,"maze" // <Customizable>
  28.     set .x,50; // <Customizable>
  29.     set .y,55; // <Customizable>
  30.     set .playersmax,15; // <Customizable>
  31.     set .playersin,0;
  32.     disablenpc "Garden Entrance"; //when do you enable it ?
  33.     end;
  34.  
  35. OnSat1200: //enable npc on saturday at noon
  36.     enablenpc "Garden Entrance";
  37.     end;
  38. OnSat1800: //disable npc after 6h
  39.     disablenpc "Garden Entrance";
  40.     end;
  41. }
  42.  
  43. maze,60,60,4 script Ancient Hero of the Garden 793,{
  44. OnPCLoadMapEvent : //autoenable and spawn, comment this if you want to handle differently
  45.     if((getmapusers(.garden$) == 15) && !.spawn[1]) { //when we reach 15 player on map we enable npc and spawn monster
  46.         enablenpc "Ancient Hero of the Garden"; //nota : we enable npc so player can click on it but it's not really usefull, we should consider invisible automated npc instead.
  47. //nota2 we may have extra enable from player wich it's quite annoying but shouldn't be buggy anyway
  48.         monster .garden$,0,0,"Treasure of the Secret Garden",.spawn,10,"Ancient Hero of the Garden::L_MDeath";
  49.         set .spawn[1],1; //mark monster are spawned
  50.     }
  51.     else {
  52.         mes "I don't know exacly what's my purpose yet but monsters alreaby been spawn, found them !"
  53.         close;
  54.     }
  55.     end;
  56.  
  57. L_MDeath: //called at each mob dead
  58.     if(getmapmobs(.spawn) == 0) { //if there no more mob on map
  59.         set .spawn[1],0; //mark monster are all dead
  60.         mes "I see you have found the treasure ...";
  61.         next;
  62.         switch(rand(1,15)){
  63.             case 1 : goto L_First; //I dun like much goto but well
  64.             case 2 : goto L_Second;
  65.             case 3 : goto L_Third;
  66.             default :
  67.                 mes "I see that you did not get the sacred mark of the treasure...";
  68.                 close;
  69.         }
  70.     }
  71.     end;
  72.  
  73. L_First:
  74.     mes "Wow... You got the ultimate mark of the treasure ...";
  75.     next;
  76.     mes "I believe this is yours then...";
  77.     getitem 2862;
  78.     set zeny, zeny + 100000;
  79.     close;
  80.  
  81. L_Second:
  82.     mes "Wow... You got the legendary mark of the treasure ...";
  83.     next;
  84.     mes "I believe this is yours then...";
  85.     getitem 5682;
  86.     set zeny, zeny + 50000;
  87.     close;
  88.  
  89. L_Third:
  90.     mes "Wow... You got the holy mark of the treasure ...";
  91.     next;
  92.     mes "I believe this is yours then...";
  93.     set zeny, zeny + 20000;
  94.     close;
  95.  
  96. OnInit:
  97.     set .spawn,1902; // <Customizable>
  98.     set .garden$,"maze" // <Customizable>
  99.     disablenpc "Ancient Hero of the Garden"; //when do you enable it ?
  100.     end;
  101. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement