2025/09/06 Update

Fixed damaged baseitems.2da
Updated PEPS.
Full compile.
This commit is contained in:
Jaysyn904
2025-09-06 12:13:11 -04:00
parent c5e44a075b
commit 41bbc115c1
193 changed files with 104993 additions and 2164 deletions

View File

@@ -25,6 +25,8 @@ const string AI_DM_TABLE = "DM_TABLE";
// Sets PEPS RULES from the database to the module.
// Creates default rules if they do not exist.
void ai_SetAIRules();
// Returns TRUE if the module is being run as a server.
int ai_GetIsServer();
// Returns TRUE if oCreature is controlled by a player.
int ai_GetIsCharacter(object oCreature);
// Returns TRUE if oCreature is controlled by a dungeon master.
@@ -307,13 +309,17 @@ void ai_SetAIRules()
SetLocalInt(oModule, sDMAIAccessVarname, bValue);
}
}
int ai_GetIsServer()
{
return GetLocalInt(GetModule(), AI_IS_SERVER) || AI_SERVER;
}
int ai_GetIsCharacter(object oCreature)
{
return (GetIsPC(oCreature) && !GetIsDM(oCreature) && !GetIsDMPossessed(oCreature));
return (GetIsPC(oCreature) && !GetIsDM(oCreature) && !GetIsDMPossessed(oCreature) && !GetIsPlayerDM(oCreature));
}
int ai_GetIsDungeonMaster(object oCreature)
{
return (GetIsDM(oCreature) || GetIsDMPossessed(oCreature));
return (GetIsDM(oCreature) || GetIsDMPossessed(oCreature) || GetIsPlayerDM(oCreature));
}
object ai_GetPlayerMaster(object oAssociate)
{
@@ -862,7 +868,7 @@ void ai_SetupAIData(object oPlayer, object oAssociate, string sAssociateType)
// We keep it for now as we don't want to move other data.
jAIData = JsonArrayInsert(jAIData, JsonInt(11)); // 7 - Associate Perception DistanceDistance.
SetLocalInt(oAssociate, AI_ASSOCIATE_PERCEPTION, 11);
SetLocalFloat(oAssociate, AI_ASSOC_PERCEPTION_DISTANCE, 20.0);
SetLocalFloat(oAssociate, AI_ASSOC_PERCEPTION_DISTANCE, 25.0);
jAIData = JsonArrayInsert(jAIData, JsonString("")); // 8 - Associate Combat Tactics.
jAIData = JsonArrayInsert(jAIData, JsonFloat(20.0)); // 9 - Open Doors check range.
SetLocalFloat(oAssociate, AI_OPEN_DOORS_RANGE, 20.0);
@@ -1140,7 +1146,7 @@ void ai_SetupDMData(object oPlayer, string sName)
void ai_CheckDMData(object oPlayer)
{
//ai_Debug("0i_main", "898", "Checking data for DM: " + GetName(oPlayer));
string sName = ai_RemoveIllegalCharacters(GetName(oPlayer));
string sName = ai_RemoveIllegalCharacters(ai_StripColorCodes(GetName(oPlayer)));
// ********** Buttons **********
json jButtons = ai_GetCampaignDbJson("buttons", sName, AI_DM_TABLE);
// if there is no saved AImodes then set the defaults.
@@ -1241,7 +1247,7 @@ json ai_CheckOldPluginJson(object oPC)
json ai_UpdatePluginsForPC(object oPC)
{
// Check if the server is running or single player.
if(!AI_SERVER) return ai_CheckOldPluginJson(oPC);
if(!ai_GetIsServer()) return ai_CheckOldPluginJson(oPC);
int nJsonType, nCounter, nIndex, bWidget, bAllow;
string sScript, sName, sIcon;
json jServerPlugins = ai_GetCampaignDbJson("plugins");
@@ -1283,7 +1289,7 @@ json ai_UpdatePluginsForPC(object oPC)
json ai_UpdatePluginsForDM(object oPC)
{
int nJsonType, nCounter, nIndex, bWidget, bAllow;
string sName, sIcon, sDbName = ai_RemoveIllegalCharacters(GetName(oPC));
string sName, sIcon, sDbName = ai_RemoveIllegalCharacters(ai_StripColorCodes(GetName(oPC)));
json jServerPlugins = ai_GetCampaignDbJson("plugins");
ai_CheckDMDataAndInitialize(oPC);
json jDMPlugin, jDMPlugins = ai_GetCampaignDbJson("plugins", sDbName, AI_DM_TABLE);
@@ -1323,7 +1329,7 @@ void ai_StartupPlugins(object oPC)
int bUpdatePlugins;
string sScript;
json jPlugins;
if(GetIsDM(oPC)) jPlugins = ai_UpdatePluginsForDM(oPC);
if(ai_GetIsDungeonMaster(oPC)) jPlugins = ai_UpdatePluginsForDM(oPC);
else jPlugins = ai_UpdatePluginsForPC(oPC);
// We delete this so each mod can be added that legally loads.
DeleteLocalJson(GetModule(), AI_MONSTER_MOD_JSON);