|
|
|
@ -237,7 +237,7 @@ namespace MWScript
|
|
|
|
|
MWWorld::Ptr ptr = R()(runtime);
|
|
|
|
|
|
|
|
|
|
Interpreter::Type_Integer value =
|
|
|
|
|
MWWorld::Class::get (ptr).getNpcStats (ptr).mSkill[mIndex].
|
|
|
|
|
MWWorld::Class::get (ptr).getNpcStats (ptr).getSkill (mIndex).
|
|
|
|
|
getModified();
|
|
|
|
|
|
|
|
|
|
runtime.push (value);
|
|
|
|
@ -260,7 +260,7 @@ namespace MWScript
|
|
|
|
|
Interpreter::Type_Integer value = runtime[0].mInteger;
|
|
|
|
|
runtime.pop();
|
|
|
|
|
|
|
|
|
|
MWWorld::Class::get (ptr).getNpcStats (ptr).mSkill[mIndex].
|
|
|
|
|
MWWorld::Class::get (ptr).getNpcStats (ptr).getSkill (mIndex).
|
|
|
|
|
setModified (value, 0);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
@ -281,10 +281,10 @@ namespace MWScript
|
|
|
|
|
Interpreter::Type_Integer value = runtime[0].mInteger;
|
|
|
|
|
runtime.pop();
|
|
|
|
|
|
|
|
|
|
value += MWWorld::Class::get (ptr).getNpcStats (ptr).mSkill[mIndex].
|
|
|
|
|
value += MWWorld::Class::get (ptr).getNpcStats (ptr).getSkill (mIndex).
|
|
|
|
|
getModified();
|
|
|
|
|
|
|
|
|
|
MWWorld::Class::get (ptr).getNpcStats (ptr).mSkill[mIndex].
|
|
|
|
|
MWWorld::Class::get (ptr).getNpcStats (ptr).getSkill (mIndex).
|
|
|
|
|
setModified (value, 0, 100);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
@ -373,9 +373,9 @@ namespace MWScript
|
|
|
|
|
if(factionID != "")
|
|
|
|
|
{
|
|
|
|
|
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayer().getPlayer();
|
|
|
|
|
if(MWWorld::Class::get(player).getNpcStats(player).mFactionRank.find(factionID) == MWWorld::Class::get(player).getNpcStats(player).mFactionRank.end())
|
|
|
|
|
if(MWWorld::Class::get(player).getNpcStats(player).getFactionRanks().find(factionID) == MWWorld::Class::get(player).getNpcStats(player).getFactionRanks().end())
|
|
|
|
|
{
|
|
|
|
|
MWWorld::Class::get(player).getNpcStats(player).mFactionRank[factionID] = 0;
|
|
|
|
|
MWWorld::Class::get(player).getNpcStats(player).getFactionRanks()[factionID] = 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -402,13 +402,13 @@ namespace MWScript
|
|
|
|
|
if(factionID != "")
|
|
|
|
|
{
|
|
|
|
|
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayer().getPlayer();
|
|
|
|
|
if(MWWorld::Class::get(player).getNpcStats(player).mFactionRank.find(factionID) == MWWorld::Class::get(player).getNpcStats(player).mFactionRank.end())
|
|
|
|
|
if(MWWorld::Class::get(player).getNpcStats(player).getFactionRanks().find(factionID) == MWWorld::Class::get(player).getNpcStats(player).getFactionRanks().end())
|
|
|
|
|
{
|
|
|
|
|
MWWorld::Class::get(player).getNpcStats(player).mFactionRank[factionID] = 0;
|
|
|
|
|
MWWorld::Class::get(player).getNpcStats(player).getFactionRanks()[factionID] = 0;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
MWWorld::Class::get(player).getNpcStats(player).mFactionRank[factionID] = MWWorld::Class::get(player).getNpcStats(player).mFactionRank[factionID] +1;
|
|
|
|
|
MWWorld::Class::get(player).getNpcStats(player).getFactionRanks()[factionID] = MWWorld::Class::get(player).getNpcStats(player).getFactionRanks()[factionID] +1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -435,9 +435,9 @@ namespace MWScript
|
|
|
|
|
if(factionID != "")
|
|
|
|
|
{
|
|
|
|
|
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayer().getPlayer();
|
|
|
|
|
if(MWWorld::Class::get(player).getNpcStats(player).mFactionRank.find(factionID) != MWWorld::Class::get(player).getNpcStats(player).mFactionRank.end())
|
|
|
|
|
if(MWWorld::Class::get(player).getNpcStats(player).getFactionRanks().find(factionID) != MWWorld::Class::get(player).getNpcStats(player).getFactionRanks().end())
|
|
|
|
|
{
|
|
|
|
|
MWWorld::Class::get(player).getNpcStats(player).mFactionRank[factionID] = MWWorld::Class::get(player).getNpcStats(player).mFactionRank[factionID] -1;
|
|
|
|
|
MWWorld::Class::get(player).getNpcStats(player).getFactionRanks()[factionID] = MWWorld::Class::get(player).getNpcStats(player).getFactionRanks()[factionID] -1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -460,22 +460,22 @@ namespace MWScript
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if(MWWorld::Class::get(ptr).getNpcStats(ptr).mFactionRank.empty())
|
|
|
|
|
if(MWWorld::Class::get(ptr).getNpcStats(ptr).getFactionRanks().empty())
|
|
|
|
|
{
|
|
|
|
|
//throw exception?
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
factionID = MWWorld::Class::get(ptr).getNpcStats(ptr).mFactionRank.begin()->first;
|
|
|
|
|
factionID = MWWorld::Class::get(ptr).getNpcStats(ptr).getFactionRanks().begin()->first;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
boost::algorithm::to_lower(factionID);
|
|
|
|
|
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayer().getPlayer();
|
|
|
|
|
if(factionID!="")
|
|
|
|
|
{
|
|
|
|
|
if(MWWorld::Class::get(player).getNpcStats(player).mFactionRank.find(factionID) != MWWorld::Class::get(player).getNpcStats(player).mFactionRank.end())
|
|
|
|
|
if(MWWorld::Class::get(player).getNpcStats(player).getFactionRanks().find(factionID) != MWWorld::Class::get(player).getNpcStats(player).getFactionRanks().end())
|
|
|
|
|
{
|
|
|
|
|
runtime.push(MWWorld::Class::get(player).getNpcStats(player).mFactionRank[factionID]);
|
|
|
|
|
runtime.push(MWWorld::Class::get(player).getNpcStats(player).getFactionRanks()[factionID]);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|