[Solved] Create Item from WorldServer, Item visible only after restart client

03/14/2017 13:27 Yothri#1
Hi,

I am currently trying to understand the FlyFF Source by implementing my own systems from scratch.

I just got inspired by a Perin Converter using the Motion System. So I created a new motion which tries to convert penya to perin when clicking the motion.

That also works. I check if user has more or equal to 100.000.000 penya in inventory, if yes, remove the gold, and create a perin in his inventory.

Well removing the penya works flawless. Creating the perin works too, but its first visible to player in inventory after relogging.

I am creating the Perin like that:

Code:
CItemElem itemElement;
itemElement.m_dwItemId = II_SYS_SYS_SCR_PERIN;
itemElement.m_nItemNum = 1;
itemElement.m_nHitPoint = -1;
itemElement.m_bCharged = 0;

pMover->AddItem(&itemElement);
This works, but perin is not in inventory instantly, only after relogging the user.

Is there some kind of refresh inventory?
What is weird is, i looked at the CreateItemFuncTextCmd to learn how items are created, and there is nothing like that.

So how can i create the perin instantly to users inventory not only after relogg?

Thanks in advance.

If someone is interested after its finished then I will release it, if there isn't already such a system released (let me know i was inactive in flyff for 2 years now, its problably already released in some released sources).

Thanks

Edit: Problem is solved. Here a demonstration.
03/14/2017 13:31 Blouflash#2
Use
Code:
pMover->CreateItem(&itemElement);
instead of
Code:
pMover->AddItem(&itemElement);
03/14/2017 13:33 Yothri#3
Quote:
Originally Posted by Blouflash View Post
Use
Code:
pMover->CreateItem(&itemElement);
instead of
Code:
pMover->AddItem(&itemElement);
Uhhh, I am dumb, even the FuncTextCmd CreateItem uses CreateItem...

Thank you, that should actually work. !!

Edit: Yep it works, so if there is someone interested, its finished now.
Here is a small video demonstration

03/20/2017 15:22 hanns.g#4
Whats happend when your Inventory is Full ?
03/20/2017 17:03 Yothri#5
Quote:
Originally Posted by hanns.g View Post
Whats happend when your Inventory is Full ?
Then a text appears that the conversion failed.