Ancordia_PRC8/_module/nss/dungeon_inc.nss
Jaysyn904 102ba7dab6 Initial Commit
Initial Commit
2023-09-21 19:51:32 -04:00

1008 lines
45 KiB
Plaintext

//This is a library containing functions related to random dungeons.
#include "_sh_inc_list"
#include "events_inc"
//Define constants
const int DUN_CREATURE_THREAT_MINOR = 1;
const int DUN_CREATURE_THREAT_MAJOR = 2;
const int DUN_CREATURE_THREAT_BOSS = 3;
const int DUN_CREATURE_CLASS_WARRIOR = 0;
const int DUN_CREATURE_CLASS_MAGE = 1;
//Level up a dungeon creature and apply appropriate bonuses
void LevelDungeonCreature(object oCreature, int nLevel, int nPlayers);
//Connect dungeon entrance and interior areas
void ConnectDungeonAreas();
//Spawn dungeon monsters
void SpawnDungeonMonsters(object oArea, object oPC, int nLevel, int nPlayers);
//Select random major enemy
string RandomMajorMonster(string sTheme);
//Select random minor enemy
string RandomMinorMonster(string sTheme);
//Select random boss
string RandomBossMonster(string sTheme);
//Generate mystical item
string GenerateMystical();
//Generate legendary item
string GenerateLegendary();
//Generate unique item
string GenerateUnique();
//Select random trap
int RandomTrap(int nLevel);
//Select random trap
int RandomTrap(int nLevel)
{
int nTrapType;
if (nLevel < 5)
{
switch (Random(7))
{
case 0: nTrapType = TRAP_BASE_TYPE_MINOR_FIRE; break;
case 1: nTrapType = TRAP_BASE_TYPE_MINOR_FROST; break;
case 2: nTrapType = TRAP_BASE_TYPE_MINOR_SONIC; break;
case 3: nTrapType = TRAP_BASE_TYPE_MINOR_ELECTRICAL; break;
case 4: nTrapType = TRAP_BASE_TYPE_MINOR_HOLY; break;
case 5: nTrapType = TRAP_BASE_TYPE_MINOR_NEGATIVE; break;
case 6: nTrapType = TRAP_BASE_TYPE_MINOR_ACID; break;
}
}
else if (nLevel < 10)
{
switch (Random(7))
{
case 0: nTrapType = TRAP_BASE_TYPE_AVERAGE_FIRE; break;
case 1: nTrapType = TRAP_BASE_TYPE_AVERAGE_FROST; break;
case 2: nTrapType = TRAP_BASE_TYPE_AVERAGE_SONIC; break;
case 3: nTrapType = TRAP_BASE_TYPE_AVERAGE_ELECTRICAL; break;
case 4: nTrapType = TRAP_BASE_TYPE_AVERAGE_HOLY; break;
case 5: nTrapType = TRAP_BASE_TYPE_AVERAGE_NEGATIVE; break;
case 6: nTrapType = TRAP_BASE_TYPE_AVERAGE_ACID; break;
}
}
else if (nLevel < 15)
{
switch (Random(7))
{
case 0: nTrapType = TRAP_BASE_TYPE_STRONG_FIRE; break;
case 1: nTrapType = TRAP_BASE_TYPE_STRONG_FROST; break;
case 2: nTrapType = TRAP_BASE_TYPE_STRONG_SONIC; break;
case 3: nTrapType = TRAP_BASE_TYPE_STRONG_ELECTRICAL; break;
case 4: nTrapType = TRAP_BASE_TYPE_STRONG_HOLY; break;
case 5: nTrapType = TRAP_BASE_TYPE_STRONG_NEGATIVE; break;
case 6: nTrapType = TRAP_BASE_TYPE_STRONG_ACID; break;
}
}
else if (nLevel < 20)
{
switch (Random(7))
{
case 0: nTrapType = TRAP_BASE_TYPE_DEADLY_FIRE; break;
case 1: nTrapType = TRAP_BASE_TYPE_DEADLY_FROST; break;
case 2: nTrapType = TRAP_BASE_TYPE_DEADLY_SONIC; break;
case 3: nTrapType = TRAP_BASE_TYPE_DEADLY_ELECTRICAL; break;
case 4: nTrapType = TRAP_BASE_TYPE_DEADLY_HOLY; break;
case 5: nTrapType = TRAP_BASE_TYPE_DEADLY_NEGATIVE; break;
case 6: nTrapType = TRAP_BASE_TYPE_DEADLY_ACID; break;
}
}
else
{
switch (Random(4))
{
case 0: nTrapType = TRAP_BASE_TYPE_EPIC_FIRE; break;
case 1: nTrapType = TRAP_BASE_TYPE_EPIC_FROST; break;
case 2: nTrapType = TRAP_BASE_TYPE_EPIC_SONIC; break;
case 3: nTrapType = TRAP_BASE_TYPE_EPIC_ELECTRICAL; break;
}
}
return nTrapType;
}
//Select random major enemy
string RandomMajorMonster(string sTheme)
{
string sResRef;
if (sTheme == "undead")
{
switch(Random(2))
{
case 0: sResRef = "dun_maj_skmage"; break;
case 1: sResRef = "dun_maj_skel"; break;
}
}
else if (sTheme == "ele1")
{
switch(Random(3))
{
case 0: sResRef = "dun_maj_airele"; break;
case 1: sResRef = "dun_maj_earele"; break;
case 2: sResRef = "dun_maj_firele"; break;
}
}
else if (sTheme == "ele2")
{
switch(Random(3))
{
case 0: sResRef = "dun_maj_watele"; break;
case 1: sResRef = "dun_maj_airele"; break;
case 2: sResRef = "dun_maj_firele"; break;
}
}
else if (sTheme == "ele3")
{
switch(Random(3))
{
case 0: sResRef = "dun_maj_watele"; break;
case 1: sResRef = "dun_maj_airele"; break;
case 2: sResRef = "dun_maj_earele"; break;
}
}
else if (sTheme == "ele4")
{
switch(Random(3))
{
case 0: sResRef = "dun_maj_watele"; break;
case 1: sResRef = "dun_maj_firele"; break;
case 2: sResRef = "dun_maj_earele"; break;
}
}
else if (sTheme == "out1")
{
switch(Random(2))
{
case 0: sResRef = "dun_maj_grasla"; break;
case 1: sResRef = "dun_maj_deasla"; break;
}
}
else if (sTheme == "out2")
{
sResRef = "dun_maj_forsol";
}
else if (sTheme == "out3")
{
switch(Random(2))
{
case 0: sResRef = "dun_maj_vrock"; break;
case 1: sResRef = "dun_maj_abishai"; break;
}
}
else if (sTheme == "constructs")
{
switch(Random(2))
{
case 0: sResRef = "dun_maj_irongol"; break;
case 1: sResRef = "dun_maj_stongol"; break;
}
}
return sResRef;
}
//Select random minor enemy
string RandomMinorMonster(string sTheme)
{
string sResRef;
if (sTheme == "undead")
{
switch(Random(3))
{
case 0: sResRef = "dun_min_skel"; break;
case 1: sResRef = "dun_min_bskel"; break;
case 2: sResRef = "dun_min_zomb"; break;
}
}
else if (sTheme == "ele1")
{
switch(Random(5))
{
case 0: sResRef = "dun_min_airmep"; break;
case 1: sResRef = "dun_min_earmep"; break;
case 2: sResRef = "dun_min_firmep"; break;
case 3: sResRef = "dun_min_magmep"; break;
case 4: sResRef = "dun_min_smomep"; break;
}
}
else if (sTheme == "ele2")
{
switch(Random(5))
{
case 0: sResRef = "dun_min_airmep"; break;
case 1: sResRef = "dun_min_magmep"; break;
case 2: sResRef = "dun_min_watmep"; break;
case 3: sResRef = "dun_min_smomep"; break;
case 4: sResRef = "dun_min_icemep"; break;
}
}
else if (sTheme == "ele3")
{
switch(Random(5))
{
case 0: sResRef = "dun_min_airmep"; break;
case 1: sResRef = "dun_min_watmep"; break;
case 2: sResRef = "dun_min_earmep"; break;
case 3: sResRef = "dun_min_icemep"; break;
case 4: sResRef = "dun_min_oozmep"; break;
}
}
else if (sTheme == "ele4")
{
switch(Random(5))
{
case 0: sResRef = "dun_min_watmep"; break;
case 1: sResRef = "dun_min_earmep"; break;
case 2: sResRef = "dun_min_magmep"; break;
case 3: sResRef = "dun_min_oozmep"; break;
case 4: sResRef = "dun_min_magmep"; break;
}
}
else if (sTheme == "out1")
{
switch(Random(3))
{
case 0: sResRef = "dun_min_redsla"; break;
case 1: sResRef = "dun_min_blusla"; break;
case 2: sResRef = "dun_min_gresla"; break;
}
}
else if (sTheme == "out2")
{
sResRef = "dun_min_forwor";
}
else if (sTheme == "out3")
{
switch(Random(3))
{
case 0: sResRef = "dun_min_imp"; break;
case 1: sResRef = "dun_min_hound"; break;
case 2: sResRef = "dun_min_succub"; break;
}
}
else if (sTheme == "constructs")
{
switch(Random(2))
{
case 0: sResRef = "dun_min_horror"; break;
case 1: sResRef = "dun_min_claygol"; break;
}
}
return sResRef;
}
//Select random boss
string RandomBossMonster(string sTheme)
{
string sResRef;
if (sTheme == "undead")
{
switch(Random(3))
{
case 0: sResRef = "dun_bos_devo"; break;
case 1: sResRef = "dun_bos_lich"; break;
case 2: sResRef = "dun_bos_dlord"; break;
}
}
else if (sTheme == "ele1")
{
switch(Random(3))
{
case 0: sResRef = "dun_bos_airlor"; break;
case 1: sResRef = "dun_bos_firlor"; break;
case 2: sResRef = "dun_bos_smoele"; break;
}
}
else if (sTheme == "ele2")
{
switch(Random(3))
{
case 0: sResRef = "dun_bos_watlor"; break;
case 1: sResRef = "dun_bos_airlor"; break;
case 2: sResRef = "dun_bos_iceele"; break;
}
}
else if (sTheme == "ele3")
{
switch(Random(3))
{
case 0: sResRef = "dun_bos_watlor"; break;
case 1: sResRef = "dun_bos_earlor"; break;
case 2: sResRef = "dun_bos_oozele"; break;
}
}
else if (sTheme == "ele4")
{
switch(Random(3))
{
case 0: sResRef = "dun_bos_firlor"; break;
case 1: sResRef = "dun_bos_earlor"; break;
case 2: sResRef = "dun_bos_magele"; break;
}
}
else if (sTheme == "out1")
{
switch(Random(2))
{
case 0: sResRef = "dun_bos_whisla"; break;
case 1: sResRef = "dun_bos_blasla"; break;
}
}
else if (sTheme == "out2")
{
sResRef = "dun_bos_forque";
}
else if (sTheme == "out3")
{
switch(Random(4))
{
case 0: sResRef = "dun_bos_pitfiend"; break;
case 1: sResRef = "dun_bos_balrog"; break;
case 2: sResRef = "dun_bos_darklord"; break;
case 3: sResRef = "dun_bos_bebilith"; break;
}
}
else if (sTheme == "constructs")
{
switch(Random(4))
{
case 0: sResRef = "dun_bos_minogon"; break;
case 1: sResRef = "dun_bos_bonegol"; break;
case 2: sResRef = "dun_bos_adamgol"; break;
case 3: sResRef = "dun_bos_mithgol"; break;
}
}
return sResRef;
}
//Generate mystical item
string GenerateMystical()
{
string sResRef;
switch (Random(8))
{
case 0: sResRef = "anc_it_mys_am01"; break;
case 1: sResRef = "anc_it_mys_bo01"; break;
case 2: sResRef = "anc_it_mys_ri03"; break;
case 3: sResRef = "anc_it_mys_ri02"; break;
case 4: sResRef = "anc_it_mys_am02"; break;
case 5: sResRef = "anc_it_mys_ri01"; break;
case 6: sResRef = "anc_it_mys_gl01"; break;
case 7: sResRef = "anc_it_mys_gl02"; break;
}
return sResRef;
}
//Generate legendary item
string GenerateLegendary()
{
string sResRef;
switch (Random(13))
{
case 0: sResRef = "anc_it_leg_he04"; break;
case 1: sResRef = "anc_it_leg_he03"; break;
case 2: sResRef = "anc_it_leg_st01"; break;
case 3: sResRef = "anc_it_leg_he02"; break;
case 4: sResRef = "anc_it_leg_lb01"; break;
case 5: sResRef = "anc_it_leg_he01"; break;
case 6: sResRef = "anc_it_leg_dsw01"; break;
case 7: sResRef = "anc_it_leg_tsh01"; break;
case 8: sResRef = "anc_it_leg_dag01"; break;
case 9: sResRef = "anc_it_leg_bs01"; break;
case 10: sResRef = "anc_it_leg_arm01"; break;
case 11: sResRef = "anc_it_leg_bs02"; break;
case 12: sResRef = "anc_it_leg_sc01"; break;
}
return sResRef;
}
//Generate unique item
string GenerateUnique()
{
string sResRef;
if (Random(100)+1 <= 50) sResRef = GenerateMystical();
else sResRef = GenerateUnique();
return sResRef;
}
//Spawn dungeon monsters
void SpawnDungeonMonsters(object oArea, object oPC, int nLevel, int nPlayers)
{
string sAreaString = GetLocalString(oArea, "AreaString");
//select monster theme
string sTheme;
int nRandom = Random(100)+1;
if (nRandom <= 25) sTheme = "undead";
else if (nRandom <= 31) sTheme = "ele1";
else if (nRandom <= 38) sTheme = "ele2";
else if (nRandom <= 44) sTheme = "ele3";
else if (nRandom <= 50) sTheme = "ele4";
else if (nRandom <= 58) sTheme = "out1";
else if (nRandom <= 66) sTheme = "out2";
else if (nRandom <= 75) sTheme = "out3";
else sTheme = "constructs";
//spawn regular monsters
int i;
string sWPTag;
object oWP;
object oCreature;
for (i = 1; i <= 10; i++)
{
sWPTag = sAreaString + "_mob_" + IntToString(i);
oWP = GetWaypointByTag(sWPTag);
int j;
for (j = 1; j <= nPlayers; j++)
{
if (nLevel < 10)
{
oCreature = CreateObject(OBJECT_TYPE_CREATURE, RandomMinorMonster(sTheme), GetLocation(oWP));
LevelDungeonCreature(oCreature, nLevel, nPlayers);
AssignCommand(oCreature, ClearAllActions());
AssignCommand(oCreature, ActionRandomWalk());
}
else if (Random(10)+1 <= 6)
{
oCreature = CreateObject(OBJECT_TYPE_CREATURE, RandomMajorMonster(sTheme), GetLocation(oWP));
LevelDungeonCreature(oCreature, nLevel, nPlayers);
AssignCommand(oCreature, ClearAllActions());
AssignCommand(oCreature, ActionRandomWalk());
}
else
{
oCreature = CreateObject(OBJECT_TYPE_CREATURE, RandomMinorMonster(sTheme), GetLocation(oWP));
LevelDungeonCreature(oCreature, nLevel, nPlayers);
AssignCommand(oCreature, ClearAllActions());
AssignCommand(oCreature, ActionRandomWalk());
oCreature = CreateObject(OBJECT_TYPE_CREATURE, RandomMinorMonster(sTheme), GetLocation(oWP));
LevelDungeonCreature(oCreature, nLevel, nPlayers);
AssignCommand(oCreature, ClearAllActions());
AssignCommand(oCreature, ActionRandomWalk());
}
}
}
//spawn boss if appropriate (or regular creatures as a substitute on lower levels)
oWP = GetWaypointByTag(sAreaString + "_boss");
if (nLevel >= 20)
{
string sBoss = RandomBossMonster(sTheme);
oCreature = CreateObject(OBJECT_TYPE_CREATURE, sBoss, GetLocation(oWP));
LevelDungeonCreature(oCreature, nLevel, nPlayers);
//spawn boss loot
SpawnTreasure(oPC, oCreature);
if (Random(100) <= 7) CreateItemOnObject(GenerateUnique(), oCreature);
//make its inventory droppable - but we don't want potions, because bosses might drink them
object oItem = GetFirstItemInInventory(oCreature);
while (GetIsObjectValid(oItem))
{
SetDroppableFlag(oItem, TRUE);
if (GetBaseItemType(oItem) == BASE_ITEM_POTIONS) DestroyObject(oItem);
oItem = GetNextItemInInventory(oCreature);
}
//if the boss is a lich, spawn a phylactery
if (sBoss == "dun_bos_lich")
{
string sOrbWP = sAreaString + "_lichorb_" + IntToString(Random(3)+1);
object oOrb = CreateObject(OBJECT_TYPE_PLACEABLE, "anc_lich_phylact", GetLocation(GetWaypointByTag(sOrbWP)));
//adjust the phylactery's health based on level
int nOrbHP = 15*nLevel;
int nDamage = 1000-nOrbHP;
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDamage(nDamage), oOrb);
}
}
else if (nLevel >= 10)
{
oCreature = CreateObject(OBJECT_TYPE_CREATURE, RandomMajorMonster(sTheme), GetLocation(oWP));
LevelDungeonCreature(oCreature, nLevel, nPlayers);
oCreature = CreateObject(OBJECT_TYPE_CREATURE, RandomMajorMonster(sTheme), GetLocation(oWP));
LevelDungeonCreature(oCreature, nLevel, nPlayers);
}
else
{
oCreature = CreateObject(OBJECT_TYPE_CREATURE, RandomMinorMonster(sTheme), GetLocation(oWP));
LevelDungeonCreature(oCreature, nLevel, nPlayers);
oCreature = CreateObject(OBJECT_TYPE_CREATURE, RandomMinorMonster(sTheme), GetLocation(oWP));
LevelDungeonCreature(oCreature, nLevel, nPlayers);
}
}
//Connect dungeon entrance and interior areas
void ConnectDungeonAreas()
{
//Get the list of free areas
string sList = "sListDung";
object oList = GetLocalObject(GetModule(), sList);
//Get the number of free areas
int nCount = ListGetElementCount(oList);
//Randomly select a free area
int nElementIndex = Random(nCount)+1;
string sRandomAreaString = ListGetString(oList, nElementIndex);
//Store a waypoint tag of the interior on the exterior area
string sWPTag = "dungeon_wp_"+sRandomAreaString;
SetLocalString(OBJECT_SELF, "DungeonWP", sWPTag);
//Store a waypoint tag of the exterior on the interior area
string sAreaString = GetLocalString(OBJECT_SELF, "AreaString");
SetLocalString(GetArea(GetWaypointByTag(sWPTag)), "DungeonWP", "exit_wp_"+sAreaString+"_n");
//Delete the interior area from the list of free areas
int i;
for (i = 1; i <= ListGetElementCount(oList); i++)
{
if (ListGetString(oList, i) == sRandomAreaString) ListRemoveElement(oList, i);
}
}
//Level up a dungeon creature and apply appropriate bonuses
void LevelDungeonCreature(object oCreature, int nLevel, int nPlayers)
{
LevelHenchmanUpTo(oCreature, nLevel, CLASS_TYPE_INVALID, 0, GetCreatureStartingPackage(oCreature), PACKAGE_INVALID);
DelayCommand(0.5, ForceRest(oCreature));
effect eCreatureBonus;
//Get all parameters
int nBoostedSave = GetLocalInt(oCreature, "DungeonSave");
int nCreatureClass = GetLocalInt(oCreature, "DungeonClass");
int nCreatureThreat = GetLocalInt(oCreature, "DungeonThreat");
//Increase skills: spot, listen, concentrate, discipline based on creature class
int nConcentrationBonus = nLevel / 2;
int nDisciplineBonus = 3 * nLevel / 4;
int nSpotBonus = 3 * nLevel / 4;
int nListenBonus = 3 * nLevel / 4;
eCreatureBonus = EffectSkillIncrease(SKILL_SPOT, nSpotBonus);
eCreatureBonus = EffectLinkEffects(EffectSkillIncrease(SKILL_LISTEN, nListenBonus), eCreatureBonus);
if (nCreatureClass == DUN_CREATURE_CLASS_MAGE || nCreatureThreat == DUN_CREATURE_THREAT_BOSS) eCreatureBonus = EffectLinkEffects(EffectSkillIncrease(SKILL_DISCIPLINE, nDisciplineBonus), eCreatureBonus);
if (nCreatureClass == DUN_CREATURE_CLASS_WARRIOR || nCreatureThreat == DUN_CREATURE_THREAT_BOSS) eCreatureBonus = EffectLinkEffects(EffectSkillIncrease(SKILL_CONCENTRATION, nConcentrationBonus), eCreatureBonus);
eCreatureBonus = SupernaturalEffect(eCreatureBonus);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eCreatureBonus, oCreature);
//Add temporary health to bosses according to the number of players
int nMaxHP = GetMaxHitPoints(oCreature);
if (nCreatureThreat == DUN_CREATURE_THREAT_BOSS) ApplyEffectToObject(DURATION_TYPE_PERMANENT, SupernaturalEffect(EffectTemporaryHitpoints(nPlayers * (nMaxHP + nMaxHP / 2))), oCreature);
SetLocalInt(oCreature, "PlayersInParty", nPlayers); //for doom lords to know how many doom servants should be summoned and for formian queens to know the maximum number of servants that should be summoned
//Apply save boost
int nSaveValue = GetHitDice(oCreature) / 2;
if (nCreatureThreat == DUN_CREATURE_THREAT_MINOR && nSaveValue > 12) nSaveValue = 12;
ApplyEffectToObject(DURATION_TYPE_PERMANENT, SupernaturalEffect(EffectSavingThrowIncrease(nBoostedSave, nSaveValue)), oCreature);
//Boss warriors
if (nCreatureClass == DUN_CREATURE_CLASS_WARRIOR && nCreatureThreat == DUN_CREATURE_THREAT_BOSS)
{
if (nLevel == 39 || nLevel == 40) //levels 39-40
{
eCreatureBonus = EffectACIncrease(17, AC_ARMOUR_ENCHANTMENT_BONUS);
eCreatureBonus = EffectLinkEffects(EffectACIncrease(17, AC_DEFLECTION_BONUS), eCreatureBonus);
eCreatureBonus = EffectLinkEffects(EffectAttackIncrease(13), eCreatureBonus);
eCreatureBonus = EffectLinkEffects(EffectDamageIncrease(5, DAMAGE_TYPE_SLASHING), eCreatureBonus);
eCreatureBonus = SupernaturalEffect(eCreatureBonus);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eCreatureBonus, oCreature);
}
else if (nLevel == 37 || nLevel == 38) //levels 37-38
{
eCreatureBonus = EffectACIncrease(17, AC_ARMOUR_ENCHANTMENT_BONUS);
eCreatureBonus = EffectLinkEffects(EffectACIncrease(16, AC_DEFLECTION_BONUS), eCreatureBonus);
eCreatureBonus = EffectLinkEffects(EffectAttackIncrease(13), eCreatureBonus);
eCreatureBonus = EffectLinkEffects(EffectDamageIncrease(5, DAMAGE_TYPE_SLASHING), eCreatureBonus);
eCreatureBonus = SupernaturalEffect(eCreatureBonus);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eCreatureBonus, oCreature);
}
else if (nLevel == 35 || nLevel == 36) //levels 35-36
{
eCreatureBonus = EffectACIncrease(17, AC_ARMOUR_ENCHANTMENT_BONUS);
eCreatureBonus = EffectLinkEffects(EffectACIncrease(15, AC_DEFLECTION_BONUS), eCreatureBonus);
eCreatureBonus = EffectLinkEffects(EffectAttackIncrease(11), eCreatureBonus);
eCreatureBonus = EffectLinkEffects(EffectDamageIncrease(5, DAMAGE_TYPE_SLASHING), eCreatureBonus);
eCreatureBonus = SupernaturalEffect(eCreatureBonus);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eCreatureBonus, oCreature);
}
else if (nLevel == 33 || nLevel == 34) //levels 33-34
{
eCreatureBonus = EffectACIncrease(17, AC_ARMOUR_ENCHANTMENT_BONUS);
eCreatureBonus = EffectLinkEffects(EffectACIncrease(14, AC_DEFLECTION_BONUS), eCreatureBonus);
eCreatureBonus = EffectLinkEffects(EffectAttackIncrease(10), eCreatureBonus);
eCreatureBonus = EffectLinkEffects(EffectDamageIncrease(4, DAMAGE_TYPE_SLASHING), eCreatureBonus);
eCreatureBonus = SupernaturalEffect(eCreatureBonus);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eCreatureBonus, oCreature);
}
else if (nLevel == 31 || nLevel == 32) //levels 31-32
{
eCreatureBonus = EffectACIncrease(17, AC_ARMOUR_ENCHANTMENT_BONUS);
eCreatureBonus = EffectLinkEffects(EffectACIncrease(14, AC_DEFLECTION_BONUS), eCreatureBonus);
eCreatureBonus = EffectLinkEffects(EffectAttackIncrease(8), eCreatureBonus);
eCreatureBonus = EffectLinkEffects(EffectDamageIncrease(3, DAMAGE_TYPE_SLASHING), eCreatureBonus);
eCreatureBonus = SupernaturalEffect(eCreatureBonus);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eCreatureBonus, oCreature);
}
else if (nLevel == 29 || nLevel == 30) //levels 29-30
{
eCreatureBonus = EffectACIncrease(17, AC_ARMOUR_ENCHANTMENT_BONUS);
eCreatureBonus = EffectLinkEffects(EffectACIncrease(11, AC_DEFLECTION_BONUS), eCreatureBonus);
eCreatureBonus = EffectLinkEffects(EffectAttackIncrease(6), eCreatureBonus);
eCreatureBonus = SupernaturalEffect(eCreatureBonus);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eCreatureBonus, oCreature);
}
else if (nLevel == 27 || nLevel == 28) //levels 27-28
{
eCreatureBonus = EffectACIncrease(17, AC_ARMOUR_ENCHANTMENT_BONUS);
eCreatureBonus = EffectLinkEffects(EffectACIncrease(10, AC_DEFLECTION_BONUS), eCreatureBonus);
eCreatureBonus = EffectLinkEffects(EffectAttackIncrease(6), eCreatureBonus);
eCreatureBonus = SupernaturalEffect(eCreatureBonus);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eCreatureBonus, oCreature);
}
else if (nLevel == 25 || nLevel == 26) //levels 25-26
{
eCreatureBonus = EffectACIncrease(15, AC_ARMOUR_ENCHANTMENT_BONUS);
eCreatureBonus = EffectLinkEffects(EffectACIncrease(9, AC_DEFLECTION_BONUS), eCreatureBonus);
eCreatureBonus = EffectLinkEffects(EffectAttackIncrease(5), eCreatureBonus);
eCreatureBonus = SupernaturalEffect(eCreatureBonus);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eCreatureBonus, oCreature);
}
else if (nLevel == 23 || nLevel == 24) //levels 23-24
{
eCreatureBonus = EffectACIncrease(15, AC_ARMOUR_ENCHANTMENT_BONUS);
eCreatureBonus = EffectLinkEffects(EffectACIncrease(8, AC_DEFLECTION_BONUS), eCreatureBonus);
eCreatureBonus = EffectLinkEffects(EffectAttackIncrease(4), eCreatureBonus);
eCreatureBonus = SupernaturalEffect(eCreatureBonus);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eCreatureBonus, oCreature);
}
else //levels 21-22
{
eCreatureBonus = EffectACIncrease(15, AC_ARMOUR_ENCHANTMENT_BONUS);
eCreatureBonus = EffectLinkEffects(EffectACIncrease(8, AC_DEFLECTION_BONUS), eCreatureBonus);
eCreatureBonus = EffectLinkEffects(EffectAttackIncrease(3), eCreatureBonus);
eCreatureBonus = SupernaturalEffect(eCreatureBonus);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eCreatureBonus, oCreature);
}
}
//Major warriors
if (nCreatureClass == DUN_CREATURE_CLASS_WARRIOR && nCreatureThreat == DUN_CREATURE_THREAT_MAJOR)
{
if (nLevel == 39 || nLevel == 40) //levels 39-40
{
eCreatureBonus = EffectACIncrease(17, AC_ARMOUR_ENCHANTMENT_BONUS);
eCreatureBonus = EffectLinkEffects(EffectACIncrease(12, AC_DEFLECTION_BONUS), eCreatureBonus);
eCreatureBonus = EffectLinkEffects(EffectAttackIncrease(12), eCreatureBonus);
eCreatureBonus = SupernaturalEffect(eCreatureBonus);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eCreatureBonus, oCreature);
}
else if (nLevel == 37 || nLevel == 38) //levels 37-38
{
eCreatureBonus = EffectACIncrease(17, AC_ARMOUR_ENCHANTMENT_BONUS);
eCreatureBonus = EffectLinkEffects(EffectACIncrease(11, AC_DEFLECTION_BONUS), eCreatureBonus);
eCreatureBonus = EffectLinkEffects(EffectAttackIncrease(12), eCreatureBonus);
eCreatureBonus = SupernaturalEffect(eCreatureBonus);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eCreatureBonus, oCreature);
}
else if (nLevel == 35 || nLevel == 36) //levels 35-36
{
eCreatureBonus = EffectACIncrease(17, AC_ARMOUR_ENCHANTMENT_BONUS);
eCreatureBonus = EffectLinkEffects(EffectACIncrease(10, AC_DEFLECTION_BONUS), eCreatureBonus);
eCreatureBonus = EffectLinkEffects(EffectAttackIncrease(10), eCreatureBonus);
eCreatureBonus = SupernaturalEffect(eCreatureBonus);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eCreatureBonus, oCreature);
}
else if (nLevel == 33 || nLevel == 34) //levels 33-34
{
eCreatureBonus = EffectACIncrease(17, AC_ARMOUR_ENCHANTMENT_BONUS);
eCreatureBonus = EffectLinkEffects(EffectACIncrease(9, AC_DEFLECTION_BONUS), eCreatureBonus);
eCreatureBonus = EffectLinkEffects(EffectAttackIncrease(9), eCreatureBonus);
eCreatureBonus = SupernaturalEffect(eCreatureBonus);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eCreatureBonus, oCreature);
}
else if (nLevel == 31 || nLevel == 32) //levels 31-32
{
eCreatureBonus = EffectACIncrease(17, AC_ARMOUR_ENCHANTMENT_BONUS);
eCreatureBonus = EffectLinkEffects(EffectACIncrease(9, AC_DEFLECTION_BONUS), eCreatureBonus);
eCreatureBonus = EffectLinkEffects(EffectAttackIncrease(7), eCreatureBonus);
eCreatureBonus = SupernaturalEffect(eCreatureBonus);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eCreatureBonus, oCreature);
}
else if (nLevel == 29 || nLevel == 30) //levels 29-30
{
eCreatureBonus = EffectACIncrease(17, AC_ARMOUR_ENCHANTMENT_BONUS);
eCreatureBonus = EffectLinkEffects(EffectACIncrease(6, AC_DEFLECTION_BONUS), eCreatureBonus);
eCreatureBonus = EffectLinkEffects(EffectAttackIncrease(5), eCreatureBonus);
eCreatureBonus = SupernaturalEffect(eCreatureBonus);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eCreatureBonus, oCreature);
}
else if (nLevel == 27 || nLevel == 28) //levels 27-28
{
eCreatureBonus = EffectACIncrease(17, AC_ARMOUR_ENCHANTMENT_BONUS);
eCreatureBonus = EffectLinkEffects(EffectACIncrease(5, AC_DEFLECTION_BONUS), eCreatureBonus);
eCreatureBonus = EffectLinkEffects(EffectAttackIncrease(5), eCreatureBonus);
eCreatureBonus = SupernaturalEffect(eCreatureBonus);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eCreatureBonus, oCreature);
}
else if (nLevel == 25 || nLevel == 26) //levels 25-26
{
eCreatureBonus = EffectACIncrease(15, AC_ARMOUR_ENCHANTMENT_BONUS);
eCreatureBonus = EffectLinkEffects(EffectACIncrease(4, AC_DEFLECTION_BONUS), eCreatureBonus);
eCreatureBonus = EffectLinkEffects(EffectAttackIncrease(4), eCreatureBonus);
eCreatureBonus = SupernaturalEffect(eCreatureBonus);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eCreatureBonus, oCreature);
}
else if (nLevel == 23 || nLevel == 24) //levels 23-24
{
eCreatureBonus = EffectACIncrease(15, AC_ARMOUR_ENCHANTMENT_BONUS);
eCreatureBonus = EffectLinkEffects(EffectACIncrease(3, AC_DEFLECTION_BONUS), eCreatureBonus);
eCreatureBonus = EffectLinkEffects(EffectAttackIncrease(3), eCreatureBonus);
eCreatureBonus = SupernaturalEffect(eCreatureBonus);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eCreatureBonus, oCreature);
}
else if (nLevel == 21 || nLevel == 22) //levels 21-22
{
eCreatureBonus = EffectACIncrease(15, AC_ARMOUR_ENCHANTMENT_BONUS);
eCreatureBonus = EffectLinkEffects(EffectACIncrease(3, AC_DEFLECTION_BONUS), eCreatureBonus);
eCreatureBonus = EffectLinkEffects(EffectAttackIncrease(3), eCreatureBonus);
eCreatureBonus = SupernaturalEffect(eCreatureBonus);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eCreatureBonus, oCreature);
}
else if (nLevel == 19 || nLevel == 20) //levels 19-20
{
eCreatureBonus = EffectACIncrease(12, AC_ARMOUR_ENCHANTMENT_BONUS);
eCreatureBonus = EffectLinkEffects(EffectACIncrease(2, AC_DEFLECTION_BONUS), eCreatureBonus);
eCreatureBonus = EffectLinkEffects(EffectAttackIncrease(3), eCreatureBonus);
eCreatureBonus = SupernaturalEffect(eCreatureBonus);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eCreatureBonus, oCreature);
}
else if (nLevel == 17 || nLevel == 18) //levels 17-18
{
eCreatureBonus = EffectACIncrease(12, AC_ARMOUR_ENCHANTMENT_BONUS);
eCreatureBonus = EffectLinkEffects(EffectACIncrease(1, AC_DEFLECTION_BONUS), eCreatureBonus);
eCreatureBonus = EffectLinkEffects(EffectAttackIncrease(3), eCreatureBonus);
eCreatureBonus = SupernaturalEffect(eCreatureBonus);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eCreatureBonus, oCreature);
}
else if (nLevel == 15 || nLevel == 16) //levels 15-16
{
eCreatureBonus = EffectACIncrease(12, AC_ARMOUR_ENCHANTMENT_BONUS);
eCreatureBonus = EffectLinkEffects(EffectAttackIncrease(2), eCreatureBonus);
eCreatureBonus = SupernaturalEffect(eCreatureBonus);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eCreatureBonus, oCreature);
}
else if (nLevel == 13 || nLevel == 14) //levels 13-14
{
eCreatureBonus = EffectACIncrease(11, AC_ARMOUR_ENCHANTMENT_BONUS);
eCreatureBonus = EffectLinkEffects(EffectAttackIncrease(2), eCreatureBonus);
eCreatureBonus = SupernaturalEffect(eCreatureBonus);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eCreatureBonus, oCreature);
}
else if (nLevel == 11 || nLevel == 12) //levels 11-12
{
eCreatureBonus = EffectACIncrease(10, AC_ARMOUR_ENCHANTMENT_BONUS);
eCreatureBonus = EffectLinkEffects(EffectAttackIncrease(1), eCreatureBonus);
eCreatureBonus = SupernaturalEffect(eCreatureBonus);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eCreatureBonus, oCreature);
}
else //level 10
{
eCreatureBonus = EffectACIncrease(9, AC_ARMOUR_ENCHANTMENT_BONUS);
eCreatureBonus = EffectLinkEffects(EffectAttackIncrease(1), eCreatureBonus);
eCreatureBonus = SupernaturalEffect(eCreatureBonus);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eCreatureBonus, oCreature);
}
}
//Minor warriors
if (nCreatureClass == DUN_CREATURE_CLASS_WARRIOR && nCreatureThreat == DUN_CREATURE_THREAT_MINOR)
{
if (nLevel >= 38 && nLevel <= 40) //levels 38-40 (encounters consisting of two minor enemies)
{
eCreatureBonus = EffectACIncrease(14, AC_ARMOUR_ENCHANTMENT_BONUS);
eCreatureBonus = EffectLinkEffects(EffectAttackIncrease(10), eCreatureBonus);
eCreatureBonus = EffectLinkEffects(EffectDamageIncrease(7, DAMAGE_TYPE_SLASHING), eCreatureBonus);
eCreatureBonus = SupernaturalEffect(eCreatureBonus);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eCreatureBonus, oCreature);
}
else if (nLevel >= 34 && nLevel <= 37) //levels 34-37 (encounters consisting of two minor enemies)
{
eCreatureBonus = EffectACIncrease(12, AC_ARMOUR_ENCHANTMENT_BONUS);
eCreatureBonus = EffectLinkEffects(EffectAttackIncrease(8), eCreatureBonus);
eCreatureBonus = EffectLinkEffects(EffectDamageIncrease(5, DAMAGE_TYPE_SLASHING), eCreatureBonus);
eCreatureBonus = SupernaturalEffect(eCreatureBonus);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eCreatureBonus, oCreature);
}
else if (nLevel >= 31 && nLevel <= 33) //levels 31-33 (encounters consisting of two minor enemies)
{
eCreatureBonus = EffectACIncrease(11, AC_ARMOUR_ENCHANTMENT_BONUS);
eCreatureBonus = EffectLinkEffects(EffectAttackIncrease(6), eCreatureBonus);
eCreatureBonus = EffectLinkEffects(EffectDamageIncrease(4, DAMAGE_TYPE_SLASHING), eCreatureBonus);
eCreatureBonus = SupernaturalEffect(eCreatureBonus);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eCreatureBonus, oCreature);
}
else if (nLevel >= 27 && nLevel <= 30) //levels 27-30 (encounters consisting of two minor enemies)
{
eCreatureBonus = EffectACIncrease(10, AC_ARMOUR_ENCHANTMENT_BONUS);
eCreatureBonus = EffectLinkEffects(EffectAttackIncrease(5), eCreatureBonus);
eCreatureBonus = EffectLinkEffects(EffectDamageIncrease(2, DAMAGE_TYPE_SLASHING), eCreatureBonus);
eCreatureBonus = SupernaturalEffect(eCreatureBonus);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eCreatureBonus, oCreature);
}
else if (nLevel >= 25 && nLevel <= 26) //levels 25-26 (encounters consisting of two minor enemies)
{
eCreatureBonus = EffectACIncrease(9, AC_ARMOUR_ENCHANTMENT_BONUS);
eCreatureBonus = EffectLinkEffects(EffectAttackIncrease(3), eCreatureBonus);
eCreatureBonus = EffectLinkEffects(EffectDamageIncrease(2, DAMAGE_TYPE_SLASHING), eCreatureBonus);
eCreatureBonus = SupernaturalEffect(eCreatureBonus);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eCreatureBonus, oCreature);
}
else if (nLevel >= 10 && nLevel <= 24) //levels 10-20 (encounters consisting of two minor enemies)
{
eCreatureBonus = EffectACIncrease(7, AC_ARMOUR_ENCHANTMENT_BONUS);
eCreatureBonus = EffectLinkEffects(EffectAttackIncrease(3), eCreatureBonus);
eCreatureBonus = SupernaturalEffect(eCreatureBonus);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eCreatureBonus, oCreature);
}
else if (nLevel == 9) //level 9
{
eCreatureBonus = EffectACIncrease(9, AC_ARMOUR_ENCHANTMENT_BONUS);
eCreatureBonus = EffectLinkEffects(EffectAttackIncrease(5), eCreatureBonus);
eCreatureBonus = EffectLinkEffects(EffectDamageIncrease(2, DAMAGE_TYPE_SLASHING), eCreatureBonus);
eCreatureBonus = SupernaturalEffect(eCreatureBonus);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eCreatureBonus, oCreature);
}
else if (nLevel == 8) //level 8
{
eCreatureBonus = EffectACIncrease(9, AC_ARMOUR_ENCHANTMENT_BONUS);
eCreatureBonus = EffectLinkEffects(EffectAttackIncrease(5), eCreatureBonus);
eCreatureBonus = EffectLinkEffects(EffectDamageIncrease(2, DAMAGE_TYPE_SLASHING), eCreatureBonus);
eCreatureBonus = SupernaturalEffect(eCreatureBonus);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eCreatureBonus, oCreature);
}
else if (nLevel == 7) //level 7
{
eCreatureBonus = EffectACIncrease(7, AC_ARMOUR_ENCHANTMENT_BONUS);
eCreatureBonus = EffectLinkEffects(EffectAttackIncrease(5), eCreatureBonus);
eCreatureBonus = EffectLinkEffects(EffectDamageIncrease(2, DAMAGE_TYPE_SLASHING), eCreatureBonus);
eCreatureBonus = SupernaturalEffect(eCreatureBonus);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eCreatureBonus, oCreature);
}
else if (nLevel == 6) //level 6
{
eCreatureBonus = EffectACIncrease(5, AC_ARMOUR_ENCHANTMENT_BONUS);
eCreatureBonus = EffectLinkEffects(EffectAttackIncrease(5), eCreatureBonus);
eCreatureBonus = SupernaturalEffect(eCreatureBonus);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eCreatureBonus, oCreature);
}
else //level 5
{
eCreatureBonus = EffectACIncrease(3, AC_ARMOUR_ENCHANTMENT_BONUS);
eCreatureBonus = EffectLinkEffects(EffectAttackIncrease(4), eCreatureBonus);
eCreatureBonus = SupernaturalEffect(eCreatureBonus);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eCreatureBonus, oCreature);
}
}
if (nCreatureClass == DUN_CREATURE_CLASS_MAGE)
{
if (nLevel == 39 || nLevel == 40) //levels 39-40
{
eCreatureBonus = EffectACIncrease(15, AC_ARMOUR_ENCHANTMENT_BONUS);
eCreatureBonus = EffectLinkEffects(EffectACIncrease(12, AC_DEFLECTION_BONUS), eCreatureBonus);
eCreatureBonus = SupernaturalEffect(eCreatureBonus);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eCreatureBonus, oCreature);
}
else if (nLevel == 37 || nLevel == 38) //levels 37-38
{
eCreatureBonus = EffectACIncrease(15, AC_ARMOUR_ENCHANTMENT_BONUS);
eCreatureBonus = EffectLinkEffects(EffectACIncrease(11, AC_DEFLECTION_BONUS), eCreatureBonus);
eCreatureBonus = SupernaturalEffect(eCreatureBonus);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eCreatureBonus, oCreature);
}
else if (nLevel == 35 || nLevel == 36) //levels 35-36
{
eCreatureBonus = EffectACIncrease(15, AC_ARMOUR_ENCHANTMENT_BONUS);
eCreatureBonus = EffectLinkEffects(EffectACIncrease(10, AC_DEFLECTION_BONUS), eCreatureBonus);
eCreatureBonus = SupernaturalEffect(eCreatureBonus);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eCreatureBonus, oCreature);
}
else if (nLevel == 33 || nLevel == 34) //levels 33-34
{
eCreatureBonus = EffectACIncrease(15, AC_ARMOUR_ENCHANTMENT_BONUS);
eCreatureBonus = EffectLinkEffects(EffectACIncrease(9, AC_DEFLECTION_BONUS), eCreatureBonus);
eCreatureBonus = SupernaturalEffect(eCreatureBonus);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eCreatureBonus, oCreature);
}
else if (nLevel == 31 || nLevel == 32) //levels 31-32
{
eCreatureBonus = EffectACIncrease(15, AC_ARMOUR_ENCHANTMENT_BONUS);
eCreatureBonus = EffectLinkEffects(EffectACIncrease(9, AC_DEFLECTION_BONUS), eCreatureBonus);
eCreatureBonus = SupernaturalEffect(eCreatureBonus);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eCreatureBonus, oCreature);
}
else if (nLevel == 29 || nLevel == 30) //levels 29-30
{
eCreatureBonus = EffectACIncrease(15, AC_ARMOUR_ENCHANTMENT_BONUS);
eCreatureBonus = EffectLinkEffects(EffectACIncrease(6, AC_DEFLECTION_BONUS), eCreatureBonus);
eCreatureBonus = SupernaturalEffect(eCreatureBonus);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eCreatureBonus, oCreature);
}
else if (nLevel == 27 || nLevel == 28) //levels 27-28
{
eCreatureBonus = EffectACIncrease(15, AC_ARMOUR_ENCHANTMENT_BONUS);
eCreatureBonus = EffectLinkEffects(EffectACIncrease(5, AC_DEFLECTION_BONUS), eCreatureBonus);
eCreatureBonus = SupernaturalEffect(eCreatureBonus);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eCreatureBonus, oCreature);
}
else if (nLevel == 25 || nLevel == 26) //levels 25-26
{
eCreatureBonus = EffectACIncrease(13, AC_ARMOUR_ENCHANTMENT_BONUS);
eCreatureBonus = EffectLinkEffects(EffectACIncrease(4, AC_DEFLECTION_BONUS), eCreatureBonus);
eCreatureBonus = SupernaturalEffect(eCreatureBonus);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eCreatureBonus, oCreature);
}
else if (nLevel == 23 || nLevel == 24) //levels 23-24
{
eCreatureBonus = EffectACIncrease(13, AC_ARMOUR_ENCHANTMENT_BONUS);
eCreatureBonus = EffectLinkEffects(EffectACIncrease(3, AC_DEFLECTION_BONUS), eCreatureBonus);
eCreatureBonus = SupernaturalEffect(eCreatureBonus);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eCreatureBonus, oCreature);
}
else if (nLevel == 21 || nLevel == 22) //levels 21-22
{
eCreatureBonus = EffectACIncrease(13, AC_ARMOUR_ENCHANTMENT_BONUS);
eCreatureBonus = EffectLinkEffects(EffectACIncrease(3, AC_DEFLECTION_BONUS), eCreatureBonus);
eCreatureBonus = SupernaturalEffect(eCreatureBonus);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eCreatureBonus, oCreature);
}
else if (nLevel == 19 || nLevel == 20) //levels 19-20
{
eCreatureBonus = EffectACIncrease(10, AC_ARMOUR_ENCHANTMENT_BONUS);
eCreatureBonus = EffectLinkEffects(EffectACIncrease(2, AC_DEFLECTION_BONUS), eCreatureBonus);
eCreatureBonus = SupernaturalEffect(eCreatureBonus);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eCreatureBonus, oCreature);
}
else if (nLevel == 17 || nLevel == 18) //levels 17-18
{
eCreatureBonus = EffectACIncrease(10, AC_ARMOUR_ENCHANTMENT_BONUS);
eCreatureBonus = EffectLinkEffects(EffectACIncrease(1, AC_DEFLECTION_BONUS), eCreatureBonus);
eCreatureBonus = SupernaturalEffect(eCreatureBonus);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eCreatureBonus, oCreature);
}
else if (nLevel == 15 || nLevel == 16) //levels 15-16
{
eCreatureBonus = EffectACIncrease(10, AC_ARMOUR_ENCHANTMENT_BONUS);
eCreatureBonus = SupernaturalEffect(eCreatureBonus);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eCreatureBonus, oCreature);
}
else if (nLevel == 13 || nLevel == 14) //levels 13-14
{
eCreatureBonus = EffectACIncrease(9, AC_ARMOUR_ENCHANTMENT_BONUS);
eCreatureBonus = SupernaturalEffect(eCreatureBonus);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eCreatureBonus, oCreature);
}
else if (nLevel == 11 || nLevel == 12) //levels 11-12
{
eCreatureBonus = EffectACIncrease(8, AC_ARMOUR_ENCHANTMENT_BONUS);
eCreatureBonus = SupernaturalEffect(eCreatureBonus);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eCreatureBonus, oCreature);
}
else //level 10
{
eCreatureBonus = EffectACIncrease(7, AC_ARMOUR_ENCHANTMENT_BONUS);
eCreatureBonus = SupernaturalEffect(eCreatureBonus);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eCreatureBonus, oCreature);
}
}
}