Bronze .Avenue™ 790 Posted October 24, 2015 Bronze Share Posted October 24, 2015 M2 Download Center This is the hidden content, please Sign In or Sign Up ( Internal ) Spoiler Spoiler Serverside - C++ [*]packet.h: search for HEADER_CG_ITEM_DROP2 = 20, data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw== & paste HEADER_CG_ITEM_DESTROY = 21, data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw== under it. [*]packet.h: search for typedef struct command_item_drop2 { [...] } TPacketCGItemDrop2; data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw== & paste typedef struct command_item_destroy { BYTE header; TItemPos Cell; } TPacketCGItemDestroy; data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw== under it. [*]packet_info.cpp: search for Set(HEADER_CG_ITEM_DROP2, sizeof(TPacketCGItemDrop2), "ItemDrop2", true); data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw== & paste Set(HEADER_CG_ITEM_DESTROY, sizeof(TPacketCGItemDestroy), "ItemDestroy", true); data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw== under it. [*]input_main.cpp: search for void CInputMain::ItemDrop2(LPCHARACTER ch, const char * data) { [...] } data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw== & paste void CInputMain::ItemDestroy(LPCHARACTER ch, const char * data) { struct command_item_destroy * pinfo = (struct command_item_destroy *) data; if (ch) ch->DestroyItem(pinfo->Cell); } data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw== under it. [*]input_main.cpp: search for case HEADER_CG_ITEM_DROP2: [...] break; data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw== & paste case HEADER_CG_ITEM_DESTROY: if (!ch->IsObserverMode()) ItemDestroy(ch, c_pData); break; data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw== under it. [*]char_item.cpp: search for bool CHARACTER::DropItem(TItemPos Cell, BYTE bCount) data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw== & paste bool CHARACTER::DestroyItem(TItemPos Cell) { LPITEM item = NULL; if (!CanHandleItem()) { if (NULL != DragonSoul_RefineWindow_GetOpener()) ChatPacket(CHAT_TYPE_INFO, LC_TEXT("°*È*âÀ» ¿¬ »óÅ¿¡¼*´Â ¾ÆÀÌÅÛÀ» ¿Å±æ ¼ö ¾ø½À´Ï´Ù.")); return false; } if (IsDead()) return false; if (!IsValidItemPosition(Cell) || !(item = GetItem(Cell))) return false; if (item->IsExchanging()) return false; if (true == item->isLocked()) return false; if (quest::CQuestManager::instance().GetPCForce(GetPlayerID())->IsRunning() == true) return false; if (item->GetCount() <= 0) return false; SyncQuickslot(QUICKSLOT_TYPE_ITEM, Cell.cell, 255); ITEM_MANAGER::instance().RemoveItem(item); ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Du hast %s zerstoert."), item->GetName()); return true; } data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw== above it. [*]char.h: search for bool DropItem(TItemPos Cell, BYTE bCount=0); data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw== & paste bool DestroyItem(TItemPos Cell); data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw== above it. [*]input.h: search for void ItemDrop2(LPCHARACTER ch, const char * data); data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw== & paste void ItemDestroy(LPCHARACTER ch, const char * data); data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw== under it. Clientside - C++ [*]packet.h: search for HEADER_CG_ITEM_DROP2 = 20, data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw== & paste HEADER_CG_ITEM_DESTROY = 21, data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw== ein. [*]packet.h: search for typedef struct command_item_drop2 { [...] } TPacketCGItemDrop2; data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw== & paste typedef struct command_item_destroy { BYTE header; TItemPos pos; } TPacketCGItemDestroy; data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw== under it. [*]PythonNetworkStreamPhaseGameItem.cpp: search for bool CPythonNetworkStream::SendItemDropPacketNew(TItemPos pos, DWORD elk, DWORD count) { [...] } data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw== & paste bool CPythonNetworkStream::SendItemDestroyPacket(TItemPos pos) { if (!__CanActMainInstance()) return true; TPacketCGItemDestroy itemDestroyPacket; itemDestroyPacket.header = HEADER_CG_ITEM_DESTROY; itemDestroyPacket.pos = pos; if (!Send(sizeof(itemDestroyPacket), &itemDestroyPacket)) { Tracen("SendItemDestroyPacket Error"); return false; } return SendSequence(); } data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw== under it. [*]PythonNetworkStreamModule.cpp: search for PyObject* netSendItemDropPacket(PyObject* poSelf, PyObject* poArgs) { [...] } data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw== & paste PyObject* netSendItemDestroyPacket(PyObject* poSelf, PyObject* poArgs) { TItemPos Cell; if (!PyTuple_GetInteger(poArgs, 0, &Cell.cell)) return Py_BuildException(); CPythonNetworkStream& rkNetStream = CPythonNetworkStream::Instance(); rkNetStream.SendItemDestroyPacket(Cell); return Py_BuildNone(); } data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw== under it. [*]PythonNetworkStreamModule.cpp: search for { "SendItemDropPacketNew", netSendItemDropPacketNew, METH_VARARGS }, data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw== & paste { "SendItemDestroyPacket", netSendItemDestroyPacket, METH_VARARGS }, data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw== under it. [*]PythonNetworkStream.h: search for bool SendItemDropPacketNew(TItemPos pos, DWORD elk, DWORD count); data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw== & paste bool SendItemDestroyPacket(TItemPos pos); data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw== under it. Clientside - Python [*]uiCommon.py: search for class QuestionDialog(ui.ScriptWindow): [...] data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw== & paste class QuestionDialogItem(ui.ScriptWindow): def __init__(self): ui.ScriptWindow.__init__(self) self.__CreateDialog() def __del__(self): ui.ScriptWindow.__del__(self) def __CreateDialog(self): pyScrLoader = ui.PythonScriptLoader() pyScrLoader.LoadScriptFile(self, "uiscript/questiondialogitem.py") self.board = self.GetChild("board") self.textLine = self.GetChild("message") self.acceptButton = self.GetChild("accept") self.destroyButton = self.GetChild("destroy") self.cancelButton = self.GetChild("cancel") def Open(self): self.SetCenterPosition() self.SetTop() self.Show() def Close(self): self.Hide() def SetWidth(self, width): height = self.GetHeight() self.SetSize(width, height) self.board.SetSize(width, height) self.SetCenterPosition() self.UpdateRect() def SAFE_SetAcceptEvent(self, event): self.acceptButton.SAFE_SetEvent(event) def SAFE_SetCancelEvent(self, event): self.cancelButton.SAFE_SetEvent(event) def SetAcceptEvent(self, event): self.acceptButton.SetEvent(event) def SetDestroyEvent(self, event): self.destroyButton.SetEvent(event) def SetCancelEvent(self, event): self.cancelButton.SetEvent(event) def SetText(self, text): self.textLine.SetText(text) def SetAcceptText(self, text): self.acceptButton.SetText(text) def SetCancelText(self, text): self.cancelButton.SetText(text) def OnPressEscapeKey(self): self.Close() return TRUE data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw== under it. [*]uiScript/questiondialogitem.py: download it & pack it in your pack/uiscript. [*]game.py: search in definition __DropItem for the first itemDropQuestionDialog = uiCommon.QuestionDialog() data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw== & replace it with itemDropQuestionDialog = uiCommon.QuestionDialogItem() data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw== [*]game.py: a few lines under it you can find itemDropQuestionDialog.SetAcceptEvent(lambda arg=TRUE: self.RequestDropItem(arg)) data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw== & paste itemDropQuestionDialog.SetDestroyEvent(lambda arg=TRUE: self.RequestDestroyItem(arg)) data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw== under it. [*]game.py: search for def RequestDropItem(self, answer): [...] data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw== & paste def RequestDestroyItem(self, answer): if not self.itemDropQuestionDialog: return if answer: dropType = self.itemDropQuestionDialog.dropType dropNumber = self.itemDropQuestionDialog.dropNumber if player.SLOT_TYPE_INVENTORY == dropType: if dropNumber == player.ITEM_MONEY: return else: self.__SendDestroyItemPacket(dropNumber) self.itemDropQuestionDialog.Close() self.itemDropQuestionDialog = None constInfo.SET_ITEM_DROP_QUESTION_DIALOG_STATUS(0) data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw== under it. [*]game.py: search for def __SendDropItemPacket(self, itemVNum, itemCount, itemInvenType = player.INVENTORY): [...] data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw== & paste def __SendDestroyItemPacket(self, itemVNum, itemInvenType = player.INVENTORY): if uiPrivateShopBuilder.IsBuildingPrivateShop(): chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.DROP_ITEM_FAILURE_PRIVATE_SHOP) return net.SendItemDestroyPacket(itemVNum) data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw== under it. [*]locale/xx/locale_interface.txt: add there somewhere DESTROY Destroy data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw== 153 2 3 3 1 4 2 1 2 54 14 152 Link to comment Share on other sites More sharing options...
Premium Galet 514 Posted October 24, 2015 Premium Share Posted October 24, 2015 Something interesting, good job ! Link to comment Share on other sites More sharing options...
metin2-factory 1018 Posted February 20, 2016 Share Posted February 20, 2016 Hey, it all works good. but i want to add a little clarification to the non experienced. Pasting in the wrong def will get you frustrated so,make sure to paste it in following def: Spoiler def __DropItem(self, attachedType, attachedItemIndex, attachedItemSlotPos, attachedItemCount): below: Spoiler if player.SLOT_TYPE_INVENTORY == attachedType: [*]game.py: a few lines under it you can find itemDropQuestionDialog.SetAcceptEvent(lambda arg=TRUE: self.RequestDropItem(arg)) & paste itemDropQuestionDialog.SetDestroyEvent(lambda arg=TRUE: self.RequestDestroyItem(arg)) Regards. 2 1 Link to comment Share on other sites More sharing options...
morion 60 Posted February 20, 2016 Share Posted February 20, 2016 Hi i have this error when i try to drop a item 0220 12:54:51383 :: File "game.py", line 1396, in OnMouseLeftButtonUp 0220 12:54:51383 :: File "game.py", line 1433, in __PutItem 0220 12:54:51383 :: File "game.py", line 1508, in __DropItem 0220 12:54:51383 :: AttributeError 0220 12:54:51383 :: : 0220 12:54:51383 :: 'module' object has no attribute 'QuestionDialogItem' 0220 12:54:51383 :: 1 Link to comment Share on other sites More sharing options...
lostrealms 4 Posted June 1, 2016 Share Posted June 1, 2016 (edited) help I have this problem , I get this error when compiling I did everything that comes here . He sought and under what he said put me put an image here https://metin2.download/picture/JD4B5WWNv0lgg89r33EsQE7w19a54hDS/.gif sorry for my english Edited September 2, 2022 by Metin2 Dev Core X - External 2 Internal 2 1 1 Link to comment Share on other sites More sharing options...
Fr4ncy93 0 Posted July 24, 2016 Share Posted July 24, 2016 You can this with only python and lua. Send in Quest that select item slot of item and remove.. Sorry my bad english. Link to comment Share on other sites More sharing options...
Kenny1337 8 Posted July 28, 2016 Share Posted July 28, 2016 eq bug when i destroy item :/ can't rechange weapon, etc... Link to comment Share on other sites More sharing options...
Randy 0 Posted July 29, 2016 Share Posted July 29, 2016 18 hours ago, Kenny1337 said: eq bug when i destroy item :/ can't rechange weapon, etc Same man... Link to comment Share on other sites More sharing options...
ladcatalin 6 Posted July 29, 2016 Share Posted July 29, 2016 After i destroy any item, my inventory is 'blocked'... I cant move any itemes, or equip..i cant do nothing with my inventory. The problem is about client side (@python).... 1 Link to comment Share on other sites More sharing options...
Randy 0 Posted July 29, 2016 Share Posted July 29, 2016 2 hours ago, ladcatalin said: After i destroy any item, my inventory is 'blocked'... I cant move any itemes, or equip..i cant do nothing with my inventory. The problem is about client side (@python).... So.. we will wait for fix @.Avenue™ help ? Link to comment Share on other sites More sharing options...
Premium Galet 514 Posted July 29, 2016 Premium Share Posted July 29, 2016 The only problem is that you can delete everything, including unique item and this is dangerous so you must create a check with flags :/ 1 Link to comment Share on other sites More sharing options...
ladcatalin 6 Posted July 29, 2016 Share Posted July 29, 2016 3 hours ago, galet said: The only problem is that you can delete everything, including unique item and this is dangerous so you must create a check with flags :/ Sorry, but this "dropdialog" is used for destroy any items. If u set this to destroy just items which can be sold in shop or dropped, this system will be useless. We need this for destroy any items from inventory... 2 Link to comment Share on other sites More sharing options...
VegaS 1101 Posted July 29, 2016 Share Posted July 29, 2016 3 hours ago, galet said: The only problem is that you can delete everything, including unique item and this is dangerous so you must create a check with flags :/ Example: LPITEM item ; if (IS_SET (item ->GetAntiFlag(), ITEM_ANTIFLAG_GIVE | ITEM_ANTIFLAG_PKDROP | ITEM_ANTIFLAG_SELL)) return ; enum EItemAntiFlag { ITEM_ANTIFLAG_FEMALE = ( 1 << 0 ), ITEM_ANTIFLAG_MALE = ( 1 << 1 ), ITEM_ANTIFLAG_WARRIOR = ( 1 << 2 ), ITEM_ANTIFLAG_ASSASSIN = ( 1 << 3 ), ITEM_ANTIFLAG_SURA = ( 1 << 4 ), ITEM_ANTIFLAG_SHAMAN = ( 1 << 5 ), ITEM_ANTIFLAG_GET = ( 1 << 6 ), ITEM_ANTIFLAG_DROP = ( 1 << 7 ), ITEM_ANTIFLAG_SELL = ( 1 << 8 ), ITEM_ANTIFLAG_EMPIRE_A = ( 1 << 9 ), ITEM_ANTIFLAG_EMPIRE_B = ( 1 << 10 ), ITEM_ANTIFLAG_EMPIRE_C = ( 1 << 11 ), ITEM_ANTIFLAG_SAVE = ( 1 << 12 ), ITEM_ANTIFLAG_GIVE = ( 1 << 13 ), ITEM_ANTIFLAG_PKDROP = ( 1 << 14 ), ITEM_ANTIFLAG_STACK = ( 1 << 15 ), ITEM_ANTIFLAG_MYSHOP = ( 1 << 16 ), ITEM_ANTIFLAG_SAFEBOX = ( 1 << 17 ), }; 3 Link to comment Share on other sites More sharing options...
Premium Galet 514 Posted July 29, 2016 Premium Share Posted July 29, 2016 Thanks but I was just pointing out the bug ^^' Otherwise, I know @ladcatalin but I prefer not to have stucked character because they deleted an unique item made only for them 1 Link to comment Share on other sites More sharing options...
VegaS 1101 Posted July 29, 2016 Share Posted July 29, 2016 Or you can make it much easier xD @galet int pVnumTable[] = {50011, 50012, 50013, 50014, 50015, 50016, 50017, 50018, 50019, 50020, 50021, 50022, 50023}; const char* pDestroyMessage = {"<Destroy> You can't delete item [%s] !"}; for (int i = 0; i < _countof(pVnumTable); i++){ if (pVnumTable[i] == item->GetVnum()) { ChatPacket(CHAT_TYPE_INFO, pDestroyMessage, item->GetName()); return false; } } 1 Link to comment Share on other sites More sharing options...
ladcatalin 6 Posted July 29, 2016 Share Posted July 29, 2016 (edited) Sorry...but.. where i should add this? 1 hour ago, VegaS said: Example: LPITEM item ; if (IS_SET (item ->GetAntiFlag(), ITEM_ANTIFLAG_GIVE | ITEM_ANTIFLAG_PKDROP | ITEM_ANTIFLAG_SELL)) return ; enum EItemAntiFlag { ITEM_ANTIFLAG_FEMALE = ( 1 << 0 ), ITEM_ANTIFLAG_MALE = ( 1 << 1 ), ITEM_ANTIFLAG_WARRIOR = ( 1 << 2 ), ITEM_ANTIFLAG_ASSASSIN = ( 1 << 3 ), ITEM_ANTIFLAG_SURA = ( 1 << 4 ), ITEM_ANTIFLAG_SHAMAN = ( 1 << 5 ), ITEM_ANTIFLAG_GET = ( 1 << 6 ), ITEM_ANTIFLAG_DROP = ( 1 << 7 ), ITEM_ANTIFLAG_SELL = ( 1 << 8 ), ITEM_ANTIFLAG_EMPIRE_A = ( 1 << 9 ), ITEM_ANTIFLAG_EMPIRE_B = ( 1 << 10 ), ITEM_ANTIFLAG_EMPIRE_C = ( 1 << 11 ), ITEM_ANTIFLAG_SAVE = ( 1 << 12 ), ITEM_ANTIFLAG_GIVE = ( 1 << 13 ), ITEM_ANTIFLAG_PKDROP = ( 1 << 14 ), ITEM_ANTIFLAG_STACK = ( 1 << 15 ), ITEM_ANTIFLAG_MYSHOP = ( 1 << 16 ), ITEM_ANTIFLAG_SAFEBOX = ( 1 << 17 ), }; And..After i do this, my problem will be solved?... Edited July 29, 2016 by ladcatalin my fault.. Link to comment Share on other sites More sharing options...
Premium Galet 514 Posted July 29, 2016 Premium Share Posted July 29, 2016 This is absolutely not about your problem, this is just a new check with Antiflag Try to start from the beginning, I use this system and I don't have any bugs :/ Link to comment Share on other sites More sharing options...
Kronzu 11 Posted October 27, 2016 Share Posted October 27, 2016 (edited) Hi, I want a little change because someone might accidentally click the Remove button. I tried to do as gif: But as you can see when you click "Usuń" does not remove the object and does not close the window. I did this: http://pastebin.com/4afZVsei sysser: Traceback (most recent call last): File "ui.py", line 1372, in CallEvent File "game.py", line 1507, in <lambda> File "game.py", line 1541, in RequestDestroyItem AttributeError: 'QuestionDialogItem2' object has no attribute 'dropType' game.py: on def __DropItem(self, attachedType, attachedItemIndex, attachedItemSlotPos, attachedItemCount): itemDropQuestionDialog = uiCommon.QuestionDialogItem() ... itemDropQuestionDialog.SetText(questionText) itemDropQuestionDialog.SetAcceptEvent(lambda arg=TRUE: self.RequestDropItem(arg)) itemDropQuestionDialog.SetDestroyEvent(lambda arg=TRUE: self.RequestDestroyItem1(arg)) itemDropQuestionDialog.SetCancelEvent(lambda arg=FALSE: self.RequestDropItem(arg)) itemDropQuestionDialog.Open() itemDropQuestionDialog.dropType = attachedType itemDropQuestionDialog.dropNumber = attachedItemSlotPos itemDropQuestionDialog.dropCount = attachedItemCount self.itemDropQuestionDialog = itemDropQuestionDialog constInfo.SET_ITEM_DROP_QUESTION_DIALOG_STATUS(1) ... def RequestDestroyItem1(self, answer): if answer: dropType = self.itemDropQuestionDialog.dropType dropNumber = self.itemDropQuestionDialog.dropNumber itemDropQuestionDialog = uiCommon.QuestionDialogItem2() itemDropQuestionDialog.SetText(localeInfo.DESTROY2) itemDropQuestionDialog.SetDestroyEvent(lambda arg=TRUE: self.RequestDestroyItem(arg)) itemDropQuestionDialog.SetCancelEvent(lambda arg=FALSE: self.RequestDropItem(arg)) itemDropQuestionDialog.Open() self.itemDropQuestionDialog = itemDropQuestionDialog constInfo.SET_ITEM_DROP_QUESTION_DIALOG_STATUS(1) uicommon.py: class QuestionDialogItem2(ui.ScriptWindow): def __init__(self): ui.ScriptWindow.__init__(self) self.__CreateDialog() def __del__(self): ui.ScriptWindow.__del__(self) def __CreateDialog(self): pyScrLoader = ui.PythonScriptLoader() pyScrLoader.LoadScriptFile(self, "uiscript/questiondialogitem2.py") self.board = self.GetChild("board") self.textLine = self.GetChild("message") self.destroyButton = self.GetChild("destroy") self.cancelButton = self.GetChild("cancel") def Open(self): self.SetCenterPosition() self.SetTop() self.Show() def Close(self): self.Hide() def SetWidth(self, width): height = self.GetHeight() self.SetSize(width, height) self.board.SetSize(width, height) self.SetCenterPosition() self.UpdateRect() def SAFE_SetCancelEvent(self, event): self.cancelButton.SAFE_SetEvent(event) def SetDestroyEvent(self, event): self.destroyButton.SetEvent(event) def SetCancelEvent(self, event): self.cancelButton.SetEvent(event) def SetText(self, text): self.textLine.SetText(text) def SetCancelText(self, text): self.cancelButton.SetText(text) def OnPressEscapeKey(self): self.Close() return TRUE questiondialogitem2.py: import uiScriptLocale window = { "name" : "QuestionDialog", "style" : ("movable", "float",), "x" : SCREEN_WIDTH/2 - 125, "y" : SCREEN_HEIGHT/2 - 52, "width" : 340, "height" : 105, "children" : ( { "name" : "board", "type" : "board", "x" : 0, "y" : 0, "width" : 340, "height" : 105, "children" : ( { "name" : "message", "type" : "text", "x" : 0, "y" : 38, "horizontal_align" : "center", "text" : uiScriptLocale.MESSAGE, "text_horizontal_align" : "center", "text_vertical_align" : "center", }, { "name" : "destroy", "type" : "button", "x" : -60, "y" : 63, "width" : 61, "height" : 21, "horizontal_align" : "center", "text" : uiScriptLocale.DESTROY, "default_image" : "d:/ymir work/ui/public/middle_button_01.sub", "over_image" : "d:/ymir work/ui/public/middle_button_02.sub", "down_image" : "d:/ymir work/ui/public/middle_button_03.sub", }, { "name" : "cancel", "type" : "button", "x" : 60, "y" : 63, "width" : 61, "height" : 21, "horizontal_align" : "center", "text" : uiScriptLocale.NO, "default_image" : "d:/ymir work/ui/public/middle_button_01.sub", "over_image" : "d:/ymir work/ui/public/middle_button_02.sub", "down_image" : "d:/ymir work/ui/public/middle_button_03.sub", }, ), }, ), } Could someone take a look something, advise or something? Edited August 20, 2022 by Metin2 Dev Core X - External 2 Internal 1 1 Link to comment Share on other sites More sharing options...
Evor 72 Posted October 27, 2016 Share Posted October 27, 2016 @Kronzu Search for QuestionDialogItem2 and paste here ur py-class. (my guess is uicommon.py) Detail: Class QuestionDialogItem2 dosen't have dropType attribute. Link to comment Share on other sites More sharing options...
Kronzu 11 Posted October 27, 2016 Share Posted October 27, 2016 (edited) Now i can't close the window for button. only Esc. sysser: Traceback (most recent call last): File "ui.py", line 1372, in CallEvent File "game.py", line 1468, in <lambda> File "game.py", line 1510, in RequestDestroyItem1 NameError: global name 'attachedType' is not defined def RequestDestroyItem1(self, answer): if answer: dropType = self.itemDropQuestionDialog.dropType dropNumber = self.itemDropQuestionDialog.dropNumber itemDropQuestionDialog = uiCommon.QuestionDialogItem2() itemDropQuestionDialog.SetText(localeInfo.DESTROY2) itemDropQuestionDialog.SetDestroyEvent(lambda arg=TRUE: self.RequestDestroyItem(arg)) itemDropQuestionDialog.SetCancelEvent(lambda arg=FALSE: self.RequestDropItem(arg)) itemDropQuestionDialog.Open() itemDropQuestionDialog.dropType = attachedType itemDropQuestionDialog.dropNumber = attachedItemSlotPos itemDropQuestionDialog.dropCount = attachedItemCount self.itemDropQuestionDialog = itemDropQuestionDialog constInfo.SET_ITEM_DROP_QUESTION_DIALOG_STATUS(1) Edited August 20, 2022 by Metin2 Dev Core X - External 2 Internal Link to comment Share on other sites More sharing options...
Active Member hachiwari 138 Posted October 27, 2016 Active Member Share Posted October 27, 2016 (edited) 4 minutes ago, Kronzu said: Now i can't close the window for button. Hide contents only Esc. sysser: Traceback (most recent call last): File "ui.py", line 1372, in CallEvent File "game.py", line 1468, in <lambda> File "game.py", line 1510, in RequestDestroyItem1 NameError: global name 'attachedType' is not defined def RequestDestroyItem1(self, answer): if answer: dropType = self.itemDropQuestionDialog.dropType dropNumber = self.itemDropQuestionDialog.dropNumber itemDropQuestionDialog = uiCommon.QuestionDialogItem2() itemDropQuestionDialog.SetText(localeInfo.DESTROY2) itemDropQuestionDialog.SetDestroyEvent(lambda arg=TRUE: self.RequestDestroyItem(arg)) itemDropQuestionDialog.SetCancelEvent(lambda arg=FALSE: self.RequestDropItem(arg)) itemDropQuestionDialog.Open() itemDropQuestionDialog.dropType = attachedType itemDropQuestionDialog.dropNumber = attachedItemSlotPos itemDropQuestionDialog.dropCount = attachedItemCount self.itemDropQuestionDialog = itemDropQuestionDialog constInfo.SET_ITEM_DROP_QUESTION_DIALOG_STATUS(1) Use your brain.exe, polish noob.. Ps. You have new character wolfman, but you dont have logical thinking. Edited August 20, 2022 by Metin2 Dev Core X - External 2 Internal 1 Link to comment Share on other sites More sharing options...
Migxelito 10 Posted November 23, 2016 Share Posted November 23, 2016 (edited) On 24/10/2015 at 5:56 AM, .Avenue™ said: Screenshot Help Me Please :c i close the sale when i want to throw an item Sysser: 1123 00:38:01084 :: Failed to load script file : uiscript/questiondialogitem.py 1123 00:38:01089 :: ui.py(line:3803) LoadScriptFile system.py(line:193) execfile system.py(line:164) Run uiscript/questiondialogitem.py(line:68) <module> LoadScriptFile!!!!!!!!!!!!!! - <type 'exceptions.AttributeError'>:'module' object has no attribute 'DESTROY' 1123 00:38:01089 :: ============================================================================================================ 1123 00:38:01089 :: Abort!!!! Edited August 20, 2022 by Metin2 Dev Core X - External 2 Internal Link to comment Share on other sites More sharing options...
Active Member ReFresh 2351 Posted November 27, 2016 Active Member Share Posted November 27, 2016 @Crox Just use one TAB between: DESTROY Destroy And, Is there any solution for confirmation dialog? I can't click on yes and no. I'll be always helpful! Link to comment Share on other sites More sharing options...
12AKN 6 Posted January 6, 2017 Share Posted January 6, 2017 If u can't move or equip items after destroy one, here's the fix: In this def def RequestDestroyItem(self, answer): if not self.itemDropQuestionDialog: return if answer: dropType = self.itemDropQuestionDialog.dropType dropNumber = self.itemDropQuestionDialog.dropNumber if player.SLOT_TYPE_INVENTORY == dropType: if dropNumber == player.ITEM_MONEY: return else: self.__SendDestroyItemPacket(dropNumber) self.itemDropQuestionDialog.Close() self.itemDropQuestionDialog = None constInfo.SET_ITEM_DROP_QUESTION_DIALOG_STATUS(0) Replace the constInfo.SET_ITEM_DROP_QUESTION_DIALOG_STATUS(0) with constInfo.SET_ITEM_QUESTION_DIALOG_STATUS(0) 6 Link to comment Share on other sites More sharing options...
iShadoW 3 Posted November 4, 2017 Share Posted November 4, 2017 is works fine , but for begginers be careful you need to put [TAB] instead SPACE in python because is delicated . ty for this system <3 i put it first time , and i dont have any bugs Link to comment Share on other sites More sharing options...
Recommended Posts