HoS_PRC8/_mod/_module/nss/mai_c_defaults.nss
Jaysyn904 04165202c0 Initial upload
Initial upload
2024-11-25 19:36:07 -05:00

147 lines
3.5 KiB
Plaintext

// mai_c_defaults - set default 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");
if (sTID=="DWF")
{ // dwarf
sPE="UNC";
nAI=1;
nMVD=4;
nTRD=4;
nLD1=3;
nLD2=3;
nCPC=4;
nHU=1;
nIC=1;
nRA=8;
nRM=1;
nRG=1;
nPR=0;
nRL=5;
nCPL=3;
nPRL=5;
} // dwarf
else if (sTID=="UNC")
{ // unclean
sPE="DWF";
nAI=2;
nMVD=1;
nTRD=2;
nLD1=2;
nLD2=2;
nCPC=6;
nHU=1;
nIC=1;
nRA=10;
nRM=1;
nRG=2;
nPR=0;
nRL=3;
nCPL=1;
nPRL=5;
} // unclean
else if (sTID=="UND")
{ // undead
sPE="SPID";
nAI=1;
nMVD=2;
nTRD=2;
nLD1=5;
nLD2=1;
nCPC=4;
nHU=1;
nIC=1;
nRA=11;
nRM=2;
nRG=1;
nPR=0;
nRL=1;
nCPL=1;
nPRL=3;
} // undead
else if (sTID=="SPID")
{ // spider cultists
sPE="UND";
nAI=1;
nMVD=2;
nTRD=2;
nLD1=2;
nLD2=2;
nCPC=4;
nHU=1;
nIC=1;
nRA=12;
nRM=1;
nRG=2;
nPR=0;
nRL=5;
nCPL=5;
nPRL=5;
} // spider cultists
SetLocalString(oMod,"s"+sTID+"_CAI_PE",sPE);
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);
SetLocalInt(oMod,"n"+sTID+"_CAI_Setting",nAI);
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);
SetLocalInt(oMod,"n"+sTID+"_nCAIMVD",nMVD);
SetCustomToken(86002,IntToString(nMVD));
SetLocalInt(oMod,"n"+sTID+"_nCAITRD",nTRD);
SetCustomToken(86003,IntToString(nTRD));
SetLocalInt(oMod,"n"+sTID+"_nCAILD1",nLD1);
SetCustomToken(86004,IntToString(nLD1));
SetLocalInt(oMod,"n"+sTID+"_nCAILD2",nLD2);
SetCustomToken(86005,IntToString(nLD2));
SetLocalInt(oMod,"n"+sTID+"_nCAICPC",nCPC);
SetCustomToken(86006,IntToString(nCPC));
SetLocalInt(oMod,"n"+sTID+"_nCAIHU",nHU);
SetCustomToken(86007,IntToString(nHU));
SetLocalInt(oMod,"n"+sTID+"_nCAIIC",nIC);
SetCustomToken(86008,IntToString(nIC));
SetLocalInt(oMod,"n"+sTID+"_nCAIRA",nRA);
SetCustomToken(86009,IntToString(nRA));
SetLocalInt(oMod,"n"+sTID+"_nCAIRM",nRM);
SetCustomToken(86010,IntToString(nRM));
SetLocalInt(oMod,"n"+sTID+"_nCAIRG",nRG);
SetCustomToken(86011,IntToString(nRG));
SetLocalInt(oMod,"n"+sTID+"_nCAIPR",nPR);
SetCustomToken(86012,IntToString(nPR));
SetLocalInt(oMod,"n"+sTID+"_nCAIRL",nRL);
SetLocalInt(oMod,"n"+sTID+"_nCAICPL",nCPL);
SetLocalInt(oMod,"n"+sTID+"_nCAIPRL",nPRL);
SetCustomToken(86050,"0");
SetLocalInt(oPC,"nMAI_UR",0);
}