Jump to content

xP3NG3Rx

Honorable Member
  • Posts

    839
  • Joined

  • Days Won

    393
  • Feedback

    100%

Posts posted by xP3NG3Rx

  1. So, you are saying that:
    1. If we are wolfman. &&(aaand)
    2. The attaching weapon type is sword!wtf! &&(and)
    3. The attaching part is weapon. &&(aaaaand!)
    4. Item type is rod or pickaxe.

    Am I right?

    I reversed my code from official binary, so do not tell me how should be working, you! who selling @martysama0134's source.
    If anyone feel that to come and share their fix about this bug, why didn't come so far...? Shame.
     

    • Love 5
  2. Hey,

    As I promised that I make a fix for the wolfmans pickaxe, and fishing rod holding, I'm here with it.

    225511ss-2016-07-30-at-09.27.08-.jpg

     

    1.) Open GameLib\RaceData.h and find this:

    		void RegisterAttachingBoneName(DWORD dwPartIndex, const char * c_szBoneName);

    Paste this below:

    		void ChangeAttachingBoneName(DWORD dwPartIndex, const char * c_szBoneName);

    2. Open GameLib\RaceData.cpp and find this function:

    void CRaceData::RegisterAttachingBoneName(DWORD dwPartIndex, const char * c_szBoneName)
    {
    	m_AttachingBoneNameMap.insert(TAttachingBoneNameMap::value_type(dwPartIndex, c_szBoneName));
    }

    Than paste this function below:

    void CRaceData::ChangeAttachingBoneName(DWORD dwPartIndex, const char * c_szBoneName)
    {
    	TAttachingBoneNameMap::iterator it = m_AttachingBoneNameMap.find(dwPartIndex);
    	if (it == m_AttachingBoneNameMap.end())
    		return;
    
    	//m_AttachingBoneNameMap[dwPartIndex] = c_szBoneName; //bad behavior possiblity
    	it->second = c_szBoneName;
    }

     

    The following modification is may different by systems like costume weapon and so on, so I give a solution for clean version, you have to make it yourself.
    3.) Open GameLib\ActorInstanceAttach.cpp and find this code(or something like that with other systems):

    void CActorInstance::AttachWeapon(DWORD dwItemIndex,DWORD dwParentPartIndex, DWORD dwPartIndex)
    {
     //[...]
    	__DestroyWeaponTrace();
    	//ľçĽŐą«±â(ŔÚ°´ Ŕ̵µ·ů) żŢĽŐ,żŔ¸ĄĽŐ ¸đµÎżˇ ŔĺÂř.
    	if (__IsRightHandWeapon(pItemData->GetWeaponType()))
    		AttachWeapon(dwParentPartIndex, CRaceData::PART_WEAPON, pItemData);
    	if (__IsLeftHandWeapon(pItemData->GetWeaponType()))
    		AttachWeapon(dwParentPartIndex, CRaceData::PART_WEAPON_LEFT, pItemData);

    and replace it with this:

    void CActorInstance::AttachWeapon(DWORD dwItemIndex,DWORD dwParentPartIndex, DWORD dwPartIndex)
    {
    //[...]
    	DWORD dwWeaponType = pItemData->GetWeaponType();
    #ifdef ENABLE_WOLFMAN_CHARACTER
    	if (m_eRace == CRaceData::RACE_WOLFMAN_M)
    	{
    		char* szAttachingBoneName = "equip_right_weapon";
    		if (dwWeaponType != CItemData::WEAPON_CLAW)
    			szAttachingBoneName = "equip_right";
    		m_pkCurRaceData->ChangeAttachingBoneName(CRaceData::PART_WEAPON, szAttachingBoneName);
    	}
    #endif
    	__DestroyWeaponTrace();
    	if (__IsRightHandWeapon(dwWeaponType))
    		AttachWeapon(dwParentPartIndex, CRaceData::PART_WEAPON, pItemData);
    	if (__IsLeftHandWeapon(dwWeaponType))
    		AttachWeapon(dwParentPartIndex, CRaceData::PART_WEAPON_LEFT, pItemData);

     

    Done, build and enjoy.
    P3NG3R.
     

    • Metin2 Dev 1
    • Love 15
  3. Oh damn I understood already, I'm an idiot.

    	      if ( *(_DWORD *)(v7 + 1244) == 8 )        // Dog
          {
            if ( CItemData::GetType(v26) == 28 )
              v16 = CItemData::GetValue(v26, v15, 3u);
            else
              v16 = CItemData::GetWeaponType(v26);
            v18 = v16 == 8;
            v19 = (int)"equip_right_weapon";
            if ( !v18 )
              v19 = (int)"equip_right";
            sub_59C530(*(_DWORD *)(v7 + 1280), v17, 0, edi0, 1, v19);// wtf is this (v7 + 1280 : ActorInstance::m_pkCurRaceData) UPDATE: change the attaching bonename
          }
    	

     

    I will fix this shit tommorow, thank you so much.

    Now I'm uploading the whole actual decrypted GayForge client ;)

    • Love 1
  4. This and this, oh and brain.exe:

    #[...]
    import item
    #[...]
    class SafeboxWindow(ui.ScriptWindow):
    #[...]
    	def GetEmptyItemPos(self, itemHeight):
    		#DaRealFreak is freak :o ;)
    		inventory_size = player.INVENTORY_PAGE_SIZE * player.INVENTORY_PAGE_COUNT 
    		# function to return the blocked slots based on the item size 
    		GetBlockedSlots = lambda slot, size: [slot+(round*5) for round in xrange(size)] 
    		# check if an item in on the slot and get the blocked slots, in the end chain all of our lists together 
    		blocked_slots = [element for sublist in [GetBlockedSlots(slot, item.GetItemSize(item.SelectItem(player.GetItemIndex(slot)))[1]) for slot in xrange(inventory_size) if player.isItem(slot)] for element in sublist] 
    		# check is only necessary if our item size is > 1, else bigger performance loss in list comprehension 
    		if itemHeight > 1: 
    			# add the slots where f.e. size 2 items won't fit because of the 2-page-separated inventory 
    			[[blocked_slots.append(slot) for slot in range(inventory_size/round-(itemHeight-1)*5, inventory_size/round) if not slot in blocked_slots] for round in xrange(1,3)] 
    		# check for every slot if it's not in the blocked_slots list and check also for the size the lower slots  
    		free_slots = [slot for slot in xrange(inventory_size) if not slot in blocked_slots and not True in [e in blocked_slots for e in [slot+(round*5) for round in xrange(itemHeight)]]] 
    		# if our free_slot list is empty return -1 as error code, else return the first possible slot 
    		return [free_slots, -1][len(free_slots) == 0]
    
    	def UseItemSlot(self, slotIndex):
    		if mouseModule.mouseController.isAttached():
    			mouseModule.mouseController.DeattachObject()
    
    		item.SelectItem(safebox.GetItemID(self.__LocalPosToGlobalPos(slotIndex)))
    
    		(w, h) = item.GetItemSize()
    		emptyInvenSlots = self.GetEmptyItemPos(h)
    		if emptyInvenSlots == -1:
    			return
    
    		net.SendSafeboxCheckoutPacket(slotIndex, emptyInvenSlots[0])
    #[...]

     

    Edit: Tested, and works.
    There is a little mistake, when you log into your account, and open safebox than "checkout" some items, those items will new items, I mean the slots will be activated, because of this:

    void CInputMain::SafeboxCheckout(LPCHARACTER ch, const char * c_pData, bool bMall)
    {
    //[...]
    		pkSafebox->Remove(p->bSafePos);
    		pkItem->SetLastOwnerPID(ch->GetPlayerID()); #fixme slothighlight
    		pkItem->AddToCharacter(ch, p->ItemPos);
    		ITEM_MANAGER::instance().FlushDelayedSave(pkItem);
    //[...]
    }

    https://www.youtube.com/watch?v=k7oYpzP2tUc
     

    For that you can put items into safebox by clicks you have to check that safebox is opened or not, and rewrite/modify the useslot function in uiInventory.py(InventoryWindow class)

    • Metin2 Dev 1
    • Good 1
    • Love 8
  5. Do you know what are you talking about or I do not understand you?

    The chenking of the flag of the block in python now, but if you put the checking into c++ is similar and faster a little bit(s)

    I mean this:

    if systemSetting.IsShowMoneyText() == True:

    Same with this c++ code before the binary calls the python method:

    CPythonSystem::Instance().IsShowMoneyText()
    • Love 1
  6. Thanks.

    I think better way if the flag is active do not call the python method in game.py
    PythonNetworkStreamPhaseGame.cpp
    Replace this:

    		if (POINT_GOLD == PointChange.Type)
    		{
    			if (PointChange.amount > 0)
    			{
    				PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "OnPickMoney", Py_BuildValue("(i)", (int)PointChange.amount));
    			}
    		}
    
     

    With this:

    		if (POINT_GOLD == PointChange.Type)
    		{
    			if (PointChange.amount > 0 && CPythonSystem::Instance().IsShowMoneyText())
    			{
    				PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "OnPickMoney", Py_BuildValue("(i)", (int)PointChange.amount));
    			}
    		}
    
    
     

     

  7. That isn't image, c++ code.

     

    		if (IS_SET(rSlot.dwState, SLOT_STATE_UNUSABLE))
    		{
    			CPythonGraphic::Instance().SetDiffuseColor(1.0f, 1.0f, 1.0f, 0.3f);
    			CPythonGraphic::Instance().RenderBar2d(m_rect.left + rSlot.ixPosition,
    				m_rect.top + rSlot.iyPosition,
    				m_rect.left + rSlot.ixPosition + rSlot.byxPlacedItemSize * ITEM_WIDTH,
    				m_rect.top + rSlot.iyPosition + rSlot.byyPlacedItemSize * ITEM_HEIGHT);
    		}
    

     

    • Love 3
  8. I do not know what is this and why need this, but the code is ugly a little. And what those commented lines are?
    If you release smthg do not put inside unnecessary codes.

    Here is a little code which is much sexier:

     

    import app, chat
    szText = "banword"
    
    fHandle = app.OpenTextFile("locale/en/block_words_python.txt")
    if not fHandle:
    	return False
    
    if szText in [app.GetTextFileLine(fHandle, i).strip() for i in xrange(app.GetTextFileLineCount(fHandle))]
    	chat.AppendChat(chat.CHAT_TYPE_INFO, "[SYSTEM] Blocked words were introduced!")
    	return

     

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