1515 lines
52 KiB
Plaintext
1515 lines
52 KiB
Plaintext
|
#include "nw_i0_tool"
|
||
|
#include "x2_inc_switches"
|
||
|
#include "rd_questinc"
|
||
|
#include "rd_treasure"
|
||
|
//#include "en4_racial_const"
|
||
|
#include "prc_inc_racial"
|
||
|
#include "inc_examine"
|
||
|
#include "inc_gennui"
|
||
|
#include "utl_i_sqluuid"
|
||
|
#include "utl_i_sqlocals"
|
||
|
#include "prc_inc_template"
|
||
|
|
||
|
void SetupCharacter(object oPC);
|
||
|
void GetItems(object oPC);
|
||
|
void RemoveAllItems(object oPC);
|
||
|
void InitialEvent(object oPC);
|
||
|
int ValidStartingItem(string sTag);
|
||
|
string GetRace(object oPC);
|
||
|
void SetupDynamicMerchant();
|
||
|
void AddToDynamicMerchant();
|
||
|
void SetupModule();
|
||
|
void CheckSpecialRace(object oPC);
|
||
|
void SetupRandomNPCs();
|
||
|
void CheckImport(object oPC);
|
||
|
|
||
|
void main()
|
||
|
{
|
||
|
int iLevel;
|
||
|
int iRnd;
|
||
|
int iRnd2;
|
||
|
int iIndex;
|
||
|
object oPC = GetEnteringObject();
|
||
|
object oAnimal;
|
||
|
|
||
|
int iAnimal = GetLevelByClass(CLASS_TYPE_DRUID, oPC)
|
||
|
+ GetLevelByClass(CLASS_TYPE_FACTOTUM, oPC)
|
||
|
+ GetLevelByClass(CLASS_TYPE_HEALER, oPC)
|
||
|
+ GetLevelByClass(CLASS_TYPE_RANGER, oPC)
|
||
|
+ GetLevelByClass(CLASS_TYPE_SOULBORN, oPC)
|
||
|
+ GetLevelByClass(CLASS_TYPE_TOTEMIST, oPC);
|
||
|
|
||
|
Randomize();
|
||
|
|
||
|
//Examine_DisablePanels(oPC);
|
||
|
|
||
|
//GNW_ShowMenuButton(oPC);
|
||
|
|
||
|
if (GetIsPC(oPC))
|
||
|
{
|
||
|
//SQLocalsUUID_SetInt(oPC,"OverallQuest",132);
|
||
|
|
||
|
SQLocals_SetInt(GetModule(),"ClientEnter",1);
|
||
|
|
||
|
DelayCommand(1.0f,SQLocals_SetInt(GetModule(),"ClientEnter",0));
|
||
|
|
||
|
if (SQLocals_GetInt(GetModule(),"ModuleStart") == 0)
|
||
|
SetupModule();
|
||
|
|
||
|
if (SQLocals_GetInt(GetModule(),"DynamicMerchant") == 0)
|
||
|
{
|
||
|
SetupDynamicMerchant();
|
||
|
SQLocals_SetInt(GetModule(),"DynamicMerchant",1);
|
||
|
SQLocalsUUID_SetInt(oPC,"DynamicMerchant",1);
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
if (SQLocalsUUID_GetInt(oPC,"DynamicMerchant") == 0)
|
||
|
{
|
||
|
AddToDynamicMerchant();
|
||
|
SQLocalsUUID_SetInt(oPC,"DynamicMerchant",1);
|
||
|
}
|
||
|
}
|
||
|
if (SQLocalsUUID_GetInt(oPC,"ModStart") == 0)
|
||
|
{
|
||
|
SQLocalsUUID_SetInt(oPC,"ModStart",1);
|
||
|
SQLocalsUUID_SetInt(oPC,"Entering",1);
|
||
|
|
||
|
if (iAnimal >= 1)
|
||
|
{
|
||
|
oAnimal = GetObjectByTag("en3_animal");
|
||
|
AdjustReputation(oPC,oAnimal,30);
|
||
|
}
|
||
|
if (GetGoodEvilValue(oPC) < 40) //:: Probably need this after fixing evil path.
|
||
|
{
|
||
|
object oGood;
|
||
|
oGood = GetObjectByTag("en3_good");
|
||
|
AdjustReputation(oPC,oGood,-100);
|
||
|
}
|
||
|
if (GetGoodEvilValue(oPC) > 60)
|
||
|
{
|
||
|
object oGood;
|
||
|
oGood = GetObjectByTag("en3_good");
|
||
|
AdjustReputation(oPC,oGood,50);
|
||
|
}
|
||
|
|
||
|
iLevel = GetHitDice(oPC);
|
||
|
SQLocalsUUID_SetInt(oPC,"PCEnterLevel",iLevel);
|
||
|
|
||
|
SendMessageToPC(oPC,"Starting New Campaign...");
|
||
|
|
||
|
SetLocalString(oPC,"Respawn","EN4_Respawn");
|
||
|
|
||
|
if (GetXP(oPC) == 0)
|
||
|
{
|
||
|
SQLocalsUUID_SetInt(oPC,"ModRank",1);
|
||
|
SetupCharacter(oPC);
|
||
|
SendMessageToPC(oPC,"Character is eligible for Campaign Ranking.");
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
CheckImport(oPC);
|
||
|
}
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
SendMessageToPC(oPC,"Continuing Old Campaign...");
|
||
|
|
||
|
if (SQLocalsUUID_GetInt(oPC,"ModRank") == 1)
|
||
|
SendMessageToPC(oPC,"Character is eligible for Campaign Ranking.");
|
||
|
else
|
||
|
SendMessageToPC(oPC,"Character is ineligible for Campaign Ranking.");
|
||
|
|
||
|
if (SQLocalsUUID_GetInt(oPC,"SpecialPowers") > 0)
|
||
|
CreateSpecialPowers(oPC);
|
||
|
|
||
|
if (SQLocalsUUID_GetInt(oPC,"EvilPath") > 0)
|
||
|
CreateEvilPowers(oPC);
|
||
|
|
||
|
object oItem = GetItemInSlot(INVENTORY_SLOT_RIGHTHAND,oPC);
|
||
|
|
||
|
if (!GetIsObjectValid(oItem) && GetLevelByClass(CLASS_TYPE_MONK,oPC) > 0)
|
||
|
oItem = GetItemInSlot(INVENTORY_SLOT_ARMS,oPC);
|
||
|
|
||
|
if (GetIsObjectValid(oItem))
|
||
|
GetSpecialWeaponBonus(oPC,oItem);
|
||
|
|
||
|
oItem = GetItemInSlot(INVENTORY_SLOT_LEFTHAND,oPC);
|
||
|
if (GetIsObjectValid(oItem))
|
||
|
GetSpecialWeaponBonus(oPC,oItem);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
if (SQLocalsUUID_GetInt(GetModule(),"ModStarted") == 0)
|
||
|
{
|
||
|
SetupRandomNPCs();
|
||
|
SQLocalsUUID_SetInt(GetModule(),"ModStarted",1);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
|
||
|
void GetItems(object oPC)
|
||
|
{
|
||
|
object oObject = GetFirstItemInInventory(oPC);
|
||
|
|
||
|
int iFlag = 0;
|
||
|
int iIndex = 0;
|
||
|
|
||
|
while (iFlag == 0 && GetIsObjectValid(oObject))
|
||
|
{
|
||
|
iIndex++;
|
||
|
SendMessageToPC(oPC,"Item = " + GetTag(oObject));
|
||
|
oObject = GetNextItemInInventory(oPC);
|
||
|
if (iIndex > 100)
|
||
|
iFlag = 1;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
void SetupCharacter(object oPC)
|
||
|
{
|
||
|
object oItem;
|
||
|
string sMessage;
|
||
|
|
||
|
if (GetGold(oPC) < 200)
|
||
|
GiveGoldToCreature(oPC, 200 - GetGold(oPC));
|
||
|
|
||
|
RemoveAllItems(oPC);
|
||
|
|
||
|
oItem = GetItemInSlot(INVENTORY_SLOT_CHEST,oPC);
|
||
|
|
||
|
AssignCommand(oPC,ActionUnequipItem(oItem));
|
||
|
|
||
|
DestroyObject(oItem);
|
||
|
|
||
|
oItem = CreateItemOnObject("Tunic",oPC);
|
||
|
|
||
|
AssignCommand(oPC, ActionEquipItem(oItem, INVENTORY_SLOT_CHEST));
|
||
|
|
||
|
CheckSpecialRace(oPC);
|
||
|
|
||
|
string sCampaign = "Endless Nights IV";
|
||
|
|
||
|
if (GetCampaignInt(sCampaign,"MP") == 1)
|
||
|
sCampaign = "MP_Endless Nights IV";
|
||
|
|
||
|
if (GetCampaignInt(sCampaign,"HardcoreSettings") == 1)
|
||
|
{
|
||
|
SQLocalsUUID_SetInt(oPC,"PCHardcore",1);
|
||
|
DelayCommand(0.3,SendMessageToPC(oPC,"You have been set to Hardcore mode."));
|
||
|
}
|
||
|
|
||
|
if (GetCampaignInt(sCampaign,"HardcoreSettings") == 2)
|
||
|
{
|
||
|
SQLocalsUUID_SetInt(oPC,"PCHardCorePNP",1);
|
||
|
DelayCommand(0.3,SendMessageToPC(oPC,"You have been set to PnP Hardcore mode."));
|
||
|
}
|
||
|
|
||
|
if (GetCampaignInt(sCampaign,"HardcoreSettings") == 3)
|
||
|
{
|
||
|
SQLocalsUUID_SetInt(oPC,"PCHardCoreSpecial",1);
|
||
|
DelayCommand(0.3,SendMessageToPC(oPC,"You have been set to Special experience/lives mode."));
|
||
|
}
|
||
|
|
||
|
if (SQLocalsUUID_GetInt(oPC,"PCDeaths") == 0)
|
||
|
{
|
||
|
InitialEvent(oPC);
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
if (SQLocalsUUID_GetInt(oPC,"PCHardCorePNP") == 0 && SQLocalsUUID_GetInt(oPC,"PCHardcore") == 0)
|
||
|
{
|
||
|
sMessage = "You have been given " + IntToString(SQLocalsUUID_GetInt(oPC,"PCDeaths")) + " deaths to compensate for your choice of races.";
|
||
|
DelayCommand(0.4,SendMessageToPC(oPC,sMessage));
|
||
|
}
|
||
|
}
|
||
|
|
||
|
if (SQLocalsUUID_GetInt(oPC,"Monstrous") == 0 || SQLocalsUUID_GetInt(oPC,"EvilPath") > 0)
|
||
|
{
|
||
|
SetLocalString(oPC,"Respawn","EN4_Respawn");
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
if (SQLocalsUUID_GetInt(oPC,"Monstrous") > 0 && SQLocalsUUID_GetInt(oPC,"EvilPath") == 0)
|
||
|
SetLocalString(oPC,"Respawn","EN4_Monster");
|
||
|
else
|
||
|
SetLocalString(oPC,"Respawn","EN4_MERespawn");
|
||
|
}
|
||
|
}
|
||
|
|
||
|
void RemoveAllItems(object oPC)
|
||
|
{
|
||
|
int iFlag = 0;
|
||
|
int iIndex = 0;
|
||
|
|
||
|
object oObject = GetFirstItemInInventory(oPC);
|
||
|
|
||
|
while (iFlag == 0 && GetIsObjectValid(oObject))
|
||
|
{
|
||
|
iIndex++;
|
||
|
|
||
|
if (ValidStartingItem(GetTag(oObject)) == FALSE)
|
||
|
{
|
||
|
//SendMessageToPC(oPC,"Destroying " + GetTag(oObject));
|
||
|
DestroyObject(oObject);
|
||
|
}
|
||
|
|
||
|
oObject = GetNextItemInInventory(oPC);
|
||
|
|
||
|
if (iIndex > 100)
|
||
|
iFlag = 1;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
int ValidStartingItem(string sTag)
|
||
|
{
|
||
|
int iFlag;
|
||
|
|
||
|
iFlag = FALSE;
|
||
|
|
||
|
if (sTag == "NW_IT_MPOTION001")
|
||
|
iFlag = TRUE;
|
||
|
|
||
|
return iFlag;
|
||
|
}
|
||
|
|
||
|
void InitialEvent(object oPC)
|
||
|
{
|
||
|
int iRandom;
|
||
|
int iRandom2;
|
||
|
int iArmor;
|
||
|
int iAdjust;
|
||
|
int iMod;
|
||
|
int iEvent;
|
||
|
string sMessage;
|
||
|
string sRace;
|
||
|
string sTag;
|
||
|
string sType;
|
||
|
itemproperty ip;
|
||
|
object oItem;
|
||
|
int iQuestPoints;
|
||
|
|
||
|
string sCampaign = "Endless Nights IV";
|
||
|
|
||
|
if (GetCampaignInt(sCampaign,"MP") == 1)
|
||
|
sCampaign = "MP_Endless Nights IV";
|
||
|
|
||
|
iEvent = GetCampaignInt(sCampaign,"E4InitialEvent");
|
||
|
|
||
|
if (iEvent == 1 || iEvent == 2)
|
||
|
{
|
||
|
if (iEvent == 1)
|
||
|
iRandom = Random(100) + 1;
|
||
|
else
|
||
|
iRandom = Random(42) + 1;
|
||
|
|
||
|
//iRandom = 41;
|
||
|
//SendMessageToPC(oPC,"Random = " + IntToString(iRandom));
|
||
|
iMod = 0;
|
||
|
|
||
|
if (iRandom < 2) //Found Magical Item
|
||
|
{
|
||
|
sMessage = "Tending your farm one day, you were suprised to find a myserious magical item beneath the corn stalks. Gathering up what gold you could, you left home in hopes of becoming a famous adventurer...";
|
||
|
GetMagicItem(oPC,TRUE,TRUE);
|
||
|
}
|
||
|
else if (iRandom < 3) //Enchanted
|
||
|
{
|
||
|
SQLocalsUUID_SetInt(oPC,"HasCustomSkin",1);
|
||
|
sRace = GetSubRace(oPC);
|
||
|
|
||
|
if (sRace == "")
|
||
|
sRace = GetRace(oPC);
|
||
|
|
||
|
sRace = "Enchanted " + sRace;
|
||
|
|
||
|
SetSubRace(oPC, sRace);
|
||
|
|
||
|
//sMessage = CreatePlayerSkin(oPC); //::: Use PRC skin instead.
|
||
|
|
||
|
sMessage = "A mysterious old man visited your farm one day and granted you enhanced powers. This experience urged you to leave the farm and seek adventure in the lands.";
|
||
|
|
||
|
iMod=1;
|
||
|
|
||
|
SQLocalsUUID_SetInt(oPC,"SpecialPowers",1);
|
||
|
|
||
|
CreateSpecialPowers(oPC);
|
||
|
|
||
|
}
|
||
|
else if (iRandom < 4) // Undead
|
||
|
{
|
||
|
SQLocalsUUID_SetInt(oPC,"HasCustomSkin",1);
|
||
|
|
||
|
sMessage = "You have little recollection of your death, but you well remember the beginning of your undeath. Whatever vile spells the necromancer cast went awry, though, leading to his death and to your conciousness remaining inside of your undead body.";
|
||
|
|
||
|
sRace = GetSubRace(oPC);
|
||
|
|
||
|
if (sRace == "")
|
||
|
sRace = GetRace(oPC);
|
||
|
|
||
|
sRace = "Undead " + sRace;
|
||
|
|
||
|
SetSubRace(oPC, sRace);
|
||
|
|
||
|
//CreateUndeadPC(oPC); //:: Use PRC template instead.
|
||
|
|
||
|
ApplyTemplateToObject(TEMPLATE_NECROPOLITAN, oPC);
|
||
|
|
||
|
iMod = 1;
|
||
|
|
||
|
SQLocalsUUID_SetInt(oPC,"SpecialPowers",2);
|
||
|
|
||
|
CreateSpecialPowers(oPC);
|
||
|
}
|
||
|
else if (iRandom < 6)
|
||
|
{
|
||
|
GiveGoldToCreature(oPC,1800);
|
||
|
|
||
|
sMessage = "Exploring the cavernous area near your farmhouse, you found a chest filled with treasure. Using these riches you decided to set out into the world and seek adventure.";
|
||
|
}
|
||
|
else if (iRandom < 7)
|
||
|
{
|
||
|
IE_MagicalRing(oPC);
|
||
|
|
||
|
sMessage = "Exploring the cavernous area near your farmhouse, you found a strange magical ring. You decided to use its powers to seek adventure in the world.";
|
||
|
}
|
||
|
else if (iRandom < 8)
|
||
|
{
|
||
|
GetWeaponType(oPC);
|
||
|
|
||
|
sTag = "en3_" + GetWeaponTag(oPC) + "1";
|
||
|
|
||
|
SendMessageToPC(oPC,sTag);
|
||
|
|
||
|
oItem=CreateItemOnObject(sTag,oPC);
|
||
|
|
||
|
ip=ItemPropertyEnhancementBonus(1);
|
||
|
|
||
|
IPSafeAddItemProperty(oItem,ip);
|
||
|
|
||
|
sMessage = "Your father was an adventurer in his youth and gave you an " + GetName(oItem) + " before you set out in the world to find your own fame.";
|
||
|
}
|
||
|
else if (iRandom < 9)
|
||
|
{
|
||
|
iArmor = ENGetArmorType(oPC);
|
||
|
|
||
|
sTag = GetArmorTag(iArmor) + "1";
|
||
|
|
||
|
SendMessageToPC(oPC,sTag);
|
||
|
|
||
|
oItem=CreateItemOnObject(sTag,oPC);
|
||
|
|
||
|
ip=ItemPropertyACBonus(1);
|
||
|
|
||
|
IPSafeAddItemProperty(oItem,ip);
|
||
|
|
||
|
sMessage = "Your father was an adventurer in his youth and gave you an " + GetName(oItem) + " before you set out in the world to find your own fame.";
|
||
|
}
|
||
|
else if (iRandom < 10)
|
||
|
{
|
||
|
iAdjust = Random(20)+1;
|
||
|
DelayCommand(0.5f,EquipMob(oPC,1,iAdjust));
|
||
|
|
||
|
if (iAdjust < 5)
|
||
|
sMessage = "Your father was a minor adventurer in his youth and made sure you were propertly equipped before you set out in the world to find your own fame.";
|
||
|
|
||
|
else if (iAdjust <11)
|
||
|
sMessage = "Your father was a renown adventurer in his youth and made sure you were propertly equipped before you set out in the world to find your own fame.";
|
||
|
|
||
|
else if (iAdjust <16)
|
||
|
sMessage = "Your father was a very renown adventurer in his youth and made sure you were propertly equipped before you set out in the world to find your own fame.";
|
||
|
|
||
|
else
|
||
|
sMessage = "Your father was a famous adventurer in his youth and made sure you were propertly equipped before you set out in the world to find your own fame.";
|
||
|
}
|
||
|
else if (iRandom < 11)
|
||
|
{
|
||
|
if (GetLevelByClass(CLASS_TYPE_CLERIC, oPC) >= 1 || GetLevelByClass(CLASS_TYPE_DRUID, oPC) >= 1)
|
||
|
GetMagicItem(oPC,TRUE,FALSE,2);
|
||
|
|
||
|
else if (GetLevelByClass(CLASS_TYPE_SORCERER, oPC) >= 1 || GetLevelByClass(CLASS_TYPE_WIZARD, oPC) >= 1 || GetLevelByClass(CLASS_TYPE_MONK, oPC) >= 1)
|
||
|
GetMagicItem(oPC,TRUE,FALSE,3);
|
||
|
|
||
|
else
|
||
|
GetMagicItem(oPC,TRUE,FALSE,1);
|
||
|
|
||
|
sMessage = "Your father was a famous adventurer in his youth and upon his death passed you a powerful magical item. Armed with this item and resolve you decided to make a name for yourself in the world.";
|
||
|
}
|
||
|
else if (iRandom < 12)
|
||
|
{
|
||
|
CreateRandomItem(oPC);
|
||
|
|
||
|
if (GetLevelByClass(CLASS_TYPE_ROGUE, oPC) >= 1)
|
||
|
sMessage = "After you left home you traveled to a strange city and found yourself in a shop of magical items. Seeing your oppurtunity, you grabbed one and ran but the shopkeeper alerted the guards. Fast on your feet, you escaped the city and kept running...";
|
||
|
|
||
|
else
|
||
|
sMessage = "Having left home to find adventure, you spotted an old man being attacked by a bandit. Rushing to his aid, you ran the bandit off and, in thanks, the old man gave you a magical item.";
|
||
|
}
|
||
|
else if (iRandom < 13)
|
||
|
{
|
||
|
SQLocalsUUID_SetInt(oPC,"Lucky",1);
|
||
|
|
||
|
sMessage = "All of your life you have had the benefit of great luck. If you gambled, you invariably won. If danger was near, you invariably survived. You decided to go out into the world to make a name for yourself armed with the knowledge that your luck would protect you.";
|
||
|
}
|
||
|
else if (iRandom < 14)
|
||
|
{
|
||
|
MakeStatue(oPC);
|
||
|
sMessage = "On your father's deathbed he gave you a statue that would summon forth a companion to protect you in your adventures.";
|
||
|
}
|
||
|
else if (iRandom < 15)
|
||
|
{
|
||
|
GetArtifact(oPC);
|
||
|
iMod = Random(2)+2;
|
||
|
sMessage = "Exploring the caves outside your home you discovered an artifact of immense power. You decided to use this item to seek out fame and fortunes as an adventurer.";
|
||
|
}
|
||
|
else if (iRandom < 16) // Fiendish/Celestial
|
||
|
{
|
||
|
SQLocalsUUID_SetInt(oPC,"HasCustomSkin",1);
|
||
|
|
||
|
sRace = GetSubRace(oPC);
|
||
|
|
||
|
if (sRace == "")
|
||
|
sRace = GetRace(oPC);
|
||
|
|
||
|
int iGoodEvil;
|
||
|
|
||
|
iGoodEvil = GetGoodEvilValue(oPC);
|
||
|
|
||
|
if (iGoodEvil < 40)
|
||
|
{
|
||
|
sMessage = "Your father was a demon from the deepest layers of the abyss. This parentage has gifted you with immense power in which you now use to make your mark in the world.";
|
||
|
ApplyTemplateToObject(TEMPLATE_HALF_FIEND, oPC);
|
||
|
sRace = "Fiendish " + sRace;
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
sMessage = "Your father was an angel who fell in love with your mother. This parentage has gifted you with immense power in which you now use to make your mark in the world.";
|
||
|
ApplyTemplateToObject(TEMPLATE_HALF_CELESTIAL, oPC);
|
||
|
sRace = "Celestial " + sRace;
|
||
|
}
|
||
|
|
||
|
SetSubRace(oPC, sRace);
|
||
|
|
||
|
//CreateGodlingPC(oPC); //:: Use PRC templates instead.
|
||
|
|
||
|
SQLocalsUUID_SetInt(oPC,"SpecialPowers",3);
|
||
|
|
||
|
CreateSpecialPowers(oPC);
|
||
|
|
||
|
iMod = 1;
|
||
|
}
|
||
|
else if (iRandom < 17)
|
||
|
{
|
||
|
sMessage = "Tending your farm one day, you were suprised to find a myserious magical item beneath the corn stalks. Gathering up what gold you could, you left home in hopes of becoming a famous adventurer...";
|
||
|
GetMagicItem(oPC,TRUE,TRUE);
|
||
|
}
|
||
|
else if (iRandom < 18)
|
||
|
{
|
||
|
iAdjust = Random(20)+1;
|
||
|
|
||
|
DelayCommand(0.5f,EquipMob(oPC,1,iAdjust));
|
||
|
|
||
|
if (iAdjust < 5)
|
||
|
sMessage = "Your father was a minor adventurer in his youth and made sure you were propertly equipped before you set out in the world to find your own fame.";
|
||
|
|
||
|
else if (iAdjust <11)
|
||
|
sMessage = "Your father was a renown adventurer in his youth and made sure you were propertly equipped before you set out in the world to find your own fame.";
|
||
|
|
||
|
else if (iAdjust <16)
|
||
|
sMessage = "Your father was a very renown adventurer in his youth and made sure you were propertly equipped before you set out in the world to find your own fame.";
|
||
|
|
||
|
else
|
||
|
sMessage = "Your father was a famous adventurer in his youth and made sure you were propertly equipped before you set out in the world to find your own fame.";
|
||
|
}
|
||
|
else if (iRandom < 19)
|
||
|
{
|
||
|
DelayCommand(0.5f,EquipMob(oPC,1,40));
|
||
|
sMessage = "Your father was an extremely famous adventurer in his youth and made sure you were propertly equipped before you set out in the world to find your own fame.";
|
||
|
}
|
||
|
else if (iRandom < 20)
|
||
|
{
|
||
|
ItemOfPower(oPC);
|
||
|
sMessage = "Your father was an exiled king and gave you a great item of power before you went out to seek your fame.";
|
||
|
}
|
||
|
else if (iRandom < 21)
|
||
|
{
|
||
|
sMessage = "Tending your farm one day, you were suprised to find a myserious magical item beneath the corn stalks. Gathering up what gold you could, you left home in hopes of becoming a famous adventurer...";
|
||
|
GetMagicItem(oPC,TRUE,TRUE);
|
||
|
}
|
||
|
else if (iRandom < 22)
|
||
|
{
|
||
|
SQLocalsUUID_SetInt(oPC,"PCXPBonus",25);
|
||
|
SQLocalsUUID_SetInt(oPC,"Unlucky",1);
|
||
|
|
||
|
sMessage = "You have always been very unlucky and, deep in your heart, you know you will die an early death. You have, however, learned to adapt quickly.";
|
||
|
}
|
||
|
else if (iRandom < 24)
|
||
|
{
|
||
|
sMessage = "On your way to Hightop City, you spotted a small cave. Exploring, you found a minor magic item.";
|
||
|
GetMinorMagicItem(oPC);
|
||
|
}
|
||
|
else if (iRandom < 25)
|
||
|
{
|
||
|
IE_MagicalRing(oPC);
|
||
|
sMessage = "Exploring the cavernous area near your farmhouse, you found a strange magical ring. You decided to use its powers to seek adventure in the world.";
|
||
|
}
|
||
|
else if (iRandom < 26)
|
||
|
{
|
||
|
iQuestPoints = Random(40)+11;
|
||
|
//iQuestPoints = 24;
|
||
|
SQLocalsUUID_SetInt(oPC,"QuestPoints",iQuestPoints);
|
||
|
sMessage = "Your father is legendary. You start the game with " + IntToString(iQuestPoints) + " quest points.";
|
||
|
}
|
||
|
else if (iRandom < 27)
|
||
|
{
|
||
|
SetMaxHenchmen(5);
|
||
|
SetLocalString(GetModule(), "FriendlySpirit", GetName(oPC));
|
||
|
SQLocalsUUID_SetInt(oPC,"Spirit",1);
|
||
|
sMessage = "When you were young you befriended a friendly spirit who has become your constant companion.";
|
||
|
}
|
||
|
else if (iRandom < 28)
|
||
|
{
|
||
|
GiveGoldToCreature(oPC,49800);
|
||
|
sMessage = "You come from an extremely wealthy family. On the day of your father's death, you took your inheretance and went out into the world.";
|
||
|
}
|
||
|
else if (iRandom < 29)
|
||
|
{
|
||
|
if (GetAbilityScore(oPC,ABILITY_CHARISMA)>9)
|
||
|
{
|
||
|
SQLocalsUUID_SetInt(oPC,"Charming",1);
|
||
|
sMessage = "You have an inherent spark that causes people to like you. As such, you gather fame easier.";
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
SQLocalsUUID_SetInt(oPC,"Lucky",1);
|
||
|
sMessage = "All of your life you have had the benefit of great luck. If you gambled, you invariably won. If danger was near, you invariably survived. You decided to go out into the world to make a name for yourself armed with the knowledge that your luck would protect you.";
|
||
|
}
|
||
|
}
|
||
|
else if (iRandom < 30)
|
||
|
{
|
||
|
iRandom2 = Random(4)+1;
|
||
|
|
||
|
switch (iRandom2)
|
||
|
{
|
||
|
case 1: SQLocalsUUID_SetInt(oPC,"WeaponBonus",1); sType = "Fire"; break;
|
||
|
case 2: SQLocalsUUID_SetInt(oPC,"WeaponBonus",2); sType = "Lightning"; break;
|
||
|
case 3: SQLocalsUUID_SetInt(oPC,"WeaponBonus",3); sType = "Cold"; break;
|
||
|
case 4: SQLocalsUUID_SetInt(oPC,"WeaponBonus",4); sType = "Acid"; break;
|
||
|
}
|
||
|
SQLocalsUUID_SetInt(oPC, "WeaponBonus", 1);
|
||
|
sMessage = "You were born with amazing powers to control " + sType + " and have learned to enchant items to do more damage.";
|
||
|
}
|
||
|
else if (iRandom < 31)
|
||
|
{
|
||
|
SQLocalsUUID_SetInt(oPC, "Cursed", 1);
|
||
|
GetMagicItem(oPC);
|
||
|
sMessage = "When you were younger, you stole a magic item from a witch. In return, she cursed you and you have found life has been difficult ever since.";
|
||
|
}
|
||
|
else if (iRandom < 32)
|
||
|
{
|
||
|
iRandom2 = Random(3)+1;
|
||
|
|
||
|
SQLocalsUUID_SetInt(oPC,"Enemy",iRandom2);
|
||
|
|
||
|
switch (iRandom2)
|
||
|
{
|
||
|
case 1: sMessage = "A rich merchant gave you a magic item to cross the Red Wizards. You did so, but made a powerful enemy and have fled here hoping you will be safe from them.";
|
||
|
break;
|
||
|
case 2: sMessage = "You were instrumental in catching a theif and received a magic item as a reward, but the Thieves' Guild put a bounty on your head. You fled here hoping you will be safe from them.";
|
||
|
break;
|
||
|
case 3: sMessage = "You cheated a powerful merchant out of a magic item and he put a bounty on your head. You fled here hoping you will be safe from them.";
|
||
|
break;
|
||
|
}
|
||
|
|
||
|
if (Random(3)==0)
|
||
|
GetRareItem(oPC);
|
||
|
else
|
||
|
GetMagicItem(oPC);
|
||
|
}
|
||
|
else if (iRandom < 33)
|
||
|
{
|
||
|
GetEN2Weapon(oPC,oPC);
|
||
|
|
||
|
sMessage = "Your father is a hero, once saving the village of Nirra Hamlett. When you set out into the world he gave you a magical weapon from his days of adventuring.";
|
||
|
}
|
||
|
else if (iRandom < 34)
|
||
|
{
|
||
|
iRandom2 = (Random(4)+1) * 5;
|
||
|
SQLocalsUUID_SetInt(oPC,"PCXPBonus",iRandom2);
|
||
|
sMessage = "You are have always been a very quick learner and pick up new skills easily.";
|
||
|
}
|
||
|
else if (iRandom < 35)
|
||
|
{
|
||
|
SQLocalsUUID_SetInt(oPC,"HasCustomSkin",1);
|
||
|
sRace = GetSubRace(oPC);
|
||
|
|
||
|
if (sRace == "")
|
||
|
sRace = GetRace(oPC);
|
||
|
|
||
|
sRace = "Shade " + sRace;
|
||
|
|
||
|
sMessage = "You were born into shadow and from the shadows you gain power. You now use to make your mark in the world.";
|
||
|
|
||
|
SetSubRace(oPC,sRace);
|
||
|
|
||
|
//CreateGodlingPC(oPC);
|
||
|
|
||
|
SQLocalsUUID_SetInt(oPC,"SpecialPowers",4);
|
||
|
|
||
|
CreateSpecialPowers(oPC);
|
||
|
|
||
|
iMod=1;
|
||
|
}
|
||
|
else if (iRandom < 36)
|
||
|
{
|
||
|
SQLocalsUUID_SetInt(oPC,"HasCustomSkin",1);
|
||
|
sMessage = "You have always had great strength. You now arrive in hightop to make your mark in the world.";
|
||
|
SQLocalsUUID_SetInt(oPC,"SpecialPowers",5);
|
||
|
CreateSpecialPowers(oPC);
|
||
|
}
|
||
|
else if (iRandom < 37)
|
||
|
{
|
||
|
SQLocalsUUID_SetInt(oPC,"HasCustomSkin",1);
|
||
|
sMessage = "You have always had been very hardy. You now arrive in hightop to make your mark in the world.";
|
||
|
SQLocalsUUID_SetInt(oPC,"SpecialPowers",6);
|
||
|
CreateSpecialPowers(oPC);
|
||
|
}
|
||
|
else if (iRandom < 38)
|
||
|
{
|
||
|
SQLocalsUUID_SetInt(oPC,"HasCustomSkin",1);
|
||
|
sMessage = "You have always had been very nimble. You now arrive in hightop to make your mark in the world.";
|
||
|
SQLocalsUUID_SetInt(oPC,"SpecialPowers",7);
|
||
|
CreateSpecialPowers(oPC);
|
||
|
}
|
||
|
else if (iRandom < 39)
|
||
|
{
|
||
|
sMessage = "Upon your father's death, you inherited a rare item from him and set out in the world to seek fame and fortune.";
|
||
|
GetRareItem(oPC);
|
||
|
}
|
||
|
else if (iRandom < 40)
|
||
|
{
|
||
|
SQLocalsUUID_SetInt(oPC,"HasCustomSkin",1);
|
||
|
sMessage = "You have always had an affinity with magic. This affinity helps you manipulate and resist it.";
|
||
|
SQLocalsUUID_SetInt(oPC,"SpecialPowers",8);
|
||
|
CreateSpecialPowers(oPC);
|
||
|
}
|
||
|
else if (iRandom < 41)
|
||
|
{
|
||
|
sMessage = "Your father was a powerful sorcerer and upon his death you inherited a rare artifact that imparted some of that power to you.";
|
||
|
GetInfiniteSpells(oPC);
|
||
|
}
|
||
|
else if (iRandom < 42)
|
||
|
{
|
||
|
//SuperPowers
|
||
|
SQLocalsUUID_SetInt(oPC,"HasCustomSkin",1);
|
||
|
sMessage = "You are descended from an ancient race who wield special powers far beyond those of mortal man.";
|
||
|
iRandom2 = Random(10)+1;
|
||
|
//iRandom2 = 7;
|
||
|
|
||
|
switch (iRandom2)
|
||
|
{
|
||
|
case 1: sMessage = sMessage + " You were born with the power to heal from wounds almost instantly.";
|
||
|
SQLocalsUUID_SetInt(oPC,"SuperPowers",1);
|
||
|
break;
|
||
|
case 2: sMessage = sMessage + " You were born with super speed and dexterity.";
|
||
|
SQLocalsUUID_SetInt(oPC,"SuperPowers",2);
|
||
|
break;
|
||
|
case 3: sMessage = sMessage + " You were born in a quasi-ethereal state which leaves you imperveous to physical damage.";
|
||
|
SQLocalsUUID_SetInt(oPC,"SuperPowers",3);
|
||
|
break;
|
||
|
case 4: sMessage = sMessage + " You were born with complete immunity to magical spells.";
|
||
|
SQLocalsUUID_SetInt(oPC,"SuperPowers",4);
|
||
|
break;
|
||
|
case 5: sMessage = sMessage + " You were born with great control over fire.";
|
||
|
SQLocalsUUID_SetInt(oPC,"SuperPowers",5);
|
||
|
SQLocalsUUID_SetInt(oPC,"WeaponBonus",1);
|
||
|
break;
|
||
|
case 6: sMessage = sMessage + " You were born with super strength beyond that of mortal man.";
|
||
|
SQLocalsUUID_SetInt(oPC,"SuperPowers",6);
|
||
|
break;
|
||
|
case 7: sMessage = sMessage + " You were born with the ability to assume multiple forms.";
|
||
|
oItem=CreateItemOnObject("en4_forms",oPC);
|
||
|
SetStolenFlag(oItem,TRUE);
|
||
|
SQLocalsUUID_SetInt(oPC,"HasCustomSkin",0);
|
||
|
break;
|
||
|
case 8: sMessage = sMessage + " You were born with the knowledge of an ancestor who was a powerful wizard.";
|
||
|
oItem=CreateItemOnObject("en4_spells",oPC);
|
||
|
SetStolenFlag(oItem,TRUE);
|
||
|
SQLocalsUUID_SetInt(oPC,"HasCustomSkin",0);
|
||
|
break;
|
||
|
case 9: sMessage = sMessage + " You were born destined to become a hero of epic proportions. This destiny grants you speed, immunity to fear, death, and fatal blows, and great control over weapons.";
|
||
|
SQLocalsUUID_SetInt(oPC,"SuperPowers",7);
|
||
|
break;
|
||
|
case 10: sMessage = sMessage + " You were born with vampiric powers which are channeled through your weapon.";
|
||
|
SQLocalsUUID_SetInt(oPC,"SuperPowers",8);
|
||
|
break;
|
||
|
}
|
||
|
|
||
|
CreateSuperPowers(oPC);
|
||
|
|
||
|
}
|
||
|
else if (iRandom < 43)
|
||
|
{
|
||
|
if (Random(2)==0)
|
||
|
{
|
||
|
sMessage = "You were met on the road by a stange gypsy who gave you a playing card and told you that great power could come from its use, as could great ruin, and its use is limited to once per day. You are unsure of whether or not you want to use the card.";
|
||
|
oItem=CreateItemOnObject("en4_card",oPC);
|
||
|
SetStolenFlag(oItem,TRUE);
|
||
|
} else {
|
||
|
if (Random(2) == 0)
|
||
|
{
|
||
|
sMessage = "Your father was a wizard who left you a magical helm containing great powers of domination upon his death.";
|
||
|
oItem = CreateItemOnObject("en4_eyes",oPC);
|
||
|
SetStolenFlag(oItem,TRUE);
|
||
|
} else {
|
||
|
if (GetAbilityScore(oPC,ABILITY_CHARISMA)>9)
|
||
|
{
|
||
|
SQLocalsUUID_SetInt(oPC,"Charming",1);
|
||
|
sMessage = "You have an inherent spark that causes people to like you. As such, you gather fame easier.";
|
||
|
} else {
|
||
|
SQLocalsUUID_SetInt(oPC,"Lucky",1);
|
||
|
sMessage = "All of your life you have had the benefit of great luck. If you gambled, you invariably won. If danger was near, you invariably survived. You decided to go out into the world to make a name for yourself armed with the knowledge that your luck would protect you.";
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
else
|
||
|
sMessage = "You arrive in Hightop City ready to make a name for yourself.";
|
||
|
} else {
|
||
|
sMessage = "After a long journey, you arrive in Hightop City ready to make a name for yourself.";
|
||
|
}
|
||
|
|
||
|
DelayCommand(0.5,SendMessageToPC(oPC,sMessage));
|
||
|
if (iMod>0)
|
||
|
SQLocalsUUID_SetInt(oPC,"Adjust",iMod);
|
||
|
|
||
|
}
|
||
|
|
||
|
string GetRace(object oPC)
|
||
|
{
|
||
|
string sRace = GetSubRace(oPC);
|
||
|
|
||
|
if (sRace == "")
|
||
|
{
|
||
|
sRace = GetStringByStrRef(StringToInt(Get2DAString("racialtypes", "Name", GetRacialType(oPC))));
|
||
|
}
|
||
|
|
||
|
return sRace;
|
||
|
}
|
||
|
|
||
|
void SetupDynamicMerchant()
|
||
|
{
|
||
|
int iCount;
|
||
|
int iRandom;
|
||
|
object oStore;
|
||
|
|
||
|
oStore = GetObjectByTag("HTC_Dynamic");
|
||
|
|
||
|
iRandom=Random(3)+1;
|
||
|
iCount = 0;
|
||
|
while (iCount <= iRandom)
|
||
|
{
|
||
|
GetMagicItem(oStore,TRUE,TRUE,5);
|
||
|
iCount++;
|
||
|
}
|
||
|
|
||
|
iRandom=Random(5)+6;
|
||
|
iCount = 0;
|
||
|
while (iCount <= iRandom)
|
||
|
{
|
||
|
GetMagicItem(oStore,TRUE,TRUE);
|
||
|
iCount++;
|
||
|
}
|
||
|
|
||
|
iRandom=Random(3)+3;
|
||
|
iCount = 0;
|
||
|
while (iCount <= iRandom)
|
||
|
{
|
||
|
GetMiscMagic(oStore);
|
||
|
iCount++;
|
||
|
}
|
||
|
|
||
|
iRandom=Random(4)+1;
|
||
|
iCount = 0;
|
||
|
while (iCount <= iRandom)
|
||
|
{
|
||
|
GetMinorMagicItem(oStore);
|
||
|
iCount++;
|
||
|
}
|
||
|
|
||
|
iRandom=Random(8)+1;
|
||
|
iCount = 0;
|
||
|
while (iCount <= iRandom)
|
||
|
{
|
||
|
CreateRandomItem(oStore);
|
||
|
iCount++;
|
||
|
}
|
||
|
|
||
|
iRandom=Random(3);
|
||
|
iCount = 0;
|
||
|
while (iCount <= iRandom)
|
||
|
{
|
||
|
GetRareItem(oStore);
|
||
|
iCount++;
|
||
|
}
|
||
|
|
||
|
GetNegativeItem(oStore);
|
||
|
|
||
|
}
|
||
|
|
||
|
void AddToDynamicMerchant()
|
||
|
{
|
||
|
object oStore;
|
||
|
|
||
|
oStore = GetObjectByTag("NH1_Dynamic");
|
||
|
|
||
|
GetMagicItem(oStore,TRUE,TRUE,5);
|
||
|
GetMagicItem(oStore,TRUE,TRUE,5);
|
||
|
GetMagicItem(oStore,TRUE,TRUE,5);
|
||
|
GetMagicItem(oStore,TRUE,TRUE,5);
|
||
|
}
|
||
|
|
||
|
void SetupModule()
|
||
|
{
|
||
|
object oChest;
|
||
|
int iRandom;
|
||
|
int iAI;
|
||
|
|
||
|
SQLocals_SetInt(GetModule(),"ModuleStart",1);
|
||
|
SQLocals_SetInt(GetModule(),MODULE_SWITCH_ENABLE_BEBILITH_RUIN_ARMOR,FALSE);
|
||
|
SetMaxHenchmen(4);
|
||
|
|
||
|
string sCampaign = "Endless Nights IV";
|
||
|
if (GetCampaignInt(sCampaign,"MP") == 1)
|
||
|
sCampaign = "MP_Endless Nights IV";
|
||
|
iAI = GetCampaignInt(sCampaign,"MP");
|
||
|
SQLocals_SetInt(GetModule(),"NoAI",iAI);
|
||
|
|
||
|
oChest = GetObjectByTag("EN4_SpecChest" + IntToString(Random(2)+1));
|
||
|
SQLocals_SetInt(oChest,"Weapon",1);
|
||
|
|
||
|
iRandom = Random(4);
|
||
|
if (iRandom==0)
|
||
|
{
|
||
|
iRandom = Random(4)+1;
|
||
|
SQLocals_SetInt(GetModule(),"HTC_SpecialMerchant",iRandom);
|
||
|
}
|
||
|
|
||
|
WriteTimestampedLogEntry("*** Endless Night IV Loaded ***");
|
||
|
}
|
||
|
|
||
|
void CheckSpecialRace(object oPC)
|
||
|
{
|
||
|
int iDeaths;
|
||
|
int iMonstrous;
|
||
|
int iRace;
|
||
|
string sRace;
|
||
|
|
||
|
iDeaths = 0;
|
||
|
iMonstrous = 0;
|
||
|
iRace = GetRacialType(oPC);
|
||
|
sRace = GetRace(oPC);
|
||
|
|
||
|
//SendMessageToPC(oPC,"Race = " + sRace);
|
||
|
//SendMessageToPC(oPC,"Sub-Race = " + GetSubRace(oPC));
|
||
|
|
||
|
if (iRace == RACIAL_TYPE_AASIMAR) {iDeaths = 2; iMonstrous = 0;}
|
||
|
else if (iRace == RACIAL_TYPE_ABOM_YUAN) {iDeaths = 2; iMonstrous = 1;}
|
||
|
else if (iRace == RACIAL_TYPE_AIR_GEN) {iDeaths = 0; iMonstrous = 0;}
|
||
|
else if (iRace == RACIAL_TYPE_ARANEA) {iDeaths = 1; iMonstrous = 1;}
|
||
|
else if (iRace == RACIAL_TYPE_ARC_DWARF) {iDeaths = 0; iMonstrous = 0;}
|
||
|
else if (iRace == RACIAL_TYPE_ARKAMOI) {iDeaths = 2; iMonstrous = 1;}
|
||
|
else if (iRace == RACIAL_TYPE_ASHERATI) {iDeaths = 0; iMonstrous = 0;}
|
||
|
else if (iRace == RACIAL_TYPE_AVARIEL) {iDeaths = 0; iMonstrous = 0;}
|
||
|
else if (iRace == RACIAL_TYPE_AZER) {iDeaths = 3; iMonstrous = 1;}
|
||
|
else if (iRace == RACIAL_TYPE_AZURIN) {iDeaths = 0; iMonstrous = 0;}
|
||
|
else if (iRace == RACIAL_TYPE_BARIAUR) {iDeaths = 2; iMonstrous = 0;}
|
||
|
else if (iRace == RACIAL_TYPE_BHUKA) {iDeaths = 0; iMonstrous = 1;}
|
||
|
else if (iRace == RACIAL_TYPE_BLUE_GOBLIN) {iDeaths = 0; iMonstrous = 1;}
|
||
|
else if (iRace == RACIAL_TYPE_BRALANI) {iDeaths = 3; iMonstrous = 0;}
|
||
|
else if (iRace == RACIAL_TYPE_BROWNIE) {iDeaths = 2; iMonstrous = 0;}
|
||
|
else if (iRace == RACIAL_TYPE_BUGBEAR) {iDeaths = 1; iMonstrous = 1;}
|
||
|
else if (iRace == RACIAL_TYPE_BUOMMANS) {iDeaths = 0; iMonstrous = 0;}
|
||
|
else if (iRace == RACIAL_TYPE_CATFOLK) {iDeaths = 1; iMonstrous = 0;}
|
||
|
else if (iRace == RACIAL_TYPE_CENTAUR) {iDeaths = 2; iMonstrous = 0;}
|
||
|
else if (iRace == RACIAL_TYPE_CHANGELING) {iDeaths = 1; iMonstrous = 0;}
|
||
|
else if (iRace == RACIAL_TYPE_CHITINE) {iDeaths = 1; iMonstrous = 1;}
|
||
|
else if (iRace == RACIAL_TYPE_CRUCIAN) {iDeaths = 1; iMonstrous = 1;}
|
||
|
else if (iRace == RACIAL_TYPE_DEEP_GNOME) {iDeaths = 1; iMonstrous = 0;}
|
||
|
else if (iRace == RACIAL_TYPE_DEEP_HALFLING) {iDeaths = 0; iMonstrous = 0;}
|
||
|
else if (iRace == RACIAL_TYPE_DOPPELGANGER) {iDeaths = 2; iMonstrous = 0;}
|
||
|
else if (iRace == RACIAL_TYPE_DRIDER) {iDeaths = 2; iMonstrous = 1;}
|
||
|
else if (iRace == RACIAL_TYPE_DROMITE) {iDeaths = 1; iMonstrous = 1;}
|
||
|
else if (iRace == RACIAL_TYPE_DROW_FEMALE) {iDeaths = 2; iMonstrous = 0;}
|
||
|
else if (iRace == RACIAL_TYPE_DROW_MALE) {iDeaths = 2; iMonstrous = 0;}
|
||
|
else if (iRace == RACIAL_TYPE_DUERGAR) {iDeaths = 2; iMonstrous = 1;}
|
||
|
else if (iRace == RACIAL_TYPE_DUSKLING) {iDeaths = 2; iMonstrous = 0;}
|
||
|
else if (iRace == RACIAL_TYPE_EARTH_GEN) {iDeaths = 0; iMonstrous = 0;}
|
||
|
else if (iRace == RACIAL_TYPE_ELAN) {iDeaths = 0; iMonstrous = 0;}
|
||
|
else if (iRace == RACIAL_TYPE_EXTAMINAAR) {iDeaths = 1; iMonstrous = 1;}
|
||
|
else if (iRace == RACIAL_TYPE_FERAL_GARGUN) {iDeaths = 1; iMonstrous = 1;}
|
||
|
else if (iRace == RACIAL_TYPE_FEYRI) {iDeaths = 2; iMonstrous = 0;}
|
||
|
else if (iRace == RACIAL_TYPE_FIRE_GEN) {iDeaths = 0; iMonstrous = 0;}
|
||
|
else if (iRace == RACIAL_TYPE_FIREBLOOD_DWARF) {iDeaths = 0; iMonstrous = 0;}
|
||
|
else if (iRace == RACIAL_TYPE_FLIND) {iDeaths = 2; iMonstrous = 1;}
|
||
|
else if (iRace == RACIAL_TYPE_FOR_GNOME) {iDeaths = 0; iMonstrous = 0;}
|
||
|
else if (iRace == RACIAL_TYPE_FORESTLORD_ELF) {iDeaths = 0; iMonstrous = 0;}
|
||
|
else if (iRace == RACIAL_TYPE_FROST_FOLK) {iDeaths = 1; iMonstrous = 0;}
|
||
|
else if (iRace == RACIAL_TYPE_FROSTBLOOD_ORC) {iDeaths = 0; iMonstrous = 1;}
|
||
|
else if (iRace == RACIAL_TYPE_GHOSTWISE_HALFLING) {iDeaths = 0; iMonstrous = 0;}
|
||
|
else if (iRace == RACIAL_TYPE_GITHYANKI) {iDeaths = 2; iMonstrous = 1;}
|
||
|
else if (iRace == RACIAL_TYPE_GITHZERAI) {iDeaths = 2; iMonstrous = 0;}
|
||
|
else if (iRace == RACIAL_TYPE_GLIMMERSKIN_HALFING) {iDeaths = 0; iMonstrous = 0;}
|
||
|
else if (iRace == RACIAL_TYPE_GLOURA) {iDeaths = 3; iMonstrous = 0;}
|
||
|
else if (iRace == RACIAL_TYPE_GNOLL) {iDeaths = 1; iMonstrous = 1;}
|
||
|
else if (iRace == RACIAL_TYPE_GOBLIN) {iDeaths = 0; iMonstrous = 1;}
|
||
|
else if (iRace == RACIAL_TYPE_GOLD_DWARF) {iDeaths = 0; iMonstrous = 0;}
|
||
|
else if (iRace == RACIAL_TYPE_GOLIATH) {iDeaths = 2; iMonstrous = 0;}
|
||
|
else if (iRace == RACIAL_TYPE_GRAYORC) {iDeaths = 1; iMonstrous = 1;}
|
||
|
else if (iRace == RACIAL_TYPE_HADOZEE) {iDeaths = 1; iMonstrous = 0;}
|
||
|
else if (iRace == RACIAL_TYPE_HADRIMOI) {iDeaths = 2; iMonstrous = 1;}
|
||
|
else if (iRace == RACIAL_TYPE_HAGSPAWN) {iDeaths = 2; iMonstrous = 1;}
|
||
|
else if (iRace == RACIAL_TYPE_HALFDROW) {iDeaths = 1; iMonstrous = 0;}
|
||
|
else if (iRace == RACIAL_TYPE_HALFOGRE) {iDeaths = 2; iMonstrous = 0;}
|
||
|
else if (iRace == RACIAL_TYPE_HOBGOBLIN) {iDeaths = 1; iMonstrous = 1;}
|
||
|
else if (iRace == RACIAL_TYPE_HOUND_ARCHON) {iDeaths = 2; iMonstrous = 0;}
|
||
|
else if (iRace == RACIAL_TYPE_HYBSIL) {iDeaths = 2; iMonstrous = 0;}
|
||
|
else if (iRace == RACIAL_TYPE_ILLITHID) {iDeaths = 3; iMonstrous = 1;}
|
||
|
else if (iRace == RACIAL_TYPE_IMASKARI) {iDeaths = 0; iMonstrous = 0;}
|
||
|
else if (iRace == RACIAL_TYPE_KALASHTAR) {iDeaths = 1; iMonstrous = 0;}
|
||
|
else if (iRace == RACIAL_TYPE_KARSITE) {iDeaths = 1; iMonstrous = 0;}
|
||
|
else if (iRace == RACIAL_TYPE_KHAASTA) {iDeaths = 2; iMonstrous = 1;}
|
||
|
else if (iRace == RACIAL_TYPE_KILLOREN) {iDeaths = 2; iMonstrous = 0;}
|
||
|
else if (iRace == RACIAL_TYPE_KOBOLD) {iDeaths = 0; iMonstrous = 1;}
|
||
|
else if (iRace == RACIAL_TYPE_KRINTH) {iDeaths = 1; iMonstrous = 0;}
|
||
|
else if (iRace == RACIAL_TYPE_LASHEMOI) {iDeaths = 2; iMonstrous = 1;}
|
||
|
else if (iRace == RACIAL_TYPE_LIZARDFOLK) {iDeaths = 1; iMonstrous = 1;}
|
||
|
else if (iRace == RACIAL_TYPE_MAENADS) {iDeaths = 1; iMonstrous = 0;}
|
||
|
else if (iRace == RACIAL_TYPE_MARRULURK) {iDeaths = 2; iMonstrous = 1;}
|
||
|
else if (iRace == RACIAL_TYPE_MARRUSAULT) {iDeaths = 2; iMonstrous = 1;}
|
||
|
else if (iRace == RACIAL_TYPE_MARRUTACT) {iDeaths = 2; iMonstrous = 1;}
|
||
|
else if (iRace == RACIAL_TYPE_MEPHLING_AIR) {iDeaths = 1; iMonstrous = 0;}
|
||
|
else if (iRace == RACIAL_TYPE_MEPHLING_EARTH) {iDeaths = 1; iMonstrous = 0;}
|
||
|
else if (iRace == RACIAL_TYPE_MEPHLING_FIRE) {iDeaths = 1; iMonstrous = 0;}
|
||
|
else if (iRace == RACIAL_TYPE_MEPHLING_WATER) {iDeaths = 1; iMonstrous = 0;}
|
||
|
else if (iRace == RACIAL_TYPE_MINOTAUR) {iDeaths = 2; iMonstrous = 1;}
|
||
|
else if (iRace == RACIAL_TYPE_MONGRELFOLK) {iDeaths = 0; iMonstrous = 1;}
|
||
|
else if (iRace == RACIAL_TYPE_MUCKDWELLER) {iDeaths = 0; iMonstrous = 1;}
|
||
|
else if (iRace == RACIAL_TYPE_NATHRI) {iDeaths = 1; iMonstrous = 1;}
|
||
|
else if (iRace == RACIAL_TYPE_NAZTHARUNE_RAKSHASA) {iDeaths = 3; iMonstrous = 0;}
|
||
|
else if (iRace == RACIAL_TYPE_NEANDERTHAL) {iDeaths = 1; iMonstrous = 0;}
|
||
|
else if (iRace == RACIAL_TYPE_NERAPHIM) {iDeaths = 1; iMonstrous = 1;}
|
||
|
else if (iRace == RACIAL_TYPE_OGRE) {iDeaths = 2; iMonstrous = 1;}
|
||
|
else if (iRace == RACIAL_TYPE_ORC) {iDeaths = 0; iMonstrous = 1;}
|
||
|
else if (iRace == RACIAL_TYPE_OROG) {iDeaths = 2; iMonstrous = 1;}
|
||
|
else if (iRace == RACIAL_TYPE_PH_HALFGIANT) {iDeaths = 2; iMonstrous = 0;}
|
||
|
else if (iRace == RACIAL_TYPE_PIXIE) {iDeaths = 2; iMonstrous = 0;}
|
||
|
else if (iRace == RACIAL_TYPE_POISON_DUSK) {iDeaths = 1; iMonstrous = 1;}
|
||
|
else if (iRace == RACIAL_TYPE_PURE_YUAN) {iDeaths = 2; iMonstrous = 1;}
|
||
|
else if (iRace == RACIAL_TYPE_RAKSHASA) {iDeaths = 3; iMonstrous = 0;}
|
||
|
else if (iRace == RACIAL_TYPE_REDSPAWN_ARCANISS) {iDeaths = 2; iMonstrous = 1;}
|
||
|
else if (iRace == RACIAL_TYPE_RETH_DEKALA) {iDeaths = 2; iMonstrous = 1;}
|
||
|
else if (iRace == RACIAL_TYPE_RILKAN) {iDeaths = 1; iMonstrous = 0;}
|
||
|
else if (iRace == RACIAL_TYPE_ROCK_GNOME) {iDeaths = 0; iMonstrous = 0;}
|
||
|
else if (iRace == RACIAL_TYPE_SHADOWSWYFT) {iDeaths = 2; iMonstrous = 0;}
|
||
|
else if (iRace == RACIAL_TYPE_SHARAKIM) {iDeaths = 1; iMonstrous = 0;}
|
||
|
else if (iRace == RACIAL_TYPE_SHIFTER) {iDeaths = 2; iMonstrous = 0;}
|
||
|
else if (iRace == RACIAL_TYPE_SILVERBROW_HUMAN) {iDeaths = 0; iMonstrous = 0;}
|
||
|
else if (iRace == RACIAL_TYPE_SKARN) {iDeaths = 2; iMonstrous = 0;}
|
||
|
else if (iRace == RACIAL_TYPE_SKULK) {iDeaths = 2; iMonstrous = 1;}
|
||
|
else if (iRace == RACIAL_TYPE_SNOW_ELF) {iDeaths = 0; iMonstrous = 0;}
|
||
|
else if (iRace == RACIAL_TYPE_SPIKER) {iDeaths = 2; iMonstrous = 1;}
|
||
|
else if (iRace == RACIAL_TYPE_SPIRETOPDRAGON) {iDeaths = 1; iMonstrous = 0;}
|
||
|
else if (iRace == RACIAL_TYPE_SPIRIT_FOLK) {iDeaths = 0; iMonstrous = 0;}
|
||
|
else if (iRace == RACIAL_TYPE_STONECHILD) {iDeaths = 1; iMonstrous = 0;}
|
||
|
else if (iRace == RACIAL_TYPE_STONEHUNTER_GNOME) {iDeaths = 0; iMonstrous = 0;}
|
||
|
else if (iRace == RACIAL_TYPE_STRONGHEART_HALFLING) {iDeaths = 0; iMonstrous = 0;}
|
||
|
else if (iRace == RACIAL_TYPE_SUN_ELF) {iDeaths = 0; iMonstrous = 0;}
|
||
|
else if (iRace == RACIAL_TYPE_SUNSCORCH_HOBGOBLIN) {iDeaths = 1; iMonstrous = 1;}
|
||
|
else if (iRace == RACIAL_TYPE_TAER) {iDeaths = 1; iMonstrous = 1;}
|
||
|
else if (iRace == RACIAL_TYPE_TALLFELLOW_HALFLING) {iDeaths = 0; iMonstrous = 0;}
|
||
|
else if (iRace == RACIAL_TYPE_TANARUKK) {iDeaths = 2; iMonstrous = 1;}
|
||
|
else if (iRace == RACIAL_TYPE_TASLOI) {iDeaths = 0; iMonstrous = 1;}
|
||
|
else if (iRace == RACIAL_TYPE_TIEFLING) {iDeaths = 2; iMonstrous = 0;}
|
||
|
else if (iRace == RACIAL_TYPE_TROGLODYTE) {iDeaths = 0; iMonstrous = 1;}
|
||
|
else if (iRace == RACIAL_TYPE_TROLL) {iDeaths = 3; iMonstrous = 1;}
|
||
|
else if (iRace == RACIAL_TYPE_TUNDRA_HALFLING) {iDeaths = 0; iMonstrous = 0;}
|
||
|
else if (iRace == RACIAL_TYPE_TURLEMOI) {iDeaths = 2; iMonstrous = 1;}
|
||
|
else if (iRace == RACIAL_TYPE_ULDRA) {iDeaths = 0; iMonstrous = 0;}
|
||
|
else if (iRace == RACIAL_TYPE_UNDERFOLK) {iDeaths = 0; iMonstrous = 0;}
|
||
|
else if (iRace == RACIAL_TYPE_URDINNIR) {iDeaths = 1; iMonstrous = 0;}
|
||
|
else if (iRace == RACIAL_TYPE_VARAG) {iDeaths = 2; iMonstrous = 1;}
|
||
|
else if (iRace == RACIAL_TYPE_VILETOOTH_LIZARDFOLK) {iDeaths = 1; iMonstrous = 1;}
|
||
|
else if (iRace == RACIAL_TYPE_VOLODNI) {iDeaths = 2; iMonstrous = 0;}
|
||
|
else if (iRace == RACIAL_TYPE_WARFORGED) {iDeaths = 2; iMonstrous = 0;}
|
||
|
else if (iRace == RACIAL_TYPE_WARFORGED_CHARGER) {iDeaths = 2; iMonstrous = 0;}
|
||
|
else if (iRace == RACIAL_TYPE_WATER_GEN) {iDeaths = 0; iMonstrous = 0;}
|
||
|
else if (iRace == RACIAL_TYPE_WEMIC) {iDeaths = 3; iMonstrous = 0;}
|
||
|
else if (iRace == RACIAL_TYPE_WHISPER_GNOME) {iDeaths = 0; iMonstrous = 0;}
|
||
|
else if (iRace == RACIAL_TYPE_WILD_DWARF) {iDeaths = 0; iMonstrous = 0;}
|
||
|
else if (iRace == RACIAL_TYPE_WILD_ELF) {iDeaths = 0; iMonstrous = 0;}
|
||
|
else if (iRace == RACIAL_TYPE_WILDREN) {iDeaths = 2; iMonstrous = 0;}
|
||
|
else if (iRace == RACIAL_TYPE_WOOD_ELF) {iDeaths = 0; iMonstrous = 0;}
|
||
|
else if (iRace == RACIAL_TYPE_XEPH) {iDeaths = 2; iMonstrous = 0;}
|
||
|
else if (iRace == RACIAL_TYPE_ZAKYA_RAKSHASA) {iDeaths = 3; iMonstrous = 0;}
|
||
|
|
||
|
|
||
|
// if (iRace == RACIAL_TYPE_SHADOWSWYFT) {iDeaths = 2;}
|
||
|
|
||
|
// else if (iRace == RACIAL_TYPE_NERAPHIM) {iDeaths = 1; iMonstrous = 1;}
|
||
|
|
||
|
// else if (iRace == RACIAL_TYPE_TROLL)
|
||
|
// {
|
||
|
// iDeaths = 3;
|
||
|
// iMonstrous = 1;
|
||
|
// }
|
||
|
// else if (iRace == RACIAL_TYPE_HALFOGRE)
|
||
|
// {
|
||
|
// iDeaths = 2;
|
||
|
// }
|
||
|
// else if (iRace == RACIAL_TYPE_AZER)
|
||
|
// {
|
||
|
// iDeaths = 3;
|
||
|
// iMonstrous = 1;
|
||
|
// }
|
||
|
// else if (iRace == RACIAL_TYPE_PIXIE)
|
||
|
// {
|
||
|
// iDeaths = 2;
|
||
|
// }
|
||
|
// else if (iRace == RACIAL_TYPE_ILLITHID)
|
||
|
// {
|
||
|
// iDeaths = 3;
|
||
|
// iMonstrous = 1;
|
||
|
// }
|
||
|
// else if (iRace == RACIAL_TYPE_RAKSHASA)
|
||
|
// {
|
||
|
// iDeaths = 3;
|
||
|
// iMonstrous = 1;
|
||
|
// }
|
||
|
// else if (iRace == RACIAL_TYPE_GITHZERAI)
|
||
|
// {
|
||
|
// iDeaths = 2;
|
||
|
// iMonstrous = 1;
|
||
|
// }
|
||
|
// else if (iRace == RACIAL_TYPE_GITHYANKI)
|
||
|
// {
|
||
|
// iDeaths = 2;
|
||
|
// iMonstrous = 1;
|
||
|
// }
|
||
|
// else if (iRace == RACIAL_TYPE_PURE_YUAN)
|
||
|
// {
|
||
|
// iDeaths = 3;
|
||
|
// iMonstrous = 1;
|
||
|
// }
|
||
|
// else if (iRace == RACIAL_TYPE_LIZARDFOLK)
|
||
|
// {
|
||
|
// iDeaths = 2;
|
||
|
// iMonstrous = 1;
|
||
|
// }
|
||
|
// else if (iRace == RACIAL_TYPE_MINOTAUR)
|
||
|
// {
|
||
|
// iDeaths = 3;
|
||
|
// iMonstrous = 1;
|
||
|
// }
|
||
|
// else if (iRace == RACIAL_TYPE_BUGBEAR)
|
||
|
// {
|
||
|
// iDeaths = 1;
|
||
|
// iMonstrous = 1;
|
||
|
// }
|
||
|
// else if (iRace == RACIAL_TYPE_OGRE)
|
||
|
// {
|
||
|
// iDeaths = 3;
|
||
|
// iMonstrous = 1;
|
||
|
// }
|
||
|
// else if (iRace == RACIAL_TYPE_TIEFLING)
|
||
|
// {
|
||
|
// iDeaths = 1;
|
||
|
// }
|
||
|
// else if (iRace == RACIAL_TYPE_TANARUKK)
|
||
|
// {
|
||
|
// iDeaths = 3;
|
||
|
// iMonstrous = 1;
|
||
|
// }
|
||
|
// else if (iRace == RACIAL_TYPE_FEYRI)
|
||
|
// {
|
||
|
// iDeaths = 3;
|
||
|
// }
|
||
|
// else if (iRace == RACIAL_TYPE_AASIMAR)
|
||
|
// {
|
||
|
// iDeaths = 1;
|
||
|
// }
|
||
|
// else if (iRace == RACIAL_TYPE_OROG)
|
||
|
// {
|
||
|
// iDeaths = 2;
|
||
|
// iMonstrous = 1;
|
||
|
// }
|
||
|
// else if (iRace == RACIAL_TYPE_DEEP_GNOME)
|
||
|
// {
|
||
|
// iDeaths = 2;
|
||
|
// }
|
||
|
// else if (iRace == RACIAL_TYPE_DROW_FEMALE)
|
||
|
// {
|
||
|
// iDeaths = 2;
|
||
|
// }
|
||
|
// else if (iRace == RACIAL_TYPE_WILD_DWARF)
|
||
|
// {
|
||
|
// iDeaths = 1;
|
||
|
// }
|
||
|
// else if (iRace == RACIAL_TYPE_URDINNIR)
|
||
|
// {
|
||
|
// iDeaths = 2;
|
||
|
// }
|
||
|
// else if (iRace == RACIAL_TYPE_DUERGAR)
|
||
|
// {
|
||
|
// iDeaths = 1;
|
||
|
// }
|
||
|
// else if (iRace == RACIAL_TYPE_ARC_DWARF)
|
||
|
// {
|
||
|
// iDeaths = 2;
|
||
|
// }
|
||
|
|
||
|
if (iMonstrous == 1)
|
||
|
{
|
||
|
object oGood;
|
||
|
oGood = GetObjectByTag("en3_good");
|
||
|
AdjustReputation(oPC,oGood,-100);
|
||
|
|
||
|
object oDefender;
|
||
|
oDefender = GetObjectByTag("en4_cityguard0_1");
|
||
|
AdjustReputation(oPC,oDefender,-100);
|
||
|
|
||
|
object oEvil;
|
||
|
oEvil = GetObjectByTag("en4_evil");
|
||
|
AdjustReputation(oPC,oEvil,50);
|
||
|
|
||
|
if (GetGoodEvilValue(oPC) > 60)
|
||
|
{
|
||
|
SQLocalsUUID_SetInt(oPC,"Monstrous",2);
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
SQLocalsUUID_SetInt(oPC,"Monstrous",1);
|
||
|
}
|
||
|
|
||
|
object oSpawnPoint;
|
||
|
|
||
|
oSpawnPoint = GetObjectByTag("EN4_MERespawn");
|
||
|
|
||
|
DelayCommand(0.1f,AssignCommand(oPC,JumpToLocation(GetLocation(oSpawnPoint))));
|
||
|
DelayCommand(1.0f,SendMessageToPC(oPC,"Your monstrous appearence renders guards, defenders, and citizens aggressive to you."));
|
||
|
}
|
||
|
|
||
|
if (iDeaths > 0)
|
||
|
{
|
||
|
SQLocalsUUID_SetInt(oPC,"PCDeaths",iDeaths);
|
||
|
SQLocalsUUID_SetInt(oPC,"PCLevelMod",iDeaths);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
void SetupRandomNPCs()
|
||
|
{
|
||
|
string sLocation;
|
||
|
string sNPC;
|
||
|
string sNPCLoc;
|
||
|
int iRandomSpot;
|
||
|
int iRandom;
|
||
|
object oNPC;
|
||
|
location lLoc;
|
||
|
|
||
|
if (Random(2)==0)
|
||
|
{
|
||
|
if (Random(2) == 0)
|
||
|
sLocation = "RP1";
|
||
|
else
|
||
|
sLocation = "WG1";
|
||
|
|
||
|
|
||
|
iRandom = Random(2)+1;
|
||
|
switch (iRandom)
|
||
|
{
|
||
|
case 1: sNPC = "en4_en4m1"; break;
|
||
|
case 2: sNPC = "en4_en4npc1"; break;
|
||
|
}
|
||
|
|
||
|
iRandomSpot = Random(4)+1;
|
||
|
sNPCLoc = sLocation + "_QuestGiver" + IntToString(iRandomSpot);
|
||
|
lLoc = RandomLoc(GetObjectByTag(sNPCLoc));
|
||
|
oNPC = CreateObject(OBJECT_TYPE_CREATURE, sNPC, lLoc);
|
||
|
if (!GetIsObjectValid(oNPC))
|
||
|
oNPC = CreateObject(OBJECT_TYPE_CREATURE, sNPC, GetLocation(GetObjectByTag(sNPCLoc)));
|
||
|
}
|
||
|
|
||
|
if (Random(2)==0)
|
||
|
{
|
||
|
sLocation = "SP1";
|
||
|
|
||
|
iRandom = Random(3)+1;
|
||
|
switch (iRandom)
|
||
|
{
|
||
|
case 1: sNPC = "en4_en4m2"; break;
|
||
|
case 2: sNPC = "en4_en4npc2"; break;
|
||
|
case 3: sNPC = "en4_en4f1"; break;
|
||
|
}
|
||
|
|
||
|
if (Random(2) == 0)
|
||
|
sNPC = "en4_en4m2";
|
||
|
else
|
||
|
sNPC = "en4_en4npc2";
|
||
|
|
||
|
iRandomSpot = Random(4)+1;
|
||
|
sNPCLoc = sLocation + "_QuestGiver" + IntToString(iRandomSpot);
|
||
|
lLoc = RandomLoc(GetObjectByTag(sNPCLoc));
|
||
|
oNPC = CreateObject(OBJECT_TYPE_CREATURE, sNPC, lLoc);
|
||
|
if (!GetIsObjectValid(oNPC))
|
||
|
oNPC = CreateObject(OBJECT_TYPE_CREATURE, sNPC, GetLocation(GetObjectByTag(sNPCLoc)));
|
||
|
}
|
||
|
|
||
|
if (Random(2)==0)
|
||
|
{
|
||
|
sLocation = "RW1";
|
||
|
|
||
|
|
||
|
iRandom = Random(2)+1;
|
||
|
switch (iRandom)
|
||
|
{
|
||
|
case 1: sNPC = "en4_en4m3"; break;
|
||
|
case 2: sNPC = "en4_en4npc3"; break;
|
||
|
}
|
||
|
|
||
|
iRandomSpot = Random(4)+1;
|
||
|
sNPCLoc = sLocation + "_QuestGiver" + IntToString(iRandomSpot);
|
||
|
lLoc = RandomLoc(GetObjectByTag(sNPCLoc));
|
||
|
oNPC = CreateObject(OBJECT_TYPE_CREATURE, sNPC, lLoc);
|
||
|
if (!GetIsObjectValid(oNPC))
|
||
|
oNPC = CreateObject(OBJECT_TYPE_CREATURE, sNPC, GetLocation(GetObjectByTag(sNPCLoc)));
|
||
|
}
|
||
|
|
||
|
if (Random(2)==0)
|
||
|
{
|
||
|
sLocation = "DW1";
|
||
|
|
||
|
iRandom = Random(3)+1;
|
||
|
switch (iRandom)
|
||
|
{
|
||
|
case 1: sNPC = "en4_en4m4"; break;
|
||
|
case 2: sNPC = "en4_en4npc4"; break;
|
||
|
case 3: sNPC = "en4_en4f2"; break;
|
||
|
}
|
||
|
|
||
|
iRandomSpot = Random(4)+1;
|
||
|
sNPCLoc = sLocation + "_QuestGiver" + IntToString(iRandomSpot);
|
||
|
lLoc = RandomLoc(GetObjectByTag(sNPCLoc));
|
||
|
oNPC = CreateObject(OBJECT_TYPE_CREATURE, sNPC, lLoc);
|
||
|
if (!GetIsObjectValid(oNPC))
|
||
|
oNPC = CreateObject(OBJECT_TYPE_CREATURE, sNPC, GetLocation(GetObjectByTag(sNPCLoc)));
|
||
|
}
|
||
|
|
||
|
if (Random(2)==0)
|
||
|
{
|
||
|
sLocation = "SP1";
|
||
|
|
||
|
iRandom = Random(3)+1;
|
||
|
switch (iRandom)
|
||
|
{
|
||
|
case 1: sNPC = "en4_en4m5"; break;
|
||
|
case 2: sNPC = "en4_en4npc5"; break;
|
||
|
case 3: sNPC = "en3_Ronus"; break;
|
||
|
}
|
||
|
|
||
|
iRandomSpot = Random(4)+1;
|
||
|
sNPCLoc = sLocation + "_QuestGiver" + IntToString(iRandomSpot);
|
||
|
lLoc = RandomLoc(GetObjectByTag(sNPCLoc));
|
||
|
oNPC = CreateObject(OBJECT_TYPE_CREATURE, sNPC, lLoc);
|
||
|
if (!GetIsObjectValid(oNPC))
|
||
|
oNPC = CreateObject(OBJECT_TYPE_CREATURE, sNPC, GetLocation(GetObjectByTag(sNPCLoc)));
|
||
|
}
|
||
|
|
||
|
if (Random(2)==0)
|
||
|
{
|
||
|
sLocation = "IP1";
|
||
|
|
||
|
iRandom = Random(2)+1;
|
||
|
switch (iRandom)
|
||
|
{
|
||
|
case 1: sNPC = "en4_en4f3"; break;
|
||
|
case 2: sNPC = "en4_en4npc6"; break;
|
||
|
}
|
||
|
|
||
|
iRandomSpot = Random(4)+1;
|
||
|
sNPCLoc = sLocation + "_QuestGiver" + IntToString(iRandomSpot);
|
||
|
lLoc = RandomLoc(GetObjectByTag(sNPCLoc));
|
||
|
oNPC = CreateObject(OBJECT_TYPE_CREATURE, sNPC, lLoc);
|
||
|
if (!GetIsObjectValid(oNPC))
|
||
|
oNPC = CreateObject(OBJECT_TYPE_CREATURE, sNPC, GetLocation(GetObjectByTag(sNPCLoc)));
|
||
|
}
|
||
|
}
|
||
|
|
||
|
void CheckImport(object oPC)
|
||
|
{
|
||
|
int iXP;
|
||
|
int iGold;
|
||
|
int iXPCheck;
|
||
|
int iGoldCheck;
|
||
|
int iOverallQuest;
|
||
|
int iHardcore;
|
||
|
int iHardcorePnP;
|
||
|
int iQuestPoints;
|
||
|
int iDeaths;
|
||
|
int iModRank;
|
||
|
int iMonstrous;
|
||
|
int iPCXPBonus;
|
||
|
int iPCLevelMod;
|
||
|
int iSpecialPowers;
|
||
|
int iSuperPowers;
|
||
|
int iSpirit;
|
||
|
int iLucky;
|
||
|
int iCharming;
|
||
|
int iWeaponBonus;
|
||
|
int iAdjust;
|
||
|
int iEnemy;
|
||
|
int iCursed;
|
||
|
int iPCEnterLevel;
|
||
|
int iEvilLevel;
|
||
|
int iEvilPowers;
|
||
|
int iEvilQuest;
|
||
|
int iHardcoreSpecial;
|
||
|
int iGuild;
|
||
|
int iGuildQuests;
|
||
|
|
||
|
iXP = GetXP(oPC);
|
||
|
iGold = GetGold(oPC);
|
||
|
|
||
|
iXPCheck = GetCampaignInt("Endless Nights IV","XP",oPC);
|
||
|
iGoldCheck = GetCampaignInt("Endless Nights IV","Gold",oPC);
|
||
|
|
||
|
if (iXP == iXPCheck && iGold == iGoldCheck)
|
||
|
{
|
||
|
iOverallQuest = GetCampaignInt("Endless Nights IV","OverallQuest",oPC);
|
||
|
iHardcore = GetCampaignInt("Endless Nights IV","PCHardcore",oPC);
|
||
|
iHardcorePnP = GetCampaignInt("Endless Nights IV","PCHardCorePNP",oPC);
|
||
|
iHardcoreSpecial = GetCampaignInt("Endless Nights IV","PCHardCoreSpecial",oPC);
|
||
|
|
||
|
iQuestPoints = GetCampaignInt("Endless Nights IV","QuestPoints",oPC);
|
||
|
iDeaths = GetCampaignInt("Endless Nights IV","PCDeaths",oPC);
|
||
|
iModRank = GetCampaignInt("Endless Nights IV","ModRank",oPC);
|
||
|
iMonstrous = GetCampaignInt("Endless Nights IV","Monstrous",oPC);
|
||
|
iPCXPBonus = GetCampaignInt("Endless Nights IV","PCXPBonus",oPC);
|
||
|
iPCLevelMod = GetCampaignInt("Endless Nights IV","PCLevelMod",oPC);
|
||
|
iEvilPowers = GetCampaignInt("Endless Nights IV","EvilPath",oPC);
|
||
|
iEvilLevel = GetCampaignInt("Endless Nights IV","EvilLevel",oPC);
|
||
|
iEvilQuest = GetCampaignInt("Endless Nights IV","EvilQuest",oPC);
|
||
|
|
||
|
iSpecialPowers= GetCampaignInt("Endless Nights IV","SpecialPowers",oPC);
|
||
|
iSuperPowers= GetCampaignInt("Endless Nights IV","SuperPowers",oPC);
|
||
|
iSpirit= GetCampaignInt("Endless Nights IV","Spirit",oPC);
|
||
|
iLucky= GetCampaignInt("Endless Nights IV","Lucky",oPC);
|
||
|
iCharming= GetCampaignInt("Endless Nights IV","Charming",oPC);
|
||
|
iWeaponBonus= GetCampaignInt("Endless Nights IV","WeaponBonus",oPC);
|
||
|
iAdjust= GetCampaignInt("Endless Nights IV","Adjust",oPC);
|
||
|
iEnemy= GetCampaignInt("Endless Nights IV","Enemy",oPC);
|
||
|
iCursed= GetCampaignInt("Endless Nights IV","Cursed",oPC);
|
||
|
iPCEnterLevel = GetCampaignInt("Endless Nights IV","PCEnterLevel",oPC);
|
||
|
|
||
|
iGuild= GetCampaignInt("Endless Nights IV","PCGuild",oPC);
|
||
|
iGuildQuests = GetCampaignInt("Endless Nights IV","GuildQuests",oPC);
|
||
|
|
||
|
//Reset overall quest to the last major portion started
|
||
|
if (iOverallQuest <101)
|
||
|
iOverallQuest = 0;
|
||
|
else if (iOverallQuest <111)
|
||
|
iOverallQuest = 101;
|
||
|
else if (iOverallQuest <121)
|
||
|
iOverallQuest = 111;
|
||
|
else if (iOverallQuest <999)
|
||
|
iOverallQuest = 121;
|
||
|
|
||
|
SQLocalsUUID_SetInt(oPC,"OverallQuest",iOverallQuest);
|
||
|
SQLocalsUUID_SetInt(oPC,"PCHardcore",iHardcore);
|
||
|
SQLocalsUUID_SetInt(oPC,"PCHardCorePNP",iHardcorePnP);
|
||
|
SQLocalsUUID_SetInt(oPC,"PCHardCoreSpecial",iHardcoreSpecial);
|
||
|
SQLocalsUUID_SetInt(oPC,"QuestPoints",iQuestPoints);
|
||
|
SQLocalsUUID_SetInt(oPC,"PCDeaths",iDeaths);
|
||
|
SQLocalsUUID_SetInt(oPC,"ModRank",iModRank);
|
||
|
SQLocalsUUID_SetInt(oPC,"Monstrous",iMonstrous);
|
||
|
SQLocalsUUID_SetInt(oPC,"PCXPBonus",iPCXPBonus);
|
||
|
SQLocalsUUID_SetInt(oPC,"PCLevelMod",iPCLevelMod);
|
||
|
|
||
|
SQLocalsUUID_SetInt(oPC,"SpecialPowers",iSpecialPowers);
|
||
|
SQLocalsUUID_SetInt(oPC,"SuperPowers",iSuperPowers);
|
||
|
|
||
|
SQLocalsUUID_SetInt(oPC,"Spirit",iSpirit);
|
||
|
SQLocalsUUID_SetInt(oPC,"Lucky",iLucky);
|
||
|
SQLocalsUUID_SetInt(oPC,"Charming",iCharming);
|
||
|
SQLocalsUUID_SetInt(oPC,"WeaponBonus",iWeaponBonus);
|
||
|
SQLocalsUUID_SetInt(oPC,"Adjust",iAdjust);
|
||
|
SQLocalsUUID_SetInt(oPC,"Enemy",iEnemy);
|
||
|
SQLocalsUUID_SetInt(oPC,"Cursed",iCursed);
|
||
|
SQLocalsUUID_SetInt(oPC,"EvilQuest",iEvilQuest);
|
||
|
SQLocalsUUID_SetInt(oPC,"EvilPath",iEvilPowers );
|
||
|
SQLocalsUUID_SetInt(oPC,"EvilLevel",iEvilLevel);
|
||
|
|
||
|
SQLocalsUUID_SetInt(oPC,"PCGuild",iGuild);
|
||
|
SQLocalsUUID_SetInt(oPC,"GuildQuests",iGuildQuests);
|
||
|
|
||
|
if (iPCEnterLevel == 0)
|
||
|
iPCEnterLevel = 1;
|
||
|
SQLocalsUUID_SetInt(oPC,"PCEnterLevel",iPCEnterLevel);
|
||
|
|
||
|
SQLocalsUUID_SetString(oPC,"QPWeaponTag",GetCampaignString("Endless Nights IV","QPWeaponTag",oPC));
|
||
|
SQLocalsUUID_SetString(oPC,"QPTag",GetCampaignString("Endless Nights IV","QPTag",oPC));
|
||
|
SQLocalsUUID_SetString(oPC,"QPRingTag",GetCampaignString("Endless Nights IV","QPRingTag",oPC));
|
||
|
|
||
|
if (iSpecialPowers > 0)
|
||
|
CreateSpecialPowers(oPC);
|
||
|
if (SQLocalsUUID_GetInt(oPC,"EvilPath") > 0)
|
||
|
CreateEvilPowers(oPC);
|
||
|
|
||
|
if (iSpirit > 0)
|
||
|
SQLocals_SetString(GetModule(),"FriendlySpirit",GetName(oPC));
|
||
|
|
||
|
if (iMonstrous == 1 || iEvilPowers > 0)
|
||
|
{
|
||
|
object oGood;
|
||
|
oGood = GetObjectByTag("en3_good");
|
||
|
AdjustReputation(oPC,oGood,-100);
|
||
|
object oDefender;
|
||
|
oDefender = GetObjectByTag("en4_cityguard0_1");
|
||
|
AdjustReputation(oPC,oDefender,-100);
|
||
|
object oEvil;
|
||
|
oEvil = GetObjectByTag("en4_evil");
|
||
|
AdjustReputation(oPC,oEvil,50);
|
||
|
|
||
|
SetLocalString(oPC,"Respawn","EN4_MERespawn");
|
||
|
|
||
|
if (GetGoodEvilValue(oPC) > 60 && iMonstrous == 1)
|
||
|
{
|
||
|
SQLocalsUUID_SetInt(oPC,"Monstrous",2);
|
||
|
} else {
|
||
|
SQLocalsUUID_SetInt(oPC,"Monstrous",1);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
DelayCommand(0.1,SendMessageToPC(oPC,"Character imported with " + IntToString(iQuestPoints) + " quest points and " + IntToString(iDeaths) + " deaths."));
|
||
|
if (SQLocalsUUID_GetInt(oPC,"ModRank") == 1)
|
||
|
DelayCommand(0.2,SendMessageToPC(oPC,"Character is eligible for Campaign Ranking."));
|
||
|
else
|
||
|
DelayCommand(0.2,SendMessageToPC(oPC,"Character is ineligible for Campaign Ranking."));
|
||
|
} else {
|
||
|
SQLocalsUUID_SetInt(oPC,"ModRank",0);
|
||
|
if (iXPCheck == 0)
|
||
|
DelayCommand(0.2,SendMessageToPC(oPC,"Character is ineligible for Campaign Ranking."));
|
||
|
else
|
||
|
DelayCommand(0.2,SendMessageToPC(oPC,"Invalid Character Import: Character is ineligible for Campaign Ranking."));
|
||
|
}
|
||
|
|
||
|
object oItem = GetItemInSlot(INVENTORY_SLOT_RIGHTHAND,oPC);
|
||
|
if (!GetIsObjectValid(oItem) && GetLevelByClass(CLASS_TYPE_MONK,oPC) > 0)
|
||
|
oItem = GetItemInSlot(INVENTORY_SLOT_ARMS,oPC);
|
||
|
|
||
|
if (GetIsObjectValid(oItem))
|
||
|
GetSpecialWeaponBonus(oPC,oItem);
|
||
|
|
||
|
oItem = GetItemInSlot(INVENTORY_SLOT_LEFTHAND,oPC);
|
||
|
if (GetIsObjectValid(oItem))
|
||
|
GetSpecialWeaponBonus(oPC,oItem);
|
||
|
|
||
|
}
|