[Feature] Add "Keeps Sold Items" Flag to NPCs (#2671)

# Perl
- Add `$npc->GetKeepsSoldItems()`.
- Add `$npc->SetKeepsSoldItems(keeps_sold_items)`.

# Lua
- Add `npc:GetKeepsSoldItems()`.
- Add `npc:SetKeepsSoldItems(keeps_sold_items)`.

# Notes
- Allows operators to keep specific NPCs from keeping items sold to them.
- Keeps NPCs from being cluttered with stuff like Cloth Caps, Bone Chips, etc.
This commit is contained in:
Alex King
2022-12-25 16:36:20 -05:00
committed by GitHub
parent 2ed73199bf
commit a590ea1d52
19 changed files with 696 additions and 415 deletions
+34 -32
View File
@@ -98,6 +98,7 @@ Mob::Mob(
uint16 in_usemodel,
bool in_always_aggro,
int32 in_heroic_strikethrough,
bool in_keeps_sold_items,
int64 in_hp_regen_per_second
) :
attack_timer(2000),
@@ -252,39 +253,40 @@ Mob::Mob(
aa_title = 0xFF;
}
AC = in_ac;
ATK = in_atk;
STR = in_str;
STA = in_sta;
DEX = in_dex;
AGI = in_agi;
INT = in_int;
WIS = in_wis;
CHA = in_cha;
MR = CR = FR = DR = PR = Corrup = PhR = 0;
ExtraHaste = 0;
bEnraged = false;
current_mana = 0;
max_mana = 0;
hp_regen = in_hp_regen;
hp_regen_per_second = in_hp_regen_per_second;
mana_regen = in_mana_regen;
ooc_regen = RuleI(NPC, OOCRegen); //default Out of Combat Regen
maxlevel = in_maxlevel;
scalerate = in_scalerate;
invisible = 0;
invisible_undead = 0;
invisible_animals = 0;
sneaking = false;
hidden = false;
improved_hidden = false;
invulnerable = false;
IsFullHP = (current_hp == max_hp);
qglobal = 0;
spawned = false;
rare_spawn = false;
always_aggro = in_always_aggro;
AC = in_ac;
ATK = in_atk;
STR = in_str;
STA = in_sta;
DEX = in_dex;
AGI = in_agi;
INT = in_int;
WIS = in_wis;
CHA = in_cha;
MR = CR = FR = DR = PR = Corrup = PhR = 0;
ExtraHaste = 0;
bEnraged = false;
current_mana = 0;
max_mana = 0;
hp_regen = in_hp_regen;
hp_regen_per_second = in_hp_regen_per_second;
mana_regen = in_mana_regen;
ooc_regen = RuleI(NPC, OOCRegen); //default Out of Combat Regen
maxlevel = in_maxlevel;
scalerate = in_scalerate;
invisible = 0;
invisible_undead = 0;
invisible_animals = 0;
sneaking = false;
hidden = false;
improved_hidden = false;
invulnerable = false;
IsFullHP = (current_hp == max_hp);
qglobal = 0;
spawned = false;
rare_spawn = false;
always_aggro = in_always_aggro;
heroic_strikethrough = in_heroic_strikethrough;
keeps_sold_items = in_keeps_sold_items;
InitializeBuffSlots();