Jump to content

[FIX] Best fix - You cannot drop items from equipped items.


Recommended Posts

  • Bronze

You cannot drop items from equipped items.

Why?

Why there are bugs when throwing equipped items

-------------------------------BUG 1--------------------------------------

If you have sura/warrior aura and throw 1 item the aura is still there

    if (iWearCell == WEAR_WEAPON) {
        if (IsAffectFlag(AFF_GWIGUM)) {
            RemoveAffect(SKILL_GWIGEOM);
        }

        if (IsAffectFlag(AFF_GEOMGYEONG)) {
            RemoveAffect(SKILL_GEOMKYUNG);
        }
    }

Fix bypass for this code

You have aura ?  drop items and this aura is work

-------------------------------END--------------------------------------

 

-------------------------------BUG 2--------------------------------------

If your serverfiles have a problem with HP/SP and drop object the HP stays

In some server files there are even more problems

-------------------------------END--------------------------------------

 

Tested and works perfectly, I have player block for exploiting quite a few bugs with items

To fix this solves every problem!!!!

thanks you 

1) OPEN input_main.cpp
  search:
void CInputMain::ItemDrop2(LPCHARACTER ch, const char * data)
 
Change with:
#ifdef FIX_DROP_ITEMSSS
	void CInputMain::ItemDrop2(LPCHARACTER ch, const char * data)
	{
		TPacketCGItemDrop2 * pinfo = (TPacketCGItemDrop2 *) data;
		LPITEM pkItem = ch->GetItem(pinfo->Cell);
		
		if (!pkItem || !ch)
			return;
		if (pkItem->IsEquipped() == true)
		{
			ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("bug fixes items IsEquipped not drop."));
			return;
		}
		if (pinfo->gold > 0)
			ch->DropGold(pinfo->gold);
		else
			ch->DropItem(pinfo->Cell);
	}
#else
	void CInputMain::ItemDrop2(LPCHARACTER ch, const char * data)
	{
		TPacketCGItemDrop2 * pinfo = (TPacketCGItemDrop2 *) data;
		if (!ch)
			return;
		if (pinfo->gold > 0)
			ch->DropGold(pinfo->gold);
		else
			ch->DropItem(pinfo->Cell);
	}
#endif
  
 2) OPEN service.h
  add 
  #define FIX_DROP_ITEMSSS
  
  -------------------------------------------------------------------------------------------
  
  
  -------------------------------------------------------------------------------------------
  
  OPEN CLIENT ROOT
  
  OPEN: game.py
    
   search:
			if player.SLOT_TYPE_INVENTORY == attachedType:
				dropItemIndex = player.GetItemIndex(attachedItemSlotPos)

				item.SelectItem(dropItemIndex)
				dropItemName = item.GetItemName()

				## Question Text
				questionText = localeInfo.HOW_MANY_ITEM_DO_YOU_DROP(dropItemName, attachedItemCount)

				## Dialog
				itemDropQuestionDialog = uiCommon.QuestionDialog()
				itemDropQuestionDialog.SetText(questionText)
				itemDropQuestionDialog.SetAcceptEvent(lambda arg=True: self.RequestDropItem(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_QUESTION_DIALOG_STATUS(1)

              
change with:


			if player.SLOT_TYPE_INVENTORY == attachedType:
				if player.IsEquipmentSlot(attachedItemSlotPos):
					self.stream.popupWindow.Close()
					self.stream.popupWindow.Open(localeInfo.EXCHANGE_FAILURE_EQUIP_DROPPP, 0, localeInfo.UI_OK)
				else:
					dropItemIndex = player.GetItemIndex(attachedItemSlotPos)

					item.SelectItem(dropItemIndex)
					dropItemName = item.GetItemName()

					questionText = localeInfo.HOW_MANY_ITEM_DO_YOU_DROP(dropItemName, attachedItemCount)

					itemDropQuestionDialog = uiCommon.QuestionDialog()
					itemDropQuestionDialog.SetText(questionText)
					itemDropQuestionDialog.SetAcceptEvent(lambda arg=True: self.RequestDropItem(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_QUESTION_DIALOG_STATUS(1)
     
                      
                      
  OPEN LOCALE CLIENT:  locale_game.txt
    add
    EXCHANGE_FAILURE_EQUIP_DROPPP	Hello friends i am sorry this bug is closed :( .

  OPEN LOCALE SERVER:  locale_string.txt
    add
   "bug fixes items IsEquipped not drop."
    "bug fixes items IsEquipped not drop."
    
    
    
    

 

You can now take a test

Put on a weapon or armor and try to throw them down.

 

Edited by Draveniou1
Post correction Bug fix #5
  • Metin2 Dev 2
  • Smile Tear 1
  • Think 2
  • Lmao 2
  • Good 1
Link to comment
Share on other sites

  • Bronze

Please check my post again, any errors have been fixed

thanks you 

 

Updated the post

 


Fix error
my post updated
  ----------

#ifdef FIX_DROP_ITEMSSS
	void CInputMain::ItemDrop2(LPCHARACTER ch, const char * data)
	{
		TPacketCGItemDrop2 * pinfo = (TPacketCGItemDrop2 *) data;
		LPITEM pkItem = ch->GetItem(pinfo->Cell);
		
		if (!pkItem || !ch)
			return;
		if (pkItem->IsEquipped() == true)
		{
			ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("bug fixes items IsEquipped not drop."));
			return;
		}
		if (pinfo->gold > 0)
			ch->DropGold(pinfo->gold);
		else
			ch->DropItem(pinfo->Cell);
	}
#else
	void CInputMain::ItemDrop2(LPCHARACTER ch, const char * data)
	{
		TPacketCGItemDrop2 * pinfo = (TPacketCGItemDrop2 *) data;
		if (!ch)
			return;
		if (pinfo->gold > 0)
			ch->DropGold(pinfo->gold);
		else
			ch->DropItem(pinfo->Cell);
	}
#endif

 

Link to comment
Share on other sites

  • Premium

I think you meant to do like this, with your fix you cannot drop gold.

void CInputMain::ItemDrop2(LPCHARACTER ch, const char * data)
{
	TPacketCGItemDrop2 * pinfo = (TPacketCGItemDrop2 *) data;
	if (!ch)
		return;
  
	if (pinfo->gold > 0)
		ch->DropGold(pinfo->gold);
	else
	{
		LPITEM pkItem = ch->GetItem(pinfo->Cell);
		if (!pkItem)
			return;

		if (pkItem->IsEquipped())
			return;

		ch->DropItem(pinfo->Cell);
	}
}

But it's better to check inside of CHARACTER::DropItem function. Btw don't use macros it's enough to put a comment like // FIXME: can't drop equipment

Link to comment
Share on other sites

  • Bronze
4 hours ago, Jira said:

I think you meant to do like this, with your fix you cannot drop gold.

void CInputMain::ItemDrop2(LPCHARACTER ch, const char * data)
{
	TPacketCGItemDrop2 * pinfo = (TPacketCGItemDrop2 *) data;
	if (!ch)
		return;
  
	if (pinfo->gold > 0)
		ch->DropGold(pinfo->gold);
	else
	{
		LPITEM pkItem = ch->GetItem(pinfo->Cell);
		if (!pkItem)
			return;

		if (pkItem->IsEquipped())
			return;

		ch->DropItem(pinfo->Cell);
	}
}

But it's better to check inside of CHARACTER::DropItem function. Btw don't use macros it's enough to put a comment like // FIXME: can't drop equipment

 

        if (pkItem->IsEquipped())
            return;

why? I think this also checks the items in the inventory

		if (pkItem->IsEquipped() == true)
		{
			ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("bug fixes items IsEquipped not drop."));
			return;
		}
		

 

if (pkItem->IsEquipped() == true)

better that way for me

add as you want i have no problem

 

9 hours ago, TAUMP said:

Fix and you use define? Wow.

we should know the location of the fix because in the future you may make different server files and fix them

Link to comment
Share on other sites

Announcements



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