Battledale_PRC8/_module/nss/jw_half_mal_usd.nss
Jaysyn904 e5b3f6ad61 Finished PRC8 integration
Finished PRC8 integration.  Moved creature abilities to top hak.  Setup tooling.  Created release archive
2024-03-12 21:27:23 -04:00

137 lines
3.5 KiB
Plaintext

//::///////////////////////////////////////////////
//:: Custom User Defined Event
//:: FileName
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
*/
//:://////////////////////////////////////////////
//:: Created By:
//:: Created On:
//:://////////////////////////////////////////////
#include "jw_custom_spells"
#include "NW_I0_GENERIC"
#include "jw_privates_inc"
#include "prc_inc_racial"
void main()
{
ExecuteScript("prc_npc_userdef", OBJECT_SELF);
int nUser = GetUserDefinedEventNumber();
if(nUser == 1001) //HEARTBEAT
{
if (GetIsInCombat())
{
return;
}
object oFriend=GetLocalObject(OBJECT_SELF,"friend");
if (GetIsObjectValid(oFriend))
{
if (GetLocalObject(oFriend,"friend")!=OBJECT_SELF)
{
SetLocalObject(OBJECT_SELF,"friend",OBJECT_INVALID);
}
}
oFriend=GetLocalObject(OBJECT_SELF,"friend");
if ((!GetIsObjectValid(oFriend)))
{
if (d4()==1)
{
oFriend=GetNearestCreature(CREATURE_TYPE_PERCEPTION,PERCEPTION_SEEN,OBJECT_SELF,1,CREATURE_TYPE_REPUTATION,REPUTATION_TYPE_FRIEND,CREATURE_TYPE_RACIAL_TYPE,RACIAL_TYPE_HALFLING);
SetLocalObject(OBJECT_SELF,"friend",oFriend);
SetLocalObject(oFriend,"friend",OBJECT_SELF);
ClearAllActions();
ActionMoveToObject(oFriend);
AssignCommand(oFriend,SetFacingPoint(GetPosition(OBJECT_SELF)));
SetisCustomEncounterCreature(FALSE);
SetisCustomEncounterCreature(FALSE,oFriend);
}
else
{
if (!GetisCustomEncounterCreature())
{
SetisCustomEncounterCreature(TRUE);
}
}
}
else
{
AssignCommand(oFriend,SetFacingPoint(GetPosition(OBJECT_SELF)));
SetFacingPoint(GetPosition(oFriend));
int nRandom=d12();
switch (nRandom)
{
case 1: PlaySound("vs_favhen4m_cuss"); break; // play the dammit sound
case 2: PlaySound("vs_favhen4m_foll"); break; // play the come on sound
case 3: PlaySound("vs_favhen4m_haha"); break; // play the haha sound
case 4: SpeakString("*Grins manically*"); break;
case 5: SpeakString("Gold? Eh, how much?"); break;
case 6: SpeakString("This one has a pretty sharp blade . . ."); break;
case 7: case 8: case 9: case 10: PlayImmobileAmbientAnimations(); break;
case 11: case 12: SetLocalObject(OBJECT_SELF,"friend",OBJECT_INVALID); SetLocalObject(oFriend,"friend",OBJECT_INVALID); break;
}
}
}
else if(nUser == 1002) // PERCEIVE
{
object oPC=GetLastPerceived();
if ((GetIsPC(oPC))&&(MyPRCGetRacialType(oPC)!=RACIAL_TYPE_HALFLING))
{
SetIsTemporaryEnemy(oPC,OBJECT_SELF,TRUE,600.0);
if (!GetIsFighting(OBJECT_SELF))
{
DetermineCombatRound(oPC);
}
}
}
else if(nUser == 1003) // END OF COMBAT
{
if ((GetLocalInt(OBJECT_SELF,"donegarrote")!=1)&&(GetLevelByClass(CLASS_TYPE_ROGUE,OBJECT_SELF)>1)&&(d3()==1))
{
object oDamager=GetVictim();
if (GetObjectSeen(oDamager))
{
SetFacingPoint(GetPosition(oDamager));
garrote(oDamager, 1);
SetLocalInt(OBJECT_SELF,"donegarrote",1);
}
}
}
else if(nUser == 1004) // ON DIALOGUE
{
}
else if(nUser == 1005) // ATTACKED
{
}
else if(nUser == 1006) // DAMAGED
{
}
else if(nUser == 1007) // DEATH
{
}
else if(nUser == 1008) // DISTURBED
{
}
}