added missing disposition script instructions

actorid
Marc Zinnschlag 12 years ago
parent 8aa1fd921b
commit c621a9f7e4

@ -207,5 +207,9 @@ op 0x20001a0: ShowMap
op 0x20001a1: FillMap
op 0x20001a2: WakeUpPc
op 0x20001a3: GetDeadCount
opcodes 0x20001a4-0x3ffffff unused
op 0x20001a4: SetDisposition
op 0x20001a5: SetDisposition, Explicit
op 0x20001a6: GetDisposition
op 0x20001a7: GetDisposition, Explicit
opcodes 0x20001a8-0x3ffffff unused

@ -608,6 +608,35 @@ namespace MWScript
(MWWorld::Class::get (ptr).getNpcStats (ptr).getBaseDisposition() + value);
}
};
template<class R>
class OpSetDisposition : public Interpreter::Opcode0
{
public:
virtual void execute (Interpreter::Runtime& runtime)
{
MWWorld::Ptr ptr = R()(runtime);
Interpreter::Type_Integer value = runtime[0].mInteger;
runtime.pop();
MWWorld::Class::get (ptr).getNpcStats (ptr).setBaseDisposition (value);
}
};
template<class R>
class OpGetDisposition : public Interpreter::Opcode0
{
public:
virtual void execute (Interpreter::Runtime& runtime)
{
MWWorld::Ptr ptr = R()(runtime);
runtime.push (MWWorld::Class::get (ptr).getNpcStats (ptr).getBaseDisposition());
}
};
class OpGetDeadCount : public Interpreter::Opcode0
{
@ -666,6 +695,10 @@ namespace MWScript
const int opcodeGetPCRankExplicit = 0x2000f;
const int opcodeModDisposition = 0x200014d;
const int opcodeModDispositionExplicit = 0x200014e;
const int opcodeSetDisposition = 0x20001a4;
const int opcodeSetDispositionExplicit = 0x20001a5;
const int opcodeGetDisposition = 0x20001a6;
const int opcodeGetDispositionExplicit = 0x20001a7;
const int opcodeGetLevel = 0x200018c;
const int opcodeGetLevelExplicit = 0x200018d;
@ -753,8 +786,12 @@ namespace MWScript
extensions.registerInstruction("pcraiserank","/S",opcodePCRaiseRank);
extensions.registerInstruction("pclowerrank","/S",opcodePCLowerRank);
extensions.registerInstruction("pcjoinfaction","/S",opcodePCJoinFaction);
extensions.registerInstruction("moddisposition","l",opcodeModDisposition,
extensions.registerInstruction ("moddisposition","l",opcodeModDisposition,
opcodeModDispositionExplicit);
extensions.registerInstruction ("setdisposition","l",opcodeSetDisposition,
opcodeSetDispositionExplicit);
extensions.registerFunction ("getdisposition",'l', "",opcodeGetDisposition,
opcodeGetDispositionExplicit);
extensions.registerFunction("getpcrank",'l',"/S",opcodeGetPCRank,opcodeGetPCRankExplicit);
extensions.registerInstruction("setlevel", "l", opcodeSetLevel, opcodeSetLevelExplicit);
@ -828,11 +865,16 @@ namespace MWScript
interpreter.installSegment3(opcodePCRaiseRank,new OpPCRaiseRank);
interpreter.installSegment3(opcodePCLowerRank,new OpPCLowerRank);
interpreter.installSegment3(opcodePCJoinFaction,new OpPCJoinFaction);
interpreter.installSegment5(opcodeModDisposition,new OpModDisposition<ImplicitRef>);
interpreter.installSegment5(opcodeModDispositionExplicit,new OpModDisposition<ExplicitRef>);
interpreter.installSegment3(opcodeGetPCRank,new OpGetPCRank<ImplicitRef>);
interpreter.installSegment3(opcodeGetPCRankExplicit,new OpGetPCRank<ExplicitRef>);
interpreter.installSegment5(opcodeModDisposition,new OpModDisposition<ImplicitRef>);
interpreter.installSegment5(opcodeModDispositionExplicit,new OpModDisposition<ExplicitRef>);
interpreter.installSegment5(opcodeSetDisposition,new OpSetDisposition<ImplicitRef>);
interpreter.installSegment5(opcodeSetDispositionExplicit,new OpSetDisposition<ExplicitRef>);
interpreter.installSegment5(opcodeGetDisposition,new OpGetDisposition<ImplicitRef>);
interpreter.installSegment5(opcodeGetDispositionExplicit,new OpGetDisposition<ExplicitRef>);
interpreter.installSegment5 (opcodeGetLevel, new OpGetLevel<ImplicitRef>);
interpreter.installSegment5 (opcodeGetLevelExplicit, new OpGetLevel<ExplicitRef>);
interpreter.installSegment5 (opcodeSetLevel, new OpSetLevel<ImplicitRef>);

Loading…
Cancel
Save