81 lines
2.4 KiB
Plaintext
81 lines
2.4 KiB
Plaintext
void ResetWuss(object oCritter = OBJECT_SELF)
|
|
{
|
|
|
|
SetLocalInt(oCritter, "nWuss", 0);
|
|
ChangeToStandardFaction(oCritter, STANDARD_FACTION_HOSTILE);
|
|
}
|
|
void main()
|
|
|
|
{
|
|
|
|
object oPC = GetLastHostileActor();
|
|
|
|
while (GetIsObjectValid(GetMaster(oPC)))
|
|
{
|
|
oPC=GetMaster(oPC);
|
|
}
|
|
|
|
object oTarget;
|
|
effect eVFX;
|
|
|
|
//object oPC = GetLastHostileActor();//who hit me?
|
|
object oHench = GetHenchman(oPC);
|
|
object oCompanion = GetAssociate(ASSOCIATE_TYPE_ANIMALCOMPANION, oPC);
|
|
object oFamiliar = GetAssociate(ASSOCIATE_TYPE_FAMILIAR, oPC);
|
|
int nHealth = GetCurrentHitPoints(OBJECT_SELF);//how does it feel?
|
|
int nMax = GetMaxHitPoints(OBJECT_SELF);//how did I used to feel?
|
|
float fRatio = IntToFloat(nHealth)/IntToFloat(nMax);
|
|
|
|
//am I half dead, fighting a PC and haven't surrendered before?
|
|
float fTime = 600.0;
|
|
|
|
//change to increase or decrease time to reset nWuss factor set at 10 minutes
|
|
if ((fRatio <= 0.5) && GetIsPC(oPC) && GetLocalInt(OBJECT_SELF,"nWuss") == 0)
|
|
{//make sure I don't <span class="highlight">surrender</span> again
|
|
SetLocalInt(OBJECT_SELF,"nWuss",1);
|
|
|
|
//<span class="highlight">surrender</span>
|
|
SurrenderToEnemies();
|
|
|
|
//change faction so the PC will get more evil if he doesn't show mercy
|
|
ChangeToStandardFaction(OBJECT_SELF, STANDARD_FACTION_COMMONER);
|
|
SetIsTemporaryFriend(oHench, OBJECT_SELF, TRUE, fTime);
|
|
SetIsTemporaryFriend(oCompanion, OBJECT_SELF, TRUE, fTime);
|
|
SetIsTemporaryFriend(oFamiliar, OBJECT_SELF, TRUE, fTime);
|
|
|
|
//go have a chat
|
|
//SurrenderToEnemies();
|
|
ClearAllActions();
|
|
ActionMoveToObject(oPC);
|
|
ActionStartConversation(oPC);
|
|
DelayCommand(fTime, ResetWuss(OBJECT_SELF));
|
|
|
|
object oNPC = OBJECT_SELF;
|
|
AssignCommand(oPC, ClearAllActions(TRUE));
|
|
AssignCommand(oPC, ClearPersonalReputation(oNPC));
|
|
|
|
ClearAllActions(TRUE);
|
|
ClearPersonalReputation(oPC);
|
|
SurrenderToEnemies();
|
|
|
|
ClearAllActions(TRUE);
|
|
AssignCommand(oPC, PlayVoiceChat(VOICE_CHAT_STOP));
|
|
ClearPersonalReputation(oPC);
|
|
|
|
ClearAllActions(TRUE);
|
|
DelayCommand(0.7,AssignCommand(oPC, PlayVoiceChat(VOICE_CHAT_FOLLOWME)));
|
|
ClearPersonalReputation(oPC);
|
|
|
|
// Have "Tulmakiz" say something.
|
|
AssignCommand(GetObjectByTag("Tulmakiz"), SpeakString("Enough! Another time!"));
|
|
|
|
// Destroy an object (not fully effective until this script ends).
|
|
eVFX = EffectVisualEffect(VFX_FNF_SMOKE_PUFF);
|
|
oTarget = GetObjectByTag("Tulmakiz");
|
|
DelayCommand(2.0, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVFX, oTarget));
|
|
DelayCommand(2.0, DestroyObject(oTarget, 3.0));
|
|
|
|
}
|
|
}
|
|
|