|
|
|
@ -11,6 +11,9 @@
|
|
|
|
|
#include "../mwbase/dialoguemanager.hpp"
|
|
|
|
|
#include "../mwbase/journal.hpp"
|
|
|
|
|
|
|
|
|
|
#include "../mwworld/class.hpp"
|
|
|
|
|
#include "../mwmechanics/npcstats.hpp"
|
|
|
|
|
|
|
|
|
|
#include "interpretercontext.hpp"
|
|
|
|
|
#include "ref.hpp"
|
|
|
|
|
|
|
|
|
@ -126,6 +129,37 @@ namespace MWScript
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
template<class R>
|
|
|
|
|
class OpModReputation : 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).setReputation (MWWorld::Class::get(ptr).getNpcStats (ptr).getReputation () + value);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
template<class R>
|
|
|
|
|
class OpSetReputation : 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).setReputation (value);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const int opcodeJournal = 0x2000133;
|
|
|
|
|
const int opcodeSetJournalIndex = 0x2000134;
|
|
|
|
|
const int opcodeGetJournalIndex = 0x2000135;
|
|
|
|
@ -134,6 +168,10 @@ namespace MWScript
|
|
|
|
|
const int opcodeForceGreeting = 0x200014f;
|
|
|
|
|
const int opcodeForceGreetingExplicit = 0x2000150;
|
|
|
|
|
const int opcodeGoodbye = 0x2000152;
|
|
|
|
|
const int opcodeSetReputation = 0x20001ad;
|
|
|
|
|
const int opcodeModReputation = 0x20001ae;
|
|
|
|
|
const int opcodeSetReputationExplicit = 0x20001af;
|
|
|
|
|
const int opcodeModReputationExplicit = 0x20001b0;
|
|
|
|
|
|
|
|
|
|
void registerExtensions (Compiler::Extensions& extensions)
|
|
|
|
|
{
|
|
|
|
@ -146,6 +184,10 @@ namespace MWScript
|
|
|
|
|
extensions.registerInstruction("forcegreeting","",opcodeForceGreeting,
|
|
|
|
|
opcodeForceGreetingExplicit);
|
|
|
|
|
extensions.registerInstruction("goodbye", "", opcodeGoodbye);
|
|
|
|
|
extensions.registerInstruction("setreputation", "l", opcodeSetReputation,
|
|
|
|
|
opcodeSetReputationExplicit);
|
|
|
|
|
extensions.registerInstruction("modreputation", "l", opcodeModReputation,
|
|
|
|
|
opcodeModReputationExplicit);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void installOpcodes (Interpreter::Interpreter& interpreter)
|
|
|
|
@ -158,6 +200,10 @@ namespace MWScript
|
|
|
|
|
interpreter.installSegment5 (opcodeForceGreeting, new OpForceGreeting<ImplicitRef>);
|
|
|
|
|
interpreter.installSegment5 (opcodeForceGreetingExplicit, new OpForceGreeting<ExplicitRef>);
|
|
|
|
|
interpreter.installSegment5 (opcodeGoodbye, new OpGoodbye);
|
|
|
|
|
interpreter.installSegment5 (opcodeSetReputation, new OpSetReputation<ImplicitRef>);
|
|
|
|
|
interpreter.installSegment5 (opcodeModReputation, new OpModReputation<ImplicitRef>);
|
|
|
|
|
interpreter.installSegment5 (opcodeSetReputationExplicit, new OpSetReputation<ExplicitRef>);
|
|
|
|
|
interpreter.installSegment5 (opcodeModReputationExplicit, new OpModReputation<ExplicitRef>);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|