Jump to content

Anti drop hack


Go to solution Solved by Sanchez,

Recommended Posts

  • Premium

Open char_item.cpp
 
Find  namespace NPartyPickupDistribute
Add under it this code

namespace NPartyPickupPermission
{
	struct FCompareOwnership
	{
		LPITEM item;
		bool is_allowed = false;

		FCompareOwnership(LPITEM item) 
			: item(item)
		{
		}

		void operator () (LPCHARACTER ch)
		{
			if (item->IsOwnership(ch) == true)
				is_allowed = true;
		}
	};
}

After search else if (!IS_SET(item->GetAntiFlag(), ITEM_ANTIFLAG_GIVE | ITEM_ANTIFLAG_DROP) && GetParty())

Add under it 

			bool is_allowed = false;
			NPartyPickupPermission::FCompareOwnership funcCompareOwnership(item);
			GetParty()->ForEachOnlineMember(funcCompareOwnership);
			is_allowed = funcCompareOwnership.is_allowed;
			if(is_allowed == false)
			{
				ChatPacket(CHAT_TYPE_INFO, LC_TEXT("This item is not yours!"));
				return false;
			}
Link to comment
Share on other sites

char_item.cpp: In member function 'bool CHARACTER::IsEmptyItemGrid(TItemPos, BYTE, int) const':
char_item.cpp:640: warning: comparison is always false due to limited range of data type
char_item.cpp:666: warning: comparison is always false due to limited range of data type
char_item.cpp: In member function 'bool CHARACTER::UseItemEx(CItem*, TItemPos)':
char_item.cpp:2387: warning: format '%d' expects type 'int', but argument 6 has type 'long int'
char_item.cpp:2391: warning: format '%d' expects type 'int', but argument 6 has type 'long int'
char_item.cpp:2403: warning: format '%d' expects type 'int', but argument 5 has type 'long int'
char_item.cpp:2407: warning: format '%d' expects type 'int', but argument 5 has type 'long int'
char_item.cpp:2434: warning: format '%d' expects type 'int', but argument 6 has type 'long int'
char_item.cpp:2442: warning: format '%d' expects type 'int', but argument 5 has type 'long int'
char_item.cpp:5096: warning: comparison between signed and unsigned integer expressions
char_item.cpp: In member function 'bool CHARACTER::UseItem(TItemPos, TItemPos)':
char_item.cpp:5168: warning: unused variable 'wDestCell'
char_item.cpp:5169: warning: unused variable 'bDestInven'
char_item.cpp: At global scope:
char_item.cpp:5685: error: ISO C++ forbids initialization of member 'is_allowed'
char_item.cpp:5685: error: making 'is_allowed' static
char_item.cpp:5685: error: ISO C++ forbids in-class initialization of non-const static member 'is_allowed'
compile crc32.cpp
char_item.cpp:5974: error: 'NPartyPickupPermission' has not been declared
char_item.cpp:5974: error: expected constructor, destructor, or type conversion before 'funcCompareOwnershi             p'
char_item.cpp:5975: error: expected constructor, destructor, or type conversion before '->' token
char_item.cpp:5976: error: expected constructor, destructor, or type conversion before '=' token
char_item.cpp:5977: error: expected unqualified-id before 'if'
char_item.cpp: In member function 'bool CHARACTER::EquipItem(CItem*, int)':
char_item.cpp:6201: warning: array subscript has type 'char'
char_item.cpp: In member function 'void CHARACTER::BuffOnAttr_AddBuffsFromItem(CItem*)':
char_item.cpp:6265: warning: comparison between signed and unsigned integer expressions
char_item.cpp: In member function 'void CHARACTER::BuffOnAttr_RemoveBuffsFromItem(CItem*)':
char_item.cpp:6277: warning: comparison between signed and unsigned integer expressions
char_item.cpp: In member function 'bool CHARACTER::CanEquipNow(CItem*, const TItemPos&, const TItemPos&)':
char_item.cpp:7463: warning: unused variable 'itemType'
char_item.cpp:7464: warning: unused variable 'itemSubType'
 
fail to compile
Link to comment
Share on other sites

  • Premium
  • Solution

Just replace this in char_item.cpp:

LPCHARACTER owner = funcFindOwnership.owner;

With this:

LPCHARACTER owner = funcFindOwnership.owner;

// Owner does not exist, so don't allow to run remaining codes.
if (!owner)
	return false;

The next line of the code will set me as owner of the item if the owner is currently nobody. And sure, it's nobody because no one is the owner of the item from my group.

  • Love 4
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



  • Similar Content

  • Activity

    1. 5

      Effect weapons

    2. 3

      Crystal Metinstone

    3. 3

      Feeding game source to LLM

    4. 113

      Ulthar SF V2 (TMP4 Base)

    5. 3

      Feeding game source to LLM

    6. 0

      Target Information System

    7. 3

      Feeding game source to LLM

    8. 2

      anti exp explanation pls

  • Recently Browsing

    • No registered users viewing this page.
×
×
  • 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.