1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-02-06 00:40:04 +00:00

FEAT: Add essential and respawning flags for both NPC and Creature types

This commit is contained in:
Dave Corley 2024-07-28 17:13:49 -05:00
parent ef9d5270a1
commit 42060be65c
3 changed files with 12 additions and 0 deletions

View File

@ -68,6 +68,10 @@ namespace MWLua
[](const ESM::Creature& rec) -> bool { return rec.mFlags & ESM::Creature::Walks; });
record["isBiped"] = sol::readonly_property(
[](const ESM::Creature& rec) -> bool { return rec.mFlags & ESM::Creature::Bipedal; });
record["isEssential"] = sol::readonly_property(
[](const ESM::Creature& rec) -> bool { return rec.mFlags & ESM::Creature::Essential; });
record["isRespawning"] = sol::readonly_property(
[](const ESM::Creature& rec) -> bool { return rec.mFlags & ESM::Creature::Respawn; });
addActorServicesBindings<ESM::Creature>(record, context);
}

View File

@ -95,7 +95,11 @@ namespace MWLua
= sol::readonly_property([](const ESM::NPC& rec) -> std::string { return rec.mHead.serializeText(); });
record["model"] = sol::readonly_property(
[](const ESM::NPC& rec) -> std::string { return Misc::ResourceHelpers::correctMeshPath(rec.mModel); });
record["isEssential"]
= sol::readonly_property([](const ESM::NPC& rec) -> bool { return rec.mFlags & ESM::NPC::Essential; });
record["isMale"] = sol::readonly_property([](const ESM::NPC& rec) -> bool { return rec.isMale(); });
record["isRespawning"]
= sol::readonly_property([](const ESM::NPC& rec) -> bool { return rec.mFlags & ESM::NPC::Respawn; });
record["baseGold"] = sol::readonly_property([](const ESM::NPC& rec) -> int { return rec.mNpdt.mGold; });
addActorServicesBindings<ESM::NPC>(record, context);

View File

@ -852,6 +852,8 @@
-- @field #boolean canWalk whether the creature can walk
-- @field #boolean canUseWeapons whether the creature can use weapons and shields
-- @field #boolean isBiped whether the creature is a biped
-- @field #boolean isEssential whether the creature is essential
-- @field #boolean isRespawning whether the creature respawns after death
--- @{#NPC} functions
@ -1130,6 +1132,8 @@
-- @field #bool isMale The gender setting of the NPC
-- @field #map<#string, #boolean> servicesOffered The services of the NPC, in a table. Value is if the service is provided or not, and they are indexed by: Spells, Spellmaking, Enchanting, Training, Repair, Barter, Weapon, Armor, Clothing, Books, Ingredients, Picks, Probes, Lights, Apparatus, RepairItems, Misc, Potions, MagicItems, Travel.
-- @field #list<#TravelDestination> travelDestinations A list of @{#TravelDestination}s for this NPC.
-- @field #boolean isEssential whether the NPC is essential
-- @field #boolean isRespawning whether the NPC respawns after death
---
-- @type TravelDestination