Jump to content

//dar e equipar itens ao logar


F-Caneiras

Recommended Posts

//dar e equipar itens ao logar

 

Procurar em /source /server /game /src ( questlua_pc.cpp) encontrar:

ALUA(pc_get_informer_item)


colocar de baixo de toda a função

    int pc_give_and_equip_item(lua_State* L)
    {
        LPCHARACTER pkCharacter = CQuestManager::instance().GetCurrentCharacterPtr();

        if (!pkCharacter ||
           !lua_isnumber(L, 1))
        {
           lua_pushboolean(L, false);
           return 1;
        }

         LPITEM pkItem = ITEM_MANAGER::instance().CreateItem(lua_tonumber(L, 1));
          if (pkItem &&
            pkCharacter->EquipItem(pkItem))
        {
            lua_pushboolean(L, true);
          }
           else
           {
            M2_DESTROY_ITEM(pkItem);
            lua_pushboolean(L, false);
        }

    return 1;
    }

Procurar:

{ "get_informer_item", pc_get_informer_item }, 

adicionar a baixo

 { "give_and_equip_item", pc_give_and_equip_item },

no servidor ir a quaest_functions e add a nova função

 pc.give_and_equip_item

Agora na quest add:

pc.give_and_equip_item

para dar e equipar o item ao logar no server pela primeira vez ou outras coisas mais 

equip_wepon-min.gif

Edited by Caneiras
  • Like 1
Link to comment
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
×
×
  • Create New...