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

1263 lines
76 KiB
Plaintext

//This is where the fun begins. Spawn the henchman, change his name and surname to the ones established earlier,
//randomize his appearance and create his equipment that is more or less suitable for his level.
#include "nw_i0_generic"
#include "69_hench_lib"
void SaveHenchman(object oPC, object oHenchman)
{
int nHenchPosition;
if(GetCampaignString(CharacterDB(oPC), "HENCH_1_NAME") == "") nHenchPosition = 1;
else if(GetCampaignString(CharacterDB(oPC), "HENCH_2_NAME") == "") nHenchPosition = 2;
else if(GetCampaignString(CharacterDB(oPC), "HENCH_3_NAME") == "") nHenchPosition = 3;
else return;
SetLocalInt(oHenchman, "HenchPosition", nHenchPosition);
string sHenchPosition = IntToString(nHenchPosition);
string sHenchName = GetName(oHenchman);
int nHenchNumber = GetCampaignInt(CharacterDB(oPC), "HENCH_NUMBER");
SetCampaignInt(CharacterDB(oPC), "HENCH_NUMBER", nHenchNumber+1);
StoreCampaignObject(CharacterDB(oPC), "HENCH_"+sHenchPosition, oHenchman);
DelayCommand(1.0, SetCampaignString(CharacterDB(oPC), "HENCH_"+sHenchPosition+"_NAME", sHenchName));
}
void main()
{
object oHenchman;
object oPC = GetPCSpeaker();
int nAutoLevelup = GetLocalInt(GetModule(), "nAutoLevelup");
//Change the "barbarian" part to "barb" for barbarian halflings, half-orcs and half-elves (otherwise the resref is too long)
if (GetLocalString(oPC, "henchman") == "na_barbarian_m")
{
if ((GetLocalString(oPC, "hench_race") == "_ha") || (GetLocalString(oPC, "hench_race") == "_ho") || (GetLocalString(oPC, "hench_race") == "_he"))
{
SetLocalString(oPC, "henchman", "na_barb_m");
}
}
if (GetLocalString(oPC, "henchman") == "na_barbarian_f")
{
if ((GetLocalString(oPC, "hench_race") == "_ha") || (GetLocalString(oPC, "hench_race") == "_ho") || (GetLocalString(oPC, "hench_race") == "_he"))
{
SetLocalString(oPC, "henchman", "na_barb_f");
}
}
//Finished changing the resref part
//Spawn the henchman
oHenchman = CreateObject(OBJECT_TYPE_CREATURE, (GetLocalString(oPC, "henchman")+GetLocalString(oPC, "hench_race")), GetLocation(oPC));
SetLocalInt(oHenchman, "JustSpawned", TRUE);
DelayCommand(1.0, DeleteLocalInt(oHenchman, "JustSpawned"));
//if(nAutoLevelup == 1 && GetCanLevelUp69(oPC, oHenchman))
//{
DelayCommand(1.0, LevelUpHenchman69(oHenchman, oPC, 1));
//}
//ActionStartConversation(oHenchman);
//Change his name and surname
SetLocalString(oPC, "fullname", (GetLocalString(oPC, GetLocalString(oPC, "hench_name"))+" "+(GetLocalString(oPC, GetLocalString(oPC, "hench_surname")))));
SetName(oHenchman, GetLocalString(oPC, "fullname"));
//Randomize appearance; starting with hair color
switch(d6())
{
case 1: SetColor(oHenchman, COLOR_CHANNEL_HAIR, 11);break;
case 2: SetColor(oHenchman, COLOR_CHANNEL_HAIR, 2);break;
case 3: SetColor(oHenchman, COLOR_CHANNEL_HAIR, 135);break;
case 4: SetColor(oHenchman, COLOR_CHANNEL_HAIR, 16);break;
case 5: SetColor(oHenchman, COLOR_CHANNEL_HAIR, 7);break;
case 6: SetColor(oHenchman, COLOR_CHANNEL_HAIR, 15);break;
}
//Randomize phenotype; elves and half-elves should be fat veeery rarely
if ( GetRacialType(oHenchman) == RACIAL_TYPE_ELF ||
GetRacialType(oHenchman) == RACIAL_TYPE_HALFELF )
{
SetLocalInt(oHenchman, "Chance", 3);
}
else
{
SetLocalInt(oHenchman, "Chance", 15);
}
if ( Random(100) < GetLocalInt(oHenchman, "Chance"))
{
SetPhenoType(PHENOTYPE_BIG, oHenchman);
}
else
{
SetPhenoType(PHENOTYPE_NORMAL, oHenchman);
}
//Randomize skin color; only for humans, elves and dwarves (in case of elves and dwarves, allow them to be drow and duergar, respectively)
if ( GetRacialType(oHenchman) == RACIAL_TYPE_HUMAN )
{
if ( Random(100) < 16)
{
SetColor(oHenchman, COLOR_CHANNEL_SKIN, 7);
}
else
{
SetColor(oHenchman, COLOR_CHANNEL_SKIN, 2);
}
}
if ( GetRacialType(oHenchman) == RACIAL_TYPE_ELF )
{
if ( Random(100) < 10)
{
SetColor(oHenchman, COLOR_CHANNEL_SKIN, 134);
SetLocalString(oHenchman, "subrace", "drow");
}
else
{
SetColor(oHenchman, COLOR_CHANNEL_SKIN, 1);
}
}
if ( GetRacialType(oHenchman) == RACIAL_TYPE_DWARF )
{
if ( Random(100) < 10)
{
SetColor(oHenchman, COLOR_CHANNEL_SKIN, 42);
SetLocalString(oHenchman, "subrace", "duergar");
}
else
{
SetColor(oHenchman, COLOR_CHANNEL_SKIN, 2);
}
}
//Randomize head; choose any head from the default ones numbered 1 to 10
SetLocalInt(oHenchman, "head", d10());
SetCreatureBodyPart(CREATURE_PART_HEAD, GetLocalInt(oHenchman, "head"), oHenchman);
//Create equipment based on the henchman's class and, to some extent, level (use PC's level instead, since it's the same anyway and works better)
object oArmor;
object oWeapon;
object oHelmet;
object oShield;
object oBoots;
object oGloves;
object oCloak;
object oRing1;
object oRing2;
object oAmulet;
object oPotion1;
object oPotion2;
object oPotion3;
object oAmmo;
object oAmmo2;
object oAmmo3;
//If the henchman is a fighter or a paladin:
if ( GetLevelByClass(CLASS_TYPE_FIGHTER, oHenchman) > 0 ||
GetLevelByClass(CLASS_TYPE_PALADIN, oHenchman) > 0 )
{
if ( GetHitDice(oPC) <= 2 )
{
oArmor = CreateItemOnObject("NW_AARCL012", oHenchman); //Koszulka kolcza
if ( GetRacialType(oHenchman) == RACIAL_TYPE_GNOME || GetRacialType(oHenchman) == RACIAL_TYPE_HALFLING )
{oWeapon = CreateItemOnObject("NW_WSWSS001", oHenchman);} //Krotki miecz
else {oWeapon = CreateItemOnObject("NW_WSWLS001", oHenchman);} //Dlugi miecz
oPotion1 = CreateItemOnObject("na_hench_pot1", oHenchman);
oPotion2 = CreateItemOnObject("na_hench_pot12", oHenchman);
oPotion3 = CreateItemOnObject("na_hench_pot13", oHenchman);
}
else if ( GetHitDice(oPC) <= 5 )
{
oArmor = CreateItemOnObject("NW_MAARCL046", oHenchman); //Koszulka kolcza +1
if ( GetRacialType(oHenchman) == RACIAL_TYPE_GNOME || GetRacialType(oHenchman) == RACIAL_TYPE_HALFLING )
{oWeapon = CreateItemOnObject("NW_WSWMSS002", oHenchman);} //Krotki miecz +1
else {oWeapon = CreateItemOnObject("NW_WSWMLS002", oHenchman);} //Dlugi miecz +1
oPotion1 = CreateItemOnObject("na_hench_pot2", oHenchman);
oPotion2 = CreateItemOnObject("na_hench_pot22", oHenchman);
oPotion3 = CreateItemOnObject("na_hench_pot23", oHenchman);
}
else if ( GetHitDice(oPC) <= 10 )
{
oArmor = CreateItemOnObject("NW_MAARCL066", oHenchman); //Kolczuga +2
if ( GetRacialType(oHenchman) == RACIAL_TYPE_GNOME || GetRacialType(oHenchman) == RACIAL_TYPE_HALFLING )
{oWeapon = CreateItemOnObject("NW_WSWMSS011", oHenchman);} //Krotki miecz +3
else {oWeapon = CreateItemOnObject("NW_WSWMLS012", oHenchman);} //Dlugi miecz +3
oPotion1 = CreateItemOnObject("na_hench_pot3", oHenchman);
oPotion2 = CreateItemOnObject("na_hench_pot32", oHenchman);
oPotion3 = CreateItemOnObject("na_hench_pot33", oHenchman);
}
else if ( GetHitDice(oPC) <= 15 )
{
oArmor = CreateItemOnObject("NW_MAARCL068", oHenchman); //Pelna zbroja plytowa +2
if ( GetRacialType(oHenchman) == RACIAL_TYPE_GNOME || GetRacialType(oHenchman) == RACIAL_TYPE_HALFLING )
{oWeapon = CreateItemOnObject("X0_WSWMSS001", oHenchman); //Krotki miecz +4
oShield = CreateItemOnObject("X0_ASHMSW001", oHenchman);} //Mala tarcza +4
else {oWeapon = CreateItemOnObject("X0_WSWMLS001", oHenchman); //Dlugi miecz +4
oShield = CreateItemOnObject("X0_ASHMLW001", oHenchman);} //Duza tarcza +4
oPotion1 = CreateItemOnObject("na_hench_pot4", oHenchman);
oPotion2 = CreateItemOnObject("na_hench_pot42", oHenchman);
oPotion3 = CreateItemOnObject("na_hench_pot43", oHenchman);
}
else if ( GetHitDice(oPC) <= 20 )
{
oArmor = CreateItemOnObject("NW_MAARCL080", oHenchman); //Pelna zbroja plytowa +3
if ( GetRacialType(oHenchman) == RACIAL_TYPE_GNOME || GetRacialType(oHenchman) == RACIAL_TYPE_HALFLING )
{oWeapon = CreateItemOnObject("NW_WSWMSS009", oHenchman); //Krotki miecz +5
oShield = CreateItemOnObject("X0_ASHMSW002", oHenchman);} //Mala tarcza +5
else {oWeapon = CreateItemOnObject("X0_WSWMLS002", oHenchman); //Dlugi miecz +5
oShield = CreateItemOnObject("X0_ASHMLW002", oHenchman);} //Duza tarcza +5
oPotion1 = CreateItemOnObject("na_hench_pot5", oHenchman);
oPotion2 = CreateItemOnObject("na_hench_pot52", oHenchman);
oPotion3 = CreateItemOnObject("na_hench_pot53", oHenchman);
}
else if ( GetHitDice(oPC) <= 25 )
{
oArmor = CreateItemOnObject("X0_MAARCL023", oHenchman); //Pelna zbroja plytowa +4
if ( GetRacialType(oHenchman) == RACIAL_TYPE_GNOME || GetRacialType(oHenchman) == RACIAL_TYPE_HALFLING )
{oWeapon = CreateItemOnObject("X2_WSWMSS003", oHenchman); //Krotki miecz +6
oShield = CreateItemOnObject("X2_ASHMLW003", oHenchman);} //Duza tarcza +6
else {oWeapon = CreateItemOnObject("X2_WSWMLS003", oHenchman); //Dlugi miecz +6
oShield = CreateItemOnObject("X2_ASHMTO003", oHenchman);} //Pawez +6
oPotion1 = CreateItemOnObject("na_hench_pot5", oHenchman);
oPotion2 = CreateItemOnObject("na_hench_pot52", oHenchman);
oPotion3 = CreateItemOnObject("na_hench_pot53", oHenchman);
}
else if ( GetHitDice(oPC) <= 30 )
{
oArmor = CreateItemOnObject("X2_MAARCL047", oHenchman); //Pelna zbroja plytowa +6
if ( GetRacialType(oHenchman) == RACIAL_TYPE_GNOME || GetRacialType(oHenchman) == RACIAL_TYPE_HALFLING )
{oWeapon = CreateItemOnObject("X2_WSWMSS004", oHenchman); //Krotki miecz +7
oShield = CreateItemOnObject("na_largeshield8", oHenchman);} //Duza tarcza +8
else {oWeapon = CreateItemOnObject("X2_WSWMLS004", oHenchman); //Dlugi miecz +7
oShield = CreateItemOnObject("na_towershield8", oHenchman);} //Pawez +8
oPotion1 = CreateItemOnObject("na_hench_pot5", oHenchman);
oPotion2 = CreateItemOnObject("na_hench_pot52", oHenchman);
oPotion3 = CreateItemOnObject("na_hench_pot53", oHenchman);
}
else if ( GetHitDice(oPC) <= 35 )
{
oArmor = CreateItemOnObject("X2_MAARCL048", oHenchman); //Pelna zbroja plytowa +7
if ( GetRacialType(oHenchman) == RACIAL_TYPE_GNOME || GetRacialType(oHenchman) == RACIAL_TYPE_HALFLING )
{oWeapon = CreateItemOnObject("X2_WSWMSS004", oHenchman); //Krotki miecz +7
oShield = CreateItemOnObject("na_largeshield9", oHenchman);} //Duza tarcza +9
else {oWeapon = CreateItemOnObject("X2_WSWMLS004", oHenchman); //Dlugi miecz +7
oShield = CreateItemOnObject("na_towershield9", oHenchman);} //Pawez +9
oPotion1 = CreateItemOnObject("na_hench_pot5", oHenchman);
oPotion2 = CreateItemOnObject("na_hench_pot52", oHenchman);
oPotion3 = CreateItemOnObject("na_hench_pot53", oHenchman);
}
else if ( GetHitDice(oPC) <= 39 )
{
oArmor = CreateItemOnObject("na_pzp_10", oHenchman); //Pelna zbroja plytowa +10
if ( GetRacialType(oHenchman) == RACIAL_TYPE_GNOME || GetRacialType(oHenchman) == RACIAL_TYPE_HALFLING )
{oWeapon = CreateItemOnObject("na_shortsword8", oHenchman); //Krotki miecz +8
oShield = CreateItemOnObject("na_largeshield9", oHenchman);} //Duza tarcza +9
else {oWeapon = CreateItemOnObject("na_longsword8", oHenchman); //Dlugi miecz +8
oShield = CreateItemOnObject("na_towershield9", oHenchman);} //Pawez +9
oPotion1 = CreateItemOnObject("na_hench_pot5", oHenchman);
oPotion2 = CreateItemOnObject("na_hench_pot52", oHenchman);
oPotion3 = CreateItemOnObject("na_hench_pot53", oHenchman);
}
else
{
oArmor = CreateItemOnObject("na_pzp_16", oHenchman); //Pelna zbroja plytowa +16
if ( GetRacialType(oHenchman) == RACIAL_TYPE_GNOME || GetRacialType(oHenchman) == RACIAL_TYPE_HALFLING )
{oWeapon = CreateItemOnObject("na_shortsword14", oHenchman); //Krotki miecz +14
oShield = CreateItemOnObject("na_largeshield15", oHenchman);} //Duza tarcza +15
else {oWeapon = CreateItemOnObject("na_longsword14", oHenchman); //Dlugi miecz +14
oShield = CreateItemOnObject("na_towershield15", oHenchman);} //Pawez +15
oPotion1 = CreateItemOnObject("na_hench_pot5", oHenchman);
oPotion2 = CreateItemOnObject("na_hench_pot52", oHenchman);
oPotion3 = CreateItemOnObject("na_hench_pot53", oHenchman);
}
}
//If the henchman is a wizard or a sorcerer:
if ( GetLevelByClass(CLASS_TYPE_WIZARD, oHenchman) > 0 ||
GetLevelByClass(CLASS_TYPE_SORCERER, oHenchman) > 0 )
{
SetLocalString(oHenchman, "SummonCreature", "na_hench_familiar");
if ( GetHitDice(oPC) <= 2 )
{
oPotion1 = CreateItemOnObject("na_hench_pot1", oHenchman);
oPotion2 = CreateItemOnObject("na_hench_pot12", oHenchman);
oPotion3 = CreateItemOnObject("na_hench_pot13", oHenchman);
}
else if ( GetHitDice(oPC) <= 5 )
{
oPotion1 = CreateItemOnObject("na_hench_pot2", oHenchman);
oPotion2 = CreateItemOnObject("na_hench_pot22", oHenchman);
oPotion3 = CreateItemOnObject("na_hench_pot23", oHenchman);
}
else if ( GetHitDice(oPC) <= 10 )
{
oPotion1 = CreateItemOnObject("na_hench_pot3", oHenchman);
oPotion2 = CreateItemOnObject("na_hench_pot32", oHenchman);
oPotion3 = CreateItemOnObject("na_hench_pot33", oHenchman);
}
else if ( GetHitDice(oPC) <= 15 )
{
oPotion1 = CreateItemOnObject("na_hench_pot4", oHenchman);
oPotion2 = CreateItemOnObject("na_hench_pot42", oHenchman);
oPotion3 = CreateItemOnObject("na_hench_pot43", oHenchman);
}
else if ( GetHitDice(oPC) <= 20 )
{
oPotion1 = CreateItemOnObject("na_hench_pot5", oHenchman);
oPotion2 = CreateItemOnObject("na_hench_pot52", oHenchman);
oPotion3 = CreateItemOnObject("na_hench_pot53", oHenchman);
}
else if ( GetHitDice(oPC) <= 25 )
{
oPotion1 = CreateItemOnObject("na_hench_pot5", oHenchman);
oPotion2 = CreateItemOnObject("na_hench_pot52", oHenchman);
oPotion3 = CreateItemOnObject("na_hench_pot53", oHenchman);
}
else if ( GetHitDice(oPC) <= 30 )
{
oPotion1 = CreateItemOnObject("na_hench_pot5", oHenchman);
oPotion2 = CreateItemOnObject("na_hench_pot52", oHenchman);
oPotion3 = CreateItemOnObject("na_hench_pot53", oHenchman);
}
else if ( GetHitDice(oPC) <= 35 )
{
oPotion1 = CreateItemOnObject("na_hench_pot5", oHenchman);
oPotion2 = CreateItemOnObject("na_hench_pot52", oHenchman);
oPotion3 = CreateItemOnObject("na_hench_pot53", oHenchman);
}
else if ( GetHitDice(oPC) <= 39 )
{
oPotion1 = CreateItemOnObject("na_hench_pot5", oHenchman);
oPotion2 = CreateItemOnObject("na_hench_pot52", oHenchman);
oPotion3 = CreateItemOnObject("na_hench_pot53", oHenchman);
}
else
{
oPotion1 = CreateItemOnObject("na_hench_pot5", oHenchman);
oPotion2 = CreateItemOnObject("na_hench_pot52", oHenchman);
oPotion3 = CreateItemOnObject("na_hench_pot53", oHenchman);
}
}
//If the henchman is a monk:
if ( GetLevelByClass(CLASS_TYPE_MONK, oHenchman) > 0 )
{
if ( GetHitDice(oPC) <= 2 )
{
oPotion1 = CreateItemOnObject("na_hench_pot1", oHenchman);
oPotion2 = CreateItemOnObject("na_hench_pot12", oHenchman);
oPotion3 = CreateItemOnObject("na_hench_pot13", oHenchman);
}
else if ( GetHitDice(oPC) <= 5 )
{
oGloves = CreateItemOnObject("na_steelice1", oHenchman); //Rekawice Stalowego Lodu +1
oArmor = CreateItemOnObject("na_gown1", oHenchman); //Toga Lsniacej Reki +1
oPotion1 = CreateItemOnObject("na_hench_pot2", oHenchman);
oPotion2 = CreateItemOnObject("na_hench_pot22", oHenchman);
oPotion3 = CreateItemOnObject("na_hench_pot23", oHenchman);
}
else if ( GetHitDice(oPC) <= 10 )
{
oGloves = CreateItemOnObject("na_steelice2", oHenchman); //Rekawice Stalowego Lodu +2
oArmor = CreateItemOnObject("na_gown2", oHenchman); //Toga Lsniacej Reki +2
oPotion1 = CreateItemOnObject("na_hench_pot3", oHenchman);
oPotion2 = CreateItemOnObject("na_hench_pot32", oHenchman);
oPotion3 = CreateItemOnObject("na_hench_pot33", oHenchman);
}
else if ( GetHitDice(oPC) <= 15 )
{
oBoots = CreateItemOnObject("na_ssboots4", oHenchman); //Buty Duszy Slonca +4
oGloves = CreateItemOnObject("na_steelice4", oHenchman); //Rekawice Stalowego Lodu +4
oArmor = CreateItemOnObject("na_gown2", oHenchman); //Toga Lsniacej Reki +2
oPotion1 = CreateItemOnObject("na_hench_pot4", oHenchman);
oPotion2 = CreateItemOnObject("na_hench_pot42", oHenchman);
oPotion3 = CreateItemOnObject("na_hench_pot43", oHenchman);
}
else if ( GetHitDice(oPC) <= 20 )
{
oBoots = CreateItemOnObject("na_ssboots5", oHenchman); //Buty Duszy Slonca +5
oGloves = CreateItemOnObject("na_steelice5", oHenchman); //Rekawice Stalowego Lodu +5
oArmor = CreateItemOnObject("na_gown3", oHenchman); //Toga Lsniacej Reki +3
oPotion1 = CreateItemOnObject("na_hench_pot5", oHenchman);
oPotion2 = CreateItemOnObject("na_hench_pot52", oHenchman);
oPotion3 = CreateItemOnObject("na_hench_pot53", oHenchman);
}
else if ( GetHitDice(oPC) <= 25 )
{
oBoots = CreateItemOnObject("na_ssboots6", oHenchman); //Buty Duszy Slonca +6
oGloves = CreateItemOnObject("na_steelice8", oHenchman); //Rekawice Stalowego Lodu +8
oArmor = CreateItemOnObject("na_gown4", oHenchman); //Toga Lsniacej Reki +4
oPotion1 = CreateItemOnObject("na_hench_pot5", oHenchman);
oPotion2 = CreateItemOnObject("na_hench_pot52", oHenchman);
oPotion3 = CreateItemOnObject("na_hench_pot53", oHenchman);
}
else if ( GetHitDice(oPC) <= 30 )
{
oBoots = CreateItemOnObject("na_ssboots7", oHenchman); //Buty Duszy Slonca +7
oGloves = CreateItemOnObject("na_steelice9", oHenchman); //Rekawice Stalowego Lodu +9
oArmor = CreateItemOnObject("na_gown6", oHenchman); //Toga Lsniacej Reki +6
oPotion1 = CreateItemOnObject("na_hench_pot5", oHenchman);
oPotion2 = CreateItemOnObject("na_hench_pot52", oHenchman);
oPotion3 = CreateItemOnObject("na_hench_pot53", oHenchman);
}
else if ( GetHitDice(oPC) <= 35 )
{
oBoots = CreateItemOnObject("na_ssboots8", oHenchman); //Buty Duszy Slonca +8
oGloves = CreateItemOnObject("na_steelice9", oHenchman); //Rekawice Stalowego Lodu +9
oArmor = CreateItemOnObject("na_gown7", oHenchman); //Toga Lsniacej Reki +7
oPotion1 = CreateItemOnObject("na_hench_pot5", oHenchman);
oPotion2 = CreateItemOnObject("na_hench_pot52", oHenchman);
oPotion3 = CreateItemOnObject("na_hench_pot53", oHenchman);
}
else if ( GetHitDice(oPC) <= 39 )
{
oBoots = CreateItemOnObject("na_ssboots8", oHenchman); //Buty Duszy Slonca +8
oGloves = CreateItemOnObject("na_steelice11", oHenchman); //Rekawice Stalowego Lodu +11
oArmor = CreateItemOnObject("na_gown11", oHenchman); //Toga Lsniacej Reki +11
oPotion1 = CreateItemOnObject("na_hench_pot5", oHenchman);
oPotion2 = CreateItemOnObject("na_hench_pot52", oHenchman);
oPotion3 = CreateItemOnObject("na_hench_pot53", oHenchman);
}
else
{
oBoots = CreateItemOnObject("na_ssboots13", oHenchman); //Buty Duszy Slonca +5
oGloves = CreateItemOnObject("na_steelice20", oHenchman); //Rekawice Stalowego Lodu +20
oArmor = CreateItemOnObject("na_gown16", oHenchman); //Toga Lsniacej Reki +16
oPotion1 = CreateItemOnObject("na_hench_pot5", oHenchman);
oPotion2 = CreateItemOnObject("na_hench_pot52", oHenchman);
oPotion3 = CreateItemOnObject("na_hench_pot53", oHenchman);
}
}
//If the henchman is a druid:
if ( GetLevelByClass(CLASS_TYPE_DRUID, oHenchman) > 0 )
{
SetLocalString(oHenchman, "SummonCreature", "na_hench_comp");
if ( GetHitDice(oPC) <= 2 )
{
oArmor = CreateItemOnObject("NW_AARCL008", oHenchman);
oWeapon = CreateItemOnObject("NW_WSPSC001", oHenchman);
oPotion1 = CreateItemOnObject("na_hench_pot1", oHenchman);
oPotion2 = CreateItemOnObject("na_hench_pot12", oHenchman);
oPotion3 = CreateItemOnObject("na_hench_pot13", oHenchman);
}
else if ( GetHitDice(oPC) <= 5 )
{
oArmor = CreateItemOnObject("NW_MAARCL047", oHenchman);
oWeapon = CreateItemOnObject("NW_WSPMSC002", oHenchman);
oPotion1 = CreateItemOnObject("na_hench_pot2", oHenchman);
oPotion2 = CreateItemOnObject("na_hench_pot22", oHenchman);
oPotion3 = CreateItemOnObject("na_hench_pot23", oHenchman);
}
else if ( GetHitDice(oPC) <= 10 )
{
oArmor = CreateItemOnObject("NW_MAARCL070", oHenchman);
oWeapon = CreateItemOnObject("NW_WSPMSC011", oHenchman);
oPotion1 = CreateItemOnObject("na_hench_pot3", oHenchman);
oPotion2 = CreateItemOnObject("na_hench_pot32", oHenchman);
oPotion3 = CreateItemOnObject("na_hench_pot33", oHenchman);
}
else if ( GetHitDice(oPC) <= 15 )
{
oShield = CreateItemOnObject("X0_ASHMSW001", oHenchman);
oArmor = CreateItemOnObject("NW_MAARCL070", oHenchman);
oWeapon = CreateItemOnObject("X0_WSPMSC001", oHenchman);
oPotion1 = CreateItemOnObject("na_hench_pot4", oHenchman);
oPotion2 = CreateItemOnObject("na_hench_pot42", oHenchman);
oPotion3 = CreateItemOnObject("na_hench_pot43", oHenchman);
}
else if ( GetHitDice(oPC) <= 20 )
{
oShield = CreateItemOnObject("X0_ASHMSW002", oHenchman);
oArmor = CreateItemOnObject("NW_MAARCL082", oHenchman);
oWeapon = CreateItemOnObject("X0_WSPMSC002", oHenchman);
oPotion1 = CreateItemOnObject("na_hench_pot5", oHenchman);
oPotion2 = CreateItemOnObject("na_hench_pot52", oHenchman);
oPotion3 = CreateItemOnObject("na_hench_pot53", oHenchman);
}
else if ( GetHitDice(oPC) <= 25 )
{
oRing1 = CreateItemOnObject("bandofstolidityb", oHenchman);
oShield = CreateItemOnObject("X2_ASHMSW003", oHenchman);
oArmor = CreateItemOnObject("X0_MAARCL007", oHenchman);
oWeapon = CreateItemOnObject("X2_WSPMSC003", oHenchman);
oPotion1 = CreateItemOnObject("na_hench_pot5", oHenchman);
oPotion2 = CreateItemOnObject("na_hench_pot52", oHenchman);
oPotion3 = CreateItemOnObject("na_hench_pot53", oHenchman);
}
else if ( GetHitDice(oPC) <= 30 )
{
oRing2 = CreateItemOnObject("ringofresinbest", oHenchman);
oRing1 = CreateItemOnObject("bandofstolidityb", oHenchman);
oShield = CreateItemOnObject("ashmsw004", oHenchman);
oArmor = CreateItemOnObject("X2_MAARCL031", oHenchman);
oWeapon = CreateItemOnObject("X2_WSPMSC004", oHenchman);
oPotion1 = CreateItemOnObject("na_hench_pot5", oHenchman);
oPotion2 = CreateItemOnObject("na_hench_pot52", oHenchman);
oPotion3 = CreateItemOnObject("na_hench_pot53", oHenchman);
}
else if ( GetHitDice(oPC) <= 35 )
{
oRing2 = CreateItemOnObject("ringofresinbest", oHenchman);
oRing1 = CreateItemOnObject("bandofstolidityb", oHenchman);
oShield = CreateItemOnObject("ashmsw005", oHenchman);
oArmor = CreateItemOnObject("X2_MAARCL032", oHenchman);
oWeapon = CreateItemOnObject("X2_WSPMSC004", oHenchman);
oPotion1 = CreateItemOnObject("na_hench_pot5", oHenchman);
oPotion2 = CreateItemOnObject("na_hench_pot52", oHenchman);
oPotion3 = CreateItemOnObject("na_hench_pot53", oHenchman);
}
else if ( GetHitDice(oPC) <= 39 )
{
oRing2 = CreateItemOnObject("ringofresinbest", oHenchman);
oRing1 = CreateItemOnObject("bandofstolidityb", oHenchman);
oShield = CreateItemOnObject("ashmsw005", oHenchman);
oArmor = CreateItemOnObject("learmor10", oHenchman);
oWeapon = CreateItemOnObject("sickleelefire7", oHenchman);
oPotion1 = CreateItemOnObject("na_hench_pot5", oHenchman);
oPotion2 = CreateItemOnObject("na_hench_pot52", oHenchman);
oPotion3 = CreateItemOnObject("na_hench_pot53", oHenchman);
}
else
{
oRing2 = CreateItemOnObject("ringofresinbest", oHenchman); //Pierscien Zywicy +6
oRing1 = CreateItemOnObject("bandofstolidityb", oHenchman); //Obraczka Naturalnej Niewrazliwosci +5
oShield = CreateItemOnObject("wolfshield8", oHenchman); //Tarcza Duszy Wilka +8
oArmor = CreateItemOnObject("learmor16", oHenchman); //Zbroja Skorzana +16
oWeapon = CreateItemOnObject("sickleelefire10", oHenchman); //Sierp Elementalnego Ognia +10
oPotion1 = CreateItemOnObject("na_hench_pot5", oHenchman);
oPotion2 = CreateItemOnObject("na_hench_pot52", oHenchman);
oPotion3 = CreateItemOnObject("na_hench_pot53", oHenchman);
}
}
//If the henchman is a bard:
if ( GetLevelByClass(CLASS_TYPE_BARD, oHenchman) > 0 )
{
if ( GetHitDice(oPC) <= 2 )
{
oArmor = CreateItemOnObject("NW_AARCL008", oHenchman);
oPotion1 = CreateItemOnObject("na_hench_pot1", oHenchman);
oPotion2 = CreateItemOnObject("na_hench_pot12", oHenchman);
oPotion3 = CreateItemOnObject("na_hench_pot13", oHenchman);
}
else if ( GetHitDice(oPC) <= 5 )
{
oArmor = CreateItemOnObject("NW_MAARCL047", oHenchman);
oPotion1 = CreateItemOnObject("na_hench_pot2", oHenchman);
oPotion2 = CreateItemOnObject("na_hench_pot22", oHenchman);
oPotion3 = CreateItemOnObject("na_hench_pot23", oHenchman);
}
else if ( GetHitDice(oPC) <= 10 )
{
oArmor = CreateItemOnObject("NW_MAARCL070", oHenchman);
oPotion1 = CreateItemOnObject("na_hench_pot3", oHenchman);
oPotion2 = CreateItemOnObject("na_hench_pot32", oHenchman);
oPotion3 = CreateItemOnObject("na_hench_pot33", oHenchman);
}
else if ( GetHitDice(oPC) <= 15 )
{
oArmor = CreateItemOnObject("NW_MAARCL070", oHenchman);
oPotion1 = CreateItemOnObject("na_hench_pot4", oHenchman);
oPotion2 = CreateItemOnObject("na_hench_pot42", oHenchman);
oPotion3 = CreateItemOnObject("na_hench_pot43", oHenchman);
}
else if ( GetHitDice(oPC) <= 20 )
{
oArmor = CreateItemOnObject("NW_MAARCL082", oHenchman);
oPotion1 = CreateItemOnObject("na_hench_pot5", oHenchman);
oPotion2 = CreateItemOnObject("na_hench_pot52", oHenchman);
oPotion3 = CreateItemOnObject("na_hench_pot53", oHenchman);
}
else if ( GetHitDice(oPC) <= 25 )
{
oArmor = CreateItemOnObject("X0_MAARCL007", oHenchman);
oPotion1 = CreateItemOnObject("na_hench_pot5", oHenchman);
oPotion2 = CreateItemOnObject("na_hench_pot52", oHenchman);
oPotion3 = CreateItemOnObject("na_hench_pot53", oHenchman);
}
else if ( GetHitDice(oPC) <= 30 )
{
oArmor = CreateItemOnObject("X2_MAARCL031", oHenchman);
oPotion1 = CreateItemOnObject("na_hench_pot5", oHenchman);
oPotion2 = CreateItemOnObject("na_hench_pot52", oHenchman);
oPotion3 = CreateItemOnObject("na_hench_pot53", oHenchman);
}
else if ( GetHitDice(oPC) <= 35 )
{
oArmor = CreateItemOnObject("X2_MAARCL032", oHenchman);
oPotion1 = CreateItemOnObject("na_hench_pot5", oHenchman);
oPotion2 = CreateItemOnObject("na_hench_pot52", oHenchman);
oPotion3 = CreateItemOnObject("na_hench_pot53", oHenchman);
}
else if ( GetHitDice(oPC) <= 39 )
{
oArmor = CreateItemOnObject("learmor10", oHenchman);
oPotion1 = CreateItemOnObject("na_hench_pot5", oHenchman);
oPotion2 = CreateItemOnObject("na_hench_pot52", oHenchman);
oPotion3 = CreateItemOnObject("na_hench_pot53", oHenchman);
}
else
{
oArmor = CreateItemOnObject("learmor16a", oHenchman); //Zbroja Skorzana +16
oPotion1 = CreateItemOnObject("na_hench_pot5", oHenchman);
oPotion2 = CreateItemOnObject("na_hench_pot52", oHenchman);
oPotion3 = CreateItemOnObject("na_hench_pot53", oHenchman);
}
}
//If the henchman is a cleric:
if ( GetLevelByClass(CLASS_TYPE_CLERIC, oHenchman) > 0)
{
SetLocalInt(oHenchman, "cleric_henchman", 1);
if ( GetHitDice(oPC) <= 2 )
{
oArmor = CreateItemOnObject("NW_AARCL012", oHenchman); //Koszulka kolcza
if ( GetRacialType(oHenchman) == RACIAL_TYPE_GNOME || GetRacialType(oHenchman) == RACIAL_TYPE_HALFLING )
{oWeapon = CreateItemOnObject("NW_WBLML001", oHenchman);} //Bulawa
else {oWeapon = CreateItemOnObject("NW_WBLML001", oHenchman);} //Bulawa
oPotion1 = CreateItemOnObject("na_hench_pot1", oHenchman);
oPotion2 = CreateItemOnObject("na_hench_pot12", oHenchman);
oPotion3 = CreateItemOnObject("na_hench_pot13", oHenchman);
}
else if ( GetHitDice(oPC) <= 5 )
{
oArmor = CreateItemOnObject("NW_MAARCL046", oHenchman); //Koszulka kolcza +1
if ( GetRacialType(oHenchman) == RACIAL_TYPE_GNOME || GetRacialType(oHenchman) == RACIAL_TYPE_HALFLING )
{oWeapon = CreateItemOnObject("NW_WBLMML002", oHenchman);} //Bulawa +1
else {oWeapon = CreateItemOnObject("NW_WBLMML002", oHenchman);} //Bulawa +1
oPotion1 = CreateItemOnObject("na_hench_pot2", oHenchman);
oPotion2 = CreateItemOnObject("na_hench_pot22", oHenchman);
oPotion3 = CreateItemOnObject("na_hench_pot23", oHenchman);
}
else if ( GetHitDice(oPC) <= 10 )
{
oArmor = CreateItemOnObject("NW_MAARCL066", oHenchman); //Kolczuga +2
if ( GetRacialType(oHenchman) == RACIAL_TYPE_GNOME || GetRacialType(oHenchman) == RACIAL_TYPE_HALFLING )
{oWeapon = CreateItemOnObject("NW_WBLMML012", oHenchman);} //Bulawa +3
else {oWeapon = CreateItemOnObject("NW_WBLMML012", oHenchman);} //Bulawa +3
oPotion1 = CreateItemOnObject("na_hench_pot3", oHenchman);
oPotion2 = CreateItemOnObject("na_hench_pot32", oHenchman);
oPotion3 = CreateItemOnObject("na_hench_pot33", oHenchman);
}
else if ( GetHitDice(oPC) <= 15 )
{
oArmor = CreateItemOnObject("NW_MAARCL068", oHenchman); //Pelna zbroja plytowa +2
if ( GetRacialType(oHenchman) == RACIAL_TYPE_GNOME || GetRacialType(oHenchman) == RACIAL_TYPE_HALFLING )
{oWeapon = CreateItemOnObject("X0_WBLMML001", oHenchman); //Bulawa +4
oShield = CreateItemOnObject("X0_ASHMSW001", oHenchman);} //Mala tarcza +4
else {oWeapon = CreateItemOnObject("X0_WBLMML001", oHenchman); //Bulawa +4
oShield = CreateItemOnObject("X0_ASHMLW001", oHenchman);} //Duza tarcza +4
oPotion1 = CreateItemOnObject("na_hench_pot4", oHenchman);
oPotion2 = CreateItemOnObject("na_hench_pot42", oHenchman);
oPotion3 = CreateItemOnObject("na_hench_pot43", oHenchman);
}
else if ( GetHitDice(oPC) <= 20 )
{
oArmor = CreateItemOnObject("NW_MAARCL080", oHenchman); //Pelna zbroja plytowa +3
if ( GetRacialType(oHenchman) == RACIAL_TYPE_GNOME || GetRacialType(oHenchman) == RACIAL_TYPE_HALFLING )
{oWeapon = CreateItemOnObject("X0_WBLMML002", oHenchman); //Bulawa +5
oShield = CreateItemOnObject("X0_ASHMSW002", oHenchman);} //Mala tarcza +5
else {oWeapon = CreateItemOnObject("X0_WBLMML002", oHenchman); //Bulawa +5
oShield = CreateItemOnObject("X0_ASHMLW002", oHenchman);} //Duza tarcza +5
oPotion1 = CreateItemOnObject("na_hench_pot5", oHenchman);
oPotion2 = CreateItemOnObject("na_hench_pot52", oHenchman);
oPotion3 = CreateItemOnObject("na_hench_pot53", oHenchman);
}
else if ( GetHitDice(oPC) <= 25 )
{
oArmor = CreateItemOnObject("X0_MAARCL023", oHenchman); //Pelna zbroja plytowa +4
if ( GetRacialType(oHenchman) == RACIAL_TYPE_GNOME || GetRacialType(oHenchman) == RACIAL_TYPE_HALFLING )
{oWeapon = CreateItemOnObject("X2_WBLMML003", oHenchman); //Bulawa +6
oShield = CreateItemOnObject("X2_ASHMLW003", oHenchman);} //Duza tarcza +6
else {oWeapon = CreateItemOnObject("X2_WBLMML003", oHenchman); //Bulawa +6
oShield = CreateItemOnObject("X2_ASHMTO003", oHenchman);} //Pawez +6
oPotion1 = CreateItemOnObject("na_hench_pot5", oHenchman);
oPotion2 = CreateItemOnObject("na_hench_pot52", oHenchman);
oPotion3 = CreateItemOnObject("na_hench_pot53", oHenchman);
}
else if ( GetHitDice(oPC) <= 30 )
{
oArmor = CreateItemOnObject("X2_MAARCL047", oHenchman); //Pelna zbroja plytowa +6
if ( GetRacialType(oHenchman) == RACIAL_TYPE_GNOME || GetRacialType(oHenchman) == RACIAL_TYPE_HALFLING )
{oWeapon = CreateItemOnObject("X2_WBLMML004", oHenchman); //Bulawa +7
oShield = CreateItemOnObject("na_largeshield8", oHenchman);} //Duza tarcza +8
else {oWeapon = CreateItemOnObject("X2_WBLMML004", oHenchman); //Bulawa +7
oShield = CreateItemOnObject("na_towershield8", oHenchman);} //Pawez +8
oPotion1 = CreateItemOnObject("na_hench_pot5", oHenchman);
oPotion2 = CreateItemOnObject("na_hench_pot52", oHenchman);
oPotion3 = CreateItemOnObject("na_hench_pot53", oHenchman);
}
else if ( GetHitDice(oPC) <= 35 )
{
oArmor = CreateItemOnObject("X2_MAARCL048", oHenchman); //Pelna zbroja plytowa +7
if ( GetRacialType(oHenchman) == RACIAL_TYPE_GNOME || GetRacialType(oHenchman) == RACIAL_TYPE_HALFLING )
{oWeapon = CreateItemOnObject("X2_WBLMML004", oHenchman); //Bulawa +7
oShield = CreateItemOnObject("na_largeshield9", oHenchman);} //Duza tarcza +9
else {oWeapon = CreateItemOnObject("X2_WBLMML004", oHenchman); //Bulawa +7
oShield = CreateItemOnObject("na_towershield9", oHenchman);} //Pawez +9
oPotion1 = CreateItemOnObject("na_hench_pot5", oHenchman);
oPotion2 = CreateItemOnObject("na_hench_pot52", oHenchman);
oPotion3 = CreateItemOnObject("na_hench_pot53", oHenchman);
}
else if ( GetHitDice(oPC) <= 39 )
{
oArmor = CreateItemOnObject("na_pzp_10", oHenchman); //Pelna zbroja plytowa +10
if ( GetRacialType(oHenchman) == RACIAL_TYPE_GNOME || GetRacialType(oHenchman) == RACIAL_TYPE_HALFLING )
{oWeapon = CreateItemOnObject("wblmml004", oHenchman); //Bulawa +8
oShield = CreateItemOnObject("na_largeshield9", oHenchman);} //Duza tarcza +9
else {oWeapon = CreateItemOnObject("wblmml004", oHenchman); //Bulawa +8
oShield = CreateItemOnObject("na_towershield9", oHenchman);} //Pawez +9
oPotion1 = CreateItemOnObject("na_hench_pot5", oHenchman);
oPotion2 = CreateItemOnObject("na_hench_pot52", oHenchman);
oPotion3 = CreateItemOnObject("na_hench_pot53", oHenchman);
}
else
{
oArmor = CreateItemOnObject("na_pzp_16", oHenchman); //Pelna zbroja plytowa +16
if ( GetRacialType(oHenchman) == RACIAL_TYPE_GNOME || GetRacialType(oHenchman) == RACIAL_TYPE_HALFLING )
{oWeapon = CreateItemOnObject("mace12", oHenchman); //Bulawa +12
oShield = CreateItemOnObject("na_largeshield15", oHenchman);} //Duza tarcza +15
else {oWeapon = CreateItemOnObject("mace12", oHenchman); //Bulawa +12
oShield = CreateItemOnObject("na_towershield15", oHenchman);} //Pawez +15
oPotion1 = CreateItemOnObject("na_hench_pot5", oHenchman);
oPotion2 = CreateItemOnObject("na_hench_pot52", oHenchman);
oPotion3 = CreateItemOnObject("na_hench_pot53", oHenchman);
}
}
//If the henchman is a barbarian:
if ( GetLevelByClass(CLASS_TYPE_BARBARIAN, oHenchman) > 0)
{
if ( GetHitDice(oPC) <= 2 )
{
oArmor = CreateItemOnObject("NW_AARCL012", oHenchman); //Koszulka kolcza
if ( GetRacialType(oHenchman) == RACIAL_TYPE_GNOME || GetRacialType(oHenchman) == RACIAL_TYPE_HALFLING )
{oWeapon = CreateItemOnObject("NW_WAXBT001", oHenchman);}
else {oWeapon = CreateItemOnObject("NW_WAXGR001", oHenchman);}
oPotion1 = CreateItemOnObject("na_hench_pot1", oHenchman);
oPotion2 = CreateItemOnObject("na_hench_pot12", oHenchman);
oPotion3 = CreateItemOnObject("na_hench_pot13", oHenchman);
}
else if ( GetHitDice(oPC) <= 5 )
{
oArmor = CreateItemOnObject("NW_MAARCL046", oHenchman); //Koszulka kolcza +1
if ( GetRacialType(oHenchman) == RACIAL_TYPE_GNOME || GetRacialType(oHenchman) == RACIAL_TYPE_HALFLING )
{oWeapon = CreateItemOnObject("NW_WAXMBT002", oHenchman);}
else {oWeapon = CreateItemOnObject("NW_WAXMGR002", oHenchman);}
oPotion1 = CreateItemOnObject("na_hench_pot2", oHenchman);
oPotion2 = CreateItemOnObject("na_hench_pot22", oHenchman);
oPotion3 = CreateItemOnObject("na_hench_pot23", oHenchman);
}
else if ( GetHitDice(oPC) <= 10 )
{
oArmor = CreateItemOnObject("NW_MAARCL066", oHenchman); //Kolczuga +2
if ( GetRacialType(oHenchman) == RACIAL_TYPE_GNOME || GetRacialType(oHenchman) == RACIAL_TYPE_HALFLING )
{oWeapon = CreateItemOnObject("NW_WAXMBT011", oHenchman);}
else {oWeapon = CreateItemOnObject("NW_WAXMGR011", oHenchman);}
oPotion1 = CreateItemOnObject("na_hench_pot3", oHenchman);
oPotion2 = CreateItemOnObject("na_hench_pot32", oHenchman);
oPotion3 = CreateItemOnObject("na_hench_pot33", oHenchman);
}
else if ( GetHitDice(oPC) <= 15 )
{
oArmor = CreateItemOnObject("NW_MAARCL068", oHenchman); //Pelna zbroja plytowa +2
if ( GetRacialType(oHenchman) == RACIAL_TYPE_GNOME || GetRacialType(oHenchman) == RACIAL_TYPE_HALFLING )
{oWeapon = CreateItemOnObject("X0_WAXMBT001", oHenchman);
}
else {oWeapon = CreateItemOnObject("X0_WAXMGR001", oHenchman);
}
oPotion1 = CreateItemOnObject("na_hench_pot4", oHenchman);
oPotion2 = CreateItemOnObject("na_hench_pot42", oHenchman);
oPotion3 = CreateItemOnObject("na_hench_pot43", oHenchman);
}
else if ( GetHitDice(oPC) <= 20 )
{
oArmor = CreateItemOnObject("NW_MAARCL080", oHenchman); //Pelna zbroja plytowa +3
if ( GetRacialType(oHenchman) == RACIAL_TYPE_GNOME || GetRacialType(oHenchman) == RACIAL_TYPE_HALFLING )
{oWeapon = CreateItemOnObject("X0_WAXMBT002", oHenchman);
}
else {oWeapon = CreateItemOnObject("X0_WAXMGR002", oHenchman);
}
oPotion1 = CreateItemOnObject("na_hench_pot5", oHenchman);
oPotion2 = CreateItemOnObject("na_hench_pot52", oHenchman);
oPotion3 = CreateItemOnObject("na_hench_pot53", oHenchman);
}
else if ( GetHitDice(oPC) <= 25 )
{
oArmor = CreateItemOnObject("X0_MAARCL023", oHenchman); //Pelna zbroja plytowa +4
if ( GetRacialType(oHenchman) == RACIAL_TYPE_GNOME || GetRacialType(oHenchman) == RACIAL_TYPE_HALFLING )
{oWeapon = CreateItemOnObject("X2_WAXMBT003", oHenchman);
}
else {oWeapon = CreateItemOnObject("X2_WAXMGR003", oHenchman);
}
oPotion1 = CreateItemOnObject("na_hench_pot5", oHenchman);
oPotion2 = CreateItemOnObject("na_hench_pot52", oHenchman);
oPotion3 = CreateItemOnObject("na_hench_pot53", oHenchman);
}
else if ( GetHitDice(oPC) <= 30 )
{
oArmor = CreateItemOnObject("X2_MAARCL047", oHenchman); //Pelna zbroja plytowa +6
if ( GetRacialType(oHenchman) == RACIAL_TYPE_GNOME || GetRacialType(oHenchman) == RACIAL_TYPE_HALFLING )
{oWeapon = CreateItemOnObject("X2_WAXMBT004", oHenchman);
}
else {oWeapon = CreateItemOnObject("X2_WAXMGR004", oHenchman);
}
oPotion1 = CreateItemOnObject("na_hench_pot5", oHenchman);
oPotion2 = CreateItemOnObject("na_hench_pot52", oHenchman);
oPotion3 = CreateItemOnObject("na_hench_pot53", oHenchman);
}
else if ( GetHitDice(oPC) <= 35 )
{
oArmor = CreateItemOnObject("X2_MAARCL048", oHenchman); //Pelna zbroja plytowa +7
if ( GetRacialType(oHenchman) == RACIAL_TYPE_GNOME || GetRacialType(oHenchman) == RACIAL_TYPE_HALFLING )
{oWeapon = CreateItemOnObject("X2_WAXMBT004", oHenchman);
}
else {oWeapon = CreateItemOnObject("X2_WAXMGR004", oHenchman);
}
oPotion1 = CreateItemOnObject("na_hench_pot5", oHenchman);
oPotion2 = CreateItemOnObject("na_hench_pot52", oHenchman);
oPotion3 = CreateItemOnObject("na_hench_pot53", oHenchman);
}
else if ( GetHitDice(oPC) <= 39 )
{
oArmor = CreateItemOnObject("na_pzp_10", oHenchman); //Pelna zbroja plytowa +10
if ( GetRacialType(oHenchman) == RACIAL_TYPE_GNOME || GetRacialType(oHenchman) == RACIAL_TYPE_HALFLING )
{oWeapon = CreateItemOnObject("axe8", oHenchman);
}
else {oWeapon = CreateItemOnObject("waxmgr006", oHenchman);
}
oPotion1 = CreateItemOnObject("na_hench_pot5", oHenchman);
oPotion2 = CreateItemOnObject("na_hench_pot52", oHenchman);
oPotion3 = CreateItemOnObject("na_hench_pot53", oHenchman);
}
else
{
oArmor = CreateItemOnObject("na_pzp_16", oHenchman); //Pelna zbroja plytowa +16
if ( GetRacialType(oHenchman) == RACIAL_TYPE_GNOME || GetRacialType(oHenchman) == RACIAL_TYPE_HALFLING )
{oWeapon = CreateItemOnObject("axe14", oHenchman);
}
else {oWeapon = CreateItemOnObject("greataxe14", oHenchman);
}
oPotion1 = CreateItemOnObject("na_hench_pot5", oHenchman);
oPotion2 = CreateItemOnObject("na_hench_pot52", oHenchman);
oPotion3 = CreateItemOnObject("na_hench_pot53", oHenchman);
}
}
//If the henchman is a ranger:
if ( GetLevelByClass(CLASS_TYPE_RANGER, oHenchman) > 0 )
{
SetLocalString(oHenchman, "SummonCreature", "na_hench_comp");
if ( GetHitDice(oPC) <= 2 )
{
oArmor = CreateItemOnObject("NW_AARCL008", oHenchman);
if ( GetRacialType(oHenchman) == RACIAL_TYPE_GNOME || GetRacialType(oHenchman) == RACIAL_TYPE_HALFLING )
{oWeapon = CreateItemOnObject("NW_WBWSH001", oHenchman);}
else {oWeapon = CreateItemOnObject("NW_WBWLN001", oHenchman);}
oPotion1 = CreateItemOnObject("na_hench_pot1", oHenchman);
oPotion2 = CreateItemOnObject("na_hench_pot12", oHenchman);
oPotion3 = CreateItemOnObject("na_hench_pot13", oHenchman);
oAmmo = CreateItemOnObject("NW_WAMMAR009", oHenchman, 99);
oAmmo2 = CreateItemOnObject("NW_WAMMAR009", oHenchman, 99);
oAmmo3 = CreateItemOnObject("NW_WAMMAR009", oHenchman, 99);
}
else if ( GetHitDice(oPC) <= 5 )
{
oArmor = CreateItemOnObject("NW_MAARCL047", oHenchman);
if ( GetRacialType(oHenchman) == RACIAL_TYPE_GNOME || GetRacialType(oHenchman) == RACIAL_TYPE_HALFLING )
{oWeapon = CreateItemOnObject("NW_WBWMSH010", oHenchman);}
else {oWeapon = CreateItemOnObject("NW_WBWMLN010", oHenchman);}
oPotion1 = CreateItemOnObject("na_hench_pot2", oHenchman);
oPotion2 = CreateItemOnObject("na_hench_pot22", oHenchman);
oPotion3 = CreateItemOnObject("na_hench_pot23", oHenchman);
oAmmo = CreateItemOnObject("NW_WAMMAR010", oHenchman, 99);
oAmmo2 = CreateItemOnObject("NW_WAMMAR010", oHenchman, 99);
oAmmo3 = CreateItemOnObject("NW_WAMMAR010", oHenchman, 99);
}
else if ( GetHitDice(oPC) <= 10 )
{
oArmor = CreateItemOnObject("NW_MAARCL070", oHenchman);
if ( GetRacialType(oHenchman) == RACIAL_TYPE_GNOME || GetRacialType(oHenchman) == RACIAL_TYPE_HALFLING )
{oWeapon = CreateItemOnObject("NW_WBWMSH012", oHenchman);}
else {oWeapon = CreateItemOnObject("NW_WBWMLN012", oHenchman);}
oPotion1 = CreateItemOnObject("na_hench_pot3", oHenchman);
oPotion2 = CreateItemOnObject("na_hench_pot32", oHenchman);
oPotion3 = CreateItemOnObject("na_hench_pot33", oHenchman);
oAmmo = CreateItemOnObject("NW_WAMMAR011", oHenchman, 99);
oAmmo2 = CreateItemOnObject("NW_WAMMAR011", oHenchman, 99);
oAmmo3 = CreateItemOnObject("NW_WAMMAR011", oHenchman, 99);
}
else if ( GetHitDice(oPC) <= 15 )
{
oArmor = CreateItemOnObject("NW_MAARCL070", oHenchman);
if ( GetRacialType(oHenchman) == RACIAL_TYPE_GNOME || GetRacialType(oHenchman) == RACIAL_TYPE_HALFLING )
{oWeapon = CreateItemOnObject("X0_WBWMSH003", oHenchman);
}
else {oWeapon = CreateItemOnObject("X0_WBWMLN003", oHenchman);
}
oPotion1 = CreateItemOnObject("na_hench_pot4", oHenchman);
oPotion2 = CreateItemOnObject("na_hench_pot42", oHenchman);
oPotion3 = CreateItemOnObject("na_hench_pot43", oHenchman);
oAmmo = CreateItemOnObject("X2_WAMMAR012", oHenchman, 99);
oAmmo2 = CreateItemOnObject("X2_WAMMAR012", oHenchman, 99);
oAmmo3 = CreateItemOnObject("X2_WAMMAR012", oHenchman, 99);
}
else if ( GetHitDice(oPC) <= 20 )
{
oArmor = CreateItemOnObject("NW_MAARCL082", oHenchman);
if ( GetRacialType(oHenchman) == RACIAL_TYPE_GNOME || GetRacialType(oHenchman) == RACIAL_TYPE_HALFLING )
{oWeapon = CreateItemOnObject("X0_WBWMSH004", oHenchman);
}
else {oWeapon = CreateItemOnObject("X0_WBWMLN004", oHenchman);
}
oPotion1 = CreateItemOnObject("na_hench_pot5", oHenchman);
oPotion2 = CreateItemOnObject("na_hench_pot52", oHenchman);
oPotion3 = CreateItemOnObject("na_hench_pot53", oHenchman);
oAmmo = CreateItemOnObject("arrow006", oHenchman, 99);
oAmmo2 = CreateItemOnObject("arrow006", oHenchman, 99);
oAmmo3 = CreateItemOnObject("arrow006", oHenchman, 99);
}
else if ( GetHitDice(oPC) <= 25 )
{
oArmor = CreateItemOnObject("X0_MAARCL007", oHenchman);
if ( GetRacialType(oHenchman) == RACIAL_TYPE_GNOME || GetRacialType(oHenchman) == RACIAL_TYPE_HALFLING )
{oWeapon = CreateItemOnObject("X2_WBWMSH007", oHenchman);
}
else {oWeapon = CreateItemOnObject("X2_WBWMLN007", oHenchman);
}
oPotion1 = CreateItemOnObject("na_hench_pot5", oHenchman);
oPotion2 = CreateItemOnObject("na_hench_pot52", oHenchman);
oPotion3 = CreateItemOnObject("na_hench_pot53", oHenchman);
oAmmo = CreateItemOnObject("arrow007", oHenchman, 99);
oAmmo2 = CreateItemOnObject("arrow007", oHenchman, 99);
oAmmo3 = CreateItemOnObject("arrow007", oHenchman, 99);
}
else if ( GetHitDice(oPC) <= 30 )
{
oArmor = CreateItemOnObject("X2_MAARCL031", oHenchman);
if ( GetRacialType(oHenchman) == RACIAL_TYPE_GNOME || GetRacialType(oHenchman) == RACIAL_TYPE_HALFLING )
{oWeapon = CreateItemOnObject("X2_WBWMSH008", oHenchman);
}
else {oWeapon = CreateItemOnObject("X2_WBWMLN008", oHenchman);
}
oPotion1 = CreateItemOnObject("na_hench_pot5", oHenchman);
oPotion2 = CreateItemOnObject("na_hench_pot52", oHenchman);
oPotion3 = CreateItemOnObject("na_hench_pot53", oHenchman);
oAmmo = CreateItemOnObject("arrow008", oHenchman, 99);
oAmmo2 = CreateItemOnObject("arrow008", oHenchman, 99);
oAmmo3 = CreateItemOnObject("arrow008", oHenchman, 99);
}
else if ( GetHitDice(oPC) <= 35 )
{
oArmor = CreateItemOnObject("X2_MAARCL032", oHenchman);
if ( GetRacialType(oHenchman) == RACIAL_TYPE_GNOME || GetRacialType(oHenchman) == RACIAL_TYPE_HALFLING )
{oWeapon = CreateItemOnObject("X2_WBWMSH008", oHenchman);
}
else {oWeapon = CreateItemOnObject("X2_WBWMLN008", oHenchman);
}
oPotion1 = CreateItemOnObject("na_hench_pot5", oHenchman);
oPotion2 = CreateItemOnObject("na_hench_pot52", oHenchman);
oPotion3 = CreateItemOnObject("na_hench_pot53", oHenchman);
oAmmo = CreateItemOnObject("arrow009", oHenchman, 99);
oAmmo2 = CreateItemOnObject("arrow009", oHenchman, 99);
oAmmo3 = CreateItemOnObject("arrow009", oHenchman, 99);
}
else if ( GetHitDice(oPC) <= 39 )
{
oArmor = CreateItemOnObject("learmor10", oHenchman);
if ( GetRacialType(oHenchman) == RACIAL_TYPE_GNOME || GetRacialType(oHenchman) == RACIAL_TYPE_HALFLING )
{oWeapon = CreateItemOnObject("wbwmsh008", oHenchman);
}
else {oWeapon = CreateItemOnObject("wbwmln008", oHenchman);
}
oPotion1 = CreateItemOnObject("na_hench_pot5", oHenchman);
oPotion2 = CreateItemOnObject("na_hench_pot52", oHenchman);
oPotion3 = CreateItemOnObject("na_hench_pot53", oHenchman);
oAmmo = CreateItemOnObject("dragonsspine", oHenchman, 99);
oAmmo2 = CreateItemOnObject("dragonsspine", oHenchman, 99);
oAmmo3 = CreateItemOnObject("dragonsspine", oHenchman, 99);
}
else
{
oArmor = CreateItemOnObject("learmor16", oHenchman);
if ( GetRacialType(oHenchman) == RACIAL_TYPE_GNOME || GetRacialType(oHenchman) == RACIAL_TYPE_HALFLING )
{oWeapon = CreateItemOnObject("comshortbow14", oHenchman);
}
else {oWeapon = CreateItemOnObject("comlongbow14", oHenchman);
}
oPotion1 = CreateItemOnObject("na_hench_pot5", oHenchman);
oPotion2 = CreateItemOnObject("na_hench_pot52", oHenchman);
oPotion3 = CreateItemOnObject("na_hench_pot53", oHenchman);
oAmmo = CreateItemOnObject("dragonsspine", oHenchman, 99);
oAmmo2 = CreateItemOnObject("dragonsspine", oHenchman, 99);
oAmmo3 = CreateItemOnObject("dragonsspine", oHenchman, 99);
}
}
//If the henchman is a rogue:
if ( GetLevelByClass(CLASS_TYPE_ROGUE, oHenchman) > 0 )
{
if ( GetHitDice(oPC) <= 2 )
{
oArmor = CreateItemOnObject("NW_AARCL001", oHenchman);
oWeapon = CreateItemOnObject("NW_WSWDG001", oHenchman);
oShield = CreateItemOnObject("NW_WSWDG001", oHenchman);
oPotion1 = CreateItemOnObject("na_hench_pot1", oHenchman);
oPotion2 = CreateItemOnObject("na_hench_pot12", oHenchman);
oPotion3 = CreateItemOnObject("na_hench_pot13", oHenchman);
}
else if ( GetHitDice(oPC) <= 5 )
{
oArmor = CreateItemOnObject("NW_MAARCL044", oHenchman);
oWeapon = CreateItemOnObject("NW_WSWMDG002", oHenchman);
oShield = CreateItemOnObject("NW_WSWMDG002", oHenchman);
oPotion1 = CreateItemOnObject("na_hench_pot2", oHenchman);
oPotion2 = CreateItemOnObject("na_hench_pot22", oHenchman);
oPotion3 = CreateItemOnObject("na_hench_pot23", oHenchman);
}
else if ( GetHitDice(oPC) <= 10 )
{
oArmor = CreateItemOnObject("NW_MAARCL071", oHenchman);
oWeapon = CreateItemOnObject("NW_WSWMDG009", oHenchman);
oShield = CreateItemOnObject("NW_WSWMDG009", oHenchman);
oPotion1 = CreateItemOnObject("na_hench_pot3", oHenchman);
oPotion2 = CreateItemOnObject("na_hench_pot32", oHenchman);
oPotion3 = CreateItemOnObject("na_hench_pot33", oHenchman);
}
else if ( GetHitDice(oPC) <= 15 )
{
oArmor = CreateItemOnObject("NW_MAARCL071", oHenchman);
oWeapon = CreateItemOnObject("X0_WSWMDG001", oHenchman);
oShield = CreateItemOnObject("X0_WSWMDG001", oHenchman);
oPotion1 = CreateItemOnObject("na_hench_pot4", oHenchman);
oPotion2 = CreateItemOnObject("na_hench_pot42", oHenchman);
oPotion3 = CreateItemOnObject("na_hench_pot43", oHenchman);
}
else if ( GetHitDice(oPC) <= 20 )
{
oArmor = CreateItemOnObject("NW_MAARCL083", oHenchman);
oWeapon = CreateItemOnObject("X0_WSWMDG002", oHenchman);
oShield = CreateItemOnObject("X0_WSWMDG002", oHenchman);
oPotion1 = CreateItemOnObject("na_hench_pot5", oHenchman);
oPotion2 = CreateItemOnObject("na_hench_pot52", oHenchman);
oPotion3 = CreateItemOnObject("na_hench_pot53", oHenchman);
}
else if ( GetHitDice(oPC) <= 25 )
{
oArmor = CreateItemOnObject("X0_MAARCL003", oHenchman);
oWeapon = CreateItemOnObject("X2_WSWMDG003", oHenchman);
oShield = CreateItemOnObject("X2_WSWMDG003", oHenchman);
oPotion1 = CreateItemOnObject("na_hench_pot5", oHenchman);
oPotion2 = CreateItemOnObject("na_hench_pot52", oHenchman);
oPotion3 = CreateItemOnObject("na_hench_pot53", oHenchman);
}
else if ( GetHitDice(oPC) <= 30 )
{
oArmor = CreateItemOnObject("X2_MAARCL027", oHenchman);
oWeapon = CreateItemOnObject("X2_WSWMDG004", oHenchman);
oShield = CreateItemOnObject("X2_WSWMDG004", oHenchman);
oPotion1 = CreateItemOnObject("na_hench_pot5", oHenchman);
oPotion2 = CreateItemOnObject("na_hench_pot52", oHenchman);
oPotion3 = CreateItemOnObject("na_hench_pot53", oHenchman);
}
else if ( GetHitDice(oPC) <= 35 )
{
oArmor = CreateItemOnObject("X2_MAARCL028", oHenchman);
oWeapon = CreateItemOnObject("X2_WSWMDG004", oHenchman);
oShield = CreateItemOnObject("X2_WSWMDG004", oHenchman);
oPotion1 = CreateItemOnObject("na_hench_pot5", oHenchman);
oPotion2 = CreateItemOnObject("na_hench_pot52", oHenchman);
oPotion3 = CreateItemOnObject("na_hench_pot53", oHenchman);
}
else if ( GetHitDice(oPC) <= 39 )
{
oArmor = CreateItemOnObject("learmor10", oHenchman);
oWeapon = CreateItemOnObject("wswmdg004", oHenchman);
oShield = CreateItemOnObject("wswmdg004", oHenchman);
oPotion1 = CreateItemOnObject("na_hench_pot5", oHenchman);
oPotion2 = CreateItemOnObject("na_hench_pot52", oHenchman);
oPotion3 = CreateItemOnObject("na_hench_pot53", oHenchman);
}
else
{
oArmor = CreateItemOnObject("learmorb16", oHenchman); //Zbroja Skorzana +16
oWeapon = CreateItemOnObject("dagger14", oHenchman);
oShield = CreateItemOnObject("dagger14", oHenchman);
oPotion1 = CreateItemOnObject("na_hench_pot5", oHenchman);
oPotion2 = CreateItemOnObject("na_hench_pot52", oHenchman);
oPotion3 = CreateItemOnObject("na_hench_pot53", oHenchman);
}
}
//Identify the equipment and make it untransferrable
SetIdentified(oArmor, TRUE);
SetItemCursedFlag(oArmor, TRUE);
SetIdentified(oWeapon, TRUE);
SetItemCursedFlag(oWeapon, TRUE);
SetIdentified(oShield, TRUE);
SetItemCursedFlag(oShield, TRUE);
SetIdentified(oHelmet, TRUE);
SetItemCursedFlag(oHelmet, TRUE);
SetIdentified(oBoots, TRUE);
SetItemCursedFlag(oBoots, TRUE);
SetIdentified(oGloves, TRUE);
SetItemCursedFlag(oGloves, TRUE);
SetIdentified(oCloak, TRUE);
SetItemCursedFlag(oCloak, TRUE);
SetIdentified(oRing1, TRUE);
SetItemCursedFlag(oRing1, TRUE);
SetIdentified(oRing2, TRUE);
SetItemCursedFlag(oRing2, TRUE);
SetIdentified(oAmulet, TRUE);
SetItemCursedFlag(oAmulet, TRUE);
SetIdentified(oAmmo, TRUE);
SetItemCursedFlag(oAmmo, TRUE);
SetIdentified(oAmmo2, TRUE);
SetItemCursedFlag(oAmmo2, TRUE);
SetIdentified(oAmmo3, TRUE);
SetItemCursedFlag(oAmmo3, TRUE);
//Choose alignment randomly, at the same time keeping it true to the henchman's class (and possibly subrace)
//First, choose a totally random alignment
switch(d3())
{
case 1: AdjustAlignment(oHenchman, ALIGNMENT_GOOD, 100, FALSE);break;
case 2: AdjustAlignment(oHenchman, ALIGNMENT_EVIL, 100, FALSE);break;
case 3: break;
}
switch(d3())
{
case 1: AdjustAlignment(oHenchman, ALIGNMENT_LAWFUL, 100, FALSE);break;
case 2: AdjustAlignment(oHenchman, ALIGNMENT_CHAOTIC, 100, FALSE);break;
case 3: break;
}
//If the henchman is a drow or a duergar, make it 90% probable that he or she is evil
if ( GetLocalString(oHenchman, "subrace") == "drow" || GetLocalString(oHenchman, "subrace") == "duergar" )
{
if ( Random(100) < 90 )
{
AdjustAlignment(oHenchman, ALIGNMENT_EVIL, 100, FALSE);
}
}
//Finally, modify the alignment if it is restricted by the henchman's class
if ( GetLevelByClass(CLASS_TYPE_PALADIN, oHenchman) > 0 ) //Paladin
{
AdjustAlignment(oHenchman, ALIGNMENT_GOOD, 100, FALSE);
AdjustAlignment(oHenchman, ALIGNMENT_LAWFUL, 100, FALSE);
}
if ( GetLevelByClass(CLASS_TYPE_MONK, oHenchman) > 0 ) //Monk
{
AdjustAlignment(oHenchman, ALIGNMENT_LAWFUL, 100, FALSE);
}
if ( GetLevelByClass(CLASS_TYPE_BARBARIAN, oHenchman) > 0 ) //Barbarian
{
AdjustAlignment(oHenchman, ALIGNMENT_CHAOTIC, 100, FALSE);
}
if ( GetLevelByClass(CLASS_TYPE_BARD, oHenchman) > 0 ) //Bard
{
AdjustAlignment(oHenchman, ALIGNMENT_NEUTRAL, 100, FALSE);
switch(d2())
{
case 1:
switch(d3())
{
case 1: AdjustAlignment(oHenchman, ALIGNMENT_GOOD, 100, FALSE);break;
case 2: AdjustAlignment(oHenchman, ALIGNMENT_EVIL, 100, FALSE);break;
case 3: break;
}
break;
case 2:
switch(d3())
{
case 1: AdjustAlignment(oHenchman, ALIGNMENT_GOOD, 100, FALSE);break;
case 2: AdjustAlignment(oHenchman, ALIGNMENT_EVIL, 100, FALSE);break;
case 3: break;
}
AdjustAlignment(oHenchman, ALIGNMENT_CHAOTIC, 100, FALSE);break;
}
}
if ( GetLevelByClass(CLASS_TYPE_DRUID, oHenchman) > 0 ) //Druid
{
AdjustAlignment(oHenchman, ALIGNMENT_NEUTRAL, 100, FALSE);
switch(Random(5))
{
case 0: AdjustAlignment(oHenchman, ALIGNMENT_GOOD, 100, FALSE);break;
case 1: AdjustAlignment(oHenchman, ALIGNMENT_EVIL, 100, FALSE);break;
case 2: break;
case 3: AdjustAlignment(oHenchman, ALIGNMENT_LAWFUL, 100, FALSE);break;
case 4: AdjustAlignment(oHenchman, ALIGNMENT_CHAOTIC, 100, FALSE);break;
}
}
//Hire the henchman and restore spells if he or she has any
HireHenchman69(oPC, oHenchman);
ForceRest(oHenchman);
//Save the henchman in the PC's database
DelayCommand(1.5, SaveHenchman(oPC, oHenchman));
//TEST
//DelayCommand(5.0, ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDamage(9999), oHenchman));
}