Creating custom item triggers NPC

Thyr

New member
Messages
78
Points
0
Github
warcraftfrozen
How can I make a Item Box that triggers NPC.

Example:

Freebies Box, this box give 100 ygg,100 box of thunder, valkyrie set, and Stat Accessory [this thing will trigger npc to choice which type of accessory STR,AGI,VIT,INT,DEX,LUK.

(The box still distribute items and then triggers NPC talk, to choose what kind of accessory.)

 
For this simply make a new item and in the script<> section use getitem() for each item you want to give, then use doevent() to call your npc script and in this npc before any dialog use delitem() to remove the box, then put your dialog that asks which item you want

 
For this simply make a new item and in the script<> section use getitem() for each item you want to give, then use doevent() to call your npc script and in this npc before any dialog use delitem() to remove the box, then put your dialog that asks which item you want
Hello made function, 

How can i make this continue to the next package after the accessory given the npc didn't continues.

Code:
//== GPACK ======================================
function	script	M_Gpack	{
	switch(getarg(0)) {
	case 1:
	mes "[ Guild Package Manager ]";
	mes "So you are a guild member,";
	mes "please choose your accessory.";
		switch(select("Strength", "Agility", "Vitality", "Intelligence", "Dexterity", "Luk")) {
			case 1:
			getitembound 2771,2,2;
			close;
			case 2:
			getitembound 2770,2,2;
			close;
			case 3:
			getitembound 2766,2,2;
			close;
			case 4:
			getitembound 2768,2,2;
			close;
			case 5:
			getitembound 2769,2,2;
			close;
			case 6:
			getitembound 2767,2,2;
			close;
			}
	next;
	mes "[ Guild Package Manager ]";
	mes "Please choose  your set..";
		switch(select("STR", "AGI", "VIT", "INT", "DEX", "LUK")) {
			case 1: //STR
			getitembound 20002,1,2;
			getitembound 20002,1,2;
			close;
			case 2: //AGI
			getitembound 20011,1,2;
			getitembound 20020,1,2;
			close;
			case 3: //VIT
			getitembound 20001,1,2;
			getitembound 20016	,1,2;
			close;
			case 4: //INT
			getitembound 20004,1,2;
			getitembound 20019,1,2;
			close;
			case 5: //DEX
			getitembound 20003,1,2;
			getitembound 20018,1,2;
			close;
			case 6: //LUK
			getitembound 20013,1,2;
			getitembound 20017,1,2;
			close;
		}
	case 2: 
		mes "Nothing";
		close;
	}
	return;
}
 
Well of course it didn't continue: you used close; instead of break;

 
Well of course it didn't continue: you used close; instead of break;
Sorry, used close; and end; didn't tried break; sorry again. Thank you.

 
Last edited by a moderator:
Back
Top