Thread Tools Display Modes
04/17/14, 09:40 AM   #1
Flagrick
 
Flagrick's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 24
GetItemLinkInfo - need help for LootDrop

Hello,

Loot drop is using
Code:
local icon, _, _, _, _ = GetItemLinkInfo( itemName )
with the event
Code:
self.control:RegisterForEvent( EVENT_LOOT_RECEIVED, function( _, ... ) self:OnItemLooted( ... )    end )
But sometimes, icon information is missing.
(In fact alway when it's a quest item that is looted)

for the moment the workaround is
Code:
    if ( not icon or icon == '' ) then
        icon = [[/esoui/art/icons/icon_missing.dds]]
    end
How could have i the icon name ?
There is an icon im my bag, so how should i do to take it with the loot event ?
  Reply With Quote
04/17/14, 11:43 AM   #2
BadVolt
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 74
Originally Posted by Flagrick View Post
Hello,

Loot drop is using
Code:
local icon, _, _, _, _ = GetItemLinkInfo( itemName )
with the event
Code:
self.control:RegisterForEvent( EVENT_LOOT_RECEIVED, function( _, ... ) self:OnItemLooted( ... )    end )
But sometimes, icon information is missing.
(In fact alway when it's a quest item that is looted)

for the moment the workaround is
Code:
    if ( not icon or icon == '' ) then
        icon = [[/esoui/art/icons/icon_missing.dds]]
    end
How could have i the icon name ?
There is an icon im my bag, so how should i do to take it with the loot event ?
There are several ways to get link, like GetQuestRewardItemLink(). You can try this.
  Reply With Quote
04/18/14, 02:01 AM   #3
Flagrick
 
Flagrick's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 24
hello,
and thx for the reply.

The events parameters are these
Code:
EVENT_LOOT_RECEIVED (string receivedBy, string itemName, integer quantity, integer itemSound, integer lootType, bool self)
in case of quest item, then lootType = LOOT_TYPE_QUEST_ITEM
ok
but how could i use these parameters to link with

Code:
GetQuestRewardItemLink(luaindex rewardIndex, LinkStyle linkStyle)
Returns: string link
and what are
  • rewardIndex
  • linkStyle
  Reply With Quote
04/18/14, 09:37 AM   #4
Iyanga
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 183
Originally Posted by Flagrick View Post
in case of quest item, then lootType = LOOT_TYPE_QUEST_ITEM
ok
but how could i use these parameters to link with

Code:
GetQuestRewardItemLink(luaindex rewardIndex, LinkStyle linkStyle)
Returns: string link

You need to distinguish two cases!

The first one are items that are part of the quest, you know: Gather 4 garblknorps. For the garblknorps you have the LOOT_TYPE_QUEST_ITEM set. The second part are items as reward. Those come up as normal LOOT_TYPE_ITEM event!
  Reply With Quote
04/18/14, 12:12 PM   #5
ckaotik
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 12
Originally Posted by Flagrick View Post
GetQuestRewardItemLink(luaindex rewardIndex, LinkStyle linkStyle)
what are
  • rewardIndex
  • linkStyle
Well, rewardIndex is the index for which quest reward you are asking information. A quest might reward more than one thing, e.g. one or more items, a skill point or whatever. For most quests (that I have encountered so far) it seems there's only one item reward, i.e. rewardIndex = 1 will be your friend.

About linkStyle: There are two ways item links can be returned, check the wiki.
Code:
"[This is a fancy item]" -- LINK_STYLE_BRACKETS
"This is a fancy item" -- LINK_STYLE_DEFAULT
  Reply With Quote
05/01/14, 03:36 AM   #6
Flagrick
 
Flagrick's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 24
After this event
Code:
EVENT_LOOT_RECEIVED (string receivedBy, string itemName, integer quantity, integer itemSound, integer lootType, bool self)
I have try something like that
Code:
if (lootType == LOOT_TYPE_ITEM) then
  EasyFind(...)
end
elseif (lootType == LOOT_TYPE_QUEST_ITEM) then
  HardQuestFind(...)
end
in EasyFind() i'm using loot info or, if it's not enough to get icon, bag info.
in HardQuestFind(), not yet implemented,
is there a way to avoid the management and monitoring of quests.
I think that is a bit heavy to only have the icon, right?
  Reply With Quote
05/01/14, 04:35 AM   #7
lyravega
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 93
I have somewhat similar problem. In my add-on I have a little code which just prints the loot to the chat with d().

That event gives us itemName, it is cool. But I wasn't able to link it to any other function, in order to get the quality of it. Same goes for the icon, I mean both the quality and the icon, you can get via GetLootItemInfo(), but I have no clue how to obtain the lootId.
  Reply With Quote

ESOUI » Developer Discussions » General Authoring Discussion » GetItemLinkInfo - need help for LootDrop


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off