• 0
Rizta

Can't keep refine, cards and enchants after evolve

Question

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:

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

OnNPCKillEvent:

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

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

 

 

Share this post


Link to post
Share on other sites

Recommended Posts

  • 0

Well I basically just saved the equip slot in the variable [email protected] 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 [email protected];

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:
¬†¬† ¬†[email protected]=.w1;
    .w1++;
¬†¬† ¬†for ([email protected]=getargcount();[email protected]<[email protected];[email protected]+=4)
    {
¬†¬† ¬†¬†¬† ¬†[email protected] = ++.w2[[email protected]];
¬†¬† ¬†¬†¬† ¬†setd ".a1"+.w1+"_"[email protected],getarg([email protected]);
¬†¬† ¬†¬†¬† ¬†setd ".a2"+.w1+"_"[email protected],getarg([email protected]+1);
¬†¬† ¬†¬†¬† ¬†setd ".a3"+.w1+"_"[email protected],getarg([email protected]+2);
¬†¬† ¬†¬†¬† ¬†setd ".a4"+.w1+"_"[email protected],getarg([email protected]+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]))
    {
¬†¬† ¬†¬†¬† ¬†[email protected] ¬†= 1;
¬†¬† ¬†¬†¬† ¬†[email protected] ¬†= @wing[0];
¬†¬† ¬†¬†¬† ¬†[email protected] ¬†= @wing[1];
¬†¬† ¬†¬†¬† ¬†[email protected] = @wing[2];
¬†¬† ¬†¬†¬† ¬†[email protected] ¬†= @wing[3]; // Readded the slot into the array
    }
    else
    {
¬†¬† ¬†¬†¬† ¬†for ([email protected]=getarraysize(.slots);[email protected]<[email protected]&&[email protected];[email protected]++)
        {
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†[email protected] = getequipid(.slots[[email protected]]); // Saving the Item ID
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†[email protected] = .slots[[email protected]]; // Saving the slot in [email protected]
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†if ([email protected]<0)
            continue;
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†[email protected] = 0;
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†[email protected] = 1;
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†while ([email protected]++<=.w2[[email protected]]&&[email protected])
            {
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†if ([email protected]>.w2[[email protected]])
                {
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†[email protected] = 1;
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†[email protected]++;
                }
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†if ([email protected]==getd(".a1"[email protected]+"_"[email protected]))
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†if (getd(".a4"[email protected]+"_"[email protected])>0&&(killedrid==getd(".a3"[email protected]+"_"[email protected])||getd(".a3"[email protected]+"_"[email protected])<1001))
                {
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†[email protected] = 1;
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†setarray @wing[0],[email protected],[email protected],[email protected],[email protected];
                }
            }
        }
    }
¬†¬† ¬†if ([email protected])
    {
¬†¬† ¬†¬†¬† ¬†if (getd(".a2"[email protected]+"_"[email protected])==1)
        {
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†[email protected] = getd("mobs_"[email protected]);
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†setd "mobs_"[email protected],[email protected]+1;
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†if (getd("mobs_"[email protected])<getd(".a4"[email protected]+"_"[email protected]))
            end;
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†setd "evo"[email protected],getd("evo"[email protected])+1;
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†setd "mobs_"[email protected],0;
        }
¬†¬† ¬†¬†¬† ¬†else if(getd(".a2"[email protected]+"_"[email protected])==2)
        {
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†[email protected] = getd("exp_"[email protected]);
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†setd "exp_"[email protected],[email protected]+strmobinfo(6,killedrid);
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†if (getd("exp_"[email protected])<getd(".a4"[email protected]+"_"[email protected]))
            end;
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†setd "evo"[email protected],getd("evo"[email protected])+1;
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†setd "exp_"[email protected],0;
        }
        else
        debugmes "Script Items_Evo, error: wrong mode.";
¬†¬† ¬†¬†¬† ¬†announce getitemname([email protected])+" est√° com "+getd("evo"[email protected])+"% para evoluir...",bc_self,"0x"+.c$[0];
        specialeffect2 58;
        specialeffect2 383;
¬†¬† ¬†¬†¬† ¬†if(getd("evo"[email protected])>=100&&.auto) // Checks for 100% exp and evo mode
        {
            specialeffect2 263;
            specialeffect2 377;
            specialeffect2 542;
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†announce getitemname([email protected])+" est√° evoluindo...",bc_self,"0x"+.c$[1];
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†[email protected]=3;
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†while ([email protected]) // <--- 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([email protected] == 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:
                /* 
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†[email protected] = getequiprefinerycnt([email protected]);
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†[email protected]=getequipcardid([email protected],0);
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†[email protected]=getequipcardid([email protected],1);
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†[email protected]=getequipcardid([email protected],2);
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†[email protected]=getequipcardid([email protected],3);
                
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†[email protected]=getequiprandomoption([email protected],0,ROA_ID);
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†[email protected]=getequiprandomoption([email protected],1,ROA_ID);
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†[email protected]=getequiprandomoption([email protected],2,ROA_ID);
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†[email protected]=getequiprandomoption([email protected],3,ROA_ID);
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†[email protected]=getequiprandomoption([email protected],4,ROA_ID);
                
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†[email protected]=getequiprandomoption([email protected],0,ROA_VALUE);
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†[email protected]=getequiprandomoption([email protected],1,ROA_VALUE);
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†[email protected]=getequiprandomoption([email protected],2,ROA_VALUE);
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†[email protected]=getequiprandomoption([email protected],3,ROA_VALUE);
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†[email protected]=getequiprandomoption([email protected],4,ROA_VALUE);
                */
                
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†[email protected]=getequiprefinerycnt(EQI_HAND_R);¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†[email protected]=getequipcardid(EQI_HAND_R,0);
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†[email protected]=getequipcardid(EQI_HAND_R,1);
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†[email protected]=getequipcardid(EQI_HAND_R,2);
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†[email protected]=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
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†[email protected]=getequiprandomoption(EQI_HAND_R,0,ROA_ID);
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†[email protected]=getequiprandomoption(EQI_HAND_R,1,ROA_ID);
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†[email protected]=getequiprandomoption(EQI_HAND_R,2,ROA_ID);
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†[email protected]=getequiprandomoption(EQI_HAND_R,3,ROA_ID);
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†[email protected]=getequiprandomoption(EQI_HAND_R,4,ROA_ID);
                
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†[email protected]=getequiprandomoption(EQI_HAND_R,0,ROA_VALUE);
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†[email protected]=getequiprandomoption(EQI_HAND_R,1,ROA_VALUE);
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†[email protected]=getequiprandomoption(EQI_HAND_R,2,ROA_VALUE);
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†[email protected]=getequiprandomoption(EQI_HAND_R,3,ROA_VALUE);
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†[email protected]=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 [email protected][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 [email protected][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 [email protected] if its 0 anyway
            
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†// Now with the [email protected] usage from above:
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†// setarray [email protected][0],getequiprandomoption([email protected],0,ROA_ID),getequiprandomoption([email protected],1,ROA_ID),getequiprandomoption([email protected],2,ROA_ID),getequiprandomoption([email protected],3,ROA_ID),getequiprandomoption([email protected],4,ROA_ID);
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†// setarray [email protected][0],getequiprandomoption([email protected],0,ROA_VALUE),getequiprandomoption([email protected],1,ROA_VALUE),getequiprandomoption([email protected],2,ROA_VALUE),getequiprandomoption([email protected],3,ROA_VALUE),getequiprandomoption([email protected],4,ROA_VALUE);¬†
            
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†setarray [email protected][0],[email protected],[email protected],[email protected],[email protected],[email protected];
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†setarray [email protected][0],[email protected],[email protected],[email protected],[email protected],[email protected];
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†setarray [email protected][0],0;¬†¬† ¬†
            
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†if(!getd(".a1"[email protected]+"_"+([email protected]+1))) //Null
                end;    
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†if([email protected]>0||[email protected]>0||[email protected]>0||[email protected]>0||[email protected]>0){
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†//delitem3 [email protected],1,1,[email protected],0,[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected];
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†getitem3 getd(".a1"[email protected]+"_"+([email protected]+1)),1,1,[email protected],0,[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected];
            }
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†else if([email protected]>0||[email protected]>0||[email protected]>0||[email protected]>0||[email protected]>0){
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†//delitem2 [email protected],1,1,[email protected],0,[email protected],[email protected],[email protected],[email protected];
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†getitem2 getd(".a1"[email protected]+"_"+([email protected]+1)),1,1,[email protected],0,[email protected],[email protected],[email protected],[email protected];
            }
            else{
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†//delitem [email protected],1;
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†getitem getd(".a1"[email protected]+"_"+([email protected]+1)),1;
            }
            // Instead of delitem use delequip
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†// I added a new variable in the above lines to save the slot: [email protected]
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†delequip [email protected];
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†equip getd(".a1"[email protected]+"_"+([email protected]+1));¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†setd "evo"[email protected],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"[email protected]+"_"+([email protected]+1)))+".",bc_self,"0x"+.c$[2];
        }
    }
    end;
}

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

Regards,
Chris:
 

Edited by llchrisll

Share this post


Link to post
Share on other sites
  • 0
On 10/22/2018 at 12:09 PM, llchrisll said:

Well I basically just saved the equip slot in the variable [email protected] 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 [email protected];

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:
¬†¬† ¬†[email protected]=.w1;
    .w1++;
¬†¬† ¬†for ([email protected]=getargcount();[email protected]<[email protected];[email protected]+=4)
    {
¬†¬† ¬†¬†¬† ¬†[email protected] = ++.w2[[email protected]];
¬†¬† ¬†¬†¬† ¬†setd ".a1"+.w1+"_"[email protected],getarg([email protected]);
¬†¬† ¬†¬†¬† ¬†setd ".a2"+.w1+"_"[email protected],getarg([email protected]+1);
¬†¬† ¬†¬†¬† ¬†setd ".a3"+.w1+"_"[email protected],getarg([email protected]+2);
¬†¬† ¬†¬†¬† ¬†setd ".a4"+.w1+"_"[email protected],getarg([email protected]+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]))
    {
¬†¬† ¬†¬†¬† ¬†[email protected] ¬†= 1;
¬†¬† ¬†¬†¬† ¬†[email protected] ¬†= @wing[0];
¬†¬† ¬†¬†¬† ¬†[email protected] ¬†= @wing[1];
¬†¬† ¬†¬†¬† ¬†[email protected] = @wing[2];
¬†¬† ¬†¬†¬† ¬†[email protected] ¬†= @wing[3];ÔĽŅÔĽŅ // Readded the slot into the array
    }
    else
    {
¬†¬† ¬†¬†¬† ¬†for ([email protected]=getarraysize(.slots);[email protected]<[email protected]&&[email protected];[email protected]++)
        {
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†[email protected] = getequipid(.slots[[email protected]]); // Saving the Item ID
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†[email protected] = .slots[[email protected]];ÔĽŅÔĽŅ // Saving the slot in [email protected]
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†if ([email protected]<0)
            continue;
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†[email protected] = 0;
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†[email protected] = 1;
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†while ([email protected]++<=.w2[[email protected]]&&[email protected])
            {
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†if ([email protected]>.w2[[email protected]])
                {
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†[email protected] = 1;
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†[email protected]++;
                }
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†if ([email protected]==getd(".a1"[email protected]+"_"[email protected]))
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†if (getd(".a4"[email protected]+"_"[email protected])>0&&(killedrid==getd(".a3"[email protected]+"_"[email protected])||getd(".a3"[email protected]+"_"[email protected])<1001))
                {
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†[email protected] = 1;
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†setarray @wing[0],[email protected],[email protected],[email protected],[email protected];
                }
            }
        }
    }
¬†¬† ¬†if ([email protected])
    {
¬†¬† ¬†¬†¬† ¬†if (getd(".a2"[email protected]+"_"[email protected])==1)
        {
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†[email protected] = getd("mobs_"[email protected]);
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†setd "mobs_"[email protected],[email protected]+1;
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†if (getd("mobs_"[email protected])<getd(".a4"[email protected]+"_"[email protected]))
            end;
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†setd "evo"[email protected],getd("evo"[email protected])+1;
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†setd "mobs_"[email protected],0;
        }
¬†¬† ¬†¬†¬† ¬†else if(getd(".a2"[email protected]+"_"[email protected])==2)
        {
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†[email protected] = getd("exp_"[email protected]);
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†setd "exp_"[email protected],[email protected]+strmobinfo(6,killedrid);
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†if (getd("exp_"[email protected])<getd(".a4"[email protected]+"_"[email protected]))
            end;
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†setd "evo"[email protected],getd("evo"[email protected])+1;
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†setd "exp_"[email protected],0;
        }
        else
        debugmes "Script Items_Evo, error: wrong mode.";
¬†¬† ¬†¬†¬† ¬†announce getitemname([email protected])+" est√° com "+getd("evo"[email protected])+"% para evoluir...",bc_self,"0x"+.c$[0];
        specialeffect2 58;
        specialeffect2 383;
¬†¬† ¬†¬†¬† ¬†if(getd("evo"[email protected])>=100&&.auto) // Checks for 100% exp and evo mode
        {
            specialeffect2 263;
            specialeffect2 377;
            specialeffect2 542;
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†announce getitemname([email protected])+" est√° evoluindo...",bc_self,"0x"+.c$[1];
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†[email protected]=3;
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†while ([email protected]) // <--- 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([email protected] == 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:
                /* 
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†[email protected] = getequiprefinerycnt([email protected]);
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†[email protected]=getequipcardid([email protected],0);
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†[email protected]=getequipcardid([email protected],1);
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†[email protected]=getequipcardid([email protected],2);
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†[email protected]=getequipcardid([email protected],3);
                
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†[email protected]=getequiprandomoption([email protected],0,ROA_ID);
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†[email protected]=getequiprandomoption([email protected],1,ROA_ID);
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†[email protected]=getequiprandomoption([email protected],2,ROA_ID);
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†[email protected]=getequiprandomoption([email protected],3,ROA_ID);
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†[email protected]=getequiprandomoption([email protected],4,ROA_ID);
                
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†[email protected]=getequiprandomoption([email protected],0,ROA_VALUE);
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†[email protected]=getequiprandomoption([email protected],1,ROA_VALUE);
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†[email protected]=getequiprandomoption([email protected],2,ROA_VALUE);
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†[email protected]=getequiprandomoption([email protected],3,ROA_VALUE);
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†[email protected]=getequiprandomoption([email protected],4,ROA_VALUE);
                */
                
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†[email protected]=getequiprefinerycnt(EQI_HAND_R);¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†[email protected]=getequipcardid(EQI_HAND_R,0);
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†[email protected]=getequipcardid(EQI_HAND_R,1);
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†[email protected]=getequipcardid(EQI_HAND_R,2);
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†[email protected]=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
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†[email protected]=getequiprandomoption(EQI_HAND_R,0,ROA_ID);
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†[email protected]=getequiprandomoption(EQI_HAND_R,1,ROA_ID);
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†[email protected]=getequiprandomoption(EQI_HAND_R,2,ROA_ID);
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†[email protected]=getequiprandomoption(EQI_HAND_R,3,ROA_ID);
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†[email protected]=getequiprandomoption(EQI_HAND_R,4,ROA_ID);
                
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†[email protected]=getequiprandomoption(EQI_HAND_R,0,ROA_VALUE);
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†[email protected]=getequiprandomoption(EQI_HAND_R,1,ROA_VALUE);
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†[email protected]=getequiprandomoption(EQI_HAND_R,2,ROA_VALUE);
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†[email protected]=getequiprandomoption(EQI_HAND_R,3,ROA_VALUE);
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†[email protected]=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 [email protected][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 [email protected][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 [email protected] if its 0 anyway
            
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†// Now with the [email protected] usage from above:
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†// setarray [email protected][0],getequiprandomoption([email protected],0,ROA_ID),getequiprandomoption([email protected],1,ROA_ID),getequiprandomoption([email protected],2,ROA_ID),getequiprandomoption([email protected],3,ROA_ID),getequiprandomoption([email protected],4,ROA_ID);
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†// setarray [email protected][0],getequiprandomoption([email protected],0,ROA_VALUE),getequiprandomoption([email protected],1,ROA_VALUE),getequiprandomoption([email protected],2,ROA_VALUE),getequiprandomoption([email protected],3,ROA_VALUE),getequiprandomoption([email protected],4,ROA_VALUE);¬†
            
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†setarray [email protected][0],[email protected],[email protected],[email protected],[email protected],[email protected];
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†setarray [email protected][0],[email protected],[email protected],[email protected],[email protected],[email protected];
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†setarray [email protected][0],0;¬†¬† ¬†
            
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†if(!getd(".a1"[email protected]+"_"+([email protected]+1))) //Null
                end;    
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†if([email protected]>0||[email protected]>0||[email protected]>0||[email protected]>0||[email protected]>0){
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†//delitem3 [email protected],1,1,[email protected],0,[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected];
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†getitem3 getd(".a1"[email protected]+"_"+([email protected]+1)),1,1,[email protected],0,[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected];
            }
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†else if([email protected]>0||[email protected]>0||[email protected]>0||[email protected]>0||[email protected]>0){
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†//delitem2 [email protected],1,1,[email protected],0,[email protected],[email protected],[email protected],[email protected];
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†getitem2 getd(".a1"[email protected]+"_"+([email protected]+1)),1,1,[email protected],0,[email protected],[email protected],[email protected],[email protected];
            }
            else{
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†//delitem [email protected],1;
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†getitem getd(".a1"[email protected]+"_"+([email protected]+1)),1;
            }
            // Instead of delitem use delequip
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†// I added a new variable in the above lines to save the slot: [email protected]
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†delequip [email protected];
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†equip getd(".a1"[email protected]+"_"+([email protected]+1));¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†
¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†setd "evo"[email protected],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"[email protected]+"_"+([email protected]+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:
	[email protected]index=.w1;
	.w1++;
	for ([email protected]args=getargcount();[email protected]a<[email protected]args;[email protected]a+=4)
	{
		[email protected]i = ++.w2[[email protected]index];
		setd ".a1"+.w1+"_"[email protected]i,getarg([email protected]a);
		setd ".a2"+.w1+"_"[email protected]i,getarg([email protected]a+1);
		setd ".a3"+.w1+"_"[email protected]i,getarg([email protected]a+2);
		setd ".a4"+.w1+"_"[email protected]i,getarg([email protected]a+3);
	}
	return;

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

 

 

Share this post


Link to post
Share on other sites
  • 0
Posted (edited)

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],"09e2ÔĽŅf9",	// % 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([email protected]) {
		// Cache. That old loop on every mob killed...
		if(@evo_var[0] && isequipped(@evo_var[0])) {
			[email protected]_item = true;
			[email protected]_id = @evo_var[0];
			[email protected] = @evo_var[1] - 1;
			[email protected] = @evo_var[2] - 1;
			[email protected] = @evo_var[3];
			[email protected]_id = getd(".it_mob_"[email protected]+"_"[email protected]);
			if(killedrid != [email protected]_id && [email protected]_id > 1001)
				end;
		} else {
			[email protected] = getarraysize(.slots);
			while([email protected] < [email protected] && [email protected]_item) {
				[email protected]_id = getequipid(.slots[[email protected]]);
				[email protected]++;
				if([email protected]_id < 0)
					continue;
				[email protected] = 0;
				while([email protected] < .w1 && [email protected]_item) {
					[email protected] = 0;
					while([email protected] < .w2[[email protected]] && [email protected]_item) {
						[email protected]_evo = getd(".it_id_"[email protected]+"_"[email protected]);
						if([email protected]_id == [email protected]_evo && getd(".it_id_"[email protected]+"_"+([email protected] + 1))) {
							[email protected]_id = getd(".it_mob_"[email protected]+"_"[email protected]);
							if(killedrid == [email protected]_id || [email protected]_id < 1001) {
								[email protected]_item = true;
								setarray @evo_var[0],[email protected]_id,[email protected] + 1,[email protected] + 1,[email protected];
							}
						} else if([email protected]_id == [email protected]_evo) {
							end;
						}
						if([email protected]_item)
							[email protected]++;
					}
					if([email protected]_item)
						[email protected]++;
				}
			}
		}
		if([email protected]_item) {
			if(getd(".it_mode_"[email protected]+"_"[email protected]) == 1) {
				[email protected] = ++getd("mobs_"[email protected]_id);
				setd "mobs_"[email protected]_id,[email protected];
				if([email protected] < getd(".it_amt_"[email protected]+"_"[email protected])) end;
				setd "mobs_"[email protected]_id,0;
			} else if(getd(".it_mode_"[email protected]+"_"[email protected]) == 2) {
				[email protected] = getd("exp_"[email protected]_id) + strmobinfo(6,killedrid);
				setd "exp_"[email protected]_id,[email protected];
				if([email protected] < getd(".it_amt_"[email protected]+"_"[email protected])) end;
				setd "exp_"[email protected]_id,0;
			} else {
				debugmes "Script Items_Evo, error: wrong mode.";
				end;
			}
			specialeffect2 EF_BEGINSPELL6;
			sleep2 rand(190,280);
			specialeffect2 EF_ENERGYDRAIN3;
			[email protected] = getd("evo_"[email protected]_id);
			if([email protected] < 100) {
				setd "evo_"[email protected]_id,[email protected];
				announce getitemname([email protected]_id)+": "[email protected]+"%.",bc_self,"0x"+.c$[0];
			}
			if([email protected] >= 100 && .auto && [email protected]) {
				@evolving = true;
				specialeffect2 EF_GUMGANG3;
				sleep2 500;
				specialeffect2 EF_BASH3D2;
				sleep2 300;
				specialeffect2 EF_BLUEBODY;
				sleep2 300;
				announce getitemname([email protected]_id)+" is evolving...",bc_self,"0x"+.c$[1];
				[email protected] = 3;
				while([email protected]) {
					specialeffect2 EF_DOUBLECASTBODY;
					sleep2 900;
				}
				specialeffect2 EF_STORMKICK5;
				sleep2 200;
				specialeffect2 EF_BUBBLE_DROP;
				sleep2 500;
				[email protected];
				setarray [email protected][1],getequipcardid(.slots[[email protected]],0),getequipcardid(.slots[[email protected]],1),getequipcardid(.slots[[email protected]],2),getequipcardid(.slots[[email protected]],3);
				[email protected] = getequiprefinerycnt(.slots[[email protected]]);
				if(getiteminfo([email protected]_id,2) == IT_WEAPON) {
					for([email protected] = 0;[email protected] < 5;[email protected]++) {
						[email protected]_id[[email protected]] = getequiprandomoption(.slots[[email protected]],[email protected],ROA_ID);
						[email protected]_val[[email protected]] = getequiprandomoption(.slots[[email protected]],[email protected],ROA_VAL);
						if([email protected]_option && [email protected]_val[[email protected]]))
							[email protected]_option = true;
					}
				}
				[email protected]_item = getd(".it_id_"[email protected]+"_"+([email protected] + 1));
				delequip .slots[[email protected]];
				if([email protected]_option)
					getitembound3 [email protected]_item,1,true,[email protected],false,[email protected][1],[email protected][2],[email protected][3],[email protected][4],Bound_Char,[email protected]_id,[email protected]_val,0;
				else
					getitembound2 [email protected]_item,1,true,[email protected],false,[email protected][1],[email protected][2],[email protected][3],[email protected][4],Bound_Char;
				equip [email protected]_item;
				setd "evo_"[email protected]_id,0;
				deletearray @evo_var;
				announce "Congratulations, your "+getitemname([email protected]_id)+" has evolved to "+getitemname([email protected]_item)+".",bc_self,"0x"+.c$[2];
				@evolving = false;
			}
		}
	}
	end;

	function	add_item	{

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

	}

}

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

Edited by n0tttt

Share this post


Link to post
Share on other sites
  • 0
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],"09e2ÔĽŅf9",	// % 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([email protected]) {
		// Cache. That old loop on every mob killed...
		if(@evo_var[0] && isequipped(@evo_var[0])) {
			[email protected]_item = true;
			[email protected]_id = @evo_var[0];
			[email protected] = @evo_var[1] - 1;
			[email protected] = @evo_var[2] - 1;
			[email protected] = @evo_var[3];
			[email protected]_id = getd(".it_mob_"[email protected]+"_"[email protected]);
			if(killedrid != [email protected]_id && [email protected]_id > 1001)
				end;
		} else {
			[email protected] = getarraysize(.slots);
			while([email protected] < [email protected] && [email protected]_item) {
				[email protected]_id = getequipid(.slots[[email protected]]);
				[email protected]++;
				if([email protected]_id < 0)
					continue;
				[email protected] = 0;
				while([email protected] < .w1 && [email protected]_item) {
					[email protected] = 0;
					while([email protected] < .w2[[email protected]] && [email protected]_item) {
						[email protected]_evo = getd(".it_id_"[email protected]+"_"[email protected]);
						if([email protected]_id == [email protected]_evo && getd(".it_id_"[email protected]+"_"+([email protected] + 1))) {
							[email protected]_id = getd(".it_mob_"[email protected]+"_"[email protected]);
							if(killedrid == [email protected]_id || [email protected]_id < 1001) {
								[email protected]_item = true;
								setarray @evo_var[0],[email protected]_id,[email protected] + 1,[email protected] + 1,[email protected];
							}
						} else if([email protected]_id == [email protected]_evo) {
							end;
						}
						if([email protected]_item)
							[email protected]++;
					}
					if([email protected]_item)
						[email protected]++;
				}
			}
		}
		if([email protected]_item) {
			if(getd(".it_mode_"[email protected]+"_"[email protected]) == 1) {
				[email protected] = ++getd("mobs_"[email protected]_id);
				setd "mobs_"[email protected]_id,[email protected];
				if([email protected] < getd(".it_amt_"[email protected]+"_"[email protected])) end;
				setd "mobs_"[email protected]_id,0;
			} else if(getd(".it_mode_"[email protected]+"_"[email protected]) == 2) {
				[email protected] = getd("exp_"[email protected]_id) + strmobinfo(6,killedrid);
				setd "exp_"[email protected]_id,[email protected];
				if([email protected] < getd(".it_amt_"[email protected]+"_"[email protected])) end;
				setd "exp_"[email protected]_id,0;
			} else {
				debugmes "Script Items_Evo, error: wrong mode.";
				end;
			}
			specialeffect2 EF_BEGINSPELL6;
			sleep2 rand(190,280);
			speciaÔĽŅleffect2 EF_ENERGYDRAIN3;
			[email protected] = getd("evo_"[email protected]_id);
			if([email protected] < 100) {
				setd "evo_"[email protected]_id,[email protected];
				announce getitemname([email protected]_id)+": "[email protected]+"%.",bc_self,"0x"+.c$[0];
			}
			if([email protected] >= 100 && .auto && [email protected]) {
				@evolving = true;
				specialeffect2 EF_GUMGANG3;
				sleep2 500;
				specialeffect2 EF_BASH3D2;
				sleep2 300;
				specialeffect2 EF_BLUEBODY;
				sleep2 300;
				announce getitemname([email protected]_id)+" is evolving...",bc_self,"0x"+.c$[1];
				[email protected] = 3;
				while([email protected]) {
					specialeffect2 EF_DOUBLECASTBODY;
					sleep2 900;
				}
				specialeffect2 EF_STORMKICK5;
				sleep2 200;
				specialeffect2 EF_BUBBLE_DROP;
				sleep2 500;
				[email protected];
				setarray [email protected][1],getequipcardid(.slots[[email protected]],0),getequipcardid(.slots[[email protected]],1),getequipcardid(.slots[[email protected]],2),getequipcardid(.slots[[email protected]],3);
				[email protected] = getequiprefinerycnt(.slots[[email protected]]);
				if(getiteminfo([email protected]_id,2) == IT_WEAPON) {
					for([email protected] = 0;[email protected] < 5;[email protected]++) {
						[email protected]_id[[email protected]] = getequiprandomoption(.slots[[email protected]],[email protected],ROA_ID);
						[email protected]_val[[email protected]] = getequiprandomoption(.slots[[email protected]],[email protected],ROA_VAL);
						if([email protected]_option && [email protected]_val[[email protected]]))
							[email protected]_option = true;
					}
				}
				[email protected]_item = getd(".it_id_"[email protected]+"_"+([email protected] + 1));
				delequip .slots[[email protected]];
				if([email protected]_option)
					getitembound3 [email protected]_item,1,true,[email protected],false,[email protected][1],[email protected][2],[email protected][3],[email protected][4],Bound_Char,[email protected]_id,[email protected]_val,0;
				else
					getitembound2 [email protected]_item,1,true,[email protected],false,[email protected][1],[email protected][2],[email protected][3],[email protected][4],Bound_Char;
				equip [email protected]_item;
				setd "evo_"[email protected]_id,0;
				deletearray @evo_var;
				announce "Congratulations, your "+getitemname([email protected]_id)+" has evolved to "+getitemname([email protected]_item)+".",bc_self,"0x"+.c$[2];
				@evolving = false;
			}
		}
	}
	end;

	function	add_item	{

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

	}

}ÔĽŅ

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

y87q9qlw

Share this post


Link to post
Share on other sites
  • 0
Posted (edited)

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:

[email protected] = getd("mobs_"[email protected]_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([email protected]) {
		// Cache. That old loop on every mob killed...
		if(@evo_var[0] && isequipped(@evo_var[0])) {
			[email protected]_item = true;
			[email protected]_id = @evo_var[0];
			[email protected] = @evo_var[1] - 1;
			[email protected] = @evo_var[2] - 1;
			[email protected] = @evo_var[3];
			[email protected]_id = getd(".it_mob_"[email protected]+"_"[email protected]);
			if(killedrid != [email protected]_id && [email protected]_id > 1001)
				end;
		} else {
			[email protected] = getarraysize(.slots);
			while([email protected] < [email protected] && [email protected]_item) {
				[email protected]_id = getequipid(.slots[[email protected]]);
				[email protected]++;
				if([email protected]_id < 0)
					continue;
				[email protected] = 0;
				while([email protected] < .w1 && [email protected]_item) {
					[email protected] = 0;
					while([email protected] < .w2[[email protected]] && [email protected]_item) {
						[email protected]_evo = getd(".it_id_"[email protected]+"_"[email protected]);
						if([email protected]_id == [email protected]_evo && getd(".it_id_"[email protected]+"_"+([email protected] + 1))) {
							[email protected]_id = getd(".it_mob_"[email protected]+"_"[email protected]);
							if(killedrid == [email protected]_id || [email protected]_id < 1001) {
								[email protected]_item = true;
								setarray @evo_var[0],[email protected]_id,[email protected] + 1,[email protected] + 1,[email protected];
							}
						} else if([email protected]_id == [email protected]_evo) {
							end;
						}
						if([email protected]_item)
							[email protected]++;
					}
					if([email protected]_item)
						[email protected]++;
				}
			}
		}
		if([email protected]_item) {
			if(getd(".it_mode_"[email protected]+"_"[email protected]) == 1) {
				[email protected] = getd("mobs_"[email protected]_id) + 1;
				setd "mobs_"[email protected]_id,[email protected];
				if([email protected] < getd(".it_amt_"[email protected]+"_"[email protected])) end;
				setd "mobs_"[email protected]_id,0;
			} else if(getd(".it_mode_"[email protected]+"_"[email protected]) == 2) {
				[email protected] = getd("exp_"[email protected]_id) + strmobinfo(6,killedrid);
				setd "exp_"[email protected]_id,[email protected];
				if([email protected] < getd(".it_amt_"[email protected]+"_"[email protected])) end;
				setd "exp_"[email protected]_id,0;
			} else {
				debugmes "Script Items_Evo, error: wrong mode.";
				end;
			}
			specialeffect2 EF_BEGINSPELL6;
			sleep2 rand(190,280);
			//specia?leffect2 EF_ENERGYDRAIN3;
			[email protected] = getd("evo_"[email protected]_id);
			if([email protected] < 100) {
				setd "evo_"[email protected]_id,[email protected];
				announce getitemname([email protected]_id)+": "[email protected]+"%.",bc_self,"0x"+.c$[0];
			}
			if([email protected] >= 100 && .auto && [email protected]) {
				@evolving = true;
				specialeffect2 EF_GUMGANG3;
				sleep2 500;
				specialeffect2 EF_BASH3D2;
				sleep2 300;
				specialeffect2 EF_BLUEBODY;
				sleep2 300;
				announce getitemname([email protected]_id)+" est√° evoluindo...",bc_self,"0x"+.c$[1];
				[email protected] = 3;
				while([email protected]) {
					specialeffect2 EF_DOUBLECASTBODY;
					sleep2 900;
				}
				specialeffect2 EF_STORMKICK5;
				sleep2 200;
				specialeffect2 EF_BUBBLE_DROP;
				sleep2 500;
				[email protected];
				//setarray [email protected][1],getequipcardid(.slots[[email protected]],0),getequipcardid(.slots[[email protected]],1),getequipcardid(.slots[[email protected]],2),getequipcardid(.slots[[email protected]],3);
				//[email protected] = getequiprefinerycnt(.slots[[email protected]]);
				//if(getiteminfo([email protected]_id,2) == IT_WEAPON) {
				//	for([email protected] = 0;[email protected] < 5;[email protected]++) {
				//		[email protected]_id[[email protected]] = getequiprandomoption(.slots[[email protected]],[email protected],ROA_ID);
				//		[email protected]_val[[email protected]] = getequiprandomoption(.slots[[email protected]],[email protected],ROA_VAL);
				//		if([email protected]_option && [email protected]_val[[email protected]])
				//			[email protected]_option = true;
				//	}
				//}
				[email protected] = .slots[[email protected]];
				[email protected] = getequipid([email protected]);				
				getinventorylist;
				freeloop 1;
				for([email protected] = 0; [email protected] < @inventorylist_count; [email protected]++){
				if(@inventorylist_equip[[email protected]] && @inventorylist_id[[email protected]] == [email protected]){
				if([email protected]_expire[[email protected]]){
				setarray [email protected],@inventorylist_id[[email protected]],@inventorylist_refine[[email protected]],@inventorylist_card1[[email protected]],@inventorylist_card2[[email protected]],@inventorylist_card3[[email protected]],@inventorylist_card4[[email protected]];
				setarray [email protected],@inventorylist_option_id1[[email protected]],@inventorylist_option_id2[[email protected]],@inventorylist_option_id3[[email protected]],@inventorylist_option_id4[[email protected]],@inventorylist_option_id5[[email protected]];
				setarray [email protected],@inventorylist_option_value1[[email protected]],@inventorylist_option_value2[[email protected]],@inventorylist_option_value3[[email protected]],@inventorylist_option_value4[[email protected]],@inventorylist_option_value5[[email protected]];
				setarray [email protected],@inventorylist_option_parameter1[[email protected]],@inventorylist_option_parameter2[[email protected]],@inventorylist_option_parameter3[[email protected]],@inventorylist_option_parameter4[[email protected]],@inventorylist_option_parameter5[[email protected]];
				[email protected] = @inventorylist_bound[[email protected]];
				break;
			} else	end;
		}
	}
	freeloop 0;
				[email protected]_item = getd(".it_id_"[email protected]+"_"+([email protected] + 1));
				//delequip .slots[[email protected]];
				//if([email protected]_option)
				if(getarraysize([email protected])){
					delitem3 [email protected][0],1,1,[email protected][1],0,[email protected][2],[email protected][3],[email protected][4],[email protected][5],[email protected],[email protected],[email protected];
				if([email protected])
					getitembound3 [email protected]_item,1,1,[email protected][1],0,[email protected][2],[email protected][3],[email protected][4],[email protected][5],Bound_Account,[email protected],[email protected],[email protected];
				else	getitem3 [email protected]_item,1,1,[email protected][1],0,[email protected][2],[email protected][3],[email protected][4],[email protected][5],[email protected],[email protected],[email protected];
			} else {
					delitem2 [email protected][0],1,1,[email protected][1],0,[email protected][2],[email protected][3],[email protected][4],[email protected][5];
				if([email protected])
					getitembound2 [email protected]_item,1,1,[email protected][1],0,[email protected][2],[email protected][3],[email protected][4],[email protected][5],Bound_Account;
				else	getitem2 [email protected]_item,1,1,[email protected][1],0,[email protected][2],[email protected][3],[email protected][4],[email protected][5];
			}				
			//	if(getarraysize([email protected]))
			//		getitem3 [email protected]_item,1,true,[email protected],false,[email protected][1],[email protected][2],[email protected][3],[email protected][4],[email protected],[email protected],[email protected]; //[email protected]_id,[email protected]_val,0;
			//	else
			//		getitem2 [email protected]_item,1,true,[email protected],false,[email protected][1],[email protected][2],[email protected][3],[email protected][4];
				equip [email protected]_item;
				setd "evo_"[email protected]_id,0;
				deletearray @evo_var;
				announce "Parab√©ns!! Sua "+getitemname([email protected]_id)+" evoluiu para "+getitemname([email protected]_item)+".",bc_self,"0x"+.c$[2];
				@evolving = false;
			}
		}
	}
	end;

	function	add_item	{

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

	}

}

 

Edited by Rizta

Share this post


Link to post
Share on other sites
  • 0
Posted (edited)

It's because the script uses [email protected] for indexing which wing, and you added a loop which also uses [email protected]

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

	function	add_item	{

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

	}

}

 

Edited by n0tttt

Share this post


Link to post
Share on other sites
  • 0
6 hours ago, n0tttt said:

It's because the script uses [email protected] for indexing which wing, and you added a loop which also uses [email protected]

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([email protected]) {
		// Cache. That old loop on every mob killed...
		if(@evo_var[0] && isequipped(@evo_var[0])) {
			[email protected]_item = true;
			[email protected]_id = @evo_var[0];
			[email protected] = @evo_var[1] - 1;
			[email protected] = @evo_var[2] - 1;
			[email protected] = @evo_var[3];
			[email protected]_id = getd(".it_mob_"[email protected]+"_"[email protected]);
			if(killedrid != [email protected]_id && [email protected]_id > 1001)
				end;
		} else {
			[email protected] = getarraysize(.slots);
			while([email protected] < [email protected] && [email protected]_item) {
				[email protected]_id = getequipid(.slots[[email protected]]);
				[email protected]++;
				if([email protected]_id < 0)
					continue;
				[email protected] = 0;
				while([email protected] < .w1 && [email protected]_item) {
					[email protected] = 0;
					while([email protected] < .w2[[email protected]] && [email protected]_item) {
						[email protected]_evo = getd(".it_id_"[email protected]+"_"[email protected]);
						if([email protected]_id == [email protected]_evo && getd(".it_id_"[email protected]+"_"+([email protected] + 1))) {
							[email protected]_id = getd(".it_mob_"[email protected]+"_"[email protected]);
							if(killedrid == [email protected]_id || [email protected]_id < 1001) {
								[email protected]_item = true;
								setarray @evo_var[0],[email protected]_id,[email protected] + 1,[email protected] + 1,[email protected];
							}
						} else if([email protected]_id == [email protected]_evo) {
							end;
						}
						if([email protected]_item)
							[email protected]++;
					}
					if([email protected]_item)
						[email protected]++;
				}
			}
		}
		if([email protected]_item) {
			if(getd(".it_mode_"[email protected]+"_"[email protected]) == 1) {
				[email protected] = getd("mobs_"[email protected]_id) + 1;
				setd "mobs_"[email protected]_id,[email protected];
				if([email protected] < getd(".it_amt_"[email protected]+"_"[email protected])) end;
				setd "mobs_"[email protected]_id,0;
			} else if(getd(".it_mode_"[email protected]+"_"[email protected]) == 2) {
				[email protected] = getd("exp_"[email protected]_id) + strmobinfo(6,killedrid);
				setd "exp_"[email protected]_id,[email protected];
				if([email protected] < getd(".it_amt_"[email protected]+"_"[email protected])) end;
				setd "exp_"[email protected]_id,0;
			} else {
				debugmes "Script Items_Evo, error: wrong mode.";
				end;
			}
			specialeffect2 EF_BEGINSPELL6;
			sleep2 rand(190,280);
			specialeffect2 EF_ENERGYDRAIN3;
			[email protected] = getd("evo_"[email protected]_id);
			if([email protected] < 100) {
				setd "evo_"[email protected]_id,[email protected];
				announce getitemname([email protected]_id)+": "[email protected]+"%.",bc_self,"0x"+.c$[0];
			}
			if([email protected] >= 100 && .auto && [email protected]) {
				@evolving ÔĽŅ= true;
				specialeffect2 EF_GUMGANG3;
				sleep2 500;
				specialeffect2 EF_BASH3D2;
				sleep2 300;
				specialeffect2 EF_BLUEBODY;
				sleep2 300;
				announce getitemname([email protected]_id)+" est√° evoluindo...",bc_self,"0x"+.c$[1];
				[email protected] = 3;
				while([email protected]) {
					specialeffect2 EF_DOUBLECASTBODY;
					sleep2 900;
				}
				specialeffect2 EF_STORMKICK5;
				sleep2 200;
				specialeffect2 EF_BUBBLE_DROP;
				sleep2 500;
				[email protected];
				[email protected] = .slots[[email protected]];
				getinventorylist;
				[email protected] = inarray(@inventorylist_equip,[email protected]);
				if([email protected] == -1)
					end;
				if([email protected]_expire[[email protected]]){
					setarray [email protected],@inventorylist_id[[email protected]],@inventorylist_refine[[email protected]],@inventorylist_card1[[email protected]],@inventorylist_card2[[email protected]],@inventorylist_card3[[email protected]],@inventorylist_card4[[email protected]];
					setarray [email protected],@inventorylist_option_id1[[email protected]],@inventorylist_option_id2[[email protected]],@inventorylist_option_id3[[email protected]],@inventorylist_option_id4[[email protected]],@inventorylist_option_id5[[email protected]];
					setarray [email protected],@inventorylist_option_value1[[email protected]],@inventorylist_option_value2[[email protected]],@inventorylist_option_value3[[email protected]],@inventorylist_option_value4[[email protected]],@inventorylist_option_value5[[email protected]];
					setarray [email protected],@inventorylist_option_parameter1[[email protected]],@inventorylist_option_parameter2[[email protected]],@inventorylist_option_parameter3[[email protected]],@inventorylist_option_parameter4[[email protected]],@inventorylist_option_parameter5[[email protected]];
					[email protected] = @inventorylist_bound[[email protected]];
				} else {
					end;
				}
				[email protected]_item = getd(".it_id_"[email protected]+"_"+([email protected] + 1));
				if(getarraysize([email protected])){
					delitem3 [email protected][0],1,1,[email protected][1],0,[email protected][2],[email protected][3],[email protected][4],[email protected][5],[email protected],[email protected],[email protected];
					if([email protected])
						getitembound3 [email protected]_item,1,1,[email protected][1],0,[email protected][2],[email protected][3],[email protected][4],[email protected][5],Bound_Account,[email protected],[email protected],[email protected];
					else
						getitem3 [email protected]_item,1,1,[email protected][1],0,[email protected][2],[email protected][3],[email protected][4],[email protected][5],[email protected],[email protected],[email protected];
				} else {
					delitem2 [email protected][0],1,1,[email protected][1],0,[email protected][2],[email protected][3],[email protected][4],[email protected][5];
					if([email protected])
						getitembound2 [email protected]_item,1,1,[email protected][1],0,[email protected][2],[email protected][3],[email protected][4],[email protected][5],Bound_Account;
					else
						getitem2 [email protected]_item,1,1,[email protected][1],0,[email protected][2],[email protected][3],[email protected][4],[email protected][5];
				}
				equip [email protected]_item;
				setd "evo_"[email protected]_id,0;
				deletearray @evo_var;
				announce "Parab√©ns!! Sua "+getitemname([email protected]_id)+" evoluiu para "+getitemname([email protected]_item)+".",bc_self,"0x"+.c$[2];
				@evolving = false;
			}
		}
	}
	end;

	function	add_item	{

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

	}

}ÔĽŅ

 

ya4brzut

Fixing this and now item dosnt evolve. 

Share this post


Link to post
Share on other sites
  • 0

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

	function	add_item	{

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

	}

}

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

Share this post


Link to post
Share on other sites
  • 0
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 

Share this post


Link to post
Share on other sites
  • 0
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([email protected]) {
		// Cache. That old loop on every mob killed...
		if(@evo_var[0] && isequipped(@evo_var[0])) {
			[email protected]_item = true;
			[email protected]_id = @evo_var[0];
			[email protected] = @evo_var[1] - 1;
			[email protected] = @evo_var[2] - 1;
			[email protected] = @evo_var[3];
			[email protected]_id = getd(".it_mob_"[email protected]+"_"[email protected]);
			if(killedrid != [email protected]_id && [email protected]_id > 1001)
				end;
		} else {
			[email protected] = getarraysize(.slots);
			while([email protected] < [email protected] && [email protected]_item) {
				[email protected]_id = getequipid(.slots[[email protected]]);
				[email protected]++;
				if([email protected]_id < 0)
					continue;
				[email protected] = 0;
				while([email protected] < .w1 && [email protected]_item) {
					[email protected] = 0;
					while([email protected] < .w2[[email protected]] && [email protected]_item) {
						[email protected]_evo = getd(".it_id_"[email protected]+"_"[email protected]);
						if([email protected]_id == [email protected]_evo && getd(".it_id_"[email protected]+"_"+([email protected] + 1))) {
							[email protected]_id = getd(".it_mob_"[email protected]+"_"[email protected]);
							if(killedrid == [email protected]_id || [email protected]_id < 1001) {
								[email protected]_item = true;
								setarray @evo_var[0],[email protected]_id,[email protected] + 1,[email protected] + 1,[email protected];
							}
						} else if([email protected]_id == [email protected]_evo) {
							end;
						}
						if([email protected]_item)
							[email protected]++;
					}
					if([email protected]_item)
						[email protected]++;
				}
			}
		}
		if([email protected]_item) {
			if(getd(".it_mode_"[email protected]+"_"[email protected]) == 1) {
				[email protected] = getd("mobs_"[email protected]_id) + 1;
				setd "mobs_"[email protected]_id,[email protected];
				if([email protected] < getd(".it_amt_"[email protected]+"_"[email protected])) end;
				setd "mobs_"[email protected]_id,0;
			} else if(getd(".it_mode_"[email protected]+"_"[email protected]) == 2) {
				[email protected] = getd("exp_"[email protected]_id) + strmobinfo(6,killedrid);
				setd "exp_"[email protected]_id,[email protected];
				if([email protected] < getd(".it_amt_"[email protected]+"_"[email protected])) end;
				setd "exp_"[email protected]_id,0;
			} else {
				debugmes "Script Items_Evo, error: wrong mode.";
				end;
			}
			specialeffect2 EF_BEGINSPELL6;
			sleep2 rand(190,280);
			specialeffect2 EF_ENERGYDRAIN3;
			[email protected] = getd("evo_"[email protected]_id);
			if([email protected] < 100) {
				setd "evo_"[email protected]_id,[email protected];
				announce getitemname([email protected]_id)+": "[email protected]+"%.",bc_self,"0x"+.c$[0];
			}
			if([email protected] >= 100 && .auto && [email protected]) {
				@evolving = true;
				specialeffect2 EF_GUMGANG3;
				sleep2 500;
				specialeffect2 EF_BASH3D2;
				sleep2 300;
				specialeffect2 EF_BLUEBODY;
				sleep2 300;
				announce getitemname([email protected]_id)+" est√° evoluindo...",bc_self,"0x"+.c$[1];
				[email protected] = 3;
				while([email protected]) {
					specialeffect2 EF_DOUBLECASTBODY;
					sleep2 900;
				}
				specialeffect2 EF_STORMKICK5;
				sleep2 200;
				specialeffect2 EF_BUBBLE_DROP;
				sleep2 500;
				getinventorylist;
				[email protected] = inarray(@inventorylist_id,[email protected]_id);
				if([email protected] != -1) {
					if([email protected]_expire[[email protected]]) {
						setarray [email protected],@inventorylist_id[[email protected]],@inventorylist_refine[[email protected]],@inventorylist_card1[[email protected]],@inventorylist_card2[[email protected]],@inventorylist_card3[[email protected]],@inventorylist_card4[[email protected]];
						setarray [email protected],@inventorylist_option_id1[[email protected]],@inventorylist_option_id2[[email protected]],@inventorylist_option_id3[[email protected]],@inventorylist_option_id4[[email protected]],@inventorylist_option_id5[[email protected]];
						setarray [email protected],@inventorylist_option_value1[[email protected]],@inventorylist_option_value2[[email protected]],@inventorylist_option_value3[[email protected]],@inventorylist_option_value4[[email protected]],@inventorylist_option_value5[[email protected]];
						setarray [email protected],@inventorylist_option_parameter1[[email protected]],@inventorylist_option_parameter2[[email protected]],@inventorylist_option_parameter3[[email protected]],@inventorylist_option_parameter4[[email protected]],@inventorylist_option_parameter5[[email protected]];
						[email protected] = @inventorylist_bound[[email protected]];
					} else {
						@evolving = false;
					}
					if(@evolving) {
						[email protected]_item = getd(".it_id_"[email protected]+"_"+([email protected] + 1));
						if(getarraysize([email protected])){
							delitem3 [email protected][0],1,1,[email protected][1],0,[email protected][2],[email protected][3],[email protected][4],[email protected][5],[email protected],[email protected],[email protected];
							if([email protected])
								getitembound3 [email protected]_item,1,1,[email protected][1],0,[email protected][2],[email protected][3],[email protected][4],[email protected][5],Bound_Account,[email protected],[email protected],[email protected];
							else
								getitem3 [email protected]_item,1,1,[email protected][1],0,[email protected][2],[email protected][3],[email protected][4],[email protected][5],[email protected],[email protected],[email protected];
						} else {
							delitem2 [email protected][0],1,1,[email protected][1],0,[email protected][2],[email protected][3],[email protected][4],[email protected][5];
							if([email protected])
								getitembound2 [email protected]_item,1,1,[email protected][1],0,[email protected][2],[email protected][3],[email protected][4],[email protected][5],Bound_Account;
							else
								getitem2 [email protected]_item,1,1,[email protected][1],0,[email protected][2],[email protected][3],[email protected][4],[email protected][5];
						}
						equip [email protected]_item;
						setd "evo_"[email protected]_id,0;
						deletearray @evo_var;
						announce "Parab√©ns!! Sua "+getitemname([email protected]_id)+" evoluiu para "+getitemname([email protected]_item)+".",bc_self,"0x"+.c$[2];
						@evolving = false;
					}
				}
			}
		}
	}
	end;

	function	add_item	{

		for([email protected] = getargcount();[email protected] < [email protected];[email protected]+= 4) {
			[email protected] = .w2[.w1]++;
			setd ".it_id_"+.w1+"_"[email protected],getarg([email protected]);	// id.
			if(getarg([email protected] + 4,0) != 0) {
				setd ".it_mode_"+.w1+"_"[email protected],getarg([email protected] + 1);	// mode.
				setd ".it_mob_"+.w1+"_"[email protected],getarg([email protected] + 2);	// mob id.
				setd ".it_amt_"+.w1+"_"[email protected],getarg([email protected] + 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 

Share this post


Link to post
Share on other sites
  • 0

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?

Share this post


Link to post
Share on other sites
  • 0
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

Share this post


Link to post
Share on other sites
  • 0

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:

	[email protected] = getarraysize(.slots);
	while([email protected] < [email protected]) {
		[email protected]_id = getequipid(.slots[[email protected]]);
		[email protected]++;
		if([email protected]_id < 0)
			continue;
		[email protected] = 0;
		while([email protected] < .w1) {
			[email protected] = 0;
			[email protected]_item = false;
			while([email protected] < .w2[[email protected]] && [email protected]_item) {
				[email protected]_evo = getd(".it_id_"[email protected]+"_"[email protected]);
				if([email protected]_id == [email protected]_evo && getd(".it_id_"[email protected]+"_"+([email protected] + 1))) {
					[email protected]_id = getd(".it_mob_"[email protected]+"_"[email protected]);
					if(killedrid == [email protected]_id || [email protected]_id < 1001) {
						if(getd(".it_mode_"[email protected]+"_"[email protected]) == 1) {
							[email protected] = getd("mobs_"[email protected]_id) + 1;
							setd "mobs_"[email protected]_id,[email protected];
							if([email protected] < getd(".it_amt_"[email protected]+"_"[email protected])) continue;
							setd "mobs_"[email protected]_id,0;
						} else {
							[email protected] = getd("exp_"[email protected]_id) + strmobinfo(6,killedrid);
							setd "exp_"[email protected]_id,[email protected];
							if([email protected] < getd(".it_amt_"[email protected]+"_"[email protected])) continue;
							setd "exp_"[email protected]_id,0;
						}
						specialeffect2 EF_BEGINSPELL6;
						sleep2 rand(190,280);
						specialeffect2 EF_ENERGYDRAIN3;
						[email protected] = getd("evo_"[email protected]_id);
						if([email protected] < 100) {
							setd "evo_"[email protected]_id,[email protected];
							announce getitemname([email protected]_id)+": "[email protected]+"%.",bc_self,"0x"+.c$[0];
						}
						if([email protected] >= 100 && .auto) {
							specialeffect2 EF_GUMGANG3;
							sleep2 500;
							specialeffect2 EF_BASH3D2;
							sleep2 300;
							specialeffect2 EF_BLUEBODY;
							sleep2 300;
							announce getitemname([email protected]_id)+" est√° evoluindo...",bc_self,"0x"+.c$[1];
							[email protected] = 3;
							while([email protected]) {
								specialeffect2 EF_DOUBLECASTBODY;
								sleep2 900;
							}
							specialeffect2 EF_STORMKICK5;
							sleep2 200;
							specialeffect2 EF_BUBBLE_DROP;
							sleep2 500;
							if([email protected]) {
								getinventorylist;
								[email protected] = true;
							}
							[email protected] = inarray(@inventorylist_id,[email protected]_id);
							if([email protected] != -1) {
								if([email protected]_expire[[email protected]]) {
									setarray [email protected][0],@inventorylist_id[[email protected]],@inventorylist_refine[[email protected]],@inventorylist_card1[[email protected]],@inventorylist_card2[[email protected]],@inventorylist_card3[[email protected]],@inventorylist_card4[[email protected]];
									setarray [email protected][0],@inventorylist_option_id1[[email protected]],@inventorylist_option_id2[[email protected]],@inventorylist_option_id3[[email protected]],@inventorylist_option_id4[[email protected]],@inventorylist_option_id5[[email protected]];
									setarray [email protected][0],@inventorylist_option_value1[[email protected]],@inventorylist_option_value2[[email protected]],@inventorylist_option_value3[[email protected]],@inventorylist_option_value4[[email protected]],@inventorylist_option_value5[[email protected]];
									setarray [email protected][0],@inventorylist_option_parameter1[[email protected]],@inventorylist_option_parameter2[[email protected]],@inventorylist_option_parameter3[[email protected]],@inventorylist_option_parameter4[[email protected]],@inventorylist_option_parameter5[[email protected]];
									[email protected] = @inventorylist_bound[[email protected]];
								} else {
									continue;
								}
								[email protected]_item = getd(".it_id_"[email protected]+"_"+([email protected] + 1));
								if(getarraysize([email protected])){
									delitem3 [email protected][0],1,1,[email protected][1],0,[email protected][2],[email protected][3],[email protected][4],[email protected][5],[email protected],[email protected],[email protected];
									if([email protected])
										getitembound3 [email protected]_item,1,1,[email protected][1],0,[email protected][2],[email protected][3],[email protected][4],[email protected][5],Bound_Account,[email protected],[email protected],[email protected];
									else
										getitem3 [email protected]_item,1,1,[email protected][1],0,[email protected][2],[email protected][3],[email protected][4],[email protected][5],[email protected],[email protected],[email protected];
								} else {
									delitem2 [email protected][0],1,1,[email protected][1],0,[email protected][2],[email protected][3],[email protected][4],[email protected][5];
									if([email protected])
										getitembound2 [email protected]_item,1,1,[email protected][1],0,[email protected][2],[email protected][3],[email protected][4],[email protected][5],Bound_Account;
									else
										getitem2 [email protected]_item,1,1,[email protected][1],0,[email protected][2],[email protected][3],[email protected][4],[email protected][5];
								}
								equip [email protected]_item;
								setd "evo_"[email protected]_id,0;
								announce "Parab√©ns!! Sua "+getitemname([email protected]_id)+" evoluiu para "+getitemname([email protected]_item)+".",bc_self,"0x"+.c$[2];
							}
							[email protected]_item = true;
						} else if([email protected]_id == [email protected]_evo) {
							continue;
						}
					}
				}
				[email protected]++;
			}
			[email protected]++;
		}
	}
	end;

	function	add_item	{

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

	}

}

 

Share this post


Link to post
Share on other sites
  • 0
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:

	[email protected] = getarraysize(.slots);
	while([email protected] < [email protected]) {
		[email protected]_id = getequipid(.slots[[email protected]]);
		[email protected]++;
		if([email protected]_id < 0)
			continue;
		[email protected] = 0;
		while([email protected] < .w1) {
			[email protected] = 0;
			[email protected]_item = false;
			while([email protected] < .w2[[email protected]] && [email protected]_item) {
				[email protected]_evo = getd(".it_id_"[email protected]+"_"[email protected]);
				if([email protected]_id == [email protected]_evo && getd(".it_id_"[email protected]+"_"+([email protected] + 1))) {
					[email protected]_id = getd(".it_mob_"[email protected]+"_"[email protected]);
					if(killedrid == [email protected]_id || [email protected]_id < 1001) {
						if(getd(".it_mode_"[email protected]+"_"[email protected]) == 1) {
							[email protected] = getd("mobs_"[email protected]_id) + 1;
							setd "mobs_"[email protected]_id,[email protected];
							if([email protected] < getd(".it_amt_"[email protected]+"_"[email protected])) continue;
							setd "mobs_"[email protected]_id,0;
						} else {
							[email protected] = getd("exp_"[email protected]_id) + strmobinfo(6,killedrid);
							setd "exp_"[email protected]_id,[email protected];
							if([email protected] < getd(".it_amt_"[email protected]+"_"[email protected])) continue;
							setd "exp_"[email protected]_id,0;
						}
						specialeffect2 EF_BEGINSPELL6;
						sleep2 rand(190,280);
						specialeffect2 EF_ENERGYDRAIN3;
						[email protected] = getd("evo_"[email protected]_id);
						if([email protected] < 100) {
							setd "evo_"[email protected]_id,[email protected];
							announce getitemname([email protected]_id)+": "[email protected]+"%.",bc_self,"0x"+.c$[0];
						}
						if([email protected] >= 100 && .auto) {
							specialeffect2 EF_GUMGANG3;
							sleep2 500;
							specialeffect2 EF_BASH3D2;
							sleep2 300;
							specialeffect2 EF_BLUEBODY;
							sleep2 300;
							announce getitemname([email protected]_id)+" est√° evoluindo...",bc_self,"0x"+.c$[1];
							[email protected] = 3;
							while([email protected]) {
								specialeffect2 EF_DOUBLECASTBODY;
								sleep2 900;
							}
							specialeffect2 EF_STORMKICK5;
							sleep2 200;
							specialeffect2 EF_BUBBLE_DROP;
							sleep2 500;
							if([email protected]) {
								getinventorylist;
								[email protected] = true;
							}
							[email protected] = inarray(@inventorylist_id,[email protected]_id);
							if([email protected] != -1) {
								if([email protected]_expire[[email protected]]) {
									setarray [email protected][0],@inventorylist_id[[email protected]],@inventorylist_refine[[email protected]],@inventorylist_card1[[email protected]],@inventorylist_card2[[email protected]],@inventorylist_card3[[email protected]],@inventorylist_card4[[email protected]];
									setarray [email protected][0],@inventorylist_option_id1[[email protected]],@inventorylist_option_id2[[email protected]],@inventorylist_option_id3[[email protected]],@inventorylist_option_id4[[email protected]],@inventorylist_option_id5[[email protected]];
									setarray [email protected][0],@inventorylist_option_value1[[email protected]],@inventorylist_option_value2[[email protected]],@inventorylist_option_value3[[email protected]],@inventorylist_option_value4[[email protected]],@inventorylist_option_value5[[email protected]];
									setarray [email protected][0],@inventorylist_option_parameter1[[email protected]],@inventorylist_option_parameter2[[email protected]],@inventorylist_option_parameter3[[email protected]],@inventorylist_option_parameter4[[email protected]],@inventorylist_option_parameter5[[email protected]];
									[email protected] = @inventorylist_bound[[email protected]];
								} else {
									continue;
								}
								[email protected]_item = getd(".it_id_"[email protected]+"_"+([email protected] + 1));
								if(getarraysize([email protected])){
									delitem3 [email protected][0],1,1,[email protected][1],0,[email protected][2],[email protected][3],[email protected][4],[email protected][5],[email protected],[email protected],[email protected];
									if([email protected])
										getitembound3 [email protected]_item,1,1,[email protected][1],0,[email protected][2],[email protected][3],[email protected][4],[email protected][5],Bound_Account,[email protected],[email protected],[email protected];
									else
										getitem3 [email protected]_item,1,1,[email protected][1],0,[email protected][2],[email protected][3],[email protected][4],[email protected][5],[email protected],[email protected],[email protected];
								} else {
									delitem2 [email protected][0],1,1,[email protected][1],0,[email protected][2],[email protected][3],[email protected][4],[email protected][5];
									if([email protected])
										getitembound2 [email protected]_item,1,1,[email protected][1],0,[email protected][2],[email protected][3],[email protected][4],[email protected][5],Bound_Account;
									else
										getitem2 [email protected]_item,1,1,[email protected][1],0,[email protected][2],[email protected][3],[email protected][4],[email protected][5];
								}
								equip [email protected]_item;
								setd "evo_"[email protected]_id,0;
								announce "Parab√©ns!! Sua "+getitemname([email protected]_id)+" evoluiu para "+getitemname([email protected]_item)+".",bc_self,"0x"+.c$[2];
							}
							[email protected]_item = true;
						} else if([email protected]_id == [email protected]_evo) {
							continue;
						}
					}
				}
				[email protected]++;
			}
			[email protected]++;
		}
	}
	end;

	function	add_item	{

		for([email protected] = getargcount();[email protected] < [email protected];[email protected]+= 4) {
			[email protected] = .w2[.w1]++;
			setd ".it_id_"+.w1+"_"[email protected],getarg([email protected]);	// id.
			if(getarg([email protected] + 4,0) != 0) {
				setd ".it_mode_"+.w1+"_"[email protected],getarg([email protected] + 1);	// mode.
				setd ".it_mob_"+.w1+"_"[email protected],getarg([email protected] + 2);	// mob id.
				setd ".it_amt_"+.w1+"_"[email protected],getarg([email protected] + 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

Share this post


Link to post
Share on other sites
  • 0

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([email protected]) {
		// Cache. That old loop on every mob killed...
		if(@evo_var[0] && isequipped(@evo_var[0])) {
			[email protected]_item = true;
			[email protected]_id = @evo_var[0];
			[email protected] = @evo_var[1] - 1;
			[email protected] = @evo_var[2] - 1;
			[email protected] = @evo_var[3];
			[email protected]_id = getd(".it_mob_"[email protected]+"_"[email protected]);
			if(killedrid != [email protected]_id && [email protected]_id > 1001)
				end;
		} else {
			[email protected] = getarraysize(.slots);
			while([email protected] < [email protected] && [email protected]_item) {
				[email protected]_id = getequipid(.slots[[email protected]]);
				[email protected]++;
				if([email protected]_id < 0)
					continue;
				[email protected] = 0;
				while([email protected] < .w1 && [email protected]_item) {
					[email protected] = 0;
					while([email protected] < .w2[[email protected]] && [email protected]_item) {
						[email protected]_evo = getd(".it_id_"[email protected]+"_"[email protected]);
						if([email protected]_id == [email protected]_evo && getd(".it_id_"[email protected]+"_"+([email protected] + 1))) {
							[email protected]_id = getd(".it_mob_"[email protected]+"_"[email protected]);
							if(killedrid == [email protected]_id || [email protected]_id < 1001) {
								[email protected]_item = true;
								setarray @evo_var[0],[email protected]_id,[email protected] + 1,[email protected] + 1,[email protected];
							}
						} else if([email protected]_id == [email protected]_evo) {
							[email protected] = .w2[[email protected]];
						}
						if([email protected]_item)
							[email protected]++;
					}
					if([email protected]_item)
						[email protected]++;
				}
			}
		}
		if([email protected]_item) {
			if(getd(".it_mode_"[email protected]+"_"[email protected]) == 1) {
				[email protected] = getd("mobs_"[email protected]_id) + 1;
				setd "mobs_"[email protected]_id,[email protected];
				if([email protected] < getd(".it_amt_"[email protected]+"_"[email protected])) end;
				setd "mobs_"[email protected]_id,0;
			} else {
				[email protected] = getd("exp_"[email protected]_id) + strmobinfo(6,killedrid);
				setd "exp_"[email protected]_id,[email protected];
				if([email protected] < getd(".it_amt_"[email protected]+"_"[email protected])) end;
				setd "exp_"[email protected]_id,0;
			}
			specialeffect2 EF_BEGINSPELL6;
			sleep2 rand(190,280);
			specialeffect2 EF_ENERGYDRAIN3;
			[email protected] = getd("evo_"[email protected]_id);
			if([email protected] < 100) {
				setd "evo_"[email protected]_id,[email protected];
				announce getitemname([email protected]_id)+": "[email protected]+"%.",bc_self,"0x"+.c$[0];
			}
			if([email protected] >= 100 && .auto && [email protected]) {
				@evolving = true;
				specialeffect2 EF_GUMGANG3;
				sleep2 500;
				specialeffect2 EF_BASH3D2;
				sleep2 300;
				specialeffect2 EF_BLUEBODY;
				sleep2 300;
				announce getitemname([email protected]_id)+" est√° evoluindo...",bc_self,"0x"+.c$[1];
				[email protected] = 3;
				while([email protected]) {
					specialeffect2 EF_DOUBLECASTBODY;
					sleep2 900;
				}
				specialeffect2 EF_STORMKICK5;
				sleep2 200;
				specialeffect2 EF_BUBBLE_DROP;
				sleep2 500;
				getinventorylist;
				[email protected] = inarray(@inventorylist_id,[email protected]_id);
				if([email protected] != -1) {
					if([email protected]_expire[[email protected]]) {
						setarray [email protected],@inventorylist_id[[email protected]],@inventorylist_refine[[email protected]],@inventorylist_card1[[email protected]],@inventorylist_card2[[email protected]],@inventorylist_card3[[email protected]],@inventorylist_card4[[email protected]];
						setarray [email protected],@inventorylist_option_id1[[email protected]],@inventorylist_option_id2[[email protected]],@inventorylist_option_id3[[email protected]],@inventorylist_option_id4[[email protected]],@inventorylist_option_id5[[email protected]];
						setarray [email protected],@inventorylist_option_value1[[email protected]],@inventorylist_option_value2[[email protected]],@inventorylist_option_value3[[email protected]],@inventorylist_option_value4[[email protected]],@inventorylist_option_value5[[email protected]];
						setarray [email protected],@inventorylist_option_parameter1[[email protected]],@inventorylist_option_parameter2[[email protected]],@inventorylist_option_parameter3[[email protected]],@inventorylist_option_parameter4[[email protected]],@inventorylist_option_parameter5[[email protected]];
						[email protected] = @inventorylist_bound[[email protected]];
					} else {
						@evolving = false;
					}
					if(@evolving) {
						[email protected]_item = getd(".it_id_"[email protected]+"_"+([email protected] + 1));
						if(getarraysize([email protected])){
							delitem3 [email protected][0],1,1,[email protected][1],0,[email protected][2],[email protected][3],[email protected][4],[email protected][5],[email protected],[email protected],[email protected];
							if([email protected])
								getitembound3 [email protected]_item,1,1,[email protected][1],0,[email protected][2],[email protected][3],[email protected][4],[email protected][5],Bound_Account,[email protected],[email protected],[email protected];
							else
								getitem3 [email protected]_item,1,1,[email protected][1],0,[email protected][2],[email protected][3],[email protected][4],[email protected][5],[email protected],[email protected],[email protected];
						} else {
							delitem2 [email protected][0],1,1,[email protected][1],0,[email protected][2],[email protected][3],[email protected][4],[email protected][5];
							if([email protected])
								getitembound2 [email protected]_item,1,1,[email protected][1],0,[email protected][2],[email protected][3],[email protected][4],[email protected][5],Bound_Account;
							else
								getitem2 [email protected]_item,1,1,[email protected][1],0,[email protected][2],[email protected][3],[email protected][4],[email protected][5];
						}
						equip [email protected]_item;
						setd "evo_"[email protected]_id,0;
						deletearray @evo_var;
						announce "Parab√©ns!! Sua "+getitemname([email protected]_id)+" evoluiu para "+getitemname([email protected]_item)+".",bc_self,"0x"+.c$[2];
						@evolving = false;
					}
				}
			}
		}
	}
	end;

	function	add_item	{

		for([email protected] = getargcount();[email protected] < [email protected];[email protected]+= 4) {
			[email protected] = .w2[.w1]++;
			setd ".it_id_"+.w1+"_"[email protected],getarg([email protected]);	// id.
			if(getarg([email protected] + 4,0) != 0) {
				setd ".it_mode_"+.w1+"_"[email protected],getarg([email protected] + 1);	// mode.
				setd ".it_mob_"+.w1+"_"[email protected],getarg([email protected] + 2);	// mob id.
				setd ".it_amt_"+.w1+"_"[email protected],getarg([email protected] + 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;
	[email protected] = getarraysize(.slots);
	while([email protected] < [email protected]) {
		[email protected]_id = getequipid(.slots[[email protected]]);
		[email protected]++;
		if([email protected]_id < 0)
			continue;
		[email protected] = 0;
		while([email protected] < .w1) {
			[email protected] = 0;
			[email protected]_item = false;
			while([email protected] < .w2[[email protected]] && [email protected]_item) {
				[email protected]_evo = getd(".it_id_"[email protected]+"_"[email protected]);
				if([email protected]_id == [email protected]_evo && getd(".it_id_"[email protected]+"_"+([email protected] + 1))) {
					[email protected]_id = getd(".it_mob_"[email protected]+"_"[email protected]);
					if(killedrid == [email protected]_id || [email protected]_id < 1001) {
						if(getd(".it_mode_"[email protected]+"_"[email protected]) == 1) {
							[email protected] = getd("mobs_"[email protected]_id) + 1;
							setd "mobs_"[email protected]_id,[email protected];
							if([email protected] < getd(".it_amt_"[email protected]+"_"[email protected])) continue;
							setd "mobs_"[email protected]_id,0;
						} else {
							[email protected] = getd("exp_"[email protected]_id) + strmobinfo(6,killedrid);
							setd "exp_"[email protected]_id,[email protected];
							if([email protected] < getd(".it_amt_"[email protected]+"_"[email protected])) continue;
							setd "exp_"[email protected]_id,0;
						}
						specialeffect2 EF_BEGINSPELL6;
						sleep2 rand(190,280);
						specialeffect2 EF_ENERGYDRAIN3;
						[email protected] = getd("evo_"[email protected]_id);
						if([email protected] < 100) {
							setd "evo_"[email protected]_id,[email protected];
							announce getitemname([email protected]_id)+": "[email protected]+"%.",bc_self,"0x"+.c$[0];
						}
						if([email protected] >= 100 && .auto) {
							specialeffect2 EF_GUMGANG3;
							sleep2 500;
							specialeffect2 EF_BASH3D2;
							sleep2 300;
							specialeffect2 EF_BLUEBODY;
							sleep2 300;
							announce getitemname([email protected]_id)+" est√° evoluindo...",bc_self,"0x"+.c$[1];
							[email protected] = 3;
							while([email protected]) {
								specialeffect2 EF_DOUBLECASTBODY;
								sleep2 900;
							}
							specialeffect2 EF_STORMKICK5;
							sleep2 200;
							specialeffect2 EF_BUBBLE_DROP;
							sleep2 500;
							if([email protected]) {
								getinventorylist;
								[email protected] = true;
							}
							[email protected] = inarray(@inventorylist_id,[email protected]_id);
							if([email protected] != -1) {
								if([email protected]_expire[[email protected]]) {
									setarray [email protected][0],@inventorylist_id[[email protected]],@inventorylist_refine[[email protected]],@inventorylist_card1[[email protected]],@inventorylist_card2[[email protected]],@inventorylist_card3[[email protected]],@inventorylist_card4[[email protected]];
									setarray [email protected][0],@inventorylist_option_id1[[email protected]],@inventorylist_option_id2[[email protected]],@inventorylist_option_id3[[email protected]],@inventorylist_option_id4[[email protected]],@inventorylist_option_id5[[email protected]];
									setarray [email protected][0],@inventorylist_option_value1[[email protected]],@inventorylist_option_value2[[email protected]],@inventorylist_option_value3[[email protected]],@inventorylist_option_value4[[email protected]],@inventorylist_option_value5[[email protected]];
									setarray [email protected][0],@inventorylist_option_parameter1[[email protected]],@inventorylist_option_parameter2[[email protected]],@inventorylist_option_parameter3[[email protected]],@inventorylist_option_parameter4[[email protected]],@inventorylist_option_parameter5[[email protected]];
									[email protected] = @inventorylist_bound[[email protected]];
								} else {
									continue;
								}
								[email protected]_item = getd(".it_id_"[email protected]+"_"+([email protected] + 1));
								if(getarraysize([email protected])){
									delitem3 [email protected][0],1,1,[email protected][1],0,[email protected][2],[email protected][3],[email protected][4],[email protected][5],[email protected],[email protected],[email protected];
									if([email protected])
										getitembound3 [email protected]_item,1,1,[email protected][1],0,[email protected][2],[email protected][3],[email protected][4],[email protected][5],Bound_Account,[email protected],[email protected],[email protected];
									else
										getitem3 [email protected]_item,1,1,[email protected][1],0,[email protected][2],[email protected][3],[email protected][4],[email protected][5],[email protected],[email protected],[email protected];
								} else {
									delitem2 [email protected][0],1,1,[email protected][1],0,[email protected][2],[email protected][3],[email protected][4],[email protected][5];
									if([email protected])
										getitembound2 [email protected]_item,1,1,[email protected][1],0,[email protected][2],[email protected][3],[email protected][4],[email protected][5],Bound_Account;
									else
										getitem2 [email protected]_item,1,1,[email protected][1],0,[email protected][2],[email protected][3],[email protected][4],[email protected][5];
								}
								equip [email protected]_item;
								setd "evo_"[email protected]_id,0;
								announce "Parab√©ns!! Sua "+getitemname([email protected]_id)+" evoluiu para "+getitemname([email protected]_item)+".",bc_self,"0x"+.c$[2];
							}
							[email protected]_item = true;
						} else if([email protected]_id == [email protected]_evo) {
							[email protected] = .w2[[email protected]];
						}
					}
				}
				[email protected]++;
			}
			[email protected]++;
		}
	}
	@evolve_inuse = false;
	end;

	function	add_item	{

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

	}

}

 

Share this post


Link to post
Share on other sites
  • 0
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([email protected]) {
		// Cache. That old loop on every mob killed...
		if(@evo_var[0] && isequipped(@evo_var[0])) {
			[email protected]_item = true;
			[email protected]_id = @evo_var[0];
			[email protected] = @evo_var[1] - 1;
			[email protected] = @evo_var[2] - 1;
			[email protected] = @evo_var[3];
			[email protected]_id = getd(".it_mob_"[email protected]+"_"[email protected]);
			if(killedrid != [email protected]_id && [email protected]_id > 1001)
				end;
		} else {
			[email protected] = getarraysize(.slots);
			while([email protected] < [email protected] && [email protected]_item) {
				[email protected]_id = getequipid(.slots[[email protected]]);
				[email protected]++;
				if([email protected]_id < 0)
					continue;
				[email protected] = 0;
				while([email protected] < .w1 && [email protected]_item) {
					[email protected] = 0;
					while([email protected] < .w2[[email protected]] && [email protected]_item) {
						[email protected]_evo = getd(".it_id_"[email protected]+"_"[email protected]);
						if([email protected]_id == [email protected]_evo && getd(".it_id_"[email protected]+"_"+([email protected] + 1))) {
							[email protected]_id = getd(".it_mob_"[email protected]+"_"[email protected]);
							if(killedrid == [email protected]_id || [email protected]_id < 1001) {
								[email protected]_item = true;
								setarray @evo_var[0],[email protected]_id,[email protected] + 1,[email protected] + 1,[email protected];
							}
						} else if([email protected]_id == [email protected]_evo) {
							[email protected] = .w2[[email protected]];
						}
						if([email protected]_item)
							[email protected]++;
					}
					if([email protected]_item)
						[email protected]++;
				}
			}
		}
		if([email protected]_item) {
			if(getd(".it_mode_"[email protected]+"_"[email protected]) == 1) {
				[email protected] = getd("mobs_"[email protected]_id) + 1;
				setd "mobs_"[email protected]_id,[email protected];
				if([email protected] < getd(".it_amt_"[email protected]+"_"[email protected])) end;
				setd "mobs_"[email protected]_id,0;
			} else {
				[email protected] = getd("exp_"[email protected]_id) + strmobinfo(6,killedrid);
				setd "exp_"[email protected]_id,[email protected];
				if([email protected] < getd(".it_amt_"[email protected]+"_"[email protected])) end;
				setd "exp_"[email protected]_id,0;
			}
			specialeffect2 EF_BEGINSPELL6;
			sleep2 rand(190,280);
			specialeffect2 EF_ENERGYDRAIN3;
			[email protected] = getd("evo_"[email protected]_id);
			if([email protected] < 100) {
				setd "evo_"[email protected]_id,[email protected];
				announce getitemname([email protected]_id)+": "[email protected]+"%.",bc_self,"0x"+.c$[0];
			}
			if([email protected] >= 100 && .auto && [email protected]) {
				@evolving = true;
				specialeffect2 EF_GUMGANG3;
				sleep2 500;
				specialeffect2 EF_BASH3D2;
				sleep2 300;
				specialeffect2 EF_BLUEBODY;
				sleep2 300;
				announce getitemname([email protected]_id)+" est√° evoluindo...",bc_self,"0x"+.c$[1];
				[email protected] = 3;
				while([email protected]) {
					specialeffect2 EF_DOUBLECASTBODY;
					sleep2 900;
				}
				specialeffect2 EF_STORMKICK5;
				sleep2 200;
				specialeffect2 EF_BUBBLE_DROP;
				sleep2 500;
				getinventorylist;
				[email protected] = inarray(@inventorylist_id,[email protected]_id);
				if([email protected] != -1) {
					if([email protected]_expire[[email protected]]) {
						setarray [email protected],@inventorylist_id[[email protected]],@inventorylist_refine[[email protected]],@inventorylist_card1[[email protected]],@inventorylist_card2[[email protected]],@inventorylist_card3[[email protected]],@inventorylist_card4[[email protected]];
						setarray [email protected],@inventorylist_option_id1[[email protected]],@inventorylist_option_id2[[email protected]],@inventorylist_option_id3[[email protected]],@inventorylist_option_id4[[email protected]],@inventorylist_option_id5[[email protected]];
						setarray [email protected],@inventorylist_option_value1[[email protected]],@inventorylist_option_value2[[email protected]],@inventorylist_option_value3[[email protected]],@inventorylist_option_value4[[email protected]],@inventorylist_option_value5[[email protected]];
						setarray [email protected],@inventorylist_option_parameter1[[email protected]],@inventorylist_option_parameter2[[email protected]],@inventorylist_option_parameter3[[email protected]],@inventorylist_option_parameter4[[email protected]],@inventorylist_option_parameter5[[email protected]];
						[email protected] = @inventorylist_bound[[email protected]];
					} else {
						@evolving = false;
					}
					if(@evolving) {
						[email protected]_item = getd(".it_id_"[email protected]+"_"+([email protected] + 1));
						if(getarraysize([email protected])){
							delitem3 [email protected][0],1,1,[email protected][1],0,[email protected][2],[email protected][3],[email protected][4],[email protected][5],[email protected],[email protected],[email protected];
							if([email protected])
								getitembound3 [email protected]_item,1,1,[email protected][1],0,[email protected][2],[email protected][3],[email protected][4],[email protected][5],Bound_Account,[email protected],[email protected],[email protected];
							else
								getitem3 [email protected]_item,1,1,[email protected][1],0,[email protected][2],[email protected][3],[email protected][4],[email protected][5],[email protected],[email protected],[email protected];
						} else {
							delitem2 [email protected][0],1,1,[email protected][1],0,[email protected][2],[email protected][3],[email protected][4],[email protected][5];
							if([email protected])
								getitembound2 [email protected]_item,1,1,[email protected][1],0,[email protected][2],[email protected][3],[email protected][4],[email protected][5],Bound_Account;
							else
								getitem2 [email protected]_item,1,1,[email protected][1],0,[email protected][2],[email protected][3],[email protected][4],[email protected][5];
						}
						equip [email protected]_item;
						setd "evo_"[email protected]_id,0;
						deletearray @evo_var;
						announce "Parab√©ns!! Sua "+getitemname([email protected]_id)+" evoluiu para "+getitemname([email protected]_item)+".",bc_self,"0x"+.c$[2];
						@evolving = false;
					}
				}
			}
		}
	}
	end;

	function	add_item	{

		for([email protected] = getargcount();[email protected] < [email protected];[email protected]+= 4) {
			[email protected] = .w2[.w1]++;
			setd ".it_id_"+.w1+"_"[email protected],getarg([email protected]);	// id.
			if(getarg([email protected] + 4,0) != 0) {
				setd ".it_mode_"+.w1+"_"[email protected],getarg([email protected] + 1);	// mode.
				setd ".it_mob_"+.w1+"_"[email protected],getarg([email protected] + 2);	// mob id.
				setd ".it_amt_"+.w1+"_"[email protected],getarg([email protected] + 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;
	[email protected] = getarraysize(.slots);
	while([email protected] < [email protected]) {
		[email protected]_id = getequipid(.slots[[email protected]]);
		[email protected]++;
		if([email protected]_id < 0)
			continue;
		[email protected] = 0;
		while([email protected] < .w1) {
			[email protected] = 0;
			[email protected]_item = false;
			while([email protected] < .w2[[email protected]] && [email protected]_item) {
				[email protected]_evo = getd(".it_id_"[email protected]+"_"[email protected]);
				if([email protected]_id == [email protected]_evo && getd(".it_id_"[email protected]+"_"+([email protected] + 1))) {
					[email protected]_id = getd(".it_mob_"[email protected]+"_"[email protected]);
					if(killedrid == [email protected]_id || [email protected]_id < 1001) {
						if(getd(".it_mode_"[email protected]+"_"[email protected]) == 1) {
							[email protected] = getd("mobs_"[email protected]_id) + 1;
							setd "mobs_"[email protected]_id,[email protected];
							if([email protected] < getd(".it_amt_"[email protected]+"_"[email protected])) continue;
							setd "mobs_"[email protected]_id,0;
						} else {
							[email protected] = getd("exp_"[email protected]_id) + strmobinfo(6,killedrid);
							setd "exp_"[email protected]_id,[email protected];
							if([email protected] < getd(".it_amt_"[email protected]+"_"[email protected])) continue;
							setd "exp_"[email protected]_id,0;
						}
						specialeffect2 EF_BEGINSPELL6;
						sleep2 rand(190,280);
						specialeffect2 EF_ENERGYDRAIN3;
						[email protected] = getd("evo_"[email protected]_id);
						if([email protected] < 100) {
							setd "evo_"[email protected]_id,[email protected];
							announce getitemname([email protected]_id)+": "[email protected]+"%.",bc_self,"0x"+.c$[0];
						}
						if([email protected] >= 100 && .auto) {
							specialeffect2 EF_GUMGANG3;
							sleep2 500;
							specialeffect2 EF_BASH3D2;
							sleep2 300;
							specialeffect2 EF_BLUEBODY;
							sleep2 300;
							announce getitemname([email protected]_id)+" est√° evoluindo...",bc_self,"0x"+.c$[1];
							[email protected] = 3;
							while([email protected]) {
								specialeffect2 EF_DOUBLECASTBODY;
								sleep2 900;
							}
							specialeffect2 EF_STORMKICK5;
							sleep2 200;
							specialeffect2 EF_BUBBLE_DROP;
							sleep2 500;
							if([email protected]) {
								getinventorylist;
								[email protected] = true;
							}
							[email protected] = inarray(@inventorylist_id,[email protected]_id);
							if([email protected] != -1) {
								if([email protected]_expire[[email protected]]) {
									setarray [email protected][0],@inventorylist_id[[email protected]],@inventorylist_refine[[email protected]],@inventorylist_card1[[email protected]],@inventorylist_card2[[email protected]],@inventorylist_card3[[email protected]],@inventorylist_card4[[email protected]];
									setarray [email protected][0],@inventorylist_option_id1[[email protected]],@inventorylist_option_id2[[email protected]],@inventorylist_option_id3[[email protected]],@inventorylist_option_id4[[email protected]],@inventorylist_option_id5[[email protected]];
									setarray [email protected][0],@inventorylist_option_value1[[email protected]],@inventorylist_option_value2[[email protected]],@inventorylist_option_value3[[email protected]],@inventorylist_option_value4[[email protected]],@inventorylist_option_value5[[email protected]];
									setarray [email protected][0],@inventorylist_option_parameter1[[email protected]],@inventorylist_option_parameter2[[email protected]],@inventorylist_option_parameter3[[email protected]],@inventorylist_option_parameter4[[email protected]],@inventorylist_option_parameter5[[email protected]];
									[email protected] = @inventorylist_bound[[email protected]];
								} else {
									continue;
								}
								[email protected]_item = getd(".it_id_"[email protected]+"_"+([email protected] + 1));
								if(getarraysize([email protected])){
									delitem3 [email protected][0],1,1,[email protected][1],0,[email protected][2],[email protected][3],[email protected][4],[email protected][5],[email protected],[email protected],[email protected];
									if([email protected])
										getitembound3 [email protected]_item,1,1,[email protected][1],0,[email protected][2],[email protected][3],[email protected][4],[email protected][5],Bound_Account,[email protected],[email protected],[email protected];
									else
										getitem3 [email protected]_item,1,1,[email protected][1],0,[email protected][2],[email protected][3],[email protected][4],[email protected][5],[email protected],[email protected],[email protected];
								} else {
									delitem2 [email protected][0],1,1,[email protected][1],0,[email protected][2],[email protected][3],[email protected][4],[email protected][5];
									if([email protected])
										getitembound2 [email protected]_item,1,1,[email protected][1],0,[email protected][2],[email protected][3],[email protected][4],[email protected][5],Bound_Account;
									else
										getitem2 [email protected]_item,1,1,[email protected][1],0,[email protected][2],[email protected][3],[email protected][4],[email protected][5];
								}
								equip [email protected]_item;
								setd "evo_"[email protected]_id,0;
								announce "Parab√©ns!! Sua "+getitemname([email protected]_id)+" evoluiu para "+getitemname([email protected]_item)+".",bc_self,"0x"+.c$[2];
							}
							[email protected]_item = true;
						} else if([email protected]_id == [email protected]_evo) {
							[email protected] = .w2[[email protected]];
						}
					}
				}
				[email protected]++;
			}
			[email protected]++;
		}
	}
	@evolve_inuse = false;
	end;

	function	add_item	{

		for([email protected] = getargcount();[email protected] < [email protected];[email protected]+= 4) {
			[email protected] = .w2[.w1]++;
			setd ".it_id_"+.w1+"_"[email protected],getarg([email protected]);	// id.
			if(getarg([email protected] + 4,0) != 0) {
				setd ".it_mode_"+.w1+"_"[email protected],getarg([email protected] + 1);	// mode.
				setd ".it_mob_"+.w1+"_"[email protected],getarg([email protected] + 2);	// mob id.
				setd ".it_amt_"+.w1+"_"[email protected],getarg([email protected] + 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)

Share this post


Link to post
Share on other sites
  • 0

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.

Share this post


Link to post
Share on other sites
  • 0
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;
	[email protected] = getarraysize(.slots);
	while([email protected] < [email protected]) {
		[email protected]_id = getequipid(.slots[[email protected]]);
		[email protected]++;
		if([email protected]_id < 0)
			continue;
		[email protected] = 0;
		while([email protected] < .w1) {
			[email protected] = 0;
			[email protected]_item = false;
			while([email protected] < .w2[[email protected]] && [email protected]_item) {
				[email protected]_evo = getd(".it_id_"[email protected]+"_"[email protected]);
				if([email protected]_id == [email protected]_evo && getd(".it_id_"[email protected]+"_"+([email protected] + 1))) {
					[email protected]_id = getd(".it_mob_"[email protected]+"_"[email protected]);
					if(killedrid == [email protected]_id || [email protected]_id < 1001) {
						if(getd(".it_mode_"[email protected]+"_"[email protected]) == 1) {
							[email protected] = getd("mobs_"[email protected]_id) + 1;
							setd "mobs_"[email protected]_id,[email protected];
							if([email protected] < getd(".it_amt_"[email protected]+"_"[email protected])) continue;
							setd "mobs_"[email protected]_id,0;
						} else {
							[email protected] = getd("exp_"[email protected]_id) + strmobinfo(6,killedrid);
							setd "exp_"[email protected]_id,[email protected];
							if([email protected] < getd(".it_amt_"[email protected]+"_"[email protected])) continue;
							setd "exp_"[email protected]_id,0;
						}
						specialeffect2 EF_BEGINSPELL6;
						sleep2 rand(190,280);
						specialeffect2 EF_ENERGYDRAIN3;
						[email protected] = getd("evo_"[email protected]_id);
						if([email protected] < 100) {
							setd "evo_"[email protected]_id,[email protected];
							announce getitemname([email protected]_id)+": "[email protected]+"%.",bc_self,"0x"+.c$[0];
						}
						if([email protected] >= 100 && .auto) {
							specialeffect2 EF_GUMGANG3;
							sleep2 500;
							specialeffect2 EF_BASH3D2;
							sleep2 300;
							specialeffect2 EF_BLUEBODY;
							sleep2 300;
							announce getitemname([email protected]_id)+" est√° evoluindo...",bc_self,"0x"+.c$[1];
							[email protected] = 3;
							while([email protected]) {
								specialeffect2 EF_DOUBLECASTBODY;
								sleep2 900;
							}
							specialeffect2 EF_STORMKICK5;
							sleep2 200;
							specialeffect2 EF_BUBBLE_DROP;
							sleep2 500;
							if([email protected]) {
								getinventorylist;
								[email protected] = true;
							}
							[email protected] = inarray(@inventorylist_id,[email protected]_id);
							if([email protected] != -1) {
								if([email protected]_expire[[email protected]]) {
									setarray [email protected][0],@inventorylist_id[[email protected]],@inventorylist_refine[[email protected]],@inventorylist_card1[[email protected]],@inventorylist_card2[[email protected]],@inventorylist_card3[[email protected]],@inventorylist_card4[[email protected]];
									setarray [email protected][0],@inventorylist_option_id1[[email protected]],@inventorylist_option_id2[[email protected]],@inventorylist_option_id3[[email protected]],@inventorylist_option_id4[[email protected]],@inventorylist_option_id5[[email protected]];
									setarray [email protected][0],@inventorylist_option_value1[[email protected]],@inventorylist_option_value2[[email protected]],@inventorylist_option_value3[[email protected]],@inventorylist_option_value4[[email protected]],@inventorylist_option_value5[[email protected]];
									setarray [email protected][0],@inventorylist_option_parameter1[[email protected]],@inventorylist_option_parameter2[[email protected]],@inventorylist_option_parameter3[[email protected]],@inventorylist_option_parameter4[[email protected]],@inventorylist_option_parameter5[[email protected]];
									[email protected] = @inventorylist_bound[[email protected]];
								} else {
									continue;
								}
								[email protected]_item = getd(".it_id_"[email protected]+"_"+([email protected] + 1));
								if(getarraysize([email protected])){
									delitem3 [email protected][0],1,1,[email protected][1],0,[email protected][2],[email protected][3],[email protected][4],[email protected][5],[email protected],[email protected],[email protected];
									if([email protected])
										getitembound3 [email protected]_item,1,1,[email protected][1],0,[email protected][2],[email protected]nfo[3],[email protected][4],[email protected][5],Bound_Account,[email protected],[email protected],[email protected];
									else
										getitem3 [email protected]_item,1,1,[email protected][1],0,[email protected][2],[email protected][3],[email protected][4],[email protected][5],[email protected],[email protected],[email protected];
								} else {
									delitem2 [email protected][0],1,1,[email protected][1],0,[email protected][2],[email protected][3],[email protected][4],[email protected][5];
									if([email protected])
										getitembound2 [email protected]_item,1,1,[email protected][1],0,[email protected][2],[email protected][3],[email protected][4],[email protected][5],Bound_Account;
									else
										getitem2 [email protected]_item,1,1,[email protected][1],0,[email protected][2],[email protected][3],[email protected][4],[email protected][5];
								}
								equip [email protected]_item;
								setd "evo_"[email protected]_id,0;
								announce "Parab√©ns!! Sua "+getitemname([email protected]_id)+" evoluiu para "+getitemname([email protected]_item)+".",bc_self,"0x"+.c$[2];
							}
							[email protected]_item = true;
						} else if([email protected]_id == [email protected]_evo) {
							[email protected] = .w2[[email protected]];
						}
					}
				}
				[email protected]++;
			}
			[email protected]++;
		}
	}
	@evolve_inuse = false;
	end;

	function	add_item	{

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

	}

}

 

Share this post


Link to post
Share on other sites
  • 0

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;
	[email protected] = getarraysize(.slots);
	while([email protected] < [email protected]) {
		[email protected]_id = getequipid(.slots[[email protected]]);
		[email protected]++;
		if([email protected]_id < 0)
			continue;
		[email protected] = 0;
		while([email protected] < .w1) {
			[email protected] = 0;
			[email protected]_item = false;
			while([email protected] < .w2[[email protected]] && [email protected]_item) {
				[email protected]_percent = false;
				[email protected]_evo = getd(".it_id_"[email protected]+"_"[email protected]);
				if([email protected]_id == [email protected]_evo && getd(".it_id_"[email protected]+"_"+([email protected] + 1))) {
					[email protected]_item = true;
					[email protected]_id = getd(".it_mob_"[email protected]+"_"[email protected]);
					if(killedrid == [email protected]_id || [email protected]_id < 1001) {
						if(getd(".it_mode_"[email protected]+"_"[email protected]) == 1) {
							[email protected] = getd("mobs_"[email protected]_id) + 1;
							setd "mobs_"[email protected]_id,[email protected];
							if([email protected] < getd(".it_amt_"[email protected]+"_"[email protected])) [email protected]_percent = true;
						} else {
							[email protected] = getd("exp_"[email protected]_id) + strmobinfo(6,killedrid);
							setd "exp_"[email protected]_id,[email protected];
							if([email protected] < getd(".it_amt_"[email protected]+"_"[email protected])) [email protected]_percent = true;
						}
						if([email protected]_percent) {
							setd "mobs_"[email protected]_id,0;
							setd "exp_"[email protected]_id,0;
							specialeffect2 EF_BEGINSPELL6;
							sleep2 rand(190,280);
							specialeffect2 EF_ENERGYDRAIN3;
							[email protected] = getd("evo_"[email protected]_id);
							if([email protected] < 100) {
								setd "evo_"[email protected]_id,[email protected];
								announce getitemname([email protected]_id)+": "[email protected]+"%.",bc_self,"0x"+.c$[0];
							}
							if([email protected] >= 100 && .auto) {
								specialeffect2 EF_GUMGANG3;
								sleep2 500;
								specialeffect2 EF_BASH3D2;
								sleep2 300;
								specialeffect2 EF_BLUEBODY;
								sleep2 300;
								announce getitemname([email protected]_id)+" est√° evoluindo...",bc_self,"0x"+.c$[1];
								[email protected] = 3;
								while([email protected]) {
									specialeffect2 EF_DOUBLECASTBODY;
									sleep2 900;
								}
								specialeffect2 EF_STORMKICK5;
								sleep2 200;
								specialeffect2 EF_BUBBLE_DROP;
								sleep2 500;
								if([email protected]) {
									getinventorylist;
									[email protected] = true;
								}
								[email protected] = inarray(@inventorylist_id,[email protected]_id);
								if([email protected] != -1) {
									if([email protected]_expire[[email protected]]) {
										setarray [email protected][0],@inventorylist_id[[email protected]],@inventorylist_refine[[email protected]],@inventorylist_card1[[email protected]],@inventorylist_card2[[email protected]],@inventorylist_card3[[email protected]],@inventorylist_card4[[email protected]];
										setarray [email protected][0],@inventorylist_option_id1[[email protected]],@inventorylist_option_id2[[email protected]],@inventorylist_option_id3[[email protected]],@inventorylist_option_id4[[email protected]],@inventorylist_option_id5[[email protected]];
										setarray [email protected][0],@inventorylist_option_value1[[email protected]],@inventorylist_option_value2[[email protected]],@inventorylist_option_value3[[email protected]],@inventorylist_option_value4[[email protected]],@inventorylist_option_value5[[email protected]];
										setarray [email protected][0],@inventorylist_option_parameter1[[email protected]],@inventorylist_option_parameter2[[email protected]],@inventorylist_option_parameter3[[email protected]],@inventorylist_option_parameter4[[email protected]],@inventorylist_option_parameter5[[email protected]];
										[email protected] = @inventorylist_bound[[email protected]];
									} else {
										continue;
									}
									[email protected]_item = getd(".it_id_"[email protected]+"_"+([email protected] + 1));
									if(getarraysize([email protected])){
									delitem3 [email protected][0],1,1,[email protected][1],0,[email protected][2],[email protected][3],[email protected][4],[email protected][5],[email protected],[email protected],[email protected];
									if([email protected])
										getitembound3 [email protected]_item,1,1,[email protected][1],0,[email protected][2],[email protected][3],[email protected][4],[email protected][5],Bound_Account,[email protected],[email protected],[email protected];
									else
										getitem3 [email protected]_item,1,1,[email protected][1],0,[email protected][2],[email protected][3],[email protected][4],[email protected][5],[email protected],[email protected],[email protected];
									} else {
										delitem2 [email protected][0],1,1,[email protected][1],0,[email protected][2],[email protected][3],[email protected][4],[email protected][5];
										if([email protected])
											getitembound2 [email protected]_item,1,1,[email protected][1],0,[email protected][2],[email protected][3],[email protected][4],[email protected][5],Bound_Account;
										else
											getitem2 [email protected]_item,1,1,[email protected][1],0,[email protected][2],[email protected][3],[email protected][4],[email protected][5];
									}
									equip [email protected]_item;
									setd "evo_"[email protected]_id,0;
									announce "Parab√©ns!! Sua "+getitemname([email protected]_id)+" evoluiu para "+getitemname([email protected]_item)+".",bc_self,"0x"+.c$[2];
								}
							}
						} else if([email protected]_id == [email protected]_evo) {
							[email protected]_item = true;
						}
					}
				}
				[email protected]++;
			}
			[email protected]++;
		}
	}
	@evolve_inuse = false;
	end;

	function	add_item	{

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

	}

}

 

Share this post


Link to post
Share on other sites
  • 0
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;
	[email protected] = getarraysize(.slots);
	while([email protected] < [email protected]) {
		[email protected]_id = getequipid(.slots[[email protected]]);
		[email protected]++;
		if([email protected]_id < 0)
			continue;
		[email protected] = 0;
		while([email protected] < .w1) {
			[email protected] = 0;
			[email protected]_item = false;
			while([email protected] < .w2[[email protected]] && [email protected]_item) {
				[email protected]_percent = false;
				[email protected]_evo = getd(".it_id_"[email protected]+"_"[email protected]);
				if([email protected]_id == [email protected]_evo && getd(".it_id_"[email protected]+"_"+([email protected] + 1))) {
					[email protected]_item = true;
					[email protected]_id = getd(".it_mob_"[email protected]+"_"[email protected]);
					if(killedrid == [email protected]_id || [email protected]_id < 1001) {
						if(getd(".it_mode_"[email protected]+"_"[email protected]) == 1) {
							[email protected] = getd("mobs_"[email protected]_id) + 1;
							setd "mobs_"[email protected]_id,[email protected];
							if([email protected] < getd(".it_amt_"[email protected]+"_"[email protected])) [email protected]_percent = true;
						} else {
							[email protected] = getd("exp_"[email protected]_id) + strmobinfo(6,killedrid);
							setd "exp_"[email protected]_id,[email protected];
							if([email protected] < getd(".it_amt_"[email protected]+"_"[email protected])) [email protected]_percent = true;
						}
						if([email protected]_percent) {
							setd "mobs_"[email protected]_id,0;
							setd "exp_"[email protected]em_id,0;
							specialeffect2 EF_BEGINSPELL6;
							sleep2 rand(190,280);
							specialeffect2 EF_ENERGYDRAIN3;
							[email protected] = getd("evo_"[email protected]_id);
							if([email protected] < 100) {
								setd "evo_"[email protected]_id,[email protected];
								announce getitemname([email protected]_id)+": "[email protected]+"%.",bc_self,"0x"+.c$[0];
							}
							if([email protected] >= 100 && .auto) {
								specialeffect2 EF_GUMGANG3;
								sleep2 500;
								specialeffect2 EF_BASH3D2;
								sleep2 300;
								specialeffect2 EF_BLUEBODY;
								sleep2 300;
								announce getitemname([email protected]_id)+" est√° evoluindo...",bc_self,"0x"+.c$[1];
								[email protected] = 3;
								while([email protected]) {
									specialeffect2 EF_DOUBLECASTBODY;
									sleep2 900;
								}
								specialeffect2 EF_STORMKICK5;
								sleep2 200;
								specialeffect2 EF_BUBBLE_DROP;
								sleep2 500;
								if([email protected]) {
									getinventorylist;
									[email protected] = true;
								}
								[email protected] = inarray(@inventorylist_id,[email protected]_id);
								if([email protected] != -1) {
									if([email protected]_expire[[email protected]]) {
										setarray [email protected][0],@inventorylist_id[[email protected]],@inventorylist_refine[[email protected]],@inventorylist_card1[[email protected]],@inventorylist_card2[[email protected]],@inventorylist_card3[[email protected]],@inventorylist_card4[[email protected]];
										setarray [email protected][0],@inventorylist_option_id1[[email protected]],@inventorylist_option_id2[[email protected]],@inventorylist_option_id3[[email protected]],@inventorylist_option_id4[[email protected]],@inventorylist_option_id5[[email protected]];
										setarray [email protected][0],@inventorylist_option_value1[[email protected]],@inventorylist_option_value2[[email protected]],@inventorylist_option_value3[[email protected]],@inventorylist_option_value4[[email protected]],@inventorylist_option_value5[[email protected]];
										setarray [email protected][0],@inventorylist_option_parameter1[[email protected]],@inventorylist_option_parameter2[[email protected]],@inventorylist_option_parameter3[[email protected]],@inventorylist_option_parameter4[[email protected]],@inventorylist_option_parameter5[[email protected]];
										[email protected] = @inventorylist_bound[[email protected]];
									} else {
										continue;
									}
									[email protected]_item = getd(".it_id_"[email protected]+"_"+([email protected] + 1));
									if(getarraysize([email protected])){
									delitem3 [email protected][0],1,1,[email protected][1],0,[email protected][2],[email protected][3],[email protected][4],[email protected][5],[email protected],[email protected],[email protected];
									if([email protected])
										getitembound3 [email protected]_item,1,1,[email protected][1],0,[email protected][2],[email protected][3],[email protected][4],[email protected][5],Bound_Account,[email protected],[email protected],[email protected];
									else
										getitem3 [email protected]_item,1,1,[email protected][1],0,[email protected][2],[email protected][3],[email protected][4],[email protected][5],[email protected],[email protected],[email protected];
									} else {
										delitem2 [email protected][0],1,1,[email protected][1],0,[email protected][2],[email protected][3],[email protected][4],[email protected][5];
										if([email protected])
											getitembound2 [email protected]_item,1,1,[email protected][1],0,[email protected][2],[email protected][3],[email protected][4],[email protected][5],Bound_Account;
										else
											getitem2 [email protected]_item,1,1,[email protected][1],0,[email protected][2],[email protected][3],[email protected][4],[email protected][5];
									}
									equip [email protected]_item;
									setd "evo_"[email protected]_id,0;
									announce "Parab√©ns!! Sua "+getitemname([email protected]_id)+" evoluiu para "+getitemname([email protected]_item)+".",bc_self,"0x"+.c$[2];
								}
							}
						} else if([email protected]_id == [email protected]_evo) {
							[email protected]_item = true;
						}
					}
				}
				[email protected]++;
			}
			[email protected]++;
		}
	}
	@evolve_inuse = false;
	end;

	function	add_item	{

		for([email protected] = getargcount();[email protected] < [email protected];[email protected]+= 4) {
			[email protected] = .w2[.w1]++;
			setd ".it_id_"+.w1+"_"[email protected],getarg([email protected]);	// id.
			if(getarg([email protected] + 4,0) != 0) {
				setd ".it_mode_"+.w1+"_"[email protected],getarg([email protected] + 1);	// mode.
				setd ".it_mob_"+.w1+"_"[email protected],getarg([email protected] + 2);	// mob id.
				setd ".it_amt_"+.w1+"_"[email protected],getarg([email protected] + 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 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now