Check if itemid exists, with Perl
I made a quest where characters can create items that is similar to what Sonikboom did here. Items cannot be redeemed until the server resets which he says he does every night. His script then checks to see if a day has passed before he redeems the new item.
Is there a way in Perl to check to see if an item exists? If it does summon it, and if not tell the character they'll have to wait until server resets. |
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); Code:
bool QuestManager::IsValidItem(int32 itemid) Code:
XS(XS__IsValidItem); Code:
newXS(strcpy(buf, "IsValidItem"), XS__IsValidItem, file); |
I think something like this may work for you. You can look to see if the variable below is 0 or if it is not equal to the item ID you are feeding the command.
Code:
my $ItemID = 1001; # Set item id to verify here |
Perfect Trev, it works.
That's just the kind of trick I was trying to find. Thank you. |
All times are GMT -4. The time now is 11:24 AM. |
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.