Advertisement
Guest User

Poring Coin Farm

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