2025/09/06 Update
Fixed damaged baseitems.2da Updated PEPS. Full compile.
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
#include "0i_menus"
|
||||
// Setup an AI OnPlayerTarget Event script while allowing any module onplayer
|
||||
// target event script to still work.
|
||||
void ai_SetupPlayerTarget(object oCreature);
|
||||
void ai_SetupPlayerTarget();
|
||||
// Selects a target for oAssocite to follow.
|
||||
void ai_AllSelectTarget(object oPC, object oAssociate, object oTarget);
|
||||
// Removes the Cutscene ghosts and variables from all associates. For original AI scripts.
|
||||
@@ -30,7 +30,7 @@ void ai_UpdateAssociateWidget(object oPC, object oAssociate);
|
||||
// Sets oAssociates action mode for nFeat from the quick widget menu
|
||||
int ai_SetActionMode(object oAssociate, int nFeat);
|
||||
|
||||
void ai_SetupPlayerTarget(object oCreature)
|
||||
void ai_SetupPlayerTarget()
|
||||
{
|
||||
object oModule = GetModule();
|
||||
string sModuleTargetEvent = GetEventScript(oModule, EVENT_SCRIPT_MODULE_ON_PLAYER_TARGET);
|
||||
@@ -204,12 +204,14 @@ void ai_ActionAssociate(object oPC, object oTarget, location lLocation)
|
||||
{
|
||||
SetLocalString(oAssociate, AI_COMBAT_SCRIPT, GetLocalString(oAssociate, AI_DEFAULT_SCRIPT));
|
||||
}
|
||||
if(ai_GetIsInCombat(oAssociate)) ai_DoAssociateCombatRound(oAssociate, oTarget);
|
||||
else
|
||||
{
|
||||
ai_HaveCreatureSpeak(oAssociate, 5, ":0:1:2:3:6:");
|
||||
ai_StartAssociateCombat(oAssociate, oTarget);
|
||||
}
|
||||
//if(ai_GetIsInCombat(oAssociate)) ai_DoAssociateCombatRound(oAssociate, oTarget);
|
||||
//else
|
||||
//{
|
||||
// ai_HaveCreatureSpeak(oAssociate, 5, ":0:1:2:3:6:");
|
||||
// ai_StartAssociateCombat(oAssociate, oTarget);
|
||||
//}
|
||||
if(ai_GetIsRangeWeapon(GetItemInSlot(INVENTORY_SLOT_LEFTHAND, oAssociate))) ActionAttack(oTarget, TRUE);
|
||||
else ActionAttack(oTarget);
|
||||
ai_SendMessages(GetName(oAssociate) + " is attacking " + GetName(oTarget), AI_COLOR_RED, oPC);
|
||||
}
|
||||
else
|
||||
@@ -317,6 +319,7 @@ void ai_SelectFollowTarget(object oPC, object oAssociate, object oTarget)
|
||||
{
|
||||
ai_SetAIMode(oAssociate, AI_MODE_FOLLOW, FALSE);
|
||||
DeleteLocalObject(oAssociate, AI_FOLLOW_TARGET);
|
||||
ClearAllActions(FALSE, oAssociate);
|
||||
string sTarget;
|
||||
if(ai_GetIsCharacter(oAssociate))
|
||||
{
|
||||
@@ -634,6 +637,7 @@ void ai_SelectWidgetSpellTarget(object oPC, object oAssociate, string sElem)
|
||||
json jSpell = JsonArrayGet(jWidget, nIndex);
|
||||
int nSpell = JsonGetInt(JsonArrayGet(jSpell, 0));
|
||||
int nClass = JsonGetInt(JsonArrayGet(jSpell, 1));
|
||||
SetLocalObject(oPC, AI_TARGET_ASSOCIATE, oAssociate);
|
||||
if(nClass == -1) // This is an Item.
|
||||
{
|
||||
object oItem = GetObjectByUUID(JsonGetString(JsonArrayGet(jSpell, 5)));
|
||||
@@ -693,8 +697,7 @@ void ai_SelectWidgetSpellTarget(object oPC, object oAssociate, string sElem)
|
||||
EnterTargetingMode(oPC, OBJECT_TYPE_CREATURE, MOUSECURSOR_ATTACK, MOUSECURSOR_NOATTACK);
|
||||
}
|
||||
// Check feat and adjust if it is an action mode feat.
|
||||
if(ai_SetActionMode(oAssociate, nFeat)) return;
|
||||
AssignCommand(oAssociate, ActionUseFeat(nFeat, oAssociate, nSpell));
|
||||
if(!ai_SetActionMode(oAssociate, nFeat)) AssignCommand(oAssociate, ActionUseFeat(nFeat, oAssociate, nSpell));
|
||||
DelayCommand(6.0, ai_UpdateAssociateWidget(oPC, oAssociate));
|
||||
return;
|
||||
}
|
||||
@@ -702,7 +705,6 @@ void ai_SelectWidgetSpellTarget(object oPC, object oAssociate, string sElem)
|
||||
}
|
||||
else SetLocalString(oPC, AI_TARGET_MODE, "ASSOCIATE_CAST_SPELL");
|
||||
}
|
||||
SetLocalObject(oPC, AI_TARGET_ASSOCIATE, oAssociate);
|
||||
int nObjectType;
|
||||
string sTarget = Get2DAString("spells", "TargetType", nSpell);
|
||||
int nTarget = ai_HexStringToInt(sTarget);
|
||||
@@ -784,6 +786,7 @@ int ai_SetActionMode(object oAssociate, int nFeat)
|
||||
else if(nFeat == FEAT_EXPERTISE) nMode = ACTION_MODE_EXPERTISE;
|
||||
else if(nFeat == FEAT_IMPROVED_EXPERTISE) nMode = ACTION_MODE_IMPROVED_EXPERTISE;
|
||||
else if(nFeat == FEAT_DIRTY_FIGHTING) nMode = ACTION_MODE_DIRTY_FIGHTING;
|
||||
else if(nFeat == FEAT_DWARVEN_DEFENDER_DEFENSIVE_STANCE) nMode = 12; // ACTION_MODE_DEFENSIVE_STANCE
|
||||
if(nMode)
|
||||
{
|
||||
SetActionMode(oAssociate, nMode, !GetActionMode(oAssociate, nMode));
|
||||
|
Reference in New Issue
Block a user