Browse Source

allow body drops with body_drop item db entry

Fix #244

alter table items add column body_drop tinyint(3) not null default '0';
Image 3 years ago
parent
commit
10b1a4e8d0

+ 1 - 0
DB/updates/items_body_drop_dec31_2020.sql

@@ -0,0 +1 @@
+alter table items add column body_drop tinyint(3) not null default '0';

+ 4 - 0
EQ2/source/WorldServer/Items/Items.cpp

@@ -1281,6 +1281,10 @@ bool Item::IsHarvest() {
 	return generic_info.harvest == 1;
 }
 
+bool Item::IsBodyDrop() {
+	return generic_info.body_drop == 1;
+}
+
 bool Item::IsTradeskill(){
 	LogWrite(MISC__TODO, 1, "TODO", "Item Is Crafted\n\t(%s, function: %s, line #: %i)", __FILE__, __FUNCTION__, __LINE__);
 	return false;

+ 2 - 0
EQ2/source/WorldServer/Items/Items.h

@@ -697,6 +697,7 @@ public:
 		int16					tradeskill_default_level;
 		int8					usable;
 		int8					harvest;
+		int8					body_drop;
 	};
 	struct Armor_Info {
 		int16					mitigation_low;
@@ -913,6 +914,7 @@ public:
 	bool IsTradeskill();
 	bool IsThrown();
 	bool IsHarvest();
+	bool IsBodyDrop();
 	void SetItemScript(string name);
 	const char*	GetItemScript();
 	int32 CalculateRepairCost();

+ 1 - 0
EQ2/source/WorldServer/Items/ItemsDB.cpp

@@ -282,6 +282,7 @@ void WorldDatabase::LoadDataFromRow(DatabaseResult* result, Item* item)
 	item->details.soe_id						= result->GetSInt32Str("soe_item_id");
 
 	item->generic_info.harvest					= result->GetInt8Str("harvest");
+	item->generic_info.body_drop				= result->GetInt8Str("body_drop");
 }
 
 int32 WorldDatabase::LoadSkillItems()

+ 1 - 1
EQ2/source/WorldServer/Items/Loot.cpp

@@ -453,7 +453,7 @@ NPC* Entity::DropChest() {
 	int8 highest_tier = 0;
 	vector<Item*>::iterator itr;	
 	for (itr = ((Spawn*)this)->GetLootItems()->begin(); itr != ((Spawn*)this)->GetLootItems()->end(); ) {
-		if ((*itr)->details.tier >= ITEM_TAG_UNCOMMON) {
+		if ((*itr)->details.tier >= ITEM_TAG_UNCOMMON && !(*itr)->IsBodyDrop()) {
 			if ((*itr)->details.tier > highest_tier)
 				highest_tier = (*itr)->details.tier;