diff --git a/common/ruletypes.h b/common/ruletypes.h index 82eddca7f..5207b6cbf 100644 --- a/common/ruletypes.h +++ b/common/ruletypes.h @@ -157,6 +157,7 @@ RULE_BOOL(Character, OPClientUpdateVisualDebug, false, "Shows a pulse and forwar RULE_BOOL(Character, AllowCrossClassTrainers, false, "") RULE_BOOL(Character, PetsUseReagents, true, "Pets use reagent on spells") RULE_BOOL(Character, DismountWater, true, "Dismount horses when entering water") +RULE_BOOL(Character, UseNoJunkFishing, false, "Disregards junk items when fishing") RULE_CATEGORY_END() RULE_CATEGORY(Mercs) diff --git a/zone/forage.cpp b/zone/forage.cpp index 3c69dce19..24c4641e4 100644 --- a/zone/forage.cpp +++ b/zone/forage.cpp @@ -309,40 +309,42 @@ void Client::GoFish() if(food_id == 0) { int index = zone->random.Int(0, MAX_COMMON_FISH_IDS-1); - food_id = common_fish_ids[index]; + food_id = (RuleB(Character, UseNoJunkFishing) ? 13019 : common_fish_ids[index]); } const EQEmu::ItemData* food_item = database.GetItem(food_id); + if (food_item) { - if (food_item->ItemType != EQEmu::item::ItemTypeFood) { - MessageString(Chat::Skills, FISHING_SUCCESS); - } - else { - MessageString(Chat::Skills, FISHING_SUCCESS_FISH_NAME, food_item->Name); - } - - EQEmu::ItemInstance* inst = database.CreateItem(food_item, 1); - if(inst != nullptr) { - if(CheckLoreConflict(inst->GetItem())) - { - MessageString(Chat::White, DUP_LORE); - safe_delete(inst); + if (food_item->ItemType != EQEmu::item::ItemTypeFood) { + MessageString(Chat::Skills, FISHING_SUCCESS); } - else - { - PushItemOnCursor(*inst); - SendItemPacket(EQEmu::invslot::slotCursor, inst, ItemPacketLimbo); - if(RuleB(TaskSystem, EnableTaskSystem)) - UpdateTasksForItem(ActivityFish, food_id); - - safe_delete(inst); - inst = m_inv.GetItem(EQEmu::invslot::slotCursor); + else { + MessageString(Chat::Skills, FISHING_SUCCESS_FISH_NAME, food_item->Name); } - if(inst) { - std::vector args; - args.push_back(inst); - parse->EventPlayer(EVENT_FISH_SUCCESS, this, "", inst->GetID(), &args); + EQEmu::ItemInstance* inst = database.CreateItem(food_item, 1); + if (inst != nullptr) { + if (CheckLoreConflict(inst->GetItem())) + { + MessageString(Chat::White, DUP_LORE); + safe_delete(inst); + } + else + { + PushItemOnCursor(*inst); + SendItemPacket(EQEmu::invslot::slotCursor, inst, ItemPacketLimbo); + if (RuleB(TaskSystem, EnableTaskSystem)) + UpdateTasksForItem(ActivityFish, food_id); + + safe_delete(inst); + inst = m_inv.GetItem(EQEmu::invslot::slotCursor); + } + + if (inst) { + std::vector args; + args.push_back(inst); + parse->EventPlayer(EVENT_FISH_SUCCESS, this, "", inst->GetID(), &args); + } } } }