Merge branch 'record_gold' into 'master'

Add baseGold to NPC and creature lua records

See merge request OpenMW/openmw!3369
macos_ci_fix
psi29a 1 year ago
commit 516108691d

@ -47,5 +47,6 @@ namespace MWLua
[](const ESM::Creature& rec) -> std::string { return rec.mOriginal.serializeText(); });
record["soulValue"] = sol::readonly_property([](const ESM::Creature& rec) -> int { return rec.mData.mSoul; });
record["type"] = sol::readonly_property([](const ESM::Creature& rec) -> int { return rec.mData.mType; });
record["baseGold"] = sol::readonly_property([](const ESM::Creature& rec) -> int { return rec.mData.mGold; });
}
}

@ -44,6 +44,7 @@ namespace MWLua
record["head"]
= sol::readonly_property([](const ESM::NPC& rec) -> std::string { return rec.mHead.serializeText(); });
record["isMale"] = sol::readonly_property([](const ESM::NPC& rec) -> bool { return rec.isMale(); });
record["baseGold"] = sol::readonly_property([](const ESM::NPC& rec) -> int { return rec.mNpdt.mGold; });
// This function is game-specific, in future we should replace it with something more universal.
npc["isWerewolf"] = [](const Object& o) {

@ -688,6 +688,7 @@
-- @field #string mwscript
-- @field #number soulValue The soul value of the creature record
-- @field #number type The @{#Creature.TYPE} of the creature
-- @field #number baseGold The base barter gold of the creature
--- @{#NPC} functions
@ -727,6 +728,7 @@
-- @field #string mwscript MWScript that is attached to this NPC
-- @field #string hair Path to the hair body part model
-- @field #string head Path to the head body part model
-- @field #number baseGold The base barter gold of the NPC
-- @field #bool isMale The gender setting of the NPC

Loading…
Cancel
Save