Jump to content

Kafa

Inactive Member
  • Posts

    269
  • Joined

  • Last visited

  • Feedback

    0%

Posts posted by Kafa

  1. 17 minutes ago, peakzinho said:

    I have your problem...

    if I kill mobs on the map, the new skill stops working and in addition the level is only temporary and the player's name is black

    The players name is black because you put the if condition for the name color in the wrong place. (Tutorial i wrong) in the same function at the bottom there are a couple of if ... return name shit you need to put the condition there. Then the black player name is fixed bro im on smartphone.

     

    edit: im talking about InstanceBaseEffect

    cpp

     

    GetNameColorIndex

  2. 10 hours ago, Finnis said:

    M2 Download Center

    This is the hidden content, please
      ( Internal )
    This is the hidden content, please
     
    ( Github )

    Helloo!

    Someone asked if there's a way to scale buttons and since Metin2 doesn't support this by default, I decided to make this small tutorial.

     

      Hide contents

    265138F-r-titlu.png

     

    
    How to  use?
    
    your_button.SetScale(scaleWidth, scaleHeight)
    
    E.g:
    
    self.costumeButton.SetScale(0.7, 0.7)

     

    Sincerly,

    Finnis.

     

     

    ma boy finnis 

    • Metin2 Dev 2
    • Love 4
  3. 1 minute ago, Mali61 said:

    like this?

    
    void CHARACTER::GiveRandomItemByType(BYTE bType)
    {
    	if (!(bType > ITEM_NONE && bType <= ITEM_BELT)) // my last item type is belt
    		return;
    
    	if (bType == ITEM_SKILLBOOK) {
    		GiveRandomSkillBook();
    		return;
    	}
    	
    	const std::vector<TItemTable>& vItemTable = ITEM_MANAGER::instance().GetTable();
    	if (vItemTable.empty())
    		return;
    
    	while (true) {
    		const int iRandIdx = number(0, vItemTable.size() - 1);
    		const TItemTable& table = vItemTable.at(iRandIdx);
    		if (table.bType == bType) {
    			AutoGiveItem(table.dwVnum);
    			break;
    		}
    	}
    }

    char.h

    
    void				GiveRandomItemByType(BYTE bType);

    USAGE:

    
    character->GiveRandomItemByType(ITEM_ARMOR);
    character->GiveRandomItemByType(ITEM_BELT);

     

    Exactly!  

    For those who wonder, why ? 

     

    I want to create a chest because my upgrade items have type ITEM_UPGRADE. 

     

    There are so many hundreds of upgrade items, i cant add all of them in special_drop, thats why i needed this function. 

     

    Thank you Mali!!!!!

    • Metin2 Dev 2
  4. 2 hours ago, DemOnJR said:

    If is missing something is because i don't remember from where i edited it an year ago.

     

    accountlistwindow.py

    
    
    		{
    			"name" : "sterge",
    			"type" : "button",
    
    			"x" : 105,
    			"y" : 265,
    
    			"width" : 41,
    			"height" : 21,
    
    			"text" : "Sterge",
    
    			"default_image" : "d:/ymir work/ui/public/small_button_01.sub",
    			"over_image" : "d:/ymir work/ui/public/small_button_02.sub",
    			"down_image" : "d:/ymir work/ui/public/small_button_03.sub",
    		},

     

    uiselectcredentials.py

    After:

    
    
    self.cancelButton.SAFE_SetEvent(self.__OnCancel)

     

    Add:

    
    
    self.stergeButton.SAFE_SetEvent(self.__OnSterge)

     

    After:

    
    
    self.okButton=self.GetChild("ok")

     

    Add:

    
    
    self.stergeButton=self.GetChild("sterge")

     

    After:

    
    
    def __OnOK(self):
        self.Hide()

     

    Add:

    
    
      def __OnSterge(self):
        self.Hide()

     

    After:

    
    
    	def __OnOK(self):
    		selItem=self.fileListBox.GetSelectedItem()
    		if selItem:
    			if self.selectEvent:
    				self.selectEvent(selItem.GetText())
    			with open('user//preferred','w') as mainpg:
    				mainpg.write("{};{}".format(selItem.GetText(),self.GetPwdFromId(selItem.GetText())) )
    			self.__PopupMessage("{} selectat, conecteaza-te apasand load.".format(selItem.GetText()))
    			self.Hide()
    		else:
    			self.__PopupMessage("Nu ai ales niciun cont din lista.")

     

    Add:

     

    
    
    	def __OnSterge(self):
    		selItem=self.fileListBox.GetSelectedItem()
    		if selItem:
    			if self.selectEvent:
    				self.selectEvent(selItem.GetText())
    			with open('user//credentials', 'r+') as f:
    				data = ''.join([i for i in f if not i.lower().startswith(selItem.GetText())])
    				f.seek(0)
    				f.write(data)
    				f.truncate()
    			self.__PopupMessage("{} a fost sters.".format(selItem.GetText()))
    			self.__RefreshFileList()
    		else:
    			self.__PopupMessage("Nu ai ales niciun cont din lista.")

     

     

     

    Thank you bro, but the delete function does not work properly,  if i have following accounts in my list:

     

    admin

    admin2

    tesajta

    kofakk

     

    it deletes both admin, admin2 together.

     

    and then i cant delete tesatja, kofakk anymore.

     

    There is no syserr. 😕 

  5. 11 hours ago, cBaraN said:

     

    Sorry, ido not keep old files on my computer, im not a good archivist :P 

    Mali released a function to sort the characters in intro select according to last played time. If you played character warrior last time he will be in the first slot so you can play him again by just pressing enter. If you misunderstood it‘s ok we are humans.

    • Love 1
  6. 12 hours ago, DrTurk said:

    Yesterday i got problems, today after new attempt it works

    Only thing that doesnt work is the stacking in safebox.

    Edit: Could you upload your grid.h from common? I'm using the grid.h from libgame, want to check if they do the same

     

    15 hours ago, Mali61 said:

    #Update

    giphy.gif


    Mali, im using your shopEx is it possible to stack items bought? If you buy 50 green potion 2 times currently you get 2x 50 stacks from it :D

    • Metin2 Dev 1
    • 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.