Go Back   EQEmulator Home > EQEmulator Forums > Quests > Quests::Q&A

Quests::Q&A This is the quest support section

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 09-17-2011, 01:00 AM
Tabasco's Avatar
Tabasco
Discordant
 
Join Date: Sep 2009
Posts: 269
Default

I don't see any existing function that will do what you want.
With DBI installed you could query the tiems table, but that doesn't guarantee that the item actually exists in the shared memory block.

You could try this though:

questmgr.h (somewhere under public
Code:
bool IsValidItem(int32 itemid);
questmgr.cpp
Code:
bool QuestManager::IsValidItem(int32 itemid)
{
    return(database.GetItem(itemid));
}
perlparser.cpp
Code:
XS(XS__IsValidItem);
XS(XS__IsValidItem)
{
    dXSARGS;
    if (items != 1)
        Perl_croak(aTHX_ "Usage: IsValidItem(itemid)");

    int32       itemid = (int32)SvUV(ST(0));
    bool        RETVAL;
    dXSTARG;


    RETVAL = quest_manager.IsValidItem(itemid);
    XSprePUSH; PUSHu((IV)RETVAL);

    XSRETURN(1);
}
Then add to the boot_quest function in perlparser.cpp
Code:
newXS(strcpy(buf, "IsValidItem"), XS__IsValidItem, file);
I can test it fully in the morning, but for now I can at least tell you that it compiles.
Reply With Quote
 


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

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

Forum Jump

   

All times are GMT -4. The time now is 10:28 AM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3