Initial Upload
Initial Upload
This commit is contained in:
83
_module/nss/ba_r_randomspawn.nss
Normal file
83
_module/nss/ba_r_randomspawn.nss
Normal file
@@ -0,0 +1,83 @@
|
||||
#include "nw_i0_spells"
|
||||
|
||||
void SpawnRandomBoss()
|
||||
{
|
||||
int nAmmount, nRandomWaypoint;
|
||||
string sMonster, sArea;
|
||||
float fHelpDelay;
|
||||
location lRandom;
|
||||
object oRandomArea, oMonster, oWaypoint, oSearcher;
|
||||
|
||||
switch (d20() + d10() - 1)
|
||||
{
|
||||
case 1 : oRandomArea = GetObjectByTag("AersMountain"); break;
|
||||
case 2 : oRandomArea = GetObjectByTag("Cliffs"); break;
|
||||
case 3 : oRandomArea = GetObjectByTag("Dawn"); break;
|
||||
case 4 : oRandomArea = GetObjectByTag("DarknessFalls"); break;
|
||||
case 5 : oRandomArea = GetObjectByTag("DesertofRa"); break;
|
||||
case 6 : oRandomArea = GetObjectByTag("DestroyedCrypts"); break;
|
||||
case 7 : oRandomArea = GetObjectByTag("tor_ctfwdm"); break;
|
||||
case 8 : oRandomArea = GetObjectByTag("DragonsDomain"); break;
|
||||
case 9 : oRandomArea = GetObjectByTag("ForestofLostHope"); break;
|
||||
case 10 : oRandomArea = GetObjectByTag("tor_fdlpth"); break;
|
||||
case 11 : oRandomArea = GetObjectByTag("FrostValley"); break;
|
||||
case 12 : oRandomArea = GetObjectByTag("KainsIsland"); break;
|
||||
case 13 : oRandomArea = GetObjectByTag("CastleCourtyard"); break;
|
||||
case 14 : oRandomArea = GetObjectByTag("ThenesMines"); break;
|
||||
case 15 : oRandomArea = GetObjectByTag("MoonShayIsle"); break;
|
||||
case 16 : oRandomArea = GetObjectByTag("MtBarovchocy"); break;
|
||||
case 17 : oRandomArea = GetObjectByTag("MtDrake"); break;
|
||||
case 18 : oRandomArea = GetObjectByTag("NoMansLand"); break;
|
||||
case 19 : oRandomArea = GetObjectByTag("Oblivion"); break;
|
||||
case 21 : oRandomArea = GetObjectByTag("OceanofDestiny"); break;
|
||||
case 22 : oRandomArea = GetObjectByTag("OrcStronghold"); break;
|
||||
case 23 : oRandomArea = GetObjectByTag("SeaofFallenAngels"); break;
|
||||
case 24 : oRandomArea = GetObjectByTag("ShadowRealm"); break;
|
||||
case 25 : oRandomArea = GetObjectByTag("SkullGorge"); break;
|
||||
case 26 : oRandomArea = GetObjectByTag("stingerforest"); break;
|
||||
case 27 : oRandomArea = GetObjectByTag("TheUnderdarkForest"); break;
|
||||
case 28 : oRandomArea = GetObjectByTag("UpperTrollOutpost"); break;
|
||||
case 29 : oRandomArea = GetObjectByTag("VenomPlains"); break;
|
||||
default : oRandomArea = GetObjectByTag("VenomPlains"); break;
|
||||
}
|
||||
|
||||
if(GetIsObjectValid(oRandomArea))
|
||||
{
|
||||
oWaypoint = GetFirstObjectInArea(oRandomArea);
|
||||
|
||||
while(GetIsObjectValid(oWaypoint))
|
||||
{
|
||||
if(GetTag(oWaypoint) == "br_MassagreWaypoint") nAmmount++;
|
||||
|
||||
oWaypoint = GetNextObjectInArea(oRandomArea);
|
||||
}
|
||||
|
||||
nRandomWaypoint = Random(nAmmount) + 1;
|
||||
|
||||
oSearcher = GetNearestObjectToLocation(OBJECT_TYPE_WAYPOINT, Location(oRandomArea, Vector(5.0, 5.0, 0.0), 0.0), 1);
|
||||
|
||||
oWaypoint = GetNearestObjectByTag("br_MassagreWaypoint", oSearcher, nRandomWaypoint);
|
||||
|
||||
if(!GetIsObjectValid(oWaypoint)) oWaypoint = oSearcher;
|
||||
|
||||
switch(d8())
|
||||
{
|
||||
case 1 : sMonster = "br_ra1sttba"; break; // Scourge
|
||||
case 2 : sMonster = "tb_rstroll"; break; // Vaprak
|
||||
case 3 : sMonster = "DeathDragon"; break; // Death
|
||||
case 4 : sMonster = "bx_hung4ba"; break; // Famine
|
||||
case 5 : sMonster = "bx_fpestil"; break; // Pestilence
|
||||
case 6 : sMonster = "bx_waro4ks"; break; // War
|
||||
case 7 : sMonster = "sf_boss_fidemon"; break; // Fire & Ice Demon
|
||||
case 8 : sMonster = "tb_rstroll"; break;
|
||||
default : sMonster = "br_ra1sttba"; break;
|
||||
}
|
||||
|
||||
fHelpDelay = GetRandomDelay(240.0, 200.0);
|
||||
lRandom = GetLocation(oWaypoint);
|
||||
oMonster = CreateObject(OBJECT_TYPE_CREATURE, sMonster, lRandom, TRUE);
|
||||
sArea = GetName(GetArea(oMonster));
|
||||
DelayCommand(4.0, AssignCommand(oMonster, SpeakString("The World will be mine!", TALKVOLUME_SHOUT)));
|
||||
DelayCommand(fHelpDelay, AssignCommand(oMonster, SpeakString(sArea + " is already conquered! No one will be safe!", TALKVOLUME_SHOUT)));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user