Jump to content

Recommended Posts

  • Premium

    int npc_open_shop(lua_State * L)
    {
        int iShopVnum = 0;
        if (lua_gettop(L) == 1)
        {
            if (lua_isnumber(L, 1))
                iShopVnum = (int) lua_tonumber(L, 1);
        }

        if (iShopVnum && CQuestManager::instance().GetCurrentNPCCharacterPtr())
            CShopManager::instance().StartShopping(CQuestManager::instance().GetCurrentCharacterPtr(), CQuestManager::instance().GetCurrentNPCCharacterPtr(), iShopVnum);
        else
            sys_err("Wrong iShopVnum || !NPCCharacterPtr");

        return 0;
    }

  • Love 1
Link to comment
Share on other sites

  • Premium

    int npc_open_shop(lua_State * L)
    {
        int iShopVnum = 0;
        if (lua_gettop(L) == 1)
        {
            if (lua_isnumber(L, 1))
                iShopVnum = (int) lua_tonumber(L, 1);
        }

        if (CQuestManager::instance().GetCurrentNPCCharacterPtr())
            CShopManager::instance().StartShopping(CQuestManager::instance().GetCurrentCharacterPtr(), CQuestManager::instance().GetCurrentNPCCharacterPtr(), iShopVnum);
        else
            sys_err(" !NPCCharacterPtr");

        return 0;
    }

 

Ok this is right.

When you give it from LUA

you can decide to use  npc.shop_open()    or   npc.shop_open(SHOP_VNUM)

  • Love 1
Link to comment
Share on other sites

  • Premium

bool CShopManager::StartShopping(LPCHARACTER pkChr, LPCHARACTER pkChrShopKeeper, int iShopVnum)

 

You're bound to give:

pkChr = CQuestManager::instance().GetCurrentCharacterPtr();

pkChrShopKeeper = CQuestManager::instance().GetCurrentNPCCharacterPtr();

iShopVnum = (int) lua_tonumber(L, 1);

 

If you want to open just from quest kinda letter, you must make a new boolean function to start shopping without pkChrShopKeeper.

 

  • Love 1
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.