generated from Jaysyn/ModuleTemplate
Initial Commit
Initial Commit.
This commit is contained in:
150
_module/nss/nwdefault7_alqst.nss
Normal file
150
_module/nss/nwdefault7_alqst.nss
Normal file
@@ -0,0 +1,150 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// // //
|
||||
// Lootable Corpses: OnDeath script // VERSION 3.3 //
|
||||
// // //
|
||||
// Modified by Scrotok on 9 Feb 03 ////////////////////////////
|
||||
// Thanks to Keron Blackfeld for 99% of the work! //
|
||||
// email Questions and Comments to: jnbplatte@intellisys.net //
|
||||
// //
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// //
|
||||
// CAUTION: You MUST re-save/compile (F7 key) "nw_c2_default7" whenever //
|
||||
// "_kb_loot_corpse" is modified! //
|
||||
// //
|
||||
// NEWBIES: You don't need to place this script anywhere -- it's already //
|
||||
// taken care of for you (this script IS the default OnDeath script for all //
|
||||
// creatures). //
|
||||
// //
|
||||
// This script works in conjunction with the "_kb_loot_corpse" script. //
|
||||
// Place this script in the OnDeath event for any creature you want to be //
|
||||
// lootable after death. //
|
||||
// //
|
||||
// This script is only slightly modified from the Bioware default. Two //
|
||||
// lines of code have been added - they are noted below. //
|
||||
// //
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Default:On Death
|
||||
//:: NW_C2_DEFAULT7
|
||||
//:: Copyright (c) 2001 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
Shouts to allies that they have been killed
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Preston Watamaniuk
|
||||
//:: Created On: Oct 25, 2001
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
#include "NW_I0_GENERIC"
|
||||
|
||||
// The following line has been added to support Scrotok's Lootable Corpses script
|
||||
#include "_kb_loot_corpse"
|
||||
|
||||
void main()
|
||||
{
|
||||
ExecuteScript("prc_npc_death", OBJECT_SELF);
|
||||
ExecuteScript("prc_pwondeath", OBJECT_SELF);
|
||||
|
||||
|
||||
|
||||
object oPC = GetLastKiller();
|
||||
|
||||
while (GetIsObjectValid(GetMaster(oPC)))
|
||||
{
|
||||
oPC=GetMaster(oPC);
|
||||
}
|
||||
|
||||
if (!GetIsPC(oPC)) return;
|
||||
|
||||
int nInt;
|
||||
nInt=GetLocalInt(oPC, "NW_JOURNAL_ENTRYalain");
|
||||
|
||||
if (nInt < 1)
|
||||
return;
|
||||
|
||||
AddJournalQuestEntry("alain", 2, oPC, TRUE, FALSE, FALSE);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
int nClass = GetLevelByClass(CLASS_TYPE_COMMONER);
|
||||
int nAlign = GetAlignmentGoodEvil(OBJECT_SELF);
|
||||
if(nClass > 0 && (nAlign == ALIGNMENT_GOOD || nAlign == ALIGNMENT_NEUTRAL))
|
||||
{
|
||||
object oKiller = GetLastKiller();
|
||||
AdjustAlignment(oKiller, ALIGNMENT_EVIL, 5);
|
||||
}
|
||||
|
||||
SpeakString("NW_I_AM_DEAD", TALKVOLUME_SILENT_TALK);
|
||||
//Shout Attack my target, only works with the On Spawn In setup
|
||||
SpeakString("NW_ATTACK_MY_TARGET", TALKVOLUME_SILENT_TALK);
|
||||
if(GetSpawnInCondition(NW_FLAG_DEATH_EVENT))
|
||||
{
|
||||
SignalEvent(OBJECT_SELF, EventUserDefined(1007));
|
||||
}
|
||||
|
||||
//This line has been added to support Scrotok's Lootable Corpses script
|
||||
LeaveCorpse();
|
||||
|
||||
//FOF: Sparks a RETREAT_CHECK among allies upon death via
|
||||
//a shout.
|
||||
if (GetLocalInt(OBJECT_SELF,"FIGHT_OR_FLIGHT") == 1 && GetLocalInt(OBJECT_SELF,"RETREATED") == 0)
|
||||
{
|
||||
//The int is to help make sure dead creatures lying on
|
||||
//the ground are not counted toward f_OurCR.
|
||||
SetLocalInt(OBJECT_SELF,"FOF_DEAD",1);
|
||||
SpeakString("RETREAT_CHECK",TALKVOLUME_SILENT_TALK);
|
||||
}
|
||||
|
||||
if(GetSpawnInCondition(NW_FLAG_DEATH_EVENT))
|
||||
{
|
||||
SignalEvent(OBJECT_SELF, EventUserDefined(1007));
|
||||
//FOF: Sparks a RETREAT_CHECK among allies upon death via
|
||||
//a shout.
|
||||
if (GetLocalInt(OBJECT_SELF,"FIGHT_OR_FLIGHT") == 1 && GetLocalInt(OBJECT_SELF,"RETREATED") == 0)
|
||||
{
|
||||
//The int is to help make sure dead creatures lying on
|
||||
//the ground are not counted toward f_OurCR.
|
||||
SetLocalInt(OBJECT_SELF,"FOF_DEAD",1);
|
||||
SpeakString("RETREAT_CHECK",TALKVOLUME_SILENT_TALK);
|
||||
}
|
||||
|
||||
if(GetSpawnInCondition(NW_FLAG_DEATH_EVENT))
|
||||
{
|
||||
SignalEvent(OBJECT_SELF, EventUserDefined(1007));
|
||||
|
||||
/* Script generated by
|
||||
Lilac Soul's NWN Script Generator, v. 2.3
|
||||
|
||||
For download info, please visit:
|
||||
http://nwvault.ign.com/View.php?view=Other.Detail&id=4683&id=625 */
|
||||
|
||||
//Put this script OnDeath
|
||||
|
||||
{
|
||||
|
||||
object oPC = GetLastKiller();
|
||||
|
||||
while (GetIsObjectValid(GetMaster(oPC)))
|
||||
{
|
||||
oPC=GetMaster(oPC);
|
||||
}
|
||||
|
||||
if (!GetIsPC(oPC)) return;
|
||||
|
||||
int nInt;
|
||||
nInt=GetLocalInt(oPC, "NW_JOURNAL_ENTRYalain");
|
||||
|
||||
if (nInt < 1)
|
||||
return;
|
||||
|
||||
AddJournalQuestEntry("alain", 2, oPC, TRUE, FALSE);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}}
|
||||
Reference in New Issue
Block a user