Jump to content

ReFresh

Active Member
  • Posts

    1797
  • Joined

  • Last visited

  • Days Won

    4
  • Feedback

    0%

Posts posted by ReFresh

  1. @CaptainLucifer I just found a piece of code which could fix that problem.

    Spoiler

    char.cpp:

    // Find this:
    m_bOpeningSafebox = false;
    
    //And below change this:
    m_fSyncTime = get_float_time()-3;
    
    //To this:
    m_fSyncTime = get_dword_time()-3;
    
    //Then find:
    bool CHARACTER::CanMove() const
    
    //And in this function change this:
    if (get_float_time() - m_fSyncTime < 0.2f)
    
    //To this:
    if (get_dword_time() - m_fSyncTime < 50)
    
    //Then find this:
    bool CHARACTER::SetSyncOwner(LPCHARACTER ch, bool bRemoveFromList)
    
    //And in this function find this:
    m_fSyncTime = get_float_time();
    
    //And change it to:
    m_fSyncTime = get_dword_time();
    
    //Then find this:
    bool CHARACTER::IsSyncOwner(LPCHARACTER ch) const
    
    //And in this function find this:
    if (get_float_time() - m_fSyncTime >= 3.0f)
      
    //And change to this:
    if (get_dword_time() - m_fSyncTime >= 100)
      

    char.h

    //Find this:
    float			m_fSyncTime;
    
    //And change to this:
    DWORD			m_fSyncTime;

     

    Let me know if these changes solved your problem.

  2. Solved

    GIF by Equipe de France de Football

    It was my fault. Since I'm using granny viewer as .gr2 extension, I didn't see the file endings. I checked ending only for main model which was right and forgot to check animation gr2 extensions they were written with uppercase endings and that was whole problem. 

  3. @Kurogamiko Good news for you man, you were right. Someone published the sitting animations for all characters, I just found them on my disc.

    Here is the link:

    Spoiler

    This is the hidden content, please

    And if you want, here is full pack of YMIR animations, but as I said, only for warrior character:

    Spoiler

    This is the hidden content, please

    Enjoy!

    • Metin2 Dev 21
    • Good 7
    • Love 7
  4. @meneleosThanks for trying to help me, but by the way you did, you cannot recieve the name of invite sender, because you didn't edit the packet which have to send the inviter name. I got an empty value by the way you did. I was thinking about adding a new packet to send the inviter name, but if there is another easier way how to send it, it will be much better.

    • Scream 1
  5. @ Cryptex Just search and use your brain, believe me, it's not too hard to find the functions. Sources are different, problem can be in configs in serverfiles too.

    Spoiler
    For dropped items without ownership
    //item.h
    
    void StartDestroyEvent(int iSec=300);
    
    //item.cpp
    
    void CItem::StartDestroyEvent(int iSec)

     

  6. Hey guys,

    I'm wondering what should I use in this function, because everywhere in LUA .cpp functions are 0 or 1 or -1, can someone explain me what does it mean and should I use number or boolean return in LUA .cpp functions?

    Spoiler
    ALUA(game_open_safebox)
    	{
    		CQuestManager& q = CQuestManager::instance();
    		LPCHARACTER ch = q.GetCurrentCharacterPtr();
    
    		if (ch->GetExchange())
    		{
    			ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("´Ů¸Ą°Ĺ·ˇĂ˘ŔĚ ż­¸°»óĹÂżˇĽ­´Â â°í¸¦ ż­Ľö°ˇ ľř˝Ŕ´Ď´Ů."));
    			/// return false; or return 0, 1, -1;???
    		}
    		else
    		{
    			ch->SetSafeboxOpenPosition();
    			ch->ChatPacket(CHAT_TYPE_COMMAND, "ShowMeSafeboxPassword");
    		}
    
    		return 0;
    	}

     

    Thanks for possible answers!

    Sincerely,

    ReFresh

  7. @ xP3NG3Rx First of all, thanks for the release. But you did a mistake with this:

    On 4/14/2017 at 8:29 PM, xP3NG3Rx said:
    def BINARY_OnQuestConfirm(self, msg, timeout, pid):
    		confirmDialog = uiCommon.QuestionDialogWithTimeLimit()
    		confirmDialog.SetText1(msg)
    		confirmDialog.Open(timeout)
    		confirmDialog.SetAcceptEvent(lambda answer=True, pid=pid: m2net.SendQuestConfirmPacket(answer, pid) or self.confirmDialog.Hide())
    		confirmDialog.SetCancelEvent(lambda answer=False, pid=pid: m2net.SendQuestConfirmPacket(answer, pid) or self.confirmDialog.Hide())
    		self.confirmDialog = confirmDialog

    dialog won't close because there is missing the "event" which is closing the dialog.

    I solved that by these changes:

    Open: root/game.py

    Finddef BINARY_OnQuestConfirm(self, msg, timeout, pid):

    Replace whole function with this:

    Spoiler
    def BINARY_OnQuestConfirm(self, msg, timeout, pid):
    		confirmDialog = uiCommon.QuestionDialogWithTimeLimit2()
    		confirmDialog.SetText1(msg)
    		confirmDialog.SetText2(localeInfo.UI_ACCEPT_MARRIAGE)
    		confirmDialog.SetTimeOverMsg(localeInfo.MARRIAGE_ANSWER_TIMEOVER)
    		confirmDialog.SetAcceptEvent(lambda answer=True, pid=pid: net.SendQuestConfirmPacket(answer, pid) or self.confirmDialog.Hide())
    		confirmDialog.SetCancelEvent(lambda answer=False, pid=pid: net.SendQuestConfirmPacket(answer, pid) or self.confirmDialog.Hide())
    		confirmDialog.Open(timeout)
    		self.confirmDialog = confirmDialog

     

    Now add this to locale/locale_game.txt:

    Spoiler
    UI_ACCEPT_MARRIAGE	Accept request?
    MARRIAGE_ANSWER_TIMEOVER	Time limit for marriage accept is over!

     

    Then open root/uicommon.py:

    And add a new class:

    Spoiler
    class QuestionDialogWithTimeLimit2(QuestionDialog2):
    
    	def __init__(self):
    		ui.ScriptWindow.__init__(self)
    
    		self.__CreateDialog()
    		self.endTime = 0
    		self.timeOverMsg = 0
    
    	def __del__(self):
    		QuestionDialog2.__del__(self)
    
    	def __CreateDialog(self):
    		pyScrLoader = ui.PythonScriptLoader()
    		pyScrLoader.LoadScriptFile(self, "uiscript/questiondialog2.py")
    
    		self.board = self.GetChild("board")
    		self.textLine1 = self.GetChild("message1")
    		self.textLine2 = self.GetChild("message2")
    		self.acceptButton = self.GetChild("accept")
    		self.cancelButton = self.GetChild("cancel")
    
    	def Open(self, timeout):
    		self.SetCenterPosition()
    		self.SetTop()
    		self.Show()
    
    		self.endTime = app.GetTime() + timeout
    	
    	def Close(self):
    		self.Hide()
    
    	def SetTimeOverMsg(self, msg):
    		self.timeOverMsg = msg
    
    	def OnUpdate(self):
    		leftTime = max(0, self.endTime - app.GetTime())
    		# self.SetText2(localeInfo.UI_LEFT_TIME % (leftTime))
    
    		if leftTime <= 0:
    			self.Close()
    			self.cancelButton.CallEvent()
    
    			if self.timeOverMsg:
    				chat.AppendChat(chat.CHAT_TYPE_INFO, self.timeOverMsg)
    
    	def OnPressEscapeKey(self):
    		self.Close()
    		self.cancelButton.CallEvent()
    		return True

     

    Enjoy!

    If anyone got an idea for better solution, I'll be really glad for that.

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