diff --git a/common/ruletypes.h b/common/ruletypes.h index 7ee004d1c..bed6fbb9e 100644 --- a/common/ruletypes.h +++ b/common/ruletypes.h @@ -683,6 +683,7 @@ RULE_INT(Adventure, ItemIDToEnablePorts, 41000, "ItemID to enable adventure port RULE_INT(Adventure, LDoNTrapDistanceUse, 625, "LDoN trap distance use") RULE_REAL(Adventure, LDoNBaseTrapDifficulty, 15.0, "LDoN base trap difficulty") RULE_REAL(Adventure, LDoNCriticalFailTrapThreshold, 10.0, "LDoN critical fail trap threshold") +RULE_INT(Adventure, LDoNLootCountModifier, 10, "LDoN Loot Count Modifier, lower is better (default is 10)") RULE_CATEGORY_END() RULE_CATEGORY(AA) diff --git a/zone/zone.cpp b/zone/zone.cpp index 8a2d6422c..d0c6ab3e0 100644 --- a/zone/zone.cpp +++ b/zone/zone.cpp @@ -2540,24 +2540,28 @@ void Zone::DoAdventureAssassinationCountIncrease() void Zone::DoAdventureActions() { - ServerZoneAdventureDataReply_Struct* ds = (ServerZoneAdventureDataReply_Struct*)adv_data; - if(ds->type == Adventure_Collect) - { - int count = (ds->total - ds->count) * 25 / 10; + const auto* ds = (ServerZoneAdventureDataReply_Struct*) adv_data; + if (ds->type == Adventure_Collect) { + int count = (ds->total - ds->count) * 25 / RuleI(Adventure, LDoNLootCountModifier); entity_list.AddLootToNPCS(ds->data_id, count); did_adventure_actions = true; - } - else if(ds->type == Adventure_Assassinate) - { - if(ds->assa_count >= RuleI(Adventure, NumberKillsForBossSpawn)) - { - const NPCType* tmp = content_db.LoadNPCTypesData(ds->data_id); - if(tmp) - { - NPC* npc = new NPC(tmp, nullptr, glm::vec4(ds->assa_x, ds->assa_y, ds->assa_z, ds->assa_h), GravityBehavior::Water); + } else if (ds->type == Adventure_Assassinate) { + if (ds->assa_count >= RuleI(Adventure, NumberKillsForBossSpawn)) { + const auto* d = content_db.LoadNPCTypesData(ds->data_id); + if (d) { + NPC* npc = new NPC( + d, + nullptr, + glm::vec4(ds->assa_x, ds->assa_y, ds->assa_z, ds->assa_h), + GravityBehavior::Water + ); + npc->AddLootTable(); - if (npc->DropsGlobalLoot()) + + if (npc->DropsGlobalLoot()) { npc->CheckGlobalLootTables(); + } + entity_list.AddNPC(npc); npc->Shout("Rarrrgh!"); did_adventure_actions = true;