REO-EE/_module/nss/quest1teleport1.nss
Jaysyn904 f82740bbbd Initial commit
Initial commit
2024-02-22 13:22:03 -05:00

382 lines
6.8 KiB
Plaintext

void main()
{
object oPC = GetPCSpeaker();
object oPCCheck1;
object oOrb;
object oOrb2;
object oNPC = OBJECT_SELF;
object oParty;
object oArea;
object oAreaChoose1;
object oDestination1;
object oCreate1;
int iRoll1;
int iRoll2;
int iAreaZoneType1;
int iAreaTag1;
int iNumber1;
int iGold;
int iQuest1Tag1;
int iTagCollide1;
string sAreaTag1;
string sAreaZone1;
string sLocalAreaString1;
string sWarp = "quest1_spawnpoint1";
string sTemplate1;
string sQuestItemType1;
string sRandomName1;
string sRandomName2;
location lSpawnpoint1;
SetLocalString(oNPC, "RandomArea1", "");
iNumber1 = 0;
oAreaChoose1 = OBJECT_INVALID;
oArea = GetArea(oNPC);
sAreaTag1 = GetTag(oArea);
if (GetGold(oPC) <= 999)
{
return;
}
oCreate1 = CreateItemOnObject("reo_gen_map_1", oPC, 1, "Quest1Map1");
iRoll1 = Random(46) + 1;
switch(iRoll1)
{
case 1:
sQuestItemType1 = "Great axe";
sTemplate1 = "nw_waxgr001";
break;
case 2:
sQuestItemType1 = "Hand axe";
sTemplate1 = "nw_waxhn001";
break;
case 3:
sQuestItemType1 = "Battle axe";
sTemplate1 = "nw_waxbt001";
break;
case 4:
sQuestItemType1 = "Long sword";
sTemplate1 = "nw_wswls001";
break;
case 5:
sQuestItemType1 = "Dagger";
sTemplate1 = "nw_wswdg001";
break;
case 6:
sQuestItemType1 = "Great sword";
sTemplate1 = "nw_wswgs001";
break;
case 7:
sQuestItemType1 = "Bastard sword";
sTemplate1 = "nw_wswbs001";
break;
case 8:
sQuestItemType1 = "Short sword";
sTemplate1 = "nw_wswss001";
break;
case 9:
sQuestItemType1 = "Katana";
sTemplate1 = "nw_wswka001";
break;
case 10:
sQuestItemType1 = "Club";
sTemplate1 = "forgedclub001";
break;
case 11:
sQuestItemType1 = "Heavy flail";
sTemplate1 = "nw_wblfh001";
break;
case 12:
sQuestItemType1 = "Light flail";
sTemplate1 = "nw_wblfl001";
break;
case 13:
sQuestItemType1 = "Warhammer";
sTemplate1 = "nw_wblhw001";
break;
case 14:
sQuestItemType1 = "Light hammer";
sTemplate1 = "nw_wblhl001";
break;
case 15:
sQuestItemType1 = "Mace";
sTemplate1 = "nw_wblml001";
break;
case 16:
sQuestItemType1 = "Morningstar";
sTemplate1 = "nw_wblms001";
break;
case 17:
sQuestItemType1 = "Dire mace";
sTemplate1 = "nw_wdbma001";
break;
case 18:
sQuestItemType1 = "Double axe";
sTemplate1 = "nw_wdbax001";
break;
case 19:
sQuestItemType1 = "Quarterstaff";
sTemplate1 = "forgedquarter001";
break;
case 20:
sQuestItemType1 = "Two-bladed sword";
sTemplate1 = "nw_wdbsw001";
break;
case 21:
sQuestItemType1 = "Kama";
sTemplate1 = "nw_wspka001";
break;
case 22:
sQuestItemType1 = "Kukri";
sTemplate1 = "nw_wspku001";
break;
case 23:
sQuestItemType1 = "Sickle";
sTemplate1 = "nw_wspsc001";
break;
case 24:
sQuestItemType1 = "Halberd";
sTemplate1 = "nw_wplhb001";
break;
case 25:
sQuestItemType1 = "Scythe";
sTemplate1 = "nw_wplsc001";
break;
case 26:
sQuestItemType1 = "Spear";
sTemplate1 = "nw_wplss001";
break;
case 27:
sQuestItemType1 = "Dwarven waraxe";
sTemplate1 = "x2_wdwraxe001";
break;
case 28:
sQuestItemType1 = "Rapier";
sTemplate1 = "nw_wswrp001";
break;
case 29:
sQuestItemType1 = "Scimitar";
sTemplate1 = "nw_wswsc001";
//---
case 30:
sQuestItemType1 = "Gloves";
sTemplate1 = "leathergauntlet1";
break;
//---
case 31:
sQuestItemType1 = "Heavy crossbow";
sTemplate1 = "nw_wbwxh001";
break;
case 32:
sQuestItemType1 = "Light crossbow";
sTemplate1 = "nw_wbwxl001";
break;
case 33:
sQuestItemType1 = "Longbow";
sTemplate1 = "nw_wbwln001";
break;
case 34:
sQuestItemType1 = "Shortbow";
sTemplate1 = "nw_wbwsh001";
break;
case 35:
sQuestItemType1 = "Sling";
sTemplate1 = "nw_wbwsl001";
break;
//---
case 36:
sQuestItemType1 = "Cloth";
sTemplate1 = "zep_arabian";
break;
//---
case 37:
sQuestItemType1 = "Padded armor";
sTemplate1 = "nw_aarcl009";
break;
case 38:
sQuestItemType1 = "Leather armor";
sTemplate1 = "nw_aarcl001";
break;
case 39:
sQuestItemType1 = "Studded leather armor";
sTemplate1 = "nw_aarcl002";
break;
//---
case 40:
sQuestItemType1 = "Scale armor";
sTemplate1 = "nw_aarcl003";
break;
case 41:
sQuestItemType1 = "Chainmail";
sTemplate1 = "nw_aarcl010";
break;
//---
case 42:
sQuestItemType1 = "Splint armor";
sTemplate1 = "nw_aarcl011";
break;
case 43:
sQuestItemType1 = "Half armor";
sTemplate1 = "nw_aarcl006";
break;
case 44:
sQuestItemType1 = "Full armor";
sTemplate1 = "nw_aarcl007";
break;
case 45:
sQuestItemType1 = "Ring";
sTemplate1 = "nw_it_mring021";
break;
case 46:
sQuestItemType1 = "Necklace";
sTemplate1 = "nw_it_mneck020";
break;
}
sRandomName1 = RandomName();
sRandomName2 = RandomName(NAME_LAST_HUMAN);
iQuest1Tag1 = Random(999999999999999999999) + 1;
SetLocalString(oCreate1, "Quest1ItemName1", "<ca e>" + sRandomName1 + " " + sRandomName2 + "'s " + sQuestItemType1 + "");
SetLocalString(oCreate1, "Quest1ItemBlueprint1", sTemplate1);
SetLocalString(oCreate1, "Quest1ItemTypeName1", sQuestItemType1);
SetName(oCreate1, "Map leading toward <ca e>" + sRandomName1 + " " + sRandomName2 + "'s " + sQuestItemType1 + "");
do
{
iTagCollide1 = 0;
GetLocalString(oNPC, "RandomArea1") == "";
if (!GetIsObjectValid(oAreaChoose1) ||
GetLocalString(oNPC, "RandomArea1") == "" ||
GetLocalString(oNPC, "RandomArea1") == sAreaTag1)
{
iRoll2 = Random(10) + 1; //Random number for instances, make it higher if it exceed the wrote number.
iRoll1 = Random(2) + 1;
switch (iRoll1)
{
case 1:
sAreaZone1 = "quest1_office1_" + IntToString(iRoll2) + "";
break;
case 2:
sAreaZone1 = "quest1_office2_" + IntToString(iRoll2) + "";
break;
/*case 3:
sAreaZone1 = "quest1_crypt1_" + IntToString(iRoll2) + "";
break;
case 4:
sAreaZone1 = "quest1_icew1_" + IntToString(iRoll2) + "";
break;*/
}
}
SetLocalString(oNPC, "RandomArea1", sAreaZone1);
sLocalAreaString1 = GetLocalString(oNPC, "RandomArea1");
oAreaChoose1 = GetObjectByTag(sLocalAreaString1);
oPCCheck1 = GetFirstPC();
while (GetIsObjectValid(oPCCheck1))
{
oOrb = GetItemPossessedBy(oPCCheck1, "database");
oOrb2 = GetItemPossessedBy(oPC, "database");
if (GetTag(GetArea(oPCCheck1)) == GetTag(oAreaChoose1) &&
GetLocalInt(oOrb, "Quest1Tag1") != GetLocalInt(oOrb2, "Quest1Tag1") &&
oPCCheck1 != oPC)
{
iTagCollide1 = 1;
}
oPCCheck1 = GetNextPC();
}
}while(iTagCollide1 == 1 || !GetIsObjectValid(oAreaChoose1) || GetLocalString(oNPC, "RandomArea1") == sAreaTag1);
oDestination1 = GetFirstObjectInArea(oAreaChoose1);
while (GetIsObjectValid(oDestination1) &&
iNumber1 == 0)
{
if (GetTag(oDestination1) == "quest1_spawnpoint1")
{
iNumber1 = 1;
}
if (iNumber1 != 1)
{
oDestination1 = GetNextObjectInArea(oAreaChoose1);
}
}
oParty = GetFirstFactionMember(GetFactionLeader(oPC), TRUE);
while (GetIsObjectValid(oParty))
{
iGold = GetGold(oParty);
if (GetArea(oParty) == GetArea(oNPC))
{
if (GetDistanceBetween(oNPC, oParty) <= 20.0)
{
if (iGold >= 150)
{
oOrb = GetItemPossessedBy(oParty, "database");
SetLocalInt(oOrb, "Quest1Tag1", iQuest1Tag1);
SetLocalLocation(oOrb, "Quest1StarterLocation1", GetLocation(oNPC));
TakeGoldFromCreature(150, oParty, TRUE);
AssignCommand(oParty, JumpToObject(oDestination1));
}
}
}
oParty = GetNextFactionMember(GetFactionLeader(oPC), TRUE);
}
}