mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-17 07:18:37 +00:00
[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:
+15
-6
@@ -121,7 +121,8 @@ NPC::NPC(const NPCType *npc_type_data, Spawn2 *in_respawn, const glm::vec4 &posi
|
||||
npc_type_data->use_model,
|
||||
npc_type_data->always_aggro,
|
||||
npc_type_data->hp_regen_per_second,
|
||||
npc_type_data->heroic_strikethrough
|
||||
npc_type_data->heroic_strikethrough,
|
||||
npc_type_data->keeps_sold_items
|
||||
),
|
||||
attacked_timer(CombatEventTimer_expire),
|
||||
swarm_timer(100),
|
||||
@@ -210,12 +211,13 @@ NPC::NPC(const NPCType *npc_type_data, Spawn2 *in_respawn, const glm::vec4 &posi
|
||||
LevelScale();
|
||||
}
|
||||
|
||||
base_damage = round((max_dmg - min_dmg) / 1.9);
|
||||
min_damage = min_dmg - round(base_damage / 10.0);
|
||||
accuracy_rating = npc_type_data->accuracy_rating;
|
||||
avoidance_rating = npc_type_data->avoidance_rating;
|
||||
ATK = npc_type_data->ATK;
|
||||
base_damage = round((max_dmg - min_dmg) / 1.9);
|
||||
min_damage = min_dmg - round(base_damage / 10.0);
|
||||
accuracy_rating = npc_type_data->accuracy_rating;
|
||||
avoidance_rating = npc_type_data->avoidance_rating;
|
||||
ATK = npc_type_data->ATK;
|
||||
heroic_strikethrough = npc_type_data->heroic_strikethrough;
|
||||
keeps_sold_items = npc_type_data->keeps_sold_items;
|
||||
|
||||
// used for when switch back to charm
|
||||
default_ac = npc_type_data->AC;
|
||||
@@ -2672,6 +2674,10 @@ void NPC::ModifyNPCStat(std::string stat, std::string value)
|
||||
heroic_strikethrough = atoi(value.c_str());
|
||||
return;
|
||||
}
|
||||
else if (stat_lower == "keeps_sold_items") {
|
||||
SetKeepsSoldItems(Strings::ToBool(value));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
float NPC::GetNPCStat(std::string stat)
|
||||
@@ -2813,6 +2819,9 @@ float NPC::GetNPCStat(std::string stat)
|
||||
else if (stat_lower == "heroic_strikethrough") {
|
||||
return heroic_strikethrough;
|
||||
}
|
||||
else if (stat_lower == "keeps_sold_items") {
|
||||
return keeps_sold_items;
|
||||
}
|
||||
//default values
|
||||
else if (stat_lower == "default_ac") {
|
||||
return default_ac;
|
||||
|
||||
Reference in New Issue
Block a user