Quest persistence work
Quest persistence work. Added new salamander model.
This commit is contained in:
		
							
								
								
									
										26
									
								
								_module/nss/cv_chk_1000gp.nss
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										26
									
								
								_module/nss/cv_chk_1000gp.nss
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,26 @@
 | 
			
		||||
//::///////////////////////////////////////////////
 | 
			
		||||
//:: cv_chk_1000gp.nss
 | 
			
		||||
//:: Copyright (c) 2022 Project RATDOG
 | 
			
		||||
//:://////////////////////////////////////////////
 | 
			
		||||
/*
 | 
			
		||||
    Checks to see if the PC has 1000gp.
 | 
			
		||||
 | 
			
		||||
*/
 | 
			
		||||
//:://////////////////////////////////////////////
 | 
			
		||||
//:: Created By: Tolen
 | 
			
		||||
//:: Created On: 8/21/2005 4:12:07 PM
 | 
			
		||||
//:://////////////////////////////////////////////
 | 
			
		||||
 | 
			
		||||
int StartingConditional()
 | 
			
		||||
{
 | 
			
		||||
//:: Declare major variables
 | 
			
		||||
    object oPC = GetPCSpeaker();
 | 
			
		||||
    int nGP = GetGold(oPC);
 | 
			
		||||
 | 
			
		||||
//:: Check to see if the PC has 1000 gp.
 | 
			
		||||
    if ( GetGold(oPC) < 1000 )
 | 
			
		||||
        return FALSE;
 | 
			
		||||
 | 
			
		||||
    return TRUE;
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										25
									
								
								_module/nss/cv_chk_lvl10plus.nss
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										25
									
								
								_module/nss/cv_chk_lvl10plus.nss
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,25 @@
 | 
			
		||||
//::///////////////////////////////////////////////
 | 
			
		||||
//:: cv_chk_lvl10plus.nss
 | 
			
		||||
//:: Copyright (c) 2022 Project RATDOG
 | 
			
		||||
//:://////////////////////////////////////////////
 | 
			
		||||
/*
 | 
			
		||||
    Checks to see if the PC is 10th level.
 | 
			
		||||
 | 
			
		||||
*/
 | 
			
		||||
//:://////////////////////////////////////////////
 | 
			
		||||
//:: Created By: Jaysyn
 | 
			
		||||
//:: Created On: 20220703
 | 
			
		||||
//:://////////////////////////////////////////////
 | 
			
		||||
 | 
			
		||||
int StartingConditional()
 | 
			
		||||
{
 | 
			
		||||
//:: Declare major variables
 | 
			
		||||
    object oPC = GetPCSpeaker();
 | 
			
		||||
 | 
			
		||||
//:: The PC's total level must be at least 10.
 | 
			
		||||
    if ( GetHitDice(oPC) < 10 )
 | 
			
		||||
        return FALSE;
 | 
			
		||||
 | 
			
		||||
    return TRUE;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										25
									
								
								_module/nss/cv_chk_lvl15plus.nss
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										25
									
								
								_module/nss/cv_chk_lvl15plus.nss
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,25 @@
 | 
			
		||||
//::///////////////////////////////////////////////
 | 
			
		||||
//:: cv_chk_lvl15plus.nss
 | 
			
		||||
//:: Copyright (c) 2022 Project RATDOG
 | 
			
		||||
//:://////////////////////////////////////////////
 | 
			
		||||
/*
 | 
			
		||||
    Checks to see if the PC is 15th lvl.
 | 
			
		||||
 | 
			
		||||
*/
 | 
			
		||||
//:://////////////////////////////////////////////
 | 
			
		||||
//:: Created By: Jaysyn
 | 
			
		||||
//:: Created On: 20220703
 | 
			
		||||
//:://////////////////////////////////////////////
 | 
			
		||||
 | 
			
		||||
int StartingConditional()
 | 
			
		||||
{
 | 
			
		||||
//:: Declare major variables
 | 
			
		||||
    object oPC = GetPCSpeaker();
 | 
			
		||||
 | 
			
		||||
//:: The PC's total level must be at least 10.
 | 
			
		||||
    if ( GetHitDice(oPC) < 15 )
 | 
			
		||||
        return FALSE;
 | 
			
		||||
 | 
			
		||||
    return TRUE;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										22
									
								
								_module/nss/cv_doppleshift.nss
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										22
									
								
								_module/nss/cv_doppleshift.nss
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,22 @@
 | 
			
		||||
//:://////////////////////////////////////////////
 | 
			
		||||
//:: cv_doppleshift.nss
 | 
			
		||||
//:: Copyright (c) 2022 Project RATDOG
 | 
			
		||||
//:://////////////////////////////////////////////
 | 
			
		||||
/*
 | 
			
		||||
    Changes the NPC's appearance into a
 | 
			
		||||
    doppleganger in conversaion.
 | 
			
		||||
*/
 | 
			
		||||
//:://////////////////////////////////////////////
 | 
			
		||||
//:: Created By: Jaysyn
 | 
			
		||||
//:: Created On: 20220703
 | 
			
		||||
//:://////////////////////////////////////////////
 | 
			
		||||
 | 
			
		||||
void main()
 | 
			
		||||
{
 | 
			
		||||
//:: Declare major variables
 | 
			
		||||
    object oPC = GetPCSpeaker();
 | 
			
		||||
    object oTarget = OBJECT_SELF;
 | 
			
		||||
 | 
			
		||||
//:: Set Appearance to Doppleganger
 | 
			
		||||
    SetCreatureAppearanceType(oTarget, 1215);
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										23
									
								
								_module/nss/cv_party_5k_xp.nss
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										23
									
								
								_module/nss/cv_party_5k_xp.nss
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,23 @@
 | 
			
		||||
//::///////////////////////////////////////////////
 | 
			
		||||
//:: cv_party_5k_xp.nss
 | 
			
		||||
//:: Copyright (c) 2022 Project RATDOG
 | 
			
		||||
//:://////////////////////////////////////////////
 | 
			
		||||
/*
 | 
			
		||||
    Rewards the PC's party with 5000 XP.
 | 
			
		||||
 | 
			
		||||
*/
 | 
			
		||||
//:://////////////////////////////////////////////
 | 
			
		||||
//:: Created By: Tolen
 | 
			
		||||
//:: Created On: 7/30/2005 4:22:02 PM
 | 
			
		||||
//:://////////////////////////////////////////////
 | 
			
		||||
#include "nw_i0_tool"
 | 
			
		||||
 | 
			
		||||
void main()
 | 
			
		||||
{
 | 
			
		||||
//:: Declare major variables
 | 
			
		||||
    object oPC = GetPCSpeaker();
 | 
			
		||||
 | 
			
		||||
//:: Give the PC's party XP.
 | 
			
		||||
    RewardPartyXP(5000, oPC);
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										22
									
								
								_module/nss/cv_take_1000gp.nss
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										22
									
								
								_module/nss/cv_take_1000gp.nss
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,22 @@
 | 
			
		||||
//::///////////////////////////////////////////////
 | 
			
		||||
//:: cv_take_1000gp.nss
 | 
			
		||||
//:: Copyright (c) 2022 Project RATDOG
 | 
			
		||||
//:://////////////////////////////////////////////
 | 
			
		||||
/*
 | 
			
		||||
    Takes 1000 GP from the PC.
 | 
			
		||||
 | 
			
		||||
*/
 | 
			
		||||
//:://////////////////////////////////////////////
 | 
			
		||||
//:: Created By: Tolen
 | 
			
		||||
//:: Created On: 8/28/2005 10:06:04 PM
 | 
			
		||||
//:://////////////////////////////////////////////
 | 
			
		||||
 | 
			
		||||
void main()
 | 
			
		||||
{
 | 
			
		||||
//:: Declare major variables
 | 
			
		||||
    object oPC = GetPCSpeaker();
 | 
			
		||||
 | 
			
		||||
//:: Remove 1000 gold from the PC
 | 
			
		||||
    TakeGoldFromCreature(1000, oPC, FALSE);
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										20
									
								
								_module/nss/cv_take_10k_gp.nss
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										20
									
								
								_module/nss/cv_take_10k_gp.nss
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,20 @@
 | 
			
		||||
//::///////////////////////////////////////////////
 | 
			
		||||
//:: cv_take_10k_gp.nss
 | 
			
		||||
//:: Copyright (c) 2022 Project RATDOG
 | 
			
		||||
//:://////////////////////////////////////////////
 | 
			
		||||
/*
 | 
			
		||||
    Takes 10000 GP from the PC.
 | 
			
		||||
 | 
			
		||||
*/
 | 
			
		||||
//:://////////////////////////////////////////////
 | 
			
		||||
//:: Created By: Tolen
 | 
			
		||||
//:: Created On: 8/18/2005 10:10:27 PM
 | 
			
		||||
//:://////////////////////////////////////////////
 | 
			
		||||
void main()
 | 
			
		||||
{
 | 
			
		||||
//:: Declare major variables
 | 
			
		||||
    object oPC = GetPCSpeaker();
 | 
			
		||||
 | 
			
		||||
//:: Remove 1000 gold from the PC
 | 
			
		||||
    TakeGoldFromCreature(10000, oPC, FALSE);
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										78
									
								
								_module/nss/lycan_userdef.nss
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										78
									
								
								_module/nss/lycan_userdef.nss
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,78 @@
 | 
			
		||||
//::///////////////////////////////////////////////
 | 
			
		||||
//:: lycan_userdef.nss
 | 
			
		||||
//:: Copyright (c) 2022 Project RATDOG
 | 
			
		||||
//:://////////////////////////////////////////////
 | 
			
		||||
/*
 | 
			
		||||
    OnUserDefined scrip for Wererats.
 | 
			
		||||
 | 
			
		||||
*/
 | 
			
		||||
//:://////////////////////////////////////////////
 | 
			
		||||
//:: Created By:  Jaysyn
 | 
			
		||||
//:: Created On:  20220730
 | 
			
		||||
//:://////////////////////////////////////////////
 | 
			
		||||
 | 
			
		||||
const int EVENT_USER_DEFINED_PRESPAWN = 1510;
 | 
			
		||||
const int EVENT_USER_DEFINED_POSTSPAWN = 1511;
 | 
			
		||||
void main()
 | 
			
		||||
{
 | 
			
		||||
// Make sure the were creature has a custom on spawn in with the line Custom User On Attacked being
 | 
			
		||||
// commented in.  This becomes the Userdefined script.
 | 
			
		||||
 | 
			
		||||
    int nUser = GetUserDefinedEventNumber();
 | 
			
		||||
    int nChange = GetLocalInt(OBJECT_SELF,"NW_LYCANTHROPE");
 | 
			
		||||
    effect eShape = EffectPolymorph(POLYMORPH_TYPE_WERERAT); //Use one of the polymorph constants here (WERE_RAT, WERE_WOLF or WERE_CAT)
 | 
			
		||||
    effect eVis = EffectVisualEffect(VFX_FNF_SUMMON_UNDEAD);
 | 
			
		||||
    if(nUser == 1005 && nChange == 0)
 | 
			
		||||
    {
 | 
			
		||||
        DelayCommand(1.0, ApplyEffectToObject(DURATION_TYPE_PERMANENT, eShape, OBJECT_SELF));
 | 
			
		||||
        DelayCommand(1.0, ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eVis, GetLocation(OBJECT_SELF)));
 | 
			
		||||
        SetLocalInt(OBJECT_SELF, "NW_LYCANTHROPE", 1);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if(nUser == EVENT_HEARTBEAT ) //HEARTBEAT
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
    else if(nUser == EVENT_PERCEIVE) // PERCEIVE
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
    else if(nUser == EVENT_END_COMBAT_ROUND) // END OF COMBAT
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
    else if(nUser == EVENT_DIALOGUE) // ON DIALOGUE
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
    else if(nUser == EVENT_ATTACKED) // ATTACKED
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
    else if(nUser == EVENT_DAMAGED) // DAMAGED
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
    else if(nUser == 1007) // DEATH  - do not use for critical code, does not fire reliably all the time
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
    else if(nUser == EVENT_DISTURBED) // DISTURBED
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
    else if (nUser == EVENT_USER_DEFINED_PRESPAWN)
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
    else if (nUser == EVENT_USER_DEFINED_POSTSPAWN)
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
//:: Execute the PRC NPC OnUserDef script
 | 
			
		||||
    ExecuteScript("prc_npc_userdef", OBJECT_SELF);
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										23
									
								
								_module/nss/qst_seals_start.nss
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										23
									
								
								_module/nss/qst_seals_start.nss
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,23 @@
 | 
			
		||||
//::///////////////////////////////////////////////
 | 
			
		||||
//:: qst_seals_start.nss
 | 
			
		||||
//:: Copyright (c) 2022 Project RATDOG
 | 
			
		||||
//:://////////////////////////////////////////////
 | 
			
		||||
/*
 | 
			
		||||
    Start & tracks the "Seven Seals" quest.
 | 
			
		||||
*/
 | 
			
		||||
//:://////////////////////////////////////////////
 | 
			
		||||
//:: Created By:  Jaysyn
 | 
			
		||||
//:: Created On:  20220703
 | 
			
		||||
//:://////////////////////////////////////////////
 | 
			
		||||
 | 
			
		||||
#include "pqj_inc"
 | 
			
		||||
 | 
			
		||||
void main()
 | 
			
		||||
{
 | 
			
		||||
//:: Declare major variables
 | 
			
		||||
    object oPC = GetPCSpeaker();
 | 
			
		||||
 | 
			
		||||
//:: Set quest stage & update DB.
 | 
			
		||||
    AddPersistentJournalQuestEntry("seals", 1, oPC);
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										30
									
								
								_module/nss/qst_slayer_end.nss
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										30
									
								
								_module/nss/qst_slayer_end.nss
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,30 @@
 | 
			
		||||
//::///////////////////////////////////////////////
 | 
			
		||||
//:: qst_slayer_end.nss
 | 
			
		||||
//:: Copyright (c) 2022 Project RATDOG
 | 
			
		||||
//:://////////////////////////////////////////////
 | 
			
		||||
/*
 | 
			
		||||
    Ends "The Orcus-Slayer" quest.
 | 
			
		||||
*/
 | 
			
		||||
//:://////////////////////////////////////////////
 | 
			
		||||
//:: Created By: Tolen
 | 
			
		||||
//:: Created On: 9/2/2005 11:31:01 PM
 | 
			
		||||
//:://////////////////////////////////////////////
 | 
			
		||||
 | 
			
		||||
#include "pqj_inc"
 | 
			
		||||
#include "nw_i0_tool"
 | 
			
		||||
 | 
			
		||||
void main()
 | 
			
		||||
{
 | 
			
		||||
//:: Declare major variables
 | 
			
		||||
    object oPC = GetPCSpeaker();
 | 
			
		||||
 | 
			
		||||
//:: Set quest stage & update DB.
 | 
			
		||||
    AddPersistentJournalQuestEntry("blood", 2, oPC);
 | 
			
		||||
 | 
			
		||||
// Give the PC's party XP
 | 
			
		||||
    RewardPartyXP(2000, oPC);
 | 
			
		||||
 | 
			
		||||
//:: Give the PC Deamonbane
 | 
			
		||||
    CreateItemOnObject("demonbane", oPC, 1);
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										24
									
								
								_module/nss/qst_slayer_start.nss
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										24
									
								
								_module/nss/qst_slayer_start.nss
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,24 @@
 | 
			
		||||
//::///////////////////////////////////////////////
 | 
			
		||||
//:: qst_slayer_st.nss
 | 
			
		||||
//:: Copyright (c) 2022 Project RATDOG
 | 
			
		||||
//:://////////////////////////////////////////////
 | 
			
		||||
/*
 | 
			
		||||
    Starts & tracks "The Orcus-Slayer" quest.
 | 
			
		||||
 | 
			
		||||
*/
 | 
			
		||||
//:://////////////////////////////////////////////
 | 
			
		||||
//:: Created By:  Jaysyn
 | 
			
		||||
//:: Created On:  20220703
 | 
			
		||||
//:://////////////////////////////////////////////
 | 
			
		||||
 | 
			
		||||
#include "pqj_inc"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
void main()
 | 
			
		||||
{
 | 
			
		||||
//:: Declare major variables
 | 
			
		||||
        object oPC = GetPCSpeaker();
 | 
			
		||||
 | 
			
		||||
//:: Set quest stage & update DB.
 | 
			
		||||
        AddPersistentJournalQuestEntry("slayer", 1, oPC);
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										78
									
								
								_module/nss/ra_lycan_userdef.nss
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										78
									
								
								_module/nss/ra_lycan_userdef.nss
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,78 @@
 | 
			
		||||
//::///////////////////////////////////////////////
 | 
			
		||||
//:: ra_lycan_userdef.nss
 | 
			
		||||
//:: Copyright (c) 2022 Project RATDOG
 | 
			
		||||
//:://////////////////////////////////////////////
 | 
			
		||||
/*
 | 
			
		||||
    OnUserDefined scrip for Wererats.
 | 
			
		||||
 | 
			
		||||
*/
 | 
			
		||||
//:://////////////////////////////////////////////
 | 
			
		||||
//:: Created By:  Jaysyn
 | 
			
		||||
//:: Created On:  20220730
 | 
			
		||||
//:://////////////////////////////////////////////
 | 
			
		||||
 | 
			
		||||
const int EVENT_USER_DEFINED_PRESPAWN = 1510;
 | 
			
		||||
const int EVENT_USER_DEFINED_POSTSPAWN = 1511;
 | 
			
		||||
void main()
 | 
			
		||||
{
 | 
			
		||||
// Make sure the were creature has a custom on spawn in with the line Custom User On Attacked being
 | 
			
		||||
// commented in.  This becomes the Userdefined script.
 | 
			
		||||
 | 
			
		||||
    int nUser = GetUserDefinedEventNumber();
 | 
			
		||||
    int nChange = GetLocalInt(OBJECT_SELF,"NW_LYCANTHROPE");
 | 
			
		||||
    effect eShape = EffectPolymorph(POLYMORPH_TYPE_WERERAT); //Use one of the polymorph constants here (WERE_RAT, WERE_WOLF or WERE_CAT)
 | 
			
		||||
    effect eVis = EffectVisualEffect(VFX_FNF_SUMMON_UNDEAD);
 | 
			
		||||
    if(nUser == 1005 && nChange == 0)
 | 
			
		||||
    {
 | 
			
		||||
        DelayCommand(1.0, ApplyEffectToObject(DURATION_TYPE_PERMANENT, eShape, OBJECT_SELF));
 | 
			
		||||
        DelayCommand(1.0, ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eVis, GetLocation(OBJECT_SELF)));
 | 
			
		||||
        SetLocalInt(OBJECT_SELF, "NW_LYCANTHROPE", 1);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if(nUser == EVENT_HEARTBEAT ) //HEARTBEAT
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
    else if(nUser == EVENT_PERCEIVE) // PERCEIVE
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
    else if(nUser == EVENT_END_COMBAT_ROUND) // END OF COMBAT
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
    else if(nUser == EVENT_DIALOGUE) // ON DIALOGUE
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
    else if(nUser == EVENT_ATTACKED) // ATTACKED
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
    else if(nUser == EVENT_DAMAGED) // DAMAGED
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
    else if(nUser == 1007) // DEATH  - do not use for critical code, does not fire reliably all the time
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
    else if(nUser == EVENT_DISTURBED) // DISTURBED
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
    else if (nUser == EVENT_USER_DEFINED_PRESPAWN)
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
    else if (nUser == EVENT_USER_DEFINED_POSTSPAWN)
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
//:: Execute the PRC NPC OnUserDef script
 | 
			
		||||
    ExecuteScript("prc_npc_userdef", OBJECT_SELF);
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										96
									
								
								_module/nss/wererat_onspawn.nss
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										96
									
								
								_module/nss/wererat_onspawn.nss
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,96 @@
 | 
			
		||||
//::///////////////////////////////////////////////
 | 
			
		||||
//:: wererat_onspawn.nss
 | 
			
		||||
//:: Copyright (c) 2022 Project RATDOG
 | 
			
		||||
//:://////////////////////////////////////////////
 | 
			
		||||
/*
 | 
			
		||||
    OnSpawn event script for wererats.
 | 
			
		||||
 | 
			
		||||
*/
 | 
			
		||||
//:://////////////////////////////////////////////
 | 
			
		||||
//:: Created By:  Jaysyn
 | 
			
		||||
//:: Created On:  20220703
 | 
			
		||||
//:://////////////////////////////////////////////
 | 
			
		||||
 | 
			
		||||
const int EVENT_USER_DEFINED_PRESPAWN = 1510;
 | 
			
		||||
const int EVENT_USER_DEFINED_POSTSPAWN = 1511;
 | 
			
		||||
 | 
			
		||||
#include "j_inc_spawnin"
 | 
			
		||||
#include "ms_name_inc"
 | 
			
		||||
#include "rnd_commoner_inc"
 | 
			
		||||
 | 
			
		||||
void main()
 | 
			
		||||
{
 | 
			
		||||
    string sTag;
 | 
			
		||||
    object oNPC;
 | 
			
		||||
    // User defined OnSpawn event requested?
 | 
			
		||||
    int nSpecEvent = GetLocalInt(OBJECT_SELF,"X2_USERDEFINED_ONSPAWN_EVENTS");
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    // Pre Spawn Event requested
 | 
			
		||||
    if (nSpecEvent == 1  || nSpecEvent == 3  )
 | 
			
		||||
    {
 | 
			
		||||
    SignalEvent(OBJECT_SELF,EventUserDefined(EVENT_USER_DEFINED_PRESPAWN ));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    SetAIInteger(AI_INTELLIGENCE, 10);
 | 
			
		||||
        // This is the intelligence of the creature 1-10. Default to 10
 | 
			
		||||
        // Read the file in "Explainations" about this intelligence for more info.
 | 
			
		||||
 | 
			
		||||
    SetSpawnInCondition(AI_FLAG_FLEEING_FEARLESS, AI_TARGETING_FLEE_MASTER);
 | 
			
		||||
        // Fearless
 | 
			
		||||
 | 
			
		||||
    SetSpawnInCondition(AI_FLAG_OTHER_DONT_RESPOND_TO_EMOTES, AI_OTHER_MASTER);
 | 
			
		||||
        // This will ignore ALL chat by ENEMIES who speak in Stars - IE
 | 
			
		||||
        // "*Nods*" will be ignored, while "Nods" will not, nor "*Nods"
 | 
			
		||||
 | 
			
		||||
    SetSpawnInCondition(AI_FLAG_UDE_ATTACK_EVENT, AI_UDE_MASTER);
 | 
			
		||||
 | 
			
		||||
    // AI Behaviour. DO NOT CHANGE! DO NOT CHANGE!!!
 | 
			
		||||
    AI_SetUpEndOfSpawn();
 | 
			
		||||
        // This MUST be called. It fires these events:
 | 
			
		||||
        // SetUpSpells, SetUpSkillToUse, SetListeningPatterns, SetWeapons, AdvancedAuras.
 | 
			
		||||
        // These MUST be called! the AI might fail to work correctly if they don't fire!
 | 
			
		||||
 | 
			
		||||
    // Example (and default) of user addition:
 | 
			
		||||
    // - If we are from an encounter, set mobile (move around) animations.
 | 
			
		||||
    if(GetIsEncounterCreature())
 | 
			
		||||
    {
 | 
			
		||||
        SetSpawnInCondition(NW_FLAG_AMBIENT_ANIMATIONS, NW_GENERIC_MASTER);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
// Check for randomizations.
 | 
			
		||||
 | 
			
		||||
    ms_Nomenclature(OBJECT_SELF);
 | 
			
		||||
 | 
			
		||||
    int nKeepskin = GetLocalInt(OBJECT_SELF,"RA_KEEPSKIN");
 | 
			
		||||
        if (nKeepskin != 1)
 | 
			
		||||
            {
 | 
			
		||||
                rnd_skin(OBJECT_SELF);
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
    rnd_skin(OBJECT_SELF);
 | 
			
		||||
 | 
			
		||||
    int nKeephead = GetLocalInt(OBJECT_SELF,"RA_KEEPHEAD");
 | 
			
		||||
        if (nKeephead != 1)
 | 
			
		||||
            {
 | 
			
		||||
                rnd_head(OBJECT_SELF);
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
    int nKeeptats = GetLocalInt(OBJECT_SELF,"RA_KEEPTATS");
 | 
			
		||||
        if (nKeeptats != 1)
 | 
			
		||||
            {
 | 
			
		||||
                rnd_tattoo(OBJECT_SELF);
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    // Execute default OnSpawn script.
 | 
			
		||||
    ExecuteScript("nw_c2_default9", OBJECT_SELF);
 | 
			
		||||
 | 
			
		||||
    // Execute PRC OnSpawn script.
 | 
			
		||||
    ExecuteScript("prc_npc_spawn", OBJECT_SELF);
 | 
			
		||||
 | 
			
		||||
    // Note: You shouldn't really remove this. Also performs hiding ETC.
 | 
			
		||||
    DelayCommand(2.0f, SpawnWalkWayPoints());
 | 
			
		||||
        // Delayed walk waypoints, as to not upset instant combat spawning.
 | 
			
		||||
        // This will also check if to change to day/night posts during the walking, no heartbeats.
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										78
									
								
								_module/nss/wererat_userdef.nss
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										78
									
								
								_module/nss/wererat_userdef.nss
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,78 @@
 | 
			
		||||
//::///////////////////////////////////////////////
 | 
			
		||||
//:: wererat_userdef.nss
 | 
			
		||||
//:: Copyright (c) 2022 Project RATDOG
 | 
			
		||||
//:://////////////////////////////////////////////
 | 
			
		||||
/*
 | 
			
		||||
    OnUserDefined scrip for Wererats.
 | 
			
		||||
 | 
			
		||||
*/
 | 
			
		||||
//:://////////////////////////////////////////////
 | 
			
		||||
//:: Created By:  Jaysyn
 | 
			
		||||
//:: Created On:  20220730
 | 
			
		||||
//:://////////////////////////////////////////////
 | 
			
		||||
 | 
			
		||||
const int EVENT_USER_DEFINED_PRESPAWN = 1510;
 | 
			
		||||
const int EVENT_USER_DEFINED_POSTSPAWN = 1511;
 | 
			
		||||
void main()
 | 
			
		||||
{
 | 
			
		||||
// Make sure the were creature has a custom on spawn in with the line Custom User On Attacked being
 | 
			
		||||
// commented in.  This becomes the Userdefined script.
 | 
			
		||||
 | 
			
		||||
    int nUser = GetUserDefinedEventNumber();
 | 
			
		||||
    int nChange = GetLocalInt(OBJECT_SELF,"NW_LYCANTHROPE");
 | 
			
		||||
    effect eShape = EffectPolymorph(POLYMORPH_TYPE_WERERAT); //Use one of the polymorph constants here (WERE_RAT, WERE_WOLF or WERE_CAT)
 | 
			
		||||
    effect eVis = EffectVisualEffect(VFX_FNF_SUMMON_UNDEAD);
 | 
			
		||||
    if(nUser == 1005 && nChange == 0)
 | 
			
		||||
    {
 | 
			
		||||
        DelayCommand(1.0, ApplyEffectToObject(DURATION_TYPE_PERMANENT, eShape, OBJECT_SELF));
 | 
			
		||||
        DelayCommand(1.0, ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eVis, GetLocation(OBJECT_SELF)));
 | 
			
		||||
        SetLocalInt(OBJECT_SELF, "NW_LYCANTHROPE", 1);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if(nUser == EVENT_HEARTBEAT ) //HEARTBEAT
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
    else if(nUser == EVENT_PERCEIVE) // PERCEIVE
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
    else if(nUser == EVENT_END_COMBAT_ROUND) // END OF COMBAT
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
    else if(nUser == EVENT_DIALOGUE) // ON DIALOGUE
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
    else if(nUser == EVENT_ATTACKED) // ATTACKED
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
    else if(nUser == EVENT_DAMAGED) // DAMAGED
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
    else if(nUser == 1007) // DEATH  - do not use for critical code, does not fire reliably all the time
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
    else if(nUser == EVENT_DISTURBED) // DISTURBED
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
    else if (nUser == EVENT_USER_DEFINED_PRESPAWN)
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
    else if (nUser == EVENT_USER_DEFINED_POSTSPAWN)
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
//:: Execute the PRC NPC OnUserDef script
 | 
			
		||||
    ExecuteScript("prc_npc_userdef", OBJECT_SELF);
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user