Jump to content

Frozen

Inactive Member
  • Posts

    199
  • Joined

  • Last visited

  • Days Won

    7
  • Feedback

    0%

Posts posted by Frozen

  1. 11 hours ago, Ken said:

    At first, you don't have to follow a long way for that. The second one is about CPetActor::SetLevel. You don't have to follow a long way for that too. The default will be one all the time if the level is less than zero. 

    
    addPacket.dwLevel = IsPC() || IsMonster() || IsPet() ? GetLevel() : 0;
    
    void CPetActor::SetLevel(BYTE level)
    {
    	if (!IsSummoned())
    		return;
    	
    	if (level < 0)
    		level = 1; // Default will be 1 all the time if the level is less than zero.
    	
    	m_pkChar->SetLevel(level);
    	m_level = level;
    }

    That's totally correct, thanks for the optimization.

    Kind Regards.

  2. Hey guys, i think not many people know how to put the pet name like oficial so im making a tutorial on how to do it.

     

    • First, go to game->PetSystem.cpp and search for:
    Spoiler

     void CPetActor::SetName(const char* name)

     

    •  Under that function add this:           
    Spoiler

     

    void CPetActor::SetLevel(BYTE level)
    {
        BYTE petLevel = level;
        if (0 > level)
        {
            petLevel = 0;
        }

        if (true == IsSummoned())
            m_pkChar->SetLevel(petLevel);

        m_level = petLevel;
    }

     

     

    • Search for:
    Spoiler

    DWORD CPetActor::Summon(const char* petName, LPITEM pSummonItem, bool bSpawnFar)

     

    • Replace with:
    Spoiler

    DWORD CPetActor::Summon(const char* petName, BYTE petLevel, LPITEM pSummonItem, bool bSpawnFar)

     

    • In that same function (Summon), you will find this:
    Spoiler

    this->SetName(petName);

     

    • Add under:
    Spoiler

    this->SetLevel(petLevel);

     

    • Search for:
    Spoiler

    CPetActor* CPetSystem::Summon(DWORD mobVnum, LPITEM pSummonItem, const char* petName, bool bSpawnFar, DWORD options)

     

    • Replace with:
    Spoiler

    CPetActor* CPetSystem::Summon(DWORD mobVnum, LPITEM pSummonItem, const char* petName, BYTE petLevel, bool bSpawnFar, DWORD options)

     

    • In the same function you will find:
    Spoiler

    DWORD petVID = petActor->Summon(petName, pSummonItem, bSpawnFar);

     

    • Replace with:
    Spoiler

    DWORD petVID = petActor->Summon(petName, petLevel, pSummonItem, bSpawnFar);

    • Save the file.

     

    • Open game->PetSystem.h.
    • Search for:
    Spoiler

    std::string        m_name; 

     

    • Add under:
    Spoiler

    BYTE            m_level;

     

    • Search for:
    Spoiler

    void            SetName(const char* petName);

     

    • Add under:
    Spoiler

    void            SetLevel(BYTE petLevel);

     

    • A little bit under you will find:
    Spoiler

    DWORD            Summon(const char* petName, LPITEM pSummonItem, bool bSpawnFar = false);

     

    • Replace with:
    Spoiler

    DWORD            Summon(const char* petName, BYTE petLevel, LPITEM pSummonItem, bool bSpawnFar = false);

     

    • Search for:
    Spoiler

    CPetActor*    Summon(DWORD mobVnum, LPITEM pSummonItem, const char* petName, bool bSpawnFar, DWORD options = CPetActor::EPetOption_Followable | CPetActor::EPetOption_Summonable);

     

    • Add Under;
    Spoiler

    CPetActor*    Summon(DWORD mobVnum, LPITEM pSummonItem, const char* petName, BYTE petLevel, bool bSpawnFar, DWORD options = CPetActor::EPetOption_Followable | CPetActor::EPetOption_Summonable);

     

    • Save the file. 

     

    Lastly we will change the quest function pet.summon(mobVnum, petName, bFromFar) to pet.summon(mobVnum, petName, petLevel, bFromFar)

     

    • Open game->questlua_pet.cpp and search for :
    Spoiler

    int pet_summon(lua_State* L)

     

    • Replace the function with:
    Spoiler

     

    int pet_summon(lua_State* L)
        {
            LPCHARACTER ch = CQuestManager::instance().GetCurrentCharacterPtr();
            CPetSystem* petSystem = ch->GetPetSystem();
            LPITEM pItem = CQuestManager::instance().GetCurrentItem();
            if (!ch || !petSystem || !pItem)
            {
                lua_pushnumber (L, 0);
                return 1;
            }

            if (0 == petSystem)
            {
                lua_pushnumber (L, 0);
                return 1;
            }

            // ¼Òȯ¼öÀÇ vnum
            DWORD mobVnum= lua_isnumber(L, 1) ? lua_tonumber(L, 1) : 0;

            // ¼Òȯ¼öÀÇ À̸§
            const char* petName = lua_isstring(L, 2) ? lua_tostring(L, 2) : 0;

            BYTE petLevel = lua_isnumber(L, 3) ? lua_tonumber(L, 3) : 0;

            // ¼ÒȯÇÏ¸é ¸Ö¸®¼­ºÎÅÍ ´Þ·Á¿À´ÂÁö ¿©ºÎ
            bool bFromFar = lua_isboolean(L, 4) ? lua_toboolean(L, 4) : false;

            CPetActor* pet = petSystem->Summon(mobVnum, pItem, petName, petLevel, bFromFar);

            if (pet != NULL)
                lua_pushnumber (L, pet->GetVID());
            else
                lua_pushnumber (L, 0);

            return 1;
        }

     

    • Save the file.
    • Compile It.

    Done :)

    Now just change your pet quest function to pet.summon(mobVnum, petName, petLevel, bFromFar).

    To make the clientside changes check out .Avenue topic: https://metin2dev.org/board/index.php?/topic/8276-how-to-pet-level-in-other-color-like-official/
    PS: In .Avenue topic dont forget to check also the second post he done is a important step to make you see the pet level.

    I hope this was usefull,
    Kind Regards,
    Frozen

     

    • Love 5
  3. did you replace this?

    def MakeEachButton(self, i):
    		if self.skin == 3:
    			button = BarButton("TOP_MOST")
    			button.SetParent(self.board)
    			button.SetSize(106,26)
    			button.SetPosition(self.sx + self.board.GetWidth()/2+((i*2)-1)*56-56, self.sy+(event.GetLineCount(self.descIndex))*16+20+5)
    			button.SetText("a")
    			button.SetTextColor(0xff000000)
    		else:
    			i = i % 8
    			button = BarButton("TOP_MOST")
    			button.SetParent(self.board)
    			button.SetSize(200,26)
    			button.SetPosition(self.sx + self.board.GetWidth()/2-100,self.sy+(event.GetLineCount(self.descIndex)+i*2)*16+20+5)
    			button.SetText("a")
    			button.SetTextColor(0xffffffff)
    		return button

    if yes, show the syssr of the client pls

  4. Try this: 

    class BarButton(ui.Button):
    	
    	btpath = "d:/ymir work/ui/public/" # HERE THE PATH
    	btnormal = btpath + "/btnnormal.tga" # HERE THE BUTTON NAME
    	btover = btpath + "/btnnormal.tga" # HERE THE BUTTON NAME
    	btdisable = btpath + "/btnnormal.tga" # HERE THE BUTTON NAME
    
    
    	def __init__(self, layer = "UI", 
    			aButtonUp   = btnormal, 
    			aButtonDown = btdisable, 
    			aButtonOver = btover):
    		ui.Button.__init__(self,layer)
    		self.SetUpVisual(aButtonUp)
    		self.SetOverVisual(aButtonOver)
    		self.SetDownVisual(aButtonDown)
    		
    	def CallEvent(self):
    		ui.Button.CallEvent(self)

     

    and replace the MakeEachButtonFunction for this:

    def MakeEachButton(self, i):
    		if self.skin == 3:
    			button = BarButton("TOP_MOST")
    			button.SetParent(self.board)
    			button.SetSize(106,26)
    			button.SetPosition(self.sx + self.board.GetWidth()/2+((i*2)-1)*56-56, self.sy+(event.GetLineCount(self.descIndex))*16+20+5)
    			button.SetText("a")
    			button.SetTextColor(0xff000000)
    		else:
    			i = i % 8
    			button = BarButton("TOP_MOST")
    			button.SetParent(self.board)
    			button.SetSize(200,26)
    			button.SetPosition(self.sx + self.board.GetWidth()/2-100,self.sy+(event.GetLineCount(self.descIndex)+i*2)*16+20+5)
    			button.SetText("a")
    			button.SetTextColor(0xffffffff)
    		return button

     

    dont forget to put the buttons path

  5. 
    int _say(lua_State* L)
    	{
    		ostringstream s;
    		combine_lua_string(L, s);
    		CQuestManager::Instance().AddScript("[COLOR r;{numberofcolorred}|g;{numberofcolorgreen}|b;{numberofcolorblue}]" + s.str() + "[/COLOR][ENTER]");
    		return 0;
    	}

    and replace the {numeberofcolorred},{numeberofcolorblue} and {numeberofcolorgreen} for the number you want.

    I dont know if this is correct i dont know anything about c++.. but try it.. maybe it works

     

    • Love 1
  6.  

    0907 13:58:03678 ::
    networkModule.py(line:208) SetSelectCharacterPhase
    system.py(line:130) __pack_import
    system.py(line:110) _process_result
    introSelect.py(line:30) <module>
    system.py(line:130) __pack_import
    system.py(line:110) _process_result
    interfaceModule.py(line:26) <module>
    system.py(line:130) __pack_import
    system.py(line:110) _process_result
    uiSystem.py(line:12) <module>
    system.py(line:130) __pack_import
    system.py(line:110) _process_result
    uichannel.py(line:264) <module>
    uichannel.py(line:17) __init__
    uichannel.py(line:134) __Fill_Up_ChannelList
    uichannel.py(line:140) __RequestServerStateList
    uichannel.py(line:131) __GetServerID
    networkModule.SetSelectCharacterPhase - <type 'exceptions.UnboundLocalError'>:local variable 'serverID' referenced before assignment
    0907 13:58:03679 :: ============================================================================================================
    0907 13:58:03679 :: Abort!!!!
    
    

    You need to define first the serverId before using it, try to put this in the __init__ function in uichannel.py:

    self.serverID = ""

     

  7. Hello, im trying to run a python script, but the client gives this error:

    0902 13:07:15186 :: GRANNY: r:/granny/rt/granny_file_info.cpp(145): File has run-time type tag of 0x8000000f, which doesn't match this version of Granny (0x80000010).  Automatic conversion will be attempted.
    0902 13:08:27973 :: Traceback (most recent call last):
    
    0902 13:08:27973 ::   File "game.py", line 1952, in BINARY_ServerCommand_Run
    
    0902 13:08:27974 ::   File "stringCommander.py", line 63, in Run
    
    0902 13:08:27974 ::   File "stringCommander.py", line 31, in __call__
    
    0902 13:08:27974 ::   File "stringCommander.py", line 20, in __call__
    
    0902 13:08:27974 ::   File "game.py", line 2254, in __PetIncubator
    
    0902 13:08:27974 ::   File "system.py", line 130, in __pack_import
    
    0902 13:08:27974 ::   File "
    0902 13:08:27974 :: <string>
    0902 13:08:27974 :: ", line 
    0902 13:08:27974 :: 55
    0902 13:08:27974 :: 
    
    0902 13:08:27974 ::     
    0902 13:08:27974 :: chat.AppendChat(1, str(constInfo.PET_INCUBATOR[0]]))
    
    0902 13:08:27974 ::     
    0902 13:08:27974 ::  
    0902 13:08:27974 ::  
    0902 13:08:27974 ::  
    0902 13:08:27974 ::  
    0902 13:08:27974 ::  
    0902 13:08:27974 ::  
    0902 13:08:27974 ::  
    0902 13:08:27974 ::  
    0902 13:08:27974 ::  
    0902 13:08:27974 ::  
    0902 13:08:27974 ::  
    0902 13:08:27974 ::  
    0902 13:08:27974 ::  
    0902 13:08:27974 ::  
    0902 13:08:27974 ::  
    0902 13:08:27974 ::  
    0902 13:08:27974 ::  
    0902 13:08:27974 ::  
    0902 13:08:27974 ::  
    0902 13:08:27974 ::  
    0902 13:08:27974 ::  
    0902 13:08:27974 ::  
    0902 13:08:27974 ::  
    0902 13:08:27974 ::  
    0902 13:08:27974 ::  
    0902 13:08:27974 ::  
    0902 13:08:27974 ::  
    0902 13:08:27974 ::  
    0902 13:08:27974 ::  
    0902 13:08:27974 ::  
    0902 13:08:27974 ::  
    0902 13:08:27974 ::  
    0902 13:08:27974 ::  
    0902 13:08:27974 ::  
    0902 13:08:27974 ::  
    0902 13:08:27974 ::  
    0902 13:08:27974 ::  
    0902 13:08:27974 ::  
    0902 13:08:27974 ::  
    0902 13:08:27974 ::  
    0902 13:08:27974 ::  
    0902 13:08:27974 ::  
    0902 13:08:27974 ::  
    0902 13:08:27974 ::  
    0902 13:08:27974 ::  
    0902 13:08:27974 ::  
    0902 13:08:27974 ::  
    0902 13:08:27974 ::  
    0902 13:08:27974 ::  
    0902 13:08:27974 :: ^
    
    0902 13:08:27974 :: SyntaxError
    0902 13:08:27974 :: : 
    0902 13:08:27974 :: invalid syntax
    0902 13:08:27974 :: 

    the :

    chat.AppendChat(1, str(constInfo.PET_INCUBATOR[0]]))
    

    was the last line i wrote, but after that i have some script that i copied, and i think the part of the script i copied works, but the one i wrote it gives this error...

    Is it the lenguage im using? the coding?

    Im using notepad++

     

    Can somewone please help me?

    Kind Regards,

    Frozen

     

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