[HELP]With coding an NPC

10/02/2008 05:33 FuzionZero#1
Hey guys. I'm working on something for my server and I was wondering if maybe you guys could help make it easier for me. What I am looking to make is an NPC that changes the armor/etc your wearing into a different one. But what I came to realize is that in order to do this the NPC would need to check your armor and see if its the right one to upgrade. That means that it would need to check the item number. And Armors have a set of 7 numbers one for each quality for each set. So either I have to enter in the coding to one-by-one check all the possible color/quality combos or figure out a way where I could just check to see if the Item is called for example "EagleCoat". Unfortunately I have no idea how to check the items by name rather than item number haha. Could anyone possibly explain to me how I would check the items by name instead? Thanks much.
10/02/2008 06:11 FuzionZero#2
Actually I might have figured out a way to do this. But I'm not ready to try it yet. I will try it when I'm ready and let you guys know if it worked or not. In the mean time though feel free to post your help just in case I fail haha.
10/02/2008 06:50 THE BAT#3
use ItemType, ItemType2, and ArmorType

those will help u
10/02/2008 06:53 FuzionZero#4
Thanks. I'm not at my source atm. What do those define exactly? I am not familiar with those.
10/02/2008 07:06 THE BAT#5
Other.ArmorType -> tell you if that item is armor or not
ItemType/2 -> tell you item type
ItemQuality -> tell you what is the Quality of the item
10/02/2008 07:13 FuzionZero#6
Ahh I see. But what I need is the NPC to check if lets say you choose "Armor" from the NPC. The NPC will then check to see if you are wearing the right armor, such as specifically "EagleCoat", then if you are wearing an "EagleCoat" it will do its task, if not it doesn't. Using those you gave me it doesn't seem like they would be able to do what I need. Unless by Item Type you mean Item Name.
10/02/2008 07:40 THE BAT#7
oh i got what you want

you can query the database (items table) with item id and the query return the item name for you

Code:
SELECT ItemName FROM items WHERE ItemID = anyID