EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Quests::LUA (https://www.eqemulator.org/forums/forumdisplay.php?f=680)
-   -   $npc->GetItemStat($itemid, "id"); in LUA? (https://www.eqemulator.org/forums/showthread.php?t=39908)

Rabuk 08-04-2015 12:59 PM

$npc->GetItemStat($itemid, "id"); in LUA?
 
Hello,
anyone knows the LUA function for: $npc->GetItemStat($itemid, "id");?

I have looked in the sourcecode, lua reference and lua modules but cant find any function like that.

Thanks in advance :)

NatedogEZ 08-04-2015 05:11 PM

I had NO idea how to do this either lol.. but at the same time I did know how to do it.. was a huge brain fart .

Here are the identifiers that can be used..
https://github.com/EQEmu/Server/blob..._item.cpp#L908


I kept trying to do..
"myitem:GetName()" -- which is wrong .. but the correct way is in the code below. Which is why I was having a brain fart .. :(

Code:

function event_say(e)
       
        local myitem = Item(1001);
       
        if(e.message:findi("hail")) then
                e.other:Message(335, "Item name is.. " .. myitem:Name());
        end

end


Rabuk 08-04-2015 06:11 PM

Quote:

Originally Posted by NatedogEZ (Post 242329)
I had NO idea how to do this either lol.. but at the same time I did know how to do it.. was a huge brain fart .

Here are the identifiers that can be used..
https://github.com/EQEmu/Server/blob..._item.cpp#L908


I kept trying to do..
"myitem:GetName()" -- which is wrong .. but the correct way is in the code below. Which is why I was having a brain fart .. :(

Code:

function event_say(e)
       
        local myitem = Item(1001);
       
        if(e.message:findi("hail")) then
                e.other:Message(335, "Item name is.. " .. myitem:Name());
        end

end


Ah cool thank you very much. Will check out this soon. :)


All times are GMT -4. The time now is 01:41 AM.

Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.