Advertisement
ryax

Poring Farm

Mar 11th, 2013
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 7.55 KB | None | 0 0
  1. //
  2. //Coin Room By Ryax   \\
  3. //~~~~~~~~~~~~~~~~~~~~~~\\
  4. //=============================================================================
  5. //Concept and initial coading by: rudolp
  6. //===== Compatible With: =================================================================
  7. //Any Rathena Version {build for eathena}
  8. //==================================================
  9. poring_w02.gat  mapflag noskill
  10. poring_w02.gat  mapflag nomemo
  11. poring_w02.gat  mapflag nobranch
  12. poring_w02.gat  mapflag noloot
  13. poring_w02.gat  mapflag noexp
  14. poring_w02.gat  mapflag nodrop
  15. poring_w02.gat  mapflag novending
  16. poring_w02.gat  mapflag nowarp
  17. poring_w02.gat  mapflag nowarpto
  18. poring_w02.gat  mapflag noreturn
  19. //=================================================
  20.  
  21. poring_w02,0,0,0    script  Poring Farm -1,{
  22.  
  23. OnInit:
  24. //No. of Mine Guardian.
  25. //For golden peko it is default to 100 and 4 seconds~2 seconds spawn rate.
  26.     set .guardian,50;
  27.  
  28. //Type of guardian. 0 = normal 1 = extreme
  29.     set .@guardiantype,0;
  30.  
  31.     if(.@guardiantype == 0){
  32.         monster "poring_w02",0,0,"Farmer Bob",1949,.guardian,"";
  33.        
  34.     }else{
  35.         monster "poring_w02",0,0,"Farmer Bruto",1950,.guardian,"";
  36.     }
  37. end;
  38. OnNPCKillEvent:
  39. //===== Configurations: ========================================================================
  40.  
  41. //Max coin can a player get after killing 1 poring (default 5 note:this will increase if luk bonus is enable).
  42.     set .@maxgaincoin,5;
  43.  
  44. //Apply coin penalty. 0 = no 1 = yes
  45.     set .@penalty1,1;
  46.  
  47. //The Maximum no. of coin Penalty.
  48.     set .@maxpenalty1,3;
  49.  
  50. //Apply speed & HP penalty. 0 = no 1 = yes
  51.     set .@penalty2,1;
  52.  
  53. //coin limitation penalty must be enable
  54.     set .@maxcoin,200;
  55.  
  56. //The maximum no. of hp penalty by %.
  57.     set .@maxpenalty2,10;
  58.  
  59. //Enable luk bonus. 0=no 1=yes
  60.     set .@lukbonus,0;
  61.  
  62. //If luk Bonus is enable,luk divider default 49 w/ 99 max parameter. Note: the quotient of your max parameter and .@lukdiv must not grater than 5 to avoid over Farming.
  63.     set .@lukdiv,49;
  64.  
  65. //Show Server Name. 0=no 1=yes
  66.     set .@showservername,1;
  67.  
  68. //Name of your Server
  69.     set .@servername$,"[ServerNAME]";
  70.  
  71. //=========================================================================================
  72.  
  73.  
  74. if (getmapxy(@mapname$,@mapx,@mapy,0) == -1) goto L_Finish;
  75. if (@mapname$ == "poring_w02"){
  76.     set @bonus,0;
  77.     set @deduction,0;
  78.     set @gain,rand (.@maxgaincoin);
  79.  
  80. //Luk bonus
  81.     if (.@lukbonus != 0){
  82.         set @bonus,readparam(bLuk)/.@lukdiv;
  83.     }
  84.  
  85. //coin Penalty
  86.     if (.@penalty1 != 0){
  87.         set @deduction,rand(.@maxpenalty1);
  88.         if(@deduction == 0) set @deduction,1;  
  89.     }
  90.  
  91.     set @gain, @gain + @bonus - @deduction;
  92.     set coin, coin + @gain ;
  93.  
  94. //Displaying Gained coin
  95.     if(.@showservername != 0){
  96.         if(coin%5 == 0){ //Show Server Name every 10 coin gain.
  97.             dispbottom "===============Brought to you by===============";
  98.             dispbottom "==============" + .@servername$ +"==============";
  99.         }
  100.     }
  101.  
  102.     if(@gain){
  103.         dispbottom "-|You got: " +@gain+ " coin| - |Total: " +coin+ " coin|- ";
  104.  
  105.     }else{
  106.         dispbottom "-|You got: NOTHING! |- ";
  107.     }
  108.  
  109.  
  110.  
  111.     if (.@penalty2 != 0){
  112.         if (coin >= .@maxcoin/2 && coin <=.@maxcoin/2+20){
  113.              sc_start   SC_DECREASEAGI,240000,10;      
  114.         }else if(coin >.@maxcoin){
  115.             sc_start    SC_CURSE,240000,10;
  116.             percentheal (.@maxpenalty2*-1),(.@maxpenalty2*-1);
  117.             heal -50,0; //For him to die
  118.         }
  119.     }
  120.  
  121.     if(paid == 0){
  122.         mapannounce "poring_w02"," x( "+strcharinfo(0)+" is a cheater!",bc_map;
  123.         dispbottom "Go out you bastard!";
  124.         set coin,0;
  125.         warp "prontera", 173, 160;
  126.     }
  127.         end;
  128. }
  129.  
  130.  
  131. OnPCDieEvent:
  132.  
  133. if (getmapxy(@mapname$,@mapx,@mapy,0) == -1) goto L_Finish;
  134. if (@mapname$ == "poring_w02"){
  135.         dispbottom "Holy Shit you died!";
  136.         dispbottom "All of your coin will gone!";
  137.         set alive, 0;
  138.         set paid, 0;
  139.         end;
  140. }
  141.  
  142. L_Finish:
  143. close;
  144. }
  145.  
  146.  
  147.  
  148. //===============================================
  149. //warper
  150. //===============================================
  151. poring_w02,117,83,4 script  coin Farmer 813,{
  152.     mes "[coin Farmer]";
  153.     if(coin >=2){
  154.         goto wa;
  155.     }
  156.     mes "Want to go now?";
  157.     mes "Your coin is just "+coin+" you can still get more.";
  158.     close;
  159. wa:
  160.     mes "Want to go now?";
  161.      if(select("Yes", "No") == 1) {
  162.         set alive,1;
  163.                 warp "prontera", 173, 160;
  164.         }
  165.     close;
  166. }
  167.  
  168. prontera,165,158,5  script  coin Room Warperer#pront    813,{
  169.     set @name$,"prontera";
  170.     callfunc "coinmain";
  171.     end;
  172. }
  173.  
  174. aldebaran,133,116,4 script  coin Room Warperer#alde 813,{
  175.     set @name$,"aldebaran";
  176.     callfunc "coinmain";
  177.     end;
  178. }
  179.  
  180. alberta,23,247,4    script  coin Room Warperer#alb  813,{
  181.     set @name$,"alberta";
  182.     callfunc "coinmain";
  183.     end;
  184. }
  185. payon,151,182,4 script  coin Room Warperer#pay  813,{
  186.     set @name$,"payon";
  187.     callfunc "coinmain";
  188.     end;
  189. }
  190.  
  191. geffen,115,74,4 script  Farm Warper#gef 813,{
  192.     set @name$,"geffen";
  193.     callfunc "coinmain";
  194.     end;
  195. }
  196.  
  197. function    script  coinmain    {
  198.     if (getgmlevel() >= 90){
  199.         mes "[Poring Farm Warper]";
  200.     if(sex != 0){
  201.         mes "Hello Sir what can I do for you?";
  202.     }else{
  203.         mes "Hello Maam what can I do for you?";
  204.     }
  205.  
  206.     next;
  207.     menu "Enter Farming Site",start,"Please close the Farm Site. Now!",-,"Please Open the Farm Site. Now!",G_open,"Nothing",C_s;
  208.     next;
  209.     mes "[Poring Farm Warper]";
  210.     mapannounce "prontera","Excuse me Farmers.",bc_map;
  211.     mes "Ok.";
  212.     next;
  213.     mapannounce "prontera",strcharinfo(0) +" wants to close the coin Room for a while",bc_map;
  214.     mes "Just a second I will just ask them to";
  215.     mes "go out in the Farming site";
  216.     next;
  217.     mapannounce "prontera","Please settle your things and move quitely",bc_map;
  218.     mes "[Poring Farm Warper]";
  219.     mes ".............";
  220.     mes "........";
  221.     next;
  222.     mes "[Poring Farm Warper]";
  223.     mes "Ok your done";
  224.     set .opencoinroom,1;
  225.     atcommand "@Doommap";
  226.     close;
  227.     }
  228.  
  229.     if(.opencoinroom == 0){
  230.         goto start;
  231.     }else{
  232.         mes "[Poring Farm Warper]";
  233.         mes "Sorry!";
  234.         mes "The Farming Site is closed.";
  235.         close;
  236.     }
  237. G_open:
  238.     mes "[Poring Farm Warper]";
  239.     mes "Ok.";
  240.     mes "Farming Site is Already Available.";
  241.     announce " coin Room is open for public!",bc_map;
  242.     set .opencoinroom,0;
  243. close;
  244.  
  245. start:
  246.     if ( alive == 0){
  247.         set coin,0;
  248.     }
  249.     mes "[Poring Farm Warper]";
  250.     mes "What do you want?";
  251.     next;
  252.     menu "To the coin Room",-,"Exchange coin",exchange,"Nothing",C_s;
  253.     mes "[coin Room Warperer]";
  254.     mes "Hmm..";
  255.     mes "It cost 100,000z";
  256.         mes "Would you like to go now to the coin room?";
  257.         if(select("Yes", "No") == 1) {
  258.         if(@name$ == "prontera") savepoint "prontera", 173, 160;
  259.         if(@name$ == "aldebaran") savepoint "aldebaran",166, 163;
  260.         if(@name$ == "alberta") savepoint "alberta",16, 246;
  261.         if(@name$ == "payon") savepoint "payon",160, 179;
  262.         if(@name$ == "geffen") savepoint "geffen",124, 85;
  263.         if (Zeny < 100000) goto nomoney;
  264.         set Zeny, Zeny - 100000;
  265.         set alive, 1;
  266.         set paid, 1;
  267.                 warp "poring_w02", 121, 83;
  268.        
  269.         }
  270.         close;
  271. nomoney:
  272.     mes "[Poring Farm Warper]";
  273.     mes "Sorry insufficient balance";
  274.     close;
  275. exchange:
  276.     mes "[Poring Farm Warper]";
  277.     mes "Hmm...let me see";
  278.     mes "You have " +coin+ ".";
  279.     if (coin == 0) goto nocoin;
  280.     mes "Ok get this.";
  281.     next;
  282.         if (checkweight(7539,coin) == 0) goto L_OverWeight;
  283.     getitem 7539, coin;
  284.     set coin, 0;
  285.     emotion e_gg;
  286.     close;
  287. L_OverWeight:
  288.     mes "[Poring Farm Warper]";
  289.     mes "Sorry your overweight";
  290.     close;
  291. nocoin:
  292.     close;
  293. C_s:
  294.     close;
  295. }
  296.  
  297.  
  298. //============================================================
  299.  
  300. //===========================================================
  301. //========================================
  302. //========================================
  303.  
  304.  
  305. //============Spawns=================
  306.  //-----------you can change this "100" value to the number of monsters you want--//
  307. poring_w02,0,0,0,0  monster Farm Poring 1002,100,40000,20000,0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement