Fix LootRollLevel=1 to match documented 'greed' behavior (#2068)

## Summary

Fixes `AiPlayerbot.LootRollLevel = 1` to actually behave as "greed" mode
per the config documentation.

## Problem

The config documentation states:
```conf
# Bots' loot roll level (0 = pass, 1 = greed, 2 = need)
# Default: 1 (greed)
AiPlayerbot.LootRollLevel = 1
```

However, level 1 was converting **all GREED votes to PASS**, causing
bots to pass on almost everything:

| Item Type | AI Decision | Level 1 Behavior (Before) | Expected |
|-----------|-------------|---------------------------|----------|
| Gear upgrade | NEED | GREED ✓ | GREED |
| Usable gear (not upgrade) | GREED | **PASS** ✗ | GREED |
| Crafting materials | GREED | **PASS** ✗ | GREED |
| Recipes, consumables | GREED | **PASS** ✗ | GREED |

The only items bots would greed on were direct gear upgrades (originally
NEED, downgraded to GREED).

## Root Cause

In `LootRollAction.cpp`, lines 104-107 were converting GREED to PASS:

```cpp
else if (vote == GREED)
{
    vote = PASS;  // This breaks "greed" mode
}
```

## Fix

Remove the GREED→PASS conversion. Level 1 now only downgrades NEED to
GREED (as intended), preserving GREED votes for useful items.

## Behavior After Fix

| Level | Description | Behavior |
|-------|-------------|----------|
| 0 | Pass | Always pass on all items |
| 1 | Greed | Greed on useful items, never need |
| 2 | Need | Full AI logic (need/greed/pass) |

## Test Plan

- [ ] Set `AiPlayerbot.LootRollLevel = 1`
- [ ] Kill mobs that drop crafting materials, recipes, or non-upgrade
gear
- [ ] Verify bots greed on useful items instead of passing
- [ ] Verify bots still pass on junk items
- [ ] Verify bots never roll need (only greed)

Co-authored-by: Hokken <Hokken@users.noreply.github.com>
This commit is contained in:
Hokken
2026-02-08 11:45:03 +00:00
committed by GitHub
parent 3db2a5a193
commit e9e79ad696

View File

@@ -90,6 +90,8 @@ bool LootRollAction::Execute(Event event)
}
else if (sPlayerbotAIConfig.lootRollLevel == 1)
{
// Level 1 = "greed" mode: bots greed on useful items but never need
// Only downgrade NEED to GREED, preserve GREED votes as-is
if (vote == NEED)
{
if (RollUniqueCheck(proto, bot))
@@ -101,10 +103,6 @@ bool LootRollAction::Execute(Event event)
vote = GREED;
}
}
else if (vote == GREED)
{
vote = PASS;
}
}
switch (group->GetLootMethod())
{