LUA Function: GetItemType()

Discussions on development of both the EQ2Emulator LUA Script Engine and Script specifications

Moderator: Team Members

Post Reply
User avatar
thefoof
Retired
Posts: 630
Joined: Wed Nov 07, 2012 7:36 pm
Location: Florida

LUA Function: GetItemType()

Post by thefoof » Thu Nov 21, 2013 11:27 pm

This function returns the int value of an item's type. Syntax is GetItemType(Item*).

LUA:GetItemType()

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Re: LUA Function: GetItemType()

Post by John Adams » Fri Nov 22, 2013 7:46 am

Exxxxcellent. Thank you.

Quick question though... is this just returning the value of the enum for item_type? (Armor, Weapon, Ranged...) If so, that might not be enough since non-bows can be equipped in the Ranged slot (right?) However, for the immediate need, this will do fine.

I like Jab's idea of IsBow(), which might be the long-term solution.

User avatar
thefoof
Retired
Posts: 630
Joined: Wed Nov 07, 2012 7:36 pm
Location: Florida

Re: LUA Function: GetItemType()

Post by thefoof » Fri Nov 22, 2013 2:47 pm

Hmm looking it over I don't know that we really have a way to differ thrown weapons and bows in the first place? It looks like we just have ranged but no subtype as a bow or bandolier/satchel ect.

User avatar
thefoof
Retired
Posts: 630
Joined: Wed Nov 07, 2012 7:36 pm
Location: Florida

Re: LUA Function: GetItemType()

Post by thefoof » Fri Nov 22, 2013 3:34 pm

It looks like this *might* be set by the item's skill_id_req or skill_id_req2, anybody know for sure? Either way we don't run any kind of check for this in the server when it comes to attacking with a ranged weapon currently.

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Re: LUA Function: GetItemType()

Post by John Adams » Fri Nov 22, 2013 3:38 pm

thefoof wrote:Either way we don't run any kind of check for this in the server when it comes to attacking with a ranged weapon currently.
BUG!!!

so I could equip a ranged sausage, and kill things with it?

User avatar
thefoof
Retired
Posts: 630
Joined: Wed Nov 07, 2012 7:36 pm
Location: Florida

Re: LUA Function: GetItemType()

Post by thefoof » Fri Nov 22, 2013 3:48 pm

John Adams wrote:BUG!!!

so I could equip a ranged sausage, and kill things with it?
Let me explain :mrgreen: we run a check to see if a player has ammo, but not the type of ammo in relation to the bow. In other words right now you can throw arrows from a bandolier, or shoot throwing knives with a bow.

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Re: LUA Function: GetItemType()

Post by John Adams » Fri Nov 22, 2013 3:49 pm

BUG!!!11/

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests