Jump to content
  • 0

Can't keep refine, cards and enchants after evolve


Rizta

Question


  • Group:  Members
  • Topic Count:  22
  • Topics Per Day:  0.01
  • Content Count:  109
  • Reputation:   5
  • Joined:  08/12/17
  • Last Seen:  

Hi community, is me again! ? 

Now i got a new problem... Im using one item evolve script but i want some attributes r maintened after the evolve, things like refine, cards/enchants and random options, but, after some tests i cant reach this. ?  

here's the full script. The // part is the last thing ive tried.


 

Spoiler

-	script	Items_Conf	-1,{

OnInit:

/* Adaga  */	callsub Ids, 13040,1, 111, 1, 1203, 1, 111, 5, 1206, 1, 111, 15, 1209, 1, 111, 25, 1212, 1, 111, 30, 1215, 1, 111, 60, 1218, 1, 111, 70, 1221, 1, 111, 80, 1222, 1, 111, 90, 13048, 1, 111, 150 ; // Adaga
/* 1HSword */	callsub Ids, 13415,1, 111, 1, 1103, 1, 111, 5, 1106, 1, 111, 15, 1109, 1, 111, 25, 1112, 1, 111, 30, 1115, 1, 111, 60, 1122, 1, 111, 70, 1123, 1, 111, 80, 1126, 1, 111, 90, 1121, 1, 111, 100, 1129, 1, 111, 125, 13422, 1, 111, 150 ; // Espada 1H
/* 2HSword */	callsub Ids, 1118, 1, 111, 5, 1153, 1, 111, 15, 1156, 1, 111, 25, 1160, 1, 111, 30, 1159, 1, 111, 60, 1163, 1, 111, 70, 1190, 1, 111, 100, 1188, 1, 111, 200 ; // Espada 2H
/* 2HAxe  */	callsub Ids, 1381, 1, 111, 1, 1353, 1, 111, 5, 1356, 1, 111, 15, 1359, 1, 111, 25, 1362, 1, 111, 30, 1388, 1, 111, 100, 1384, 1, 111, 200 ; // Machado 1H
/* Maces  */	callsub Ids, 1545, 1, 111, 1, 1503, 1, 111, 5, 1506, 1, 111, 15, 1509, 1, 111, 25, 1512, 1, 111, 30, 1521, 1, 111, 60, 1515, 1, 111, 70, 1518, 1, 111, 80, 1548, 1, 111, 200 ; // Maces 1H
/* Arcos  */	callsub Ids, 1742, 1, 111, 1, 1703, 1, 111, 5, 1706, 1, 111, 15, 1709, 1, 111, 25, 1712, 1, 111, 30, 1713, 1, 111, 60, 1714, 1, 111, 70, 1735, 1, 111, 80, 18128, 1, 111, 200 ; // Arcos
/* Cajados */	callsub Ids, 1639, 1, 111, 1, 1603, 1, 111, 5, 1606, 1, 111, 15, 1609, 1, 111, 25, 1612, 1, 111, 30, 1614, 1, 111, 60, 1615, 1, 111, 80, 1636, 1, 111, 100; // Cajados
/* 1HSpear */	callsub Ids, 1403, 1, 111,10, 1406, 1, 111,15, 1409, 1, 111, 30, 1430, 1, 111, 200;
/* 2HSpear */	callsub Ids, 1453, 1, 111,20, 1456, 1, 111,30, 1459, 1, 111, 40, 1462, 1, 111, 50, 1465, 1, 111, 70, 1412, 1, 111, 100;
/* Knuckles */	callsub Ids, 1801, 1, 111,20, 1803, 1, 111,30, 1805, 1, 111, 40, 1809, 1, 111, 50, 1811, 1, 111, 60, 1807, 1, 111, 70, 1814, 1, 111, 80, 1829, 1, 111, 100;
/* Violin */	callsub Ids, 1901, 1, 111,20, 1903, 1, 111,30, 1905, 1, 111, 40, 1909, 1, 111, 50, 1911, 1, 111, 60, 1907, 1, 111, 80, 1925, 1, 111,100, 1918, 1, 111, 150;
/* Whip */		callsub Ids, 1950, 1, 111,20, 1952, 1, 111,30, 1954, 1, 111, 40, 1958, 1, 111, 50, 1960, 1, 111, 60, 1958, 1, 111, 80, 1994, 1, 111,100;
/* Katar */		callsub Ids, 1264, 1, 111,20, 1262, 1, 111,30, 1295, 1, 111, 40, 1250, 1, 111, 50, 1252, 1, 111, 60, 1283, 1, 111, 100;
/* Debug  */
/*
	ID[...], evolution mode[...], mob id[...], neccessary to get 1%[...].
	If  you want any monster, use 111.

Evolution modes:

	1 = Every X numer of mobs (1%).
	2 = Experience (1%).
*/

/*
	0 = Won't be evolved automatically.
	1 = Will be evolved automatically
*/
	.auto = 1;

/*
	Color of the announces.
*/
	setarray .c$[0],	"09e2f9",	// % of evolution.
				"d43438",	// Wings evolving.
				"e2f909";	// Wings evolved.

/* slots to check.
	EQI_ACC_L (0)             - Accessory 1
	EQI_ACC_R (1)             - Accessory 2
	EQI_SHOES (2)             - Footgear (shoes, boots)
	EQI_GARMENT (3)           - Garment (mufflers, hoods, manteaux)
	EQI_HEAD_LOW (4)          - Lower Headgear (beards, some masks)
	EQI_HEAD_MID (5)          - Middle Headgear (masks, glasses)
	EQI_HEAD_TOP (6)          - Upper Headgear
	EQI_ARMOR (7)             - Armor (jackets, robes)
	EQI_HAND_L (8)            - Left hand (weapons, shields)
	EQI_HAND_R (9)            - Right hand (weapons)
	EQI_COSTUME_HEAD_TOP (10) - Upper Costume Headgear
	EQI_COSTUME_HEAD_MID (11) - Middle Costume Headgear
	EQI_COSTUME_HEAD_LOW (12) - Lower Costume Headgear
	EQI_COSTUME_GARMENT (13)  - Costume Garment
	EQI_AMMO (14)    		  - Arrow/Ammunition
	EQI_SHADOW_ARMOR (15)     - Shadow Armor
	EQI_SHADOW_WEAPON (16)    - Shadow Weapon
	EQI_SHADOW_SHIELD (17)    - Shadow Shield
	EQI_SHADOW_SHOES (18)     - Shadow Shoes
	EQI_SHADOW_ACC_R (19)     - Shadow Accessory 2
	EQI_SHADOW_ACC_L (20)     - Shadow Accessory 1
*/

	setarray .slots[0], 	EQI_HEAD_TOP, 
				EQI_HEAD_MID,
				EQI_HEAD_LOW,
				EQI_ARMOR,
				EQI_HAND_R,
				EQI_HAND_L,
				EQI_GARMENT,
				EQI_SHOES,
				EQI_ACC_R,
				EQI_ACC_L;

	//=============================================

	.w1 = 0;

	end ;

Ids:

	.@index = .w1;
	.w1++;
	for ( .@args = getargcount ( ); .@a < .@args ; .@a+=4 )
	{
		.@i = ++.w2[.@index];
		setd ".a1"+ .w1 +"_"+ .@i, getarg ( .@a );	// id.
		setd ".a2"+ .w1 +"_"+ .@i, getarg ( .@a + 1 );	// mode.
		setd ".a3"+ .w1 +"_"+ .@i, getarg ( .@a + 2 );	// mob id.
		setd ".a4"+ .w1 +"_"+ .@i, getarg ( .@a + 3 );	// amount.
	}
	return ;

OnNPCKillEvent:

	// Cache. That old loop on every mob killed...
	if ( @wing[0] && isequipped ( @wing[0] ) )
	{
		.@c  = 1;
		.@e  = @wing[0];
		.@w  = @wing[1];
		.@id = @wing[2];
	}
	else
	{
		for ( .@size = getarraysize ( .slots ); .@a < .@size && !.@c ; .@a++ )
		{
			.@e = getequipid ( .slots[.@a] );
			if ( .@e < 0 )
				continue ;
			.@id = 0;
			.@w = 1;
			while ( .@id++ <= .w2[.@w - 1] && !.@c )
			{
				if ( .@id > .w2[.@w - 1] )
				{
					.@id = 1;
					.@w++;
				}
				if ( .@e == getd ( ".a1"+ .@w +"_"+ .@id ) )
					if ( getd ( ".a4"+ .@w +"_"+ .@id ) > 0 && ( killedrid == getd ( ".a3"+ .@w +"_"+ .@id ) || getd ( ".a3"+ .@w +"_"+ .@id ) < 1001 ) )
					{
						.@c = 1;
						setarray @wing[0], .@e, .@w, .@id;
					}
			}
		}
	}

	if ( .@c )
	{
		if ( getd ( ".a2"+ .@w +"_"+ .@id ) == 1 )
		{
			.@amount = getd ( "mobs_"+ .@e );
			setd "mobs_"+ .@e, .@amount + 1;
			if ( getd ( "mobs_"+ .@e ) < getd ( ".a4"+ .@w +"_"+ .@id ) ) end ;
			setd "evo"+ .@e, getd ( "evo"+ .@e ) + 1;
			setd "mobs_"+ .@e, 0;
		}
		else if ( getd ( ".a2"+ .@w +"_"+ .@id ) == 2 )
		{
			.@amount = getd ( "exp_"+ .@e );
			setd "exp_"+ .@e, .@amount + strmobinfo ( 6, killedrid );
			if ( getd ( "exp_"+ .@e ) < getd ( ".a4"+ .@w +"_"+ .@id ) ) end ;
			setd "evo"+ .@e, getd ( "evo"+ .@e ) + 1;
			setd "exp_"+ .@e, 0;
		}
		else
			debugmes "Script Items_Evo, error: wrong mode.";
		announce getitemname ( .@e ) +" está com "+ getd ( "evo"+ .@e ) +"% para evoluir...", bc_self, "0x"+ .c$[0] ;
		specialeffect2 58 ;
		sleep2 200 ;
		specialeffect2 383 ;
		if ( getd ( "evo"+ .@e ) == 100 && .auto )
		{
			specialeffect2 263 ;
			sleep2 500 ;
			specialeffect2 377 ;
			sleep2 300 ;
			specialeffect2 542 ;
			sleep2 300 ;
			announce getitemname ( .@e ) +" está evoluindo..." , bc_self, "0x"+ .c$[1] ;
			.@i = 3;
			while ( .@i-- )
			{
				specialeffect2 521 ;
				sleep2 900 ;
			}
			specialeffect2 463 ;
			sleep2 200;
			specialeffect2 665 ;
			sleep2 500 ;
			setarray .@card[1], getequipcardid ( .slots[.@a], 0 ), getequipcardid ( .slots[.@a], 1 ), getequipcardid ( .slots[.@a], 2 ), getequipcardid ( .slots[.@a], 3 );
			.@refine = getequiprefinerycnt ( .slots[.@a] );
			//setarray .@Oid[0],0;
			//setarray .@Oid[1],0;
			//setarray .@Oid[2],0;
			//setarray .@Oid[3],0;
			//setarray .@Oid[4],0;
			//setarray .@Oval[0],0;
			//setarray .@Oval[1],0;
			//setarray .@Oval[2],0;
			//setarray .@Oval[3],0;
			//setarray .@Oval[4],0;
			//setarray .@Opam[0],0;
			//setarray .@Opam[1],0;
			//setarray .@Opam[2],0;
			//setarray .@Opam[3],0;
			//setarray .@Opam[4],0;
			//for (.@j = 0; .@j < 5; .@j++) {
			//setarray .@Oid[.@j],getequiprandomoption(.slots[.@a],.@j,ROA_ID);
			//setarray .@Oval[.@j],getequiprandomoption(.slots[.@a],.@j,ROA_VALUE);
			//setarray .@Opam[.@j],getequiprandomoption(.slots[.@a],.@j,ROA_PARAM);
			//}
			//sleep2 200;
			delitem .@e, 1;// 1, .@refine, 0, .@card[1], .@card[2], .@card[3], .@card[4], .@Oid, .@Oval, .@Opam ;
			getitem2 getd ( ".a1"+ .@w +"_"+ ( .@id + 1 ) ) , 1, 1, .@refine, 0, .@card[1], .@card[2], .@card[3], .@card[4];//.@Oid, .@Oval, .@Opam;
			equip getd ( ".a1"+  .@w +"_"+ ( .@id + 1 ) ) ;
			setd "evo"+ .@e, 0;
			deletearray @wing ;
			announce "Parabéns seu item evoluiu para "+ getitemname ( getd ( ".a1"+ .@w +"_"+ ( .@id + 1 ) ) ) +"." , bc_self , "0x"+ .c$[2] ;
		}
	}
	end ;
}

 

 

Link to comment
Share on other sites

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  12
  • Topics Per Day:  0.00
  • Content Count:  625
  • Reputation:   188
  • Joined:  11/19/11
  • Last Seen:  

Well I basically just saved the equip slot in the variable .@s to use delequip, removed the variable  resets forr random options as well as the checks for existing values. Which are unnecessary, since below you set the variables anyway into the array. Even if it's 0.

But I let the check for getitem3 stay if there is an value for an random option to use the correct getitem.

And instead of delitem I used delequip .@s;

But after the getitem stuff to save  lines since it does the same  thing anyway.

If you want to have a look where delequip comes to action:
Costume Enchanter - GitHub

Edit:
After coming home from work I added some lines and comments:
 

Spoiler

-    script    Items_Conf    -1,{
    
OnInit:
    //callsub Ids, 13040,1, 111, 1, 1203, 1, 111, 5, 1206, 1, 111, 15, 1209, 1, 111, 25, 1212, 1, 111, 30, 1215, 1, 111, 60, 1218, 1, 111, 70, 1221, 1, 111, 80, 1222, 1, 111, 90, 13048, 1, 111, 150 ;
    callsub Ids, 13415,1, 111, 1, 1103, 1, 111, 5, 1106, 1, 111, 15, 1109, 1, 111, 25, 1112, 1, 111, 30, 1115, 1, 111, 60, 1122, 1, 111, 70, 1123, 1, 111, 80, 1126, 1, 111, 90, 1121, 1, 111, 100, 1129, 1, 111, 125, 13422, 1, 111, 150 ;
    callsub Ids, 1118, 1, 111, 5, 1153, 1, 111, 15,1156, 1, 111, 25, 1160, 1, 111, 30, 1159, 1, 111, 60, 1163, 1, 111, 70, 1190, 1, 111, 100, 1188, 1, 111, 200 ;
    callsub Ids, 1381, 1, 111, 1, 1353, 1, 111, 5, 1356, 1, 111, 15, 1359, 1, 111, 25, 1362, 1, 111, 30, 1388, 1, 111, 100, 1384, 1, 111, 200 ;
    callsub Ids, 1545, 1, 111, 1, 1503, 1, 111, 5, 1506, 1, 111, 15, 1509, 1, 111, 25, 1512, 1, 111, 30, 1521, 1, 111, 60, 1515, 1, 111, 70, 1518, 1, 111, 80, 1548, 1, 111, 200 ;
    callsub Ids, 1742, 1, 111, 1, 1703, 1, 111, 5, 1706, 1, 111, 15, 1709, 1, 111, 25, 1712, 1, 111, 30, 1713, 1, 111, 60, 1714, 1, 111, 70, 1735, 1, 111, 80, 18128, 1, 111, 200 ;
    callsub Ids, 1639, 1, 111, 1, 1603, 1, 111, 5, 1606, 1, 111, 15, 1609, 1, 111, 25, 1612, 1, 111, 30, 1614, 1, 111, 60, 1615, 1, 111, 80, 1636, 1, 111, 100;
    callsub Ids, 1403, 1, 111,10, 1406, 1, 111,15, 1409, 1, 111, 30, 1430, 1, 111, 200;
    callsub Ids, 1453, 1, 111,20, 1456, 1, 111,30, 1459, 1, 111, 40, 1462, 1, 111, 50, 1465, 1, 111, 70, 1412, 1, 111, 100;
    callsub Ids, 1801, 1, 111,20, 1803, 1, 111,30, 1805, 1, 111, 40, 1809, 1, 111, 50, 1811, 1, 111, 60, 1807, 1, 111, 70, 1814, 1, 111, 80, 1829, 1, 111, 100;
    callsub Ids, 1901, 1, 111,20, 1903, 1, 111,30, 1905, 1, 111, 40, 1909, 1, 111, 50, 1911, 1, 111, 60, 1907, 1, 111, 80, 1925, 1, 111,100, 1918, 1, 111, 150;
    callsub Ids, 1950, 1, 111,20, 1952, 1, 111,30, 1954, 1, 111, 40, 1958, 1, 111, 50, 1960, 1, 111, 60, 1958, 1, 111, 80, 1994, 1, 111,100;
    callsub Ids, 1264, 1, 111,20, 1262, 1, 111,30, 1295, 1, 111, 40, 1250, 1, 111, 50, 1252, 1, 111, 60, 1283, 1, 111, 100;
    .auto = 1;
    setarray .c$[0],"09e2f9","d43438","e2f909";    
    setarray .slots[0],EQI_HEAD_TOP,EQI_HEAD_MID,EQI_HEAD_LOW,EQI_ARMOR,EQI_HAND_R,EQI_HAND_L,EQI_GARMENT,EQI_SHOES,EQI_ACC_R,EQI_ACC_L;
    .w1 = 0;
    end;
    
Ids:
    .@index=.w1;
    .w1++;
    for (.@args=getargcount();.@a<.@args;.@a+=4)
    {
        .@i = ++.w2[.@index];
        setd ".a1"+.w1+"_"+.@i,getarg(.@a);
        setd ".a2"+.w1+"_"+.@i,getarg(.@a+1);
        setd ".a3"+.w1+"_"+.@i,getarg(.@a+2);
        setd ".a4"+.w1+"_"+.@i,getarg(.@a+3);
    }
    return;

OnNPCKillEvent:
    // In my opinion this doesn't make sense, since the array @wing gets deleted at the end
    if (@wing[0]&&isequipped(@wing[0]))
    {
        .@c  = 1;
        .@e  = @wing[0];
        .@w  = @wing[1];
        .@id = @wing[2];
        .@s  = @wing[3]; // Readded the slot into the array
    }
    else
    {
        for (.@size=getarraysize(.slots);.@a<.@size&&!.@c;.@a++)
        {
            .@e = getequipid(.slots[.@a]); // Saving the Item ID
            .@s = .slots[.@a]; // Saving the slot in .@s
            if (.@e<0)
            continue;
            .@id = 0;
            .@w = 1;
            while (.@id++<=.w2[.@w-1]&&!.@c)
            {
                if (.@id>.w2[.@w-1])
                {
                    .@id = 1;
                    .@w++;
                }
                if (.@e==getd(".a1"+.@w+"_"+.@id))
                if (getd(".a4"+.@w+"_"+.@id)>0&&(killedrid==getd(".a3"+.@w+"_"+.@id)||getd(".a3"+.@w+"_"+.@id)<1001))
                {
                    .@c = 1;
                    setarray @wing[0],.@e,.@w,.@id,.@s;
                }
            }
        }
    }
    if (.@c)
    {
        if (getd(".a2"+.@w+"_"+.@id)==1)
        {
            .@amount = getd("mobs_"+.@e);
            setd "mobs_"+.@e,.@amount+1;
            if (getd("mobs_"+.@e)<getd(".a4"+.@w+"_"+.@id))
            end;
            setd "evo"+.@e,getd("evo"+.@e)+1;
            setd "mobs_"+.@e,0;
        }
        else if(getd(".a2"+.@w+"_"+.@id)==2)
        {
            .@amount = getd("exp_"+.@e);
            setd "exp_"+.@e,.@amount+strmobinfo(6,killedrid);
            if (getd("exp_"+.@e)<getd(".a4"+.@w+"_"+.@id))
            end;
            setd "evo"+.@e,getd("evo"+.@e)+1;
            setd "exp_"+.@e,0;
        }
        else
        debugmes "Script Items_Evo, error: wrong mode.";
        announce getitemname(.@e)+" está com "+getd("evo"+.@e)+"% para evoluir...",bc_self,"0x"+.c$[0];
        specialeffect2 58;
        specialeffect2 383;
        if(getd("evo"+.@e)>=100&&.auto) // Checks for 100% exp and evo mode
        {
            specialeffect2 263;
            specialeffect2 377;
            specialeffect2 542;
            announce getitemname(.@e)+" está evoluindo...",bc_self,"0x"+.c$[1];
            .@i=3;
            while (.@i--) // <--- only affects the next specialeffect2
                specialeffect2 521;
            specialeffect2 463;
            specialeffect2 665;
            
            // As far as I undestood the script above, it doesn't check anywhere
            // if the item is an weapon or not for refines and enchants!
            
            if(.@s == EQI_HAND_R) { // Checking if the equipment is a weapon
            
                // I could now script it that it reads the refine/cards and enchants based on the slot
                // That would look like this:
                /* 
                .@refine = getequiprefinerycnt(.@s);
                .@card1=getequipcardid(.@s,0);
                .@card2=getequipcardid(.@s,1);
                .@card3=getequipcardid(.@s,2);
                .@card4=getequipcardid(.@s,3);
                
                .@optID01=getequiprandomoption(.@s,0,ROA_ID);
                .@optID02=getequiprandomoption(.@s,1,ROA_ID);
                .@optID03=getequiprandomoption(.@s,2,ROA_ID);
                .@optID04=getequiprandomoption(.@s,3,ROA_ID);
                .@optID05=getequiprandomoption(.@s,4,ROA_ID);
                
                .@optVALUE01=getequiprandomoption(.@s,0,ROA_VALUE);
                .@optVALUE02=getequiprandomoption(.@s,1,ROA_VALUE);
                .@optVALUE03=getequiprandomoption(.@s,2,ROA_VALUE);
                .@optVALUE04=getequiprandomoption(.@s,3,ROA_VALUE);
                .@optVALUE05=getequiprandomoption(.@s,4,ROA_VALUE);
                */
                
                .@refine=getequiprefinerycnt(EQI_HAND_R);            
                .@card1=getequipcardid(EQI_HAND_R,0);
                .@card2=getequipcardid(EQI_HAND_R,1);
                .@card3=getequipcardid(EQI_HAND_R,2);
                .@card4=getequipcardid(EQI_HAND_R,3);
                
                // No need to reset the variables, since they are temporary npc variables
                // No need to check for an value above 0, since if there are values afterwards they will be 0 anyway
                .@optID01=getequiprandomoption(EQI_HAND_R,0,ROA_ID);
                .@optID02=getequiprandomoption(EQI_HAND_R,1,ROA_ID);
                .@optID03=getequiprandomoption(EQI_HAND_R,2,ROA_ID);
                .@optID04=getequiprandomoption(EQI_HAND_R,3,ROA_ID);
                .@optID05=getequiprandomoption(EQI_HAND_R,4,ROA_ID);
                
                .@optVALUE01=getequiprandomoption(EQI_HAND_R,0,ROA_VALUE);
                .@optVALUE02=getequiprandomoption(EQI_HAND_R,1,ROA_VALUE);
                .@optVALUE03=getequiprandomoption(EQI_HAND_R,2,ROA_VALUE);
                .@optVALUE04=getequiprandomoption(EQI_HAND_R,3,ROA_VALUE);
                .@optVALUE05=getequiprandomoption(EQI_HAND_R,4,ROA_VALUE);
            }
            // You could even directly insert the values into the array without using extra variables,
            // but that would make it kinda too long to read:            
            
            // setarray .@optId[0],getequiprandomoption(EQI_HAND_R,0,ROA_ID),getequiprandomoption(EQI_HAND_R,1,ROA_ID),getequiprandomoption(EQI_HAND_R,2,ROA_ID),getequiprandomoption(EQI_HAND_R,3,ROA_ID),getequiprandomoption(EQI_HAND_R,4,ROA_ID);
            // setarray .@optVal[0],getequiprandomoption(EQI_HAND_R,0,ROA_VALUE),getequiprandomoption(EQI_HAND_R,1,ROA_VALUE),getequiprandomoption(EQI_HAND_R,2,ROA_VALUE),getequiprandomoption(EQI_HAND_R,3,ROA_VALUE),getequiprandomoption(EQI_HAND_R,4,ROA_VALUE); 
            // No need to declare .@optParam if its 0 anyway
            
            // Now with the .@s usage from above:
            // setarray .@optId[0],getequiprandomoption(.@s,0,ROA_ID),getequiprandomoption(.@s,1,ROA_ID),getequiprandomoption(.@s,2,ROA_ID),getequiprandomoption(.@s,3,ROA_ID),getequiprandomoption(.@s,4,ROA_ID);
            // setarray .@optVal[0],getequiprandomoption(.@s,0,ROA_VALUE),getequiprandomoption(.@s,1,ROA_VALUE),getequiprandomoption(.@s,2,ROA_VALUE),getequiprandomoption(.@s,3,ROA_VALUE),getequiprandomoption(.@s,4,ROA_VALUE); 
            
            setarray .@optId[0],.@optID01,.@optID02,.@optID03,.@optID04,.@optID05;
            setarray .@optVal[0],.@optVALUE01,.@optVALUE02,.@optVALUE03,.@optVALUE04,.@optVALUE05;
            setarray .@optParam[0],0;    
            
            if(!getd(".a1"+.@w+"_"+(.@id+1))) //Null
                end;    
            if(.@optID01>0||.@optID02>0||.@optID03>0||.@optID04>0||.@optID05>0){
                //delitem3 .@e,1,1,.@refine,0,.@card1,.@card2,.@card3,.@card4,.@optID,.@optVal,.@optParam;
                getitem3 getd(".a1"+.@w+"_"+(.@id+1)),1,1,.@refine,0,.@card1,.@card2,.@card3,.@card4,.@optID,.@optVal,.@optParam;
            }
            else if(.@refine>0||.@card1>0||.@card2>0||.@card3>0||.@card4>0){
                //delitem2 .@e,1,1,.@refine,0,.@card1,.@card2,.@card3,.@card4;
                getitem2 getd(".a1"+.@w+"_"+(.@id+1)),1,1,.@refine,0,.@card1,.@card2,.@card3,.@card4;
            }
            else{
                //delitem .@e,1;
                getitem getd(".a1"+.@w+"_"+(.@id+1)),1;
            }
            // Instead of delitem use delequip
            // I added a new variable in the above lines to save the slot: .@s
            delequip .@s;
            equip getd(".a1"+.@w+"_"+(.@id+1));            
            setd "evo"+.@e,0;
            deletearray @wing; // Here it gets weird, at the begining you check for existing values, but here it gets deleted anyway?
            announce "Parabéns seu item evoluiu para "+getitemname(getd(".a1"+.@w+"_"+(.@id+1)))+".",bc_self,"0x"+.c$[2];
        }
    }
    end;
}

Like I mentioned earlier, I didn't test it yet.

Regards,
Chris:
 

Edited by llchrisll
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  22
  • Topics Per Day:  0.01
  • Content Count:  109
  • Reputation:   5
  • Joined:  08/12/17
  • Last Seen:  

On 10/22/2018 at 12:09 PM, llchrisll said:

Well I basically just saved the equip slot in the variable .@s to use delequip, removed the variable  resets forr random options as well as the checks for existing values. Which are unnecessary, since below you set the variables anyway into the array. Even if it's 0.

But I let the check for getitem3 stay if there is an value for an random option to use the correct getitem.

And instead of delitem I used delequip .@s;

But after the getitem stuff to save  lines since it does the same  thing anyway.

If you want to have a look where delequip comes to action:
Costume Enchanter - GitHub

Edit:
After coming home from work I added some lines and comments:
 

  Hide contents

-    script    Items_Conf    -1,{
    
OnInit:
    //callsub Ids, 13040,1, 111, 1, 1203, 1, 111, 5, 1206, 1, 111, 15, 1209, 1, 111, 25, 1212, 1, 111, 30, 1215, 1, 111, 60, 1218, 1, 111, 70, 1221, 1, 111, 80, 1222, 1, 111, 90, 13048, 1, 111, 150 ;
    callsub Ids, 13415,1, 111, 1, 1103, 1, 111, 5, 1106, 1, 111, 15, 1109, 1, 111, 25, 1112, 1, 111, 30, 1115, 1, 111, 60, 1122, 1, 111, 70, 1123, 1, 111, 80, 1126, 1, 111, 90, 1121, 1, 111, 100, 1129, 1, 111, 125, 13422, 1, 111, 150 ;
    callsub Ids, 1118, 1, 111, 5, 1153, 1, 111, 15,1156, 1, 111, 25, 1160, 1, 111, 30, 1159, 1, 111, 60, 1163, 1, 111, 70, 1190, 1, 111, 100, 1188, 1, 111, 200 ;
    callsub Ids, 1381, 1, 111, 1, 1353, 1, 111, 5, 1356, 1, 111, 15, 1359, 1, 111, 25, 1362, 1, 111, 30, 1388, 1, 111, 100, 1384, 1, 111, 200 ;
    callsub Ids, 1545, 1, 111, 1, 1503, 1, 111, 5, 1506, 1, 111, 15, 1509, 1, 111, 25, 1512, 1, 111, 30, 1521, 1, 111, 60, 1515, 1, 111, 70, 1518, 1, 111, 80, 1548, 1, 111, 200 ;
    callsub Ids, 1742, 1, 111, 1, 1703, 1, 111, 5, 1706, 1, 111, 15, 1709, 1, 111, 25, 1712, 1, 111, 30, 1713, 1, 111, 60, 1714, 1, 111, 70, 1735, 1, 111, 80, 18128, 1, 111, 200 ;
    callsub Ids, 1639, 1, 111, 1, 1603, 1, 111, 5, 1606, 1, 111, 15, 1609, 1, 111, 25, 1612, 1, 111, 30, 1614, 1, 111, 60, 1615, 1, 111, 80, 1636, 1, 111, 100;
    callsub Ids, 1403, 1, 111,10, 1406, 1, 111,15, 1409, 1, 111, 30, 1430, 1, 111, 200;
    callsub Ids, 1453, 1, 111,20, 1456, 1, 111,30, 1459, 1, 111, 40, 1462, 1, 111, 50, 1465, 1, 111, 70, 1412, 1, 111, 100;
    callsub Ids, 1801, 1, 111,20, 1803, 1, 111,30, 1805, 1, 111, 40, 1809, 1, 111, 50, 1811, 1, 111, 60, 1807, 1, 111, 70, 1814, 1, 111, 80, 1829, 1, 111, 100;
    callsub Ids, 1901, 1, 111,20, 1903, 1, 111,30, 1905, 1, 111, 40, 1909, 1, 111, 50, 1911, 1, 111, 60, 1907, 1, 111, 80, 1925, 1, 111,100, 1918, 1, 111, 150;
    callsub Ids, 1950, 1, 111,20, 1952, 1, 111,30, 1954, 1, 111, 40, 1958, 1, 111, 50, 1960, 1, 111, 60, 1958, 1, 111, 80, 1994, 1, 111,100;
    callsub Ids, 1264, 1, 111,20, 1262, 1, 111,30, 1295, 1, 111, 40, 1250, 1, 111, 50, 1252, 1, 111, 60, 1283, 1, 111, 100;
    .auto = 1;
    setarray .c$[0],"09e2f9","d43438","e2f909";    
    setarray .slots[0],EQI_HEAD_TOP,EQI_HEAD_MID,EQI_HEAD_LOW,EQI_ARMOR,EQI_HAND_R,EQI_HAND_L,EQI_GARMENT,EQI_SHOES,EQI_ACC_R,EQI_ACC_L;
    .w1 = 0;
    end;
    
Ids:
    .@index=.w1;
    .w1++;
    for (.@args=getargcount();.@a<.@args;.@a+=4)
    {
        .@i = ++.w2[.@index];
        setd ".a1"+.w1+"_"+.@i,getarg(.@a);
        setd ".a2"+.w1+"_"+.@i,getarg(.@a+1);
        setd ".a3"+.w1+"_"+.@i,getarg(.@a+2);
        setd ".a4"+.w1+"_"+.@i,getarg(.@a+3);
    }
    return;

OnNPCKillEvent:
    // In my opinion this doesn't make sense, since the array @wing gets deleted at the end
    if (@wing[0]&&isequipped(@wing[0]))
    {
        .@c  = 1;
        .@e  = @wing[0];
        .@w  = @wing[1];
        .@id = @wing[2];
        .@s  = @wing[3]; // Readded the slot into the array
    }
    else
    {
        for (.@size=getarraysize(.slots);.@a<.@size&&!.@c;.@a++)
        {
            .@e = getequipid(.slots[.@a]); // Saving the Item ID
            .@s = .slots[.@a]; // Saving the slot in .@s
            if (.@e<0)
            continue;
            .@id = 0;
            .@w = 1;
            while (.@id++<=.w2[.@w-1]&&!.@c)
            {
                if (.@id>.w2[.@w-1])
                {
                    .@id = 1;
                    .@w++;
                }
                if (.@e==getd(".a1"+.@w+"_"+.@id))
                if (getd(".a4"+.@w+"_"+.@id)>0&&(killedrid==getd(".a3"+.@w+"_"+.@id)||getd(".a3"+.@w+"_"+.@id)<1001))
                {
                    .@c = 1;
                    setarray @wing[0],.@e,.@w,.@id,.@s;
                }
            }
        }
    }
    if (.@c)
    {
        if (getd(".a2"+.@w+"_"+.@id)==1)
        {
            .@amount = getd("mobs_"+.@e);
            setd "mobs_"+.@e,.@amount+1;
            if (getd("mobs_"+.@e)<getd(".a4"+.@w+"_"+.@id))
            end;
            setd "evo"+.@e,getd("evo"+.@e)+1;
            setd "mobs_"+.@e,0;
        }
        else if(getd(".a2"+.@w+"_"+.@id)==2)
        {
            .@amount = getd("exp_"+.@e);
            setd "exp_"+.@e,.@amount+strmobinfo(6,killedrid);
            if (getd("exp_"+.@e)<getd(".a4"+.@w+"_"+.@id))
            end;
            setd "evo"+.@e,getd("evo"+.@e)+1;
            setd "exp_"+.@e,0;
        }
        else
        debugmes "Script Items_Evo, error: wrong mode.";
        announce getitemname(.@e)+" está com "+getd("evo"+.@e)+"% para evoluir...",bc_self,"0x"+.c$[0];
        specialeffect2 58;
        specialeffect2 383;
        if(getd("evo"+.@e)>=100&&.auto) // Checks for 100% exp and evo mode
        {
            specialeffect2 263;
            specialeffect2 377;
            specialeffect2 542;
            announce getitemname(.@e)+" está evoluindo...",bc_self,"0x"+.c$[1];
            .@i=3;
            while (.@i--) // <--- only affects the next specialeffect2
                specialeffect2 521;
            specialeffect2 463;
            specialeffect2 665;
            
            // As far as I undestood the script above, it doesn't check anywhere
            // if the item is an weapon or not for refines and enchants!
            
            if(.@s == EQI_HAND_R) { // Checking if the equipment is a weapon
            
                // I could now script it that it reads the refine/cards and enchants based on the slot
                // That would look like this:
                /* 
                .@refine = getequiprefinerycnt(.@s);
                .@card1=getequipcardid(.@s,0);
                .@card2=getequipcardid(.@s,1);
                .@card3=getequipcardid(.@s,2);
                .@card4=getequipcardid(.@s,3);
                
                .@optID01=getequiprandomoption(.@s,0,ROA_ID);
                .@optID02=getequiprandomoption(.@s,1,ROA_ID);
                .@optID03=getequiprandomoption(.@s,2,ROA_ID);
                .@optID04=getequiprandomoption(.@s,3,ROA_ID);
                .@optID05=getequiprandomoption(.@s,4,ROA_ID);
                
                .@optVALUE01=getequiprandomoption(.@s,0,ROA_VALUE);
                .@optVALUE02=getequiprandomoption(.@s,1,ROA_VALUE);
                .@optVALUE03=getequiprandomoption(.@s,2,ROA_VALUE);
                .@optVALUE04=getequiprandomoption(.@s,3,ROA_VALUE);
                .@optVALUE05=getequiprandomoption(.@s,4,ROA_VALUE);
                */
                
                .@refine=getequiprefinerycnt(EQI_HAND_R);            
                .@card1=getequipcardid(EQI_HAND_R,0);
                .@card2=getequipcardid(EQI_HAND_R,1);
                .@card3=getequipcardid(EQI_HAND_R,2);
                .@card4=getequipcardid(EQI_HAND_R,3);
                
                // No need to reset the variables, since they are temporary npc variables
                // No need to check for an value above 0, since if there are values afterwards they will be 0 anyway
                .@optID01=getequiprandomoption(EQI_HAND_R,0,ROA_ID);
                .@optID02=getequiprandomoption(EQI_HAND_R,1,ROA_ID);
                .@optID03=getequiprandomoption(EQI_HAND_R,2,ROA_ID);
                .@optID04=getequiprandomoption(EQI_HAND_R,3,ROA_ID);
                .@optID05=getequiprandomoption(EQI_HAND_R,4,ROA_ID);
                
                .@optVALUE01=getequiprandomoption(EQI_HAND_R,0,ROA_VALUE);
                .@optVALUE02=getequiprandomoption(EQI_HAND_R,1,ROA_VALUE);
                .@optVALUE03=getequiprandomoption(EQI_HAND_R,2,ROA_VALUE);
                .@optVALUE04=getequiprandomoption(EQI_HAND_R,3,ROA_VALUE);
                .@optVALUE05=getequiprandomoption(EQI_HAND_R,4,ROA_VALUE);
            }
            // You could even directly insert the values into the array without using extra variables,
            // but that would make it kinda too long to read:            
            
            // setarray .@optId[0],getequiprandomoption(EQI_HAND_R,0,ROA_ID),getequiprandomoption(EQI_HAND_R,1,ROA_ID),getequiprandomoption(EQI_HAND_R,2,ROA_ID),getequiprandomoption(EQI_HAND_R,3,ROA_ID),getequiprandomoption(EQI_HAND_R,4,ROA_ID);
            // setarray .@optVal[0],getequiprandomoption(EQI_HAND_R,0,ROA_VALUE),getequiprandomoption(EQI_HAND_R,1,ROA_VALUE),getequiprandomoption(EQI_HAND_R,2,ROA_VALUE),getequiprandomoption(EQI_HAND_R,3,ROA_VALUE),getequiprandomoption(EQI_HAND_R,4,ROA_VALUE); 
            // No need to declare .@optParam if its 0 anyway
            
            // Now with the .@s usage from above:
            // setarray .@optId[0],getequiprandomoption(.@s,0,ROA_ID),getequiprandomoption(.@s,1,ROA_ID),getequiprandomoption(.@s,2,ROA_ID),getequiprandomoption(.@s,3,ROA_ID),getequiprandomoption(.@s,4,ROA_ID);
            // setarray .@optVal[0],getequiprandomoption(.@s,0,ROA_VALUE),getequiprandomoption(.@s,1,ROA_VALUE),getequiprandomoption(.@s,2,ROA_VALUE),getequiprandomoption(.@s,3,ROA_VALUE),getequiprandomoption(.@s,4,ROA_VALUE); 
            
            setarray .@optId[0],.@optID01,.@optID02,.@optID03,.@optID04,.@optID05;
            setarray .@optVal[0],.@optVALUE01,.@optVALUE02,.@optVALUE03,.@optVALUE04,.@optVALUE05;
            setarray .@optParam[0],0;    
            
            if(!getd(".a1"+.@w+"_"+(.@id+1))) //Null
                end;    
            if(.@optID01>0||.@optID02>0||.@optID03>0||.@optID04>0||.@optID05>0){
                //delitem3 .@e,1,1,.@refine,0,.@card1,.@card2,.@card3,.@card4,.@optID,.@optVal,.@optParam;
                getitem3 getd(".a1"+.@w+"_"+(.@id+1)),1,1,.@refine,0,.@card1,.@card2,.@card3,.@card4,.@optID,.@optVal,.@optParam;
            }
            else if(.@refine>0||.@card1>0||.@card2>0||.@card3>0||.@card4>0){
                //delitem2 .@e,1,1,.@refine,0,.@card1,.@card2,.@card3,.@card4;
                getitem2 getd(".a1"+.@w+"_"+(.@id+1)),1,1,.@refine,0,.@card1,.@card2,.@card3,.@card4;
            }
            else{
                //delitem .@e,1;
                getitem getd(".a1"+.@w+"_"+(.@id+1)),1;
            }
            // Instead of delitem use delequip
            // I added a new variable in the above lines to save the slot: .@s
            delequip .@s;
            equip getd(".a1"+.@w+"_"+(.@id+1));            
            setd "evo"+.@e,0;
            deletearray @wing; // Here it gets weird, at the begining you check for existing values, but here it gets deleted anyway?
            announce "Parabéns seu item evoluiu para "+getitemname(getd(".a1"+.@w+"_"+(.@id+1)))+".",bc_self,"0x"+.c$[2];
        }
    }
    end;
}

Like I mentioned earlier, I didn't test it yet.

Regards,
Chris:
 

Hi @llchrisll. Long theres a long time since i came in this topic xD

i didnt test your suggestion but it seems to work too.

Here's my current state of this script, that works well(but it only works for weapon).

Spoiler

-	script	Items_Conf	-1,{
	
OnInit:
/*Dagger*/		callsub Ids, 13040,1, 111, 2, 1203, 1, 111, 5, 1206, 1, 111, 15, 1209, 1, 111, 25, 1212, 1, 111, 30, 1215, 1, 111, 60, 1218, 1, 111, 70, 1221, 1, 111, 80, 1222, 1, 111, 90, 13048, 1, 111, 0;
/*1H Sword*/	callsub Ids, 13415,1, 111, 2, 1103, 1, 111, 5, 1106, 1, 111, 15, 1109, 1, 111, 25, 1112, 1, 111, 30, 1115, 1, 111, 60, 1122, 1, 111, 70, 1123, 1, 111, 80, 1126, 1, 111, 90, 1121, 1, 111, 100, 1129, 1, 111, 125, 13422, 1, 111, 0;
/*2H Sword*/	callsub Ids, 1118, 1, 111,10, 1153, 1, 111,15, 1156, 1, 111, 25, 1160, 1, 111, 30, 1159, 1, 111, 60, 1163, 1, 111, 70, 1190, 1, 111, 100, 1188, 1, 111, 0;
/*2H Axe*/		callsub Ids, 1381, 1, 111, 2, 1353, 1, 111, 5, 1356, 1, 111, 15, 1359, 1, 111, 25, 1362, 1, 111, 30, 1388, 1, 111, 100, 1384, 1, 111, 0;
/*Mace*/		callsub Ids, 1545, 1, 111, 2, 1503, 1, 111, 5, 1506, 1, 111, 15, 1509, 1, 111, 25, 1512, 1, 111, 30, 1521, 1, 111, 60, 1515, 1, 111, 70, 1518, 1, 111, 80, 1548, 1, 111, 0;
/*Bow*/			callsub Ids, 1742, 1, 111, 2, 1703, 1, 111, 5, 1706, 1, 111, 15, 1709, 1, 111, 25, 1712, 1, 111, 30, 1713, 1, 111, 60, 1714, 1, 111, 70, 1735, 1, 111, 80, 18128, 1, 111, 0;
/*Staff*/		callsub Ids, 1639, 1, 111, 2, 1603, 1, 111, 5, 1606, 1, 111, 15, 1609, 1, 111, 25, 1612, 1, 111, 30, 1614, 1, 111, 60, 1615, 1, 111, 80, 1636, 1, 111, 0;
/*1H Spear*/	callsub Ids, 1403, 1, 111,10, 1406, 1, 111,15, 1409, 1, 111, 100, 1430, 1, 111, 0;
/*2H Spear*/	callsub Ids, 1453, 1, 111,20, 1456, 1, 111,30, 1459, 1, 111, 40, 1462, 1, 111, 50, 1465, 1, 111, 70, 1412, 1, 111, 0;
/*Fist*/		callsub Ids, 1801, 1, 111,20, 1803, 1, 111,30, 1805, 1, 111, 40, 1809, 1, 111, 50, 1811, 1, 111, 60, 1807, 1, 111, 70, 1814, 1, 111, 80, 1829, 1, 111, 0;
/*Male Ins*/	callsub Ids, 1901, 1, 111,20, 1903, 1, 111,30, 1905, 1, 111, 40, 1909, 1, 111, 50, 1911, 1, 111, 60, 1907, 1, 111, 80, 1925, 1, 111,100, 1918, 1, 111, 0;
/*FeMa Ins*/	callsub Ids, 1950, 1, 111,20, 1952, 1, 111,30, 1954, 1, 111, 40, 1958, 1, 111, 50, 1960, 1, 111, 60, 1958, 1, 111, 80, 1994, 1, 111,0;
/*Katar*/		callsub Ids, 1264, 1, 111,20, 1262, 1, 111,30, 1295, 1, 111, 40, 1250, 1, 111, 50, 1252, 1, 111, 60, 1283, 1, 111, 0;
/*Revolver*/	callsub Ids,13116, 1, 111, 4,13100, 1, 111, 6,13102, 1, 111, 25,13104, 1, 111, 35,13114, 1, 111, 50,13109, 1, 111,100,13111, 1, 111,0;
/*Rifle*/		callsub Ids,13180, 1, 111,50,13151, 1, 111,75,13153, 1, 111, 85,13164, 1, 111, 90,13165, 1, 111,100,13175, 1, 111, 0;
/*Gatling Gun*/ callsub Ids,13182, 1, 111,50,13157, 1, 111,75,13158, 1, 111,100,13172, 1, 111,  0;
/*Shotgun*/		callsub Ids,13181, 1, 111,20,13168, 1, 111,40,13154, 1, 111, 60,13155, 1, 111, 70,13156, 1, 111,100,13167, 1, 111, 0;
/*G.Launcher*/	callsub Ids,13183, 1, 111,50,13160, 1, 111,70,13162, 1, 111,100,13174, 1, 111,  0;
/*Shuriken*/	callsub Ids,13301, 1, 111,50,13304, 1, 111,70,13310, 1, 111,100,13309, 1, 111,  0; 
//Debug Weapon//
/*Debug Spear*/	callsub Ids, 1408, 1, 111,100, 1430, 1, 111, 0;
/*Debug Mace*/	callsub Ids, 1517, 1, 111, 80, 1548, 1, 111, 0;
	.auto = 1;
	setarray .c$[0],	"09e2f9",	"d43438",	"e2f909";	
	setarray .slots[0], EQI_HEAD_TOP,EQI_HEAD_MID,EQI_HEAD_LOW,EQI_ARMOR,EQI_HAND_R,EQI_HAND_L,EQI_GARMENT,EQI_SHOES,EQI_ACC_L,EQI_ACC_R;
	.w1 = 0;
	end;
	
Ids:
	.@index=.w1;
	.w1++;
	for (.@args=getargcount();.@a<.@args;.@a+=4)
	{
		.@i = ++.w2[.@index];
		setd ".a1"+.w1+"_"+.@i,getarg(.@a);
		setd ".a2"+.w1+"_"+.@i,getarg(.@a+1);
		setd ".a3"+.w1+"_"+.@i,getarg(.@a+2);
		setd ".a4"+.w1+"_"+.@i,getarg(.@a+3);
	}
	return;

OnNPCKillEvent:
	if (@wing[0]&&isequipped(@wing[0]))
	{
		.@c  = 1;
		.@e  = @wing[0];
		.@w  = @wing[1];
		.@id = @wing[2];
	}
	else
	{
		for (.@size=getarraysize(.slots);.@a<.@size&&!.@c;.@a++)
		{
			.@e = getequipid(.slots[.@a]);
			if (.@e<0)
			continue;
			.@id = 0;
			.@w = 1;
			while (.@id++<=.w2[.@w-1]&&!.@c)
			{
				if (.@id>.w2[.@w-1])
				{
					.@id = 1;
					.@w++;
				}
				if (.@e==getd(".a1"+.@w+"_"+.@id))
				if (getd(".a4"+.@w+"_"+.@id)>0&&(killedrid==getd(".a3"+.@w+"_"+.@id)||getd(".a3"+.@w+"_"+.@id)<1001))
				{
					.@c = 1;
					setarray @wing[0],.@e,.@w,.@id;
				}
			}
		}
	}
	if (.@c)
	{
		if (getd(".a2"+.@w+"_"+.@id)==1)
		{
			.@amount = getd("mobs_"+.@e);
			setd "mobs_"+.@e,.@amount+1;
			if (getd("mobs_"+.@e)<getd(".a4"+.@w+"_"+.@id))
			end;
			setd "evo"+.@e,getd("evo"+.@e)+1;
			setd "mobs_"+.@e,0;
		}
		else if(getd(".a2"+.@w+"_"+.@id)==2)
		{
			.@amount = getd("exp_"+.@e);
			setd "exp_"+.@e,.@amount+strmobinfo(6,killedrid);
			if (getd("exp_"+.@e)<getd(".a4"+.@w+"_"+.@id))
			end;
			setd "evo"+.@e,getd("evo"+.@e)+1;
			setd "exp_"+.@e,0;
		}
		else
		debugmes "Script Items_Evo, error: wrong mode.";
		announce getitemname(.@e)+" está com "+getd("evo"+.@e)+"% para evoluir...",bc_self,"0x"+.c$[0];
		specialeffect2 58;
		specialeffect2 383;
		if(getd("evo"+.@e)>=100&&.auto)
		{
			specialeffect2 263;
			specialeffect2 377;
			specialeffect2 542;
			announce getitemname(.@e)+" está evoluindo...",bc_self,"0x"+.c$[1];
			.@i=3;
			while (.@i--)
			specialeffect2 521;
			specialeffect2 463;
			specialeffect2 665;
			.@part = EQI_HAND_R; // - this define the slot that will work evolution, dont know how to do that to affect all the others
			.@OriId = getequipid(.@part);
			getinventorylist;
			freeloop 1;
			for(.@i = 0; .@i < @inventorylist_count; .@i++){
			if(@inventorylist_equip[.@i] && @inventorylist_id[.@i] == .@OriId){
			if(!@inventorylist_expire[.@i]){
				setarray .@iteminfo,@inventorylist_id[.@i],@inventorylist_refine[.@i],@inventorylist_card1[.@i],@inventorylist_card2[.@i],@inventorylist_card3[.@i],@inventorylist_card4[.@i];
				setarray .@roid,@inventorylist_option_id1[.@i],@inventorylist_option_id2[.@i],@inventorylist_option_id3[.@i],@inventorylist_option_id4[.@i],@inventorylist_option_id5[.@i];
				setarray .@val,@inventorylist_option_value1[.@i],@inventorylist_option_value2[.@i],@inventorylist_option_value3[.@i],@inventorylist_option_value4[.@i],@inventorylist_option_value5[.@i];
				setarray .@par,@inventorylist_option_parameter1[.@i],@inventorylist_option_parameter2[.@i],@inventorylist_option_parameter3[.@i],@inventorylist_option_parameter4[.@i],@inventorylist_option_parameter5[.@i];
				.@bound = @inventorylist_bound[.@i];
				break;
			} else	end;
		}
	}
	freeloop 0;
			.@newweapon = getd(".a1"+.@w+"_"+(.@id+1));
			//dispbottom .@newweapon+"";
			if(getarraysize(.@val)){
				delitem3 .@iteminfo[0],1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5],.@roid,.@val,.@par;
			if(.@bound)
				getitembound3 .@newweapon,1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5],Bound_Account,.@roid,.@val,.@par;
			else	getitem3 .@newweapon,1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5],.@roid,.@val,.@par;
		} else {
				delitem2 .@iteminfo[0],1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5];
			if(.@bound)
				getitembound2 .@newweapon,1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5],Bound_Account;
			else	getitem2 .@newweapon,1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5];
		}
			equip getd(".a1"+.@w+"_"+(.@id+1));			
			setd "evo"+.@e,0;
			deletearray @wing;
			announce "Parabéns seu item evoluiu para "+getitemname(getd(".a1"+.@w+"_"+(.@id+1)))+".",bc_self,"0x"+.c$[2];
		}
	}
end;
}

 

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  303
  • Reputation:   117
  • Joined:  12/10/16
  • Last Seen:  

How didn't I see this post...

Anyways here's a fixed version of the script I made on a PM. I edited it because it looks better and more readable this way.

-	script	Items_Conf	-1,{

	function add_item;

OnInit:

/*
	add_item(id, evolution mode, monster id, amount, id...);
	If  you want any monster, use 111.

Evolution modes:

	1 = Every X numer of mobs (1%).
	2 = Experience (1%).
*/


/* Adaga  */	add_item(13040,1, 111, 1, 1203, 1, 111, 5, 1206, 1, 111, 15, 1209, 1, 111, 25, 1212, 1, 111, 30, 1215, 1, 111, 60, 1218, 1, 111, 70, 1221, 1, 111, 80, 1222, 1, 111, 90, 13048, 1, 111, 150 ); // Adaga
/* 1HSword */	add_item(13415,1, 111, 1, 1103, 1, 111, 5, 1106, 1, 111, 15, 1109, 1, 111, 25, 1112, 1, 111, 30, 1115, 1, 111, 60, 1122, 1, 111, 70, 1123, 1, 111, 80, 1126, 1, 111, 90, 1121, 1, 111, 100, 1129, 1, 111, 125, 13422, 1, 111, 150 ); // Espada 1H
/* 2HSword */	add_item(1118, 1, 111, 5, 1153, 1, 111, 15, 1156, 1, 111, 25, 1160, 1, 111, 30, 1159, 1, 111, 60, 1163, 1, 111, 70, 1190, 1, 111, 100, 1188, 1, 111, 200 ); // Espada 2H
/* 2HAxe  */	add_item(1381, 1, 111, 1, 1353, 1, 111, 5, 1356, 1, 111, 15, 1359, 1, 111, 25, 1362, 1, 111, 30, 1388, 1, 111, 100, 1384, 1, 111, 200 ); // Machado 1H
/* Maces  */	add_item(1545, 1, 111, 1, 1503, 1, 111, 5, 1506, 1, 111, 15, 1509, 1, 111, 25, 1512, 1, 111, 30, 1521, 1, 111, 60, 1515, 1, 111, 70, 1518, 1, 111, 80, 1548, 1, 111, 200 ); // Maces 1H
/* Arcos  */	add_item(1742, 1, 111, 1, 1703, 1, 111, 5, 1706, 1, 111, 15, 1709, 1, 111, 25, 1712, 1, 111, 30, 1713, 1, 111, 60, 1714, 1, 111, 70, 1735, 1, 111, 80, 18128, 1, 111, 200 ); // Arcos
/* Cajados */	add_item(1639, 1, 111, 1, 1603, 1, 111, 5, 1606, 1, 111, 15, 1609, 1, 111, 25, 1612, 1, 111, 30, 1614, 1, 111, 60, 1615, 1, 111, 80, 1636, 1, 111, 100); // Cajados
/* 1HSpear */	add_item(1403, 1, 111,10, 1406, 1, 111,15, 1409, 1, 111, 30, 1430, 1, 111, 200);
/* 2HSpear */	add_item(1453, 1, 111,20, 1456, 1, 111,30, 1459, 1, 111, 40, 1462, 1, 111, 50, 1465, 1, 111, 70, 1412, 1, 111, 100);
/* Knuckles */	add_item(1801, 1, 111,20, 1803, 1, 111,30, 1805, 1, 111, 40, 1809, 1, 111, 50, 1811, 1, 111, 60, 1807, 1, 111, 70, 1814, 1, 111, 80, 1829, 1, 111, 100);
/* Violin */	add_item(1901, 1, 111,20, 1903, 1, 111,30, 1905, 1, 111, 40, 1909, 1, 111, 50, 1911, 1, 111, 60, 1907, 1, 111, 80, 1925, 1, 111,100, 1918, 1, 111, 150);
/* Whip */		add_item(1950, 1, 111,20, 1952, 1, 111,30, 1954, 1, 111, 40, 1958, 1, 111, 50, 1960, 1, 111, 60, 1958, 1, 111, 80, 1994, 1, 111,100);
/* Katar */		add_item(1264, 1, 111,20, 1262, 1, 111,30, 1295, 1, 111, 40, 1250, 1, 111, 50, 1252, 1, 111, 60, 1283, 1, 111, 100);
/* Debug  */

/*
	0 = Won't be evolved automatically.
	1 = Will be evolved automatically
*/
	.auto = 1;

/*
	Color of the announces.
*/
	setarray .c$[0],"09e2f9",	// % of evolution.
			"d43438",	// Wings evolving.
			"e2f909";	// Wings evolved.

/* slots to check.
	EQI_ACC_L (0)             - Accessory 1
	EQI_ACC_R (1)             - Accessory 2
	EQI_SHOES (2)             - Footgear (shoes, boots)
	EQI_GARMENT (3)           - Garment (mufflers, hoods, manteaux)
	EQI_HEAD_LOW (4)          - Lower Headgear (beards, some masks)
	EQI_HEAD_MID (5)          - Middle Headgear (masks, glasses)
	EQI_HEAD_TOP (6)          - Upper Headgear
	EQI_ARMOR (7)             - Armor (jackets, robes)
	EQI_HAND_L (8)            - Left hand (weapons, shields)
	EQI_HAND_R (9)            - Right hand (weapons)
	EQI_COSTUME_HEAD_TOP (10) - Upper Costume Headgear
	EQI_COSTUME_HEAD_MID (11) - Middle Costume Headgear
	EQI_COSTUME_HEAD_LOW (12) - Lower Costume Headgear
	EQI_COSTUME_GARMENT (13)  - Costume Garment
	EQI_AMMO (14)             - Arrow/Ammunition
	EQI_SHADOW_ARMOR (15)     - Shadow Armor
	EQI_SHADOW_WEAPON (16)    - Shadow Weapon
	EQI_SHADOW_SHIELD (17)    - Shadow Shield
	EQI_SHADOW_SHOES (18)     - Shadow Shoes
	EQI_SHADOW_ACC_R (19)     - Shadow Accessory 2
	EQI_SHADOW_ACC_L (20)     - Shadow Accessory 1
*/

	setarray .slots[0],     EQI_HAND_R,
				EQI_HAND_L;

	//=============================================

	end;

OnNPCKillEvent:

	if(!@evolving) {
		// Cache. That old loop on every mob killed...
		if(@evo_var[0] && isequipped(@evo_var[0])) {
			.@has_item = true;
			.@item_id = @evo_var[0];
			.@i = @evo_var[1] - 1;
			.@j = @evo_var[2] - 1;
			.@slot = @evo_var[3];
			.@mob_id = getd(".it_mob_"+.@i+"_"+.@j);
			if(killedrid != .@mob_id && .@mob_id > 1001)
				end;
		} else {
			.@size = getarraysize(.slots);
			while(.@slot < .@size && !.@has_item) {
				.@item_id = getequipid(.slots[.@slot]);
				.@slot++;
				if(.@item_id < 0)
					continue;
				.@i = 0;
				while(.@i < .w1 && !.@has_item) {
					.@j = 0;
					while(.@j < .w2[.@i] && !.@has_item) {
						.@item_evo = getd(".it_id_"+.@i+"_"+.@j);
						if(.@item_id == .@item_evo && getd(".it_id_"+.@i+"_"+(.@j + 1))) {
							.@mob_id = getd(".it_mob_"+.@i+"_"+.@j);
							if(killedrid == .@mob_id || .@mob_id < 1001) {
								.@has_item = true;
								setarray @evo_var[0],.@item_id,.@i + 1,.@j + 1,.@slot;
							}
						} else if(.@item_id == .@item_evo) {
							end;
						}
						if(!.@has_item)
							.@j++;
					}
					if(!.@has_item)
						.@i++;
				}
			}
		}
		if(.@has_item) {
			if(getd(".it_mode_"+.@i+"_"+.@j) == 1) {
				.@amount = ++getd("mobs_"+.@item_id);
				setd "mobs_"+.@item_id,.@amount;
				if(.@amount < getd(".it_amt_"+.@i+"_"+.@j)) end;
				setd "mobs_"+.@item_id,0;
			} else if(getd(".it_mode_"+.@i+"_"+.@j) == 2) {
				.@amount = getd("exp_"+.@item_id) + strmobinfo(6,killedrid);
				setd "exp_"+.@item_id,.@amount;
				if(.@amount < getd(".it_amt_"+.@i+"_"+.@j)) end;
				setd "exp_"+.@item_id,0;
			} else {
				debugmes "Script Items_Evo, error: wrong mode.";
				end;
			}
			specialeffect2 EF_BEGINSPELL6;
			sleep2 rand(190,280);
			specialeffect2 EF_ENERGYDRAIN3;
			.@percent = getd("evo_"+.@item_id);
			if(.@percent < 100) {
				setd "evo_"+.@item_id,++.@percent;
				announce getitemname(.@item_id)+": "+.@percent+"%.",bc_self,"0x"+.c$[0];
			}
			if(.@percent >= 100 && .auto && !@evolving) {
				@evolving = true;
				specialeffect2 EF_GUMGANG3;
				sleep2 500;
				specialeffect2 EF_BASH3D2;
				sleep2 300;
				specialeffect2 EF_BLUEBODY;
				sleep2 300;
				announce getitemname(.@item_id)+" is evolving...",bc_self,"0x"+.c$[1];
				.@k = 3;
				while(.@k--) {
					specialeffect2 EF_DOUBLECASTBODY;
					sleep2 900;
				}
				specialeffect2 EF_STORMKICK5;
				sleep2 200;
				specialeffect2 EF_BUBBLE_DROP;
				sleep2 500;
				.@slot--;
				setarray .@card[1],getequipcardid(.slots[.@slot],0),getequipcardid(.slots[.@slot],1),getequipcardid(.slots[.@slot],2),getequipcardid(.slots[.@slot],3);
				.@refine = getequiprefinerycnt(.slots[.@slot]);
				if(getiteminfo(.@item_id,2) == IT_WEAPON) {
					for(.@k = 0;.@k < 5;.@k++) {
						.@option_id[.@k] = getequiprandomoption(.slots[.@slot],.@k,ROA_ID);
						.@option_val[.@k] = getequiprandomoption(.slots[.@slot],.@k,ROA_VAL);
						if(!.@has_option && .@option_val[.@k]))
							.@has_option = true;
					}
				}
				.@evo_item = getd(".it_id_"+.@i+"_"+(.@j + 1));
				delequip .slots[.@slot];
				if(.@has_option)
					getitembound3 .@evo_item,1,true,.@refine,false,.@card[1],.@card[2],.@card[3],.@card[4],Bound_Char,.@option_id,.@option_val,0;
				else
					getitembound2 .@evo_item,1,true,.@refine,false,.@card[1],.@card[2],.@card[3],.@card[4],Bound_Char;
				equip .@evo_item;
				setd "evo_"+.@item_id,0;
				deletearray @evo_var;
				announce "Congratulations, your "+getitemname(.@item_id)+" has evolved to "+getitemname(.@evo_item)+".",bc_self,"0x"+.c$[2];
				@evolving = false;
			}
		}
	}
	end;

	function	add_item	{

		for(.@args = getargcount();.@i < .@args;.@i+= 4) {
			.@j = .w2[.w1]++;
			setd ".it_id_"+.w1+"_"+.@j,getarg(.@i);	// id.
			if(getarg(.@i + 4,0) != 0) {
				setd ".it_mode_"+.w1+"_"+.@j,getarg(.@i + 1);	// mode.
				setd ".it_mob_"+.w1+"_"+.@j,getarg(.@i + 2);	// mob id.
				setd ".it_amt_"+.w1+"_"+.@j,getarg(.@i + 3);	// amount.
			}
		}
		.w1++;

	}

}

Based on ||chris|| snippet, since I don't really know about the random options system.

Edited by n0tttt
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  22
  • Topics Per Day:  0.01
  • Content Count:  109
  • Reputation:   5
  • Joined:  08/12/17
  • Last Seen:  

On 1/5/2019 at 3:15 AM, n0tttt said:

How didn't I see this post...

Anyways here's a fixed version of the script I made on a PM. I edited it because it looks better and more readable this way.


-	script	Items_Conf	-1,{

	function add_item;

OnInit:

/*
	add_item(id, evolution mode, monster id, amount, id...);
	If  you want any monster, use 111.

Evolution modes:

	1 = Every X numer of mobs (1%).
	2 = Experience (1%).
*/


/* Adaga  */	add_item(13040,1, 111, 1, 1203, 1, 111, 5, 1206, 1, 111, 15, 1209, 1, 111, 25, 1212, 1, 111, 30, 1215, 1, 111, 60, 1218, 1, 111, 70, 1221, 1, 111, 80, 1222, 1, 111, 90, 13048, 1, 111, 150 ); // Adaga
/* 1HSword */	add_item(13415,1, 111, 1, 1103, 1, 111, 5, 1106, 1, 111, 15, 1109, 1, 111, 25, 1112, 1, 111, 30, 1115, 1, 111, 60, 1122, 1, 111, 70, 1123, 1, 111, 80, 1126, 1, 111, 90, 1121, 1, 111, 100, 1129, 1, 111, 125, 13422, 1, 111, 150 ); // Espada 1H
/* 2HSword */	add_item(1118, 1, 111, 5, 1153, 1, 111, 15, 1156, 1, 111, 25, 1160, 1, 111, 30, 1159, 1, 111, 60, 1163, 1, 111, 70, 1190, 1, 111, 100, 1188, 1, 111, 200 ); // Espada 2H
/* 2HAxe  */	add_item(1381, 1, 111, 1, 1353, 1, 111, 5, 1356, 1, 111, 15, 1359, 1, 111, 25, 1362, 1, 111, 30, 1388, 1, 111, 100, 1384, 1, 111, 200 ); // Machado 1H
/* Maces  */	add_item(1545, 1, 111, 1, 1503, 1, 111, 5, 1506, 1, 111, 15, 1509, 1, 111, 25, 1512, 1, 111, 30, 1521, 1, 111, 60, 1515, 1, 111, 70, 1518, 1, 111, 80, 1548, 1, 111, 200 ); // Maces 1H
/* Arcos  */	add_item(1742, 1, 111, 1, 1703, 1, 111, 5, 1706, 1, 111, 15, 1709, 1, 111, 25, 1712, 1, 111, 30, 1713, 1, 111, 60, 1714, 1, 111, 70, 1735, 1, 111, 80, 18128, 1, 111, 200 ); // Arcos
/* Cajados */	add_item(1639, 1, 111, 1, 1603, 1, 111, 5, 1606, 1, 111, 15, 1609, 1, 111, 25, 1612, 1, 111, 30, 1614, 1, 111, 60, 1615, 1, 111, 80, 1636, 1, 111, 100); // Cajados
/* 1HSpear */	add_item(1403, 1, 111,10, 1406, 1, 111,15, 1409, 1, 111, 30, 1430, 1, 111, 200);
/* 2HSpear */	add_item(1453, 1, 111,20, 1456, 1, 111,30, 1459, 1, 111, 40, 1462, 1, 111, 50, 1465, 1, 111, 70, 1412, 1, 111, 100);
/* Knuckles */	add_item(1801, 1, 111,20, 1803, 1, 111,30, 1805, 1, 111, 40, 1809, 1, 111, 50, 1811, 1, 111, 60, 1807, 1, 111, 70, 1814, 1, 111, 80, 1829, 1, 111, 100);
/* Violin */	add_item(1901, 1, 111,20, 1903, 1, 111,30, 1905, 1, 111, 40, 1909, 1, 111, 50, 1911, 1, 111, 60, 1907, 1, 111, 80, 1925, 1, 111,100, 1918, 1, 111, 150);
/* Whip */		add_item(1950, 1, 111,20, 1952, 1, 111,30, 1954, 1, 111, 40, 1958, 1, 111, 50, 1960, 1, 111, 60, 1958, 1, 111, 80, 1994, 1, 111,100);
/* Katar */		add_item(1264, 1, 111,20, 1262, 1, 111,30, 1295, 1, 111, 40, 1250, 1, 111, 50, 1252, 1, 111, 60, 1283, 1, 111, 100);
/* Debug  */

/*
	0 = Won't be evolved automatically.
	1 = Will be evolved automatically
*/
	.auto = 1;

/*
	Color of the announces.
*/
	setarray .c$[0],"09e2f9",	// % of evolution.
			"d43438",	// Wings evolving.
			"e2f909";	// Wings evolved.

/* slots to check.
	EQI_ACC_L (0)             - Accessory 1
	EQI_ACC_R (1)             - Accessory 2
	EQI_SHOES (2)             - Footgear (shoes, boots)
	EQI_GARMENT (3)           - Garment (mufflers, hoods, manteaux)
	EQI_HEAD_LOW (4)          - Lower Headgear (beards, some masks)
	EQI_HEAD_MID (5)          - Middle Headgear (masks, glasses)
	EQI_HEAD_TOP (6)          - Upper Headgear
	EQI_ARMOR (7)             - Armor (jackets, robes)
	EQI_HAND_L (8)            - Left hand (weapons, shields)
	EQI_HAND_R (9)            - Right hand (weapons)
	EQI_COSTUME_HEAD_TOP (10) - Upper Costume Headgear
	EQI_COSTUME_HEAD_MID (11) - Middle Costume Headgear
	EQI_COSTUME_HEAD_LOW (12) - Lower Costume Headgear
	EQI_COSTUME_GARMENT (13)  - Costume Garment
	EQI_AMMO (14)             - Arrow/Ammunition
	EQI_SHADOW_ARMOR (15)     - Shadow Armor
	EQI_SHADOW_WEAPON (16)    - Shadow Weapon
	EQI_SHADOW_SHIELD (17)    - Shadow Shield
	EQI_SHADOW_SHOES (18)     - Shadow Shoes
	EQI_SHADOW_ACC_R (19)     - Shadow Accessory 2
	EQI_SHADOW_ACC_L (20)     - Shadow Accessory 1
*/

	setarray .slots[0],     EQI_HAND_R,
				EQI_HAND_L;

	//=============================================

	end;

OnNPCKillEvent:

	if(!@evolving) {
		// Cache. That old loop on every mob killed...
		if(@evo_var[0] && isequipped(@evo_var[0])) {
			.@has_item = true;
			.@item_id = @evo_var[0];
			.@i = @evo_var[1] - 1;
			.@j = @evo_var[2] - 1;
			.@slot = @evo_var[3];
			.@mob_id = getd(".it_mob_"+.@i+"_"+.@j);
			if(killedrid != .@mob_id && .@mob_id > 1001)
				end;
		} else {
			.@size = getarraysize(.slots);
			while(.@slot < .@size && !.@has_item) {
				.@item_id = getequipid(.slots[.@slot]);
				.@slot++;
				if(.@item_id < 0)
					continue;
				.@i = 0;
				while(.@i < .w1 && !.@has_item) {
					.@j = 0;
					while(.@j < .w2[.@i] && !.@has_item) {
						.@item_evo = getd(".it_id_"+.@i+"_"+.@j);
						if(.@item_id == .@item_evo && getd(".it_id_"+.@i+"_"+(.@j + 1))) {
							.@mob_id = getd(".it_mob_"+.@i+"_"+.@j);
							if(killedrid == .@mob_id || .@mob_id < 1001) {
								.@has_item = true;
								setarray @evo_var[0],.@item_id,.@i + 1,.@j + 1,.@slot;
							}
						} else if(.@item_id == .@item_evo) {
							end;
						}
						if(!.@has_item)
							.@j++;
					}
					if(!.@has_item)
						.@i++;
				}
			}
		}
		if(.@has_item) {
			if(getd(".it_mode_"+.@i+"_"+.@j) == 1) {
				.@amount = ++getd("mobs_"+.@item_id);
				setd "mobs_"+.@item_id,.@amount;
				if(.@amount < getd(".it_amt_"+.@i+"_"+.@j)) end;
				setd "mobs_"+.@item_id,0;
			} else if(getd(".it_mode_"+.@i+"_"+.@j) == 2) {
				.@amount = getd("exp_"+.@item_id) + strmobinfo(6,killedrid);
				setd "exp_"+.@item_id,.@amount;
				if(.@amount < getd(".it_amt_"+.@i+"_"+.@j)) end;
				setd "exp_"+.@item_id,0;
			} else {
				debugmes "Script Items_Evo, error: wrong mode.";
				end;
			}
			specialeffect2 EF_BEGINSPELL6;
			sleep2 rand(190,280);
			specialeffect2 EF_ENERGYDRAIN3;
			.@percent = getd("evo_"+.@item_id);
			if(.@percent < 100) {
				setd "evo_"+.@item_id,++.@percent;
				announce getitemname(.@item_id)+": "+.@percent+"%.",bc_self,"0x"+.c$[0];
			}
			if(.@percent >= 100 && .auto && !@evolving) {
				@evolving = true;
				specialeffect2 EF_GUMGANG3;
				sleep2 500;
				specialeffect2 EF_BASH3D2;
				sleep2 300;
				specialeffect2 EF_BLUEBODY;
				sleep2 300;
				announce getitemname(.@item_id)+" is evolving...",bc_self,"0x"+.c$[1];
				.@k = 3;
				while(.@k--) {
					specialeffect2 EF_DOUBLECASTBODY;
					sleep2 900;
				}
				specialeffect2 EF_STORMKICK5;
				sleep2 200;
				specialeffect2 EF_BUBBLE_DROP;
				sleep2 500;
				.@slot--;
				setarray .@card[1],getequipcardid(.slots[.@slot],0),getequipcardid(.slots[.@slot],1),getequipcardid(.slots[.@slot],2),getequipcardid(.slots[.@slot],3);
				.@refine = getequiprefinerycnt(.slots[.@slot]);
				if(getiteminfo(.@item_id,2) == IT_WEAPON) {
					for(.@k = 0;.@k < 5;.@k++) {
						.@option_id[.@k] = getequiprandomoption(.slots[.@slot],.@k,ROA_ID);
						.@option_val[.@k] = getequiprandomoption(.slots[.@slot],.@k,ROA_VAL);
						if(!.@has_option && .@option_val[.@k]))
							.@has_option = true;
					}
				}
				.@evo_item = getd(".it_id_"+.@i+"_"+(.@j + 1));
				delequip .slots[.@slot];
				if(.@has_option)
					getitembound3 .@evo_item,1,true,.@refine,false,.@card[1],.@card[2],.@card[3],.@card[4],Bound_Char,.@option_id,.@option_val,0;
				else
					getitembound2 .@evo_item,1,true,.@refine,false,.@card[1],.@card[2],.@card[3],.@card[4],Bound_Char;
				equip .@evo_item;
				setd "evo_"+.@item_id,0;
				deletearray @evo_var;
				announce "Congratulations, your "+getitemname(.@item_id)+" has evolved to "+getitemname(.@evo_item)+".",bc_self,"0x"+.c$[2];
				@evolving = false;
			}
		}
	}
	end;

	function	add_item	{

		for(.@args = getargcount();.@i < .@args;.@i+= 4) {
			.@j = .w2[.w1]++;
			setd ".it_id_"+.w1+"_"+.@j,getarg(.@i);	// id.
			if(getarg(.@i + 4,0) != 0) {
				setd ".it_mode_"+.w1+"_"+.@j,getarg(.@i + 1);	// mode.
				setd ".it_mob_"+.w1+"_"+.@j,getarg(.@i + 2);	// mob id.
				setd ".it_amt_"+.w1+"_"+.@j,getarg(.@i + 3);	// amount.
			}
		}
		.w1++;

	}

}

Based on ||chris|| snippet, since I don't really know about the random options system.

y87q9qlw

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  303
  • Reputation:   117
  • Joined:  12/10/16
  • Last Seen:  

Change it to:

.@amount = getd("mobs_"+.@item_id) + 1;

Sorry.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  22
  • Topics Per Day:  0.01
  • Content Count:  109
  • Reputation:   5
  • Joined:  08/12/17
  • Last Seen:  

i fixed this part, and get new error with effect(line 139), and found another one on line 170 (an extra ')'). Script works fine but it really ignore random option. Im trying to do something with it because your version is much better than mine xD 

 

2 hours ago, n0tttt said:

Change it to:

.@amount = getd("mobs_"+.@item_id) + 1;

Sorry.

Leaving a bit your script i can made it work and now its saves random option, but, the premade order of evolving its not been respected by script.

-	script	Extra_ItemConf	-1,{

	function add_item;

OnInit:

/*
	add_item(id, evolution mode, monster id, amount, id...);
	If  you want any monster, use 111.

Evolution modes:

	1 = Every X numer of mobs (1%).
	2 = Experience (1%).
*/


/* Adaga  */	add_item(13040,1, 111, 1, 1203, 1, 111, 5, 1206, 1, 111, 15, 1209, 1, 111, 25, 1212, 1, 111, 30, 1215, 1, 111, 60, 1218, 1, 111, 70, 1221, 1, 111, 80, 1222, 1, 111, 90, 13048, 1, 111, 150 ); // Adaga
/* 1HSword */	add_item(13415,1, 111, 1, 1103, 1, 111, 5, 1106, 1, 111, 15, 1109, 1, 111, 25, 1112, 1, 111, 30, 1115, 1, 111, 60, 1122, 1, 111, 70, 1123, 1, 111, 80, 1126, 1, 111, 90, 1121, 1, 111, 100, 1129, 1, 111, 125, 13422, 1, 111, 150 ); // Espada 1H
/* 2HSword */	add_item(1118, 1, 111, 5, 1153, 1, 111, 15, 1156, 1, 111, 25, 1160, 1, 111, 30, 1159, 1, 111, 60, 1163, 1, 111, 70, 1190, 1, 111, 100, 1188, 1, 111, 200 ); // Espada 2H
/* 2HAxe  */	add_item(1381, 1, 111, 1, 1353, 1, 111, 5, 1356, 1, 111, 15, 1359, 1, 111, 25, 1362, 1, 111, 30, 1388, 1, 111, 100, 1384, 1, 111, 200 ); // Machado 1H
/* Maces  */	add_item(1545, 1, 111, 1, 1503, 1, 111, 5, 1506, 1, 111, 15, 1509, 1, 111, 25, 1512, 1, 111, 30, 1521, 1, 111, 60, 1515, 1, 111, 70, 1518, 1, 111, 80, 1548, 1, 111, 200 ); // Maces 1H
/* Arcos  */	add_item(1742, 1, 111, 1, 1703, 1, 111, 5, 1706, 1, 111, 15, 1709, 1, 111, 25, 1712, 1, 111, 30, 1713, 1, 111, 60, 1714, 1, 111, 70, 1735, 1, 111, 80, 18128, 1, 111, 200 ); // Arcos
/* Cajados */	add_item(1639, 1, 111, 1, 1603, 1, 111, 5, 1606, 1, 111, 15, 1609, 1, 111, 25, 1612, 1, 111, 30, 1614, 1, 111, 60, 1615, 1, 111, 80, 1636, 1, 111, 100); // Cajados
/* 1HSpear */	add_item(1403, 1, 111,10, 1406, 1, 111,15, 1409, 1, 111, 30, 1430, 1, 111, 200);
/* 2HSpear */	add_item(1453, 1, 111,20, 1456, 1, 111,30, 1459, 1, 111, 40, 1462, 1, 111, 50, 1465, 1, 111, 70, 1412, 1, 111, 100);
/* Knuckles */	add_item(1801, 1, 111,20, 1803, 1, 111,30, 1805, 1, 111, 40, 1809, 1, 111, 50, 1811, 1, 111, 60, 1807, 1, 111, 70, 1814, 1, 111, 80, 1829, 1, 111, 100);
/* Violin */	add_item(1901, 1, 111,20, 1903, 1, 111,30, 1905, 1, 111, 40, 1909, 1, 111, 50, 1911, 1, 111, 60, 1907, 1, 111, 80, 1925, 1, 111,100, 1918, 1, 111, 150);
/* Whip */		add_item(1950, 1, 111,20, 1952, 1, 111,30, 1954, 1, 111, 40, 1958, 1, 111, 50, 1960, 1, 111, 60, 1958, 1, 111, 80, 1994, 1, 111,100);
/* Katar */		add_item(1264, 1, 111,20, 1262, 1, 111,30, 1295, 1, 111, 40, 1250, 1, 111, 50, 1252, 1, 111, 60, 1283, 1, 111, 100);
/* Debug  */	add_item(2301, 1, 111, 1, 2302, 1, 111, 2);

/*
	0 = Won't be evolved automatically.
	1 = Will be evolved automatically
*/
	.auto = 1;

/*
	Color of the announces.
*/
	setarray .c$[0],"ffffff",	// % of evolution.
			"03fd20",	// Wings evolving.
			"11f4cc";	// Wings evolved.

/* slots to check.
	EQI_ACC_L (0)             - Accessory 1
	EQI_ACC_R (1)             - Accessory 2
	EQI_SHOES (2)             - Footgear (shoes, boots)
	EQI_GARMENT (3)           - Garment (mufflers, hoods, manteaux)
	EQI_HEAD_LOW (4)          - Lower Headgear (beards, some masks)
	EQI_HEAD_MID (5)          - Middle Headgear (masks, glasses)
	EQI_HEAD_TOP (6)          - Upper Headgear
	EQI_ARMOR (7)             - Armor (jackets, robes)
	EQI_HAND_L (8)            - Left hand (weapons, shields)
	EQI_HAND_R (9)            - Right hand (weapons)
	EQI_COSTUME_HEAD_TOP (10) - Upper Costume Headgear
	EQI_COSTUME_HEAD_MID (11) - Middle Costume Headgear
	EQI_COSTUME_HEAD_LOW (12) - Lower Costume Headgear
	EQI_COSTUME_GARMENT (13)  - Costume Garment
	EQI_AMMO (14)             - Arrow/Ammunition
	EQI_SHADOW_ARMOR (15)     - Shadow Armor
	EQI_SHADOW_WEAPON (16)    - Shadow Weapon
	EQI_SHADOW_SHIELD (17)    - Shadow Shield
	EQI_SHADOW_SHOES (18)     - Shadow Shoes
	EQI_SHADOW_ACC_R (19)     - Shadow Accessory 2
	EQI_SHADOW_ACC_L (20)     - Shadow Accessory 1
*/

	setarray .slots[0],	/*EQI_HAND_R,*/
						EQI_HAND_L,
						EQI_ARMOR,
						EQI_SHOES,
						EQI_GARMENT;

	//=============================================

	end;

OnNPCKillEvent:

	if(!@evolving) {
		// Cache. That old loop on every mob killed...
		if(@evo_var[0] && isequipped(@evo_var[0])) {
			.@has_item = true;
			.@item_id = @evo_var[0];
			.@i = @evo_var[1] - 1;
			.@j = @evo_var[2] - 1;
			.@slot = @evo_var[3];
			.@mob_id = getd(".it_mob_"+.@i+"_"+.@j);
			if(killedrid != .@mob_id && .@mob_id > 1001)
				end;
		} else {
			.@size = getarraysize(.slots);
			while(.@slot < .@size && !.@has_item) {
				.@item_id = getequipid(.slots[.@slot]);
				.@slot++;
				if(.@item_id < 0)
					continue;
				.@i = 0;
				while(.@i < .w1 && !.@has_item) {
					.@j = 0;
					while(.@j < .w2[.@i] && !.@has_item) {
						.@item_evo = getd(".it_id_"+.@i+"_"+.@j);
						if(.@item_id == .@item_evo && getd(".it_id_"+.@i+"_"+(.@j + 1))) {
							.@mob_id = getd(".it_mob_"+.@i+"_"+.@j);
							if(killedrid == .@mob_id || .@mob_id < 1001) {
								.@has_item = true;
								setarray @evo_var[0],.@item_id,.@i + 1,.@j + 1,.@slot;
							}
						} else if(.@item_id == .@item_evo) {
							end;
						}
						if(!.@has_item)
							.@j++;
					}
					if(!.@has_item)
						.@i++;
				}
			}
		}
		if(.@has_item) {
			if(getd(".it_mode_"+.@i+"_"+.@j) == 1) {
				.@amount = getd("mobs_"+.@item_id) + 1;
				setd "mobs_"+.@item_id,.@amount;
				if(.@amount < getd(".it_amt_"+.@i+"_"+.@j)) end;
				setd "mobs_"+.@item_id,0;
			} else if(getd(".it_mode_"+.@i+"_"+.@j) == 2) {
				.@amount = getd("exp_"+.@item_id) + strmobinfo(6,killedrid);
				setd "exp_"+.@item_id,.@amount;
				if(.@amount < getd(".it_amt_"+.@i+"_"+.@j)) end;
				setd "exp_"+.@item_id,0;
			} else {
				debugmes "Script Items_Evo, error: wrong mode.";
				end;
			}
			specialeffect2 EF_BEGINSPELL6;
			sleep2 rand(190,280);
			//specia?leffect2 EF_ENERGYDRAIN3;
			.@percent = getd("evo_"+.@item_id);
			if(.@percent < 100) {
				setd "evo_"+.@item_id,++.@percent;
				announce getitemname(.@item_id)+": "+.@percent+"%.",bc_self,"0x"+.c$[0];
			}
			if(.@percent >= 100 && .auto && !@evolving) {
				@evolving = true;
				specialeffect2 EF_GUMGANG3;
				sleep2 500;
				specialeffect2 EF_BASH3D2;
				sleep2 300;
				specialeffect2 EF_BLUEBODY;
				sleep2 300;
				announce getitemname(.@item_id)+" está evoluindo...",bc_self,"0x"+.c$[1];
				.@k = 3;
				while(.@k--) {
					specialeffect2 EF_DOUBLECASTBODY;
					sleep2 900;
				}
				specialeffect2 EF_STORMKICK5;
				sleep2 200;
				specialeffect2 EF_BUBBLE_DROP;
				sleep2 500;
				.@slot--;
				//setarray .@card[1],getequipcardid(.slots[.@slot],0),getequipcardid(.slots[.@slot],1),getequipcardid(.slots[.@slot],2),getequipcardid(.slots[.@slot],3);
				//.@refine = getequiprefinerycnt(.slots[.@slot]);
				//if(getiteminfo(.@item_id,2) == IT_WEAPON) {
				//	for(.@k = 0;.@k < 5;.@k++) {
				//		.@option_id[.@k] = getequiprandomoption(.slots[.@slot],.@k,ROA_ID);
				//		.@option_val[.@k] = getequiprandomoption(.slots[.@slot],.@k,ROA_VAL);
				//		if(!.@has_option && .@option_val[.@k])
				//			.@has_option = true;
				//	}
				//}
				.@part = .slots[.@slot];
				.@OriId = getequipid(.@part);				
				getinventorylist;
				freeloop 1;
				for(.@i = 0; .@i < @inventorylist_count; .@i++){
				if(@inventorylist_equip[.@i] && @inventorylist_id[.@i] == .@OriId){
				if(!@inventorylist_expire[.@i]){
				setarray .@iteminfo,@inventorylist_id[.@i],@inventorylist_refine[.@i],@inventorylist_card1[.@i],@inventorylist_card2[.@i],@inventorylist_card3[.@i],@inventorylist_card4[.@i];
				setarray .@roid,@inventorylist_option_id1[.@i],@inventorylist_option_id2[.@i],@inventorylist_option_id3[.@i],@inventorylist_option_id4[.@i],@inventorylist_option_id5[.@i];
				setarray .@val,@inventorylist_option_value1[.@i],@inventorylist_option_value2[.@i],@inventorylist_option_value3[.@i],@inventorylist_option_value4[.@i],@inventorylist_option_value5[.@i];
				setarray .@par,@inventorylist_option_parameter1[.@i],@inventorylist_option_parameter2[.@i],@inventorylist_option_parameter3[.@i],@inventorylist_option_parameter4[.@i],@inventorylist_option_parameter5[.@i];
				.@bound = @inventorylist_bound[.@i];
				break;
			} else	end;
		}
	}
	freeloop 0;
				.@evo_item = getd(".it_id_"+.@i+"_"+(.@j + 1));
				//delequip .slots[.@slot];
				//if(.@has_option)
				if(getarraysize(.@val)){
					delitem3 .@iteminfo[0],1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5],.@roid,.@val,.@par;
				if(.@bound)
					getitembound3 .@evo_item,1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5],Bound_Account,.@roid,.@val,.@par;
				else	getitem3 .@evo_item,1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5],.@roid,.@val,.@par;
			} else {
					delitem2 .@iteminfo[0],1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5];
				if(.@bound)
					getitembound2 .@evo_item,1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5],Bound_Account;
				else	getitem2 .@evo_item,1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5];
			}				
			//	if(getarraysize(.@val))
			//		getitem3 .@evo_item,1,true,.@refine,false,.@card[1],.@card[2],.@card[3],.@card[4],.@roid,.@val,.@par; //.@option_id,.@option_val,0;
			//	else
			//		getitem2 .@evo_item,1,true,.@refine,false,.@card[1],.@card[2],.@card[3],.@card[4];
				equip .@evo_item;
				setd "evo_"+.@item_id,0;
				deletearray @evo_var;
				announce "Parabéns!! Sua "+getitemname(.@item_id)+" evoluiu para "+getitemname(.@evo_item)+".",bc_self,"0x"+.c$[2];
				@evolving = false;
			}
		}
	}
	end;

	function	add_item	{

		for(.@args = getargcount();.@i < .@args;.@i+= 4) {
			.@j = .w2[.w1]++;
			setd ".it_id_"+.w1+"_"+.@j,getarg(.@i);	// id.
			if(getarg(.@i + 4,0) != 0) {
				setd ".it_mode_"+.w1+"_"+.@j,getarg(.@i + 1);	// mode.
				setd ".it_mob_"+.w1+"_"+.@j,getarg(.@i + 2);	// mob id.
				setd ".it_amt_"+.w1+"_"+.@j,getarg(.@i + 3);	// amount.
			}
		}
		.w1++;

	}

}

 

Edited by Rizta
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  303
  • Reputation:   117
  • Joined:  12/10/16
  • Last Seen:  

It's because the script uses .@i for indexing which wing, and you added a loop which also uses .@i

I changed the loop to use inarray and kept the rest like you did (just erased the other bits because they were confusing me).

Tell me how it goes.

-	script	Extra_ItemConf	-1,{

	function add_item;

OnInit:

/*
	add_item(id, evolution mode, monster id, amount, id...);
	If  you want any monster, use 111.

Evolution modes:

	1 = Every X numer of mobs (1%).
	2 = Experience (1%).
*/


/* Adaga  */	add_item(13040,1, 111, 1, 1203, 1, 111, 5, 1206, 1, 111, 15, 1209, 1, 111, 25, 1212, 1, 111, 30, 1215, 1, 111, 60, 1218, 1, 111, 70, 1221, 1, 111, 80, 1222, 1, 111, 90, 13048, 1, 111, 150 ); // Adaga
/* 1HSword */	add_item(13415,1, 111, 1, 1103, 1, 111, 5, 1106, 1, 111, 15, 1109, 1, 111, 25, 1112, 1, 111, 30, 1115, 1, 111, 60, 1122, 1, 111, 70, 1123, 1, 111, 80, 1126, 1, 111, 90, 1121, 1, 111, 100, 1129, 1, 111, 125, 13422, 1, 111, 150 ); // Espada 1H
/* 2HSword */	add_item(1118, 1, 111, 5, 1153, 1, 111, 15, 1156, 1, 111, 25, 1160, 1, 111, 30, 1159, 1, 111, 60, 1163, 1, 111, 70, 1190, 1, 111, 100, 1188, 1, 111, 200 ); // Espada 2H
/* 2HAxe  */	add_item(1381, 1, 111, 1, 1353, 1, 111, 5, 1356, 1, 111, 15, 1359, 1, 111, 25, 1362, 1, 111, 30, 1388, 1, 111, 100, 1384, 1, 111, 200 ); // Machado 1H
/* Maces  */	add_item(1545, 1, 111, 1, 1503, 1, 111, 5, 1506, 1, 111, 15, 1509, 1, 111, 25, 1512, 1, 111, 30, 1521, 1, 111, 60, 1515, 1, 111, 70, 1518, 1, 111, 80, 1548, 1, 111, 200 ); // Maces 1H
/* Arcos  */	add_item(1742, 1, 111, 1, 1703, 1, 111, 5, 1706, 1, 111, 15, 1709, 1, 111, 25, 1712, 1, 111, 30, 1713, 1, 111, 60, 1714, 1, 111, 70, 1735, 1, 111, 80, 18128, 1, 111, 200 ); // Arcos
/* Cajados */	add_item(1639, 1, 111, 1, 1603, 1, 111, 5, 1606, 1, 111, 15, 1609, 1, 111, 25, 1612, 1, 111, 30, 1614, 1, 111, 60, 1615, 1, 111, 80, 1636, 1, 111, 100); // Cajados
/* 1HSpear */	add_item(1403, 1, 111,10, 1406, 1, 111,15, 1409, 1, 111, 30, 1430, 1, 111, 200);
/* 2HSpear */	add_item(1453, 1, 111,20, 1456, 1, 111,30, 1459, 1, 111, 40, 1462, 1, 111, 50, 1465, 1, 111, 70, 1412, 1, 111, 100);
/* Knuckles */	add_item(1801, 1, 111,20, 1803, 1, 111,30, 1805, 1, 111, 40, 1809, 1, 111, 50, 1811, 1, 111, 60, 1807, 1, 111, 70, 1814, 1, 111, 80, 1829, 1, 111, 100);
/* Violin */	add_item(1901, 1, 111,20, 1903, 1, 111,30, 1905, 1, 111, 40, 1909, 1, 111, 50, 1911, 1, 111, 60, 1907, 1, 111, 80, 1925, 1, 111,100, 1918, 1, 111, 150);
/* Whip */		add_item(1950, 1, 111,20, 1952, 1, 111,30, 1954, 1, 111, 40, 1958, 1, 111, 50, 1960, 1, 111, 60, 1958, 1, 111, 80, 1994, 1, 111,100);
/* Katar */		add_item(1264, 1, 111,20, 1262, 1, 111,30, 1295, 1, 111, 40, 1250, 1, 111, 50, 1252, 1, 111, 60, 1283, 1, 111, 100);
/* Debug  */	add_item(2301, 1, 111, 1, 2302, 1, 111, 2);

/*
	0 = Won't be evolved automatically.
	1 = Will be evolved automatically
*/
	.auto = 1;

/*
	Color of the announces.
*/
	setarray .c$[0],"ffffff",	// % of evolution.
			"03fd20",	// Wings evolving.
			"11f4cc";	// Wings evolved.

/* slots to check.
	EQI_ACC_L (0)             - Accessory 1
	EQI_ACC_R (1)             - Accessory 2
	EQI_SHOES (2)             - Footgear (shoes, boots)
	EQI_GARMENT (3)           - Garment (mufflers, hoods, manteaux)
	EQI_HEAD_LOW (4)          - Lower Headgear (beards, some masks)
	EQI_HEAD_MID (5)          - Middle Headgear (masks, glasses)
	EQI_HEAD_TOP (6)          - Upper Headgear
	EQI_ARMOR (7)             - Armor (jackets, robes)
	EQI_HAND_L (8)            - Left hand (weapons, shields)
	EQI_HAND_R (9)            - Right hand (weapons)
	EQI_COSTUME_HEAD_TOP (10) - Upper Costume Headgear
	EQI_COSTUME_HEAD_MID (11) - Middle Costume Headgear
	EQI_COSTUME_HEAD_LOW (12) - Lower Costume Headgear
	EQI_COSTUME_GARMENT (13)  - Costume Garment
	EQI_AMMO (14)             - Arrow/Ammunition
	EQI_SHADOW_ARMOR (15)     - Shadow Armor
	EQI_SHADOW_WEAPON (16)    - Shadow Weapon
	EQI_SHADOW_SHIELD (17)    - Shadow Shield
	EQI_SHADOW_SHOES (18)     - Shadow Shoes
	EQI_SHADOW_ACC_R (19)     - Shadow Accessory 2
	EQI_SHADOW_ACC_L (20)     - Shadow Accessory 1
*/

	setarray .slots[0],	/*EQI_HAND_R,*/
						EQI_HAND_L,
						EQI_ARMOR,
						EQI_SHOES,
						EQI_GARMENT;

	//=============================================

	end;

OnNPCKillEvent:

	if(!@evolving) {
		// Cache. That old loop on every mob killed...
		if(@evo_var[0] && isequipped(@evo_var[0])) {
			.@has_item = true;
			.@item_id = @evo_var[0];
			.@i = @evo_var[1] - 1;
			.@j = @evo_var[2] - 1;
			.@slot = @evo_var[3];
			.@mob_id = getd(".it_mob_"+.@i+"_"+.@j);
			if(killedrid != .@mob_id && .@mob_id > 1001)
				end;
		} else {
			.@size = getarraysize(.slots);
			while(.@slot < .@size && !.@has_item) {
				.@item_id = getequipid(.slots[.@slot]);
				.@slot++;
				if(.@item_id < 0)
					continue;
				.@i = 0;
				while(.@i < .w1 && !.@has_item) {
					.@j = 0;
					while(.@j < .w2[.@i] && !.@has_item) {
						.@item_evo = getd(".it_id_"+.@i+"_"+.@j);
						if(.@item_id == .@item_evo && getd(".it_id_"+.@i+"_"+(.@j + 1))) {
							.@mob_id = getd(".it_mob_"+.@i+"_"+.@j);
							if(killedrid == .@mob_id || .@mob_id < 1001) {
								.@has_item = true;
								setarray @evo_var[0],.@item_id,.@i + 1,.@j + 1,.@slot;
							}
						} else if(.@item_id == .@item_evo) {
							end;
						}
						if(!.@has_item)
							.@j++;
					}
					if(!.@has_item)
						.@i++;
				}
			}
		}
		if(.@has_item) {
			if(getd(".it_mode_"+.@i+"_"+.@j) == 1) {
				.@amount = getd("mobs_"+.@item_id) + 1;
				setd "mobs_"+.@item_id,.@amount;
				if(.@amount < getd(".it_amt_"+.@i+"_"+.@j)) end;
				setd "mobs_"+.@item_id,0;
			} else if(getd(".it_mode_"+.@i+"_"+.@j) == 2) {
				.@amount = getd("exp_"+.@item_id) + strmobinfo(6,killedrid);
				setd "exp_"+.@item_id,.@amount;
				if(.@amount < getd(".it_amt_"+.@i+"_"+.@j)) end;
				setd "exp_"+.@item_id,0;
			} else {
				debugmes "Script Items_Evo, error: wrong mode.";
				end;
			}
			specialeffect2 EF_BEGINSPELL6;
			sleep2 rand(190,280);
			specialeffect2 EF_ENERGYDRAIN3;
			.@percent = getd("evo_"+.@item_id);
			if(.@percent < 100) {
				setd "evo_"+.@item_id,++.@percent;
				announce getitemname(.@item_id)+": "+.@percent+"%.",bc_self,"0x"+.c$[0];
			}
			if(.@percent >= 100 && .auto && !@evolving) {
				@evolving = true;
				specialeffect2 EF_GUMGANG3;
				sleep2 500;
				specialeffect2 EF_BASH3D2;
				sleep2 300;
				specialeffect2 EF_BLUEBODY;
				sleep2 300;
				announce getitemname(.@item_id)+" está evoluindo...",bc_self,"0x"+.c$[1];
				.@k = 3;
				while(.@k--) {
					specialeffect2 EF_DOUBLECASTBODY;
					sleep2 900;
				}
				specialeffect2 EF_STORMKICK5;
				sleep2 200;
				specialeffect2 EF_BUBBLE_DROP;
				sleep2 500;
				.@slot--;
				.@part = .slots[.@slot];
				getinventorylist;
				.@k = inarray(@inventorylist_equip,.@part);
				if(.@k == -1)
					end;
				if(!@inventorylist_expire[.@k]){
					setarray .@iteminfo,@inventorylist_id[.@k],@inventorylist_refine[.@k],@inventorylist_card1[.@k],@inventorylist_card2[.@k],@inventorylist_card3[.@k],@inventorylist_card4[.@k];
					setarray .@roid,@inventorylist_option_id1[.@k],@inventorylist_option_id2[.@k],@inventorylist_option_id3[.@k],@inventorylist_option_id4[.@k],@inventorylist_option_id5[.@k];
					setarray .@val,@inventorylist_option_value1[.@k],@inventorylist_option_value2[.@k],@inventorylist_option_value3[.@k],@inventorylist_option_value4[.@k],@inventorylist_option_value5[.@k];
					setarray .@par,@inventorylist_option_parameter1[.@k],@inventorylist_option_parameter2[.@k],@inventorylist_option_parameter3[.@k],@inventorylist_option_parameter4[.@k],@inventorylist_option_parameter5[.@k];
					.@bound = @inventorylist_bound[.@k];
				} else {
					end;
				}
				.@evo_item = getd(".it_id_"+.@i+"_"+(.@j + 1));
				if(getarraysize(.@val)){
					delitem3 .@iteminfo[0],1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5],.@roid,.@val,.@par;
					if(.@bound)
						getitembound3 .@evo_item,1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5],Bound_Account,.@roid,.@val,.@par;
					else
						getitem3 .@evo_item,1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5],.@roid,.@val,.@par;
				} else {
					delitem2 .@iteminfo[0],1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5];
					if(.@bound)
						getitembound2 .@evo_item,1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5],Bound_Account;
					else
						getitem2 .@evo_item,1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5];
				}
				equip .@evo_item;
				setd "evo_"+.@item_id,0;
				deletearray @evo_var;
				announce "Parabéns!! Sua "+getitemname(.@item_id)+" evoluiu para "+getitemname(.@evo_item)+".",bc_self,"0x"+.c$[2];
				@evolving = false;
			}
		}
	}
	end;

	function	add_item	{

		for(.@args = getargcount();.@i < .@args;.@i+= 4) {
			.@j = .w2[.w1]++;
			setd ".it_id_"+.w1+"_"+.@j,getarg(.@i);	// id.
			if(getarg(.@i + 4,0) != 0) {
				setd ".it_mode_"+.w1+"_"+.@j,getarg(.@i + 1);	// mode.
				setd ".it_mob_"+.w1+"_"+.@j,getarg(.@i + 2);	// mob id.
				setd ".it_amt_"+.w1+"_"+.@j,getarg(.@i + 3);	// amount.
			}
		}
		.w1++;

	}

}

 

Edited by n0tttt
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  22
  • Topics Per Day:  0.01
  • Content Count:  109
  • Reputation:   5
  • Joined:  08/12/17
  • Last Seen:  

6 hours ago, n0tttt said:

It's because the script uses .@i for indexing which wing, and you added a loop which also uses .@i

I changed the loop to use inarray and kept the rest like you did (just erased the other bits because they were confusing me).

Tell me how it goes.


-	script	Extra_ItemConf	-1,{

	function add_item;

OnInit:

/*
	add_item(id, evolution mode, monster id, amount, id...);
	If  you want any monster, use 111.

Evolution modes:

	1 = Every X numer of mobs (1%).
	2 = Experience (1%).
*/


/* Adaga  */	add_item(13040,1, 111, 1, 1203, 1, 111, 5, 1206, 1, 111, 15, 1209, 1, 111, 25, 1212, 1, 111, 30, 1215, 1, 111, 60, 1218, 1, 111, 70, 1221, 1, 111, 80, 1222, 1, 111, 90, 13048, 1, 111, 150 ); // Adaga
/* 1HSword */	add_item(13415,1, 111, 1, 1103, 1, 111, 5, 1106, 1, 111, 15, 1109, 1, 111, 25, 1112, 1, 111, 30, 1115, 1, 111, 60, 1122, 1, 111, 70, 1123, 1, 111, 80, 1126, 1, 111, 90, 1121, 1, 111, 100, 1129, 1, 111, 125, 13422, 1, 111, 150 ); // Espada 1H
/* 2HSword */	add_item(1118, 1, 111, 5, 1153, 1, 111, 15, 1156, 1, 111, 25, 1160, 1, 111, 30, 1159, 1, 111, 60, 1163, 1, 111, 70, 1190, 1, 111, 100, 1188, 1, 111, 200 ); // Espada 2H
/* 2HAxe  */	add_item(1381, 1, 111, 1, 1353, 1, 111, 5, 1356, 1, 111, 15, 1359, 1, 111, 25, 1362, 1, 111, 30, 1388, 1, 111, 100, 1384, 1, 111, 200 ); // Machado 1H
/* Maces  */	add_item(1545, 1, 111, 1, 1503, 1, 111, 5, 1506, 1, 111, 15, 1509, 1, 111, 25, 1512, 1, 111, 30, 1521, 1, 111, 60, 1515, 1, 111, 70, 1518, 1, 111, 80, 1548, 1, 111, 200 ); // Maces 1H
/* Arcos  */	add_item(1742, 1, 111, 1, 1703, 1, 111, 5, 1706, 1, 111, 15, 1709, 1, 111, 25, 1712, 1, 111, 30, 1713, 1, 111, 60, 1714, 1, 111, 70, 1735, 1, 111, 80, 18128, 1, 111, 200 ); // Arcos
/* Cajados */	add_item(1639, 1, 111, 1, 1603, 1, 111, 5, 1606, 1, 111, 15, 1609, 1, 111, 25, 1612, 1, 111, 30, 1614, 1, 111, 60, 1615, 1, 111, 80, 1636, 1, 111, 100); // Cajados
/* 1HSpear */	add_item(1403, 1, 111,10, 1406, 1, 111,15, 1409, 1, 111, 30, 1430, 1, 111, 200);
/* 2HSpear */	add_item(1453, 1, 111,20, 1456, 1, 111,30, 1459, 1, 111, 40, 1462, 1, 111, 50, 1465, 1, 111, 70, 1412, 1, 111, 100);
/* Knuckles */	add_item(1801, 1, 111,20, 1803, 1, 111,30, 1805, 1, 111, 40, 1809, 1, 111, 50, 1811, 1, 111, 60, 1807, 1, 111, 70, 1814, 1, 111, 80, 1829, 1, 111, 100);
/* Violin */	add_item(1901, 1, 111,20, 1903, 1, 111,30, 1905, 1, 111, 40, 1909, 1, 111, 50, 1911, 1, 111, 60, 1907, 1, 111, 80, 1925, 1, 111,100, 1918, 1, 111, 150);
/* Whip */		add_item(1950, 1, 111,20, 1952, 1, 111,30, 1954, 1, 111, 40, 1958, 1, 111, 50, 1960, 1, 111, 60, 1958, 1, 111, 80, 1994, 1, 111,100);
/* Katar */		add_item(1264, 1, 111,20, 1262, 1, 111,30, 1295, 1, 111, 40, 1250, 1, 111, 50, 1252, 1, 111, 60, 1283, 1, 111, 100);
/* Debug  */	add_item(2301, 1, 111, 1, 2302, 1, 111, 2);

/*
	0 = Won't be evolved automatically.
	1 = Will be evolved automatically
*/
	.auto = 1;

/*
	Color of the announces.
*/
	setarray .c$[0],"ffffff",	// % of evolution.
			"03fd20",	// Wings evolving.
			"11f4cc";	// Wings evolved.

/* slots to check.
	EQI_ACC_L (0)             - Accessory 1
	EQI_ACC_R (1)             - Accessory 2
	EQI_SHOES (2)             - Footgear (shoes, boots)
	EQI_GARMENT (3)           - Garment (mufflers, hoods, manteaux)
	EQI_HEAD_LOW (4)          - Lower Headgear (beards, some masks)
	EQI_HEAD_MID (5)          - Middle Headgear (masks, glasses)
	EQI_HEAD_TOP (6)          - Upper Headgear
	EQI_ARMOR (7)             - Armor (jackets, robes)
	EQI_HAND_L (8)            - Left hand (weapons, shields)
	EQI_HAND_R (9)            - Right hand (weapons)
	EQI_COSTUME_HEAD_TOP (10) - Upper Costume Headgear
	EQI_COSTUME_HEAD_MID (11) - Middle Costume Headgear
	EQI_COSTUME_HEAD_LOW (12) - Lower Costume Headgear
	EQI_COSTUME_GARMENT (13)  - Costume Garment
	EQI_AMMO (14)             - Arrow/Ammunition
	EQI_SHADOW_ARMOR (15)     - Shadow Armor
	EQI_SHADOW_WEAPON (16)    - Shadow Weapon
	EQI_SHADOW_SHIELD (17)    - Shadow Shield
	EQI_SHADOW_SHOES (18)     - Shadow Shoes
	EQI_SHADOW_ACC_R (19)     - Shadow Accessory 2
	EQI_SHADOW_ACC_L (20)     - Shadow Accessory 1
*/

	setarray .slots[0],	/*EQI_HAND_R,*/
						EQI_HAND_L,
						EQI_ARMOR,
						EQI_SHOES,
						EQI_GARMENT;

	//=============================================

	end;

OnNPCKillEvent:

	if(!@evolving) {
		// Cache. That old loop on every mob killed...
		if(@evo_var[0] && isequipped(@evo_var[0])) {
			.@has_item = true;
			.@item_id = @evo_var[0];
			.@i = @evo_var[1] - 1;
			.@j = @evo_var[2] - 1;
			.@slot = @evo_var[3];
			.@mob_id = getd(".it_mob_"+.@i+"_"+.@j);
			if(killedrid != .@mob_id && .@mob_id > 1001)
				end;
		} else {
			.@size = getarraysize(.slots);
			while(.@slot < .@size && !.@has_item) {
				.@item_id = getequipid(.slots[.@slot]);
				.@slot++;
				if(.@item_id < 0)
					continue;
				.@i = 0;
				while(.@i < .w1 && !.@has_item) {
					.@j = 0;
					while(.@j < .w2[.@i] && !.@has_item) {
						.@item_evo = getd(".it_id_"+.@i+"_"+.@j);
						if(.@item_id == .@item_evo && getd(".it_id_"+.@i+"_"+(.@j + 1))) {
							.@mob_id = getd(".it_mob_"+.@i+"_"+.@j);
							if(killedrid == .@mob_id || .@mob_id < 1001) {
								.@has_item = true;
								setarray @evo_var[0],.@item_id,.@i + 1,.@j + 1,.@slot;
							}
						} else if(.@item_id == .@item_evo) {
							end;
						}
						if(!.@has_item)
							.@j++;
					}
					if(!.@has_item)
						.@i++;
				}
			}
		}
		if(.@has_item) {
			if(getd(".it_mode_"+.@i+"_"+.@j) == 1) {
				.@amount = getd("mobs_"+.@item_id) + 1;
				setd "mobs_"+.@item_id,.@amount;
				if(.@amount < getd(".it_amt_"+.@i+"_"+.@j)) end;
				setd "mobs_"+.@item_id,0;
			} else if(getd(".it_mode_"+.@i+"_"+.@j) == 2) {
				.@amount = getd("exp_"+.@item_id) + strmobinfo(6,killedrid);
				setd "exp_"+.@item_id,.@amount;
				if(.@amount < getd(".it_amt_"+.@i+"_"+.@j)) end;
				setd "exp_"+.@item_id,0;
			} else {
				debugmes "Script Items_Evo, error: wrong mode.";
				end;
			}
			specialeffect2 EF_BEGINSPELL6;
			sleep2 rand(190,280);
			specialeffect2 EF_ENERGYDRAIN3;
			.@percent = getd("evo_"+.@item_id);
			if(.@percent < 100) {
				setd "evo_"+.@item_id,++.@percent;
				announce getitemname(.@item_id)+": "+.@percent+"%.",bc_self,"0x"+.c$[0];
			}
			if(.@percent >= 100 && .auto && !@evolving) {
				@evolving = true;
				specialeffect2 EF_GUMGANG3;
				sleep2 500;
				specialeffect2 EF_BASH3D2;
				sleep2 300;
				specialeffect2 EF_BLUEBODY;
				sleep2 300;
				announce getitemname(.@item_id)+" está evoluindo...",bc_self,"0x"+.c$[1];
				.@k = 3;
				while(.@k--) {
					specialeffect2 EF_DOUBLECASTBODY;
					sleep2 900;
				}
				specialeffect2 EF_STORMKICK5;
				sleep2 200;
				specialeffect2 EF_BUBBLE_DROP;
				sleep2 500;
				.@slot--;
				.@part = .slots[.@slot];
				getinventorylist;
				.@k = inarray(@inventorylist_equip,.@part);
				if(.@k == -1)
					end;
				if(!@inventorylist_expire[.@k]){
					setarray .@iteminfo,@inventorylist_id[.@k],@inventorylist_refine[.@k],@inventorylist_card1[.@k],@inventorylist_card2[.@k],@inventorylist_card3[.@k],@inventorylist_card4[.@k];
					setarray .@roid,@inventorylist_option_id1[.@k],@inventorylist_option_id2[.@k],@inventorylist_option_id3[.@k],@inventorylist_option_id4[.@k],@inventorylist_option_id5[.@k];
					setarray .@val,@inventorylist_option_value1[.@k],@inventorylist_option_value2[.@k],@inventorylist_option_value3[.@k],@inventorylist_option_value4[.@k],@inventorylist_option_value5[.@k];
					setarray .@par,@inventorylist_option_parameter1[.@k],@inventorylist_option_parameter2[.@k],@inventorylist_option_parameter3[.@k],@inventorylist_option_parameter4[.@k],@inventorylist_option_parameter5[.@k];
					.@bound = @inventorylist_bound[.@k];
				} else {
					end;
				}
				.@evo_item = getd(".it_id_"+.@i+"_"+(.@j + 1));
				if(getarraysize(.@val)){
					delitem3 .@iteminfo[0],1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5],.@roid,.@val,.@par;
					if(.@bound)
						getitembound3 .@evo_item,1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5],Bound_Account,.@roid,.@val,.@par;
					else
						getitem3 .@evo_item,1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5],.@roid,.@val,.@par;
				} else {
					delitem2 .@iteminfo[0],1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5];
					if(.@bound)
						getitembound2 .@evo_item,1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5],Bound_Account;
					else
						getitem2 .@evo_item,1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5];
				}
				equip .@evo_item;
				setd "evo_"+.@item_id,0;
				deletearray @evo_var;
				announce "Parabéns!! Sua "+getitemname(.@item_id)+" evoluiu para "+getitemname(.@evo_item)+".",bc_self,"0x"+.c$[2];
				@evolving = false;
			}
		}
	}
	end;

	function	add_item	{

		for(.@args = getargcount();.@i < .@args;.@i+= 4) {
			.@j = .w2[.w1]++;
			setd ".it_id_"+.w1+"_"+.@j,getarg(.@i);	// id.
			if(getarg(.@i + 4,0) != 0) {
				setd ".it_mode_"+.w1+"_"+.@j,getarg(.@i + 1);	// mode.
				setd ".it_mob_"+.w1+"_"+.@j,getarg(.@i + 2);	// mob id.
				setd ".it_amt_"+.w1+"_"+.@j,getarg(.@i + 3);	// amount.
			}
		}
		.w1++;

	}

}

 

ya4brzut

Fixing this and now item dosnt evolve. 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  303
  • Reputation:   117
  • Joined:  12/10/16
  • Last Seen:  

If the item is not really "repeatable", then you can look it by the id in the inarray. If it is, then we have to create an extra array with the EQP_* constants found in script_constants.hpp with the slots.

-	script	Extra_ItemConf	-1,{

	function add_item;

OnInit:

/*
	add_item(id, evolution mode, monster id, amount, id...);
	If  you want any monster, use 111.

Evolution modes:

	1 = Every X numer of mobs (1%).
	2 = Experience (1%).
*/


/* Adaga  */	add_item(13040,1, 111, 1, 1203, 1, 111, 5, 1206, 1, 111, 15, 1209, 1, 111, 25, 1212, 1, 111, 30, 1215, 1, 111, 60, 1218, 1, 111, 70, 1221, 1, 111, 80, 1222, 1, 111, 90, 13048, 1, 111, 150 ); // Adaga
/* 1HSword */	add_item(13415,1, 111, 1, 1103, 1, 111, 5, 1106, 1, 111, 15, 1109, 1, 111, 25, 1112, 1, 111, 30, 1115, 1, 111, 60, 1122, 1, 111, 70, 1123, 1, 111, 80, 1126, 1, 111, 90, 1121, 1, 111, 100, 1129, 1, 111, 125, 13422, 1, 111, 150 ); // Espada 1H
/* 2HSword */	add_item(1118, 1, 111, 5, 1153, 1, 111, 15, 1156, 1, 111, 25, 1160, 1, 111, 30, 1159, 1, 111, 60, 1163, 1, 111, 70, 1190, 1, 111, 100, 1188, 1, 111, 200 ); // Espada 2H
/* 2HAxe  */	add_item(1381, 1, 111, 1, 1353, 1, 111, 5, 1356, 1, 111, 15, 1359, 1, 111, 25, 1362, 1, 111, 30, 1388, 1, 111, 100, 1384, 1, 111, 200 ); // Machado 1H
/* Maces  */	add_item(1545, 1, 111, 1, 1503, 1, 111, 5, 1506, 1, 111, 15, 1509, 1, 111, 25, 1512, 1, 111, 30, 1521, 1, 111, 60, 1515, 1, 111, 70, 1518, 1, 111, 80, 1548, 1, 111, 200 ); // Maces 1H
/* Arcos  */	add_item(1742, 1, 111, 1, 1703, 1, 111, 5, 1706, 1, 111, 15, 1709, 1, 111, 25, 1712, 1, 111, 30, 1713, 1, 111, 60, 1714, 1, 111, 70, 1735, 1, 111, 80, 18128, 1, 111, 200 ); // Arcos
/* Cajados */	add_item(1639, 1, 111, 1, 1603, 1, 111, 5, 1606, 1, 111, 15, 1609, 1, 111, 25, 1612, 1, 111, 30, 1614, 1, 111, 60, 1615, 1, 111, 80, 1636, 1, 111, 100); // Cajados
/* 1HSpear */	add_item(1403, 1, 111,10, 1406, 1, 111,15, 1409, 1, 111, 30, 1430, 1, 111, 200);
/* 2HSpear */	add_item(1453, 1, 111,20, 1456, 1, 111,30, 1459, 1, 111, 40, 1462, 1, 111, 50, 1465, 1, 111, 70, 1412, 1, 111, 100);
/* Knuckles */	add_item(1801, 1, 111,20, 1803, 1, 111,30, 1805, 1, 111, 40, 1809, 1, 111, 50, 1811, 1, 111, 60, 1807, 1, 111, 70, 1814, 1, 111, 80, 1829, 1, 111, 100);
/* Violin */	add_item(1901, 1, 111,20, 1903, 1, 111,30, 1905, 1, 111, 40, 1909, 1, 111, 50, 1911, 1, 111, 60, 1907, 1, 111, 80, 1925, 1, 111,100, 1918, 1, 111, 150);
/* Whip */		add_item(1950, 1, 111,20, 1952, 1, 111,30, 1954, 1, 111, 40, 1958, 1, 111, 50, 1960, 1, 111, 60, 1958, 1, 111, 80, 1994, 1, 111,100);
/* Katar */		add_item(1264, 1, 111,20, 1262, 1, 111,30, 1295, 1, 111, 40, 1250, 1, 111, 50, 1252, 1, 111, 60, 1283, 1, 111, 100);
/* Debug  */	add_item(2301, 1, 111, 1, 2302, 1, 111, 2);

/*
	0 = Won't be evolved automatically.
	1 = Will be evolved automatically
*/
	.auto = 1;

/*
	Color of the announces.
*/
	setarray .c$[0],"ffffff",	// % of evolution.
			"03fd20",	// Wings evolving.
			"11f4cc";	// Wings evolved.

/* slots to check.
	EQI_ACC_L (0)             - Accessory 1
	EQI_ACC_R (1)             - Accessory 2
	EQI_SHOES (2)             - Footgear (shoes, boots)
	EQI_GARMENT (3)           - Garment (mufflers, hoods, manteaux)
	EQI_HEAD_LOW (4)          - Lower Headgear (beards, some masks)
	EQI_HEAD_MID (5)          - Middle Headgear (masks, glasses)
	EQI_HEAD_TOP (6)          - Upper Headgear
	EQI_ARMOR (7)             - Armor (jackets, robes)
	EQI_HAND_L (8)            - Left hand (weapons, shields)
	EQI_HAND_R (9)            - Right hand (weapons)
	EQI_COSTUME_HEAD_TOP (10) - Upper Costume Headgear
	EQI_COSTUME_HEAD_MID (11) - Middle Costume Headgear
	EQI_COSTUME_HEAD_LOW (12) - Lower Costume Headgear
	EQI_COSTUME_GARMENT (13)  - Costume Garment
	EQI_AMMO (14)             - Arrow/Ammunition
	EQI_SHADOW_ARMOR (15)     - Shadow Armor
	EQI_SHADOW_WEAPON (16)    - Shadow Weapon
	EQI_SHADOW_SHIELD (17)    - Shadow Shield
	EQI_SHADOW_SHOES (18)     - Shadow Shoes
	EQI_SHADOW_ACC_R (19)     - Shadow Accessory 2
	EQI_SHADOW_ACC_L (20)     - Shadow Accessory 1
*/

	setarray .slots[0],	/*EQI_HAND_R,*/
				EQI_HAND_L,
				EQI_ARMOR,
				EQI_SHOES,
				EQI_GARMENT;

	//=============================================

	end;

OnNPCKillEvent:

	if(!@evolving) {
		// Cache. That old loop on every mob killed...
		if(@evo_var[0] && isequipped(@evo_var[0])) {
			.@has_item = true;
			.@item_id = @evo_var[0];
			.@i = @evo_var[1] - 1;
			.@j = @evo_var[2] - 1;
			.@slot = @evo_var[3];
			.@mob_id = getd(".it_mob_"+.@i+"_"+.@j);
			if(killedrid != .@mob_id && .@mob_id > 1001)
				end;
		} else {
			.@size = getarraysize(.slots);
			while(.@slot < .@size && !.@has_item) {
				.@item_id = getequipid(.slots[.@slot]);
				.@slot++;
				if(.@item_id < 0)
					continue;
				.@i = 0;
				while(.@i < .w1 && !.@has_item) {
					.@j = 0;
					while(.@j < .w2[.@i] && !.@has_item) {
						.@item_evo = getd(".it_id_"+.@i+"_"+.@j);
						if(.@item_id == .@item_evo && getd(".it_id_"+.@i+"_"+(.@j + 1))) {
							.@mob_id = getd(".it_mob_"+.@i+"_"+.@j);
							if(killedrid == .@mob_id || .@mob_id < 1001) {
								.@has_item = true;
								setarray @evo_var[0],.@item_id,.@i + 1,.@j + 1,.@slot;
							}
						} else if(.@item_id == .@item_evo) {
							end;
						}
						if(!.@has_item)
							.@j++;
					}
					if(!.@has_item)
						.@i++;
				}
			}
		}
		if(.@has_item) {
			if(getd(".it_mode_"+.@i+"_"+.@j) == 1) {
				.@amount = getd("mobs_"+.@item_id) + 1;
				setd "mobs_"+.@item_id,.@amount;
				if(.@amount < getd(".it_amt_"+.@i+"_"+.@j)) end;
				setd "mobs_"+.@item_id,0;
			} else if(getd(".it_mode_"+.@i+"_"+.@j) == 2) {
				.@amount = getd("exp_"+.@item_id) + strmobinfo(6,killedrid);
				setd "exp_"+.@item_id,.@amount;
				if(.@amount < getd(".it_amt_"+.@i+"_"+.@j)) end;
				setd "exp_"+.@item_id,0;
			} else {
				debugmes "Script Items_Evo, error: wrong mode.";
				end;
			}
			specialeffect2 EF_BEGINSPELL6;
			sleep2 rand(190,280);
			specialeffect2 EF_ENERGYDRAIN3;
			.@percent = getd("evo_"+.@item_id);
			if(.@percent < 100) {
				setd "evo_"+.@item_id,++.@percent;
				announce getitemname(.@item_id)+": "+.@percent+"%.",bc_self,"0x"+.c$[0];
			}
			if(.@percent >= 100 && .auto && !@evolving) {
				@evolving = true;
				specialeffect2 EF_GUMGANG3;
				sleep2 500;
				specialeffect2 EF_BASH3D2;
				sleep2 300;
				specialeffect2 EF_BLUEBODY;
				sleep2 300;
				announce getitemname(.@item_id)+" está evoluindo...",bc_self,"0x"+.c$[1];
				.@k = 3;
				while(.@k--) {
					specialeffect2 EF_DOUBLECASTBODY;
					sleep2 900;
				}
				specialeffect2 EF_STORMKICK5;
				sleep2 200;
				specialeffect2 EF_BUBBLE_DROP;
				sleep2 500;
				getinventorylist;
				.@k = inarray(@inventorylist_id,.@item_id);
				if(.@k != -1) {
					if(!@inventorylist_expire[.@k]) {
						setarray .@iteminfo,@inventorylist_id[.@k],@inventorylist_refine[.@k],@inventorylist_card1[.@k],@inventorylist_card2[.@k],@inventorylist_card3[.@k],@inventorylist_card4[.@k];
						setarray .@roid,@inventorylist_option_id1[.@k],@inventorylist_option_id2[.@k],@inventorylist_option_id3[.@k],@inventorylist_option_id4[.@k],@inventorylist_option_id5[.@k];
						setarray .@val,@inventorylist_option_value1[.@k],@inventorylist_option_value2[.@k],@inventorylist_option_value3[.@k],@inventorylist_option_value4[.@k],@inventorylist_option_value5[.@k];
						setarray .@par,@inventorylist_option_parameter1[.@k],@inventorylist_option_parameter2[.@k],@inventorylist_option_parameter3[.@k],@inventorylist_option_parameter4[.@k],@inventorylist_option_parameter5[.@k];
						.@bound = @inventorylist_bound[.@k];
					} else {
						@evolving = false;
					}
					if(@evolving) {
						.@evo_item = getd(".it_id_"+.@i+"_"+(.@j + 1));
						if(getarraysize(.@val)){
							delitem3 .@iteminfo[0],1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5],.@roid,.@val,.@par;
							if(.@bound)
								getitembound3 .@evo_item,1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5],Bound_Account,.@roid,.@val,.@par;
							else
								getitem3 .@evo_item,1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5],.@roid,.@val,.@par;
						} else {
							delitem2 .@iteminfo[0],1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5];
							if(.@bound)
								getitembound2 .@evo_item,1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5],Bound_Account;
							else
								getitem2 .@evo_item,1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5];
						}
						equip .@evo_item;
						setd "evo_"+.@item_id,0;
						deletearray @evo_var;
						announce "Parabéns!! Sua "+getitemname(.@item_id)+" evoluiu para "+getitemname(.@evo_item)+".",bc_self,"0x"+.c$[2];
						@evolving = false;
					}
				}
			}
		}
	}
	end;

	function	add_item	{

		for(.@args = getargcount();.@i < .@args;.@i+= 4) {
			.@j = .w2[.w1]++;
			setd ".it_id_"+.w1+"_"+.@j,getarg(.@i);	// id.
			if(getarg(.@i + 4,0) != 0) {
				setd ".it_mode_"+.w1+"_"+.@j,getarg(.@i + 1);	// mode.
				setd ".it_mob_"+.w1+"_"+.@j,getarg(.@i + 2);	// mob id.
				setd ".it_amt_"+.w1+"_"+.@j,getarg(.@i + 3);	// amount.
			}
		}
		.w1++;

	}

}

Sometimes weird characters appear when you edit something. IDK why.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  22
  • Topics Per Day:  0.01
  • Content Count:  109
  • Reputation:   5
  • Joined:  08/12/17
  • Last Seen:  

20 minutes ago, n0tttt said:

If the item is not really "repeatable", then you can look it by the id in the inarray. If it is, then we have to create an extra array with the EQP_* constants found in script_constants.hpp with the slots.


-	script	Extra_ItemConf	-1,{

	function add_item;

OnInit:

/*
	add_item(id, evolution mode, monster id, amount, id...);
	If  you want any monster, use 111.

Evolution modes:

	1 = Every X numer of mobs (1%).
	2 = Experience (1%).
*/


/* Adaga  */	add_item(13040,1, 111, 1, 1203, 1, 111, 5, 1206, 1, 111, 15, 1209, 1, 111, 25, 1212, 1, 111, 30, 1215, 1, 111, 60, 1218, 1, 111, 70, 1221, 1, 111, 80, 1222, 1, 111, 90, 13048, 1, 111, 150 ); // Adaga
/* 1HSword */	add_item(13415,1, 111, 1, 1103, 1, 111, 5, 1106, 1, 111, 15, 1109, 1, 111, 25, 1112, 1, 111, 30, 1115, 1, 111, 60, 1122, 1, 111, 70, 1123, 1, 111, 80, 1126, 1, 111, 90, 1121, 1, 111, 100, 1129, 1, 111, 125, 13422, 1, 111, 150 ); // Espada 1H
/* 2HSword */	add_item(1118, 1, 111, 5, 1153, 1, 111, 15, 1156, 1, 111, 25, 1160, 1, 111, 30, 1159, 1, 111, 60, 1163, 1, 111, 70, 1190, 1, 111, 100, 1188, 1, 111, 200 ); // Espada 2H
/* 2HAxe  */	add_item(1381, 1, 111, 1, 1353, 1, 111, 5, 1356, 1, 111, 15, 1359, 1, 111, 25, 1362, 1, 111, 30, 1388, 1, 111, 100, 1384, 1, 111, 200 ); // Machado 1H
/* Maces  */	add_item(1545, 1, 111, 1, 1503, 1, 111, 5, 1506, 1, 111, 15, 1509, 1, 111, 25, 1512, 1, 111, 30, 1521, 1, 111, 60, 1515, 1, 111, 70, 1518, 1, 111, 80, 1548, 1, 111, 200 ); // Maces 1H
/* Arcos  */	add_item(1742, 1, 111, 1, 1703, 1, 111, 5, 1706, 1, 111, 15, 1709, 1, 111, 25, 1712, 1, 111, 30, 1713, 1, 111, 60, 1714, 1, 111, 70, 1735, 1, 111, 80, 18128, 1, 111, 200 ); // Arcos
/* Cajados */	add_item(1639, 1, 111, 1, 1603, 1, 111, 5, 1606, 1, 111, 15, 1609, 1, 111, 25, 1612, 1, 111, 30, 1614, 1, 111, 60, 1615, 1, 111, 80, 1636, 1, 111, 100); // Cajados
/* 1HSpear */	add_item(1403, 1, 111,10, 1406, 1, 111,15, 1409, 1, 111, 30, 1430, 1, 111, 200);
/* 2HSpear */	add_item(1453, 1, 111,20, 1456, 1, 111,30, 1459, 1, 111, 40, 1462, 1, 111, 50, 1465, 1, 111, 70, 1412, 1, 111, 100);
/* Knuckles */	add_item(1801, 1, 111,20, 1803, 1, 111,30, 1805, 1, 111, 40, 1809, 1, 111, 50, 1811, 1, 111, 60, 1807, 1, 111, 70, 1814, 1, 111, 80, 1829, 1, 111, 100);
/* Violin */	add_item(1901, 1, 111,20, 1903, 1, 111,30, 1905, 1, 111, 40, 1909, 1, 111, 50, 1911, 1, 111, 60, 1907, 1, 111, 80, 1925, 1, 111,100, 1918, 1, 111, 150);
/* Whip */		add_item(1950, 1, 111,20, 1952, 1, 111,30, 1954, 1, 111, 40, 1958, 1, 111, 50, 1960, 1, 111, 60, 1958, 1, 111, 80, 1994, 1, 111,100);
/* Katar */		add_item(1264, 1, 111,20, 1262, 1, 111,30, 1295, 1, 111, 40, 1250, 1, 111, 50, 1252, 1, 111, 60, 1283, 1, 111, 100);
/* Debug  */	add_item(2301, 1, 111, 1, 2302, 1, 111, 2);

/*
	0 = Won't be evolved automatically.
	1 = Will be evolved automatically
*/
	.auto = 1;

/*
	Color of the announces.
*/
	setarray .c$[0],"ffffff",	// % of evolution.
			"03fd20",	// Wings evolving.
			"11f4cc";	// Wings evolved.

/* slots to check.
	EQI_ACC_L (0)             - Accessory 1
	EQI_ACC_R (1)             - Accessory 2
	EQI_SHOES (2)             - Footgear (shoes, boots)
	EQI_GARMENT (3)           - Garment (mufflers, hoods, manteaux)
	EQI_HEAD_LOW (4)          - Lower Headgear (beards, some masks)
	EQI_HEAD_MID (5)          - Middle Headgear (masks, glasses)
	EQI_HEAD_TOP (6)          - Upper Headgear
	EQI_ARMOR (7)             - Armor (jackets, robes)
	EQI_HAND_L (8)            - Left hand (weapons, shields)
	EQI_HAND_R (9)            - Right hand (weapons)
	EQI_COSTUME_HEAD_TOP (10) - Upper Costume Headgear
	EQI_COSTUME_HEAD_MID (11) - Middle Costume Headgear
	EQI_COSTUME_HEAD_LOW (12) - Lower Costume Headgear
	EQI_COSTUME_GARMENT (13)  - Costume Garment
	EQI_AMMO (14)             - Arrow/Ammunition
	EQI_SHADOW_ARMOR (15)     - Shadow Armor
	EQI_SHADOW_WEAPON (16)    - Shadow Weapon
	EQI_SHADOW_SHIELD (17)    - Shadow Shield
	EQI_SHADOW_SHOES (18)     - Shadow Shoes
	EQI_SHADOW_ACC_R (19)     - Shadow Accessory 2
	EQI_SHADOW_ACC_L (20)     - Shadow Accessory 1
*/

	setarray .slots[0],	/*EQI_HAND_R,*/
				EQI_HAND_L,
				EQI_ARMOR,
				EQI_SHOES,
				EQI_GARMENT;

	//=============================================

	end;

OnNPCKillEvent:

	if(!@evolving) {
		// Cache. That old loop on every mob killed...
		if(@evo_var[0] && isequipped(@evo_var[0])) {
			.@has_item = true;
			.@item_id = @evo_var[0];
			.@i = @evo_var[1] - 1;
			.@j = @evo_var[2] - 1;
			.@slot = @evo_var[3];
			.@mob_id = getd(".it_mob_"+.@i+"_"+.@j);
			if(killedrid != .@mob_id && .@mob_id > 1001)
				end;
		} else {
			.@size = getarraysize(.slots);
			while(.@slot < .@size && !.@has_item) {
				.@item_id = getequipid(.slots[.@slot]);
				.@slot++;
				if(.@item_id < 0)
					continue;
				.@i = 0;
				while(.@i < .w1 && !.@has_item) {
					.@j = 0;
					while(.@j < .w2[.@i] && !.@has_item) {
						.@item_evo = getd(".it_id_"+.@i+"_"+.@j);
						if(.@item_id == .@item_evo && getd(".it_id_"+.@i+"_"+(.@j + 1))) {
							.@mob_id = getd(".it_mob_"+.@i+"_"+.@j);
							if(killedrid == .@mob_id || .@mob_id < 1001) {
								.@has_item = true;
								setarray @evo_var[0],.@item_id,.@i + 1,.@j + 1,.@slot;
							}
						} else if(.@item_id == .@item_evo) {
							end;
						}
						if(!.@has_item)
							.@j++;
					}
					if(!.@has_item)
						.@i++;
				}
			}
		}
		if(.@has_item) {
			if(getd(".it_mode_"+.@i+"_"+.@j) == 1) {
				.@amount = getd("mobs_"+.@item_id) + 1;
				setd "mobs_"+.@item_id,.@amount;
				if(.@amount < getd(".it_amt_"+.@i+"_"+.@j)) end;
				setd "mobs_"+.@item_id,0;
			} else if(getd(".it_mode_"+.@i+"_"+.@j) == 2) {
				.@amount = getd("exp_"+.@item_id) + strmobinfo(6,killedrid);
				setd "exp_"+.@item_id,.@amount;
				if(.@amount < getd(".it_amt_"+.@i+"_"+.@j)) end;
				setd "exp_"+.@item_id,0;
			} else {
				debugmes "Script Items_Evo, error: wrong mode.";
				end;
			}
			specialeffect2 EF_BEGINSPELL6;
			sleep2 rand(190,280);
			specialeffect2 EF_ENERGYDRAIN3;
			.@percent = getd("evo_"+.@item_id);
			if(.@percent < 100) {
				setd "evo_"+.@item_id,++.@percent;
				announce getitemname(.@item_id)+": "+.@percent+"%.",bc_self,"0x"+.c$[0];
			}
			if(.@percent >= 100 && .auto && !@evolving) {
				@evolving = true;
				specialeffect2 EF_GUMGANG3;
				sleep2 500;
				specialeffect2 EF_BASH3D2;
				sleep2 300;
				specialeffect2 EF_BLUEBODY;
				sleep2 300;
				announce getitemname(.@item_id)+" está evoluindo...",bc_self,"0x"+.c$[1];
				.@k = 3;
				while(.@k--) {
					specialeffect2 EF_DOUBLECASTBODY;
					sleep2 900;
				}
				specialeffect2 EF_STORMKICK5;
				sleep2 200;
				specialeffect2 EF_BUBBLE_DROP;
				sleep2 500;
				getinventorylist;
				.@k = inarray(@inventorylist_id,.@item_id);
				if(.@k != -1) {
					if(!@inventorylist_expire[.@k]) {
						setarray .@iteminfo,@inventorylist_id[.@k],@inventorylist_refine[.@k],@inventorylist_card1[.@k],@inventorylist_card2[.@k],@inventorylist_card3[.@k],@inventorylist_card4[.@k];
						setarray .@roid,@inventorylist_option_id1[.@k],@inventorylist_option_id2[.@k],@inventorylist_option_id3[.@k],@inventorylist_option_id4[.@k],@inventorylist_option_id5[.@k];
						setarray .@val,@inventorylist_option_value1[.@k],@inventorylist_option_value2[.@k],@inventorylist_option_value3[.@k],@inventorylist_option_value4[.@k],@inventorylist_option_value5[.@k];
						setarray .@par,@inventorylist_option_parameter1[.@k],@inventorylist_option_parameter2[.@k],@inventorylist_option_parameter3[.@k],@inventorylist_option_parameter4[.@k],@inventorylist_option_parameter5[.@k];
						.@bound = @inventorylist_bound[.@k];
					} else {
						@evolving = false;
					}
					if(@evolving) {
						.@evo_item = getd(".it_id_"+.@i+"_"+(.@j + 1));
						if(getarraysize(.@val)){
							delitem3 .@iteminfo[0],1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5],.@roid,.@val,.@par;
							if(.@bound)
								getitembound3 .@evo_item,1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5],Bound_Account,.@roid,.@val,.@par;
							else
								getitem3 .@evo_item,1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5],.@roid,.@val,.@par;
						} else {
							delitem2 .@iteminfo[0],1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5];
							if(.@bound)
								getitembound2 .@evo_item,1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5],Bound_Account;
							else
								getitem2 .@evo_item,1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5];
						}
						equip .@evo_item;
						setd "evo_"+.@item_id,0;
						deletearray @evo_var;
						announce "Parabéns!! Sua "+getitemname(.@item_id)+" evoluiu para "+getitemname(.@evo_item)+".",bc_self,"0x"+.c$[2];
						@evolving = false;
					}
				}
			}
		}
	}
	end;

	function	add_item	{

		for(.@args = getargcount();.@i < .@args;.@i+= 4) {
			.@j = .w2[.w1]++;
			setd ".it_id_"+.w1+"_"+.@j,getarg(.@i);	// id.
			if(getarg(.@i + 4,0) != 0) {
				setd ".it_mode_"+.w1+"_"+.@j,getarg(.@i + 1);	// mode.
				setd ".it_mob_"+.w1+"_"+.@j,getarg(.@i + 2);	// mob id.
				setd ".it_amt_"+.w1+"_"+.@j,getarg(.@i + 3);	// amount.
			}
		}
		.w1++;

	}

}

Sometimes weird characters appear when you edit something. IDK why.

Ill test it soon. About characters i think its because UTF-8 / ANSI xD 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  22
  • Topics Per Day:  0.01
  • Content Count:  109
  • Reputation:   5
  • Joined:  08/12/17
  • Last Seen:  

On 1/6/2019 at 11:26 PM, n0tttt said:

If the item is not really "repeatable", then you can look it by the id in the inarray. If it is, then we have to create an extra array with the EQP_* constants found in script_constants.hpp with the slots.


-	script	Extra_ItemConf	-1,{

	function add_item;

OnInit:

/*
	add_item(id, evolution mode, monster id, amount, id...);
	If  you want any monster, use 111.

Evolution modes:

	1 = Every X numer of mobs (1%).
	2 = Experience (1%).
*/


/* Adaga  */	add_item(13040,1, 111, 1, 1203, 1, 111, 5, 1206, 1, 111, 15, 1209, 1, 111, 25, 1212, 1, 111, 30, 1215, 1, 111, 60, 1218, 1, 111, 70, 1221, 1, 111, 80, 1222, 1, 111, 90, 13048, 1, 111, 150 ); // Adaga
/* 1HSword */	add_item(13415,1, 111, 1, 1103, 1, 111, 5, 1106, 1, 111, 15, 1109, 1, 111, 25, 1112, 1, 111, 30, 1115, 1, 111, 60, 1122, 1, 111, 70, 1123, 1, 111, 80, 1126, 1, 111, 90, 1121, 1, 111, 100, 1129, 1, 111, 125, 13422, 1, 111, 150 ); // Espada 1H
/* 2HSword */	add_item(1118, 1, 111, 5, 1153, 1, 111, 15, 1156, 1, 111, 25, 1160, 1, 111, 30, 1159, 1, 111, 60, 1163, 1, 111, 70, 1190, 1, 111, 100, 1188, 1, 111, 200 ); // Espada 2H
/* 2HAxe  */	add_item(1381, 1, 111, 1, 1353, 1, 111, 5, 1356, 1, 111, 15, 1359, 1, 111, 25, 1362, 1, 111, 30, 1388, 1, 111, 100, 1384, 1, 111, 200 ); // Machado 1H
/* Maces  */	add_item(1545, 1, 111, 1, 1503, 1, 111, 5, 1506, 1, 111, 15, 1509, 1, 111, 25, 1512, 1, 111, 30, 1521, 1, 111, 60, 1515, 1, 111, 70, 1518, 1, 111, 80, 1548, 1, 111, 200 ); // Maces 1H
/* Arcos  */	add_item(1742, 1, 111, 1, 1703, 1, 111, 5, 1706, 1, 111, 15, 1709, 1, 111, 25, 1712, 1, 111, 30, 1713, 1, 111, 60, 1714, 1, 111, 70, 1735, 1, 111, 80, 18128, 1, 111, 200 ); // Arcos
/* Cajados */	add_item(1639, 1, 111, 1, 1603, 1, 111, 5, 1606, 1, 111, 15, 1609, 1, 111, 25, 1612, 1, 111, 30, 1614, 1, 111, 60, 1615, 1, 111, 80, 1636, 1, 111, 100); // Cajados
/* 1HSpear */	add_item(1403, 1, 111,10, 1406, 1, 111,15, 1409, 1, 111, 30, 1430, 1, 111, 200);
/* 2HSpear */	add_item(1453, 1, 111,20, 1456, 1, 111,30, 1459, 1, 111, 40, 1462, 1, 111, 50, 1465, 1, 111, 70, 1412, 1, 111, 100);
/* Knuckles */	add_item(1801, 1, 111,20, 1803, 1, 111,30, 1805, 1, 111, 40, 1809, 1, 111, 50, 1811, 1, 111, 60, 1807, 1, 111, 70, 1814, 1, 111, 80, 1829, 1, 111, 100);
/* Violin */	add_item(1901, 1, 111,20, 1903, 1, 111,30, 1905, 1, 111, 40, 1909, 1, 111, 50, 1911, 1, 111, 60, 1907, 1, 111, 80, 1925, 1, 111,100, 1918, 1, 111, 150);
/* Whip */		add_item(1950, 1, 111,20, 1952, 1, 111,30, 1954, 1, 111, 40, 1958, 1, 111, 50, 1960, 1, 111, 60, 1958, 1, 111, 80, 1994, 1, 111,100);
/* Katar */		add_item(1264, 1, 111,20, 1262, 1, 111,30, 1295, 1, 111, 40, 1250, 1, 111, 50, 1252, 1, 111, 60, 1283, 1, 111, 100);
/* Debug  */	add_item(2301, 1, 111, 1, 2302, 1, 111, 2);

/*
	0 = Won't be evolved automatically.
	1 = Will be evolved automatically
*/
	.auto = 1;

/*
	Color of the announces.
*/
	setarray .c$[0],"ffffff",	// % of evolution.
			"03fd20",	// Wings evolving.
			"11f4cc";	// Wings evolved.

/* slots to check.
	EQI_ACC_L (0)             - Accessory 1
	EQI_ACC_R (1)             - Accessory 2
	EQI_SHOES (2)             - Footgear (shoes, boots)
	EQI_GARMENT (3)           - Garment (mufflers, hoods, manteaux)
	EQI_HEAD_LOW (4)          - Lower Headgear (beards, some masks)
	EQI_HEAD_MID (5)          - Middle Headgear (masks, glasses)
	EQI_HEAD_TOP (6)          - Upper Headgear
	EQI_ARMOR (7)             - Armor (jackets, robes)
	EQI_HAND_L (8)            - Left hand (weapons, shields)
	EQI_HAND_R (9)            - Right hand (weapons)
	EQI_COSTUME_HEAD_TOP (10) - Upper Costume Headgear
	EQI_COSTUME_HEAD_MID (11) - Middle Costume Headgear
	EQI_COSTUME_HEAD_LOW (12) - Lower Costume Headgear
	EQI_COSTUME_GARMENT (13)  - Costume Garment
	EQI_AMMO (14)             - Arrow/Ammunition
	EQI_SHADOW_ARMOR (15)     - Shadow Armor
	EQI_SHADOW_WEAPON (16)    - Shadow Weapon
	EQI_SHADOW_SHIELD (17)    - Shadow Shield
	EQI_SHADOW_SHOES (18)     - Shadow Shoes
	EQI_SHADOW_ACC_R (19)     - Shadow Accessory 2
	EQI_SHADOW_ACC_L (20)     - Shadow Accessory 1
*/

	setarray .slots[0],	/*EQI_HAND_R,*/
				EQI_HAND_L,
				EQI_ARMOR,
				EQI_SHOES,
				EQI_GARMENT;

	//=============================================

	end;

OnNPCKillEvent:

	if(!@evolving) {
		// Cache. That old loop on every mob killed...
		if(@evo_var[0] && isequipped(@evo_var[0])) {
			.@has_item = true;
			.@item_id = @evo_var[0];
			.@i = @evo_var[1] - 1;
			.@j = @evo_var[2] - 1;
			.@slot = @evo_var[3];
			.@mob_id = getd(".it_mob_"+.@i+"_"+.@j);
			if(killedrid != .@mob_id && .@mob_id > 1001)
				end;
		} else {
			.@size = getarraysize(.slots);
			while(.@slot < .@size && !.@has_item) {
				.@item_id = getequipid(.slots[.@slot]);
				.@slot++;
				if(.@item_id < 0)
					continue;
				.@i = 0;
				while(.@i < .w1 && !.@has_item) {
					.@j = 0;
					while(.@j < .w2[.@i] && !.@has_item) {
						.@item_evo = getd(".it_id_"+.@i+"_"+.@j);
						if(.@item_id == .@item_evo && getd(".it_id_"+.@i+"_"+(.@j + 1))) {
							.@mob_id = getd(".it_mob_"+.@i+"_"+.@j);
							if(killedrid == .@mob_id || .@mob_id < 1001) {
								.@has_item = true;
								setarray @evo_var[0],.@item_id,.@i + 1,.@j + 1,.@slot;
							}
						} else if(.@item_id == .@item_evo) {
							end;
						}
						if(!.@has_item)
							.@j++;
					}
					if(!.@has_item)
						.@i++;
				}
			}
		}
		if(.@has_item) {
			if(getd(".it_mode_"+.@i+"_"+.@j) == 1) {
				.@amount = getd("mobs_"+.@item_id) + 1;
				setd "mobs_"+.@item_id,.@amount;
				if(.@amount < getd(".it_amt_"+.@i+"_"+.@j)) end;
				setd "mobs_"+.@item_id,0;
			} else if(getd(".it_mode_"+.@i+"_"+.@j) == 2) {
				.@amount = getd("exp_"+.@item_id) + strmobinfo(6,killedrid);
				setd "exp_"+.@item_id,.@amount;
				if(.@amount < getd(".it_amt_"+.@i+"_"+.@j)) end;
				setd "exp_"+.@item_id,0;
			} else {
				debugmes "Script Items_Evo, error: wrong mode.";
				end;
			}
			specialeffect2 EF_BEGINSPELL6;
			sleep2 rand(190,280);
			specialeffect2 EF_ENERGYDRAIN3;
			.@percent = getd("evo_"+.@item_id);
			if(.@percent < 100) {
				setd "evo_"+.@item_id,++.@percent;
				announce getitemname(.@item_id)+": "+.@percent+"%.",bc_self,"0x"+.c$[0];
			}
			if(.@percent >= 100 && .auto && !@evolving) {
				@evolving = true;
				specialeffect2 EF_GUMGANG3;
				sleep2 500;
				specialeffect2 EF_BASH3D2;
				sleep2 300;
				specialeffect2 EF_BLUEBODY;
				sleep2 300;
				announce getitemname(.@item_id)+" está evoluindo...",bc_self,"0x"+.c$[1];
				.@k = 3;
				while(.@k--) {
					specialeffect2 EF_DOUBLECASTBODY;
					sleep2 900;
				}
				specialeffect2 EF_STORMKICK5;
				sleep2 200;
				specialeffect2 EF_BUBBLE_DROP;
				sleep2 500;
				getinventorylist;
				.@k = inarray(@inventorylist_id,.@item_id);
				if(.@k != -1) {
					if(!@inventorylist_expire[.@k]) {
						setarray .@iteminfo,@inventorylist_id[.@k],@inventorylist_refine[.@k],@inventorylist_card1[.@k],@inventorylist_card2[.@k],@inventorylist_card3[.@k],@inventorylist_card4[.@k];
						setarray .@roid,@inventorylist_option_id1[.@k],@inventorylist_option_id2[.@k],@inventorylist_option_id3[.@k],@inventorylist_option_id4[.@k],@inventorylist_option_id5[.@k];
						setarray .@val,@inventorylist_option_value1[.@k],@inventorylist_option_value2[.@k],@inventorylist_option_value3[.@k],@inventorylist_option_value4[.@k],@inventorylist_option_value5[.@k];
						setarray .@par,@inventorylist_option_parameter1[.@k],@inventorylist_option_parameter2[.@k],@inventorylist_option_parameter3[.@k],@inventorylist_option_parameter4[.@k],@inventorylist_option_parameter5[.@k];
						.@bound = @inventorylist_bound[.@k];
					} else {
						@evolving = false;
					}
					if(@evolving) {
						.@evo_item = getd(".it_id_"+.@i+"_"+(.@j + 1));
						if(getarraysize(.@val)){
							delitem3 .@iteminfo[0],1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5],.@roid,.@val,.@par;
							if(.@bound)
								getitembound3 .@evo_item,1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5],Bound_Account,.@roid,.@val,.@par;
							else
								getitem3 .@evo_item,1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5],.@roid,.@val,.@par;
						} else {
							delitem2 .@iteminfo[0],1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5];
							if(.@bound)
								getitembound2 .@evo_item,1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5],Bound_Account;
							else
								getitem2 .@evo_item,1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5];
						}
						equip .@evo_item;
						setd "evo_"+.@item_id,0;
						deletearray @evo_var;
						announce "Parabéns!! Sua "+getitemname(.@item_id)+" evoluiu para "+getitemname(.@evo_item)+".",bc_self,"0x"+.c$[2];
						@evolving = false;
					}
				}
			}
		}
	}
	end;

	function	add_item	{

		for(.@args = getargcount();.@i < .@args;.@i+= 4) {
			.@j = .w2[.w1]++;
			setd ".it_id_"+.w1+"_"+.@j,getarg(.@i);	// id.
			if(getarg(.@i + 4,0) != 0) {
				setd ".it_mode_"+.w1+"_"+.@j,getarg(.@i + 1);	// mode.
				setd ".it_mob_"+.w1+"_"+.@j,getarg(.@i + 2);	// mob id.
				setd ".it_amt_"+.w1+"_"+.@j,getarg(.@i + 3);	// amount.
			}
		}
		.w1++;

	}

}

Sometimes weird characters appear when you edit something. IDK why.

Ya, its working but i noticed the script cant evolve more than 1 item at same time (double dagger sin for example or an armor + weapon) lol 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  303
  • Reputation:   117
  • Joined:  12/10/16
  • Last Seen:  

Yeah, the script isn't coded like that. Based on the names, it was made with wings in mind. It would require a bigger change to make it do that. But does it work right for your needs now, or do you really need that feature?

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  22
  • Topics Per Day:  0.01
  • Content Count:  109
  • Reputation:   5
  • Joined:  08/12/17
  • Last Seen:  

7 hours ago, n0tttt said:

Yeah, the script isn't coded like that. Based on the names, it was made with wings in mind. It would require a bigger change to make it do that. But does it work right for your needs now, or do you really need that feature?

Yeah, ill really need that feature. I can imagine a way to do that but probably ill mess everything xD

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  303
  • Reputation:   117
  • Joined:  12/10/16
  • Last Seen:  

I tried. Tell me if it works.

-	script	Extra_ItemConf	-1,{

	function add_item;

OnInit:

/*
	add_item(id, evolution mode, monster id, amount, id...);
	If  you want any monster, use 111.

Evolution modes:

	1 = Every X numer of mobs (1%).
	2 = Experience (1%).
*/


/* Adaga  */	add_item(13040,1, 111, 1, 1203, 1, 111, 5, 1206, 1, 111, 15, 1209, 1, 111, 25, 1212, 1, 111, 30, 1215, 1, 111, 60, 1218, 1, 111, 70, 1221, 1, 111, 80, 1222, 1, 111, 90, 13048, 1, 111, 150 ); // Adaga
/* 1HSword */	add_item(13415,1, 111, 1, 1103, 1, 111, 5, 1106, 1, 111, 15, 1109, 1, 111, 25, 1112, 1, 111, 30, 1115, 1, 111, 60, 1122, 1, 111, 70, 1123, 1, 111, 80, 1126, 1, 111, 90, 1121, 1, 111, 100, 1129, 1, 111, 125, 13422, 1, 111, 150 ); // Espada 1H
/* 2HSword */	add_item(1118, 1, 111, 5, 1153, 1, 111, 15, 1156, 1, 111, 25, 1160, 1, 111, 30, 1159, 1, 111, 60, 1163, 1, 111, 70, 1190, 1, 111, 100, 1188, 1, 111, 200 ); // Espada 2H
/* 2HAxe  */	add_item(1381, 1, 111, 1, 1353, 1, 111, 5, 1356, 1, 111, 15, 1359, 1, 111, 25, 1362, 1, 111, 30, 1388, 1, 111, 100, 1384, 1, 111, 200 ); // Machado 1H
/* Maces  */	add_item(1545, 1, 111, 1, 1503, 1, 111, 5, 1506, 1, 111, 15, 1509, 1, 111, 25, 1512, 1, 111, 30, 1521, 1, 111, 60, 1515, 1, 111, 70, 1518, 1, 111, 80, 1548, 1, 111, 200 ); // Maces 1H
/* Arcos  */	add_item(1742, 1, 111, 1, 1703, 1, 111, 5, 1706, 1, 111, 15, 1709, 1, 111, 25, 1712, 1, 111, 30, 1713, 1, 111, 60, 1714, 1, 111, 70, 1735, 1, 111, 80, 18128, 1, 111, 200 ); // Arcos
/* Cajados */	add_item(1639, 1, 111, 1, 1603, 1, 111, 5, 1606, 1, 111, 15, 1609, 1, 111, 25, 1612, 1, 111, 30, 1614, 1, 111, 60, 1615, 1, 111, 80, 1636, 1, 111, 100); // Cajados
/* 1HSpear */	add_item(1403, 1, 111,10, 1406, 1, 111,15, 1409, 1, 111, 30, 1430, 1, 111, 200);
/* 2HSpear */	add_item(1453, 1, 111,20, 1456, 1, 111,30, 1459, 1, 111, 40, 1462, 1, 111, 50, 1465, 1, 111, 70, 1412, 1, 111, 100);
/* Knuckles */	add_item(1801, 1, 111,20, 1803, 1, 111,30, 1805, 1, 111, 40, 1809, 1, 111, 50, 1811, 1, 111, 60, 1807, 1, 111, 70, 1814, 1, 111, 80, 1829, 1, 111, 100);
/* Violin */	add_item(1901, 1, 111,20, 1903, 1, 111,30, 1905, 1, 111, 40, 1909, 1, 111, 50, 1911, 1, 111, 60, 1907, 1, 111, 80, 1925, 1, 111,100, 1918, 1, 111, 150);
/* Whip */		add_item(1950, 1, 111,20, 1952, 1, 111,30, 1954, 1, 111, 40, 1958, 1, 111, 50, 1960, 1, 111, 60, 1958, 1, 111, 80, 1994, 1, 111,100);
/* Katar */		add_item(1264, 1, 111,20, 1262, 1, 111,30, 1295, 1, 111, 40, 1250, 1, 111, 50, 1252, 1, 111, 60, 1283, 1, 111, 100);
/* Debug  */	add_item(2301, 1, 111, 1, 2302, 1, 111, 2);

/*
	0 = Won't be evolved automatically.
	1 = Will be evolved automatically
*/
	.auto = 1;

/*
	Color of the announces.
*/
	setarray .c$[0],"ffffff",	// % of evolution.
			"03fd20",	// Wings evolving.
			"11f4cc";	// Wings evolved.

/* slots to check.
	EQI_ACC_L (0)             - Accessory 1
	EQI_ACC_R (1)             - Accessory 2
	EQI_SHOES (2)             - Footgear (shoes, boots)
	EQI_GARMENT (3)           - Garment (mufflers, hoods, manteaux)
	EQI_HEAD_LOW (4)          - Lower Headgear (beards, some masks)
	EQI_HEAD_MID (5)          - Middle Headgear (masks, glasses)
	EQI_HEAD_TOP (6)          - Upper Headgear
	EQI_ARMOR (7)             - Armor (jackets, robes)
	EQI_HAND_L (8)            - Left hand (weapons, shields)
	EQI_HAND_R (9)            - Right hand (weapons)
	EQI_COSTUME_HEAD_TOP (10) - Upper Costume Headgear
	EQI_COSTUME_HEAD_MID (11) - Middle Costume Headgear
	EQI_COSTUME_HEAD_LOW (12) - Lower Costume Headgear
	EQI_COSTUME_GARMENT (13)  - Costume Garment
	EQI_AMMO (14)             - Arrow/Ammunition
	EQI_SHADOW_ARMOR (15)     - Shadow Armor
	EQI_SHADOW_WEAPON (16)    - Shadow Weapon
	EQI_SHADOW_SHIELD (17)    - Shadow Shield
	EQI_SHADOW_SHOES (18)     - Shadow Shoes
	EQI_SHADOW_ACC_R (19)     - Shadow Accessory 2
	EQI_SHADOW_ACC_L (20)     - Shadow Accessory 1
*/

	setarray .slots[0],	/*EQI_HAND_R,*/
				EQI_HAND_L,
				EQI_ARMOR,
				EQI_SHOES,
				EQI_GARMENT;

	//=============================================

	end;

OnNPCKillEvent:

	.@size = getarraysize(.slots);
	while(.@slot < .@size) {
		.@item_id = getequipid(.slots[.@slot]);
		.@slot++;
		if(.@item_id < 0)
			continue;
		.@i = 0;
		while(.@i < .w1) {
			.@j = 0;
			.@has_item = false;
			while(.@j < .w2[.@i] && !.@has_item) {
				.@item_evo = getd(".it_id_"+.@i+"_"+.@j);
				if(.@item_id == .@item_evo && getd(".it_id_"+.@i+"_"+(.@j + 1))) {
					.@mob_id = getd(".it_mob_"+.@i+"_"+.@j);
					if(killedrid == .@mob_id || .@mob_id < 1001) {
						if(getd(".it_mode_"+.@i+"_"+.@j) == 1) {
							.@amount = getd("mobs_"+.@item_id) + 1;
							setd "mobs_"+.@item_id,.@amount;
							if(.@amount < getd(".it_amt_"+.@i+"_"+.@j)) continue;
							setd "mobs_"+.@item_id,0;
						} else {
							.@amount = getd("exp_"+.@item_id) + strmobinfo(6,killedrid);
							setd "exp_"+.@item_id,.@amount;
							if(.@amount < getd(".it_amt_"+.@i+"_"+.@j)) continue;
							setd "exp_"+.@item_id,0;
						}
						specialeffect2 EF_BEGINSPELL6;
						sleep2 rand(190,280);
						specialeffect2 EF_ENERGYDRAIN3;
						.@percent = getd("evo_"+.@item_id);
						if(.@percent < 100) {
							setd "evo_"+.@item_id,++.@percent;
							announce getitemname(.@item_id)+": "+.@percent+"%.",bc_self,"0x"+.c$[0];
						}
						if(.@percent >= 100 && .auto) {
							specialeffect2 EF_GUMGANG3;
							sleep2 500;
							specialeffect2 EF_BASH3D2;
							sleep2 300;
							specialeffect2 EF_BLUEBODY;
							sleep2 300;
							announce getitemname(.@item_id)+" está evoluindo...",bc_self,"0x"+.c$[1];
							.@k = 3;
							while(.@k--) {
								specialeffect2 EF_DOUBLECASTBODY;
								sleep2 900;
							}
							specialeffect2 EF_STORMKICK5;
							sleep2 200;
							specialeffect2 EF_BUBBLE_DROP;
							sleep2 500;
							if(!.@inventory) {
								getinventorylist;
								.@inventory = true;
							}
							.@k = inarray(@inventorylist_id,.@item_id);
							if(.@k != -1) {
								if(!@inventorylist_expire[.@k]) {
									setarray .@iteminfo[0],@inventorylist_id[.@k],@inventorylist_refine[.@k],@inventorylist_card1[.@k],@inventorylist_card2[.@k],@inventorylist_card3[.@k],@inventorylist_card4[.@k];
									setarray .@roid[0],@inventorylist_option_id1[.@k],@inventorylist_option_id2[.@k],@inventorylist_option_id3[.@k],@inventorylist_option_id4[.@k],@inventorylist_option_id5[.@k];
									setarray .@val[0],@inventorylist_option_value1[.@k],@inventorylist_option_value2[.@k],@inventorylist_option_value3[.@k],@inventorylist_option_value4[.@k],@inventorylist_option_value5[.@k];
									setarray .@par[0],@inventorylist_option_parameter1[.@k],@inventorylist_option_parameter2[.@k],@inventorylist_option_parameter3[.@k],@inventorylist_option_parameter4[.@k],@inventorylist_option_parameter5[.@k];
									.@bound = @inventorylist_bound[.@k];
								} else {
									continue;
								}
								.@evo_item = getd(".it_id_"+.@i+"_"+(.@j + 1));
								if(getarraysize(.@val)){
									delitem3 .@iteminfo[0],1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5],.@roid,.@val,.@par;
									if(.@bound)
										getitembound3 .@evo_item,1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5],Bound_Account,.@roid,.@val,.@par;
									else
										getitem3 .@evo_item,1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5],.@roid,.@val,.@par;
								} else {
									delitem2 .@iteminfo[0],1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5];
									if(.@bound)
										getitembound2 .@evo_item,1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5],Bound_Account;
									else
										getitem2 .@evo_item,1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5];
								}
								equip .@evo_item;
								setd "evo_"+.@item_id,0;
								announce "Parabéns!! Sua "+getitemname(.@item_id)+" evoluiu para "+getitemname(.@evo_item)+".",bc_self,"0x"+.c$[2];
							}
							.@has_item = true;
						} else if(.@item_id == .@item_evo) {
							continue;
						}
					}
				}
				.@j++;
			}
			.@i++;
		}
	}
	end;

	function	add_item	{

		for(.@args = getargcount();.@i < .@args;.@i+= 4) {
			.@j = .w2[.w1]++;
			setd ".it_id_"+.w1+"_"+.@j,getarg(.@i);	// id.
			if(getarg(.@i + 4,0) != 0) {
				setd ".it_mode_"+.w1+"_"+.@j,getarg(.@i + 1);	// mode.
				setd ".it_mob_"+.w1+"_"+.@j,getarg(.@i + 2);	// mob id.
				setd ".it_amt_"+.w1+"_"+.@j,getarg(.@i + 3);	// amount.
			}
		}
		.w1++;

	}

}

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  22
  • Topics Per Day:  0.01
  • Content Count:  109
  • Reputation:   5
  • Joined:  08/12/17
  • Last Seen:  

9 hours ago, n0tttt said:

I tried. Tell me if it works.


-	script	Extra_ItemConf	-1,{

	function add_item;

OnInit:

/*
	add_item(id, evolution mode, monster id, amount, id...);
	If  you want any monster, use 111.

Evolution modes:

	1 = Every X numer of mobs (1%).
	2 = Experience (1%).
*/


/* Adaga  */	add_item(13040,1, 111, 1, 1203, 1, 111, 5, 1206, 1, 111, 15, 1209, 1, 111, 25, 1212, 1, 111, 30, 1215, 1, 111, 60, 1218, 1, 111, 70, 1221, 1, 111, 80, 1222, 1, 111, 90, 13048, 1, 111, 150 ); // Adaga
/* 1HSword */	add_item(13415,1, 111, 1, 1103, 1, 111, 5, 1106, 1, 111, 15, 1109, 1, 111, 25, 1112, 1, 111, 30, 1115, 1, 111, 60, 1122, 1, 111, 70, 1123, 1, 111, 80, 1126, 1, 111, 90, 1121, 1, 111, 100, 1129, 1, 111, 125, 13422, 1, 111, 150 ); // Espada 1H
/* 2HSword */	add_item(1118, 1, 111, 5, 1153, 1, 111, 15, 1156, 1, 111, 25, 1160, 1, 111, 30, 1159, 1, 111, 60, 1163, 1, 111, 70, 1190, 1, 111, 100, 1188, 1, 111, 200 ); // Espada 2H
/* 2HAxe  */	add_item(1381, 1, 111, 1, 1353, 1, 111, 5, 1356, 1, 111, 15, 1359, 1, 111, 25, 1362, 1, 111, 30, 1388, 1, 111, 100, 1384, 1, 111, 200 ); // Machado 1H
/* Maces  */	add_item(1545, 1, 111, 1, 1503, 1, 111, 5, 1506, 1, 111, 15, 1509, 1, 111, 25, 1512, 1, 111, 30, 1521, 1, 111, 60, 1515, 1, 111, 70, 1518, 1, 111, 80, 1548, 1, 111, 200 ); // Maces 1H
/* Arcos  */	add_item(1742, 1, 111, 1, 1703, 1, 111, 5, 1706, 1, 111, 15, 1709, 1, 111, 25, 1712, 1, 111, 30, 1713, 1, 111, 60, 1714, 1, 111, 70, 1735, 1, 111, 80, 18128, 1, 111, 200 ); // Arcos
/* Cajados */	add_item(1639, 1, 111, 1, 1603, 1, 111, 5, 1606, 1, 111, 15, 1609, 1, 111, 25, 1612, 1, 111, 30, 1614, 1, 111, 60, 1615, 1, 111, 80, 1636, 1, 111, 100); // Cajados
/* 1HSpear */	add_item(1403, 1, 111,10, 1406, 1, 111,15, 1409, 1, 111, 30, 1430, 1, 111, 200);
/* 2HSpear */	add_item(1453, 1, 111,20, 1456, 1, 111,30, 1459, 1, 111, 40, 1462, 1, 111, 50, 1465, 1, 111, 70, 1412, 1, 111, 100);
/* Knuckles */	add_item(1801, 1, 111,20, 1803, 1, 111,30, 1805, 1, 111, 40, 1809, 1, 111, 50, 1811, 1, 111, 60, 1807, 1, 111, 70, 1814, 1, 111, 80, 1829, 1, 111, 100);
/* Violin */	add_item(1901, 1, 111,20, 1903, 1, 111,30, 1905, 1, 111, 40, 1909, 1, 111, 50, 1911, 1, 111, 60, 1907, 1, 111, 80, 1925, 1, 111,100, 1918, 1, 111, 150);
/* Whip */		add_item(1950, 1, 111,20, 1952, 1, 111,30, 1954, 1, 111, 40, 1958, 1, 111, 50, 1960, 1, 111, 60, 1958, 1, 111, 80, 1994, 1, 111,100);
/* Katar */		add_item(1264, 1, 111,20, 1262, 1, 111,30, 1295, 1, 111, 40, 1250, 1, 111, 50, 1252, 1, 111, 60, 1283, 1, 111, 100);
/* Debug  */	add_item(2301, 1, 111, 1, 2302, 1, 111, 2);

/*
	0 = Won't be evolved automatically.
	1 = Will be evolved automatically
*/
	.auto = 1;

/*
	Color of the announces.
*/
	setarray .c$[0],"ffffff",	// % of evolution.
			"03fd20",	// Wings evolving.
			"11f4cc";	// Wings evolved.

/* slots to check.
	EQI_ACC_L (0)             - Accessory 1
	EQI_ACC_R (1)             - Accessory 2
	EQI_SHOES (2)             - Footgear (shoes, boots)
	EQI_GARMENT (3)           - Garment (mufflers, hoods, manteaux)
	EQI_HEAD_LOW (4)          - Lower Headgear (beards, some masks)
	EQI_HEAD_MID (5)          - Middle Headgear (masks, glasses)
	EQI_HEAD_TOP (6)          - Upper Headgear
	EQI_ARMOR (7)             - Armor (jackets, robes)
	EQI_HAND_L (8)            - Left hand (weapons, shields)
	EQI_HAND_R (9)            - Right hand (weapons)
	EQI_COSTUME_HEAD_TOP (10) - Upper Costume Headgear
	EQI_COSTUME_HEAD_MID (11) - Middle Costume Headgear
	EQI_COSTUME_HEAD_LOW (12) - Lower Costume Headgear
	EQI_COSTUME_GARMENT (13)  - Costume Garment
	EQI_AMMO (14)             - Arrow/Ammunition
	EQI_SHADOW_ARMOR (15)     - Shadow Armor
	EQI_SHADOW_WEAPON (16)    - Shadow Weapon
	EQI_SHADOW_SHIELD (17)    - Shadow Shield
	EQI_SHADOW_SHOES (18)     - Shadow Shoes
	EQI_SHADOW_ACC_R (19)     - Shadow Accessory 2
	EQI_SHADOW_ACC_L (20)     - Shadow Accessory 1
*/

	setarray .slots[0],	/*EQI_HAND_R,*/
				EQI_HAND_L,
				EQI_ARMOR,
				EQI_SHOES,
				EQI_GARMENT;

	//=============================================

	end;

OnNPCKillEvent:

	.@size = getarraysize(.slots);
	while(.@slot < .@size) {
		.@item_id = getequipid(.slots[.@slot]);
		.@slot++;
		if(.@item_id < 0)
			continue;
		.@i = 0;
		while(.@i < .w1) {
			.@j = 0;
			.@has_item = false;
			while(.@j < .w2[.@i] && !.@has_item) {
				.@item_evo = getd(".it_id_"+.@i+"_"+.@j);
				if(.@item_id == .@item_evo && getd(".it_id_"+.@i+"_"+(.@j + 1))) {
					.@mob_id = getd(".it_mob_"+.@i+"_"+.@j);
					if(killedrid == .@mob_id || .@mob_id < 1001) {
						if(getd(".it_mode_"+.@i+"_"+.@j) == 1) {
							.@amount = getd("mobs_"+.@item_id) + 1;
							setd "mobs_"+.@item_id,.@amount;
							if(.@amount < getd(".it_amt_"+.@i+"_"+.@j)) continue;
							setd "mobs_"+.@item_id,0;
						} else {
							.@amount = getd("exp_"+.@item_id) + strmobinfo(6,killedrid);
							setd "exp_"+.@item_id,.@amount;
							if(.@amount < getd(".it_amt_"+.@i+"_"+.@j)) continue;
							setd "exp_"+.@item_id,0;
						}
						specialeffect2 EF_BEGINSPELL6;
						sleep2 rand(190,280);
						specialeffect2 EF_ENERGYDRAIN3;
						.@percent = getd("evo_"+.@item_id);
						if(.@percent < 100) {
							setd "evo_"+.@item_id,++.@percent;
							announce getitemname(.@item_id)+": "+.@percent+"%.",bc_self,"0x"+.c$[0];
						}
						if(.@percent >= 100 && .auto) {
							specialeffect2 EF_GUMGANG3;
							sleep2 500;
							specialeffect2 EF_BASH3D2;
							sleep2 300;
							specialeffect2 EF_BLUEBODY;
							sleep2 300;
							announce getitemname(.@item_id)+" está evoluindo...",bc_self,"0x"+.c$[1];
							.@k = 3;
							while(.@k--) {
								specialeffect2 EF_DOUBLECASTBODY;
								sleep2 900;
							}
							specialeffect2 EF_STORMKICK5;
							sleep2 200;
							specialeffect2 EF_BUBBLE_DROP;
							sleep2 500;
							if(!.@inventory) {
								getinventorylist;
								.@inventory = true;
							}
							.@k = inarray(@inventorylist_id,.@item_id);
							if(.@k != -1) {
								if(!@inventorylist_expire[.@k]) {
									setarray .@iteminfo[0],@inventorylist_id[.@k],@inventorylist_refine[.@k],@inventorylist_card1[.@k],@inventorylist_card2[.@k],@inventorylist_card3[.@k],@inventorylist_card4[.@k];
									setarray .@roid[0],@inventorylist_option_id1[.@k],@inventorylist_option_id2[.@k],@inventorylist_option_id3[.@k],@inventorylist_option_id4[.@k],@inventorylist_option_id5[.@k];
									setarray .@val[0],@inventorylist_option_value1[.@k],@inventorylist_option_value2[.@k],@inventorylist_option_value3[.@k],@inventorylist_option_value4[.@k],@inventorylist_option_value5[.@k];
									setarray .@par[0],@inventorylist_option_parameter1[.@k],@inventorylist_option_parameter2[.@k],@inventorylist_option_parameter3[.@k],@inventorylist_option_parameter4[.@k],@inventorylist_option_parameter5[.@k];
									.@bound = @inventorylist_bound[.@k];
								} else {
									continue;
								}
								.@evo_item = getd(".it_id_"+.@i+"_"+(.@j + 1));
								if(getarraysize(.@val)){
									delitem3 .@iteminfo[0],1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5],.@roid,.@val,.@par;
									if(.@bound)
										getitembound3 .@evo_item,1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5],Bound_Account,.@roid,.@val,.@par;
									else
										getitem3 .@evo_item,1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5],.@roid,.@val,.@par;
								} else {
									delitem2 .@iteminfo[0],1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5];
									if(.@bound)
										getitembound2 .@evo_item,1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5],Bound_Account;
									else
										getitem2 .@evo_item,1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5];
								}
								equip .@evo_item;
								setd "evo_"+.@item_id,0;
								announce "Parabéns!! Sua "+getitemname(.@item_id)+" evoluiu para "+getitemname(.@evo_item)+".",bc_self,"0x"+.c$[2];
							}
							.@has_item = true;
						} else if(.@item_id == .@item_evo) {
							continue;
						}
					}
				}
				.@j++;
			}
			.@i++;
		}
	}
	end;

	function	add_item	{

		for(.@args = getargcount();.@i < .@args;.@i+= 4) {
			.@j = .w2[.w1]++;
			setd ".it_id_"+.w1+"_"+.@j,getarg(.@i);	// id.
			if(getarg(.@i + 4,0) != 0) {
				setd ".it_mode_"+.w1+"_"+.@j,getarg(.@i + 1);	// mode.
				setd ".it_mob_"+.w1+"_"+.@j,getarg(.@i + 2);	// mob id.
				setd ".it_amt_"+.w1+"_"+.@j,getarg(.@i + 3);	// amount.
			}
		}
		.w1++;

	}

}

 

it worked but theres a big bug ... all itens share the % and when i kill only 1 mob everything evolve at same time xD

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  303
  • Reputation:   117
  • Joined:  12/10/16
  • Last Seen:  

Okay this is the first script but I only edited an "end" when an item reached its max evolution. It should continue looking for another item in your inventory to evolve.

-	script	Extra_ItemConf	-1,{

	function add_item;

OnInit:

/*
	add_item(id, evolution mode, monster id, amount, id...);
	If  you want any monster, use 111.

Evolution modes:

	1 = Every X numer of mobs (1%).
	2 = Experience (1%).
*/


/* Adaga  */	add_item(13040,1, 111, 1, 1203, 1, 111, 5, 1206, 1, 111, 15, 1209, 1, 111, 25, 1212, 1, 111, 30, 1215, 1, 111, 60, 1218, 1, 111, 70, 1221, 1, 111, 80, 1222, 1, 111, 90, 13048, 1, 111, 150 ); // Adaga
/* 1HSword */	add_item(13415,1, 111, 1, 1103, 1, 111, 5, 1106, 1, 111, 15, 1109, 1, 111, 25, 1112, 1, 111, 30, 1115, 1, 111, 60, 1122, 1, 111, 70, 1123, 1, 111, 80, 1126, 1, 111, 90, 1121, 1, 111, 100, 1129, 1, 111, 125, 13422, 1, 111, 150 ); // Espada 1H
/* 2HSword */	add_item(1118, 1, 111, 5, 1153, 1, 111, 15, 1156, 1, 111, 25, 1160, 1, 111, 30, 1159, 1, 111, 60, 1163, 1, 111, 70, 1190, 1, 111, 100, 1188, 1, 111, 200 ); // Espada 2H
/* 2HAxe  */	add_item(1381, 1, 111, 1, 1353, 1, 111, 5, 1356, 1, 111, 15, 1359, 1, 111, 25, 1362, 1, 111, 30, 1388, 1, 111, 100, 1384, 1, 111, 200 ); // Machado 1H
/* Maces  */	add_item(1545, 1, 111, 1, 1503, 1, 111, 5, 1506, 1, 111, 15, 1509, 1, 111, 25, 1512, 1, 111, 30, 1521, 1, 111, 60, 1515, 1, 111, 70, 1518, 1, 111, 80, 1548, 1, 111, 200 ); // Maces 1H
/* Arcos  */	add_item(1742, 1, 111, 1, 1703, 1, 111, 5, 1706, 1, 111, 15, 1709, 1, 111, 25, 1712, 1, 111, 30, 1713, 1, 111, 60, 1714, 1, 111, 70, 1735, 1, 111, 80, 18128, 1, 111, 200 ); // Arcos
/* Cajados */	add_item(1639, 1, 111, 1, 1603, 1, 111, 5, 1606, 1, 111, 15, 1609, 1, 111, 25, 1612, 1, 111, 30, 1614, 1, 111, 60, 1615, 1, 111, 80, 1636, 1, 111, 100); // Cajados
/* 1HSpear */	add_item(1403, 1, 111,10, 1406, 1, 111,15, 1409, 1, 111, 30, 1430, 1, 111, 200);
/* 2HSpear */	add_item(1453, 1, 111,20, 1456, 1, 111,30, 1459, 1, 111, 40, 1462, 1, 111, 50, 1465, 1, 111, 70, 1412, 1, 111, 100);
/* Knuckles */	add_item(1801, 1, 111,20, 1803, 1, 111,30, 1805, 1, 111, 40, 1809, 1, 111, 50, 1811, 1, 111, 60, 1807, 1, 111, 70, 1814, 1, 111, 80, 1829, 1, 111, 100);
/* Violin */	add_item(1901, 1, 111,20, 1903, 1, 111,30, 1905, 1, 111, 40, 1909, 1, 111, 50, 1911, 1, 111, 60, 1907, 1, 111, 80, 1925, 1, 111,100, 1918, 1, 111, 150);
/* Whip */		add_item(1950, 1, 111,20, 1952, 1, 111,30, 1954, 1, 111, 40, 1958, 1, 111, 50, 1960, 1, 111, 60, 1958, 1, 111, 80, 1994, 1, 111,100);
/* Katar */		add_item(1264, 1, 111,20, 1262, 1, 111,30, 1295, 1, 111, 40, 1250, 1, 111, 50, 1252, 1, 111, 60, 1283, 1, 111, 100);
/* Debug  */	add_item(2301, 1, 111, 1, 2302, 1, 111, 2);

/*
	0 = Won't be evolved automatically.
	1 = Will be evolved automatically
*/
	.auto = 1;

/*
	Color of the announces.
*/
	setarray .c$[0],"ffffff",	// % of evolution.
			"03fd20",	// Wings evolving.
			"11f4cc";	// Wings evolved.

/* slots to check.
	EQI_ACC_L (0)             - Accessory 1
	EQI_ACC_R (1)             - Accessory 2
	EQI_SHOES (2)             - Footgear (shoes, boots)
	EQI_GARMENT (3)           - Garment (mufflers, hoods, manteaux)
	EQI_HEAD_LOW (4)          - Lower Headgear (beards, some masks)
	EQI_HEAD_MID (5)          - Middle Headgear (masks, glasses)
	EQI_HEAD_TOP (6)          - Upper Headgear
	EQI_ARMOR (7)             - Armor (jackets, robes)
	EQI_HAND_L (8)            - Left hand (weapons, shields)
	EQI_HAND_R (9)            - Right hand (weapons)
	EQI_COSTUME_HEAD_TOP (10) - Upper Costume Headgear
	EQI_COSTUME_HEAD_MID (11) - Middle Costume Headgear
	EQI_COSTUME_HEAD_LOW (12) - Lower Costume Headgear
	EQI_COSTUME_GARMENT (13)  - Costume Garment
	EQI_AMMO (14)             - Arrow/Ammunition
	EQI_SHADOW_ARMOR (15)     - Shadow Armor
	EQI_SHADOW_WEAPON (16)    - Shadow Weapon
	EQI_SHADOW_SHIELD (17)    - Shadow Shield
	EQI_SHADOW_SHOES (18)     - Shadow Shoes
	EQI_SHADOW_ACC_R (19)     - Shadow Accessory 2
	EQI_SHADOW_ACC_L (20)     - Shadow Accessory 1
*/

	setarray .slots[0],	/*EQI_HAND_R,*/
				EQI_HAND_L,
				EQI_ARMOR,
				EQI_SHOES,
				EQI_GARMENT;

	//=============================================

	end;

OnNPCKillEvent:

	if(!@evolving) {
		// Cache. That old loop on every mob killed...
		if(@evo_var[0] && isequipped(@evo_var[0])) {
			.@has_item = true;
			.@item_id = @evo_var[0];
			.@i = @evo_var[1] - 1;
			.@j = @evo_var[2] - 1;
			.@slot = @evo_var[3];
			.@mob_id = getd(".it_mob_"+.@i+"_"+.@j);
			if(killedrid != .@mob_id && .@mob_id > 1001)
				end;
		} else {
			.@size = getarraysize(.slots);
			while(.@slot < .@size && !.@has_item) {
				.@item_id = getequipid(.slots[.@slot]);
				.@slot++;
				if(.@item_id < 0)
					continue;
				.@i = 0;
				while(.@i < .w1 && !.@has_item) {
					.@j = 0;
					while(.@j < .w2[.@i] && !.@has_item) {
						.@item_evo = getd(".it_id_"+.@i+"_"+.@j);
						if(.@item_id == .@item_evo && getd(".it_id_"+.@i+"_"+(.@j + 1))) {
							.@mob_id = getd(".it_mob_"+.@i+"_"+.@j);
							if(killedrid == .@mob_id || .@mob_id < 1001) {
								.@has_item = true;
								setarray @evo_var[0],.@item_id,.@i + 1,.@j + 1,.@slot;
							}
						} else if(.@item_id == .@item_evo) {
							.@j = .w2[.@i];
						}
						if(!.@has_item)
							.@j++;
					}
					if(!.@has_item)
						.@i++;
				}
			}
		}
		if(.@has_item) {
			if(getd(".it_mode_"+.@i+"_"+.@j) == 1) {
				.@amount = getd("mobs_"+.@item_id) + 1;
				setd "mobs_"+.@item_id,.@amount;
				if(.@amount < getd(".it_amt_"+.@i+"_"+.@j)) end;
				setd "mobs_"+.@item_id,0;
			} else {
				.@amount = getd("exp_"+.@item_id) + strmobinfo(6,killedrid);
				setd "exp_"+.@item_id,.@amount;
				if(.@amount < getd(".it_amt_"+.@i+"_"+.@j)) end;
				setd "exp_"+.@item_id,0;
			}
			specialeffect2 EF_BEGINSPELL6;
			sleep2 rand(190,280);
			specialeffect2 EF_ENERGYDRAIN3;
			.@percent = getd("evo_"+.@item_id);
			if(.@percent < 100) {
				setd "evo_"+.@item_id,++.@percent;
				announce getitemname(.@item_id)+": "+.@percent+"%.",bc_self,"0x"+.c$[0];
			}
			if(.@percent >= 100 && .auto && !@evolving) {
				@evolving = true;
				specialeffect2 EF_GUMGANG3;
				sleep2 500;
				specialeffect2 EF_BASH3D2;
				sleep2 300;
				specialeffect2 EF_BLUEBODY;
				sleep2 300;
				announce getitemname(.@item_id)+" está evoluindo...",bc_self,"0x"+.c$[1];
				.@k = 3;
				while(.@k--) {
					specialeffect2 EF_DOUBLECASTBODY;
					sleep2 900;
				}
				specialeffect2 EF_STORMKICK5;
				sleep2 200;
				specialeffect2 EF_BUBBLE_DROP;
				sleep2 500;
				getinventorylist;
				.@k = inarray(@inventorylist_id,.@item_id);
				if(.@k != -1) {
					if(!@inventorylist_expire[.@k]) {
						setarray .@iteminfo,@inventorylist_id[.@k],@inventorylist_refine[.@k],@inventorylist_card1[.@k],@inventorylist_card2[.@k],@inventorylist_card3[.@k],@inventorylist_card4[.@k];
						setarray .@roid,@inventorylist_option_id1[.@k],@inventorylist_option_id2[.@k],@inventorylist_option_id3[.@k],@inventorylist_option_id4[.@k],@inventorylist_option_id5[.@k];
						setarray .@val,@inventorylist_option_value1[.@k],@inventorylist_option_value2[.@k],@inventorylist_option_value3[.@k],@inventorylist_option_value4[.@k],@inventorylist_option_value5[.@k];
						setarray .@par,@inventorylist_option_parameter1[.@k],@inventorylist_option_parameter2[.@k],@inventorylist_option_parameter3[.@k],@inventorylist_option_parameter4[.@k],@inventorylist_option_parameter5[.@k];
						.@bound = @inventorylist_bound[.@k];
					} else {
						@evolving = false;
					}
					if(@evolving) {
						.@evo_item = getd(".it_id_"+.@i+"_"+(.@j + 1));
						if(getarraysize(.@val)){
							delitem3 .@iteminfo[0],1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5],.@roid,.@val,.@par;
							if(.@bound)
								getitembound3 .@evo_item,1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5],Bound_Account,.@roid,.@val,.@par;
							else
								getitem3 .@evo_item,1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5],.@roid,.@val,.@par;
						} else {
							delitem2 .@iteminfo[0],1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5];
							if(.@bound)
								getitembound2 .@evo_item,1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5],Bound_Account;
							else
								getitem2 .@evo_item,1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5];
						}
						equip .@evo_item;
						setd "evo_"+.@item_id,0;
						deletearray @evo_var;
						announce "Parabéns!! Sua "+getitemname(.@item_id)+" evoluiu para "+getitemname(.@evo_item)+".",bc_self,"0x"+.c$[2];
						@evolving = false;
					}
				}
			}
		}
	}
	end;

	function	add_item	{

		for(.@args = getargcount();.@i < .@args;.@i+= 4) {
			.@j = .w2[.w1]++;
			setd ".it_id_"+.w1+"_"+.@j,getarg(.@i);	// id.
			if(getarg(.@i + 4,0) != 0) {
				setd ".it_mode_"+.w1+"_"+.@j,getarg(.@i + 1);	// mode.
				setd ".it_mob_"+.w1+"_"+.@j,getarg(.@i + 2);	// mob id.
				setd ".it_amt_"+.w1+"_"+.@j,getarg(.@i + 3);	// amount.
			}
		}
		.w1++;

	}

}

And now this is the second one. I only added a variable to prevent multiprocessing issues.

-	script	Extra_ItemConf	-1,{

	function add_item;

OnInit:

/*
	add_item(id, evolution mode, monster id, amount, id...);
	If  you want any monster, use 111.

Evolution modes:

	1 = Every X numer of mobs (1%).
	2 = Experience (1%).
*/


/* Adaga  */	add_item(13040,1, 111, 1, 1203, 1, 111, 5, 1206, 1, 111, 15, 1209, 1, 111, 25, 1212, 1, 111, 30, 1215, 1, 111, 60, 1218, 1, 111, 70, 1221, 1, 111, 80, 1222, 1, 111, 90, 13048, 1, 111, 150 ); // Adaga
/* 1HSword */	add_item(13415,1, 111, 1, 1103, 1, 111, 5, 1106, 1, 111, 15, 1109, 1, 111, 25, 1112, 1, 111, 30, 1115, 1, 111, 60, 1122, 1, 111, 70, 1123, 1, 111, 80, 1126, 1, 111, 90, 1121, 1, 111, 100, 1129, 1, 111, 125, 13422, 1, 111, 150 ); // Espada 1H
/* 2HSword */	add_item(1118, 1, 111, 5, 1153, 1, 111, 15, 1156, 1, 111, 25, 1160, 1, 111, 30, 1159, 1, 111, 60, 1163, 1, 111, 70, 1190, 1, 111, 100, 1188, 1, 111, 200 ); // Espada 2H
/* 2HAxe  */	add_item(1381, 1, 111, 1, 1353, 1, 111, 5, 1356, 1, 111, 15, 1359, 1, 111, 25, 1362, 1, 111, 30, 1388, 1, 111, 100, 1384, 1, 111, 200 ); // Machado 1H
/* Maces  */	add_item(1545, 1, 111, 1, 1503, 1, 111, 5, 1506, 1, 111, 15, 1509, 1, 111, 25, 1512, 1, 111, 30, 1521, 1, 111, 60, 1515, 1, 111, 70, 1518, 1, 111, 80, 1548, 1, 111, 200 ); // Maces 1H
/* Arcos  */	add_item(1742, 1, 111, 1, 1703, 1, 111, 5, 1706, 1, 111, 15, 1709, 1, 111, 25, 1712, 1, 111, 30, 1713, 1, 111, 60, 1714, 1, 111, 70, 1735, 1, 111, 80, 18128, 1, 111, 200 ); // Arcos
/* Cajados */	add_item(1639, 1, 111, 1, 1603, 1, 111, 5, 1606, 1, 111, 15, 1609, 1, 111, 25, 1612, 1, 111, 30, 1614, 1, 111, 60, 1615, 1, 111, 80, 1636, 1, 111, 100); // Cajados
/* 1HSpear */	add_item(1403, 1, 111,10, 1406, 1, 111,15, 1409, 1, 111, 30, 1430, 1, 111, 200);
/* 2HSpear */	add_item(1453, 1, 111,20, 1456, 1, 111,30, 1459, 1, 111, 40, 1462, 1, 111, 50, 1465, 1, 111, 70, 1412, 1, 111, 100);
/* Knuckles */	add_item(1801, 1, 111,20, 1803, 1, 111,30, 1805, 1, 111, 40, 1809, 1, 111, 50, 1811, 1, 111, 60, 1807, 1, 111, 70, 1814, 1, 111, 80, 1829, 1, 111, 100);
/* Violin */	add_item(1901, 1, 111,20, 1903, 1, 111,30, 1905, 1, 111, 40, 1909, 1, 111, 50, 1911, 1, 111, 60, 1907, 1, 111, 80, 1925, 1, 111,100, 1918, 1, 111, 150);
/* Whip */		add_item(1950, 1, 111,20, 1952, 1, 111,30, 1954, 1, 111, 40, 1958, 1, 111, 50, 1960, 1, 111, 60, 1958, 1, 111, 80, 1994, 1, 111,100);
/* Katar */		add_item(1264, 1, 111,20, 1262, 1, 111,30, 1295, 1, 111, 40, 1250, 1, 111, 50, 1252, 1, 111, 60, 1283, 1, 111, 100);
/* Debug  */	add_item(2301, 1, 111, 1, 2302, 1, 111, 2);

/*
	0 = Won't be evolved automatically.
	1 = Will be evolved automatically
*/
	.auto = 1;

/*
	Color of the announces.
*/
	setarray .c$[0],"ffffff",	// % of evolution.
			"03fd20",	// Wings evolving.
			"11f4cc";	// Wings evolved.

/* slots to check.
	EQI_ACC_L (0)             - Accessory 1
	EQI_ACC_R (1)             - Accessory 2
	EQI_SHOES (2)             - Footgear (shoes, boots)
	EQI_GARMENT (3)           - Garment (mufflers, hoods, manteaux)
	EQI_HEAD_LOW (4)          - Lower Headgear (beards, some masks)
	EQI_HEAD_MID (5)          - Middle Headgear (masks, glasses)
	EQI_HEAD_TOP (6)          - Upper Headgear
	EQI_ARMOR (7)             - Armor (jackets, robes)
	EQI_HAND_L (8)            - Left hand (weapons, shields)
	EQI_HAND_R (9)            - Right hand (weapons)
	EQI_COSTUME_HEAD_TOP (10) - Upper Costume Headgear
	EQI_COSTUME_HEAD_MID (11) - Middle Costume Headgear
	EQI_COSTUME_HEAD_LOW (12) - Lower Costume Headgear
	EQI_COSTUME_GARMENT (13)  - Costume Garment
	EQI_AMMO (14)             - Arrow/Ammunition
	EQI_SHADOW_ARMOR (15)     - Shadow Armor
	EQI_SHADOW_WEAPON (16)    - Shadow Weapon
	EQI_SHADOW_SHIELD (17)    - Shadow Shield
	EQI_SHADOW_SHOES (18)     - Shadow Shoes
	EQI_SHADOW_ACC_R (19)     - Shadow Accessory 2
	EQI_SHADOW_ACC_L (20)     - Shadow Accessory 1
*/

	setarray .slots[0],	/*EQI_HAND_R,*/
				EQI_HAND_L,
				EQI_ARMOR,
				EQI_SHOES,
				EQI_GARMENT;

	//=============================================

	end;

OnNPCKillEvent:

	if(@evolve_inuse)
		end;
	@evolve_inuse = true;
	.@size = getarraysize(.slots);
	while(.@slot < .@size) {
		.@item_id = getequipid(.slots[.@slot]);
		.@slot++;
		if(.@item_id < 0)
			continue;
		.@i = 0;
		while(.@i < .w1) {
			.@j = 0;
			.@has_item = false;
			while(.@j < .w2[.@i] && !.@has_item) {
				.@item_evo = getd(".it_id_"+.@i+"_"+.@j);
				if(.@item_id == .@item_evo && getd(".it_id_"+.@i+"_"+(.@j + 1))) {
					.@mob_id = getd(".it_mob_"+.@i+"_"+.@j);
					if(killedrid == .@mob_id || .@mob_id < 1001) {
						if(getd(".it_mode_"+.@i+"_"+.@j) == 1) {
							.@amount = getd("mobs_"+.@item_id) + 1;
							setd "mobs_"+.@item_id,.@amount;
							if(.@amount < getd(".it_amt_"+.@i+"_"+.@j)) continue;
							setd "mobs_"+.@item_id,0;
						} else {
							.@amount = getd("exp_"+.@item_id) + strmobinfo(6,killedrid);
							setd "exp_"+.@item_id,.@amount;
							if(.@amount < getd(".it_amt_"+.@i+"_"+.@j)) continue;
							setd "exp_"+.@item_id,0;
						}
						specialeffect2 EF_BEGINSPELL6;
						sleep2 rand(190,280);
						specialeffect2 EF_ENERGYDRAIN3;
						.@percent = getd("evo_"+.@item_id);
						if(.@percent < 100) {
							setd "evo_"+.@item_id,++.@percent;
							announce getitemname(.@item_id)+": "+.@percent+"%.",bc_self,"0x"+.c$[0];
						}
						if(.@percent >= 100 && .auto) {
							specialeffect2 EF_GUMGANG3;
							sleep2 500;
							specialeffect2 EF_BASH3D2;
							sleep2 300;
							specialeffect2 EF_BLUEBODY;
							sleep2 300;
							announce getitemname(.@item_id)+" está evoluindo...",bc_self,"0x"+.c$[1];
							.@k = 3;
							while(.@k--) {
								specialeffect2 EF_DOUBLECASTBODY;
								sleep2 900;
							}
							specialeffect2 EF_STORMKICK5;
							sleep2 200;
							specialeffect2 EF_BUBBLE_DROP;
							sleep2 500;
							if(!.@inventory) {
								getinventorylist;
								.@inventory = true;
							}
							.@k = inarray(@inventorylist_id,.@item_id);
							if(.@k != -1) {
								if(!@inventorylist_expire[.@k]) {
									setarray .@iteminfo[0],@inventorylist_id[.@k],@inventorylist_refine[.@k],@inventorylist_card1[.@k],@inventorylist_card2[.@k],@inventorylist_card3[.@k],@inventorylist_card4[.@k];
									setarray .@roid[0],@inventorylist_option_id1[.@k],@inventorylist_option_id2[.@k],@inventorylist_option_id3[.@k],@inventorylist_option_id4[.@k],@inventorylist_option_id5[.@k];
									setarray .@val[0],@inventorylist_option_value1[.@k],@inventorylist_option_value2[.@k],@inventorylist_option_value3[.@k],@inventorylist_option_value4[.@k],@inventorylist_option_value5[.@k];
									setarray .@par[0],@inventorylist_option_parameter1[.@k],@inventorylist_option_parameter2[.@k],@inventorylist_option_parameter3[.@k],@inventorylist_option_parameter4[.@k],@inventorylist_option_parameter5[.@k];
									.@bound = @inventorylist_bound[.@k];
								} else {
									continue;
								}
								.@evo_item = getd(".it_id_"+.@i+"_"+(.@j + 1));
								if(getarraysize(.@val)){
									delitem3 .@iteminfo[0],1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5],.@roid,.@val,.@par;
									if(.@bound)
										getitembound3 .@evo_item,1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5],Bound_Account,.@roid,.@val,.@par;
									else
										getitem3 .@evo_item,1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5],.@roid,.@val,.@par;
								} else {
									delitem2 .@iteminfo[0],1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5];
									if(.@bound)
										getitembound2 .@evo_item,1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5],Bound_Account;
									else
										getitem2 .@evo_item,1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5];
								}
								equip .@evo_item;
								setd "evo_"+.@item_id,0;
								announce "Parabéns!! Sua "+getitemname(.@item_id)+" evoluiu para "+getitemname(.@evo_item)+".",bc_self,"0x"+.c$[2];
							}
							.@has_item = true;
						} else if(.@item_id == .@item_evo) {
							.@j = .w2[.@i];
						}
					}
				}
				.@j++;
			}
			.@i++;
		}
	}
	@evolve_inuse = false;
	end;

	function	add_item	{

		for(.@args = getargcount();.@i < .@args;.@i+= 4) {
			.@j = .w2[.w1]++;
			setd ".it_id_"+.w1+"_"+.@j,getarg(.@i);	// id.
			if(getarg(.@i + 4,0) != 0) {
				setd ".it_mode_"+.w1+"_"+.@j,getarg(.@i + 1);	// mode.
				setd ".it_mob_"+.w1+"_"+.@j,getarg(.@i + 2);	// mob id.
				setd ".it_amt_"+.w1+"_"+.@j,getarg(.@i + 3);	// amount.
			}
		}
		.w1++;

	}

}

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  22
  • Topics Per Day:  0.01
  • Content Count:  109
  • Reputation:   5
  • Joined:  08/12/17
  • Last Seen:  

14 hours ago, n0tttt said:

Okay this is the first script but I only edited an "end" when an item reached its max evolution. It should continue looking for another item in your inventory to evolve.


-	script	Extra_ItemConf	-1,{

	function add_item;

OnInit:

/*
	add_item(id, evolution mode, monster id, amount, id...);
	If  you want any monster, use 111.

Evolution modes:

	1 = Every X numer of mobs (1%).
	2 = Experience (1%).
*/


/* Adaga  */	add_item(13040,1, 111, 1, 1203, 1, 111, 5, 1206, 1, 111, 15, 1209, 1, 111, 25, 1212, 1, 111, 30, 1215, 1, 111, 60, 1218, 1, 111, 70, 1221, 1, 111, 80, 1222, 1, 111, 90, 13048, 1, 111, 150 ); // Adaga
/* 1HSword */	add_item(13415,1, 111, 1, 1103, 1, 111, 5, 1106, 1, 111, 15, 1109, 1, 111, 25, 1112, 1, 111, 30, 1115, 1, 111, 60, 1122, 1, 111, 70, 1123, 1, 111, 80, 1126, 1, 111, 90, 1121, 1, 111, 100, 1129, 1, 111, 125, 13422, 1, 111, 150 ); // Espada 1H
/* 2HSword */	add_item(1118, 1, 111, 5, 1153, 1, 111, 15, 1156, 1, 111, 25, 1160, 1, 111, 30, 1159, 1, 111, 60, 1163, 1, 111, 70, 1190, 1, 111, 100, 1188, 1, 111, 200 ); // Espada 2H
/* 2HAxe  */	add_item(1381, 1, 111, 1, 1353, 1, 111, 5, 1356, 1, 111, 15, 1359, 1, 111, 25, 1362, 1, 111, 30, 1388, 1, 111, 100, 1384, 1, 111, 200 ); // Machado 1H
/* Maces  */	add_item(1545, 1, 111, 1, 1503, 1, 111, 5, 1506, 1, 111, 15, 1509, 1, 111, 25, 1512, 1, 111, 30, 1521, 1, 111, 60, 1515, 1, 111, 70, 1518, 1, 111, 80, 1548, 1, 111, 200 ); // Maces 1H
/* Arcos  */	add_item(1742, 1, 111, 1, 1703, 1, 111, 5, 1706, 1, 111, 15, 1709, 1, 111, 25, 1712, 1, 111, 30, 1713, 1, 111, 60, 1714, 1, 111, 70, 1735, 1, 111, 80, 18128, 1, 111, 200 ); // Arcos
/* Cajados */	add_item(1639, 1, 111, 1, 1603, 1, 111, 5, 1606, 1, 111, 15, 1609, 1, 111, 25, 1612, 1, 111, 30, 1614, 1, 111, 60, 1615, 1, 111, 80, 1636, 1, 111, 100); // Cajados
/* 1HSpear */	add_item(1403, 1, 111,10, 1406, 1, 111,15, 1409, 1, 111, 30, 1430, 1, 111, 200);
/* 2HSpear */	add_item(1453, 1, 111,20, 1456, 1, 111,30, 1459, 1, 111, 40, 1462, 1, 111, 50, 1465, 1, 111, 70, 1412, 1, 111, 100);
/* Knuckles */	add_item(1801, 1, 111,20, 1803, 1, 111,30, 1805, 1, 111, 40, 1809, 1, 111, 50, 1811, 1, 111, 60, 1807, 1, 111, 70, 1814, 1, 111, 80, 1829, 1, 111, 100);
/* Violin */	add_item(1901, 1, 111,20, 1903, 1, 111,30, 1905, 1, 111, 40, 1909, 1, 111, 50, 1911, 1, 111, 60, 1907, 1, 111, 80, 1925, 1, 111,100, 1918, 1, 111, 150);
/* Whip */		add_item(1950, 1, 111,20, 1952, 1, 111,30, 1954, 1, 111, 40, 1958, 1, 111, 50, 1960, 1, 111, 60, 1958, 1, 111, 80, 1994, 1, 111,100);
/* Katar */		add_item(1264, 1, 111,20, 1262, 1, 111,30, 1295, 1, 111, 40, 1250, 1, 111, 50, 1252, 1, 111, 60, 1283, 1, 111, 100);
/* Debug  */	add_item(2301, 1, 111, 1, 2302, 1, 111, 2);

/*
	0 = Won't be evolved automatically.
	1 = Will be evolved automatically
*/
	.auto = 1;

/*
	Color of the announces.
*/
	setarray .c$[0],"ffffff",	// % of evolution.
			"03fd20",	// Wings evolving.
			"11f4cc";	// Wings evolved.

/* slots to check.
	EQI_ACC_L (0)             - Accessory 1
	EQI_ACC_R (1)             - Accessory 2
	EQI_SHOES (2)             - Footgear (shoes, boots)
	EQI_GARMENT (3)           - Garment (mufflers, hoods, manteaux)
	EQI_HEAD_LOW (4)          - Lower Headgear (beards, some masks)
	EQI_HEAD_MID (5)          - Middle Headgear (masks, glasses)
	EQI_HEAD_TOP (6)          - Upper Headgear
	EQI_ARMOR (7)             - Armor (jackets, robes)
	EQI_HAND_L (8)            - Left hand (weapons, shields)
	EQI_HAND_R (9)            - Right hand (weapons)
	EQI_COSTUME_HEAD_TOP (10) - Upper Costume Headgear
	EQI_COSTUME_HEAD_MID (11) - Middle Costume Headgear
	EQI_COSTUME_HEAD_LOW (12) - Lower Costume Headgear
	EQI_COSTUME_GARMENT (13)  - Costume Garment
	EQI_AMMO (14)             - Arrow/Ammunition
	EQI_SHADOW_ARMOR (15)     - Shadow Armor
	EQI_SHADOW_WEAPON (16)    - Shadow Weapon
	EQI_SHADOW_SHIELD (17)    - Shadow Shield
	EQI_SHADOW_SHOES (18)     - Shadow Shoes
	EQI_SHADOW_ACC_R (19)     - Shadow Accessory 2
	EQI_SHADOW_ACC_L (20)     - Shadow Accessory 1
*/

	setarray .slots[0],	/*EQI_HAND_R,*/
				EQI_HAND_L,
				EQI_ARMOR,
				EQI_SHOES,
				EQI_GARMENT;

	//=============================================

	end;

OnNPCKillEvent:

	if(!@evolving) {
		// Cache. That old loop on every mob killed...
		if(@evo_var[0] && isequipped(@evo_var[0])) {
			.@has_item = true;
			.@item_id = @evo_var[0];
			.@i = @evo_var[1] - 1;
			.@j = @evo_var[2] - 1;
			.@slot = @evo_var[3];
			.@mob_id = getd(".it_mob_"+.@i+"_"+.@j);
			if(killedrid != .@mob_id && .@mob_id > 1001)
				end;
		} else {
			.@size = getarraysize(.slots);
			while(.@slot < .@size && !.@has_item) {
				.@item_id = getequipid(.slots[.@slot]);
				.@slot++;
				if(.@item_id < 0)
					continue;
				.@i = 0;
				while(.@i < .w1 && !.@has_item) {
					.@j = 0;
					while(.@j < .w2[.@i] && !.@has_item) {
						.@item_evo = getd(".it_id_"+.@i+"_"+.@j);
						if(.@item_id == .@item_evo && getd(".it_id_"+.@i+"_"+(.@j + 1))) {
							.@mob_id = getd(".it_mob_"+.@i+"_"+.@j);
							if(killedrid == .@mob_id || .@mob_id < 1001) {
								.@has_item = true;
								setarray @evo_var[0],.@item_id,.@i + 1,.@j + 1,.@slot;
							}
						} else if(.@item_id == .@item_evo) {
							.@j = .w2[.@i];
						}
						if(!.@has_item)
							.@j++;
					}
					if(!.@has_item)
						.@i++;
				}
			}
		}
		if(.@has_item) {
			if(getd(".it_mode_"+.@i+"_"+.@j) == 1) {
				.@amount = getd("mobs_"+.@item_id) + 1;
				setd "mobs_"+.@item_id,.@amount;
				if(.@amount < getd(".it_amt_"+.@i+"_"+.@j)) end;
				setd "mobs_"+.@item_id,0;
			} else {
				.@amount = getd("exp_"+.@item_id) + strmobinfo(6,killedrid);
				setd "exp_"+.@item_id,.@amount;
				if(.@amount < getd(".it_amt_"+.@i+"_"+.@j)) end;
				setd "exp_"+.@item_id,0;
			}
			specialeffect2 EF_BEGINSPELL6;
			sleep2 rand(190,280);
			specialeffect2 EF_ENERGYDRAIN3;
			.@percent = getd("evo_"+.@item_id);
			if(.@percent < 100) {
				setd "evo_"+.@item_id,++.@percent;
				announce getitemname(.@item_id)+": "+.@percent+"%.",bc_self,"0x"+.c$[0];
			}
			if(.@percent >= 100 && .auto && !@evolving) {
				@evolving = true;
				specialeffect2 EF_GUMGANG3;
				sleep2 500;
				specialeffect2 EF_BASH3D2;
				sleep2 300;
				specialeffect2 EF_BLUEBODY;
				sleep2 300;
				announce getitemname(.@item_id)+" está evoluindo...",bc_self,"0x"+.c$[1];
				.@k = 3;
				while(.@k--) {
					specialeffect2 EF_DOUBLECASTBODY;
					sleep2 900;
				}
				specialeffect2 EF_STORMKICK5;
				sleep2 200;
				specialeffect2 EF_BUBBLE_DROP;
				sleep2 500;
				getinventorylist;
				.@k = inarray(@inventorylist_id,.@item_id);
				if(.@k != -1) {
					if(!@inventorylist_expire[.@k]) {
						setarray .@iteminfo,@inventorylist_id[.@k],@inventorylist_refine[.@k],@inventorylist_card1[.@k],@inventorylist_card2[.@k],@inventorylist_card3[.@k],@inventorylist_card4[.@k];
						setarray .@roid,@inventorylist_option_id1[.@k],@inventorylist_option_id2[.@k],@inventorylist_option_id3[.@k],@inventorylist_option_id4[.@k],@inventorylist_option_id5[.@k];
						setarray .@val,@inventorylist_option_value1[.@k],@inventorylist_option_value2[.@k],@inventorylist_option_value3[.@k],@inventorylist_option_value4[.@k],@inventorylist_option_value5[.@k];
						setarray .@par,@inventorylist_option_parameter1[.@k],@inventorylist_option_parameter2[.@k],@inventorylist_option_parameter3[.@k],@inventorylist_option_parameter4[.@k],@inventorylist_option_parameter5[.@k];
						.@bound = @inventorylist_bound[.@k];
					} else {
						@evolving = false;
					}
					if(@evolving) {
						.@evo_item = getd(".it_id_"+.@i+"_"+(.@j + 1));
						if(getarraysize(.@val)){
							delitem3 .@iteminfo[0],1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5],.@roid,.@val,.@par;
							if(.@bound)
								getitembound3 .@evo_item,1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5],Bound_Account,.@roid,.@val,.@par;
							else
								getitem3 .@evo_item,1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5],.@roid,.@val,.@par;
						} else {
							delitem2 .@iteminfo[0],1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5];
							if(.@bound)
								getitembound2 .@evo_item,1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5],Bound_Account;
							else
								getitem2 .@evo_item,1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5];
						}
						equip .@evo_item;
						setd "evo_"+.@item_id,0;
						deletearray @evo_var;
						announce "Parabéns!! Sua "+getitemname(.@item_id)+" evoluiu para "+getitemname(.@evo_item)+".",bc_self,"0x"+.c$[2];
						@evolving = false;
					}
				}
			}
		}
	}
	end;

	function	add_item	{

		for(.@args = getargcount();.@i < .@args;.@i+= 4) {
			.@j = .w2[.w1]++;
			setd ".it_id_"+.w1+"_"+.@j,getarg(.@i);	// id.
			if(getarg(.@i + 4,0) != 0) {
				setd ".it_mode_"+.w1+"_"+.@j,getarg(.@i + 1);	// mode.
				setd ".it_mob_"+.w1+"_"+.@j,getarg(.@i + 2);	// mob id.
				setd ".it_amt_"+.w1+"_"+.@j,getarg(.@i + 3);	// amount.
			}
		}
		.w1++;

	}

}

And now this is the second one. I only added a variable to prevent multiprocessing issues.


-	script	Extra_ItemConf	-1,{

	function add_item;

OnInit:

/*
	add_item(id, evolution mode, monster id, amount, id...);
	If  you want any monster, use 111.

Evolution modes:

	1 = Every X numer of mobs (1%).
	2 = Experience (1%).
*/


/* Adaga  */	add_item(13040,1, 111, 1, 1203, 1, 111, 5, 1206, 1, 111, 15, 1209, 1, 111, 25, 1212, 1, 111, 30, 1215, 1, 111, 60, 1218, 1, 111, 70, 1221, 1, 111, 80, 1222, 1, 111, 90, 13048, 1, 111, 150 ); // Adaga
/* 1HSword */	add_item(13415,1, 111, 1, 1103, 1, 111, 5, 1106, 1, 111, 15, 1109, 1, 111, 25, 1112, 1, 111, 30, 1115, 1, 111, 60, 1122, 1, 111, 70, 1123, 1, 111, 80, 1126, 1, 111, 90, 1121, 1, 111, 100, 1129, 1, 111, 125, 13422, 1, 111, 150 ); // Espada 1H
/* 2HSword */	add_item(1118, 1, 111, 5, 1153, 1, 111, 15, 1156, 1, 111, 25, 1160, 1, 111, 30, 1159, 1, 111, 60, 1163, 1, 111, 70, 1190, 1, 111, 100, 1188, 1, 111, 200 ); // Espada 2H
/* 2HAxe  */	add_item(1381, 1, 111, 1, 1353, 1, 111, 5, 1356, 1, 111, 15, 1359, 1, 111, 25, 1362, 1, 111, 30, 1388, 1, 111, 100, 1384, 1, 111, 200 ); // Machado 1H
/* Maces  */	add_item(1545, 1, 111, 1, 1503, 1, 111, 5, 1506, 1, 111, 15, 1509, 1, 111, 25, 1512, 1, 111, 30, 1521, 1, 111, 60, 1515, 1, 111, 70, 1518, 1, 111, 80, 1548, 1, 111, 200 ); // Maces 1H
/* Arcos  */	add_item(1742, 1, 111, 1, 1703, 1, 111, 5, 1706, 1, 111, 15, 1709, 1, 111, 25, 1712, 1, 111, 30, 1713, 1, 111, 60, 1714, 1, 111, 70, 1735, 1, 111, 80, 18128, 1, 111, 200 ); // Arcos
/* Cajados */	add_item(1639, 1, 111, 1, 1603, 1, 111, 5, 1606, 1, 111, 15, 1609, 1, 111, 25, 1612, 1, 111, 30, 1614, 1, 111, 60, 1615, 1, 111, 80, 1636, 1, 111, 100); // Cajados
/* 1HSpear */	add_item(1403, 1, 111,10, 1406, 1, 111,15, 1409, 1, 111, 30, 1430, 1, 111, 200);
/* 2HSpear */	add_item(1453, 1, 111,20, 1456, 1, 111,30, 1459, 1, 111, 40, 1462, 1, 111, 50, 1465, 1, 111, 70, 1412, 1, 111, 100);
/* Knuckles */	add_item(1801, 1, 111,20, 1803, 1, 111,30, 1805, 1, 111, 40, 1809, 1, 111, 50, 1811, 1, 111, 60, 1807, 1, 111, 70, 1814, 1, 111, 80, 1829, 1, 111, 100);
/* Violin */	add_item(1901, 1, 111,20, 1903, 1, 111,30, 1905, 1, 111, 40, 1909, 1, 111, 50, 1911, 1, 111, 60, 1907, 1, 111, 80, 1925, 1, 111,100, 1918, 1, 111, 150);
/* Whip */		add_item(1950, 1, 111,20, 1952, 1, 111,30, 1954, 1, 111, 40, 1958, 1, 111, 50, 1960, 1, 111, 60, 1958, 1, 111, 80, 1994, 1, 111,100);
/* Katar */		add_item(1264, 1, 111,20, 1262, 1, 111,30, 1295, 1, 111, 40, 1250, 1, 111, 50, 1252, 1, 111, 60, 1283, 1, 111, 100);
/* Debug  */	add_item(2301, 1, 111, 1, 2302, 1, 111, 2);

/*
	0 = Won't be evolved automatically.
	1 = Will be evolved automatically
*/
	.auto = 1;

/*
	Color of the announces.
*/
	setarray .c$[0],"ffffff",	// % of evolution.
			"03fd20",	// Wings evolving.
			"11f4cc";	// Wings evolved.

/* slots to check.
	EQI_ACC_L (0)             - Accessory 1
	EQI_ACC_R (1)             - Accessory 2
	EQI_SHOES (2)             - Footgear (shoes, boots)
	EQI_GARMENT (3)           - Garment (mufflers, hoods, manteaux)
	EQI_HEAD_LOW (4)          - Lower Headgear (beards, some masks)
	EQI_HEAD_MID (5)          - Middle Headgear (masks, glasses)
	EQI_HEAD_TOP (6)          - Upper Headgear
	EQI_ARMOR (7)             - Armor (jackets, robes)
	EQI_HAND_L (8)            - Left hand (weapons, shields)
	EQI_HAND_R (9)            - Right hand (weapons)
	EQI_COSTUME_HEAD_TOP (10) - Upper Costume Headgear
	EQI_COSTUME_HEAD_MID (11) - Middle Costume Headgear
	EQI_COSTUME_HEAD_LOW (12) - Lower Costume Headgear
	EQI_COSTUME_GARMENT (13)  - Costume Garment
	EQI_AMMO (14)             - Arrow/Ammunition
	EQI_SHADOW_ARMOR (15)     - Shadow Armor
	EQI_SHADOW_WEAPON (16)    - Shadow Weapon
	EQI_SHADOW_SHIELD (17)    - Shadow Shield
	EQI_SHADOW_SHOES (18)     - Shadow Shoes
	EQI_SHADOW_ACC_R (19)     - Shadow Accessory 2
	EQI_SHADOW_ACC_L (20)     - Shadow Accessory 1
*/

	setarray .slots[0],	/*EQI_HAND_R,*/
				EQI_HAND_L,
				EQI_ARMOR,
				EQI_SHOES,
				EQI_GARMENT;

	//=============================================

	end;

OnNPCKillEvent:

	if(@evolve_inuse)
		end;
	@evolve_inuse = true;
	.@size = getarraysize(.slots);
	while(.@slot < .@size) {
		.@item_id = getequipid(.slots[.@slot]);
		.@slot++;
		if(.@item_id < 0)
			continue;
		.@i = 0;
		while(.@i < .w1) {
			.@j = 0;
			.@has_item = false;
			while(.@j < .w2[.@i] && !.@has_item) {
				.@item_evo = getd(".it_id_"+.@i+"_"+.@j);
				if(.@item_id == .@item_evo && getd(".it_id_"+.@i+"_"+(.@j + 1))) {
					.@mob_id = getd(".it_mob_"+.@i+"_"+.@j);
					if(killedrid == .@mob_id || .@mob_id < 1001) {
						if(getd(".it_mode_"+.@i+"_"+.@j) == 1) {
							.@amount = getd("mobs_"+.@item_id) + 1;
							setd "mobs_"+.@item_id,.@amount;
							if(.@amount < getd(".it_amt_"+.@i+"_"+.@j)) continue;
							setd "mobs_"+.@item_id,0;
						} else {
							.@amount = getd("exp_"+.@item_id) + strmobinfo(6,killedrid);
							setd "exp_"+.@item_id,.@amount;
							if(.@amount < getd(".it_amt_"+.@i+"_"+.@j)) continue;
							setd "exp_"+.@item_id,0;
						}
						specialeffect2 EF_BEGINSPELL6;
						sleep2 rand(190,280);
						specialeffect2 EF_ENERGYDRAIN3;
						.@percent = getd("evo_"+.@item_id);
						if(.@percent < 100) {
							setd "evo_"+.@item_id,++.@percent;
							announce getitemname(.@item_id)+": "+.@percent+"%.",bc_self,"0x"+.c$[0];
						}
						if(.@percent >= 100 && .auto) {
							specialeffect2 EF_GUMGANG3;
							sleep2 500;
							specialeffect2 EF_BASH3D2;
							sleep2 300;
							specialeffect2 EF_BLUEBODY;
							sleep2 300;
							announce getitemname(.@item_id)+" está evoluindo...",bc_self,"0x"+.c$[1];
							.@k = 3;
							while(.@k--) {
								specialeffect2 EF_DOUBLECASTBODY;
								sleep2 900;
							}
							specialeffect2 EF_STORMKICK5;
							sleep2 200;
							specialeffect2 EF_BUBBLE_DROP;
							sleep2 500;
							if(!.@inventory) {
								getinventorylist;
								.@inventory = true;
							}
							.@k = inarray(@inventorylist_id,.@item_id);
							if(.@k != -1) {
								if(!@inventorylist_expire[.@k]) {
									setarray .@iteminfo[0],@inventorylist_id[.@k],@inventorylist_refine[.@k],@inventorylist_card1[.@k],@inventorylist_card2[.@k],@inventorylist_card3[.@k],@inventorylist_card4[.@k];
									setarray .@roid[0],@inventorylist_option_id1[.@k],@inventorylist_option_id2[.@k],@inventorylist_option_id3[.@k],@inventorylist_option_id4[.@k],@inventorylist_option_id5[.@k];
									setarray .@val[0],@inventorylist_option_value1[.@k],@inventorylist_option_value2[.@k],@inventorylist_option_value3[.@k],@inventorylist_option_value4[.@k],@inventorylist_option_value5[.@k];
									setarray .@par[0],@inventorylist_option_parameter1[.@k],@inventorylist_option_parameter2[.@k],@inventorylist_option_parameter3[.@k],@inventorylist_option_parameter4[.@k],@inventorylist_option_parameter5[.@k];
									.@bound = @inventorylist_bound[.@k];
								} else {
									continue;
								}
								.@evo_item = getd(".it_id_"+.@i+"_"+(.@j + 1));
								if(getarraysize(.@val)){
									delitem3 .@iteminfo[0],1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5],.@roid,.@val,.@par;
									if(.@bound)
										getitembound3 .@evo_item,1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5],Bound_Account,.@roid,.@val,.@par;
									else
										getitem3 .@evo_item,1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5],.@roid,.@val,.@par;
								} else {
									delitem2 .@iteminfo[0],1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5];
									if(.@bound)
										getitembound2 .@evo_item,1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5],Bound_Account;
									else
										getitem2 .@evo_item,1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5];
								}
								equip .@evo_item;
								setd "evo_"+.@item_id,0;
								announce "Parabéns!! Sua "+getitemname(.@item_id)+" evoluiu para "+getitemname(.@evo_item)+".",bc_self,"0x"+.c$[2];
							}
							.@has_item = true;
						} else if(.@item_id == .@item_evo) {
							.@j = .w2[.@i];
						}
					}
				}
				.@j++;
			}
			.@i++;
		}
	}
	@evolve_inuse = false;
	end;

	function	add_item	{

		for(.@args = getargcount();.@i < .@args;.@i+= 4) {
			.@j = .w2[.w1]++;
			setd ".it_id_"+.w1+"_"+.@j,getarg(.@i);	// id.
			if(getarg(.@i + 4,0) != 0) {
				setd ".it_mode_"+.w1+"_"+.@j,getarg(.@i + 1);	// mode.
				setd ".it_mob_"+.w1+"_"+.@j,getarg(.@i + 2);	// mob id.
				setd ".it_amt_"+.w1+"_"+.@j,getarg(.@i + 3);	// amount.
			}
		}
		.w1++;

	}

}

 

First script definetely wont work. The second script works almost perfect. The only problem im capable to see is the script cant process % if you kill lots of mobs at same time. Isnt a BIG problem/issue but it is.

 

Btw im thinking and obviously im wrong, but, what do you think of copy script for each slot? If i wanna do that it will need to be different otherwise wont work(variabls problem i think)

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  303
  • Reputation:   117
  • Joined:  12/10/16
  • Last Seen:  

I thought that wouldn't be a problem except when you're testing (most of the times the testings are with values as 1 or 2, so it's obviously the script will be triggering while evolving and such). Could it happen if you set it to something more realistic, like 50 or 100? I don't know.

You can duplicate it, but I don't recommend it. You'll probably need to edit MAX_EVENT_QUEUE and I don't know if the labels are executed at the same time (pretty sure they don't?) so there'd be a queue anyways. You could test this though.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  22
  • Topics Per Day:  0.01
  • Content Count:  109
  • Reputation:   5
  • Joined:  08/12/17
  • Last Seen:  

13 hours ago, n0tttt said:

I thought that wouldn't be a problem except when you're testing (most of the times the testings are with values as 1 or 2, so it's obviously the script will be triggering while evolving and such). Could it happen if you set it to something more realistic, like 50 or 100? I don't know.

You can duplicate it, but I don't recommend it. You'll probably need to edit MAX_EVENT_QUEUE and I don't know if the labels are executed at the same time (pretty sure they don't?) so there'd be a queue anyways. You could test this though.

Using this based on your last and script ignores the needed mobs values to get % and every give me 1% in each equipped slot.

 

-	script	Extra_GearConf	-1,{

	function add_item;

OnInit:

/*
	add_item(id, evolution mode, monster id, amount, id...);
	If  you want any monster, use 111.

Evolution modes:

	1 = Every X numer of mobs (1%).
	2 = Experience (1%).
*/


/* Armor */		add_item(2301, 1, 111,10, 2303, 1, 111,25, 2305, 1, 111, 40, 2307, 1, 111, 65, 2311, 1, 111, 75, 2319, 1, 111,95, 2320, 1, 111,125);
/* Adaga  */	add_item(13040,1, 111, 1, 1203, 1, 111, 5, 1206, 1, 111, 15, 1209, 1, 111, 25, 1212, 1, 111, 30, 1215, 1, 111, 60, 1218, 1, 111, 70, 1221, 1, 111, 80, 1222, 1, 111, 90, 13048, 1, 111, 150 ); // Adaga
/* Shield */	add_item(2101, 1, 111,30, 2103, 1, 111,45, 2105, 1, 111, 70);
/* Robe */		add_item(2501, 1, 111,31, 2503, 1, 111,46, 2505, 1, 111, 71);
/* Shoes */		add_item(2401, 1, 111,32, 2403, 1, 111,47, 2405, 1, 111, 72);
/* Debug  */	

/*
	0 = Won't be evolved automatically.
	1 = Will be evolved automatically
*/
	.auto = 1;

/*
	Color of the announces.
*/
	setarray .c$[0],"ffffff",	// % of evolution.
			"03fd20",	// Wings evolving.
			"11f4cc";	// Wings evolved.

/* slots to check.
	EQI_ACC_L (0)             - Accessory 1
	EQI_ACC_R (1)             - Accessory 2
	EQI_SHOES (2)             - Footgear (shoes, boots)
	EQI_GARMENT (3)           - Garment (mufflers, hoods, manteaux)
	EQI_HEAD_LOW (4)          - Lower Headgear (beards, some masks)
	EQI_HEAD_MID (5)          - Middle Headgear (masks, glasses)
	EQI_HEAD_TOP (6)          - Upper Headgear
	EQI_ARMOR (7)             - Armor (jackets, robes)
	EQI_HAND_L (8)            - Left hand (weapons, shields)
	EQI_HAND_R (9)            - Right hand (weapons)
	EQI_COSTUME_HEAD_TOP (10) - Upper Costume Headgear
	EQI_COSTUME_HEAD_MID (11) - Middle Costume Headgear
	EQI_COSTUME_HEAD_LOW (12) - Lower Costume Headgear
	EQI_COSTUME_GARMENT (13)  - Costume Garment
	EQI_AMMO (14)             - Arrow/Ammunition
	EQI_SHADOW_ARMOR (15)     - Shadow Armor
	EQI_SHADOW_WEAPON (16)    - Shadow Weapon
	EQI_SHADOW_SHIELD (17)    - Shadow Shield
	EQI_SHADOW_SHOES (18)     - Shadow Shoes
	EQI_SHADOW_ACC_R (19)     - Shadow Accessory 2
	EQI_SHADOW_ACC_L (20)     - Shadow Accessory 1
*/

	setarray .slots[0],	EQI_HAND_L,
						EQI_ARMOR,
						EQI_GARMENT,
						EQI_SHOES;
	//=============================================

	end;

OnNPCKillEvent:

	if(@evolve_inuse)
		end;
	@evolve_inuse = true;
	.@size = getarraysize(.slots);
	while(.@slot < .@size) {
		.@item_id = getequipid(.slots[.@slot]);
		.@slot++;
		if(.@item_id < 0)
			continue;
		.@i = 0;
		while(.@i < .w1) {
			.@j = 0;
			.@has_item = false;
			while(.@j < .w2[.@i] && !.@has_item) {
				.@item_evo = getd(".it_id_"+.@i+"_"+.@j);
				if(.@item_id == .@item_evo && getd(".it_id_"+.@i+"_"+(.@j + 1))) {
					.@mob_id = getd(".it_mob_"+.@i+"_"+.@j);
					if(killedrid == .@mob_id || .@mob_id < 1001) {
						if(getd(".it_mode_"+.@i+"_"+.@j) == 1) {
							.@amount = getd("mobs_"+.@item_id) + 1;
							setd "mobs_"+.@item_id,.@amount;
							if(.@amount < getd(".it_amt_"+.@i+"_"+.@j)) continue;
							setd "mobs_"+.@item_id,0;
						} else {
							.@amount = getd("exp_"+.@item_id) + strmobinfo(6,killedrid);
							setd "exp_"+.@item_id,.@amount;
							if(.@amount < getd(".it_amt_"+.@i+"_"+.@j)) continue;
							setd "exp_"+.@item_id,0;
						}
						specialeffect2 EF_BEGINSPELL6;
						sleep2 rand(190,280);
						specialeffect2 EF_ENERGYDRAIN3;
						.@percent = getd("evo_"+.@item_id);
						if(.@percent < 100) {
							setd "evo_"+.@item_id,++.@percent;
							announce getitemname(.@item_id)+": "+.@percent+"%.",bc_self,"0x"+.c$[0];
						}
						if(.@percent >= 100 && .auto) {
							specialeffect2 EF_GUMGANG3;
							sleep2 500;
							specialeffect2 EF_BASH3D2;
							sleep2 300;
							specialeffect2 EF_BLUEBODY;
							sleep2 300;
							announce getitemname(.@item_id)+" está evoluindo...",bc_self,"0x"+.c$[1];
							.@k = 3;
							while(.@k--) {
								specialeffect2 EF_DOUBLECASTBODY;
								sleep2 900;
							}
							specialeffect2 EF_STORMKICK5;
							sleep2 200;
							specialeffect2 EF_BUBBLE_DROP;
							sleep2 500;
							if(!.@inventory) {
								getinventorylist;
								.@inventory = true;
							}
							.@k = inarray(@inventorylist_id,.@item_id);
							if(.@k != -1) {
								if(!@inventorylist_expire[.@k]) {
									setarray .@iteminfo[0],@inventorylist_id[.@k],@inventorylist_refine[.@k],@inventorylist_card1[.@k],@inventorylist_card2[.@k],@inventorylist_card3[.@k],@inventorylist_card4[.@k];
									setarray .@roid[0],@inventorylist_option_id1[.@k],@inventorylist_option_id2[.@k],@inventorylist_option_id3[.@k],@inventorylist_option_id4[.@k],@inventorylist_option_id5[.@k];
									setarray .@val[0],@inventorylist_option_value1[.@k],@inventorylist_option_value2[.@k],@inventorylist_option_value3[.@k],@inventorylist_option_value4[.@k],@inventorylist_option_value5[.@k];
									setarray .@par[0],@inventorylist_option_parameter1[.@k],@inventorylist_option_parameter2[.@k],@inventorylist_option_parameter3[.@k],@inventorylist_option_parameter4[.@k],@inventorylist_option_parameter5[.@k];
									.@bound = @inventorylist_bound[.@k];
								} else {
									continue;
								}
								.@evo_item = getd(".it_id_"+.@i+"_"+(.@j + 1));
								if(getarraysize(.@val)){
									delitem3 .@iteminfo[0],1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5],.@roid,.@val,.@par;
									if(.@bound)
										getitembound3 .@evo_item,1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5],Bound_Account,.@roid,.@val,.@par;
									else
										getitem3 .@evo_item,1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5],.@roid,.@val,.@par;
								} else {
									delitem2 .@iteminfo[0],1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5];
									if(.@bound)
										getitembound2 .@evo_item,1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5],Bound_Account;
									else
										getitem2 .@evo_item,1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5];
								}
								equip .@evo_item;
								setd "evo_"+.@item_id,0;
								announce "Parabéns!! Sua "+getitemname(.@item_id)+" evoluiu para "+getitemname(.@evo_item)+".",bc_self,"0x"+.c$[2];
							}
							.@has_item = true;
						} else if(.@item_id == .@item_evo) {
							.@j = .w2[.@i];
						}
					}
				}
				.@j++;
			}
			.@i++;
		}
	}
	@evolve_inuse = false;
	end;

	function	add_item	{

		for(.@args = getargcount();.@i < .@args;.@i+= 4) {
			.@j = .w2[.w1]++;
			setd ".it_id_"+.w1+"_"+.@j,getarg(.@i);	// id.
			if(getarg(.@i + 4,0) != 0) {
				setd ".it_mode_"+.w1+"_"+.@j,getarg(.@i + 1);	// mode.
				setd ".it_mob_"+.w1+"_"+.@j,getarg(.@i + 2);	// mob id.
				setd ".it_amt_"+.w1+"_"+.@j,getarg(.@i + 3);	// amount.
			}
		}
		.w1++;

	}

}

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  303
  • Reputation:   117
  • Joined:  12/10/16
  • Last Seen:  

Okay, test this one.

-	script	Extra_GearConf	-1,{

	function add_item;

OnInit:

/*
	add_item(id, evolution mode, monster id, amount, id...);
	If  you want any monster, use 111.

Evolution modes:

	1 = Every X numer of mobs (1%).
	2 = Experience (1%).
*/


/* Armor */		add_item(2301, 1, 111,10, 2303, 1, 111,25, 2305, 1, 111, 40, 2307, 1, 111, 65, 2311, 1, 111, 75, 2319, 1, 111,95, 2320, 1, 111,125);
/* Adaga  */	add_item(13040,1, 111, 1, 1203, 1, 111, 5, 1206, 1, 111, 15, 1209, 1, 111, 25, 1212, 1, 111, 30, 1215, 1, 111, 60, 1218, 1, 111, 70, 1221, 1, 111, 80, 1222, 1, 111, 90, 13048, 1, 111, 150 ); // Adaga
/* Shield */	add_item(2101, 1, 111,30, 2103, 1, 111,45, 2105, 1, 111, 70);
/* Robe */		add_item(2501, 1, 111,31, 2503, 1, 111,46, 2505, 1, 111, 71);
/* Shoes */		add_item(2401, 1, 111,32, 2403, 1, 111,47, 2405, 1, 111, 72);
/* Debug  */	

/*
	0 = Won't be evolved automatically.
	1 = Will be evolved automatically
*/
	.auto = 1;

/*
	Color of the announces.
*/
	setarray .c$[0],"ffffff",	// % of evolution.
			"03fd20",	// Wings evolving.
			"11f4cc";	// Wings evolved.

/* slots to check.
	EQI_ACC_L (0)             - Accessory 1
	EQI_ACC_R (1)             - Accessory 2
	EQI_SHOES (2)             - Footgear (shoes, boots)
	EQI_GARMENT (3)           - Garment (mufflers, hoods, manteaux)
	EQI_HEAD_LOW (4)          - Lower Headgear (beards, some masks)
	EQI_HEAD_MID (5)          - Middle Headgear (masks, glasses)
	EQI_HEAD_TOP (6)          - Upper Headgear
	EQI_ARMOR (7)             - Armor (jackets, robes)
	EQI_HAND_L (8)            - Left hand (weapons, shields)
	EQI_HAND_R (9)            - Right hand (weapons)
	EQI_COSTUME_HEAD_TOP (10) - Upper Costume Headgear
	EQI_COSTUME_HEAD_MID (11) - Middle Costume Headgear
	EQI_COSTUME_HEAD_LOW (12) - Lower Costume Headgear
	EQI_COSTUME_GARMENT (13)  - Costume Garment
	EQI_AMMO (14)             - Arrow/Ammunition
	EQI_SHADOW_ARMOR (15)     - Shadow Armor
	EQI_SHADOW_WEAPON (16)    - Shadow Weapon
	EQI_SHADOW_SHIELD (17)    - Shadow Shield
	EQI_SHADOW_SHOES (18)     - Shadow Shoes
	EQI_SHADOW_ACC_R (19)     - Shadow Accessory 2
	EQI_SHADOW_ACC_L (20)     - Shadow Accessory 1
*/

	setarray .slots[0],	EQI_HAND_L,
				EQI_ARMOR,
				EQI_GARMENT,
				EQI_SHOES;
	//=============================================

	end;

OnNPCKillEvent:

	if(@evolve_inuse)
		end;
	@evolve_inuse = true;
	.@size = getarraysize(.slots);
	while(.@slot < .@size) {
		.@item_id = getequipid(.slots[.@slot]);
		.@slot++;
		if(.@item_id < 0)
			continue;
		.@i = 0;
		while(.@i < .w1) {
			.@j = 0;
			.@has_item = false;
			while(.@j < .w2[.@i] && !.@has_item) {
				.@no_percent = false;
				.@item_evo = getd(".it_id_"+.@i+"_"+.@j);
				if(.@item_id == .@item_evo && getd(".it_id_"+.@i+"_"+(.@j + 1))) {
					.@has_item = true;
					.@mob_id = getd(".it_mob_"+.@i+"_"+.@j);
					if(killedrid == .@mob_id || .@mob_id < 1001) {
						if(getd(".it_mode_"+.@i+"_"+.@j) == 1) {
							.@amount = getd("mobs_"+.@item_id) + 1;
							setd "mobs_"+.@item_id,.@amount;
							if(.@amount < getd(".it_amt_"+.@i+"_"+.@j)) .@no_percent = true;
						} else {
							.@amount = getd("exp_"+.@item_id) + strmobinfo(6,killedrid);
							setd "exp_"+.@item_id,.@amount;
							if(.@amount < getd(".it_amt_"+.@i+"_"+.@j)) .@no_percent = true;
						}
						if(!.@no_percent) {
							setd "mobs_"+.@item_id,0;
							setd "exp_"+.@item_id,0;
							specialeffect2 EF_BEGINSPELL6;
							sleep2 rand(190,280);
							specialeffect2 EF_ENERGYDRAIN3;
							.@percent = getd("evo_"+.@item_id);
							if(.@percent < 100) {
								setd "evo_"+.@item_id,++.@percent;
								announce getitemname(.@item_id)+": "+.@percent+"%.",bc_self,"0x"+.c$[0];
							}
							if(.@percent >= 100 && .auto) {
								specialeffect2 EF_GUMGANG3;
								sleep2 500;
								specialeffect2 EF_BASH3D2;
								sleep2 300;
								specialeffect2 EF_BLUEBODY;
								sleep2 300;
								announce getitemname(.@item_id)+" está evoluindo...",bc_self,"0x"+.c$[1];
								.@k = 3;
								while(.@k--) {
									specialeffect2 EF_DOUBLECASTBODY;
									sleep2 900;
								}
								specialeffect2 EF_STORMKICK5;
								sleep2 200;
								specialeffect2 EF_BUBBLE_DROP;
								sleep2 500;
								if(!.@inventory) {
									getinventorylist;
									.@inventory = true;
								}
								.@k = inarray(@inventorylist_id,.@item_id);
								if(.@k != -1) {
									if(!@inventorylist_expire[.@k]) {
										setarray .@iteminfo[0],@inventorylist_id[.@k],@inventorylist_refine[.@k],@inventorylist_card1[.@k],@inventorylist_card2[.@k],@inventorylist_card3[.@k],@inventorylist_card4[.@k];
										setarray .@roid[0],@inventorylist_option_id1[.@k],@inventorylist_option_id2[.@k],@inventorylist_option_id3[.@k],@inventorylist_option_id4[.@k],@inventorylist_option_id5[.@k];
										setarray .@val[0],@inventorylist_option_value1[.@k],@inventorylist_option_value2[.@k],@inventorylist_option_value3[.@k],@inventorylist_option_value4[.@k],@inventorylist_option_value5[.@k];
										setarray .@par[0],@inventorylist_option_parameter1[.@k],@inventorylist_option_parameter2[.@k],@inventorylist_option_parameter3[.@k],@inventorylist_option_parameter4[.@k],@inventorylist_option_parameter5[.@k];
										.@bound = @inventorylist_bound[.@k];
									} else {
										continue;
									}
									.@evo_item = getd(".it_id_"+.@i+"_"+(.@j + 1));
									if(getarraysize(.@val)){
									delitem3 .@iteminfo[0],1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5],.@roid,.@val,.@par;
									if(.@bound)
										getitembound3 .@evo_item,1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5],Bound_Account,.@roid,.@val,.@par;
									else
										getitem3 .@evo_item,1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5],.@roid,.@val,.@par;
									} else {
										delitem2 .@iteminfo[0],1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5];
										if(.@bound)
											getitembound2 .@evo_item,1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5],Bound_Account;
										else
											getitem2 .@evo_item,1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5];
									}
									equip .@evo_item;
									setd "evo_"+.@item_id,0;
									announce "Parabéns!! Sua "+getitemname(.@item_id)+" evoluiu para "+getitemname(.@evo_item)+".",bc_self,"0x"+.c$[2];
								}
							}
						} else if(.@item_id == .@item_evo) {
							.@has_item = true;
						}
					}
				}
				.@j++;
			}
			.@i++;
		}
	}
	@evolve_inuse = false;
	end;

	function	add_item	{

		for(.@args = getargcount();.@i < .@args;.@i+= 4) {
			.@j = .w2[.w1]++;
			setd ".it_id_"+.w1+"_"+.@j,getarg(.@i);	// id.
			if(getarg(.@i + 4,0) != 0) {
				setd ".it_mode_"+.w1+"_"+.@j,getarg(.@i + 1);	// mode.
				setd ".it_mob_"+.w1+"_"+.@j,getarg(.@i + 2);	// mob id.
				setd ".it_amt_"+.w1+"_"+.@j,getarg(.@i + 3);	// amount.
			}
		}
		.w1++;

	}

}

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  22
  • Topics Per Day:  0.01
  • Content Count:  109
  • Reputation:   5
  • Joined:  08/12/17
  • Last Seen:  

On 1/14/2019 at 12:04 PM, n0tttt said:

Okay, test this one.


-	script	Extra_GearConf	-1,{

	function add_item;

OnInit:

/*
	add_item(id, evolution mode, monster id, amount, id...);
	If  you want any monster, use 111.

Evolution modes:

	1 = Every X numer of mobs (1%).
	2 = Experience (1%).
*/


/* Armor */		add_item(2301, 1, 111,10, 2303, 1, 111,25, 2305, 1, 111, 40, 2307, 1, 111, 65, 2311, 1, 111, 75, 2319, 1, 111,95, 2320, 1, 111,125);
/* Adaga  */	add_item(13040,1, 111, 1, 1203, 1, 111, 5, 1206, 1, 111, 15, 1209, 1, 111, 25, 1212, 1, 111, 30, 1215, 1, 111, 60, 1218, 1, 111, 70, 1221, 1, 111, 80, 1222, 1, 111, 90, 13048, 1, 111, 150 ); // Adaga
/* Shield */	add_item(2101, 1, 111,30, 2103, 1, 111,45, 2105, 1, 111, 70);
/* Robe */		add_item(2501, 1, 111,31, 2503, 1, 111,46, 2505, 1, 111, 71);
/* Shoes */		add_item(2401, 1, 111,32, 2403, 1, 111,47, 2405, 1, 111, 72);
/* Debug  */	

/*
	0 = Won't be evolved automatically.
	1 = Will be evolved automatically
*/
	.auto = 1;

/*
	Color of the announces.
*/
	setarray .c$[0],"ffffff",	// % of evolution.
			"03fd20",	// Wings evolving.
			"11f4cc";	// Wings evolved.

/* slots to check.
	EQI_ACC_L (0)             - Accessory 1
	EQI_ACC_R (1)             - Accessory 2
	EQI_SHOES (2)             - Footgear (shoes, boots)
	EQI_GARMENT (3)           - Garment (mufflers, hoods, manteaux)
	EQI_HEAD_LOW (4)          - Lower Headgear (beards, some masks)
	EQI_HEAD_MID (5)          - Middle Headgear (masks, glasses)
	EQI_HEAD_TOP (6)          - Upper Headgear
	EQI_ARMOR (7)             - Armor (jackets, robes)
	EQI_HAND_L (8)            - Left hand (weapons, shields)
	EQI_HAND_R (9)            - Right hand (weapons)
	EQI_COSTUME_HEAD_TOP (10) - Upper Costume Headgear
	EQI_COSTUME_HEAD_MID (11) - Middle Costume Headgear
	EQI_COSTUME_HEAD_LOW (12) - Lower Costume Headgear
	EQI_COSTUME_GARMENT (13)  - Costume Garment
	EQI_AMMO (14)             - Arrow/Ammunition
	EQI_SHADOW_ARMOR (15)     - Shadow Armor
	EQI_SHADOW_WEAPON (16)    - Shadow Weapon
	EQI_SHADOW_SHIELD (17)    - Shadow Shield
	EQI_SHADOW_SHOES (18)     - Shadow Shoes
	EQI_SHADOW_ACC_R (19)     - Shadow Accessory 2
	EQI_SHADOW_ACC_L (20)     - Shadow Accessory 1
*/

	setarray .slots[0],	EQI_HAND_L,
				EQI_ARMOR,
				EQI_GARMENT,
				EQI_SHOES;
	//=============================================

	end;

OnNPCKillEvent:

	if(@evolve_inuse)
		end;
	@evolve_inuse = true;
	.@size = getarraysize(.slots);
	while(.@slot < .@size) {
		.@item_id = getequipid(.slots[.@slot]);
		.@slot++;
		if(.@item_id < 0)
			continue;
		.@i = 0;
		while(.@i < .w1) {
			.@j = 0;
			.@has_item = false;
			while(.@j < .w2[.@i] && !.@has_item) {
				.@no_percent = false;
				.@item_evo = getd(".it_id_"+.@i+"_"+.@j);
				if(.@item_id == .@item_evo && getd(".it_id_"+.@i+"_"+(.@j + 1))) {
					.@has_item = true;
					.@mob_id = getd(".it_mob_"+.@i+"_"+.@j);
					if(killedrid == .@mob_id || .@mob_id < 1001) {
						if(getd(".it_mode_"+.@i+"_"+.@j) == 1) {
							.@amount = getd("mobs_"+.@item_id) + 1;
							setd "mobs_"+.@item_id,.@amount;
							if(.@amount < getd(".it_amt_"+.@i+"_"+.@j)) .@no_percent = true;
						} else {
							.@amount = getd("exp_"+.@item_id) + strmobinfo(6,killedrid);
							setd "exp_"+.@item_id,.@amount;
							if(.@amount < getd(".it_amt_"+.@i+"_"+.@j)) .@no_percent = true;
						}
						if(!.@no_percent) {
							setd "mobs_"+.@item_id,0;
							setd "exp_"+.@item_id,0;
							specialeffect2 EF_BEGINSPELL6;
							sleep2 rand(190,280);
							specialeffect2 EF_ENERGYDRAIN3;
							.@percent = getd("evo_"+.@item_id);
							if(.@percent < 100) {
								setd "evo_"+.@item_id,++.@percent;
								announce getitemname(.@item_id)+": "+.@percent+"%.",bc_self,"0x"+.c$[0];
							}
							if(.@percent >= 100 && .auto) {
								specialeffect2 EF_GUMGANG3;
								sleep2 500;
								specialeffect2 EF_BASH3D2;
								sleep2 300;
								specialeffect2 EF_BLUEBODY;
								sleep2 300;
								announce getitemname(.@item_id)+" está evoluindo...",bc_self,"0x"+.c$[1];
								.@k = 3;
								while(.@k--) {
									specialeffect2 EF_DOUBLECASTBODY;
									sleep2 900;
								}
								specialeffect2 EF_STORMKICK5;
								sleep2 200;
								specialeffect2 EF_BUBBLE_DROP;
								sleep2 500;
								if(!.@inventory) {
									getinventorylist;
									.@inventory = true;
								}
								.@k = inarray(@inventorylist_id,.@item_id);
								if(.@k != -1) {
									if(!@inventorylist_expire[.@k]) {
										setarray .@iteminfo[0],@inventorylist_id[.@k],@inventorylist_refine[.@k],@inventorylist_card1[.@k],@inventorylist_card2[.@k],@inventorylist_card3[.@k],@inventorylist_card4[.@k];
										setarray .@roid[0],@inventorylist_option_id1[.@k],@inventorylist_option_id2[.@k],@inventorylist_option_id3[.@k],@inventorylist_option_id4[.@k],@inventorylist_option_id5[.@k];
										setarray .@val[0],@inventorylist_option_value1[.@k],@inventorylist_option_value2[.@k],@inventorylist_option_value3[.@k],@inventorylist_option_value4[.@k],@inventorylist_option_value5[.@k];
										setarray .@par[0],@inventorylist_option_parameter1[.@k],@inventorylist_option_parameter2[.@k],@inventorylist_option_parameter3[.@k],@inventorylist_option_parameter4[.@k],@inventorylist_option_parameter5[.@k];
										.@bound = @inventorylist_bound[.@k];
									} else {
										continue;
									}
									.@evo_item = getd(".it_id_"+.@i+"_"+(.@j + 1));
									if(getarraysize(.@val)){
									delitem3 .@iteminfo[0],1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5],.@roid,.@val,.@par;
									if(.@bound)
										getitembound3 .@evo_item,1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5],Bound_Account,.@roid,.@val,.@par;
									else
										getitem3 .@evo_item,1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5],.@roid,.@val,.@par;
									} else {
										delitem2 .@iteminfo[0],1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5];
										if(.@bound)
											getitembound2 .@evo_item,1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5],Bound_Account;
										else
											getitem2 .@evo_item,1,1,.@iteminfo[1],0,.@iteminfo[2],.@iteminfo[3],.@iteminfo[4],.@iteminfo[5];
									}
									equip .@evo_item;
									setd "evo_"+.@item_id,0;
									announce "Parabéns!! Sua "+getitemname(.@item_id)+" evoluiu para "+getitemname(.@evo_item)+".",bc_self,"0x"+.c$[2];
								}
							}
						} else if(.@item_id == .@item_evo) {
							.@has_item = true;
						}
					}
				}
				.@j++;
			}
			.@i++;
		}
	}
	@evolve_inuse = false;
	end;

	function	add_item	{

		for(.@args = getargcount();.@i < .@args;.@i+= 4) {
			.@j = .w2[.w1]++;
			setd ".it_id_"+.w1+"_"+.@j,getarg(.@i);	// id.
			if(getarg(.@i + 4,0) != 0) {
				setd ".it_mode_"+.w1+"_"+.@j,getarg(.@i + 1);	// mode.
				setd ".it_mob_"+.w1+"_"+.@j,getarg(.@i + 2);	// mob id.
				setd ".it_amt_"+.w1+"_"+.@j,getarg(.@i + 3);	// amount.
			}
		}
		.w1++;

	}

}

 

Sorry for late response...

Im testing this and its all ok for a while xD lets see with a long time testing 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...