Jump to content

jma96

Banned
  • Posts

    42
  • Joined

  • Last visited

  • Feedback

    0%

Posts posted by jma96

  1. This is actually bugged. If you are in a duel and you kill monsters or other players the function will still return true.

    Test it like that: make a quest where you get 1 item for killing a player in duel. Start a duel, but don't kill that player. Instead kill some monsters. Or just kill another player. I am sure that you will get that item even if you did not killed the player which you're dueling with.

     

    The correct code is like that (please don't copy and say it's yours. just request thread close) - you still have to include "pvp.h" :

    int is_pvp(lua_State* L)
    {
    	LPCHARACTER ch = CQuestManager::instance().GetCurrentCharacterPtr();
    	LPCHARACTER npc = CQuestManager::instance().GetCurrentNPCCharacterPtr();
    
    	if (!npc->IsPC())
    	{
    		lua_pushboolean(L, 0);
    		return 1;
    	}
    
    	CPVP kPVP(ch->GetPlayerID(), npc->GetPlayerID());
    	CPVP * pkPVP = CPVPManager::instance().Find(kPVP.GetCRC());
    
    	if (!pkPVP || !pkPVP->IsFight())
    	{
    		lua_pushboolean(L, 0);
    		return 1;
    	}
    
    	lua_pushboolean(L, 1);
    	return 1;
    }
    
    

    EDIT: Fixed m_dwCRC;

     

     

    quest tested begin
        state start begin
            when kill with npc.is_pc begin
                if pc.is_pvp() then
                    say("test")
                    return
                end
    end
    end
    end
    

    Hi, sorry for revive the post, but i tried that quest, and dont work.

    Source compile fine. Thanks

    • Love 1
×
×
  • 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.