Advertisement
Guest User

fishing RO v1.0b

a guest
Apr 24th, 2015
244
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 4.30 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 = 100; // 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 @level_Modifier = 1;
  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.     @myLevel = cur_Level + @levelMod;
  109.     if(@myLevel > 600) @levelMod = 1;
  110.     cur_Level += @levelMod;
  111.     dispbottom "[Рыбная Ловля] + "+@levelMod+". Всего ("+cur_Level+" / "+$@FishingLevel[7]+").";
  112.     return;
  113. }
  114.  
  115. function    Show    {
  116.     mes "[Рыбная Ловля] Всего ("+cur_Level+" / "+$@FishingLevel[7]+").";
  117.     if(cur_Level > 0 && cur_Level < 200) {
  118.         @color$ = "^FF0000";
  119.         @message$ = "[" + @color$ + "||||^000000|||||||||||||||||||||||||||||]";
  120.     }
  121.     if(cur_Level > 199 && cur_Level < 400) {
  122.         @color$ = "^00FF00";
  123.         @message$ = "[" + @color$ + "||||||||||||||||||^000000|||||||||||||||]";
  124.     }
  125.     if(cur_Level > 399 && cur_Level <= 600) {
  126.         @color$ = "^0000FF";
  127.         @message$ = "[" + @color$ + "|||||||||||||||||||||||||||||||||^000000]";
  128.     }
  129.     mes @message$;
  130.     mes "Рейты : х"+$@fishing_Exp;
  131.     mes "Ваши улучшения : +"+@level_Modifier;
  132.     close;
  133. }
  134. }
  135. izlude,134,74,6 script  Fisher  100,{
  136.     switch(select("Fishing:Show")){
  137.         case 1:
  138.             mes "Выберите наживку";
  139.             set .@menu$, "";
  140.             for(set .@i,0; .@i < 3; set .@i, .@i +1){
  141.                 if($@baitID[.@i] != 0) {
  142.                     set .@menu$, .@menu$ + "> ^0000FF "+getitemname($@baitID[.@i])+" ^000000 x"+countitem($@baitID[.@i])+"";
  143.                     set .@menu$, .@menu$ + ":";
  144.                 }
  145.             }      
  146.             set @bait,select(.@menu$)-1;
  147.             if(!countitem($@baitID[@bait])) {
  148.                 dispbottom "нет наживки";
  149.                 end;
  150.             }
  151.             @baitselect = $@baitID[@bait];
  152.             @amount = countitem($@baitID[@bait]);
  153.             @fishingMap = 1;
  154.             close2;
  155.             doevent "FishingFunctions::OnFishing";
  156.             end;
  157.         case 2:
  158.             doevent "FishingFunctions::OnShowin";
  159.             end;
  160.     }
  161.  
  162. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement