Jump to content
  • 0

Requesting shield enchant NPC


iraciz

Question


  • Group:  Members
  • Topic Count:  140
  • Topics Per Day:  0.03
  • Content Count:  562
  • Reputation:   107
  • Joined:  10/05/12
  • Last Seen:  

Good day dear community, I came here as last resource to  ask for some help..

it could be possible? to create a NPC, that can enchant shield 4th slot with a DEX+1 rune?  
the item id is 4720

my request is not so simple, because I want it exclusive for shield, not lefty hand, not 2h_weapons,  ONLY SHIELDS.

Please note that, EQI_HAND_L (8) will not work, since it takes every single equip that tooks the left hand place, not only shields but assassin dual wielding dagger, 2handed weapons such as bows axe may be enchanted,  and thats exactly what I want to avoid...

Just shields please, in universal, as a whole thing,  SHIELD... no shield equiped no enchant.

- no lists, not menu's, no failure/success rate..

NPC must check if a shield is equiped and enchant it... and reject the enchant if it is a weapon or there's no item equiped in left hand, simple as that!

Edited by iraciz
bare hand
Link to comment
Share on other sites

9 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  140
  • Topics Per Day:  0.03
  • Content Count:  562
  • Reputation:   107
  • Joined:  10/05/12
  • Last Seen:  

It´s Done guys, finally..

I managed to find out  some curly locations out of place, and corrected it,  now  this is the 100% functional script, tested and working at my will.

 

beach_dun,270,70,4	script	Darkargol#darkalost	531,{
	emotion ET_SCRATCH;
	mes "^5F04B4Dark Argol^000000";
	cutin "jpn_darkalgol01",2;
	mes "Vaya vaya, mira a aquien tenemos por aqui..";
	mes "te puedo ayudar, pero solo si me traes un objeto unico..";
	next;
	cutin "jpn_darkalgol03",2;
	mes "Dark Argol";
	mes "Se trata de la cabeza de medusa, lamentablemente no es dropeable por ninguna de las que estan aqui!..";	
	next;
	cutin "jpn_darkalgol04",2;
	mes "^5F04B4Dark Argol^000000";
	mes "Si me consigues lo siguiente:";
	mes "1 <ITEM>Dead Medusa<INFO>1047</INFO></ITEM>.";
	mes "1000 <ITEM>Horrendous Hair<INFO>1048</INFO></ITEM>.";
	mes "le dare un poder nuevo al escudo que lleves equipado!.";
	next;
	cutin "jpn_darkalgol01",2;
	mes "^5F04B4Dark Argol^000000";
	mes "Permiteme revisar si tienes los items ok?";
	next;
	progressbar "ffff00",1;
	if( countitem(1047) < 1 || countitem(1048) < 1000) goto Faltaitems;
	cutin "jpn_darkalgol05",2;
	mes "^5F04B4Dark Argol^000000";
	mes "Parece que tienes todos los items, deseas encantar tu escuodo equipado ya mismo?!.";	
	next;
	menu
	"^0000FFEncantar Escudo^000000",shield,
	"Cancelar",wait;
	
	wait:
	emotion ET_SMILE;
	cutin "jpn_darkalgol02",2;
	mes "^5F04B4Dark Argol^000000";
	mes "Ok Ok lo comprendo.";
	mes "Volveras con la mejor alternativa, pillin!.";	
	close2;
	cutin "",255;
	end;
	
	shield:
	if (getequipid(EQI_HAND_L) && getiteminfo(getequipid(EQI_HAND_L), 5) == 32){
		mes "^5F04B4Dark Argol^000000";
		mes "Comenzamos.";
		cutin "jpn_darkalgol01",2;
		next;
		specialeffect 96;
		cutin "jpn_darkalgol02",2;
		progressbar "ffff00",1;
		specialeffect 101;
		delitem 1048,1000;
		delitem 1047,1;	
		set .@id, getequipid(8);
		set .@ref, getequiprefinerycnt(8);
		set .@card1, getequipcardid(8,0);
		set .@card2, getequipcardid(8,1);
		set .@card3, getequipcardid(8,2);
		set .@card4, getequipcardid(8,3);
		delitem2 .@id, 1, 1, .@ref, 0, .@card1, .@card2, .@card3, .@card4;
		getitem2 .@id, 1, 1, .@ref, 0, .@card1, .@card2, .@card3, 31498;
		equip .@id;
		cutin "jpn_darkalgol11",2;
		sleep2 200;
		cutin "",255;
		mes "Dark Argol";
		mes "Enchant exitoso!.";
		end;
		}
	
	emotion ET_HUT;	
	mes "^5F04B4Dark Argol^000000";
	cutin "jpn_darkalgol07",2;
	mes "eh eh ehhh! ^FF0000Wait^000000";
	mes "No llevas ningun escudo equipado.";
	close2;
	cutin "",255;
	end;			
	
	Faltaitems:
	emotion ET_CRY;
	cutin "jpn_darkalgol04",2;
	mes "^5F04B4Dark Argol^000000";
	mes "Desafortunadamente no los tienes!, Cuando tengas los objetos no dudes en volver, con gusto ofrecere encantar tu escudo!";
	mes "hasta pronto.";
	close2;
	cutin "",255;
	end;
	}

 

It's working nicely,   please share if you want,  just remember to edit the item require and the last enchant, mine is custom made.

This is a unique npc because,  it do not only take the left hand equip placement, it also check if the equip is a shield.  

Edited by iraciz
now working
Link to comment
Share on other sites

  • 1

  • Group:  Members
  • Topic Count:  50
  • Topics Per Day:  0.01
  • Content Count:  1702
  • Reputation:   238
  • Joined:  09/05/12
  • Last Seen:  

Use this condition

if (getequipid(EQI_HAND_L) && getiteminfo(getequipid(EQI_HAND_L), 5) == 32)

Link to comment
Share on other sites

  • 1

  • Group:  Members
  • Topic Count:  50
  • Topics Per Day:  0.01
  • Content Count:  1702
  • Reputation:   238
  • Joined:  09/05/12
  • Last Seen:  

Check if you pass below condition else it will go to Faltaitems label

if( countitem(1047) < 1 || countitem(1048) < 1000) goto Faltaitems;

Check below script

beach_dun,270,70,4	script	Darkargol#darkalost	531,{
	mes "Dark Argol";
	cutin "jpn_darkalgol01",2;
	mes "Vaya vaya, mira a aquien tenemos por aqui..";
	mes "te puedo ayudar, pero solo si me traes un objeto unico..";
	next;
	cutin "jpn_darkalgol03",2;
	mes "Dark Argol";
	mes "Se trata de la cabeza de medusa, lamentablemente no es dropeable por ninguna de las que estan aqui!..";	
	next;
	cutin "jpn_darkalgol04",2;
	mes "Dark Argol";
	mes "Si me consigues lo siguiente:";
	mes "1 <ITEM>Dead Medusa<INFO>1047</INFO></ITEM>.";
	mes "1000 <ITEM>Horrendous Hair<INFO>1048</INFO></ITEM>.";
	mes "le dare un poder nuevo al escudo que lleves equipado!.";
	next;
	if( countitem(1047) < 1 || countitem(1048) < 1000) goto Faltaitems;
	cutin "jpn_darkalgol05",2;
	mes "Dark Argol";
	mes "Parece que tienes todos los items, deseas encantar tu escuodo equipado ya mismo?!.";	
	next;
	menu
	"^0000FFEncantar Escudo^000000",shield,
	"Cancelar",wait;
	
	wait:
	cutin "jpn_darkalgol07",2;
	mes "Dark Argol";
	mes "Ok Ok lo comprendo.";
	mes "Volveras con la mejor alternativa, pillin!.";	
	close2;
	cutin "",255;
	end;
	
	shield:
	mes "Dark Argol";
	cutin "jpn_darkalgol01",2;
	mes "Comenzamos.";
	next;
	specialeffect 96;
	cutin "jpn_darkalgol02",2;
	progressbar "ffff00",1;
	if (getequipid(EQI_HAND_L) && getiteminfo(getequipid(EQI_HAND_L), 5) == 32){
		delitem 1048,1000;
		delitem 1047,1;	
		set .@id, getequipid(8);
		set .@ref, getequiprefinerycnt(8);
		set .@card1, getequipcardid(8,0);
		set .@card2, getequipcardid(8,1);
		set .@card3, getequipcardid(8,2);
		set .@card4, getequipcardid(8,3);
		delitem2 .@id, 1, 1, .@ref, 0, .@card1, .@card2, .@card3, .@card4;
		getitem2 .@id, 1, 1, .@ref, 0, .@card1, .@card2, .@card3, 4700;
		equip .@id;
		specialeffect 101;
		cutin "jpn_darkalgol11",2;
		sleep2 200;
		cutin "",255;
		mes "Dark Argol";
		mes "Enchant exitoso!.";
		end;
	}
		
	mes "Dark Argol";
	cutin "jpn_darkalgol07",2;
	mes "eh eh ehhh! Espera";
	mes "No llevas escudo equipado.";
	close2;
	cutin "",255;
	end;
	
	Faltaitems:
	cutin "jpn_darkalgol01",2;
	mes "Dark Argol";
	mes "Vuelve conmigo cuando tengas todos los items que te pedi!";
	mes "hasta pronto";
	close2;
	cutin "",255;
	end;
}

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  19
  • Topics Per Day:  0.01
  • Content Count:  398
  • Reputation:   246
  • Joined:  07/04/19
  • Last Seen:  

try to use

getequipid

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  140
  • Topics Per Day:  0.03
  • Content Count:  562
  • Reputation:   107
  • Joined:  10/05/12
  • Last Seen:  

	mes "Start Enchanting.";
	next;
	progressbar "ffff00",1;
	if(getequipid(8)+1) {
		delitem 7539,1;
		set .@id, getequipid(8);
		set .@ref, getequiprefinerycnt(8);
		set .@card1, getequipcardid(8,0);
		set .@card2, getequipcardid(8,1);
		set .@card3, getequipcardid(8,2);
		set .@card4, getequipcardid(8,3);
		delitem2 .@id, 1, 1, .@ref, 0, .@card1, .@card2, .@card3, .@card4;
		getitem2 .@id, 1, 1, .@ref, 0, .@card1, .@card2, .@card3, 4720;
		equip .@id;
		mes "Enchant Success!.";
		close;
	}
	
	mes "Please, equip a shield to proceed.";
	cutin "",255;
	close;
}

getequipid is not working, is enchanting whatever is in the left hand, 2h weapons, daggers, etc, It must be exclussive for shield, nothing else.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  105
  • Topics Per Day:  0.02
  • Content Count:  446
  • Reputation:   229
  • Joined:  03/20/12
  • Last Seen:  

Check for armor item type on L hand.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  140
  • Topics Per Day:  0.03
  • Content Count:  562
  • Reputation:   107
  • Joined:  10/05/12
  • Last Seen:  

Is working now, but it calls other dialog when detecting no shield type.  Dunno why is calling "Faltaitems" instead. 

It must say:

    mes "Dark Argol";
    cutin "jpn_darkalgol07",2;
    mes "eh eh ehhh! Espera";
    mes "No llevas escudo equipado.";
    close2;
    cutin "",255;
    end;

beach_dun,270,70,4	script	Darkargol#darkalost	531,{
	mes "Dark Argol";
	cutin "jpn_darkalgol01",2;
	mes "Vaya vaya, mira a aquien tenemos por aqui..";
	mes "te puedo ayudar, pero solo si me traes un objeto unico..";
	next;
	cutin "jpn_darkalgol03",2;
	mes "Dark Argol";
	mes "Se trata de la cabeza de medusa, lamentablemente no es dropeable por ninguna de las que estan aqui!..";	
	next;
	cutin "jpn_darkalgol04",2;
	mes "Dark Argol";
	mes "Si me consigues lo siguiente:";
	mes "1 <ITEM>Dead Medusa<INFO>1047</INFO></ITEM>.";
	mes "1000 <ITEM>Horrendous Hair<INFO>1048</INFO></ITEM>.";
	mes "le dare un poder nuevo al escudo que lleves equipado!.";
	next;
	if( countitem(1047) < 1 || countitem(1048) < 1000) goto Faltaitems;
	cutin "jpn_darkalgol05",2;
	mes "Dark Argol";
	mes "Parece que tienes todos los items, deseas encantar tu escuodo equipado ya mismo?!.";	
	next;
	menu
	"^0000FFEncantar Escudo^000000",shield,
	"Cancelar",wait;
	
	wait:
	cutin "jpn_darkalgol07",2;
	mes "Dark Argol";
	mes "Ok Ok lo comprendo.";
	mes "Volveras con la mejor alternativa, pillin!.";	
	close2;
	cutin "",255;
	end;
	
	shield:
	mes "Dark Argol";
	cutin "jpn_darkalgol01",2;
	mes "Comenzamos.";
	next;
	specialeffect 96;
	cutin "jpn_darkalgol02",2;
	progressbar "ffff00",1;
	if (getequipid(EQI_HAND_L) && getiteminfo(getequipid(EQI_HAND_L), 5) == 32){
		delitem 1048,1000;
		delitem 1047,1;	
		set .@id, getequipid(8);
		set .@ref, getequiprefinerycnt(8);
		set .@card1, getequipcardid(8,0);
		set .@card2, getequipcardid(8,1);
		set .@card3, getequipcardid(8,2);
		set .@card4, getequipcardid(8,3);
		delitem2 .@id, 1, 1, .@ref, 0, .@card1, .@card2, .@card3, .@card4;
		getitem2 .@id, 1, 1, .@ref, 0, .@card1, .@card2, .@card3, 4700;
		equip .@id;
		specialeffect 101;
		cutin "jpn_darkalgol11",2;
		sleep2 200;
		cutin "",255;
		mes "Dark Argol";
		mes "Enchant exitoso!.";
		end;
		
	mes "Dark Argol";
	cutin "jpn_darkalgol07",2;
	mes "eh eh ehhh! Espera";
	mes "No llevas escudo equipado.";
	close2;
	cutin "",255;
	end;			
	}
	
	Faltaitems:
	cutin "jpn_darkalgol01",2;
	mes "Dark Argol";
	mes "Vuelve conmigo cuando tengas todos los items que te pedi!";
	mes "hasta pronto";
	close2;
	cutin "",255;
	end;
	}

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  22
  • Topics Per Day:  0.01
  • Content Count:  271
  • Reputation:   62
  • Joined:  02/04/19
  • Last Seen:  

16 hours ago, iraciz said:

It´s Done guys, finally..

I managed to find out  some curly locations out of place, and corrected it,  now  this is the 100% functional script, tested and working at my will.

 


beach_dun,270,70,4	script	Darkargol#darkalost	531,{
	emotion ET_SCRATCH;
	mes "^5F04B4Dark Argol^000000";
	cutin "jpn_darkalgol01",2;
	mes "Vaya vaya, mira a aquien tenemos por aqui..";
	mes "te puedo ayudar, pero solo si me traes un objeto unico..";
	next;
	cutin "jpn_darkalgol03",2;
	mes "Dark Argol";
	mes "Se trata de la cabeza de medusa, lamentablemente no es dropeable por ninguna de las que estan aqui!..";	
	next;
	cutin "jpn_darkalgol04",2;
	mes "^5F04B4Dark Argol^000000";
	mes "Si me consigues lo siguiente:";
	mes "1 <ITEM>Dead Medusa<INFO>1047</INFO></ITEM>.";
	mes "1000 <ITEM>Horrendous Hair<INFO>1048</INFO></ITEM>.";
	mes "le dare un poder nuevo al escudo que lleves equipado!.";
	next;
	cutin "jpn_darkalgol01",2;
	mes "^5F04B4Dark Argol^000000";
	mes "Permiteme revisar si tienes los items ok?";
	next;
	progressbar "ffff00",1;
	if( countitem(1047) < 1 || countitem(1048) < 1000) goto Faltaitems;
	cutin "jpn_darkalgol05",2;
	mes "^5F04B4Dark Argol^000000";
	mes "Parece que tienes todos los items, deseas encantar tu escuodo equipado ya mismo?!.";	
	next;
	menu
	"^0000FFEncantar Escudo^000000",shield,
	"Cancelar",wait;
	
	wait:
	emotion ET_SMILE;
	cutin "jpn_darkalgol02",2;
	mes "^5F04B4Dark Argol^000000";
	mes "Ok Ok lo comprendo.";
	mes "Volveras con la mejor alternativa, pillin!.";	
	close2;
	cutin "",255;
	end;
	
	shield:
	if (getequipid(EQI_HAND_L) && getiteminfo(getequipid(EQI_HAND_L), 5) == 32){
		mes "^5F04B4Dark Argol^000000";
		mes "Comenzamos.";
		cutin "jpn_darkalgol01",2;
		next;
		specialeffect 96;
		cutin "jpn_darkalgol02",2;
		progressbar "ffff00",1;
		specialeffect 101;
		delitem 1048,1000;
		delitem 1047,1;	
		set .@id, getequipid(8);
		set .@ref, getequiprefinerycnt(8);
		set .@card1, getequipcardid(8,0);
		set .@card2, getequipcardid(8,1);
		set .@card3, getequipcardid(8,2);
		set .@card4, getequipcardid(8,3);
		delitem2 .@id, 1, 1, .@ref, 0, .@card1, .@card2, .@card3, .@card4;
		getitem2 .@id, 1, 1, .@ref, 0, .@card1, .@card2, .@card3, 31498;
		equip .@id;
		cutin "jpn_darkalgol11",2;
		sleep2 200;
		cutin "",255;
		mes "Dark Argol";
		mes "Enchant exitoso!.";
		end;
		}
	
	emotion ET_HUT;	
	mes "^5F04B4Dark Argol^000000";
	cutin "jpn_darkalgol07",2;
	mes "eh eh ehhh! ^FF0000Wait^000000";
	mes "No llevas ningun escudo equipado.";
	close2;
	cutin "",255;
	end;			
	
	Faltaitems:
	emotion ET_CRY;
	cutin "jpn_darkalgol04",2;
	mes "^5F04B4Dark Argol^000000";
	mes "Desafortunadamente no los tienes!, Cuando tengas los objetos no dudes en volver, con gusto ofrecere encantar tu escudo!";
	mes "hasta pronto.";
	close2;
	cutin "",255;
	end;
	}

 

 

It's working nicely,   please share if you want,  just remember to edit the item require and the last enchant, mine is custom made.

This is a unique npc because,  it do not only take the left hand equip placement, it also check if the equip is a shield.  

Share this custom enchant xD

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  140
  • Topics Per Day:  0.03
  • Content Count:  562
  • Reputation:   107
  • Joined:  10/05/12
  • Last Seen:  

13 hours ago, KeyMaster said:

Share this custom enchant xD

Can be created by following this steps:

1- Add the item to the item_db.txt, this is the script

40000,Medusa Enchant,Medusa Enchant,6,20,,10,,,,,,,,32,,,,,{ bonus bMdef,1; bonus bInt,1; bonus2 bAddEffWhenHit,Eff_Stone,500; },{},{}


2- Edit the iteminfo.lua located in System, add the item..

        [40000] = {
        unidentifiedDisplayName = "Medusa Enchant",
        unidentifiedResourceName = "메두사의머리",
        unidentifiedDescriptionName = {
            ""
        },
        identifiedDisplayName = "Medusa Enchant",
        identifiedResourceName = "메두사의머리",
        identifiedDescriptionName = {
            "Live medusa head attached to a shield!",
            "Inflict ^660000Stone Curse^000000 status by low chance when receiving damage.",
            "MDEF + 1, INT +1."
        },
        slotCount = 0,
        ClassNum = 0
    },

3- Create the card preffix in the file located in Data/cardprefixnametable.txt this will give a title to the enchanted item.

40000#Of Perseus#

4- Add the item in the file file located in Data/cardpostfixnametable.txt this will display the cardprefix after the item name.

40000#

No sprites needed since it is taking the existing dead medusa sprite:
identifiedResourceName = "메두사의머리",

Edited by iraciz
  • Upvote 1
  • Love 1
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...