//:://///////////////////////////////////////////// //:: Custom User Defined Event //:: FileName //:: Copyright (c) 2001 Bioware Corp. //::////////////////////////////////////////////// /* */ //::////////////////////////////////////////////// //:: Created By: //:: Created On: //::////////////////////////////////////////////// int GetFactionEmpskill (object oPC); void main() { int nUser = GetUserDefinedEventNumber(); if (GetIsPC(GetMaster(OBJECT_SELF))) { return; } if(nUser == 1001) //HEARTBEAT { } else if(nUser == 1002) // PERCEIVE { object oSeen=GetLastPerceived(); if (GetLastPerceptionSeen()) { if ((GetIsPC(oSeen))&&(!GetIsDM(oSeen))) { int iDC = 8+GetWillSavingThrow(OBJECT_SELF); int iBonus = GetSkillRank(SKILL_ANIMAL_EMPATHY, oSeen); int nD20= d20(); int nTotal=nD20 + iBonus; int nFactionskill; if ((nTotal >= iDC)&&(GetHasSkill(SKILL_ANIMAL_EMPATHY,oSeen))&&(!GetIsInCombat(OBJECT_SELF))) { ClearAllActions(); SetFacingPoint(GetPosition(oSeen)); ActionPlayAnimation(ANIMATION_FIREFORGET_BOW); PlayVoiceChat(VOICE_CHAT_SELECTED); return; } else { nFactionskill=GetFactionEmpskill(oSeen); if (nFactionskill>0) { nTotal=(nD20/2) + GetFactionEmpskill(oSeen); if ((nTotal >= iDC)&&(!GetIsInCombat(OBJECT_SELF))) { ClearAllActions(); SetFacingPoint(GetPosition(oSeen)); return; } } 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 nDice = d3(1); if(nDice == 1) { CreateItemOnObject("by_WinterwolfHide", OBJECT_SELF); } } else if(nUser == 1008) // DISTURBED { } } int GetFactionEmpskill (object oPC) { int nSkill; int nNumber=0; object oTestsubject=GetFirstFactionMember(oPC); while (GetIsObjectValid(oTestsubject)) { if (GetObjectSeen(oTestsubject)) { nNumber=nNumber+1; nSkill=nSkill+GetSkillRank(SKILL_ANIMAL_EMPATHY,oTestsubject); } oTestsubject=GetNextFactionMember(oPC); } if (nSkill<1||nNumber<1) { return 0; } return nSkill/nNumber; }