• 0
Sign in to follow this  
Followers 0
TekkForCeAD2

C++ HELP Drop Items in the Inventory

Question

Hello,

if (pkKiller->GetLevel() >= 15 && abs(pkKiller->GetLevel() - pkChr->GetLevel()) <= 10)
        {
            int pct = quest::CQuestManager::instance().GetEventFlag("mondi_drop");

            if (pct > 0)
            {
                const DWORD ITEM_VNUM = 50011;

                if (number(1,400) <= pct)
                {
                    if ((item = CreateItem(ITEM_VNUM, 1, 0, true)))
                        vec_item.push_back(item);
                }
            }
        }


What i must change that the drop came in the inventory and not on the floor.

Share this post


Link to post
Share on other sites

7 answers to this question

  • 0

if ((item = AutoGiveItem(ITEM_VNUM, 1, 0, true)))

1 person likes this

Share this post


Link to post
Share on other sites
  • 0
1 hour ago, M.Sorin said:

if ((item = AutoGiveItem(ITEM_VNUM, 1, 0, true)))

error: 'AutoGiveItem' was not declared in this scope

Dont work

Share this post


Link to post
Share on other sites
  • 0

Wait , i edit you code.

 

 

    if (pkKiller->GetLevel() >= 15 && abs(pkKiller->GetLevel() - pkChr->GetLevel()) <= 5)
    {
        int pct = quest::CQuestManager::instance().GetEventFlag("mondi_drop");

        if (pct > 0)
        {
            if (number(1,100) <= pct)
            {
                    const static DWORD moon_treasure = 50011;
                    pkKiller->AutoGiveItem(moon_treasure, 1);
            }
        }
    }

 

 

Share this post


Link to post
Share on other sites
  • 0
3 hours ago, M.Sorin said:

Wait , i edit you code.

 

 

    if (pkKiller->GetLevel() >= 15 && abs(pkKiller->GetLevel() - pkChr->GetLevel()) <= 5)
    {
        int pct = quest::CQuestManager::instance().GetEventFlag("mondi_drop");

        if (pct > 0)
        {
            if (number(1,100) <= pct)
            {
                    const static DWORD moon_treasure = 50011;
                    pkKiller->AutoGiveItem(moon_treasure, 1);
            }
        }
    }

 

 

Thanks ! work fine.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0

  • Recently Browsing   0 members

    No registered users viewing this page.