Advertisement
Guest User

Untitled

a guest
Jul 11th, 2019
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 4.73 KB | None | 0 0
  1. -   script  Items_Conf  -1,{
  2.  
  3. OnInit:
  4.  
  5.     callsub Ids, 5132, 1, 111, 1, 5123, 1, 111, 0 ;
  6.  
  7. /*
  8.     ID[...], evolution mode[...], mob id[...], neccessary to get 1%[...].
  9.     If  you want any monster, use 111.
  10.  
  11. Evolution modes:
  12.  
  13.     1 = Every X numer of mobs (1%).
  14.     2 = Experience (1%).
  15. */
  16.  
  17. /*
  18.     0 = Won't be evolved automatically.
  19.     1 = Will be evolved automatically
  20. */
  21.     .auto = 1;
  22.  
  23. /*
  24.     Color of the announces.
  25. */
  26.     setarray .c$[0],    "4db557",   // % of evolution.
  27.                 "d43438",   // Wings evolving.
  28.                 "4da5b5";   // Wings evolved.
  29.  
  30. /* slots to check.
  31.     EQI_ACC_L (0)             - Accessory 1
  32.     EQI_ACC_R (1)             - Accessory 2
  33.     EQI_SHOES (2)             - Footgear (shoes, boots)
  34.     EQI_GARMENT (3)           - Garment (mufflers, hoods, manteaux)
  35.     EQI_HEAD_LOW (4)          - Lower Headgear (beards, some masks)
  36.     EQI_HEAD_MID (5)          - Middle Headgear (masks, glasses)
  37.     EQI_HEAD_TOP (6)          - Upper Headgear
  38.     EQI_ARMOR (7)             - Armor (jackets, robes)
  39.     EQI_HAND_L (8)            - Left hand (weapons, shields)
  40.     EQI_HAND_R (9)            - Right hand (weapons)
  41.     EQI_COSTUME_HEAD_TOP (10) - Upper Costume Headgear
  42.     EQI_COSTUME_HEAD_MID (11) - Middle Costume Headgear
  43.     EQI_COSTUME_HEAD_LOW (12) - Lower Costume Headgear
  44.     EQI_COSTUME_GARMENT (13)  - Costume Garment
  45.     EQI_AMMO (14)             - Arrow/Ammunition
  46.     EQI_SHADOW_ARMOR (15)     - Shadow Armor
  47.     EQI_SHADOW_WEAPON (16)    - Shadow Weapon
  48.     EQI_SHADOW_SHIELD (17)    - Shadow Shield
  49.     EQI_SHADOW_SHOES (18)     - Shadow Shoes
  50.     EQI_SHADOW_ACC_R (19)     - Shadow Accessory 2
  51.     EQI_SHADOW_ACC_L (20)     - Shadow Accessory 1
  52. */
  53.  
  54.     setarray .slots[0],     EQP_HEAD_LOW,
  55.                 EQP_HEAD_MID,
  56.                 EQP_HEAD_TOP,
  57.                 EQI_COSTUME_HEAD_LOW;
  58.  
  59.     //=============================================
  60.  
  61.     .w1 = 0;
  62.  
  63.     end ;
  64.  
  65. Ids:
  66.  
  67.     .@index = .w1;
  68.     .w1++;
  69.     for ( .@args = getargcount ( ); .@a < .@args ; .@a+=4 )
  70.     {
  71.         .@i = ++.w2[.@index];
  72.         setd ".a1"+ .w1 +"_"+ .@i, getarg ( .@a );  // id.
  73.         setd ".a2"+ .w1 +"_"+ .@i, getarg ( .@a + 1 );  // mode.
  74.         setd ".a3"+ .w1 +"_"+ .@i, getarg ( .@a + 2 );  // mob id.
  75.         setd ".a4"+ .w1 +"_"+ .@i, getarg ( .@a + 3 );  // amount.
  76.     }
  77.     return ;
  78.  
  79. OnNPCKillEvent:
  80.  
  81.     // Cache. That old loop on every mob killed...
  82.     if ( @wing[0] && isequipped ( @wing[0] ) )
  83.     {
  84.         .@c  = 1;
  85.         .@e  = @wing[0];
  86.         .@w  = @wing[1];
  87.         .@id = @wing[2];
  88.     }
  89.     else
  90.     {
  91.         for ( .@size = getarraysize ( .slots ); .@a < .@size && !.@c ; .@a++ )
  92.         {
  93.             .@e = getequipid ( .slots[.@a] );
  94.             if ( .@e < 0 )
  95.                 continue ;
  96.             .@id = 0;
  97.             .@w = 1;
  98.             while ( .@id++ <= .w2[.@w - 1] && !.@c )
  99.             {
  100.                 if ( .@id > .w2[.@w - 1] )
  101.                 {
  102.                     .@id = 1;
  103.                     .@w++;
  104.                 }
  105.                 if ( .@e == getd ( ".a1"+ .@w +"_"+ .@id ) )
  106.                     if ( getd ( ".a4"+ .@w +"_"+ .@id ) > 0 && ( killedrid == getd ( ".a3"+ .@w +"_"+ .@id ) || getd ( ".a3"+ .@w +"_"+ .@id ) < 1001 ) )
  107.                     {
  108.                         .@c = 1;
  109.                         setarray @wing[0], .@e, .@w, .@id;
  110.                     }
  111.             }
  112.         }
  113.     }
  114.  
  115.     if ( .@c )
  116.     {
  117.         if ( getd ( ".a2"+ .@w +"_"+ .@id ) == 1 )
  118.         {
  119.             .@amount = getd ( "mobs_"+ .@e );
  120.             setd "mobs_"+ .@e, .@amount + 1;
  121.             if ( getd ( "mobs_"+ .@e ) < getd ( ".a4"+ .@w +"_"+ .@id ) ) end ;
  122.             setd "evo"+ .@e, getd ( "evo"+ .@e ) + 1;
  123.             setd "mobs_"+ .@e, 0;
  124.         }
  125.         else if ( getd ( ".a2"+ .@w +"_"+ .@id ) == 2 )
  126.         {
  127.             .@amount = getd ( "exp_"+ .@e );
  128.             setd "exp_"+ .@e, .@amount + strmobinfo ( 6, killedrid );
  129.             if ( getd ( "exp_"+ .@e ) < getd ( ".a4"+ .@w +"_"+ .@id ) ) end ;
  130.             setd "evo"+ .@e, getd ( "evo"+ .@e ) + 1;
  131.             setd "exp_"+ .@e, 0;
  132.         }
  133.         else
  134.             //debugmes "Script Items_Evo, error: wrong mode.";
  135.         announce getitemname ( .@e ) +" is now "+ getd ( "evo"+ .@e ) +"% from evolving...", bc_self, "0x"+ .c$[0] ;
  136.         specialeffect 58 ;
  137.         sleep2 200 ;
  138.         specialeffect 383 ;
  139.         if ( getd ( "evo"+ .@e ) == 100 && .auto )
  140.         {
  141.             specialeffect 263 ;
  142.             sleep2 500 ;
  143.             specialeffect 377 ;
  144.             sleep2 300 ;
  145.             specialeffect 542 ;
  146.             sleep2 300 ;
  147.             announce getitemname ( .@e ) +" is evolving..." , bc_self, "0x"+ .c$[1] ;
  148.             .@i = 3;
  149.             while ( .@i-- )
  150.             {
  151.                 specialeffect 521 ;
  152.                 sleep2 900 ;
  153.             }
  154.             specialeffect 463 ;
  155.             sleep2 200;
  156.             specialeffect 665 ;
  157.             sleep2 500 ;
  158.             setarray .@card[1], getequipcardid ( .slots[.@a], 0 ), getequipcardid ( .slots[.@a], 1 ), getequipcardid ( .slots[.@a], 2 ), getequipcardid ( .slots[.@a], 3 );
  159.             .@refine = getequiprefinerycnt ( .slots[.@a] );
  160.             delitem .@e, 1 ;
  161.             getitem2 getd ( ".a1"+ .@w +"_"+ ( .@id + 1 ) ) , 1, 1, .@refine, 0, .@card[1], .@card[2], .@card[3], .@card[4] ;
  162.             equip getd ( ".a1"+  .@w +"_"+ ( .@id + 1 ) ) ;
  163.             setd "evo"+ .@e, 0;
  164.             deletearray @wing ;
  165.             announce "Congratulations, your wings have evolved to "+ getitemname ( getd ( ".a1"+ .@w +"_"+ ( .@id + 1 ) ) ) +"." , bc_self , "0x"+ .c$[2] ;
  166.         }
  167.     }
  168.     end ;
  169. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement