EN4_PRC8/_module/nss/en4_cg_getquest.nss

1096 lines
32 KiB
Plaintext
Raw Permalink Normal View History

#include "rd_questinc"
#include "rd_advzones"
void GetSewerKey(object oPC);
void GuildQuestType1(object oPC);
void GuildQuestType2(object oPC);
void GuildQuestType3(object oPC);
void GuildQuestType4(object oPC);
void GuildQuestType5(object oPC);
void GuildQuestType6(object oPC);
void GuildQuestType7(object oPC);
void GuildQuestType8(object oPC);
void GuildQuestType9(object oPC);
void GuildQuestType10(object oPC);
void GuildQuestType11(object oPC);
void GuildQuestType12(object oPC);
void GuildQuestType13(object oPC);
void GuildQuestType14(object oPC);
void GuildQuestType15(object oPC);
void GuildQuestType16(object oPC);
string GetCGCamp(int iLevel,int iType=0);
void main()
{
object oPC;
object oBoss;
int iLevel;
int iAdjustedLevel;
int iQuestType;
int iZones;
int iDifficulty;
int iRandom;
int iRandom2;
string sTokenLine;
string sCD;
oPC = GetPCSpeaker();
iLevel = GetHitDice(oPC);
iAdjustedLevel = GetAdjustedLevel(oPC);
SetPartyInt(oPC,"QuestStep",1);
SetPartyString(oPC,"QuestGiver",GetTag(OBJECT_SELF));
SetPartyInt(oPC,"Quest",1);
SetCustomToken(99, "Well, then, you did alright.");
SetCustomToken(111, "");
SetCustomToken(112, "");
SetCustomToken(113, "");
SetToken(oPC,OBJECT_SELF,103,GetName(OBJECT_SELF));
iRandom = Random(130);
//iRandom=119;
if (iRandom < 10)
if (GetLocalInt(GetModule(),"AdventureZone") == 0)
GuildQuestType1(oPC); //AdventureZone - Kill
else
GuildQuestType6(oPC);
else if (iRandom < 15)
if (GetLocalInt(GetModule(),"AdventureZone") == 0)
GuildQuestType2(oPC); //AdventureZone - Retrieve
else
GuildQuestType8(oPC);
else if (iRandom < 20)
GuildQuestType3(oPC); //LandCamp - Kill
else if (iRandom < 25)
GuildQuestType4(oPC); //LandCamp - Kill and Retrieve
else if (iRandom < 30)
GuildQuestType5(oPC); //House - Kill
else if (iRandom < 35)
GuildQuestType6(oPC); //Sewers - Kill
else if (iRandom < 45)
GuildQuestType7(oPC); //Graveyard - Kill
else if (iRandom < 55)
GuildQuestType8(oPC); //Crypt - Kill
else if (iRandom < 60)
if (GetLocalInt(GetModule(),"AdventureZone") == 0)
GuildQuestType9(oPC); //AdventureZone - Dungeon
else
GuildQuestType4(oPC);
else if (iRandom < 70)
GuildQuestType10(oPC); //House - Golems/Demons/Undead
else if (iRandom < 80)
GuildQuestType11(oPC); //Sewers - Golems/Demons/Undead
else if (iRandom < 90)
GuildQuestType12(oPC); //Graveyard - Golems/Demons/Undead
else if (iRandom < 100)
GuildQuestType13(oPC); //Crypt- Undead
else if (iRandom < 110)
GuildQuestType14(oPC); //Graveyard - Necromancers
else if (iRandom < 120)
GuildQuestType15(oPC); //House - Necromancers
else
GuildQuestType16(oPC); //Crypt- Necromancers
}
void GetSewerKey(object oPC)
{
object oPartyMember = GetFirstFactionMember(oPC, TRUE);
while (GetIsObjectValid(oPartyMember) == TRUE)
{
if (!HasItem(oPartyMember,"hts2_key"))
CreateItemOnObject("hts2_key",oPartyMember);
oPartyMember = GetNextFactionMember(oPC, TRUE);
}
}
void GuildQuestType1(object oPC)
{
int iLevel;
int iAdjustedLevel;
int iDifficulty;
int iRandom;
string sCD;
string sTokenLine;
object oBoss;
iLevel = GetHitDice(oPC);
iAdjustedLevel = GetAdjustedLevel(oPC);
SetPartyInt(oPC,"QuestSteps",1);
SetPartyInt(oPC,"QuestAdventureZone",1);
SetPartyString(oPC,"AZRespawn",GetTag(OBJECT_SELF));
oBoss = SetupAdventureZones(iAdjustedLevel);
SetPartyString(oPC,"QuestStep1Mob",GetTag(oBoss));
SetPartyString(oPC,"QuestTargetMob",GetTag(oBoss));
SetPartyInt(oPC,"QuestType",1);
iDifficulty = AZDifficulty();
SetPartyInt(oPC,"QuestDifficulty",iDifficulty);
sCD = GetLocalString(oBoss,"sCD");
sTokenLine = "The city council has asked us to investigate the rising evil surrounding a distant village. We have pinpointed the source of the evil and would like for you to deal with it.";
SetToken(oPC,OBJECT_SELF,111,sTokenLine);
sTokenLine = "We believe that a " + GetName(oBoss) + " is behind the problems.";
SetToken(oPC,OBJECT_SELF,112,sTokenLine);
sTokenLine = "Gather what supplies you need and then talk to me and I send a guide with you to show you the location.";
SetToken(oPC,OBJECT_SELF,113,sTokenLine);
SetToken(oPC,OBJECT_SELF,101,sCD);
SetToken(oPC,OBJECT_SELF,105,GetName(oBoss));
RemoveJournalQuestEntry("jDelivery",oPC);
RemoveJournalQuestEntry("jCamp",oPC);
//AddJournalQuestEntry("jSpecial",1,oPC);
AddJournalQuestEntry("jCamp",1,oPC);
}
void GuildQuestType2(object oPC)
{
int iLevel;
int iAdjustedLevel;
int iDifficulty;
int iRandom;
string sCD;
string sTokenLine;
string sItem;
string sItemTag;
object oBoss;
iLevel = GetHitDice(oPC);
iAdjustedLevel = GetAdjustedLevel(oPC);
SetPartyInt(oPC,"QuestSteps",1);
SetPartyInt(oPC,"QuestAdventureZone",1);
SetPartyString(oPC,"AZRespawn",GetTag(OBJECT_SELF));
//oBoss = SetupAdventureZones(iAdjustedLevel);
iRandom = Random(5)+1;
switch(iRandom)
{
case 1: sItemTag = "mg_item1"; sItem = "an ancient scroll"; break;
case 2: sItemTag = "mg_item2"; sItem = "an old tome"; break;
case 3: sItemTag = "tg_item6"; sItem = "an ancient relic"; break;
case 4: sItemTag = "tg_item4"; sItem = "a special ring"; break;
case 5: sItemTag = "tg_item5"; sItem = "a special necklace"; break;
}
oBoss = SetupAdventureZones(iAdjustedLevel,0,"",sItemTag);
SetPartyString(oPC,"QuestItemTag",sItemTag);
SetPartyInt(oPC,"QuestType",3);
iDifficulty = AZDifficulty();
SetPartyInt(oPC,"QuestDifficulty",iDifficulty);
sCD = GetLocalString(oBoss,"sCD");
object oItem = GetObjectByTag(sItemTag);
if (GetIsObjectValid(oItem))
SetToken(oPC,OBJECT_SELF,104,GetName(oItem));
else
SetToken(oPC,OBJECT_SELF,104,"item you requested");
sTokenLine = "A member of our church lost " + sItem + " while traveling to the city. We have uncovered its general whereabouts and would like you to recover it for us.";
SetToken(oPC,OBJECT_SELF,111,sTokenLine);
sTokenLine = "Remember, you don't have to kill its guardians, but we will not mourn their loss.";
SetToken(oPC,OBJECT_SELF,112,sTokenLine);
sTokenLine = "Gather what supplies you need and then talk to me and I send a guide with you to show you the location.";
SetToken(oPC,OBJECT_SELF,113,sTokenLine);
SetToken(oPC,OBJECT_SELF,101,sCD);
SetToken(oPC,OBJECT_SELF,105,GetName(oBoss));
RemoveJournalQuestEntry("jDelivery",oPC);
RemoveJournalQuestEntry("jCamp",oPC);
AddJournalQuestEntry("jSpecial",1,oPC);
//AddJournalQuestEntry("jCamp",1,oPC);
}
void GuildQuestType3(object oPC)
{
object oBoss;
int iVariance;
int iLevel;
int iAdjustedLevel;
string sTokenLine;
string sTag;
SetPartyInt(oPC,"QuestSteps",1);
SetPartyInt(oPC,"QuestStep",1);
SetLocalString(oPC,"QuestGiver",GetTag(OBJECT_SELF));
SetLocalInt(oPC,"Quest",1);
SetCustomToken(111, "");
SetCustomToken(112, "");
SetCustomToken(113, "");
SetToken(oPC,OBJECT_SELF,103,GetName(OBJECT_SELF));
iLevel = GetHitDice(oPC);
iAdjustedLevel = GetAdjustedLevel(oPC);
if (Random(5) == 0)
oBoss = GetDungeonCamp(oPC,OBJECT_SELF);
else
oBoss = GetQuestCamp(oPC,OBJECT_SELF);
sTokenLine = "We have word that some " + GetToken(101) + " are causing trouble in the lands surrounding the city. We must guard our lands in this time of need.";
sTokenLine = FixTokenLine(sTokenLine,"REPEAT");
SetToken(oPC,OBJECT_SELF,111,sTokenLine);
sTokenLine = "The " + GetToken(101) + " are located " + GetToken(102) + ".";
sTokenLine = FixTokenLine(sTokenLine,"REPEAT");
SetToken(oPC,OBJECT_SELF,112,sTokenLine);
RemoveJournalQuestEntry("jDelivery",oPC);
RemoveJournalQuestEntry("jCamp",oPC);
AddJournalQuestEntry("jCamp",1,oPC);
}
void GuildQuestType4(object oPC)
{
object oBoss;
int iVariance;
int iLevel;
int iAdjustedLevel;
int iRandom;
string sItemTag;
string sItem;
string sTokenLine;
string sTag;
SetPartyInt(oPC,"QuestSteps",1);
SetPartyInt(oPC,"QuestStep",1);
SetLocalString(oPC,"QuestGiver",GetTag(OBJECT_SELF));
SetLocalInt(oPC,"Quest",1);
SetCustomToken(111, "");
SetCustomToken(112, "");
SetCustomToken(113, "");
SetToken(oPC,OBJECT_SELF,103,GetName(OBJECT_SELF));
iLevel = GetHitDice(oPC);
iAdjustedLevel = GetAdjustedLevel(oPC);
if (Random(5) == 0)
oBoss = GetDungeonCamp(oPC,OBJECT_SELF);
else
oBoss = GetQuestCamp(oPC,OBJECT_SELF);
iRandom = Random(5)+1;
switch(iRandom)
{
case 1: sItemTag = "mg_item1"; sItem = "an ancient scroll"; break;
case 2: sItemTag = "mg_item2"; sItem = "an old tome"; break;
case 3: sItemTag = "tg_item6"; sItem = "an ancient relic"; break;
case 4: sItemTag = "tg_item4"; sItem = "a special ring"; break;
case 5: sItemTag = "tg_item5"; sItem = "a special necklace"; break;
}
SetPartyString(oPC,"QuestItemTag",sItemTag);
object oItem = CreateItemOnObject(sItemTag,oBoss);
SetToken(oPC,OBJECT_SELF,104,GetName(oItem));
sTokenLine = "We have word that some " + GetToken(101) + " have gotten their hands on " + sItem + ". It must not be left in the hands of evil, and we would like you to be our champion in this cause.";
sTokenLine = FixTokenLine(sTokenLine,"REPEAT");
SetToken(oPC,OBJECT_SELF,111,sTokenLine);
sTokenLine = "The " + GetToken(101) + " are located " + GetToken(102) + ".";
sTokenLine = FixTokenLine(sTokenLine,"REPEAT");
SetToken(oPC,OBJECT_SELF,112,sTokenLine);
RemoveJournalQuestEntry("jDelivery",oPC);
RemoveJournalQuestEntry("jCamp",oPC);
AddJournalQuestEntry("jCamp",1,oPC);
}
void GuildQuestType5(object oPC)
{
object oBoss;
object oHouse;
int iVariance;
int iLevel;
int iAdjustedLevel;
int iCamp;
int iHCAdjust;
int iHouse;
string sTokenLine;
string sTag;
string sZone;
string sQuestCampType;
string sCampDescription;
string sLocation;
SetPartyInt(oPC,"QuestSteps",1);
SetPartyInt(oPC,"QuestStep",1);
SetLocalString(oPC,"QuestGiver",GetTag(OBJECT_SELF));
SetLocalInt(oPC,"Quest",1);
SetCustomToken(111, "");
SetCustomToken(112, "");
SetCustomToken(113, "");
SetToken(oPC,OBJECT_SELF,103,GetName(OBJECT_SELF));
iLevel = GetHitDice(oPC);
iAdjustedLevel = GetAdjustedLevel(oPC);
iHCAdjust = 0;
if (CheckHardcore())
iHCAdjust = 5;
if (iLevel - iHCAdjust < 5)
iCamp = 1;
else if (iLevel - iHCAdjust < 10)
iCamp = Random(2)+1;
else if (iLevel - iHCAdjust < 15)
iCamp = Random(3)+1;
else
iCamp = Random(2)+2;
iHouse = Random(2)+1;
if (iHouse == 1 && GetLocalInt(GetModule(),"HTCAbandonedHouse1") == 1)
iHouse = 2;
if (iHouse == 2 && GetLocalInt(GetModule(),"HTCAbandonedHouse2") == 1)
iHouse = 1;
if (iHouse==1)
{
sZone = "H1";
sLocation = "in an abandoned building across from the arena in Hightop City";
SetLocalInt(GetModule(),"HTCAbandonedHouse1",1);
SetPartyInt(oPC,"HTCAbandonedHouse1",1);
} else {
sZone = "H2";
sLocation = "in an abandoned building in Upper Hightop City";
SetLocalInt(GetModule(),"HTCAbandonedHouse2",1);
SetPartyInt(oPC,"HTCAbandonedHouse2",1);
}
sQuestCampType="";
oHouse = GetObjectByTag(sZone + "_Q1_Boss");
if (GetIsObjectValid(oHouse))
{
ClearZoneMobs(GetArea(oHouse));
//SendMessageToPC(GetFirstPC(),GetTag(GetArea(oHouse)));
}
oBoss = SpawnQuestCamp(sZone,iCamp,iAdjustedLevel,1,sQuestCampType);
sQuestCampType = GetLocalString(oBoss,"CampType");
sCampDescription = GetLocalString(oBoss,"Description");
SetToken(oPC,OBJECT_SELF,101,sCampDescription);
SetToken(oPC,OBJECT_SELF,102,sLocation);
SetToken(oPC,OBJECT_SELF,105,GetName(oBoss));
SetPartyInt(oPC,"QuestType",1);
SetPartyInt(oPC,"QuestCamp",iCamp);
SetPartyString(oPC,"QuestCampzone",sZone);
SetPartyString(oPC,"QuestTargetNPC",GetTag(OBJECT_SELF));
SetPartyString(oPC,"QuestTargetMob",GetTag(oBoss));
SetPartyInt(oPC,"QuestTargetMobDead",0);
SetPartyString(oPC,"QuestCampType",sQuestCampType);
if (iCamp == 1)
SetPartyInt(oPC,"QuestDifficulty",1);
else
SetPartyInt(oPC,"QuestDifficulty",2);
if (Random(2) == 0)
{
sTokenLine = "I have detected evil within our city. Some " + GetToken(101) + " are within the city and must be eliminated before any citizens come to harm.";
sTokenLine = FixTokenLine(sTokenLine,"REPEAT");
} else {
sTokenLine = "The city guard spotted some " + GetToken(101) + " in the city and traced them to their base of operations. They have asked for our aid in the task of cleansing the city of this evil.";
sTokenLine = FixTokenLine(sTokenLine,"REPEAT");
}
SetToken(oPC,OBJECT_SELF,111,sTokenLine);
sTokenLine = "The " + GetToken(101) + " are located " + GetToken(102) + ".";
sTokenLine = FixTokenLine(sTokenLine,"REPEAT");
SetToken(oPC,OBJECT_SELF,112,sTokenLine);
RemoveJournalQuestEntry("jDelivery",oPC);
RemoveJournalQuestEntry("jCamp",oPC);
AddJournalQuestEntry("jCamp",1,oPC);
}
void GuildQuestType6(object oPC)
{
object oBoss;
int iVariance;
int iLevel;
int iAdjustedLevel;
string sTokenLine;
string sTag;
SetPartyInt(oPC,"QuestSteps",1);
SetPartyInt(oPC,"QuestStep",1);
SetLocalString(oPC,"QuestGiver",GetTag(OBJECT_SELF));
SetLocalInt(oPC,"Quest",1);
SetCustomToken(111, "");
SetCustomToken(112, "");
SetCustomToken(113, "");
SetToken(oPC,OBJECT_SELF,103,GetName(OBJECT_SELF));
iLevel = GetHitDice(oPC);
iAdjustedLevel = GetAdjustedLevel(oPC);
oBoss = GetDungeonCamp(oPC,OBJECT_SELF,"",1);
GetSewerKey(oPC);
sTokenLine = "I have sensed a great evil growing in the sewers and through my divinations have some " + GetToken(101) + " roaming there. They must be dealt with before they break free of the sewers and present a danger to the city.";
sTokenLine = FixTokenLine(sTokenLine,"REPEAT");
SetToken(oPC,OBJECT_SELF,111,sTokenLine);
sTokenLine = "I need you to go into the abandoned sewers and destroy these " + GetToken(101) + ".";
sTokenLine = FixTokenLine(sTokenLine,"REPEAT");
SetToken(oPC,OBJECT_SELF,112,sTokenLine);
RemoveJournalQuestEntry("jDelivery",oPC);
RemoveJournalQuestEntry("jCamp",oPC);
AddJournalQuestEntry("jCamp",1,oPC);
}
void GuildQuestType7(object oPC)
{
object oBoss;
int iVariance;
int iLevel;
int iAdjustedLevel;
string sTokenLine;
string sTag;
SetPartyInt(oPC,"QuestSteps",1);
SetPartyInt(oPC,"QuestStep",1);
SetLocalString(oPC,"QuestGiver",GetTag(OBJECT_SELF));
SetLocalInt(oPC,"Quest",1);
SetCustomToken(111, "");
SetCustomToken(112, "");
SetCustomToken(113, "");
SetToken(oPC,OBJECT_SELF,103,GetName(OBJECT_SELF));
iLevel = GetHitDice(oPC);
iAdjustedLevel = GetAdjustedLevel(oPC);
oBoss = GetQuestCamp(oPC,OBJECT_SELF,"",2);
sTokenLine = "There are disturbances in the graveyard. I have divined that some " + GetToken(101) + " are behind the problems.";
sTokenLine = FixTokenLine(sTokenLine,"REPEAT");
SetToken(oPC,OBJECT_SELF,111,sTokenLine);
sTokenLine = "We need you to go up to Upper Hightop City, enter the graveyard, and put to rest these " + GetToken(101) + ".";
sTokenLine = FixTokenLine(sTokenLine,"REPEAT");
SetToken(oPC,OBJECT_SELF,112,sTokenLine);
RemoveJournalQuestEntry("jDelivery",oPC);
RemoveJournalQuestEntry("jCamp",oPC);
AddJournalQuestEntry("jCamp",1,oPC);
}
void GuildQuestType8(object oPC)
{
object oBoss;
int iVariance;
int iLevel;
int iAdjustedLevel;
string sTokenLine;
string sTag;
SetPartyInt(oPC,"QuestSteps",1);
SetPartyInt(oPC,"QuestStep",1);
SetLocalString(oPC,"QuestGiver",GetTag(OBJECT_SELF));
SetLocalInt(oPC,"Quest",1);
SetCustomToken(111, "");
SetCustomToken(112, "");
SetCustomToken(113, "");
SetToken(oPC,OBJECT_SELF,103,GetName(OBJECT_SELF));
iLevel = GetHitDice(oPC);
iAdjustedLevel = GetAdjustedLevel(oPC);
oBoss = GetDungeonCamp(oPC,OBJECT_SELF,"",3);
sTokenLine = "An evil grows inside of the graveyard's crypt. I have divined the evil to be some " + GetToken(101) + ".";
sTokenLine = FixTokenLine(sTokenLine,"REPEAT");
SetToken(oPC,OBJECT_SELF,111,sTokenLine);
sTokenLine = "I need you to cleanse this evil from the crypt. Go to Upper Hightop City, into the graveyard, enter the crypt, and get rid of these " + GetToken(101) + ".";
sTokenLine = FixTokenLine(sTokenLine,"REPEAT");
SetToken(oPC,OBJECT_SELF,112,sTokenLine);
RemoveJournalQuestEntry("jDelivery",oPC);
RemoveJournalQuestEntry("jCamp",oPC);
AddJournalQuestEntry("jCamp",1,oPC);
}
void GuildQuestType9(object oPC)
{
int iLevel;
int iAdjustedLevel;
int iDifficulty;
int iRandom;
string sCD;
string sTokenLine;
string sItem;
string sItemTag;
object oBoss;
iLevel = GetHitDice(oPC);
iAdjustedLevel = GetAdjustedLevel(oPC);
SetPartyInt(oPC,"QuestSteps",1);
SetPartyInt(oPC,"QuestAdventureZone",1);
SetPartyString(oPC,"AZRespawn",GetTag(OBJECT_SELF));
//oBoss = SetupAdventureZones(iAdjustedLevel);
oBoss = SetupAdventureZones(iAdjustedLevel,1);
SetPartyString(oPC,"QuestStep1Mob",GetTag(oBoss));
SetPartyString(oPC,"QuestTargetMob",GetTag(oBoss));
SetPartyInt(oPC,"QuestType",1);
iDifficulty = AZDifficulty();
SetPartyInt(oPC,"QuestDifficulty",iDifficulty);
sCD = GetLocalString(oBoss,"sCD");
sTokenLine = "We have uncovered a dungeon not too far from the city. This is clearly a base of operations for whatever is causing the bubbling chaos within the lands.";
SetToken(oPC,OBJECT_SELF,111,sTokenLine);
sTokenLine = "We need you to go explore this dungeon and put an end to the evil within.";
SetToken(oPC,OBJECT_SELF,112,sTokenLine);
sTokenLine = "Gather what supplies you need and then talk to me and I send a guide with you to show you the location.";
SetToken(oPC,OBJECT_SELF,113,sTokenLine);
SetToken(oPC,OBJECT_SELF,101,sCD);
SetToken(oPC,OBJECT_SELF,105,GetName(oBoss));
RemoveJournalQuestEntry("jDelivery",oPC);
RemoveJournalQuestEntry("jCamp",oPC);
//AddJournalQuestEntry("jSpecial",1,oPC);
AddJournalQuestEntry("jCamp",1,oPC);
}
void GuildQuestType10(object oPC)
{
object oBoss;
object oHouse;
int iVariance;
int iLevel;
int iAdjustedLevel;
int iCamp;
int iHCAdjust;
int iHouse;
int iRandom;
string sTokenLine;
string sTag;
string sZone;
string sQuestCampType;
string sCampDescription;
string sLocation;
SetPartyInt(oPC,"QuestSteps",1);
SetPartyInt(oPC,"QuestStep",1);
SetLocalString(oPC,"QuestGiver",GetTag(OBJECT_SELF));
SetLocalInt(oPC,"Quest",1);
SetCustomToken(111, "");
SetCustomToken(112, "");
SetCustomToken(113, "");
SetToken(oPC,OBJECT_SELF,103,GetName(OBJECT_SELF));
iLevel = GetHitDice(oPC);
iAdjustedLevel = GetAdjustedLevel(oPC);
iHCAdjust = 0;
if (CheckHardcore())
iHCAdjust = 5;
if (iLevel - iHCAdjust < 5)
iCamp = 1;
else if (iLevel - iHCAdjust < 10)
iCamp = Random(2)+1;
else if (iLevel - iHCAdjust < 15)
iCamp = Random(3)+1;
else
iCamp = Random(2)+2;
iHouse = Random(2)+1;
if (iHouse == 1 && GetLocalInt(GetModule(),"HTCAbandonedHouse1") == 1)
iHouse = 2;
if (iHouse == 2 && GetLocalInt(GetModule(),"HTCAbandonedHouse2") == 1)
iHouse = 1;
if (iHouse==1)
{
sZone = "H1";
sLocation = "in an abandoned building across from the arena in Hightop City";
SetLocalInt(GetModule(),"HTCAbandonedHouse1",1);
SetPartyInt(oPC,"HTCAbandonedHouse1",1);
} else {
sZone = "H2";
sLocation = "in an abandoned building in Upper Hightop City";
SetLocalInt(GetModule(),"HTCAbandonedHouse2",1);
SetPartyInt(oPC,"HTCAbandonedHouse2",1);
}
sQuestCampType = GetCGCamp(iLevel);
iRandom = GetLocalInt(GetModule(),"iRandom");
oHouse = GetObjectByTag(sZone + "_Q1_Boss");
if (GetIsObjectValid(oHouse))
{
ClearZoneMobs(GetArea(oHouse));
//SendMessageToPC(GetFirstPC(),GetTag(GetArea(oHouse)));
}
oBoss = SpawnQuestCamp(sZone,iCamp,iAdjustedLevel,1,sQuestCampType);
//sQuestCampType = GetLocalString(oBoss,"CampType");
sCampDescription = GetLocalString(oBoss,"Description");
SetToken(oPC,OBJECT_SELF,101,sCampDescription);
SetToken(oPC,OBJECT_SELF,102,sLocation);
SetToken(oPC,OBJECT_SELF,105,GetName(oBoss));
SetPartyInt(oPC,"QuestType",1);
SetPartyInt(oPC,"QuestCamp",iCamp);
SetPartyString(oPC,"QuestCampzone",sZone);
SetPartyString(oPC,"QuestTargetNPC",GetTag(OBJECT_SELF));
SetPartyString(oPC,"QuestTargetMob",GetTag(oBoss));
SetPartyInt(oPC,"QuestTargetMobDead",0);
SetPartyString(oPC,"QuestCampType",sQuestCampType);
if (iCamp == 1)
SetPartyInt(oPC,"QuestDifficulty",1);
else
SetPartyInt(oPC,"QuestDifficulty",2);
if (iRandom==1)
if (Random(3)==0)
sTokenLine = "Last night I dreamed of abominations of chaos being constructed right here in our city. This message of the gods is not to be ignored and I need you to root out this evil for us.";
else
sTokenLine = "I have detected a strange and powerful magic at work within the city. Through prayer I have learned of a foul priest of darkness constructing an army of golems to do his bidding. He must be stopped before harm comes to the city.";
else if (iRandom==2)
sTokenLine = "The gates of the abyss have been opened and foul demons have been brought forth into this world. We cannot allow their evil to persist in our city.";
else
sTokenLine = "My morning prayers were interupted by the chill of necromancy at work within the city. I have divined the location of the undead and need you to cleanse our city of their evil.";
sTokenLine = FixTokenLine(sTokenLine,"REPEAT");
SetToken(oPC,OBJECT_SELF,111,sTokenLine);
sTokenLine = "The " + GetToken(101) + " are located " + GetToken(102) + ".";
sTokenLine = FixTokenLine(sTokenLine,"REPEAT");
SetToken(oPC,OBJECT_SELF,112,sTokenLine);
RemoveJournalQuestEntry("jDelivery",oPC);
RemoveJournalQuestEntry("jCamp",oPC);
AddJournalQuestEntry("jCamp",1,oPC);
}
void GuildQuestType11(object oPC)
{
object oBoss;
int iVariance;
int iLevel;
int iAdjustedLevel;
int iRandom;
string sTokenLine;
string sTag;
string sQuestCampType;
SetPartyInt(oPC,"QuestSteps",1);
SetPartyInt(oPC,"QuestStep",1);
SetLocalString(oPC,"QuestGiver",GetTag(OBJECT_SELF));
SetLocalInt(oPC,"Quest",1);
SetCustomToken(111, "");
SetCustomToken(112, "");
SetCustomToken(113, "");
SetToken(oPC,OBJECT_SELF,103,GetName(OBJECT_SELF));
iLevel = GetHitDice(oPC);
iAdjustedLevel = GetAdjustedLevel(oPC);
sQuestCampType = GetCGCamp(iLevel);
iRandom = GetLocalInt(GetModule(),"iRandom");
oBoss = GetDungeonCamp(oPC,OBJECT_SELF,sQuestCampType,1);
GetSewerKey(oPC);
if (iRandom==1)
sTokenLine = "The city council reports that a unnatural beings have been spotted in the abandoned sewers. These golems can only be the work of a priest who has turned to darkness and wishes to create an army for some dreadful purpose. You must put an end to his evil designs.";
else if (iRandom==2)
sTokenLine = "I dreamed last night of fire and darkness come alive just below the city. The evil exists in the abandoned sewers and I must ask that you cleanse them from our city.";
else
sTokenLine = "In the last few days I have sensed a growing evil emanating from beneath the city. I have prayed for guidance, and my prayers were answered. The dead have returned to life and roam the abandoned sewers. We must return them to their restful sleep.";
sTokenLine = FixTokenLine(sTokenLine,"REPEAT");
SetToken(oPC,OBJECT_SELF,111,sTokenLine);
sTokenLine = "I need you to go into the abandoned sewers and destroy these " + GetToken(101) + ".";
sTokenLine = FixTokenLine(sTokenLine,"REPEAT");
SetToken(oPC,OBJECT_SELF,112,sTokenLine);
RemoveJournalQuestEntry("jDelivery",oPC);
RemoveJournalQuestEntry("jCamp",oPC);
AddJournalQuestEntry("jCamp",1,oPC);
}
void GuildQuestType12(object oPC)
{
object oBoss;
int iVariance;
int iLevel;
int iAdjustedLevel;
int iRandom;
string sTokenLine;
string sTag;
string sQuestCampType;
SetPartyInt(oPC,"QuestSteps",1);
SetPartyInt(oPC,"QuestStep",1);
SetLocalString(oPC,"QuestGiver",GetTag(OBJECT_SELF));
SetLocalInt(oPC,"Quest",1);
SetCustomToken(111, "");
SetCustomToken(112, "");
SetCustomToken(113, "");
SetToken(oPC,OBJECT_SELF,103,GetName(OBJECT_SELF));
iLevel = GetHitDice(oPC);
iAdjustedLevel = GetAdjustedLevel(oPC);
sQuestCampType = GetCGCamp(iLevel);
iRandom = GetLocalInt(GetModule(),"iRandom");
oBoss = GetQuestCamp(oPC,OBJECT_SELF,sQuestCampType,2);
if (iRandom==1)
sTokenLine = "The creation of golems is an affront to the gods for it steps upon their act of creation. Yet, this very thing has happened within our city, and what is more the dark priest behind the abominations have flaunted the gods even more by setting them loose in our graveyard.";
else if (iRandom==2)
sTokenLine = "The abyss has opened up and spit forth its foul spawn into our very graveyard. The dead will not rest easily until this evil is cleansed from their final resting place.";
else
sTokenLine = "The evil and chaos bubbling forth in the lands have taken hold of our graveyard. The dead rise from their graves and must be put back to their eternal rest.";
sTokenLine = FixTokenLine(sTokenLine,"REPEAT");
SetToken(oPC,OBJECT_SELF,111,sTokenLine);
sTokenLine = "We need you to go up to Upper Hightop City, enter the graveyard, and destroy these " + GetToken(101) + ".";
sTokenLine = FixTokenLine(sTokenLine,"REPEAT");
SetToken(oPC,OBJECT_SELF,112,sTokenLine);
RemoveJournalQuestEntry("jDelivery",oPC);
RemoveJournalQuestEntry("jCamp",oPC);
AddJournalQuestEntry("jCamp",1,oPC);
}
void GuildQuestType13(object oPC)
{
object oBoss;
object oItem;
int iVariance;
int iLevel;
int iAdjustedLevel;
int iRandom;
string sTokenLine;
string sTag;
string sQuestCampType;
string sItemTag;
string sItem;
SetPartyInt(oPC,"QuestSteps",1);
SetPartyInt(oPC,"QuestStep",1);
SetLocalString(oPC,"QuestGiver",GetTag(OBJECT_SELF));
SetLocalInt(oPC,"Quest",1);
SetCustomToken(111, "");
SetCustomToken(112, "");
SetCustomToken(113, "");
SetToken(oPC,OBJECT_SELF,103,GetName(OBJECT_SELF));
iLevel = GetHitDice(oPC);
iAdjustedLevel = GetAdjustedLevel(oPC);
sQuestCampType = GetCGCamp(iLevel,2);
iRandom = GetLocalInt(GetModule(),"iRandom");
SetLocalInt(GetModule(),"iRandom",0);
oBoss = GetDungeonCamp(oPC,OBJECT_SELF,sQuestCampType,3);
sTokenLine = "I have detected a great evil growing from within the graveyard. The evil has yet to infect the graves, but the source of the evil is not too far from them.";
sTokenLine = FixTokenLine(sTokenLine,"REPEAT");
SetToken(oPC,OBJECT_SELF,111,sTokenLine);
sTokenLine = "I ask that you go to the crypt within the graveyard and cleanse it of this growing evil.";
sTokenLine = FixTokenLine(sTokenLine,"REPEAT");
SetToken(oPC,OBJECT_SELF,112,sTokenLine);
RemoveJournalQuestEntry("jDelivery",oPC);
RemoveJournalQuestEntry("jCamp",oPC);
AddJournalQuestEntry("jCamp",1,oPC);
}
string GetCGCamp(int iLevel,int iType=0)
{
string sQuestCampType;
int iRandom;
sQuestCampType="";
if (iType = 0)
iRandom = Random(3)+1;
else if (iType = 1)
iRandom = Random(2)+1;
else if (iType = 2)
iRandom = 3;
else
iRandom = Random(2)+1;
if (iLevel < 4)
iRandom = 3;
if (iLevel>23 && iRandom==1)
iRandom = Random(2)+2;
if (iRandom==1)
{
if (iLevel < 9)
{
sQuestCampType = "summon2";
iRandom = 2;
}
else if (iLevel < 15)
sQuestCampType = "golem1";
else if (iLevel < 20)
sQuestCampType = "golem2";
else if (iLevel < 27)
{
sQuestCampType = "undead6";
iRandom = 3;
}
else
sQuestCampType = "golem3";
}
else if (iRandom==2)
{
if (iLevel < 8)
sQuestCampType = "summon2";
else if (iLevel < 11)
{
sQuestCampType = "slaad1";
iRandom = 3;
}
else if (iLevel < 16)
{
if (Random(3)>0)
sQuestCampType = "summon5";
else
sQuestCampType = "slaad2";
}
else if (iLevel < 23)
sQuestCampType = "summon6";
else if (iLevel < 33)
sQuestCampType = "fiend";
else
sQuestCampType = "demon";
}
else
{
if (iLevel < 4)
sQuestCampType = "undead2";
else if (iLevel < 6)
sQuestCampType = "undead1";
else if (iLevel < 10)
sQuestCampType = "undead3";
else if (iLevel < 15)
sQuestCampType = "undead4";
else if (iLevel < 21)
sQuestCampType = "undead5";
else if (iLevel < 31)
sQuestCampType = "undead6";
else
sQuestCampType = "vampire";
}
SetLocalInt(GetModule(),"iRandom",iRandom);
return sQuestCampType;
}
void GuildQuestType14(object oPC)
{
object oBoss;
int iVariance;
int iLevel;
int iAdjustedLevel;
int iRandom;
string sTokenLine;
string sTag;
string sQuestCampType;
SetPartyInt(oPC,"QuestSteps",1);
SetPartyInt(oPC,"QuestStep",1);
SetLocalString(oPC,"QuestGiver",GetTag(OBJECT_SELF));
SetLocalInt(oPC,"Quest",1);
SetCustomToken(111, "");
SetCustomToken(112, "");
SetCustomToken(113, "");
SetToken(oPC,OBJECT_SELF,103,GetName(OBJECT_SELF));
iLevel = GetHitDice(oPC);
iAdjustedLevel = GetAdjustedLevel(oPC);
sQuestCampType = "nec";
oBoss = GetQuestCamp(oPC,OBJECT_SELF,sQuestCampType,2);
sTokenLine = "The foul stench of necromancy is in the air. You must ward our graveyard, for if there are necromancers in the city they are headed there.";
sTokenLine = FixTokenLine(sTokenLine,"REPEAT");
SetToken(oPC,OBJECT_SELF,111,sTokenLine);
sTokenLine = "We need you to go up to Upper Hightop City, enter the graveyard, and destroy these " + GetToken(101) + ".";
sTokenLine = FixTokenLine(sTokenLine,"REPEAT");
SetToken(oPC,OBJECT_SELF,112,sTokenLine);
RemoveJournalQuestEntry("jDelivery",oPC);
RemoveJournalQuestEntry("jCamp",oPC);
AddJournalQuestEntry("jCamp",1,oPC);
}
void GuildQuestType15(object oPC)
{
object oBoss;
object oHouse;
int iVariance;
int iLevel;
int iAdjustedLevel;
int iCamp;
int iHCAdjust;
int iHouse;
int iRandom;
string sTokenLine;
string sTag;
string sZone;
string sQuestCampType;
string sCampDescription;
string sLocation;
SetPartyInt(oPC,"QuestSteps",1);
SetPartyInt(oPC,"QuestStep",1);
SetLocalString(oPC,"QuestGiver",GetTag(OBJECT_SELF));
SetLocalInt(oPC,"Quest",1);
SetCustomToken(111, "");
SetCustomToken(112, "");
SetCustomToken(113, "");
SetToken(oPC,OBJECT_SELF,103,GetName(OBJECT_SELF));
iLevel = GetHitDice(oPC);
iAdjustedLevel = GetAdjustedLevel(oPC);
iHCAdjust = 0;
if (CheckHardcore())
iHCAdjust = 5;
if (iLevel - iHCAdjust < 5)
iCamp = 1;
else if (iLevel - iHCAdjust < 10)
iCamp = Random(2)+1;
else if (iLevel - iHCAdjust < 15)
iCamp = Random(3)+1;
else
iCamp = Random(2)+2;
iHouse = Random(2)+1;
if (iHouse == 1 && GetLocalInt(GetModule(),"HTCAbandonedHouse1") == 1)
iHouse = 2;
if (iHouse == 2 && GetLocalInt(GetModule(),"HTCAbandonedHouse2") == 1)
iHouse = 1;
if (iHouse==1)
{
sZone = "H1";
sLocation = "in an abandoned building across from the arena in Hightop City";
SetLocalInt(GetModule(),"HTCAbandonedHouse1",1);
SetPartyInt(oPC,"HTCAbandonedHouse1",1);
} else {
sZone = "H2";
sLocation = "in an abandoned building in Upper Hightop City";
SetLocalInt(GetModule(),"HTCAbandonedHouse2",1);
SetPartyInt(oPC,"HTCAbandonedHouse2",1);
}
sQuestCampType = "nec";
oHouse = GetObjectByTag(sZone + "_Q1_Boss");
if (GetIsObjectValid(oHouse))
{
ClearZoneMobs(GetArea(oHouse));
//SendMessageToPC(GetFirstPC(),GetTag(GetArea(oHouse)));
}
oBoss = SpawnQuestCamp(sZone,iCamp,iAdjustedLevel,1,sQuestCampType);
//sQuestCampType = GetLocalString(oBoss,"CampType");
sCampDescription = GetLocalString(oBoss,"Description");
SetToken(oPC,OBJECT_SELF,101,sCampDescription);
SetToken(oPC,OBJECT_SELF,102,sLocation);
SetToken(oPC,OBJECT_SELF,105,GetName(oBoss));
SetPartyInt(oPC,"QuestType",1);
SetPartyInt(oPC,"QuestCamp",iCamp);
SetPartyString(oPC,"QuestCampzone",sZone);
SetPartyString(oPC,"QuestTargetNPC",GetTag(OBJECT_SELF));
SetPartyString(oPC,"QuestTargetMob",GetTag(oBoss));
SetPartyInt(oPC,"QuestTargetMobDead",0);
SetPartyString(oPC,"QuestCampType",sQuestCampType);
if (iCamp == 1)
SetPartyInt(oPC,"QuestDifficulty",1);
else
SetPartyInt(oPC,"QuestDifficulty",2);
sTokenLine = "Necromancers have been spotted in the city. We have divined their base of operations and must root them out before they are able to bring forth a dark army of the undead.";
sTokenLine = FixTokenLine(sTokenLine,"REPEAT");
SetToken(oPC,OBJECT_SELF,111,sTokenLine);
sTokenLine = "The " + GetToken(101) + " are located " + GetToken(102) + ".";
sTokenLine = FixTokenLine(sTokenLine,"REPEAT");
SetToken(oPC,OBJECT_SELF,112,sTokenLine);
RemoveJournalQuestEntry("jDelivery",oPC);
RemoveJournalQuestEntry("jCamp",oPC);
AddJournalQuestEntry("jCamp",1,oPC);
}
void GuildQuestType16(object oPC)
{
object oBoss;
int iVariance;
int iLevel;
int iAdjustedLevel;
int iRandom;
string sTokenLine;
string sTag;
string sQuestCampType;
SetPartyInt(oPC,"QuestSteps",1);
SetPartyInt(oPC,"QuestStep",1);
SetLocalString(oPC,"QuestGiver",GetTag(OBJECT_SELF));
SetLocalInt(oPC,"Quest",1);
SetCustomToken(111, "");
SetCustomToken(112, "");
SetCustomToken(113, "");
SetToken(oPC,OBJECT_SELF,103,GetName(OBJECT_SELF));
iLevel = GetHitDice(oPC);
iAdjustedLevel = GetAdjustedLevel(oPC);
sQuestCampType = "nec";
oBoss = GetDungeonCamp(oPC,OBJECT_SELF,sQuestCampType,3);
GetSewerKey(oPC);
sTokenLine = "The city guard sends word that the holy sanctity of the crypt has been violated and the dead walk once again. This can only be a work of necromancers.";
sTokenLine = FixTokenLine(sTokenLine,"REPEAT");
SetToken(oPC,OBJECT_SELF,111,sTokenLine);
sTokenLine = "I need you to go to upper Hightop, through the graveyard and into the crypt to destroy these " + GetToken(101) + ".";
sTokenLine = FixTokenLine(sTokenLine,"REPEAT");
SetToken(oPC,OBJECT_SELF,112,sTokenLine);
RemoveJournalQuestEntry("jDelivery",oPC);
RemoveJournalQuestEntry("jCamp",oPC);
AddJournalQuestEntry("jCamp",1,oPC);
}