Quote:
Originally Posted by C0mpaq
here you have 1 npc have all items new 7.4 - 8.1 items : loots ,pets ,decos ,gears mc , items shop , alot of items..
|
Thanks you for your help but thats' not what i need
Maybe i didn't explain my problem clearly enough.
I would like to know if there is a LUA command to check in player inventory if there is a specific item and if necessary remove it.
Pretty much like the Pet enchanter NPC does for artifacts
Quote:
Originally Posted by Tofrum
i lol'd
|
wow... i have this feeling this community needs to chill out sometimes.
He made a mistake... prolly explaining the right way to do things would have been more useful than lolling o.o
---------------------------------------------------------
When someone uses his own brain there is a chance to get a result
while thinking to an example for my last (this .,.) post Creature enchanter came into my mind, so i traced her from the database to lua scrip folder up to this script:
Code:
function Deva_artifact_insert(handle)
dlg_title( "@91000304" )
dlg_text( "@91000308" )
local soulcatcher_count = find_item(710002)
local vigor_list_count = table.getn( vigor_list )
if soulcatcher_count < 1 then
dlg_text( "@91000337" )
else
for i=1, vigor_list_count do
if get_item_code(handle) == vigor_list[i] then
local artifact = artifact_list[i]
local artifact_count = table.getn( artifact )
local select_one = math.random(1, artifact_count)
delete_item( handle, 1 )
delete_item( get_item_handle( 710002 ), 1 )
insert_item( artifact[select_one], 1 )
end
end
dlg_text( "@91000340" )
end
dlg_menu( "@90010003", "NPC_Creature_Enchanter_Deva_contact()" )
dlg_menu( "@90010002", '' )
dlg_show()
end
As you can see there is this
delete_item command. Need to dig deeper on this one, if anyone does know how it works and is willing to share i'd be grateful