Jump to content
  • 0

Can't keep refine, cards and enchants after evolve


Rizta

Question


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

Hi community, is me again! ? 

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

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


 

Spoiler

-	script	Items_Conf	-1,{

OnInit:

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

Evolution modes:

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

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

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

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

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

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

	.w1 = 0;

	end ;

Ids:

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

OnNPCKillEvent:

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

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

 

 

Link to comment
Share on other sites

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  25
  • Topics Per Day:  0.01
  • Content Count:  924
  • Reputation:   166
  • Joined:  04/05/13
  • Last Seen:  

Simply try to change

setarray .@card[1], getequipcardid ( .slots[.@a], 0 ), getequipcardid ( .slots[.@a], 1 ), getequipcardid ( .slots[.@a], 2 ), getequipcardid ( .slots[.@a], 3 );
			.@refine = getequiprefinerycnt (.slots[.@a]);
			delitem .@e, 1;
			getitem2 getd ( ".a1"+ .@w +"_"+ ( .@id + 1 ) ) , 1, 1, .@refine, 0, .@card[1], .@card[2], .@card[3], .@card[4];//.@Oid, .@Oval, .@Opam;
			

to

.@cardSlot1 = getequipcardid(.slots[.@a],0);
			.@cardSlot2 = getequipcardid(.slots[.@a],1);
			.@cardSlot3 = getequipcardid(.slots[.@a],2);
			.@cardSlot4 = getequipcardid(.slots[.@a],3);
			.@refine = getequiprefinerycnt (.slots[.@a]);
			dispbottom "Card slot 1: "+.@cardSlot1+"";
			dispbottom "Card slot 2: "+.@cardSlot2+"";
			dispbottom "Card slot 3: "+.@cardSlot3+"";
			dispbottom "Card slot 4: "+.@cardSlot4+"";
			dispbottom "Refine: "+.@refine+"";
			delitem .@e, 1;
			getitem2 getd(".a1"+.@w+"_"+(.@id+1)),1,1,.@refine,0,.@cardSlot1,.@cardSlot2,.@cardSlot3,.@cardSlot4;

 

And see what happen. if card doesn't had value then you need to change above code.

Link to comment
Share on other sites

  • 0

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

On 9/3/2018 at 1:21 AM, TARTs said:

Simply try to change


setarray .@card[1], getequipcardid ( .slots[.@a], 0 ), getequipcardid ( .slots[.@a], 1 ), getequipcardid ( .slots[.@a], 2 ), getequipcardid ( .slots[.@a], 3 );
			.@refine = getequiprefinerycnt (.slots[.@a]);
			delitem .@e, 1;
			getitem2 getd ( ".a1"+ .@w +"_"+ ( .@id + 1 ) ) , 1, 1, .@refine, 0, .@card[1], .@card[2], .@card[3], .@card[4];//.@Oid, .@Oval, .@Opam;
			

to


.@cardSlot1 = getequipcardid(.slots[.@a],0);
			.@cardSlot2 = getequipcardid(.slots[.@a],1);
			.@cardSlot3 = getequipcardid(.slots[.@a],2);
			.@cardSlot4 = getequipcardid(.slots[.@a],3);
			.@refine = getequiprefinerycnt (.slots[.@a]);
			dispbottom "Card slot 1: "+.@cardSlot1+"";
			dispbottom "Card slot 2: "+.@cardSlot2+"";
			dispbottom "Card slot 3: "+.@cardSlot3+"";
			dispbottom "Card slot 4: "+.@cardSlot4+"";
			dispbottom "Refine: "+.@refine+"";
			delitem .@e, 1;
			getitem2 getd(".a1"+.@w+"_"+(.@id+1)),1,1,.@refine,0,.@cardSlot1,.@cardSlot2,.@cardSlot3,.@cardSlot4;

 

And see what happen. if card doesn't had value then you need to change above code.

Thx for you answer, but i think this only will keep cards and enchants that's placed in card slots. I need a way to keep the random option too so i think ill need use of delitem3/getitem3 and some more codes? 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  25
  • Topics Per Day:  0.01
  • Content Count:  924
  • Reputation:   166
  • Joined:  04/05/13
  • Last Seen:  

Yes, getitem3 is ok.

Keep Random option command

getequiprandomoption(.slots[.@a],2,ROA_ID), getequiprandomoption(.slots[.@a],3,ROA_ID), getequiprandomoption(.slots[.@a],4,ROA_ID);
	setarray .@optVal[0], getequiprandomoption(.slots[.@a],0,ROA_VALUE), getequiprandomoption(.slots[.@a],1,ROA_VALUE), getequiprandomoption(.slots[.@a],2,ROA_VALUE), getequiprandomoption(.slots[.@a],3,ROA_VALUE), getequiprandomoption(.slots[.@a],4,ROA_VALUE);

 

change getitem2 to

getitem3 getd ( ".a1"+ .@w +"_"+ ( .@id + 1 ) ) , 1, 1, .@refine, 0, .@card[1], .@card[2], .@card[3], .@card[4],.@optID, .@optVal, 0;

 

Edited by TARTs
Link to comment
Share on other sites

  • 0

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

1 hour ago, TARTs said:

Yes, getitem3 is ok.

Keep Random option command


getequiprandomoption(.slots[.@a],2,ROA_ID), getequiprandomoption(.slots[.@a],3,ROA_ID), getequiprandomoption(.slots[.@a],4,ROA_ID);
	setarray .@optVal[0], getequiprandomoption(.slots[.@a],0,ROA_VALUE), getequiprandomoption(.slots[.@a],1,ROA_VALUE), getequiprandomoption(.slots[.@a],2,ROA_VALUE), getequiprandomoption(.slots[.@a],3,ROA_VALUE), getequiprandomoption(.slots[.@a],4,ROA_VALUE);

 

change getitem2 to


getitem3 getd ( ".a1"+ .@w +"_"+ ( .@id + 1 ) ) , 1, 1, .@refine, 0, .@card[1], .@card[2], .@card[3], .@card[4],.@optID, .@optVal, 0;

 

So ill only need OptValue ? No need to use OptID (ROA_ID) ? How the script will recognize which random option the weapon has? @TARTs sorry to bother you, i want understand to learn xD

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  25
  • Topics Per Day:  0.01
  • Content Count:  924
  • Reputation:   166
  • Joined:  04/05/13
  • Last Seen:  

setarray .@optId[0],getequiprandomoption(.slots[.@a],0,ROA_ID),getequiprandomoption(.slots[.@a],1,ROA_ID), getequiprandomoption(.slots[.@a],2,ROA_ID), getequiprandomoption(.slots[.@a],3,ROA_ID), getequiprandomoption(.slots[.@a],4,ROA_ID);
	setarray .@optVal[0], getequiprandomoption(.slots[.@a],0,ROA_VALUE), getequiprandomoption(.slots[.@a],1,ROA_VALUE), getequiprandomoption(.slots[.@a],2,ROA_VALUE), getequiprandomoption(.slots[.@a],3,ROA_VALUE), getequiprandomoption(.slots[.@a],4,ROA_VALUE);

 

Edited by TARTs
Link to comment
Share on other sites

  • 0

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

10 hours ago, TARTs said:

setarray .@optId[0],getequiprandomoption(.slots[.@a],0,ROA_ID),getequiprandomoption(.slots[.@a],1,ROA_ID), getequiprandomoption(.slots[.@a],2,ROA_ID), getequiprandomoption(.slots[.@a],3,ROA_ID), getequiprandomoption(.slots[.@a],4,ROA_ID);
	setarray .@optVal[0], getequiprandomoption(.slots[.@a],0,ROA_VALUE), getequiprandomoption(.slots[.@a],1,ROA_VALUE), getequiprandomoption(.slots[.@a],2,ROA_VALUE), getequiprandomoption(.slots[.@a],3,ROA_VALUE), getequiprandomoption(.slots[.@a],4,ROA_VALUE);

  

Spoiler

-	script	Items_Conf	-1,{

OnInit:

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

Evolution modes:

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

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

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

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

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

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

	.w1 = 0;

	end ;

Ids:

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

OnNPCKillEvent:

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

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

 

Error 1:
 

Spoiler

[Error]: buildin_getequiprandomoption: No item equipped at pos 6 (CID=21/AID=2000002).
[Debug]: Source (NPC): Items_Conf (invisible/not on a map)
[Error]: buildin_getequiprandomoption: No item equipped at pos 6 (CID=21/AID=2000002).
[Debug]: Source (NPC): Items_Conf (invisible/not on a map)
[Warning]: Unexpected type for argument 12. Expected variable, got C_INT.
[Debug]: Data: number value=0
[Debug]: Function: getitem3
[Debug]: Source (NPC): Items_Conf (invisible/not on a map)
[Error]: buildin_getitem3: The option param parameter is not an array.
[Debug]: Source (NPC): Items_Conf (invisible/not on a map)
[Error]: buildin_equip: Item 1206 cannot be equipped
[Debug]: Source (NPC): Items_Conf (invisible/not on a map)

 

Error 2:
 

Spoiler

[Warning]: Unexpected type for argument 12. Expected variable, got C_INT.
[Debug]: Data: number value=0
[Debug]: Function: getitem3
[Debug]: Source (NPC): Items_Conf (invisible/not on a map)
[Error]: buildin_getitem3: The option param parameter is not an array.
[Debug]: Source (NPC): Items_Conf (invisible/not on a map)
[Error]: buildin_equip: Item 1203 cannot be equipped
[Debug]: Source (NPC): Items_Conf (invisible/not on a map)

 

@TARTs look is very hard xD

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  25
  • Topics Per Day:  0.01
  • Content Count:  924
  • Reputation:   166
  • Joined:  04/05/13
  • Last Seen:  

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

OnNPCKillEvent:
	if ( @wing[0] && isequipped ( @wing[0] ) )
	{
		.@c  = 1;
		.@e  = @wing[0];
		.@w  = @wing[1];
		.@id = @wing[2];
	}
	else
	{
		for ( .@size = getarraysize ( .slots ); .@a < .@size && !.@c ; .@a++ )
		{
			.@e = getequipid ( .slots[.@a] );
			if ( .@e < 0 )
			continue ;
			.@id = 0;
			.@w = 1;
			while ( .@id++ <= .w2[.@w - 1] && !.@c )
			{
				if ( .@id > .w2[.@w - 1] )
				{
					.@id = 1;
					.@w++;
				}
				if ( .@e == getd ( ".a1"+ .@w +"_"+ .@id ) )
				if ( getd ( ".a4"+ .@w +"_"+ .@id ) > 0 && ( killedrid == getd ( ".a3"+ .@w +"_"+ .@id ) || getd ( ".a3"+ .@w +"_"+ .@id ) < 1001 ) )
				{
					.@c = 1;
					setarray @wing[0], .@e, .@w, .@id;
				}
			}
		}
	}
	if (.@c)
	{
		if (getd(".a2"+.@w+"_"+.@id)==1)
		{
			.@amount = getd("mobs_"+.@e);
			setd "mobs_"+.@e,.@amount+1;
			if (getd("mobs_"+.@e)<getd(".a4"+.@w+"_"+.@id))
			end ;
			setd "evo"+ .@e, getd ( "evo"+ .@e ) + 1;
			setd "mobs_"+ .@e, 0;
		}
		else if(getd(".a2"+.@w+"_"+.@id)==2)
		{
			.@amount = getd ( "exp_"+ .@e );
			setd "exp_"+ .@e, .@amount + strmobinfo ( 6, killedrid );
			if ( getd ( "exp_"+ .@e ) < getd ( ".a4"+ .@w +"_"+ .@id ) )
			end ;
			setd "evo"+ .@e, getd ( "evo"+ .@e ) + 1;
			setd "exp_"+ .@e, 0;
		}
		else
		debugmes "Script Items_Evo, error: wrong mode.";
		
		announce getitemname ( .@e ) +" está com "+ getd ( "evo"+ .@e ) +"% para evoluir...", bc_self, "0x"+ .c$[0] ;
		specialeffect2 58 ;
		specialeffect2 383 ;
		if (getd("evo"+.@e) == 100 && .auto )
		{
			specialeffect2 263 ;
			specialeffect2 377 ;
			specialeffect2 542 ;
			announce getitemname ( .@e ) +" está evoluindo..." , bc_self, "0x"+ .c$[1] ;
			.@i = 3;
			while ( .@i-- )
			{
				specialeffect2 521 ;
			}
			specialeffect2 463 ;
			specialeffect2 665 ;
			.@refine = getequiprefinerycnt (.slots[.@a]);			
			.@card1 = getequipcardid(.slots[.@a],0);
			.@card2 = getequipcardid(.slots[.@a],1);
			.@card3 = getequipcardid(.slots[.@a],2);
			.@card4 = getequipcardid(.slots[.@a],3);
			
			.@optID01 = 0;
			if(getequiprandomoption(.slots[.@a],0,ROA_ID)>0)
			.@optID01 = getequiprandomoption(.slots[.@a],0,ROA_ID);
			.@optID02 = 0;
			if(getequiprandomoption(.slots[.@a],1,ROA_ID)>0)
			.@optID02 = getequiprandomoption(.slots[.@a],1,ROA_ID);
			.@optID03 = 0;
			if(getequiprandomoption(.slots[.@a],2,ROA_ID)>0)
			.@optID03 = getequiprandomoption(.slots[.@a],2,ROA_ID);
			.@optID04 = 0;
			if(getequiprandomoption(.slots[.@a],3,ROA_ID)>0)
			.@optID04 = getequiprandomoption(.slots[.@a],3,ROA_ID);
			.@optID05 = 0;
			if(getequiprandomoption(.slots[.@a],4,ROA_ID)>0)
			.@optID05 = getequiprandomoption(.slots[.@a],4,ROA_ID);
			
			.@optVALUE01 = 0;
			if(getequiprandomoption(.slots[.@a],0,ROA_VALUE)>0)
			.@optVALUE01 = getequiprandomoption(.slots[.@a],0,ROA_VALUE);
			.@optVALUE02 = 0;
			if(getequiprandomoption(.slots[.@a],1,ROA_VALUE)>0)
			.@optVALUE02 = getequiprandomoption(.slots[.@a],1,ROA_VALUE);
			.@optVALUE03 = 0;
			if(getequiprandomoption(.slots[.@a],2,ROA_VALUE)>0)
			.@optVALUE03 = getequiprandomoption(.slots[.@a],2,ROA_VALUE);
			.@optVALUE04 = 0;
			if(getequiprandomoption(.slots[.@a],3,ROA_VALUE)>0)
			.@optVALUE04 = getequiprandomoption(.slots[.@a],3,ROA_VALUE);
			.@optVALUE05 = 0;
			if(getequiprandomoption(.slots[.@a],4,ROA_VALUE)>0)
			.@optVALUE05 = getequiprandomoption(.slots[.@a],4,ROA_VALUE);
			
			setarray .@optId[0],.@optID01,.@optID02,.@optID03,.@optID04,.@optID05;
			setarray .@optVal[0],.@optVALUE01,.@optVALUE02,.@optVALUE03,.@optVALUE04,.@optVALUE05;
			setarray .@optParam[0], 0;
			if(.@optID01>0||.@optID02>0||.@optID03>0||.@optID04>0||.@optID05>0)
			getitem3 getd(".a1"+.@w+"_"+(.@id+1)),1,1,.@refine,0,.@card1,.@card2,.@card3,.@card4,.@optID,.@optVal,.@optParam;
			else if(.@refine>0||.@card1>0||.@card2>0||.@card3>0||.@card4>0)
			getitem2 getd(".a1"+.@w+"_"+(.@id+1)),1,1,.@refine,0,.@card1,.@card2,.@card3,.@card4;
			else
			getitem getd(".a1"+.@w+"_"+(.@id+1)),1;
			delitem .@e,1;
			//equip getd ( ".a1"+  .@w +"_"+ ( .@id + 1 ) ) ;			
			setd "evo"+ .@e, 0;
			deletearray @wing;
			announce "Parabéns seu item evoluiu para "+ getitemname ( getd ( ".a1"+ .@w +"_"+ ( .@id + 1 ) ) ) +"." , bc_self , "0x"+ .c$[2] ;
		}
	}
	end;
}

 

Edited by TARTs
Link to comment
Share on other sites

  • 0

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

Test 1: Evolve item without any enchant, card or refine. Get this error.

[Error]: buildin_getequiprandomoption: No item equipped at pos 6 (CID=75/AID=2000002).
[Debug]: Source (NPC): Items_Conf (invisible/not on a map)

With a random option:

[Error]: buildin_getequiprandomoption: No item equipped at pos 6 (CID=75/AID=2000002).
[Debug]: Source (NPC): Items_Conf (invisible/not on a map)

• With this information i try to replace .@slots[.@a] for simple EQI_HAND_R and get succesfull evolving with 1 random option. (Test 3).

• Following the idea above, i run Test 4 with 1 card slot enchant and it evolves perfectly but i figured out that if you have more than one of same item you'll be able to duplicate (getting a new one evolved and keep the old one) so a delitem3 is extremely necessary to avoid this issue. When i try to use a delitem3...

[Error]: buildin_delitem3: failed to delete 1 items (AID=2000002 item_id=13415).
[Debug]: Source (NPC): Items_Conf (invisible/not on a map)

When this error happen, i got a new big problem. My weapon wont reset to 0%, and start to go over 100, like 110, 140, 200, infinite % and i cant reset this value(so a new weapon of this same type cant be evolved ever again).

• Test 5: I try to make script delete the item before give a new one to player and then autoequip, it work fine, but, if player for any reason go over 100%(e.g: killing big amount of mobs at same time), script fail in avoid this situation and we back to the loop from the previous test.

Status: Working with this little issue.

Currently Code:
 

Spoiler

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

OnNPCKillEvent:
	if ( @wing[0] && isequipped ( @wing[0] ) )
	{
		.@c  = 1;
		.@e  = @wing[0];
		.@w  = @wing[1];
		.@id = @wing[2];
	}
	else
	{
		for ( .@size = getarraysize ( .slots ); .@a < .@size && !.@c ; .@a++ )
		{
			.@e = getequipid ( .slots[.@a] );
			if ( .@e < 0 )
			continue ;
			.@id = 0;
			.@w = 1;
			while ( .@id++ <= .w2[.@w - 1] && !.@c )
			{
				if ( .@id > .w2[.@w - 1] )
				{
					.@id = 1;
					.@w++;
				}
				if ( .@e == getd ( ".a1"+ .@w +"_"+ .@id ) )
				if ( getd ( ".a4"+ .@w +"_"+ .@id ) > 0 && ( killedrid == getd ( ".a3"+ .@w +"_"+ .@id ) || getd ( ".a3"+ .@w +"_"+ .@id ) < 1001 ) )
				{
					.@c = 1;
					setarray @wing[0], .@e, .@w, .@id;
				}
			}
		}
	}
	if (.@c)
	{
		if (getd(".a2"+.@w+"_"+.@id)==1)
		{
			.@amount = getd("mobs_"+.@e);
			setd "mobs_"+.@e,.@amount+1;
			if (getd("mobs_"+.@e)<getd(".a4"+.@w+"_"+.@id))
			end ;
			setd "evo"+ .@e, getd ( "evo"+ .@e ) + 1;
			setd "mobs_"+ .@e, 0;
		}
		else if(getd(".a2"+.@w+"_"+.@id)==2)
		{
			.@amount = getd ( "exp_"+ .@e );
			setd "exp_"+ .@e, .@amount + strmobinfo ( 6, killedrid );
			if ( getd ( "exp_"+ .@e ) < getd ( ".a4"+ .@w +"_"+ .@id ) )
			end ;
			setd "evo"+ .@e, getd ( "evo"+ .@e ) + 1;
			setd "exp_"+ .@e, 0;
		}
		else
		debugmes "Script Items_Evo, error: wrong mode.";
		
		announce getitemname ( .@e ) +" está com "+ getd ( "evo"+ .@e ) +"% para evoluir...", bc_self, "0x"+ .c$[0] ;
		specialeffect2 58 ;
		specialeffect2 383 ;
		if (getd("evo"+.@e) == 100 && .auto )
		{
			specialeffect2 263 ;
			specialeffect2 377 ;
			specialeffect2 542 ;
			announce getitemname ( .@e ) +" está evoluindo..." , bc_self, "0x"+ .c$[1] ;
			.@i = 3;
			while ( .@i-- )
			{
				specialeffect2 521 ;
			}
			specialeffect2 463 ;
			specialeffect2 665 ;
			.@refine = getequiprefinerycnt (EQI_HAND_R);			
			.@card1 = getequipcardid(EQI_HAND_R,0);
			.@card2 = getequipcardid(EQI_HAND_R,1);
			.@card3 = getequipcardid(EQI_HAND_R,2);
			.@card4 = getequipcardid(EQI_HAND_R,3);
			
			.@optID01 = 0;
			if(getequiprandomoption(EQI_HAND_R,0,ROA_ID)>0)
			.@optID01 = getequiprandomoption(EQI_HAND_R,0,ROA_ID);
			.@optID02 = 0;
			if(getequiprandomoption(EQI_HAND_R,1,ROA_ID)>0)
			.@optID02 = getequiprandomoption(EQI_HAND_R,1,ROA_ID);
			.@optID03 = 0;
			if(getequiprandomoption(EQI_HAND_R,2,ROA_ID)>0)
			.@optID03 = getequiprandomoption(EQI_HAND_R,2,ROA_ID);
			.@optID04 = 0;
			if(getequiprandomoption(EQI_HAND_R,3,ROA_ID)>0)
			.@optID04 = getequiprandomoption(EQI_HAND_R,3,ROA_ID);
			.@optID05 = 0;
			if(getequiprandomoption(EQI_HAND_R,4,ROA_ID)>0)
			.@optID05 = getequiprandomoption(EQI_HAND_R,4,ROA_ID);
			
			.@optVALUE01 = 0;
			if(getequiprandomoption(EQI_HAND_R,0,ROA_VALUE)>0)
			.@optVALUE01 = getequiprandomoption(EQI_HAND_R,0,ROA_VALUE);
			.@optVALUE02 = 0;
			if(getequiprandomoption(EQI_HAND_R,1,ROA_VALUE)>0)
			.@optVALUE02 = getequiprandomoption(EQI_HAND_R,1,ROA_VALUE);
			.@optVALUE03 = 0;
			if(getequiprandomoption(EQI_HAND_R,2,ROA_VALUE)>0)
			.@optVALUE03 = getequiprandomoption(EQI_HAND_R,2,ROA_VALUE);
			.@optVALUE04 = 0;
			if(getequiprandomoption(EQI_HAND_R,3,ROA_VALUE)>0)
			.@optVALUE04 = getequiprandomoption(EQI_HAND_R,3,ROA_VALUE);
			.@optVALUE05 = 0;
			if(getequiprandomoption(EQI_HAND_R,4,ROA_VALUE)>0)
			.@optVALUE05 = getequiprandomoption(EQI_HAND_R,4,ROA_VALUE);
			
			setarray .@optId[0],.@optID01,.@optID02,.@optID03,.@optID04,.@optID05;
			setarray .@optVal[0],.@optVALUE01,.@optVALUE02,.@optVALUE03,.@optVALUE04,.@optVALUE05;
			setarray .@optParam[0], 0;
			delitem3 .@e,1,1,.@refine,0,.@card1,.@card2,.@card3,.@card4,.@optID,.@optVal,.@optParam;			
			if(.@optID01>0||.@optID02>0||.@optID03>0||.@optID04>0||.@optID05>0)
			getitem3 getd(".a1"+.@w+"_"+(.@id+1)),1,1,.@refine,0,.@card1,.@card2,.@card3,.@card4,.@optID,.@optVal,.@optParam;
			else if(.@refine>0||.@card1>0||.@card2>0||.@card3>0||.@card4>0)
			getitem2 getd(".a1"+.@w+"_"+(.@id+1)),1,1,.@refine,0,.@card1,.@card2,.@card3,.@card4;
			else
			getitem getd(".a1"+.@w+"_"+(.@id+1)),1;
			equip getd ( ".a1"+  .@w +"_"+ ( .@id + 1 ) ) ;			
			setd "evo"+ .@e, 0;
			deletearray @wing;
			announce "Parabéns seu item evoluiu para "+ getitemname ( getd ( ".a1"+ .@w +"_"+ ( .@id + 1 ) ) ) +"." , bc_self , "0x"+ .c$[2] ;
		}
	}
	end;
}

 

 

Thx for all help are you giving to me @TARTs.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  25
  • Topics Per Day:  0.01
  • Content Count:  924
  • Reputation:   166
  • Joined:  04/05/13
  • Last Seen:  

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

OnNPCKillEvent:
	if (@wing[0]&&isequipped(@wing[0]))
	{
		.@c  = 1;
		.@e  = @wing[0];
		.@w  = @wing[1];
		.@id = @wing[2];
	}
	else
	{
		for (.@size=getarraysize(.slots);.@a<.@size&&!.@c;.@a++)
		{
			.@e = getequipid(.slots[.@a]);
			if (.@e<0)
			continue;
			.@id = 0;
			.@w = 1;
			while (.@id++<=.w2[.@w-1]&&!.@c)
			{
				if (.@id>.w2[.@w-1])
				{
					.@id = 1;
					.@w++;
				}
				if (.@e==getd(".a1"+.@w+"_"+.@id))
				if (getd(".a4"+.@w+"_"+.@id)>0&&(killedrid==getd(".a3"+.@w+"_"+.@id)||getd(".a3"+.@w+"_"+.@id)<1001))
				{
					.@c = 1;
					setarray @wing[0],.@e,.@w,.@id;
				}
			}
		}
	}
	if (.@c)
	{
		if (getd(".a2"+.@w+"_"+.@id)==1)
		{
			.@amount = getd("mobs_"+.@e);
			setd "mobs_"+.@e,.@amount+1;
			if (getd("mobs_"+.@e)<getd(".a4"+.@w+"_"+.@id))
			end;
			setd "evo"+.@e,getd("evo"+.@e)+1;
			setd "mobs_"+.@e,0;
		}
		else if(getd(".a2"+.@w+"_"+.@id)==2)
		{
			.@amount = getd("exp_"+.@e);
			setd "exp_"+.@e,.@amount+strmobinfo(6,killedrid);
			if (getd("exp_"+.@e)<getd(".a4"+.@w+"_"+.@id))
			end;
			setd "evo"+.@e,getd("evo"+.@e)+1;
			setd "exp_"+.@e,0;
		}
		else
		debugmes "Script Items_Evo, error: wrong mode.";
		announce getitemname(.@e)+" está com "+getd("evo"+.@e)+"% para evoluir...",bc_self,"0x"+.c$[0];
		specialeffect2 58;
		specialeffect2 383;
		if(getd("evo"+.@e)>=100&&.auto)
		{
			specialeffect2 263;
			specialeffect2 377;
			specialeffect2 542;
			announce getitemname(.@e)+" está evoluindo...",bc_self,"0x"+.c$[1];
			.@i=3;
			while (.@i--)
			specialeffect2 521;
			specialeffect2 463;
			specialeffect2 665;
			.@refine=getequiprefinerycnt(EQI_HAND_R);			
			.@card1=getequipcardid(EQI_HAND_R,0);
			.@card2=getequipcardid(EQI_HAND_R,1);
			.@card3=getequipcardid(EQI_HAND_R,2);
			.@card4=getequipcardid(EQI_HAND_R,3);
			.@optID01=0;
			if(getequiprandomoption(EQI_HAND_R,0,ROA_ID)>0)
			.@optID01=getequiprandomoption(EQI_HAND_R,0,ROA_ID);
			.@optID02=0;
			if(getequiprandomoption(EQI_HAND_R,1,ROA_ID)>0)
			.@optID02=getequiprandomoption(EQI_HAND_R,1,ROA_ID);
			.@optID03=0;
			if(getequiprandomoption(EQI_HAND_R,2,ROA_ID)>0)
			.@optID03=getequiprandomoption(EQI_HAND_R,2,ROA_ID);
			.@optID04=0;
			if(getequiprandomoption(EQI_HAND_R,3,ROA_ID)>0)
			.@optID04=getequiprandomoption(EQI_HAND_R,3,ROA_ID);
			.@optID05=0;
			if(getequiprandomoption(EQI_HAND_R,4,ROA_ID)>0)
			.@optID05=getequiprandomoption(EQI_HAND_R,4,ROA_ID);
			.@optVALUE01=0;
			if(getequiprandomoption(EQI_HAND_R,0,ROA_VALUE)>0)
			.@optVALUE01=getequiprandomoption(EQI_HAND_R,0,ROA_VALUE);
			.@optVALUE02=0;
			if(getequiprandomoption(EQI_HAND_R,1,ROA_VALUE)>0)
			.@optVALUE02=getequiprandomoption(EQI_HAND_R,1,ROA_VALUE);
			.@optVALUE03=0;
			if(getequiprandomoption(EQI_HAND_R,2,ROA_VALUE)>0)
			.@optVALUE03=getequiprandomoption(EQI_HAND_R,2,ROA_VALUE);
			.@optVALUE04=0;
			if(getequiprandomoption(EQI_HAND_R,3,ROA_VALUE)>0)
			.@optVALUE04=getequiprandomoption(EQI_HAND_R,3,ROA_VALUE);
			.@optVALUE05=0;
			if(getequiprandomoption(EQI_HAND_R,4,ROA_VALUE)>0)
			.@optVALUE05=getequiprandomoption(EQI_HAND_R,4,ROA_VALUE);
			setarray .@optId[0],.@optID01,.@optID02,.@optID03,.@optID04,.@optID05;
			setarray .@optVal[0],.@optVALUE01,.@optVALUE02,.@optVALUE03,.@optVALUE04,.@optVALUE05;
			setarray .@optParam[0],0;	
			if(!getd(".a1"+.@w+"_"+(.@id+1)))//Null
			end;	
			if(.@optID01>0||.@optID02>0||.@optID03>0||.@optID04>0||.@optID05>0){
				delitem3 .@e,1,1,.@refine,0,.@card1,.@card2,.@card3,.@card4,.@optID,.@optVal,.@optParam;
				getitem3 getd(".a1"+.@w+"_"+(.@id+1)),1,1,.@refine,0,.@card1,.@card2,.@card3,.@card4,.@optID,.@optVal,.@optParam;
			}
			else if(.@refine>0||.@card1>0||.@card2>0||.@card3>0||.@card4>0){
				delitem2 .@e,1,1,.@refine,0,.@card1,.@card2,.@card3,.@card4;
				getitem2 getd(".a1"+.@w+"_"+(.@id+1)),1,1,.@refine,0,.@card1,.@card2,.@card3,.@card4;
			}
			else{
				delitem .@e,1;
				getitem getd(".a1"+.@w+"_"+(.@id+1)),1;
			}
			equip getd(".a1"+.@w+"_"+(.@id+1));			
			setd "evo"+.@e,0;
			deletearray @wing;
			announce "Parabéns seu item evoluiu para "+getitemname(getd(".a1"+.@w+"_"+(.@id+1)))+".",bc_self,"0x"+.c$[2];
		}
	}
	end;
}

 

Link to comment
Share on other sites

  • 0

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

On 9/9/2018 at 11:18 PM, TARTs said:

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

OnNPCKillEvent:
	if (@wing[0]&&isequipped(@wing[0]))
	{
		.@c  = 1;
		.@e  = @wing[0];
		.@w  = @wing[1];
		.@id = @wing[2];
	}
	else
	{
		for (.@size=getarraysize(.slots);.@a<.@size&&!.@c;.@a++)
		{
			.@e = getequipid(.slots[.@a]);
			if (.@e<0)
			continue;
			.@id = 0;
			.@w = 1;
			while (.@id++<=.w2[.@w-1]&&!.@c)
			{
				if (.@id>.w2[.@w-1])
				{
					.@id = 1;
					.@w++;
				}
				if (.@e==getd(".a1"+.@w+"_"+.@id))
				if (getd(".a4"+.@w+"_"+.@id)>0&&(killedrid==getd(".a3"+.@w+"_"+.@id)||getd(".a3"+.@w+"_"+.@id)<1001))
				{
					.@c = 1;
					setarray @wing[0],.@e,.@w,.@id;
				}
			}
		}
	}
	if (.@c)
	{
		if (getd(".a2"+.@w+"_"+.@id)==1)
		{
			.@amount = getd("mobs_"+.@e);
			setd "mobs_"+.@e,.@amount+1;
			if (getd("mobs_"+.@e)<getd(".a4"+.@w+"_"+.@id))
			end;
			setd "evo"+.@e,getd("evo"+.@e)+1;
			setd "mobs_"+.@e,0;
		}
		else if(getd(".a2"+.@w+"_"+.@id)==2)
		{
			.@amount = getd("exp_"+.@e);
			setd "exp_"+.@e,.@amount+strmobinfo(6,killedrid);
			if (getd("exp_"+.@e)<getd(".a4"+.@w+"_"+.@id))
			end;
			setd "evo"+.@e,getd("evo"+.@e)+1;
			setd "exp_"+.@e,0;
		}
		else
		debugmes "Script Items_Evo, error: wrong mode.";
		announce getitemname(.@e)+" está com "+getd("evo"+.@e)+"% para evoluir...",bc_self,"0x"+.c$[0];
		specialeffect2 58;
		specialeffect2 383;
		if(getd("evo"+.@e)>=100&&.auto)
		{
			specialeffect2 263;
			specialeffect2 377;
			specialeffect2 542;
			announce getitemname(.@e)+" está evoluindo...",bc_self,"0x"+.c$[1];
			.@i=3;
			while (.@i--)
			specialeffect2 521;
			specialeffect2 463;
			specialeffect2 665;
			.@refine=getequiprefinerycnt(EQI_HAND_R);			
			.@card1=getequipcardid(EQI_HAND_R,0);
			.@card2=getequipcardid(EQI_HAND_R,1);
			.@card3=getequipcardid(EQI_HAND_R,2);
			.@card4=getequipcardid(EQI_HAND_R,3);
			.@optID01=0;
			if(getequiprandomoption(EQI_HAND_R,0,ROA_ID)>0)
			.@optID01=getequiprandomoption(EQI_HAND_R,0,ROA_ID);
			.@optID02=0;
			if(getequiprandomoption(EQI_HAND_R,1,ROA_ID)>0)
			.@optID02=getequiprandomoption(EQI_HAND_R,1,ROA_ID);
			.@optID03=0;
			if(getequiprandomoption(EQI_HAND_R,2,ROA_ID)>0)
			.@optID03=getequiprandomoption(EQI_HAND_R,2,ROA_ID);
			.@optID04=0;
			if(getequiprandomoption(EQI_HAND_R,3,ROA_ID)>0)
			.@optID04=getequiprandomoption(EQI_HAND_R,3,ROA_ID);
			.@optID05=0;
			if(getequiprandomoption(EQI_HAND_R,4,ROA_ID)>0)
			.@optID05=getequiprandomoption(EQI_HAND_R,4,ROA_ID);
			.@optVALUE01=0;
			if(getequiprandomoption(EQI_HAND_R,0,ROA_VALUE)>0)
			.@optVALUE01=getequiprandomoption(EQI_HAND_R,0,ROA_VALUE);
			.@optVALUE02=0;
			if(getequiprandomoption(EQI_HAND_R,1,ROA_VALUE)>0)
			.@optVALUE02=getequiprandomoption(EQI_HAND_R,1,ROA_VALUE);
			.@optVALUE03=0;
			if(getequiprandomoption(EQI_HAND_R,2,ROA_VALUE)>0)
			.@optVALUE03=getequiprandomoption(EQI_HAND_R,2,ROA_VALUE);
			.@optVALUE04=0;
			if(getequiprandomoption(EQI_HAND_R,3,ROA_VALUE)>0)
			.@optVALUE04=getequiprandomoption(EQI_HAND_R,3,ROA_VALUE);
			.@optVALUE05=0;
			if(getequiprandomoption(EQI_HAND_R,4,ROA_VALUE)>0)
			.@optVALUE05=getequiprandomoption(EQI_HAND_R,4,ROA_VALUE);
			setarray .@optId[0],.@optID01,.@optID02,.@optID03,.@optID04,.@optID05;
			setarray .@optVal[0],.@optVALUE01,.@optVALUE02,.@optVALUE03,.@optVALUE04,.@optVALUE05;
			setarray .@optParam[0],0;	
			if(!getd(".a1"+.@w+"_"+(.@id+1)))//Null
			end;	
			if(.@optID01>0||.@optID02>0||.@optID03>0||.@optID04>0||.@optID05>0){
				delitem3 .@e,1,1,.@refine,0,.@card1,.@card2,.@card3,.@card4,.@optID,.@optVal,.@optParam;
				getitem3 getd(".a1"+.@w+"_"+(.@id+1)),1,1,.@refine,0,.@card1,.@card2,.@card3,.@card4,.@optID,.@optVal,.@optParam;
			}
			else if(.@refine>0||.@card1>0||.@card2>0||.@card3>0||.@card4>0){
				delitem2 .@e,1,1,.@refine,0,.@card1,.@card2,.@card3,.@card4;
				getitem2 getd(".a1"+.@w+"_"+(.@id+1)),1,1,.@refine,0,.@card1,.@card2,.@card3,.@card4;
			}
			else{
				delitem .@e,1;
				getitem getd(".a1"+.@w+"_"+(.@id+1)),1;
			}
			equip getd(".a1"+.@w+"_"+(.@id+1));			
			setd "evo"+.@e,0;
			deletearray @wing;
			announce "Parabéns seu item evoluiu para "+getitemname(getd(".a1"+.@w+"_"+(.@id+1)))+".",bc_self,"0x"+.c$[2];
		}
	}
	end;
}

 

@TARTs its working almost perfectly, but, still passing through 100% and didnt evolve (happens when player kill lots of mobs at same time at 95%+).

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  25
  • Topics Per Day:  0.01
  • Content Count:  924
  • Reputation:   166
  • Joined:  04/05/13
  • Last Seen:  

How did you test can you provide the step?

Link to comment
Share on other sites

  • 0

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

On 9/12/2018 at 10:44 PM, TARTs said:

How did you test can you provide the step?

Enchant my weapon with 3 or more random option, refine at random level and equip one card or simple enchant, then, go to mobs (poring) kill 100 mobs. Sometimes the script stuck in this part:

announce getitemname(.@e)+" está evoluindo...",bc_self,"0x"+.c$[1];

And plus, sometimes when the above condition is met, i got this on mapserver:

[Error]: buildin_delitem3: failed to delete 1 items (AID=2000000 item_id=1203).
[Debug]: Source (NPC): Items_Conf (invisible/not on a map)

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  25
  • Topics Per Day:  0.01
  • Content Count:  924
  • Reputation:   166
  • Joined:  04/05/13
  • Last Seen:  

change all delitem3 to delitem should be okay.

 

delitem .@e,1;

Link to comment
Share on other sites

  • 0

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

1 hour ago, TARTs said:

change all delitem3 to delitem should be okay.

 

delitem .@e,1;

I did it and now we back to the point of this topic, sometimes the enchants simple disappear when weapon evolves (specially when player have more than 1 of the same item in inventory) 

Edit: @TARTs Without delitem3 script evolve weapon ok, but, if you have the same item in your inventory, when your weapon evolves script will duplicate the enchants, refine etc in other items.

Edited by Rizta
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  25
  • Topics Per Day:  0.01
  • Content Count:  924
  • Reputation:   166
  • Joined:  04/05/13
  • Last Seen:  

Basically random option & enchant system limit 1 item in characters.

I think delitem by countitem can be solve your problem.

like this delitem .@e,countitem(.@e);

Edited by TARTs
Link to comment
Share on other sites

  • 0

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

4 hours ago, TARTs said:

Basically random option & enchant system limit 1 item in characters.

I think delitem by countitem can be solve your problem.

like this delitem .@e,countitem(.@e);

@TARTs i'll try this and edit this post with results later.

 

Edit: with your suggestion script obviously delete all itens in inventory with same id which can not happen, because the player simply can (and will) lose other weapons with different enchantments/option in the same way that he will lose if his enchantments/option are overwritten. Conclusion: we are still without a solution.

Edited by Rizta
Link to comment
Share on other sites

  • 0

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

Instead of delitem, use delequip <equip slot>;

also to save lines just directly put the random option values in the array, no need to reset these values each time  and checking if they have a value, since they are deleted evertime the scripts ends > .@ = temporary npc variables.

When I'm home from work I will ty this script myself.

Regards,

Chris

 

Edited by llchrisll
Link to comment
Share on other sites

  • 0

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

20 hours ago, llchrisll said:

Instead of delitem, use delequip <equip slot>;

also to save lines just directly put the random option values in the array, no need to reset these values each time  and checking if they have a value, since they are deleted evertime the scripts ends > .@ = temporary npc variables.

When I'm home from work I will ty this script myself.

Regards,

Chris

 

Hey Master! 

Thank you for your answer =D 

At the moment i have solved this problem and everything works fine!

Ill really appreciate if you find a different solution because it'll teach me new things! 

Link to comment
Share on other sites

  • 0

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

Well I rewrote the script already, but didn't test yet.

Link to comment
Share on other sites

  • 0

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

3 minutes ago, llchrisll said:

Well I rewrote the script already, but didn't test yet.

can i see? ?

Link to comment
Share on other sites

  • 0

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

36 minutes ago, Rizta said:

can i see? ?

I'm currently at work so not at the moment xD

Link to comment
Share on other sites

  • 0

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

I will post it when I'm home.

Edit: sorry for double post, please merge it. Missed the edit button somehow on my phone....

Edited by llchrisll
Link to comment
Share on other sites

  • 0

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

2 minutes ago, llchrisll said:

I'm currently at work so not at the moment xD

Ohh sorry xD thats ok i can wait when you finish :B

Link to comment
Share on other sites

  • 0

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

2 minutes ago, Rizta said:

Ohh sorry xD thats ok i can wait when you finish :B

That's around 4 hrs left xX

Link to comment
Share on other sites

  • 0

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

4 minutes ago, llchrisll said:

I will post it when I'm home.

Edit: sorry for double post, please merge it. Missed the edit button somehow on my phone....

ill wait ?

2 minutes ago, llchrisll said:

That's around 4 hrs left xX

Dont worry =D Im just curious and how do you improve this haha

Link to comment
Share on other sites

Join the conversation

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

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

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

×   Your previous content has been restored.   Clear editor

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

×
×
  • Create New...