[Rules] Add LDoN Loot Count Modifier Rule (#2694)

# Notes
- Adds a rule for LDoN Adventure Loot.
This commit is contained in:
Alex King 2023-01-03 14:32:13 -05:00 committed by GitHub
parent c7dde7832d
commit af4ee9f8d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 14 deletions

View File

@ -683,6 +683,7 @@ RULE_INT(Adventure, ItemIDToEnablePorts, 41000, "ItemID to enable adventure port
RULE_INT(Adventure, LDoNTrapDistanceUse, 625, "LDoN trap distance use") RULE_INT(Adventure, LDoNTrapDistanceUse, 625, "LDoN trap distance use")
RULE_REAL(Adventure, LDoNBaseTrapDifficulty, 15.0, "LDoN base trap difficulty") RULE_REAL(Adventure, LDoNBaseTrapDifficulty, 15.0, "LDoN base trap difficulty")
RULE_REAL(Adventure, LDoNCriticalFailTrapThreshold, 10.0, "LDoN critical fail trap threshold") 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_END()
RULE_CATEGORY(AA) RULE_CATEGORY(AA)

View File

@ -2540,24 +2540,28 @@ void Zone::DoAdventureAssassinationCountIncrease()
void Zone::DoAdventureActions() void Zone::DoAdventureActions()
{ {
ServerZoneAdventureDataReply_Struct* ds = (ServerZoneAdventureDataReply_Struct*)adv_data; const auto* ds = (ServerZoneAdventureDataReply_Struct*) adv_data;
if(ds->type == Adventure_Collect) if (ds->type == Adventure_Collect) {
{ int count = (ds->total - ds->count) * 25 / RuleI(Adventure, LDoNLootCountModifier);
int count = (ds->total - ds->count) * 25 / 10;
entity_list.AddLootToNPCS(ds->data_id, count); entity_list.AddLootToNPCS(ds->data_id, count);
did_adventure_actions = true; did_adventure_actions = true;
} } else if (ds->type == Adventure_Assassinate) {
else if(ds->type == Adventure_Assassinate) if (ds->assa_count >= RuleI(Adventure, NumberKillsForBossSpawn)) {
{ const auto* d = content_db.LoadNPCTypesData(ds->data_id);
if(ds->assa_count >= RuleI(Adventure, NumberKillsForBossSpawn)) if (d) {
{ NPC* npc = new NPC(
const NPCType* tmp = content_db.LoadNPCTypesData(ds->data_id); d,
if(tmp) nullptr,
{ glm::vec4(ds->assa_x, ds->assa_y, ds->assa_z, ds->assa_h),
NPC* npc = new NPC(tmp, nullptr, glm::vec4(ds->assa_x, ds->assa_y, ds->assa_z, ds->assa_h), GravityBehavior::Water); GravityBehavior::Water
);
npc->AddLootTable(); npc->AddLootTable();
if (npc->DropsGlobalLoot())
if (npc->DropsGlobalLoot()) {
npc->CheckGlobalLootTables(); npc->CheckGlobalLootTables();
}
entity_list.AddNPC(npc); entity_list.AddNPC(npc);
npc->Shout("Rarrrgh!"); npc->Shout("Rarrrgh!");
did_adventure_actions = true; did_adventure_actions = true;