Advertisement
Guest User

fishing RO

a guest
Apr 24th, 2015
243
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 4.25 KB | None | 0 0
  1. -   script  FishingFunctions    -1,{
  2. function Fishing; function Calculate;
  3. function Show; function Level;
  4. function Bait;
  5.  
  6. OnFishing:
  7.     Level ( cur_Level );
  8.     Bait ( @baitselect );
  9.     Fishing( @fishingMap, cur_Level, @level_Modifier, $@fishing_Exp, @amount );
  10.     end;
  11.    
  12. OnShowin:
  13.     Show( cur_Level, @level_Modifier, $@fishing_Exp );
  14.     end;
  15.  
  16. OnInit:
  17. setarray $@FishingLevel[0], 50, 125, 175, 220, 300, 450, 525, 600;
  18. setarray $@Drop[0], 7227, 7228, 7229;
  19. setarray $@defaultDrop[0], 910, 911, 912;
  20. setarray $@baitID[0], 909, 908, 903;
  21. $@fishing_Exp = 1; // 1 = x1 rates.
  22. end;
  23. function    Level   {
  24.     if(getarg(0) == 600) end;
  25. }
  26. function    Bait    {
  27.  
  28.     if(@baitselect == 903) {
  29.         dispbottom "Отлично, ты используешь крутую наживку!";
  30.         return @level_Modifier = 2;
  31.     }
  32.    
  33.     return;
  34. }
  35. function Fishing {
  36.     if( !getarg(0) ) end; //cheat?:D
  37.     if( getarg(0) == 1) { //izlude fishing guild
  38.        
  39.         if( !getarg(3) ) $@fishing_Exp = 1; //default x1
  40.         if( !getarg(2) ) @level_Modifier = $@fishing_Exp; //default
  41.        
  42.         @loop = getarg(4);
  43.         while(@loop) {
  44.             if(!countitem(@baitselect)) {
  45.                 dispbottom "нет наживки";
  46.                 @loop = 0;
  47.                 end;
  48.             }
  49.             message strcharinfo(0), "Осталось наживки : "+ @loop;
  50.             progressbar "green", rand(3,5);
  51.             switch(rand(1,5)) {            
  52.                 case 1: // ничего
  53.                     @loop -= 1;
  54.                     dispbottom "Сорвалось :< ";
  55.                     delitem @baitselect, 1;
  56.                     break;
  57.                 case 2: // простая добыча
  58.                     @loop -= 1;
  59.                     @get_item = $@defaultDrop[rand(2)];
  60.                     dispbottom "default drop1";
  61.                     delitem @baitselect, 1;
  62.                     @defaultExp = 1;
  63.                     getitem @get_item, 1;
  64.                     Calculate ( @defaultExp, getarg(2), getarg(3) );
  65.                     break;
  66.                 case 3:
  67.                     @loop -= 1;
  68.                     dispbottom "Сорвалось :< ";
  69.                     delitem @baitselect, 1;
  70.                     break;
  71.                 case 4:
  72.                     @loop -= 1;
  73.                     dispbottom "Сорвалось :< ";
  74.                     delitem @baitselect, 1;
  75.                     break;
  76.                 case 5:
  77.                     @loop -= 1;
  78.                     @get_item = $@Drop[rand(2)];
  79.                     dispbottom "default drop2";
  80.                     delitem @baitselect, 1;
  81.                     @defaultExp = 2;
  82.                     getitem @get_item, 1;
  83.                     Calculate ( @defaultExp, getarg(2), getarg(3) );
  84.                     break;
  85.                    
  86.                 default:
  87.                     dispbottom "Я даже наживку насадить немогу!";
  88.                     break;
  89.             }
  90.            
  91.             if(@error) {
  92.                 dispbottom "ошибка. обратитесь к администрации.";
  93.             }
  94.            
  95.         }
  96.         message strcharinfo(0), "наживка закончилась";
  97.         end;
  98.     }
  99.  
  100. }
  101.  
  102. function    Calculate   {
  103.  
  104.     if(!getarg(0)) return @error = 1;
  105.     if(!getarg(1)) return @error = 1;
  106.     if(!getarg(2)) return @error = 1;
  107.     @levelMod += getarg(0) * ( getarg(1) + getarg(2) );
  108.     if(cur_Level + @levelMod > 600) @levelMod += 1;
  109.     cur_Level += @levelMod;
  110.     dispbottom "[Рыбная Ловля] + "+@levelMod+". Всего ("+cur_Level+" / "+$@FishingLevel[7]+").";
  111.     return;
  112. }
  113.  
  114. function    Show    {
  115.     mes "[Рыбная Ловля] Всего ("+cur_Level+" / "+$@FishingLevel[7]+").";
  116.     if(cur_Level > 0 && cur_Level < 200) {
  117.         @color$ = "^FF0000";
  118.         @message$ = "[" + @color$ + "||||^000000|||||||||||||||||||||||||||||]";
  119.     }
  120.     if(cur_Level > 199 && cur_Level < 400) {
  121.         @color$ = "^00FF00";
  122.         @message$ = "[" + @color$ + "||||||||||||||||||^000000|||||||||||||||]";
  123.     }
  124.     if(cur_Level > 399 && cur_Level <= 600) {
  125.         @color$ = "^0000FF";
  126.         @message$ = "[" + @color$ + "|||||||||||||||||||||||||||||||||^000000]";
  127.     }
  128.     mes @message$;
  129.     mes "Рейты : х"+$@fishing_Exp;
  130.     mes "Ваши улучшения : +"+@level_Modifier;
  131.     close;
  132. }
  133. }
  134. izlude,134,74,6 script  Fisher  100,{
  135.     switch(select("Fishing:Show")){
  136.         case 1:
  137.             mes "Выберите наживку";
  138.             set .@menu$, "";
  139.             for(set .@i,0; .@i < 3; set .@i, .@i +1){
  140.                 if($@baitID[.@i] != 0) {
  141.                     set .@menu$, .@menu$ + "> ^0000FF "+getitemname($@baitID[.@i])+" ^000000 x"+countitem($@baitID[.@i])+"";
  142.                     set .@menu$, .@menu$ + ":";
  143.                 }
  144.             }      
  145.             set @bait,select(.@menu$)-1;
  146.             if(!countitem($@baitID[@bait])) {
  147.                 dispbottom "нет наживки";
  148.                 end;
  149.             }
  150.             @baitselect = $@baitID[@bait];
  151.             @amount = countitem($@baitID[@bait]);
  152.             @fishingMap = 1;
  153.             doevent "FishingFunctions::OnFishing";
  154.             end;
  155.         case 2:
  156.             doevent "FishingFunctions::OnShowin";
  157.             end;
  158.     }
  159.  
  160. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement