Jump to content

xP3NG3Rx

Honorable Member
  • Posts

    839
  • Joined

  • Days Won

    393
  • Feedback

    100%

Posts posted by xP3NG3Rx

  1. 	## Slot Event
    	def SelectEmptySlot(self, selectedSlotPos):
    		selectedSlotPos = self.__LocalPosToGlobalPos(selectedSlotPos)
    		if mouseModule.mouseController.isAttached():
    			attachedSlotType = mouseModule.mouseController.GetAttachedType()
    			attachedSlotPos = mouseModule.mouseController.GetAttachedSlotNumber()
    			if player.SLOT_TYPE_SAFEBOX == attachedSlotType:
    				m2net.SendSafeboxItemMovePacket(attachedSlotPos, selectedSlotPos, 0)
    				#snd.PlaySound("sound/ui/drop.wav")
    			else:
    				attachedInvenType = player.SlotTypeToInvenType(attachedSlotType)
    				if player.RESERVED_WINDOW == attachedInvenType:
    					return
    
    				if player.ITEM_MONEY == mouseModule.mouseController.GetAttachedItemIndex():
    					#m2net.SendSafeboxDepositMoneyPacket(mouseModule.mouseController.GetAttachedItemCount())
    					snd.PlaySound("sound/ui/money.wav")
    				else:
    					if not player.IsEquipmentSlot(attachedSlotPos)##########################################
    						m2net.SendSafeboxCheckinPacket(attachedInvenType, attachedSlotPos, selectedSlotPos)
    					#snd.PlaySound("sound/ui/drop.wav")
    
    			mouseModule.mouseController.DeattachObject()

     

    • Love 1
  2. Hello devs.

    I think that webzen already fixxed this, because I can't reverse the CSlotWindow::OnMouseOver it may be virtualized ?
    The problem is that, when you are trying to make conditions for the slot with runtime mouse overin, the slot doesn't handle the overin event until now.

    Here is a demonstration video to show the fixxed problem.
     

    Spoiler

     

    Without this fix the MouseOverIn event was running down if your cursor came to the slotboard which is the board of the slots ? instead of the slot. It's difficult to explain.

    Spoiler
    
    
    				## Slot
    				{
    					"name" : "CombItemSlot",
    					"type" : "slot",#THIS IS THE SLOTBOARD
    
    					"image" : "d:/ymir work/ui/public/slot_base.sub",
    
    					"x" : 8,
    					"y" : 30,
    
    					#THIS IS THE SIZE OF THE SLOTBOARD
    					"width" : 190,
    					"height" : 340,
    					#Without the fix if the mouse arrives onto this pattern the overin runs down!
    
    					#THESE THE SLOTS
    					"slot" : (
    						{"index":0, "x":78, "y":12, "width":31, "height":31},  # ˝şĹ©·Ń
    						{"index":1, "x":28, "y":68, "width":31, "height":96},  # ¸ŢŔÎÄÚ˝şĆ¬
    						{"index":2, "x":129, "y":68, "width":31, "height":96}, # Ŕç·áÄÚ˝şĆ¬
    						{"index":3, "x":79, "y":185, "width":31, "height":96}, # °á°úÄÚ˝şĆ¬
    					),
    
    					"children" :
    					(
    						{ "name":"Slot1_Name", "type":"text", "x":43, "y":170, "text" : uiScriptLocale.COMB_APPEARANCE, "text_horizontal_align":"center" },
    						{ "name":"Slot2_Name", "type":"text", "x":143, "y":170, "text" : uiScriptLocale.COMB_ATTRIBUTE, "text_horizontal_align":"center" },
    					),
    				},

     

     

     

    Before you start to implement it, make safety backup of your files!

    1.) Define the new OverIn event into the SlotWindow class in the ui.py file:

    Spoiler
    
    
    class SlotWindow(Window):
    	def __init__(self):
    		## Add these line into the __init__ function:
    		self.eventOverIn = None
    		self.eventOverOut = None
    		##
    	def __del__(self):
    		## Add these line into the __init__ function:
    		self.eventOverIn = None
    		self.eventOverOut = None
    		##
    
    	## Add the functions into the SlotWindow class:
    	def SetOverInEvent(self, event):
    		self.eventOverIn = event
    
    	def SetOverOutEvent(self, event):
    		self.eventOverOut = event
    
    	def OnOverIn(self, slotNumber):
    		if self.eventOverIn:
    			self.eventOverIn(slotNumber)
    
    	def OnOverOut(self):
    		if self.eventOverOut:
    			self.eventOverOut()
    	##
    #DONE

     

     

    2.) Define new functions and a helper variable into the eterPythonLib\PythonSlotWindow.h.

    Spoiler
    
    
    // Add these:
    			// OverInSlot
    			BOOL OnOverIn(DWORD dwSlotNumber);
    			void OnOverOut();
    // Above of this:
    			// ToolTip
    			BOOL OnOverInItem(DWORD dwSlotNumber);
    			void OnOverOutItem();
    //##
    
    // Add this:
    			DWORD m_dwOverInSlotNumber;
    // Below of this:
    			DWORD m_dwToolTipSlotNumber;
    //##DONE

     

     

    3.) Make fit, and add the new functions into the eterPythonLib\PythonSlotWindow.cpp.

    Spoiler
    
    
    //## Replace the OnMouseOverIn and OnMouseOverOut functions in the CSlotButton class with these:
    		void OnMouseOverIn()
    		{
    			if (IsEnable())
    				SetCurrentVisual(&m_overVisual);
    
    			//m_pParent->OnOverInItem(m_dwSlotNumber);
    			//m_pParent->OnOverIn(m_dwSlotNumber);
    			TSlot * pSlot;
    			if (m_pParent->GetSlotPointer(m_dwSlotNumber, &pSlot))
    			{
    				if (pSlot->isItem)
    					m_pParent->OnOverInItem(m_dwSlotNumber);
    				else
    					m_pParent->OnOverIn(m_dwSlotNumber);
    			}
    		}
    
    		void OnMouseOverOut()
    		{
    			if (IsEnable())
    			{
    				SetUp();
    				SetCurrentVisual(&m_upVisual);
    			}
    
    			//m_pParent->OnOverOutItem();
    			//m_pParent->OnOverOut();
    			TSlot * pSlot;
    			if (m_pParent->GetSlotPointer(m_dwSlotNumber, &pSlot))
    			{
    				if (pSlot->isItem)
    					m_pParent->OnOverOutItem();
    				else
    					m_pParent->OnOverOut();
    			}
    		}
    //##
    
    //## Replace the whole CSlotWindow::RefreshSlot or compare it with yourself and make it fit with this:
    void CSlotWindow::RefreshSlot()
    {
    	OnRefreshSlot();
    
    	// NOTE : Refresh µÉ¶§ ToolTip µµ °»˝Ĺ ÇŐ´Ď´Ů - [levites]
    	if (IsRendering())
    	{
    		TSlot * pSlot;
    		if (GetPickedSlotPointer(&pSlot))
    		{
    			if (pSlot->isItem)
    			{
    				OnOverOutItem();
    				OnOverInItem(pSlot->dwSlotNumber);
    			}
    			else
    			{
    				OnOverOut();
    				OnOverIn(pSlot->dwSlotNumber);
    			}
    		}
    	}
    }
    //##
    
    //## Add this call into the CSlotWindow::OnMouseOverOut() function:
    OnOverOut();
    //##
    
    //## Replace the whole CSlotWindow::OnMouseOver() with this:
    void CSlotWindow::OnMouseOver()
    {
    	// FIXME : Ŕ©µµżě¸¦ µĺ·ˇ±ë ÇĎ´Â µµÁßżˇ SetTopŔĚ µÇľîąö¸®¸é Capture°ˇ Ç®ľîÁ® ąö¸°´Ů. ±×°ÍŔÇ ąćÁö ÄÚµĺ.
    	//         Á» ´ő ±Ůş»ŔűŔÎ ÇŘ°áĂĄŔ» ĂŁľĆľß ÇŇ µí - [levites]
    //	if (UI::CWindowManager::Instance().IsCapture())
    //	if (!UI::CWindowManager::Instance().IsAttaching())
    //		return;
    
    	TSlot * pSlot;
    	CWindow * pPointWindow = UI::CWindowManager::Instance().GetPointWindow();
    	if (this == pPointWindow)
    	{
    		if (GetPickedSlotPointer(&pSlot))
    		{
    			if (OnOverInItem(pSlot->dwSlotNumber))
    				return;
    			else
    				OnOverOutItem();
    
    			if (OnOverIn(pSlot->dwSlotNumber))
    				return;
    			else
    				OnOverOut();
    
    			return;
    		}
    	}
    
    	OnOverOutItem();
    	OnOverOut();
    }
    //##
    
    //## Add the new functions above of the CSlotWindow::OnOverInItem function:
    BOOL CSlotWindow::OnOverIn(DWORD dwSlotNumber)
    {
    	TSlot * pSlot;
    	if (!GetSlotPointer(dwSlotNumber, &pSlot))
    		return FALSE;
    
    	if (pSlot->isItem)
    		return FALSE;
    
    	if (pSlot->dwSlotNumber == m_dwOverInSlotNumber)
    		return TRUE;
    
    	m_dwOverInSlotNumber = dwSlotNumber;
    	PyCallClassMemberFunc(m_poHandler, "OnOverIn", Py_BuildValue("(i)", dwSlotNumber));
    	return TRUE;
    }
    
    void CSlotWindow::OnOverOut()
    {
    	if (SLOT_NUMBER_NONE == m_dwOverInSlotNumber)
    		return;
    
    	m_dwOverInSlotNumber = SLOT_NUMBER_NONE;
    	PyCallClassMemberFunc(m_poHandler, "OnOverOut", Py_BuildValue("()"));
    }
    //##
    
    //## Initialize the new helper variable in the CSlotWindow::__Initialize function:
    	m_dwOverInSlotNumber = SLOT_NUMBER_NONE;
    //##
    
    //## Replace this line: pSlot->isItem = TRUE; in the CSlotWindow::SetSlot function with this:
    	pSlot->isItem = (dwVirtualNumber > 0) ? TRUE : FALSE;
    //##DONE

     

     

    Example usage:

    	def LoadObj(self):
    		self.wndItem = self.GetChild("ItemSlot")
    		self.wndItem.SetOverInEvent(ui.__mem_func__(self.OverIn))
    		self.wndItem.SetOverOutEvent(ui.__mem_func__(self.OverOut))
    
    	def OverIn(self, selectedSlotPos):
    		chat.AppendChat(chat.CHAT_TYPE_INFO, "OverIn %d", selectedSlotPos)
    
    	def OverOut(self):
    		chat.AppendChat(chat.CHAT_TYPE_INFO, "OverOut")

     

    • Good 1
    • Love 9
  3. M2 Download Center

    This is the hidden content, please
    ( Internal )

    Hello devs.

    I don't want to talk a lot about nothing, but I have to say what is this.
    With this little modification the party and the friend requests are cancelled automatically in seconds what you can change in the Open method. ( pyObj.Open(sec) )

    Preview video:

    Spoiler

    Songname: Selena Gomez - Kill Em With Kindness (Robby Burke Bootleg)

    Make a backup before you are implementing it! And if you found a bug, please explain it.

    0.) Open your uiCommon.py file and import chat module.
    1.) Replace the whole QuestionDialogWithTimeLimit class in the uiCommon.py file with this:

    class QuestionDialogWithTimeLimit(QuestionDialog2):
    	def __init__(self):
    		ui.ScriptWindow.__init__(self)
    
    		self.__CreateDialog()
    		self.endTime = 0
    		self.timeOverMsg = 0
    		self.timeOverEvent = None
    		self.timeOverEventArgs = None
    
    	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 SetTimeOverEvent(self, event, *args):
    		self.timeOverEvent = event
    		self.timeOverEventArgs = args
    
    	def SetTimeOverMsg(self, msg):
    		self.timeOverMsg = msg
    
    	def OnTimeOver(self):
    		if self.timeOverEvent:
    			apply(self.timeOverEvent, self.timeOverEventArgs)
    		if self.timeOverMsg:
    			chat.AppendChat(chat.CHAT_TYPE_INFO, self.timeOverMsg)
    
    	def OnUpdate(self):
    		leftTime = max(0, self.endTime - app.GetTime())
    		self.SetText2(localeInfo.UI_LEFT_TIME % (leftTime))
    		if leftTime <= 0:
    			self.OnTimeOver()
    

     

    2.) Open your game.py file and replace each of these three methods to these:

    	def OnMessengerAddFriendQuestion(self, name):
    		messengerAddFriendQuestion = uiCommon.QuestionDialogWithTimeLimit()
    		messengerAddFriendQuestion.SetText1(localeInfo.MESSENGER_DO_YOU_ACCEPT_ADD_FRIEND % (name))
    		messengerAddFriendQuestion.SetTimeOverMsg(localeInfo.MESSENGER_ADD_FRIEND_ANSWER_TIMEOVER)
    		messengerAddFriendQuestion.SetTimeOverEvent(self.OnDenyAddFriend)
    		messengerAddFriendQuestion.SetAcceptEvent(ui.__mem_func__(self.OnAcceptAddFriend))
    		messengerAddFriendQuestion.SetCancelEvent(ui.__mem_func__(self.OnDenyAddFriend))
    		messengerAddFriendQuestion.Open(10)
    		messengerAddFriendQuestion.name = name
    		self.messengerAddFriendQuestion = messengerAddFriendQuestion
    	def RecvPartyInviteQuestion(self, leaderVID, leaderName):
    		partyInviteQuestionDialog = uiCommon.QuestionDialogWithTimeLimit()
    		partyInviteQuestionDialog.SetText1(leaderName + localeInfo.PARTY_DO_YOU_JOIN)
    		partyInviteQuestionDialog.SetTimeOverMsg(localeInfo.PARTY_ANSWER_TIMEOVER)
    		partyInviteQuestionDialog.SetTimeOverEvent(self.AnswerPartyInvite, False)
    		partyInviteQuestionDialog.SetAcceptEvent(lambda arg=True: self.AnswerPartyInvite(arg))
    		partyInviteQuestionDialog.SetCancelEvent(lambda arg=False: self.AnswerPartyInvite(arg))
    		partyInviteQuestionDialog.Open(10)
    		partyInviteQuestionDialog.partyLeaderVID = leaderVID
    		self.partyInviteQuestionDialog = partyInviteQuestionDialog
    	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

     

    3.) Open your locale/xy/locale_game.txt and add these if these aren't exists:

    MESSENGER_ADD_FRIEND_ANSWER_TIMEOVER	Friend request was cancelled.
    PARTY_ANSWER_TIMEOVER	Party invite was cancelled.
    

    Remove MESSENGER_DO_YOU_ACCEPT_ADD_FRIEND_2 line and change MESSENGER_DO_YOU_ACCEPT_ADD_FRIEND_1 with this:

    MESSENGER_DO_YOU_ACCEPT_ADD_FRIEND	%s added you as a friend, accept?
    

     

    At last take a look at your files and correct the net module calls and the True-False syntax.  net <--> m2net, True <--> TRUE

    • Metin2 Dev 20
    • Not Good 1
    • Good 5
    • Love 23
  4. OnUpdate :wacko:

    Isn't the best solution, but seems good.

    		def OnUpdate(self):
    			# self.RefreshBagSlotWindow()
    			for i in xrange(player.INVENTORY_PAGE_SIZE):
    				if self.wndItem:
    					GlobalSlot = self.__InventoryLocalSlotPosToGlobalSlotPos(i)
    					if player.GetItemLook(GlobalSlot):
    						self.wndItem.EnableSlotCoverImage(i)
    					else:
    						self.wndItem.DisableSlotCoverImage(i)
    					if player.FindActivedChangeLookSlot(0) == GlobalSlot or player.FindActivedChangeLookSlot(1) == GlobalSlot:
    						self.wndItem.ActivateChangeLookSlot(i)
    					else:
    						self.wndItem.DeactivateChangeLookSlot(i)

     

    • Love 1
  5. The new update(v17.1) is containing the following unpacked packfiles:

    • locale(en,us,de,cz,hu) w/ unpacked protos <!!> via new antiflags <!!>
    • root <!> dumped python and built-in datas <!> (Not raw .python files!)
    • uiscript
    • icon
    • patch_easter2k16
    • patch_etc_costume1
    • patch_pc3_m
    • patch_public
    • patch_ramadan
    • patch_summer
    • outdoormilgyo1
    • outdoortrent02

     

     

    Spoiler
    ANTIFLAG = {
    	0 : "NONE",
    	1<< 0 : "ANTI_FEMALE",
    	1<< 1 : "ANTI_MALE",
    	1<< 2 : "ANTI_MUSA", #Warrior
    	1<< 3 : "ANTI_ASSASSIN",
    	1<< 4 : "ANTI_SURA",
    	1<< 5 : "ANTI_MUDANG", #Shaman
    	1<< 6 : "ANTI_GET",
    	1<< 7 : "ANTI_DROP",
    	1<< 8 : "ANTI_SELL",
    	1<< 9 : "ANTI_EMPIRE_A",
    	1<<10 : "ANTI_EMPIRE_B",
    	1<<11 : "ANTI_EMPIRE_C",
    	1<<12 : "ANTI_SAVE",
    	1<<13 : "ANTI_GIVE",
    	1<<14 : "ANTI_PKDROP",
    	1<<15 : "ANTI_STACK",
    	1<<16 : "ANTI_MYSHOP",
    	1<<17 : "ANTI_SAFEBOX",
    	1<<18 : "ANTI_WOLFMAN",
    	1<<19 : "ANTI_PET",#wat
    	1<<20 : "ANTI_QUICKSLOT",
    	1<<21 : "ANTI_CHANGELOOK",
    	1<<22 : "ANTI_REINFORCE",#wat
    	1<<23 : "ANTI_ENCHANT",
    	1<<24 : "ANTI_ENERGY",
    	1<<25 : "ANTI_PETFEED",
    	1<<26 : "ANTI_APPLY",#wat
    	1<<27 : "ANTI_ACCE",
    }

     

     

    • Metin2 Dev 36
    • Sad 1
    • Cry 1
    • Think 2
    • Lmao 1
    • Good 17
    • Love 2
    • Love 43
  6. M2 Download Center

    This is the hidden content, please
    ( Internal )

    Hello everyone.

    It's a good day to share an old code with you.
    First of all you need to know:

    1. I don't help to install it. Don't even take the contact with me about it.
    2. The whole code is written by me, and reversed from official binaries.
    3. At the beginning do a backup for your files(srcs+pys) and READ CAREFULLY the readme.
    4. W/o brain.exe please close this tab, or your browser, thank you for your understanding.

    Preview:
     

    Spoiler

     

     

    Download.exe

    Enjoy & #h4v3fun,
    pngr

    • Metin2 Dev 303
    • kekw 4
    • Eyes 4
    • Dislove 4
    • Angry 2
    • Not Good 1
    • Sad 2
    • Cry 1
    • Smile Tear 1
    • Think 5
    • Confused 2
    • Scream 2
    • Good 102
    • Love 26
    • Love 207
×
×
  • 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.