|
|
|
@ -31,7 +31,7 @@ namespace
|
|
|
|
|
{
|
|
|
|
|
std::string getDialogueActorFaction(MWWorld::Ptr actor)
|
|
|
|
|
{
|
|
|
|
|
const MWMechanics::NpcStats &stats = MWWorld::Class::get (actor).getNpcStats (actor);
|
|
|
|
|
const MWMechanics::NpcStats &stats = actor.getClass().getNpcStats (actor);
|
|
|
|
|
|
|
|
|
|
if (stats.getFactionRanks().empty())
|
|
|
|
|
throw std::runtime_error (
|
|
|
|
@ -55,7 +55,7 @@ namespace MWScript
|
|
|
|
|
MWWorld::Ptr ptr = R()(runtime);
|
|
|
|
|
|
|
|
|
|
Interpreter::Type_Integer value =
|
|
|
|
|
MWWorld::Class::get (ptr)
|
|
|
|
|
ptr.getClass()
|
|
|
|
|
.getCreatureStats (ptr)
|
|
|
|
|
.getLevel();
|
|
|
|
|
|
|
|
|
@ -75,7 +75,7 @@ namespace MWScript
|
|
|
|
|
Interpreter::Type_Integer value = runtime[0].mInteger;
|
|
|
|
|
runtime.pop();
|
|
|
|
|
|
|
|
|
|
MWWorld::Class::get (ptr)
|
|
|
|
|
ptr.getClass()
|
|
|
|
|
.getCreatureStats (ptr)
|
|
|
|
|
.setLevel(value);
|
|
|
|
|
}
|
|
|
|
@ -95,7 +95,7 @@ namespace MWScript
|
|
|
|
|
MWWorld::Ptr ptr = R()(runtime);
|
|
|
|
|
|
|
|
|
|
Interpreter::Type_Integer value =
|
|
|
|
|
MWWorld::Class::get (ptr)
|
|
|
|
|
ptr.getClass()
|
|
|
|
|
.getCreatureStats (ptr)
|
|
|
|
|
.getAttribute(mIndex)
|
|
|
|
|
.getModified();
|
|
|
|
@ -142,7 +142,7 @@ namespace MWScript
|
|
|
|
|
Interpreter::Type_Integer value = runtime[0].mInteger;
|
|
|
|
|
runtime.pop();
|
|
|
|
|
|
|
|
|
|
MWMechanics::AttributeValue attribute = MWWorld::Class::get(ptr)
|
|
|
|
|
MWMechanics::AttributeValue attribute = ptr.getClass()
|
|
|
|
|
.getCreatureStats(ptr)
|
|
|
|
|
.getAttribute(mIndex);
|
|
|
|
|
|
|
|
|
@ -165,13 +165,13 @@ namespace MWScript
|
|
|
|
|
MWWorld::Ptr ptr = R()(runtime);
|
|
|
|
|
Interpreter::Type_Float value;
|
|
|
|
|
|
|
|
|
|
if (mIndex==0 && MWWorld::Class::get (ptr).hasItemHealth (ptr))
|
|
|
|
|
if (mIndex==0 && ptr.getClass().hasItemHealth (ptr))
|
|
|
|
|
{
|
|
|
|
|
// health is a special case
|
|
|
|
|
value = MWWorld::Class::get (ptr).getItemMaxHealth (ptr);
|
|
|
|
|
value = ptr.getClass().getItemMaxHealth (ptr);
|
|
|
|
|
} else {
|
|
|
|
|
value =
|
|
|
|
|
MWWorld::Class::get(ptr)
|
|
|
|
|
ptr.getClass()
|
|
|
|
|
.getCreatureStats(ptr)
|
|
|
|
|
.getDynamic(mIndex)
|
|
|
|
|
.getCurrent();
|
|
|
|
@ -196,13 +196,13 @@ namespace MWScript
|
|
|
|
|
Interpreter::Type_Float value = runtime[0].mFloat;
|
|
|
|
|
runtime.pop();
|
|
|
|
|
|
|
|
|
|
MWMechanics::DynamicStat<float> stat (MWWorld::Class::get (ptr).getCreatureStats (ptr)
|
|
|
|
|
MWMechanics::DynamicStat<float> stat (ptr.getClass().getCreatureStats (ptr)
|
|
|
|
|
.getDynamic (mIndex));
|
|
|
|
|
|
|
|
|
|
stat.setModified (value, 0);
|
|
|
|
|
stat.setCurrent(value);
|
|
|
|
|
|
|
|
|
|
MWWorld::Class::get (ptr).getCreatureStats (ptr).setDynamic (mIndex, stat);
|
|
|
|
|
ptr.getClass().getCreatureStats (ptr).setDynamic (mIndex, stat);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
@ -222,18 +222,18 @@ namespace MWScript
|
|
|
|
|
Interpreter::Type_Float diff = runtime[0].mFloat;
|
|
|
|
|
runtime.pop();
|
|
|
|
|
|
|
|
|
|
MWMechanics::CreatureStats& stats = MWWorld::Class::get (ptr).getCreatureStats (ptr);
|
|
|
|
|
MWMechanics::CreatureStats& stats = ptr.getClass().getCreatureStats (ptr);
|
|
|
|
|
|
|
|
|
|
Interpreter::Type_Float current = stats.getDynamic(mIndex).getCurrent();
|
|
|
|
|
|
|
|
|
|
MWMechanics::DynamicStat<float> stat (MWWorld::Class::get (ptr).getCreatureStats (ptr)
|
|
|
|
|
MWMechanics::DynamicStat<float> stat (ptr.getClass().getCreatureStats (ptr)
|
|
|
|
|
.getDynamic (mIndex));
|
|
|
|
|
|
|
|
|
|
stat.setModified (diff + stat.getModified(), 0);
|
|
|
|
|
|
|
|
|
|
stat.setCurrent (diff + current);
|
|
|
|
|
|
|
|
|
|
MWWorld::Class::get (ptr).getCreatureStats (ptr).setDynamic (mIndex, stat);
|
|
|
|
|
ptr.getClass().getCreatureStats (ptr).setDynamic (mIndex, stat);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
@ -253,16 +253,16 @@ namespace MWScript
|
|
|
|
|
Interpreter::Type_Float diff = runtime[0].mFloat;
|
|
|
|
|
runtime.pop();
|
|
|
|
|
|
|
|
|
|
MWMechanics::CreatureStats& stats = MWWorld::Class::get (ptr).getCreatureStats (ptr);
|
|
|
|
|
MWMechanics::CreatureStats& stats = ptr.getClass().getCreatureStats (ptr);
|
|
|
|
|
|
|
|
|
|
Interpreter::Type_Float current = stats.getDynamic(mIndex).getCurrent();
|
|
|
|
|
|
|
|
|
|
MWMechanics::DynamicStat<float> stat (MWWorld::Class::get (ptr).getCreatureStats (ptr)
|
|
|
|
|
MWMechanics::DynamicStat<float> stat (ptr.getClass().getCreatureStats (ptr)
|
|
|
|
|
.getDynamic (mIndex));
|
|
|
|
|
|
|
|
|
|
stat.setCurrent (diff + current);
|
|
|
|
|
|
|
|
|
|
MWWorld::Class::get (ptr).getCreatureStats (ptr).setDynamic (mIndex, stat);
|
|
|
|
|
ptr.getClass().getCreatureStats (ptr).setDynamic (mIndex, stat);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
@ -279,7 +279,7 @@ namespace MWScript
|
|
|
|
|
{
|
|
|
|
|
MWWorld::Ptr ptr = R()(runtime);
|
|
|
|
|
|
|
|
|
|
MWMechanics::CreatureStats& stats = MWWorld::Class::get (ptr).getCreatureStats (ptr);
|
|
|
|
|
MWMechanics::CreatureStats& stats = ptr.getClass().getCreatureStats (ptr);
|
|
|
|
|
|
|
|
|
|
Interpreter::Type_Float value = 0;
|
|
|
|
|
|
|
|
|
@ -327,7 +327,7 @@ namespace MWScript
|
|
|
|
|
Interpreter::Type_Integer value = runtime[0].mInteger;
|
|
|
|
|
runtime.pop();
|
|
|
|
|
|
|
|
|
|
MWMechanics::NpcStats& stats = MWWorld::Class::get (ptr).getNpcStats (ptr);
|
|
|
|
|
MWMechanics::NpcStats& stats = ptr.getClass().getNpcStats (ptr);
|
|
|
|
|
|
|
|
|
|
MWWorld::LiveCellRef<ESM::NPC> *ref = ptr.get<ESM::NPC>();
|
|
|
|
|
|
|
|
|
@ -386,7 +386,7 @@ namespace MWScript
|
|
|
|
|
{
|
|
|
|
|
MWBase::World *world = MWBase::Environment::get().getWorld();
|
|
|
|
|
MWWorld::Ptr player = world->getPlayerPtr();
|
|
|
|
|
runtime.push (static_cast <Interpreter::Type_Float> (MWWorld::Class::get (player).getNpcStats (player).getBounty()));
|
|
|
|
|
runtime.push (static_cast <Interpreter::Type_Float> (player.getClass().getNpcStats (player).getBounty()));
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
@ -399,7 +399,7 @@ namespace MWScript
|
|
|
|
|
MWBase::World *world = MWBase::Environment::get().getWorld();
|
|
|
|
|
MWWorld::Ptr player = world->getPlayerPtr();
|
|
|
|
|
|
|
|
|
|
MWWorld::Class::get (player).getNpcStats (player).setBounty(runtime[0].mFloat);
|
|
|
|
|
player.getClass().getNpcStats (player).setBounty(runtime[0].mFloat);
|
|
|
|
|
runtime.pop();
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
@ -413,7 +413,7 @@ namespace MWScript
|
|
|
|
|
MWBase::World *world = MWBase::Environment::get().getWorld();
|
|
|
|
|
MWWorld::Ptr player = world->getPlayerPtr();
|
|
|
|
|
|
|
|
|
|
MWWorld::Class::get (player).getNpcStats (player).setBounty(runtime[0].mFloat + MWWorld::Class::get (player).getNpcStats (player).getBounty());
|
|
|
|
|
player.getClass().getNpcStats (player).setBounty(runtime[0].mFloat + player.getClass().getNpcStats (player).getBounty());
|
|
|
|
|
runtime.pop();
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
@ -433,7 +433,7 @@ namespace MWScript
|
|
|
|
|
// make sure a spell with this ID actually exists.
|
|
|
|
|
MWBase::Environment::get().getWorld()->getStore().get<ESM::Spell>().find (id);
|
|
|
|
|
|
|
|
|
|
MWWorld::Class::get (ptr).getCreatureStats (ptr).getSpells().add (id);
|
|
|
|
|
ptr.getClass().getCreatureStats (ptr).getSpells().add (id);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
@ -449,7 +449,7 @@ namespace MWScript
|
|
|
|
|
std::string id = runtime.getStringLiteral (runtime[0].mInteger);
|
|
|
|
|
runtime.pop();
|
|
|
|
|
|
|
|
|
|
MWWorld::Class::get (ptr).getCreatureStats (ptr).getSpells().remove (id);
|
|
|
|
|
ptr.getClass().getCreatureStats (ptr).getSpells().remove (id);
|
|
|
|
|
|
|
|
|
|
MWBase::WindowManager *wm = MWBase::Environment::get().getWindowManager();
|
|
|
|
|
|
|
|
|
@ -473,7 +473,7 @@ namespace MWScript
|
|
|
|
|
std::string spellid = runtime.getStringLiteral (runtime[0].mInteger);
|
|
|
|
|
runtime.pop();
|
|
|
|
|
|
|
|
|
|
MWWorld::Class::get (ptr).getCreatureStats (ptr).getActiveSpells().removeEffects(spellid);
|
|
|
|
|
ptr.getClass().getCreatureStats (ptr).getActiveSpells().removeEffects(spellid);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
@ -489,7 +489,7 @@ namespace MWScript
|
|
|
|
|
Interpreter::Type_Integer effectId = runtime[0].mInteger;
|
|
|
|
|
runtime.pop();
|
|
|
|
|
|
|
|
|
|
MWWorld::Class::get (ptr).getCreatureStats (ptr).getActiveSpells().purgeEffect(effectId);
|
|
|
|
|
ptr.getClass().getCreatureStats (ptr).getActiveSpells().purgeEffect(effectId);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
@ -509,8 +509,8 @@ namespace MWScript
|
|
|
|
|
Interpreter::Type_Integer value = 0;
|
|
|
|
|
|
|
|
|
|
for (MWMechanics::Spells::TIterator iter (
|
|
|
|
|
MWWorld::Class::get (ptr).getCreatureStats (ptr).getSpells().begin());
|
|
|
|
|
iter!=MWWorld::Class::get (ptr).getCreatureStats (ptr).getSpells().end(); ++iter)
|
|
|
|
|
ptr.getClass().getCreatureStats (ptr).getSpells().begin());
|
|
|
|
|
iter!=ptr.getClass().getCreatureStats (ptr).getSpells().end(); ++iter)
|
|
|
|
|
if (iter->first==id)
|
|
|
|
|
{
|
|
|
|
|
value = 1;
|
|
|
|
@ -544,9 +544,9 @@ namespace MWScript
|
|
|
|
|
if(factionID != "")
|
|
|
|
|
{
|
|
|
|
|
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
|
|
|
|
if(MWWorld::Class::get(player).getNpcStats(player).getFactionRanks().find(factionID) == MWWorld::Class::get(player).getNpcStats(player).getFactionRanks().end())
|
|
|
|
|
if(player.getClass().getNpcStats(player).getFactionRanks().find(factionID) == player.getClass().getNpcStats(player).getFactionRanks().end())
|
|
|
|
|
{
|
|
|
|
|
MWWorld::Class::get(player).getNpcStats(player).getFactionRanks()[factionID] = 0;
|
|
|
|
|
player.getClass().getNpcStats(player).getFactionRanks()[factionID] = 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -575,13 +575,13 @@ namespace MWScript
|
|
|
|
|
if(factionID != "")
|
|
|
|
|
{
|
|
|
|
|
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
|
|
|
|
if(MWWorld::Class::get(player).getNpcStats(player).getFactionRanks().find(factionID) == MWWorld::Class::get(player).getNpcStats(player).getFactionRanks().end())
|
|
|
|
|
if(player.getClass().getNpcStats(player).getFactionRanks().find(factionID) == player.getClass().getNpcStats(player).getFactionRanks().end())
|
|
|
|
|
{
|
|
|
|
|
MWWorld::Class::get(player).getNpcStats(player).getFactionRanks()[factionID] = 0;
|
|
|
|
|
player.getClass().getNpcStats(player).getFactionRanks()[factionID] = 0;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
MWWorld::Class::get(player).getNpcStats(player).getFactionRanks()[factionID] = MWWorld::Class::get(player).getNpcStats(player).getFactionRanks()[factionID] +1;
|
|
|
|
|
player.getClass().getNpcStats(player).getFactionRanks()[factionID] = player.getClass().getNpcStats(player).getFactionRanks()[factionID] +1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -610,9 +610,9 @@ namespace MWScript
|
|
|
|
|
if(factionID != "")
|
|
|
|
|
{
|
|
|
|
|
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
|
|
|
|
if(MWWorld::Class::get(player).getNpcStats(player).getFactionRanks().find(factionID) != MWWorld::Class::get(player).getNpcStats(player).getFactionRanks().end())
|
|
|
|
|
if(player.getClass().getNpcStats(player).getFactionRanks().find(factionID) != player.getClass().getNpcStats(player).getFactionRanks().end())
|
|
|
|
|
{
|
|
|
|
|
MWWorld::Class::get(player).getNpcStats(player).getFactionRanks()[factionID] = MWWorld::Class::get(player).getNpcStats(player).getFactionRanks()[factionID] -1;
|
|
|
|
|
player.getClass().getNpcStats(player).getFactionRanks()[factionID] = player.getClass().getNpcStats(player).getFactionRanks()[factionID] -1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -635,22 +635,22 @@ namespace MWScript
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if(MWWorld::Class::get(ptr).getNpcStats(ptr).getFactionRanks().empty())
|
|
|
|
|
if(ptr.getClass().getNpcStats(ptr).getFactionRanks().empty())
|
|
|
|
|
{
|
|
|
|
|
factionID = "";
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
factionID = MWWorld::Class::get(ptr).getNpcStats(ptr).getFactionRanks().begin()->first;
|
|
|
|
|
factionID = ptr.getClass().getNpcStats(ptr).getFactionRanks().begin()->first;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
::Misc::StringUtils::toLower(factionID);
|
|
|
|
|
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
|
|
|
|
if(factionID!="")
|
|
|
|
|
{
|
|
|
|
|
if(MWWorld::Class::get(player).getNpcStats(player).getFactionRanks().find(factionID) != MWWorld::Class::get(player).getNpcStats(player).getFactionRanks().end())
|
|
|
|
|
if(player.getClass().getNpcStats(player).getFactionRanks().find(factionID) != player.getClass().getNpcStats(player).getFactionRanks().end())
|
|
|
|
|
{
|
|
|
|
|
runtime.push(MWWorld::Class::get(player).getNpcStats(player).getFactionRanks()[factionID]);
|
|
|
|
|
runtime.push(player.getClass().getNpcStats(player).getFactionRanks()[factionID]);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
@ -676,8 +676,8 @@ namespace MWScript
|
|
|
|
|
Interpreter::Type_Integer value = runtime[0].mInteger;
|
|
|
|
|
runtime.pop();
|
|
|
|
|
|
|
|
|
|
MWWorld::Class::get (ptr).getNpcStats (ptr).setBaseDisposition
|
|
|
|
|
(MWWorld::Class::get (ptr).getNpcStats (ptr).getBaseDisposition() + value);
|
|
|
|
|
ptr.getClass().getNpcStats (ptr).setBaseDisposition
|
|
|
|
|
(ptr.getClass().getNpcStats (ptr).getBaseDisposition() + value);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
@ -693,7 +693,7 @@ namespace MWScript
|
|
|
|
|
Interpreter::Type_Integer value = runtime[0].mInteger;
|
|
|
|
|
runtime.pop();
|
|
|
|
|
|
|
|
|
|
MWWorld::Class::get (ptr).getNpcStats (ptr).setBaseDisposition (value);
|
|
|
|
|
ptr.getClass().getNpcStats (ptr).setBaseDisposition (value);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
@ -739,8 +739,8 @@ namespace MWScript
|
|
|
|
|
{
|
|
|
|
|
MWWorld::Ptr ptr = R()(runtime);
|
|
|
|
|
|
|
|
|
|
if (!MWWorld::Class::get (ptr).getNpcStats (ptr).getFactionRanks().empty())
|
|
|
|
|
factionId = MWWorld::Class::get (ptr).getNpcStats (ptr).getFactionRanks().begin()->first;
|
|
|
|
|
if (!ptr.getClass().getNpcStats (ptr).getFactionRanks().empty())
|
|
|
|
|
factionId = ptr.getClass().getNpcStats (ptr).getFactionRanks().begin()->first;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (factionId.empty())
|
|
|
|
@ -750,7 +750,7 @@ namespace MWScript
|
|
|
|
|
|
|
|
|
|
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
|
|
|
|
runtime.push (
|
|
|
|
|
MWWorld::Class::get (player).getNpcStats (player).getFactionReputation (factionId));
|
|
|
|
|
player.getClass().getNpcStats (player).getFactionReputation (factionId));
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
@ -775,8 +775,8 @@ namespace MWScript
|
|
|
|
|
{
|
|
|
|
|
MWWorld::Ptr ptr = R()(runtime);
|
|
|
|
|
|
|
|
|
|
if (!MWWorld::Class::get (ptr).getNpcStats (ptr).getFactionRanks().empty())
|
|
|
|
|
factionId = MWWorld::Class::get (ptr).getNpcStats (ptr).getFactionRanks().begin()->first;
|
|
|
|
|
if (!ptr.getClass().getNpcStats (ptr).getFactionRanks().empty())
|
|
|
|
|
factionId = ptr.getClass().getNpcStats (ptr).getFactionRanks().begin()->first;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (factionId.empty())
|
|
|
|
@ -785,7 +785,7 @@ namespace MWScript
|
|
|
|
|
::Misc::StringUtils::toLower (factionId);
|
|
|
|
|
|
|
|
|
|
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
|
|
|
|
MWWorld::Class::get (player).getNpcStats (player).setFactionReputation (factionId, value);
|
|
|
|
|
player.getClass().getNpcStats (player).setFactionReputation (factionId, value);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
@ -810,8 +810,8 @@ namespace MWScript
|
|
|
|
|
{
|
|
|
|
|
MWWorld::Ptr ptr = R()(runtime);
|
|
|
|
|
|
|
|
|
|
if (!MWWorld::Class::get (ptr).getNpcStats (ptr).getFactionRanks().empty())
|
|
|
|
|
factionId = MWWorld::Class::get (ptr).getNpcStats (ptr).getFactionRanks().begin()->first;
|
|
|
|
|
if (!ptr.getClass().getNpcStats (ptr).getFactionRanks().empty())
|
|
|
|
|
factionId = ptr.getClass().getNpcStats (ptr).getFactionRanks().begin()->first;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (factionId.empty())
|
|
|
|
@ -820,8 +820,8 @@ namespace MWScript
|
|
|
|
|
::Misc::StringUtils::toLower (factionId);
|
|
|
|
|
|
|
|
|
|
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
|
|
|
|
MWWorld::Class::get (player).getNpcStats (player).setFactionReputation (factionId,
|
|
|
|
|
MWWorld::Class::get (player).getNpcStats (player).getFactionReputation (factionId)+
|
|
|
|
|
player.getClass().getNpcStats (player).setFactionReputation (factionId,
|
|
|
|
|
player.getClass().getNpcStats (player).getFactionReputation (factionId)+
|
|
|
|
|
value);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
@ -835,7 +835,7 @@ namespace MWScript
|
|
|
|
|
{
|
|
|
|
|
MWWorld::Ptr ptr = R()(runtime);
|
|
|
|
|
|
|
|
|
|
runtime.push (MWWorld::Class::get (ptr).getCreatureStats (ptr).hasCommonDisease());
|
|
|
|
|
runtime.push (ptr.getClass().getCreatureStats (ptr).hasCommonDisease());
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
@ -848,7 +848,7 @@ namespace MWScript
|
|
|
|
|
{
|
|
|
|
|
MWWorld::Ptr ptr = R()(runtime);
|
|
|
|
|
|
|
|
|
|
runtime.push (MWWorld::Class::get (ptr).getCreatureStats (ptr).hasBlightDisease());
|
|
|
|
|
runtime.push (ptr.getClass().getCreatureStats (ptr).hasBlightDisease());
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
@ -880,7 +880,7 @@ namespace MWScript
|
|
|
|
|
{
|
|
|
|
|
MWWorld::Ptr ptr = MWBase::Environment::get().getWorld ()->getPlayerPtr();
|
|
|
|
|
|
|
|
|
|
runtime.push (MWWorld::Class::get(ptr).getNpcStats (ptr).getWerewolfKills ());
|
|
|
|
|
runtime.push (ptr.getClass().getNpcStats (ptr).getWerewolfKills ());
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
@ -901,13 +901,13 @@ namespace MWScript
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if(MWWorld::Class::get(ptr).getNpcStats(ptr).getFactionRanks().empty())
|
|
|
|
|
if(ptr.getClass().getNpcStats(ptr).getFactionRanks().empty())
|
|
|
|
|
{
|
|
|
|
|
factionID = "";
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
factionID = MWWorld::Class::get(ptr).getNpcStats(ptr).getFactionRanks().begin()->first;
|
|
|
|
|
factionID = ptr.getClass().getNpcStats(ptr).getFactionRanks().begin()->first;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
::Misc::StringUtils::toLower(factionID);
|
|
|
|
@ -939,13 +939,13 @@ namespace MWScript
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
MWWorld::Ptr ptr = R()(runtime);
|
|
|
|
|
if(MWWorld::Class::get(ptr).getNpcStats(ptr).getFactionRanks().empty())
|
|
|
|
|
if(ptr.getClass().getNpcStats(ptr).getFactionRanks().empty())
|
|
|
|
|
{
|
|
|
|
|
factionID = "";
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
factionID = MWWorld::Class::get(ptr).getNpcStats(ptr).getFactionRanks().begin()->first;
|
|
|
|
|
factionID = ptr.getClass().getNpcStats(ptr).getFactionRanks().begin()->first;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
|
|
|
@ -972,13 +972,13 @@ namespace MWScript
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
MWWorld::Ptr ptr = R()(runtime);
|
|
|
|
|
if(MWWorld::Class::get(ptr).getNpcStats(ptr).getFactionRanks().empty())
|
|
|
|
|
if(ptr.getClass().getNpcStats(ptr).getFactionRanks().empty())
|
|
|
|
|
{
|
|
|
|
|
factionID = "";
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
factionID = MWWorld::Class::get(ptr).getNpcStats(ptr).getFactionRanks().begin()->first;
|
|
|
|
|
factionID = ptr.getClass().getNpcStats(ptr).getFactionRanks().begin()->first;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
|
|
|
@ -997,11 +997,11 @@ namespace MWScript
|
|
|
|
|
MWWorld::Ptr ptr = R()(runtime);
|
|
|
|
|
|
|
|
|
|
std::string factionID = "";
|
|
|
|
|
if(MWWorld::Class::get(ptr).getNpcStats(ptr).getFactionRanks().empty())
|
|
|
|
|
if(ptr.getClass().getNpcStats(ptr).getFactionRanks().empty())
|
|
|
|
|
return;
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
factionID = MWWorld::Class::get(ptr).getNpcStats(ptr).getFactionRanks().begin()->first;
|
|
|
|
|
factionID = ptr.getClass().getNpcStats(ptr).getFactionRanks().begin()->first;
|
|
|
|
|
}
|
|
|
|
|
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
|
|
|
|
|
|
|
|
@ -1009,7 +1009,7 @@ namespace MWScript
|
|
|
|
|
if (ptr == player)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
std::map<std::string, int>& ranks = MWWorld::Class::get(ptr).getNpcStats(ptr).getFactionRanks ();
|
|
|
|
|
std::map<std::string, int>& ranks = ptr.getClass().getNpcStats(ptr).getFactionRanks ();
|
|
|
|
|
ranks[factionID] = ranks[factionID]+1;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
@ -1024,11 +1024,11 @@ namespace MWScript
|
|
|
|
|
MWWorld::Ptr ptr = R()(runtime);
|
|
|
|
|
|
|
|
|
|
std::string factionID = "";
|
|
|
|
|
if(MWWorld::Class::get(ptr).getNpcStats(ptr).getFactionRanks().empty())
|
|
|
|
|
if(ptr.getClass().getNpcStats(ptr).getFactionRanks().empty())
|
|
|
|
|
return;
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
factionID = MWWorld::Class::get(ptr).getNpcStats(ptr).getFactionRanks().begin()->first;
|
|
|
|
|
factionID = ptr.getClass().getNpcStats(ptr).getFactionRanks().begin()->first;
|
|
|
|
|
}
|
|
|
|
|
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
|
|
|
|
|
|
|
|
@ -1036,7 +1036,7 @@ namespace MWScript
|
|
|
|
|
if (ptr == player)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
std::map<std::string, int>& ranks = MWWorld::Class::get(ptr).getNpcStats(ptr).getFactionRanks ();
|
|
|
|
|
std::map<std::string, int>& ranks = ptr.getClass().getNpcStats(ptr).getFactionRanks ();
|
|
|
|
|
ranks[factionID] = ranks[factionID]-1;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
@ -1051,10 +1051,10 @@ namespace MWScript
|
|
|
|
|
MWWorld::Ptr ptr = R()(runtime);
|
|
|
|
|
|
|
|
|
|
Interpreter::Type_Integer value =
|
|
|
|
|
MWWorld::Class::get (ptr).getCreatureStats (ptr).hasDied();
|
|
|
|
|
ptr.getClass().getCreatureStats (ptr).hasDied();
|
|
|
|
|
|
|
|
|
|
if (value)
|
|
|
|
|
MWWorld::Class::get (ptr).getCreatureStats (ptr).clearHasDied();
|
|
|
|
|
ptr.getClass().getCreatureStats (ptr).clearHasDied();
|
|
|
|
|
|
|
|
|
|
runtime.push (value);
|
|
|
|
|
}
|
|
|
|
@ -1070,7 +1070,7 @@ namespace MWScript
|
|
|
|
|
MWWorld::Ptr ptr = R()(runtime);
|
|
|
|
|
|
|
|
|
|
Interpreter::Type_Integer value =
|
|
|
|
|
MWWorld::Class::get (ptr).getCreatureStats (ptr).getKnockedDownOneFrame();
|
|
|
|
|
ptr.getClass().getCreatureStats (ptr).getKnockedDownOneFrame();
|
|
|
|
|
|
|
|
|
|
runtime.push (value);
|
|
|
|
|
}
|
|
|
|
@ -1084,7 +1084,7 @@ namespace MWScript
|
|
|
|
|
virtual void execute (Interpreter::Runtime& runtime)
|
|
|
|
|
{
|
|
|
|
|
MWWorld::Ptr ptr = R()(runtime);
|
|
|
|
|
runtime.push(MWWorld::Class::get(ptr).getNpcStats(ptr).isWerewolf());
|
|
|
|
|
runtime.push(ptr.getClass().getNpcStats(ptr).isWerewolf());
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|