Jump to content

xP3NG3Rx

Honorable Member
  • Posts

    839
  • Joined

  • Days Won

    393
  • Feedback

    100%

Posts posted by xP3NG3Rx

  1. Hmm, I can't watch the video because of my mobile-internet is limited.

    But I will test with this:

    		case SHOP_SUBHEADER_CG_SELL2:
    			{
    				if (uiBytes < sizeof(WORD) + sizeof(WORD) + sizeof(BYTE))
    					return -1;
    
    				//WORD wPos = *(c_pData);
    				const WORD wPos = *reinterpret_cast<const WORD*>(c_pData);//c_pData[0:sizeof(WORD)]
    				const WORD wCount = *(c_pData + sizeof(WORD));//c_pData[sizeof(WORD):(2*sizeof(WORD))]
    				const BYTE bType = *(c_pData + sizeof(WORD) + sizeof(WORD));//c_pData[(2*sizeof(WORD)):]
    
    				sys_log(0, "INPUT: %s SHOP: SELL2", ch->GetName());
    				sys_log(0, "   wPos: %d, wCount: %d, bType: %d", wPos, wCount, bType);
    				CShopManager::instance().Sell(ch, wPos, wCount, bType);
    				return sizeof(WORD) + sizeof(WORD) + sizeof(BYTE);
    			}
    

    Because I implemented the items selling from the DS-Inventory.

    • Metin2 Dev 2
  2. You can sort the items by those names in Ascending or Descending, I did some (C&P)changes, but I did not test yet, so I do not know it works or not.
    shop_manager.cpp

    New function for sorting:

    bool CompareShopItemPos(const SShopItemTable& lhs, const SShopItemTable& rhs)
    {
    	return (lhs.display_pos < rhs.display_pos);
    }
    

    Extended sorting statement:

    	std::string stSort;
    	if (!pNode->GetValue("sort", 0, stSort))
    	{
    		stSort = "None";
    	}
    
    	if (boost::iequals(stSort, "Asc"))
    	{
    		std::sort(shopItems.begin(), shopItems.end(), CompareShopItemName);
    	}
    	else if(boost::iequals(stSort, "Desc"))
    	{
    		std::sort(shopItems.rbegin(), shopItems.rend(), CompareShopItemName);
    	}
    	else if (boost::iequals(stSort, "Pos"))
    	{
    		std::sort(shopItems.begin(), shopItems.end(), CompareShopItemPos);
    	}
    
    Group B02
    {
    	Vnum	51
    	Name	Costumes
    	CoinType	SecondaryCoin
    	Sort	Pos
    	Group Items
    	{
    		#--#	Vnum	Count	Price
    		1	41003	1	50
    		2	41004	1	50
    		3	45003	1	30
    		4	45004	1	30
    	}
    }
    

     

    • Love 1
  3. app is a built-in module inside the binary. I do not recommend to use the official file from uiscript, because of python conflicts.

    @Lurinzo: The system is to detect the level of monsters and their aggressive flag and show these informations near the monster's name, which can be turned off.
    Here it is:

  4. Here is a dict about official file which is containing some informations(function names, function arguments, imports etc.):

    uiItemCombination = {
    	'class': [
    		{
    			'class': [],
    			'func': [
    				{'args': ['self', 'selectedSlotPos'], 'defaults': [], 'name': 'SelectItemSlot'},
    				{'args': ['self', 'slotIndex'], 'defaults': [], 'name': 'OverInItem'},
    				{'args': ['self'], 'defaults': [], 'name': 'OnDialogAcceptEvent'},
    				{'args': ['self', 'slotType', 'slotIndex'], 'defaults': [], 'name': 'AttachToCombinationSlot'},
    				{'args': ['self'], 'defaults': [], 'name': 'Accept'},
    				{'args': ['self'], 'defaults': [], 'name': 'Destroy'},
    				{'args': ['self', 'slotIndex'], 'defaults': [], 'name': 'GetItemSubTypeByCombSlot'},
    				{'args': ['self'], 'defaults': [], 'name': '__init__'},
    				{'args': ['self'], 'defaults': [], 'name': 'OnUpdate'},
    				{'args': ['self'], 'defaults': [], 'name': 'OnDialogCloseEvent'},
    				{'args': ['self', 'selectedSlotPos'], 'defaults': [], 'name': 'RemoveItemSlot'},
    				{'args': ['self'], 'defaults': [], 'name': 'ClearSlot'},
    				{'args': ['self'], 'defaults': [], 'name': 'IsFilledAllSlots'},
    				{'args': ['self'], 'defaults': [], 'name': '__ShowResultToolTip'},
    				{'args': ['self', 'selectedSlotPos'], 'defaults': [], 'name': 'SelectEmptySlot'},
    				{'args': ['self', 'slotIndex'], 'defaults': [], 'name': 'CantAttachToCombSlot'},
    				{'args': ['self'], 'defaults': [], 'name': 'ChangeBackgroundImage'},
    				{'args': ['self'], 'defaults': [], 'name': '__LoadWindow'},
    				{'args': ['self', 'slotIndex'], 'defaults': [], 'name': '__ShowToolTip'},
    				{'args': ['self'], 'defaults': [], 'name': '__del__'},
    				{'args': ['self', 'selectedSlotPos'], 'defaults': [], 'name': 'UseItemSlot'},
    				{'args': ['self'], 'defaults': [], 'name': 'OnPressEscapeKey'},
    				{'args': ['self', 'inven'], 'defaults': [], 'name': 'SetInven'},
    				{'args': ['self'], 'defaults': [], 'name': 'OnTop'},
    				{'args': ['self', 'interface'], 'defaults': [], 'name': 'BindInterface'},
    				{'args': ['self', 'selectedSlotPos', 'attachedSlotType', 'attachedSlotPos'], 'defaults': [], 'name': 'CanAttachSlot'},
    				{'args': ['self', 'selectSlot', 'slotType', 'slotIndex'], 'defaults': [], 'name': 'AttachItemToSelectSlot'},
    				{'args': ['self', 'tooltip'], 'defaults': [], 'name': 'SetItemToolTip'},
    				{'args': ['self', 'wndInven'], 'defaults': [], 'name': 'SetInvenWindow'},
    				{'args': ['self'], 'defaults': [], 'name': 'OverOutItem'},
    				{'args': ['self'], 'defaults': [], 'name': 'Close'},
    				{'args': ['self'], 'defaults': [], 'name': 'SetResultItem'},
    				{'args': ['self'], 'defaults': [], 'name': 'Open'},
    				{'args': ['self'], 'defaults': [], 'name': 'RefreshCantMouseEventSlot'}
    			],
    			'import': [],
    			'var': [
    				{'name': '__module__', 'type': 'str', 'value': 'uiItemCombination'},
    				{'name': '__doc__', 'type': 'NoneType', 'value': None},
    				{'name': '__qualname__', 'type': 'str', 'value': 'ItemCombinationWindow'}
    			]
    		}
    	],
    	'func': [],
    	'import': ['chatm2g', 'app', 'uiPrivateShopBuilder', 'uiPickMoney', 'm2netm2g', 'playerm2g2', 'uiRefine', 'constInfo', 'grp', 'uiToolTip', 'uiAttachMetin', 'mouseModule', 'uiScriptLocale', 'localeInfo', 'uiCommon', 'snd', '__builtin__', 'ime', 'wndMgr', 'item', 'ui'],
    	'var': [
    		{'name': '__package__', 'type': 'NoneType', 'value': None},
    		{'name': '__doc__', 'type': 'NoneType', 'value': None},
    		{'name': 'USE_WINDOW_LIMIT_RANGE', 'type': 'int', 'value': 500},
    		{'name': '__test__', 'type': 'dict', 'value': {}},
    		{'name': '__name__', 'type': 'str', 'value': 'uiItemCombination'}
    	]
    }
    

  5. What your type of the sashes?
    costume(type:28) with costume_sash(subtype:3)?

    You have to correct this statement for your system:

    #ifdef __ACCE_COSTUME_SYSTEM__
    							if (ITEM_COSTUME != item2->GetType() && COSTUME_HAIR < item2->GetSubType())
    #else
    							if (ITEM_COSTUME != item2->GetType())
    #endif
    							{
    								ChatPacket(CHAT_TYPE_INFO, LC_TEXT("ŔĚ Ç׸ń°ú Ç׸ńŔÇ ĽÓĽşŔ» şŻ°ćÇŇ Ľö ľř˝Ŕ´Ď´Ů."));
    								return false;
    							}
    

    Like this:

    							if (ITEM_COSTUME != item2->GetType() || (item2->GetSubType() != COSTUME_BODY && item2->GetSubType() != COSTUME_HAIR))
    							{
    								ChatPacket(CHAT_TYPE_INFO, LC_TEXT("ŔĚ Ç׸ń°ú Ç׸ńŔÇ ĽÓĽşŔ» şŻ°ćÇŇ Ľö ľř˝Ŕ´Ď´Ů."));
    								return false;
    							}
    

     

    • Love 1
  6. @Despero:

    I can't log into my skype, because of my slow internet bandwith(32kbps).

    Optional update:

    char_item.cpp>

    //1. Search this function: bool CHARACTER::GiveItemFromSpecialItemGroup(DWORD dwGroupNum, std::vector<DWORD> &dwItemVnums, std::vector<DWORD> &dwItemCounts, std::vector <LPITEM> &item_gets, int &count)
    //And replace the MOB case of switch (dwVnum) with this:
    		case CSpecialItemGroup::MOB:
    			{
    				sys_log(0, "CSpecialItemGroup::MOB %d", dwCount);
    				int x = GetX() + number(-500, 500);
    				int y = GetY() + number(-500, 500);
    
    				CHARACTER_MANAGER::instance().SpawnMob(dwCount, GetMapIndex(), x, y, 0, true, -1, true, true);
    
    				bSuccess = true;
    			}
    			break;
    

    questlua.cpp>

    //1. Search the mob_spawn function.
    //Replace this:
    //############################################################################
    mob = CHARACTER_MANAGER::instance().SpawnMob(mob_vnum, ch->GetMapIndex(), x, y, 0);
    //############################################################################
    
    //With this:
    //############################################################################
    mob = CHARACTER_MANAGER::instance().SpawnMob(mob_vnum, ch->GetMapIndex(), x, y, 0, false, -1, true, true);
    //############################################################################
    
    //2. Delete this from the mob_spawn function:
    //############################################################################
    				if (bAggressive)
    					mob->SetAggressive();
    //############################################################################
    

    • Love 2
  7. First of all sorry for lately reply.
    Yes I know already TheSLZ informed me, sorry for that but I missed out something from the UserInterface/NetworkActorManager.cpp, I will update the archive within some minutes after I had recheck everything again.

    CInstanceBase* CNetworkActorManager::__AppendCharacterManagerActor(SNetworkActorData& rkNetActorData)

    	kCreateData.m_dwLevel=rkNetActorData.m_dwLevel;
    #if defined(WJ_SHOW_MOB_INFO)
    	kCreateData.m_dwAIFlag=rkNetActorData.m_dwAIFlag;
    #endif
    	kCreateData.m_dwGuildID=rkNetActorData.m_dwGuildID;
    

     

    The IsPet() part same with IsPC() if you follow the line in back(Go to definition in VS) just the different is that the Pets(the new growable pets) have new instance type (TYPE_PET = 10, pc is 6 etc).

    gameLib/ActorInstance.cpp + Header file into class CActorInstance

    		bool IsPet();
    
    bool CActorInstance::IsPet()
    {
    	if (TYPE_PET == m_eActorType)
    		return true;
    
    	return false;
    }
    

    UserInterface/InstanceBase.cpp + Header file into class CInstanceBase

    		BOOL					IsPet();
    
    BOOL CInstanceBase::IsPet()
    {
    	return m_GraphicThingInstance.IsPet();
    }
    

    gameLib/ActorInstance.h

    		enum EType
    		{
    			TYPE_ENEMY,
    			TYPE_NPC,
    			TYPE_STONE,
    			TYPE_WARP,
    			TYPE_DOOR,
    			TYPE_BUILDING,
    			TYPE_PC,
    			TYPE_POLY,
    			TYPE_HORSE,
    			TYPE_GOTO,
    			TYPE_PET,
    
    			TYPE_OBJECT, // Only For Client
    		};
    

     

    @koray: Sorry but I do not know what does it mean the WJ tag.

    @galet I have an unpacked r7071 but the imports are not corrected and crash when starts, but can load it in ida, and the (already not actual) r11185(from beta) able to debug with attach process when ... I do not want to tell that because "they" are reading this forum as Shogun said and I do not want to change this state, because I want to bebug the new binaries in the future continuously :).

    About: Module object has no attribute "blablabla". Check your pythonsystemmodule.cpp file again and add the new variable if you did not do yet.

    • Love 5
  8. M2 Download Center

    This is the hidden content, please
    ( Internal )

    Hi, developers!

    Before you start, create a backup from your source files immediately!


    Today I'm gonna share with you my last work. I have read every informations from the official binary from beta(metin2client_r11185) and r7071. It was not an easy task to understand functions but successed. I will not write down the implementation step by step, but I wrote some informations into the files what you should to do to implement the system. If you do not understand the steps I put original(from dev branch) and modified files into the archive to compare the original and the changed files with notepad++ or something else comparer tool to see the changes.

    - There are some files which optional changes to show the mob-aiflag on those monsters which are not aggressive but summoned by aggressive with "/ma" command.
    - There was a little problem with Python 2.7.3 therefore I split asunder the gui-script. And be careful, the main script is using True and False variables.
    - You can disable the whole system in common/service.h and UserInterface/Locale_inc.h with undefined or with commented macro.
     

    I hope everything are understandable and I did not miss something from the release, and sorry for my bad english.
    Special thanks to TheSLZ for test the implementation.

    And last but not least here is the result:
     

    Spoiler

    283009736f4fb927.jpg.c0ed1d9f1856ff486d6

     

    This is the hidden content, please

    • Metin2 Dev 176
    • kekw 2
    • Eyes 1
    • Dislove 2
    • Angry 4
    • Smile Tear 2
    • Think 4
    • Confused 3
    • Scream 2
    • Lmao 1
    • Good 62
    • muscle 1
    • Love 8
    • Love 114
×
×
  • 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.