72 lines
2.6 KiB
Plaintext
72 lines
2.6 KiB
Plaintext
// mai_c_active - restore challenging AI
|
|
void main()
|
|
{
|
|
object oPC=GetPCSpeaker();
|
|
object oMod=GetModule();
|
|
int nN;
|
|
string sS;
|
|
float fF;
|
|
string sTID=GetLocalString(oPC,"sMAI_TID");
|
|
/// AI VARS
|
|
string sPE; // primary enemy
|
|
int nAI; // ai setting
|
|
int nMVD; // mana vault defenders
|
|
int nTRD; // throne room defenders
|
|
int nLD1; // lair defense 1
|
|
int nLD2; // lair defense 2
|
|
int nCPC; // control point capture
|
|
int nHU; // harvest units
|
|
int nIC; // item capture
|
|
int nRA; // raiding attack
|
|
int nRM; // raiding mana
|
|
int nRG; // raiding gold
|
|
int nPR; // power reservoir
|
|
int nRL; // raid level
|
|
int nCPL; // control point level
|
|
int nPRL; // power reservoir level
|
|
/// end VAR DECLARATION
|
|
SetLocalInt(oMod,"nAISetting",2);
|
|
SetLocalString(oMod,"sAICode"+sTID,"mai_challenge");
|
|
sPE=GetLocalString(oMod,"s"+sTID+"_CAI_PE");
|
|
sS="UNKNOWN";
|
|
if (sPE=="DWF") sS="Dwarves";
|
|
else if (sPE=="UND") sS="Undead";
|
|
else if (sPE=="UNC") sS="Unclean";
|
|
else if (sPE=="SPID") sS="Spider Cultists";
|
|
SetCustomToken(86000,sS);
|
|
nAI=GetLocalInt(oMod,"n"+sTID+"_CAI_Setting");
|
|
sS="UNKNOWN";
|
|
if (nAI==0) sS="Raid only if trespassed";
|
|
else if (nAI==1) sS="Raid primary enemy unless trespassed";
|
|
else if (nAI==2) sS="Random raiding target with focus on primary";
|
|
SetCustomToken(86001,sS);
|
|
nMVD=GetLocalInt(oMod,"n"+sTID+"_nCAIMVD");
|
|
SetCustomToken(86002,IntToString(nMVD));
|
|
nTRD=GetLocalInt(oMod,"n"+sTID+"_nCAITRD");
|
|
SetCustomToken(86003,IntToString(nTRD));
|
|
nLD1=GetLocalInt(oMod,"n"+sTID+"_nCAILD1");
|
|
SetCustomToken(86004,IntToString(nLD1));
|
|
nLD2=GetLocalInt(oMod,"n"+sTID+"_nCAILD2");
|
|
SetCustomToken(86005,IntToString(nLD2));
|
|
nCPC=GetLocalInt(oMod,"n"+sTID+"_nCAICPC");
|
|
SetCustomToken(86006,IntToString(nCPC));
|
|
nHU=GetLocalInt(oMod,"n"+sTID+"_nCAIHU");
|
|
SetCustomToken(86007,IntToString(nHU));
|
|
nIC=GetLocalInt(oMod,"n"+sTID+"_nCAIIC");
|
|
SetCustomToken(86008,IntToString(nIC));
|
|
nRA=GetLocalInt(oMod,"n"+sTID+"_nCAIRA");
|
|
SetCustomToken(86009,IntToString(nRA));
|
|
nRM=GetLocalInt(oMod,"n"+sTID+"_nCAIRM");
|
|
SetCustomToken(86010,IntToString(nRM));
|
|
nRG=GetLocalInt(oMod,"n"+sTID+"_nCAIRG");
|
|
SetCustomToken(86011,IntToString(nRG));
|
|
nPR=GetLocalInt(oMod,"n"+sTID+"_nCAIPR");
|
|
SetCustomToken(86012,IntToString(nPR));
|
|
nRL=GetLocalInt(oMod,"n"+sTID+"_nCAIRL");
|
|
nCPL=GetLocalInt(oMod,"n"+sTID+"_nCAICPL");
|
|
nPRL=GetLocalInt(oMod,"n"+sTID+"_nCAIPRL");
|
|
nN=40-nMVD-nTRD-nLD1-nLD2-nCPC-nHU-nIC-nRA-nRM-nRG-nPR;
|
|
SetCustomToken(86050,IntToString(nN));
|
|
SetLocalInt(oPC,"nMAI_UR",nN);
|
|
}
|