2025/09/06 Update
Fixed damaged baseitems.2da Updated PEPS. Full compile.
This commit is contained in:
@@ -115,7 +115,7 @@ void ai_Philos_SetStealth(object oMaster, object oCreature, string sAssociateTyp
|
||||
// Button action for giving commands to associates.
|
||||
void ai_DoCommand(object oPC, object oAssociate, int nCommand);
|
||||
// Button action to have associate do an action based on the target via OnPlayer Target event.
|
||||
void ai_Action(object oPC, object oAssociate);
|
||||
void ai_Action(object oPC, object oAssociate, int bPCAI = FALSE);
|
||||
// Toggles between normal ai script and special tactic ai scripts.
|
||||
void ai_AIScript(object oPC, object oAssociate, string sAssociate, int nToken);
|
||||
// Has the PC select a Trap and then place it on the ground from an associate.
|
||||
@@ -130,6 +130,10 @@ void ai_ChangeCameraView(object oPC, object oAssociate);
|
||||
void ai_OpenInventory(object oAssociate, object oPC);
|
||||
// Executes an installed plugin.
|
||||
void ai_Plugin_Execute(object oPC, string sElem, int bUser = 0);
|
||||
// Turns on oAssociate AI, Setting all event scripts.
|
||||
void ai_TurnOn(object oPC, object oAssociate, string sAssociateType);
|
||||
// Turns off oAssociate AI, Setting all event scripts.
|
||||
void ai_TurnOff(object oPC, object oAssociate, string sAssociateType);
|
||||
|
||||
int ai_CanIAttack(object oCreature)
|
||||
{
|
||||
@@ -161,7 +165,7 @@ object ai_GetNearestLockedObject(object oCreature)
|
||||
void ai_FindTheEnemy(object oCreature, object oSpeaker, object oTarget, int bMonster)
|
||||
{
|
||||
if(GetLocalInt(oCreature, AI_AM_I_SEARCHING)) return;
|
||||
if(oSpeaker == oTarget && d100() < 34)
|
||||
if(oSpeaker == oTarget && d100() < 16)
|
||||
{
|
||||
// Let them know we heard something in the distance!.
|
||||
if(!ai_GetAIMode(oCreature, AI_MODE_DO_NOT_SPEAK))
|
||||
@@ -232,7 +236,7 @@ void ai_FindTheEnemy(object oCreature, object oSpeaker, object oTarget, int bMon
|
||||
if(AI_DEBUG) ai_Debug("0i_associates", "176", "Moving and searching for " + GetName(oTarget));
|
||||
SetActionMode(oCreature, ACTION_MODE_DETECT, TRUE);
|
||||
ActionMoveToLocation(GetLocation(oTarget), FALSE);
|
||||
//ActionMoveToObject(oTarget, FALSE, AI_RANGE_MELEE);
|
||||
//ActionMoveToObject(oTarget, FALSE, AI_RANGE_MELEE);
|
||||
AssignCommand(oCreature, ActionDoCommand(DeleteLocalInt(oCreature, AI_AM_I_SEARCHING)));
|
||||
return;
|
||||
}
|
||||
@@ -835,7 +839,7 @@ void ai_MonsterEvaluateNewThreat(object oCreature, object oLastPerceived, string
|
||||
ai_HaveCreatureSpeak(oCreature, 5, ":0:1:2:3:6:");
|
||||
}
|
||||
SetLocalObject(oCreature, AI_MY_TARGET, oLastPerceived);
|
||||
SpeakString(sPerception, TALKVOLUME_SILENT_TALK);
|
||||
SpeakString(AI_I_SEE_AN_ENEMY, TALKVOLUME_SILENT_TALK);
|
||||
ai_StartMonsterCombat(oCreature);
|
||||
}
|
||||
else ai_FindTheEnemy(oCreature, oLastPerceived, oLastPerceived, TRUE);
|
||||
@@ -1903,18 +1907,20 @@ void ai_DoCommand(object oPC, object oAssociate, int nCommand)
|
||||
}
|
||||
}
|
||||
}
|
||||
void ai_Action(object oPC, object oAssociate)
|
||||
void ai_Action(object oPC, object oAssociate, int bPCAI = FALSE)
|
||||
{
|
||||
if(oPC == oAssociate)
|
||||
{
|
||||
DeleteLocalObject(oPC, "NW_ASSOCIATE_COMMAND");
|
||||
SetLocalString(oPC, AI_TARGET_MODE, "ASSOCIATE_ACTION_ALL");
|
||||
ai_SendMessages("Select an action for the party.", AI_COLOR_YELLOW, oPC);
|
||||
}
|
||||
else
|
||||
{
|
||||
SetLocalObject(oPC, AI_TARGET_ASSOCIATE, oAssociate);
|
||||
SetLocalObject(oPC, AI_TARGET_MODE_ASSOCIATE, oAssociate);
|
||||
SetLocalString(oPC, AI_TARGET_MODE, "ASSOCIATE_ACTION");
|
||||
SetLocalInt(oPC, AI_TARGET_MODE_ON, TRUE);
|
||||
if(!GetLocalInt(GetModule(), AI_USING_PRC) && bPCAI) ai_TurnOn(oPC, oPC, "pc");
|
||||
ai_SendMessages("Select an action for " + GetName(oAssociate) + ".", AI_COLOR_YELLOW, oPC);
|
||||
}
|
||||
EnterTargetingMode(oPC, OBJECT_TYPE_ALL, MOUSECURSOR_ACTION, MOUSECURSOR_NOWALK);
|
||||
@@ -2139,6 +2145,7 @@ void ai_ChangeCameraView(object oPC, object oAssociate)
|
||||
{
|
||||
SetLocalObject(oPC, "AI_CAMERA_ON_ASSOCIATE", oAssociate);
|
||||
AttachCamera(oPC, oAssociate);
|
||||
if(!ai_GetIsCharacter(oAssociate)) ai_Action(oPC, oAssociate, TRUE);
|
||||
}
|
||||
}
|
||||
void ai_SelectCameraView(object oPC)
|
||||
@@ -2190,3 +2197,47 @@ void ai_Plugin_Execute(object oPC, string sElem, int bUser = 0)
|
||||
ExecuteScript(sScript, oPC);
|
||||
}
|
||||
}
|
||||
void ai_TurnOn(object oPC, object oTarget, string sAssociateType)
|
||||
{
|
||||
ai_UpdateToolTipUI(oPC, sAssociateType + AI_NUI, sAssociateType + AI_WIDGET_NUI, "btn_ai_tooltip", " AI On");
|
||||
ai_SendMessages("AI turned on for " + GetName(oTarget) + ".", AI_COLOR_YELLOW, oPC);
|
||||
SetEventScript(oTarget, EVENT_SCRIPT_CREATURE_ON_HEARTBEAT, "xx_pc_1_hb");
|
||||
SetEventScript(oTarget, EVENT_SCRIPT_CREATURE_ON_NOTICE, "xx_pc_2_percept");
|
||||
SetEventScript(oTarget, EVENT_SCRIPT_CREATURE_ON_END_COMBATROUND, "xx_pc_3_endround");
|
||||
SetEventScript(oTarget, EVENT_SCRIPT_CREATURE_ON_DIALOGUE, "xx_pc_4_convers");
|
||||
SetEventScript(oTarget, EVENT_SCRIPT_CREATURE_ON_MELEE_ATTACKED, "xx_pc_5_phyatked");
|
||||
SetEventScript(oTarget, EVENT_SCRIPT_CREATURE_ON_DAMAGED, "xx_pc_6_damaged");
|
||||
//SetEventScript(oTarget, EVENT_SCRIPT_CREATURE_ON_DEATH, "");
|
||||
SetEventScript(oTarget, EVENT_SCRIPT_CREATURE_ON_DISTURBED, "xx_pc_8_disturb");
|
||||
//SetEventScript(oTarget, EVENT_SCRIPT_CREATURE_ON_SPAWN_IN, "");
|
||||
//SetEventScript(oTarget, EVENT_SCRIPT_CREATURE_ON_RESTED, "");
|
||||
SetEventScript(oTarget, EVENT_SCRIPT_CREATURE_ON_SPELLCASTAT, "xx_pc_b_castat");
|
||||
SetEventScript(oTarget, EVENT_SCRIPT_CREATURE_ON_BLOCKED_BY_DOOR, "xx_pc_e_blocked");
|
||||
//SetEventScript(oTarget, EVENT_SCRIPT_CREATURE_ON_USER_DEFINED_EVENT, "");
|
||||
// This sets the script for the PC to run AI based on class.
|
||||
ai_SetAssociateAIScript(oTarget, FALSE);
|
||||
// Set so PC can hear associates talking in combat.
|
||||
ai_SetListeningPatterns(oTarget);
|
||||
}
|
||||
void ai_TurnOff(object oPC, object oAssociate, string sAssociateType)
|
||||
{
|
||||
ai_UpdateToolTipUI(oPC, sAssociateType + AI_NUI, sAssociateType + AI_WIDGET_NUI, "btn_ai_tooltip", " AI Off");
|
||||
ai_SendMessages("AI Turned off for " + GetName(oAssociate) + ".", AI_COLOR_YELLOW, oPC);
|
||||
SetEventScript(oAssociate, EVENT_SCRIPT_CREATURE_ON_HEARTBEAT, "");
|
||||
SetEventScript(oAssociate, EVENT_SCRIPT_CREATURE_ON_NOTICE, "");
|
||||
SetEventScript(oAssociate, EVENT_SCRIPT_CREATURE_ON_END_COMBATROUND, "");
|
||||
SetEventScript(oAssociate, EVENT_SCRIPT_CREATURE_ON_DIALOGUE, "");
|
||||
SetEventScript(oAssociate, EVENT_SCRIPT_CREATURE_ON_MELEE_ATTACKED, "");
|
||||
SetEventScript(oAssociate, EVENT_SCRIPT_CREATURE_ON_DAMAGED, "");
|
||||
//SetEventScript(oAssociate, EVENT_SCRIPT_CREATURE_ON_DEATH, "");
|
||||
SetEventScript(oAssociate, EVENT_SCRIPT_CREATURE_ON_DISTURBED, "");
|
||||
//SetEventScript(oAssociate, EVENT_SCRIPT_CREATURE_ON_SPAWN_IN, "");
|
||||
//SetEventScript(oAssociate, EVENT_SCRIPT_CREATURE_ON_RESTED, "");
|
||||
SetEventScript(oAssociate, EVENT_SCRIPT_CREATURE_ON_SPELLCASTAT, "");
|
||||
SetEventScript(oAssociate, EVENT_SCRIPT_CREATURE_ON_BLOCKED_BY_DOOR, "");
|
||||
//SetEventScript(oAssociate, EVENT_SCRIPT_CREATURE_ON_USER_DEFINED_EVENT, "");
|
||||
DeleteLocalInt(oAssociate, "AI_I_AM_BEING_HEALED");
|
||||
DeleteLocalString(oAssociate, "AIScript");
|
||||
ai_ClearCreatureActions();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user