Larian Banner
Previous Thread
Next Thread
Print Thread
Osiris/API/ItemIsInInventory #626172
04/10/17 04:12 PM
04/10/17 04:12 PM
Joined: Sep 2017
Posts: 159
M
monzua Offline OP
member
monzua  Offline OP
member
M

Joined: Sep 2017
Posts: 159
HI need some help: To unlock some dialogs if _player hast item in inventory i use ItemTemplateIsInInventory - works great but only for some items ... some dont work dont know why. So i looked at the wiki and found Osiris/API/ItemIsInInventory - so maybe ItemTemplate doesnt support all items and i should rather use Osiris/API/ItemIsInInventory

Can someone tlel me how to use Osiris/API/ItemIsInInventory with an example and do you guys have same issues with ItemtemplateIsInInventory?

thx

Re: Osiris/API/ItemIsInInventory [Re: monzua] #626174
04/10/17 04:23 PM
04/10/17 04:23 PM
Joined: Sep 2017
Posts: 159
M
monzua Offline OP
member
monzua  Offline OP
member
M

Joined: Sep 2017
Posts: 159
ps: looking into shared scripts to find out didnt really help me at all sadly ...

Re: Osiris/API/ItemIsInInventory [Re: monzua] #626234
04/10/17 06:17 PM
04/10/17 06:17 PM
Joined: Sep 2017
Posts: 159
M
monzua Offline OP
member
monzua  Offline OP
member
M

Joined: Sep 2017
Posts: 159
Got it working for people who are interested:

IF
ObjectFlagSet("CheckItemRune",(CHARACTERGUID)_Player,_Instance)
AND
ItemIsInInventory((ITEMGUID)ITEMGUID_LOOT_AtaraxianArtifacts_A_000_2a36a9b7-c5a4-47ea-955d-bcbfa659efa5,1)
THEN
ObjectSetFlag(_Player, "HasItemRune");

Re: Osiris/API/ItemIsInInventory [Re: monzua] #626268
04/10/17 07:26 PM
04/10/17 07:26 PM
Joined: Sep 2017
Posts: 159
M
monzua Offline OP
member
monzua  Offline OP
member
M

Joined: Sep 2017
Posts: 159
one thing i dont get how to solve, it seems whenever i spawn an item / or let the user create an item based an crafting rhis part of the item:

ITEMGUID_LOOT_AtaraxianArtifacts_A_000_2a36a9b7-c5a4-47ea-955d-bcbfa659efa5

the last part changes ... how can i check for a specific item if the id changes again and again?

Re: Osiris/API/ItemIsInInventory [Re: monzua] #626376
04/10/17 10:42 PM
04/10/17 10:42 PM
Joined: Dec 2016
Posts: 122
United States
Ameranth Offline
member
Ameranth  Offline
member

Joined: Dec 2016
Posts: 122
United States
If it's not a specific instance of an object that you want to check for, you can check inventory for an item template instead:


GetItemForItemTemplateInInventory

or

GetItemForItemTemplateInPartyInventory

you would provide these queries with the "name and guid" string of the root template. For example, if I wanted to check for LOOT_AtaraxianArtifacts_A, I would use this guid string:

"LOOT_AtaraxianArtifacts_A_629fdb6d-a88e-4a62-83a7-c4f4b3655d81"

Last edited by Ameranth; 04/10/17 10:43 PM.
Re: Osiris/API/ItemIsInInventory [Re: monzua] #628223
08/10/17 02:56 PM
08/10/17 02:56 PM
Joined: Mar 2016
Posts: 506
Belgium
T
Tinkerer Offline

addict
Tinkerer  Offline

addict
T

Joined: Mar 2016
Posts: 506
Belgium
I have documented the shared mod helper that you can use for this, along with a few related helpers you can use to create & give new items in dialogs based on root templates rather than item instances: DB_GiveTemplateFromPlayerDialogEvent and DB_GiveTemplateFromNpcToPlayerDialogEvent.

I have also updated and hopefully clarified the documentation about frame delays, which is quite important in this context.

Re: Osiris/API/ItemIsInInventory [Re: monzua] #628428
08/10/17 09:22 PM
08/10/17 09:22 PM
Joined: Sep 2017
Posts: 159
M
monzua Offline OP
member
monzua  Offline OP
member
M

Joined: Sep 2017
Posts: 159
Nice - yeah i noticed that frame delay thing did steal 1 hour of my life lol

aside that great that you updated wiki! thx

Last edited by monzua; 08/10/17 09:25 PM.

Moderated by  Dom_Larian, Larian_Koala 

Powered by UBB.threads™ PHP Forum Software 7.6.2