Jump to content
  • 0

Anti drop hack


Destiny

Question

9 answers to this question

Recommended Posts

  • 0
  • Premium

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

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

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


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