New LUA Item functions

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

Moderator: Team Members

Post Reply
Jabantiz
Lead Developer
Posts: 2912
Joined: Wed Jul 25, 2007 2:52 pm
Location: California

New LUA Item functions

Post by Jabantiz » Tue Nov 26, 2013 5:43 pm

New item script functions equipped and unequipped, will be called when you equip or unequip an item

Code: Select all

function equipped(Item, Player)

end

function unequipped(Item, Player)

end
Item = item being equipped/unequipped
Player = Player equipping/unequipping the item

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: New LUA Item functions

Post by John Adams » Wed Nov 27, 2013 8:30 am

Spell Check!

~runs~

Jabantiz
Lead Developer
Posts: 2912
Joined: Wed Jul 25, 2007 2:52 pm
Location: California

Re: New LUA Item functions

Post by Jabantiz » Wed Nov 27, 2013 1:38 pm

Yea I suck at spelling and copy and paste tends to spread the typos around... will fix it some time today

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

Re: New LUA Item functions

Post by thefoof » Thu Dec 12, 2013 8:00 pm

Hikacking this thread since we have sooo many damn lua posts :wink: 3 new functions.

First is GetItemCount(), this returns the current count of an item. Syntax is GetItemCount([Item*] item).

Second is SetItemCount(), this sets the count of an item (count must be <= the max stackcount of this item), if set to 0 this removes the item. Syntax is SetItemCount([Item*] item, [Spawn*] owner, [int16] new_count)

Third is GetItemSkillReq(), this returns either skillreq1 or skillreq2 from an item, this is useful for determining certain item subtypes. For example you could use

Code: Select all

if GetItemSkillReq(item, 1) == GetSkillIDByName("Bow")
to determine if an item is a bow. Syntax is GetItemSkillReq([Item*] item, [int8] type {use type 1 or 2})

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests