Battledale_PRC8/_module/nss/jw_malar_used.nss
Jaysyn904 7b9e44ebbb Initial upload
Initial upload.  PRC8 has been added.  Module compiles, PRC's default AI & treasure scripts have been integrated.  Started work on top hak for SLA / Ability / Scripting modifications.
2024-03-11 23:44:08 -04:00

125 lines
2.2 KiB
Plaintext

//::///////////////////////////////////////////////
//:: Custom User Defined Event
//:: FileName
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
*/
//:://////////////////////////////////////////////
//:: Created By:
//:: Created On:
//:://////////////////////////////////////////////
void main()
{
int nUser = GetUserDefinedEventNumber();
int nRandom;
if(nUser == 1001) //HEARTBEAT
{
if (!GetIsInCombat(OBJECT_SELF))
{
nRandom=Random(5)+1;
switch (nRandom)
{
case 1:
ActionRandomWalk();
break;
case 2:
ActionMoveToObject(GetNearestObjectByTag("jw_malar_beast"));
break;
case 3:
ActionMoveToObject(GetNearestObjectByTag("jw_malar_wp"));
break;
case 4:
ActionRandomWalk();
break;
case 5:
ActionMoveToObject(GetNearestObjectByTag("jw_malar_beast",OBJECT_SELF,2));
break;
}
}
}
else if(nUser == 1002) // PERCEIVE
{
object oSeen=GetLastPerceived();
if (GetLastPerceptionSeen())
{
if (GetIsPC(oSeen))
{
int iDC = 8+GetWillSavingThrow(OBJECT_SELF);
int iBonus = GetSkillRank(SKILL_ANIMAL_EMPATHY, oSeen);
int nTotal=d20() + iBonus;
if ((nTotal >= iDC)&&(GetHasSkill(SKILL_ANIMAL_EMPATHY,oSeen))&&(!GetIsInCombat(OBJECT_SELF)))
{
ClearAllActions();
SetFacingPoint(GetPosition(oSeen));
ActionPlayAnimation(ANIMATION_FIREFORGET_BOW);
PlayVoiceChat(VOICE_CHAT_SELECTED);
}
else
{
SetIsTemporaryEnemy(oSeen,OBJECT_SELF,TRUE,300.0);
PlayVoiceChat(VOICE_CHAT_THREATEN);
if (!GetIsInCombat(OBJECT_SELF))
{
ActionAttack(oSeen);
}
}
}
}
}
else if(nUser == 1003) // END OF COMBAT
{
}
else if(nUser == 1004) // ON DIALOGUE
{
}
else if(nUser == 1005) // ATTACKED
{
}
else if(nUser == 1006) // DAMAGED
{
}
else if(nUser == 1007) // DEATH
{
int nIdx;
for (nIdx=1;nIdx<=2;nIdx++)
{
if (Random(2)==1)
{
CreateItemOnObject("jw_meat",OBJECT_SELF);
}
}
}
else if(nUser == 1008) // DISTURBED
{
}
}