Jump to content

Ropen

Member
  • Posts

    41
  • Joined

  • Last visited

  • Feedback

    0%

Posts posted by Ropen

  1. On 3/15/2024 at 12:49 AM, Jimmermania said:

    This is the fix. item.cpp , search:
     

    		case ITEM_COSTUME:
    			{
    				DWORD toSetValue = this->GetVnum();
    				EParts toSetPart = PART_MAX_NUM;
    				
    				if (GetSubType() == COSTUME_BODY)

    Replace the whole function with this:
     

    				if (GetSubType() == COSTUME_BODY)
    				{
    					toSetPart = PART_MAIN;
    					if (false == bAdd)
    					{
    						const CItem* pArmor = m_pOwner->GetWear(WEAR_BODY);
    #if defined(__BL_TRANSMUTATION__)
    						if (pArmor != NULL)
    						{
    							const DWORD dwVnum = pArmor->GetVnum();
    							const DWORD dwTransmutationVnum = pArmor->GetTransmutationVnum();
    							toSetValue = dwTransmutationVnum != 0 ? dwTransmutationVnum : dwVnum;
    						}
    						else
    						{
    							toSetValue = m_pOwner->GetOriginalPart(PART_MAIN);
    						}
    #else
    						toSetValue = (NULL != pArmor) ? pArmor->GetVnum() : m_pOwner->GetOriginalPart(PART_MAIN);
    #endif
    					}
    				}

     


    can u share ur
     

    else if (GetSubType() == COSTUME_WEAPON)

    i have same problem in costume weapon too
     

    • Good 1
  2. hello there

    i have a problem with Block System - Messenger From @ Mali
    that  I can't unblock someone if he not online in the game

    ( if he is online it works fine )

    I checked this but didn't find a solution
    could any one help?

    void MessengerManager::__RemoveFromBlockList(const std::string& account, const std::string& companion)
    {
    	m_BlockRelation[account].erase(companion);
    	m_InverseBlockRelation[companion].erase(account);
    
    	LPCHARACTER ch = CHARACTER_MANAGER::instance().FindPC(account.c_str());
    	LPDESC d = ch ? ch->GetDesc() : NULL;
    
    	if (d)
    		ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("%s is no longer blocked."), companion.c_str());
    }

     

    
    void MessengerManager::RemoveFromBlockList(const std::string& account, const std::string& companion)
    {
    	if (companion.size() == 0)
    		return;
    
    	char szCompanion[CHARACTER_NAME_MAX_LEN + 1];
    	DBManager::instance().EscapeString(szCompanion, sizeof(szCompanion), companion.c_str(), companion.length());
    	DBManager::instance().Query("DELETE FROM messenger_block_list%s WHERE `account` = '%s' AND `companion` = '%s'",
    		get_table_postfix(), account.c_str(), szCompanion);
    
    	__RemoveFromBlockList(account, companion);
    
    	TPacketGGMessenger p2ppck;
    
    	p2ppck.bHeader = HEADER_GG_MESSENGER_BLOCK_REMOVE;
    	strlcpy(p2ppck.szAccount, account.c_str(), sizeof(p2ppck.szAccount));
    	strlcpy(p2ppck.szCompanion, companion.c_str(), sizeof(p2ppck.szCompanion));
    	P2P_MANAGER::instance().Send(&p2ppck, sizeof(TPacketGGMessenger));
    }

     

  3. hello every one

    I tried to do  quest function as shown below

     

    	int npc_is_gm(lua_State* L)
    	{
    		LPCHARACTER npc = CQuestManager::instance().GetCurrentNPCCharacterPtr();
    		lua_pushboolean(L, npc->GetGMLevel() >= GM_HIGH_WIZARD);
    		return 1;
    	}
    
    	int npc_get_gm_level(lua_State* L)
    	{
    		LPCHARACTER npc = CQuestManager::instance().GetCurrentNPCCharacterPtr();
    		lua_pushnumber(L, npc->GetGMLevel());
    		return 1;
    	}

    But it didn't work in quest , does any one know where is the problem?

    The purpose of the function is to create a quest that will send the player to the city if he is killed by GM

    		when death with npc.is_gm() begin 
    			if game.get_event_flag("send_home") == 1 and pc.get_map_index() == 182 then
    				warp_to_village()
    			end
    		end

     

    @ Syreldar Maybe you can help at this

  4.  

    ----------------

    # edit


    Based on the last error in server syserr ,  I came to the conclusion that the problem is precisely here

     

    	else if (IS_SET(pkSk->dwFlag, SKILL_FLAG_USE_ARROW_DAMAGE))
    	{
    		LPITEM pkBow, pkArrow;
    		if (1 == GetArrowAndBow(&pkBow, &pkArrow, 1))
    		{
    			pkSk->SetPointVar("atk", CalcArrowDamage(this, this, pkBow, pkArrow, true)); // this line is the problem
    		}
    		else
    		{
    			pkSk->SetPointVar("atk", 0);
    		}
    	}

    but i don't know why it's make a core
     

    pkSk->SetPointVar("atk", CalcArrowDamage(this, this, pkBow, pkArrow, true)); 



    It seems logical

    Chanel Syserr

    SYSERR: Aug  6 13:13:07 :: CalcMeleeDamage: CalcMeleeDamage should not handle bows (name: xABOLOMA1)
    SYSERR: Aug  6 13:15:19 :: operator(): CFuncShoot: I don't know this type [255] of range attack.
    SYSERR: Aug  6 13:17:58 :: Select: wrong QUEST_SELECT request! : 5475
    SYSERR: Aug  6 13:21:49 :: operator(): CFuncShoot: I don't know this type [255] of range attack.

     

  5. dose any one know why this game core ?

    spacer.png

     

    char.cpp :

    https://pastebin.com/i0vn0eAq

     

    char_skill.cpp :

    https://pastebin.com/azFeXhUY


    event.cpp :

    https://pastebin.com/NuWJ0EYw

     

     

    --------

     

    #0 msg

    spacer.png

     

     

    #1 msg

    spacer.png

     

    #3 msg

    spacer.png

     

    #4 msg

    spacer.png

     

    #5 msg

    spacer.png

     

     

    Its a PvP Server . And there are no monsters except 4 types, with a total 20 monsters in all the game , also the hydra is not used in the server ,
    I only have the first and second empires active no maps else .

     

     

  6. On 7/27/2022 at 6:33 PM, Jira said:

    just add -Wno-invalid-source-encoding

    ex) 

    CFLAGS = -m32 -g -Wall -O2 -pipe -fexceptions -std=c++17 -fno-strict-aliasing -pthread -D_THREAD_SAFE -DNDEBUG -Wno-invalid-source-encoding

     

    thx bro its works good for encoding
    but can i stop it for all warning ? like that warning

    .png

     

     

    ----

     

    edit

     

    thx i used  -Wno-unused-private-field

    • kekw 1
  7.  

    if i used  mysql_direct_query like that

    local name = input();
    mysql_direct_query("UPDATE player.player SET block_map = '1' WHERE name = "..name..""); 

     

    could i use mysql_direct_query to get block_map value ? and relying on it block the player like that ?

    local myname = pc.get_name() ;
    local results, ret = mysql_direct_query(string.format("SELECT `block_map` FROM `player`.`player` WHERE `name` = '%s' LIMIT 1;", myname));
    			
    if (results > 0) then
    	say ("u can't enter")
    else
    	pc.warp( 947100 , 169800 )
    end -- if/else

    Is it an effective method ? or will there be problems ?

  8. hi dev's

    i asked how can i  block a player from entering a map by using   pc.setqf  and pc.getqf

    by give him a pc.setqf  from input

    ex :

    i will use that check in quest

     

        if pc.getqf("cannot_enter") == 1 then
            say(" u can't enter the map ")
        else
            pc.warp( 947100 , 169800 )
        end

    now i want to give a player ( not me ) a ( pc.setqf ) from input by typing his name

     

    quest test begin
    	state start begin
    		when 10581.chat." Block Player " with pc.is_gm() begin
    			say_event_title(mob_name(10581))
    			say()
    			say(" type the name of the player which u want to block here  ")
    			local name = input();	
    			
    			---------------------------- Error 404 ): ----------------------------------
    
    			-- How can i set a
    			pc.setqf("cannot_enter", 1)
    			-- for the name from input ?
    			
    		end
    	end
    end

     

     

  9. 1 minute ago, Syreldar said:

    You're free to use semicolons if you like them. Lua doesn't rly care.

    They're also used to write multiple statements in a single line, I do regardless cause they're one of my many signatures and don't change the code's flow.

    yeah , i think  WeedHex means my previous attempts
    this one
     

    command("code ",name," 1")  

     

  10. 1 minute ago, Syreldar said:
    name = tonumber(input())

    Your input only accepts numerical values and you didn't make any input validation.

    If "name" is supposed to be the name of a player this will never work because of that. It should be:

    name = input()

    and then add some validation to check if the name exist and the player is online, if necessary.

    🤦‍♂️🤦‍♂️
    i didn't recognize it
    it works Perfect now
    thnx alot 🥰

    can i get the target name as avariable to the command ?

  11. 2 minutes ago, Syreldar said:

    It depends, what are you trying to do? What's the command supposed to send/receive?

    command("code "..name.." 1");
    command(string.format("code %s 1", name));

    These are both written with valid syntax and do the same thing.

    Thank you for caring

    its a voice chat system the code syntax is

    voice_chat [name] [id]

    so i type quest in this way

     

    quest private_voice_chat begin
    	state start begin	
    		when 40003.use begin
    			say_event_title(item_name(40003))
    				say()
    				say_light_blue(" type the receiver name ")
    				say()
    				name = tonumber(input())
    				say_event_title(item_name(40003))
    					say()
    					say_light_blue(" choose voice ")
    					say()
    					local voice = select(" voice 1 ", " voice 2 ", " cancel ")
    					if voice == 1 then
    						command(string.format("voice_chat %s 1", name));
    					elseif voice == 2 then
    						command(string.format("voice_chat %s 2", name));
    					else
    						return
    				end
    		end
    	end
    end

    but it didn't work 😐
    if i used code in game /voice_chat [name] [id]

    it works
     

  12.  

    hi there

    i asked if there is any way to add variable from input to command in the quest

    i tried to make it like that

     -- name is a input variable 
    command("code "..name.." 1")
    command("code ",name," 1")  
    command("code "+name+" 1")
    
    local test = command("code ")
    chat(test..name.." ")
    
    local test = command("code ") + name + " 1"
    chat(test)

    the code was not executed correctly in the game
    any one know the solution ?

    thnx alot

  13. Hi devs ,

    I would like to upgrade the View Equipment system to get the character's points such as HP , SP , Str , magic attack , magic defense,..etc.
     Details in this window
    https://metin2.download/picture/9YN65fishsoBt0qQKm8q53IjXfyHy3pf/.jpg

    I tried to use as ex :

    self.GetChild("MATT_Value").SetText(self.__GetTotalMagAtkText())
    
    	def __GetTotalMagAtkText(self):
    		minMagAtk=player.GetStatus(player.MAG_ATT)+player.GetStatus(player.MIN_MAGIC_WEP)
    		maxMagAtk=player.GetStatus(player.MAG_ATT)+player.GetStatus(player.MAX_MAGIC_WEP)
    
    		if minMagAtk==maxMagAtk:
    			return "%d" % (minMagAtk)
    		else:
    			return "%d-%d" % (minMagAtk, maxMagAtk)
    
              

    But it showed the details of my character, not the target

    https://metin2.download/picture/G6CB4Jn680gw10hm981g6S8L8ovpgXhe/.jpg


    Does anyone know a way to do this?

     

    thnx all 💙

  14. 16 hours ago, Chookez said:

    I was a little confused yesterday, it seems.

    PythonMinimap.cpp

     

    Search this:

    
    else if (pkInstEach->IsNPC()

    Change to:

    
    else if (pkInstEach->IsNPC() && !pkInstEach->IsInvisibility())

    And then add this to this function:

    
                if (pkInstEach->IsPet() || pkInstEach->IsMount())
                    continue;

    Like this:

    081953Nevtelen.png

    Its done. Now open InstanceBase.cpp

     

    Search this function:

    
    void CInstanceBase::GetBoundBox(D3DXVECTOR3 * vtMin, D3DXVECTOR3 * vtMax)

    After this function add this:

    
    BOOL CInstanceBase::IsPet()
    {
        if (GetRace() >= 34001 && GetRace() <= 34021)
            return true;
    
        return false;
    }
    
    BOOL CInstanceBase::IsMount()
    {
        if (GetRace() >= 20101 && GetRace() <= 20109)
            return true;
    
        return false;
    }

     

    Here you can change how long they are hidden, by ID.

     

    Now open: InstanceBase.h

     

    Search this:

    
    void                    SetDuelMode(DWORD type);

    Add after:

    
            BOOL IsPet();
            BOOL IsMount();

     

     

    thnx bro , done .

  15. On 2/8/2021 at 9:20 AM, Chookez said:

    Open: PythonMinimap.cpp

     

    Search: 

    
    else if (pkInstEach->IsNPC() && !pkInstEach->IsInvisibility())

    Add this:

    
                if (pkInstEach->IsPet() || pkInstEach->IsMount())
                    continue;

    Like this:

    081953Nevtelen.png

     

    It hides them all.

     

     

     

    thnx bro but how can i solve that error ?

    spacer.png

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