EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Quests::Q&A (https://www.eqemulator.org/forums/forumdisplay.php?f=599)
-   -   DeleteItemInInventory question (https://www.eqemulator.org/forums/showthread.php?t=38656)

Mortow 08-22-2014 09:56 PM

DeleteItemInInventory question
 
The Perl command $client->DeleteItemInInventory has three qualifiers after it. Slot_id, quantity, and client_update. The first two are self explanatory but what do you use for the third one to have it remove the item from inventory immediately?

Thanks,
Mortow

Kingly_Krab 08-22-2014 10:34 PM

client_update is a bool, so you can use 0 or 1. I've noticed weirdness with 'true' and 'false', so use 0 for 'false' and 1 for 'true'.

Uleat 08-22-2014 10:46 PM

The 'client_update' signifies whether to send the client an 'update' packet.

Either way, the result is immediate server-side.


In this example: https://github.com/EQEmu/Server/comp...b663c1012bR328

..the PutItemInInventory() call is followed by a SendItemPacket() call...

Had I made it 'PutItemInInventory(free_slot, *inst, true);' I could have avoided the extra command.


You really have to know what you're doing when using dealing with inventory shuffling, or you could end up with major desync's :mad:


Hopefully, the new system will be a little more intuitive :smile:

Mortow 08-22-2014 10:49 PM

Thank you both for your answers. I have tried a 1 for true in it but the item remains in inventory until you pick it up then I get a sync message and the item disappears from my cursor. Is this normal or have I hosed something somewhere?

Uleat 08-22-2014 11:41 PM

I was going to post an example..but, I couldn't find one for either put or delete in the scripts...


I don't want to speculate..but, it almost looks like the usage requires something else.


Kingly posted this in chat..

Code:

Perl_croak(aTHX_ "Usage: Client::DeleteItemInInventory(THIS, slot_id, quantity= 0, client_update= false)");

It almost looks like your should use
Code:

quest::DeleteItemInInventory($client, slot_id, quantity, bool);
- or however perl does it.


I just dunno :mad:

Noren 01-29-2015 01:53 AM

Bit of a thread necro, but to clarify for others:

In Perl...
$client->DeleteItemInInventory(252, 0, 1);
Will delete ALL of the item found in slot 252.

$client->DeleteItemInInventory(252, 1, 1);
Will delete 1 of the item found in slot 252.

For me, the client updates immediately when I use 1 for the last argument. Hope that helps!


All times are GMT -4. The time now is 06:13 PM.

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