92 lines
4.5 KiB
Plaintext
92 lines
4.5 KiB
Plaintext
//::///////////////////////////////////////////////
|
|
//:: Name x2_def_ondeath
|
|
//:: Copyright (c) 2001 Bioware Corp.
|
|
//:://////////////////////////////////////////////
|
|
/*
|
|
Default OnDeath script
|
|
*/
|
|
//:://////////////////////////////////////////////
|
|
//:: Created By: Keith Warner
|
|
//:: Created On: June 11/03
|
|
//:://////////////////////////////////////////////
|
|
#include "quest_inc"
|
|
void Ressurect(effect eEffect)
|
|
{
|
|
ApplyEffectToObject(DURATION_TYPE_INSTANT, eEffect, OBJECT_SELF);
|
|
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectHeal(GetMaxHitPoints()), OBJECT_SELF);
|
|
SetIsDestroyable(FALSE, FALSE, FALSE);
|
|
}
|
|
|
|
void main()
|
|
{
|
|
//Defeat in a friendly duel
|
|
if (GetLocalInt(OBJECT_SELF, "Adventurer") == TRUE && GetLocalInt(OBJECT_SELF, "Duel") == TRUE && GetLocalInt(OBJECT_SELF, "DuelOver") == FALSE)
|
|
{
|
|
effect eEffect = GetFirstEffect(OBJECT_SELF);
|
|
while (GetIsEffectValid(eEffect))
|
|
{
|
|
if (GetEffectType(eEffect) == EFFECT_TYPE_PETRIFY) RemoveEffect(OBJECT_SELF, eEffect);
|
|
eEffect = GetNextEffect(OBJECT_SELF);
|
|
}
|
|
SetIsDestroyable(FALSE, TRUE, FALSE);
|
|
eEffect = SupernaturalEffect(EffectResurrection());
|
|
DelayCommand(3.0, Ressurect(eEffect));
|
|
SetPlotFlag(OBJECT_SELF, TRUE);
|
|
object oObject = GetFirstObjectInArea(GetArea(OBJECT_SELF));
|
|
object oPC;
|
|
while (GetIsObjectValid(oObject))
|
|
{
|
|
SetImmortal(oObject, FALSE);
|
|
ClearPersonalReputation(oObject);
|
|
AssignCommand(oObject, ClearAllActions());
|
|
oObject = GetNextObjectInArea(GetArea(OBJECT_SELF));
|
|
}
|
|
SetLocalInt(OBJECT_SELF, "Defeat", TRUE);
|
|
SetLocalInt(OBJECT_SELF, "DuelOver", TRUE);
|
|
DeleteLocalInt(GetArea(OBJECT_SELF), "Duel");
|
|
return;
|
|
}
|
|
|
|
if (GetLocalInt(OBJECT_SELF, "Dead") == TRUE) return;
|
|
SetLocalInt(OBJECT_SELF, "Dead", TRUE);
|
|
|
|
//Death of a famous adventurer
|
|
if (GetLocalInt(OBJECT_SELF, "Adventurer") == TRUE)
|
|
{
|
|
object oKiller = GetLastKiller();
|
|
if (GetAlignmentGoodEvil(OBJECT_SELF) != ALIGNMENT_EVIL) AdjustAlignment(oKiller, ALIGNMENT_EVIL, 5, FALSE);
|
|
GiveGoldToCreature(OBJECT_SELF, Random(10000)+10000);
|
|
object oItem = GetFirstItemInInventory();
|
|
while (GetIsObjectValid(oItem))
|
|
{
|
|
if (GetTag(oItem) == "NW_IT_GOLD001") SetDroppableFlag(oItem, TRUE);
|
|
oItem = GetNextItemInInventory();
|
|
}
|
|
DeleteAdventurerNPC(GetLocalInt(OBJECT_SELF, "nPosition"));
|
|
}
|
|
|
|
if ((GetLocalInt(OBJECT_SELF, "Quest_Target") == TRUE || GetCampaignString(CharacterDB(GetLocalObject(OBJECT_SELF, "oPC")), "QUEST_EXTRA2") == "mustkill") && GetIsQuestComplete(GetLocalObject(OBJECT_SELF, "oPC")) == FALSE && GetIsQuestFailed(GetLocalObject(OBJECT_SELF, "oPC")) == FALSE)
|
|
{
|
|
if (GetLocalInt(OBJECT_SELF, "KidnapTarget") == TRUE)
|
|
{
|
|
AddRandomQuestJournalEntry(GetLocalObject(OBJECT_SELF, "oPC"), 3);
|
|
}
|
|
else
|
|
{
|
|
AddRandomQuestJournalEntry(GetLocalObject(OBJECT_SELF, "oPC"), 2);
|
|
if (GetCampaignString(CharacterDB(GetLocalObject(OBJECT_SELF, "oPC")), "QUEST_EXTRA") == "stealring") CreateItemOnObject("quest_stolenring", GetLocalObject(OBJECT_SELF, "oPC"));
|
|
else if (GetCampaignString(CharacterDB(GetLocalObject(OBJECT_SELF, "oPC")), "QUEST_EXTRA") == "stealamulet") CreateItemOnObject("quest_stolenamul", GetLocalObject(OBJECT_SELF, "oPC"));
|
|
else if (GetCampaignString(CharacterDB(GetLocalObject(OBJECT_SELF, "oPC")), "QUEST_EXTRA") == "stealsphere") CreateItemOnObject("quest_stolenart1", GetLocalObject(OBJECT_SELF, "oPC"));
|
|
else if (GetCampaignString(CharacterDB(GetLocalObject(OBJECT_SELF, "oPC")), "QUEST_EXTRA") == "stealdisc") CreateItemOnObject("quest_stolenart2", GetLocalObject(OBJECT_SELF, "oPC"));
|
|
else if (GetCampaignString(CharacterDB(GetLocalObject(OBJECT_SELF, "oPC")), "QUEST_EXTRA") == "stealhand") CreateItemOnObject("quest_stolenart3", GetLocalObject(OBJECT_SELF, "oPC"));
|
|
else CreateItemOnObject("quest_proof_"+GetCampaignString(CharacterDB(GetLocalObject(OBJECT_SELF, "oPC")), "QUEST_EXTRA2"), GetLocalObject(OBJECT_SELF, "oPC"));
|
|
}
|
|
}
|
|
|
|
DeleteLocalInt(GetArea(OBJECT_SELF), "NO_ESCAPE");
|
|
DeleteStoredNPC(GetLocalString(OBJECT_SELF, "sOwner"), GetLocalInt(OBJECT_SELF, "nPosition"));
|
|
|
|
if(GetLocalInt(OBJECT_SELF, "X4_VANILLA_AI") == TRUE) ExecuteScript("nw_c2_default7_v", OBJECT_SELF);
|
|
else ExecuteScript("nw_c2_default7", OBJECT_SELF);
|
|
}
|