allow body drops with body_drop item db entry
Fix #244 alter table items add column body_drop tinyint(3) not null default '0';
This commit is contained in:
parent
29f797d71c
commit
10b1a4e8d0
5 changed files with 9 additions and 1 deletions
1
DB/updates/items_body_drop_dec31_2020.sql
Normal file
1
DB/updates/items_body_drop_dec31_2020.sql
Normal file
|
@ -0,0 +1 @@
|
|||
alter table items add column body_drop tinyint(3) not null default '0';
|
|
@ -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;
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in a new issue