#W# Working on world spawns.

This commit is contained in:
WarrentyExpired 2026-07-12 13:12:42 -04:00
parent eeab1c9664
commit 84f48a0512
8 changed files with 1505 additions and 171 deletions

View file

@ -7,7 +7,6 @@ using System.Collections.Generic;
namespace Server
{
// 1. Define the Terrain Enum here so it is accessible to the script
public enum Terrain
{
None, Water, Cave, Dirt, Forest, Grass, Jungle, Rock, Sand, Swamp, Snow
@ -15,6 +14,8 @@ namespace Server
public class SpawnList
{
//--------------------------------- Critters --------------------------------------------
private static Type[] ForestCritters = new Type[]
{
typeof( Rat ), typeof( Snake ), typeof( Rabbit ), typeof( Squirrel)
@ -22,7 +23,7 @@ namespace Server
private static Type[] DesertCritters = new Type[]
{
typeof( Snake ), typeof( Rabbit )
typeof( Snake ), typeof( Rabbit ), typeof( Rat )
};
private static Type[] SnowCritters = new Type[]
@ -50,14 +51,16 @@ namespace Server
typeof( Rat )
};
//------------------------------------ Birds -----------------------------------------
private static Type[] ForestBirds = new Type[]
{
typeof( Bird ), typeof( Turkey ), typeof( Eagle )
typeof( Bird ), typeof( Turkey ), typeof( Eagle ), typeof( AxeBeak )
};
private static Type[] DesertBirds = new Type[]
{
typeof( Bird ), typeof( Eagle )
typeof( Bird ), typeof( Eagle ), typeof( Phoenix )
};
private static Type[] SnowBirds = new Type[]
@ -67,47 +70,51 @@ namespace Server
private static Type[] FieldBirds = new Type[]
{
typeof( Bird ), typeof( Eagle )
typeof( Bird ), typeof( Eagle ), typeof( Chicken )
};
private static Type[] JungleBirds = new Type[]
{
typeof( Bird )
typeof( Bird ), typeof( AxeBeak ), typeof( Eagle )
};
private static Type[] SwampBirds = new Type[]
{
typeof( Bird )
typeof( Bird ), typeof( Eagle ), typeof( AxeBeak )
};
private static Type[] DirtBirds = new Type[]
{
typeof( Bird )
typeof( Bird ), typeof( Chicken ), typeof( AxeBeak )
};
//---------------------------------------- Animals ----------------------------------------
private static Type[] ForestAnimals = new Type[]
{
typeof( BlackBear ), typeof( Boar ), typeof( BrownBear ),
typeof( Cougar ), typeof( GreatDeer ), typeof( TimberWolf ),
typeof( GrizzlyBear), typeof( Deer ), typeof( KodiakBear ),
typeof( GreyWolf )
typeof( GrizzlyBear), typeof( Deer ), typeof( GreyWolf ),
typeof( Bat )
};
private static Type[] JungleAnimals = new Type[]
{
typeof( Boar ), typeof( Gorilla ), typeof( PandaBear ), typeof( Panther )
typeof( Boar ), typeof( Gorilla ), typeof( PandaBear ), typeof( Panther ),
typeof( Tiger ), typeof( Ape )
};
private static Type[] FieldAnimals = new Type[]
{
typeof( BrownBear ), typeof( Goat ), typeof( MountainGoat ),
typeof( Cow ), typeof( Bull )
typeof( Cow ), typeof( Bull ), typeof( Lion ), typeof( GreyWolf )
};
private static Type[] SnowAnimals = new Type[]
{
typeof( PolarBear ), typeof( SnowLeopard ), typeof( Deer ), typeof( GreatDeer ),
typeof( Goat ), typeof( Walrus ), typeof( Rabbit ), typeof( WhiteWolf ), typeof( MountainGoat )
typeof( Goat ), typeof( Walrus ), typeof( Rabbit ), typeof( WhiteWolf ),
typeof( MountainGoat ), typeof( KodiakBear )
};
private static Type[] DesertAnimals = new Type[]
@ -117,7 +124,8 @@ namespace Server
private static Type[] SwampAnimals = new Type[]
{
typeof( Boar ), typeof( BlackBear ), typeof( Turtle ), typeof( BullFrog ),
typeof( SwampDragon ), typeof( GreatDeer ), typeof( GiantSerpent ), typeof( Alligator )
typeof( SwampDragon ), typeof( GreatDeer ), typeof( GiantSerpent ), typeof( Alligator ),
typeof( WoolyBanta )
};
private static Type[] DirtAnimals = new Type[]
@ -125,62 +133,21 @@ namespace Server
typeof( Boar ), typeof( BlackBear ), typeof( BrownBear ), typeof( GreyWolf )
};
//-------------------------------------- Tier A------------------------------------------------
private static Type[] Dirt_A = new Type[]
{
typeof( Bat ), typeof( GiantRat ), typeof( GiantSpider ), typeof( GiantSerpent ),
typeof( Ratman ), typeof( Mongbat ), typeof( GiantLizard)
};
private static Type[] Dirt_B = new Type[]
{
typeof( StoneGargoyle ), typeof( Ogre )
};
private static Type[] Dirt_C = new Type[]
{
typeof( CaveBear ), typeof( Drake ), typeof( WhippingVine ),
typeof( Xorn ), typeof( Beetle ), typeof( Manticore )
};
private static Type[] Dirt_D = new Type[]
{
typeof( Daemon ), typeof( Hydra ), typeof( OgreLord ),
typeof( Nightmare ), typeof( Balron ), typeof( ForestGiant )
};
private static Type[] Dirt_E = new Type[]
{
typeof( Wisp )
typeof( Brigand ), typeof( Skeleton ), typeof( BoneClaw ), typeof( CarcassWorm ),
typeof( Slime ), typeof( Mongbat ), typeof( HeadlessOne )
};
private static Type[] Forest_A = new Type[]
{
typeof( DireWolf ), typeof( GiantRat ), typeof( GiantSpider ),
typeof( GiantToad ), typeof( Ratman ), typeof( GiantLizard ),
typeof( GiantSerpent ), typeof( Mongbat )
};
private static Type[] Forest_B = new Type[]
{
typeof( Ettin ), typeof( Ogre ), typeof( Troll )
};
private static Type[] Forest_C = new Type[]
{
typeof( Reaper ), typeof( Owlbear ), typeof( Ettin ), typeof( Drake ),
typeof( Beetle )
};
private static Type[] Forest_D = new Type[]
{
typeof( Reaper ), typeof( DreadHorn ), typeof( Balron ),
typeof( Daemon ), typeof( Hydra ), typeof( ForestGiant ),
typeof( OgreLord ), typeof( Dragon )
};
private static Type[] Forest_E = new Type[]
{
typeof( Ent ), typeof( Pixie ), typeof( Unicorn )
typeof( GiantSerpent ), typeof( Mongbat ), typeof( Goblin ),
typeof( Corpser ), typeof( Shambler ), typeof( GiantHawk ),
typeof( GiantRaven )
};
private static Type[] Jungle_A = new Type[]
@ -190,141 +157,198 @@ namespace Server
typeof( Mongbat )
};
private static Type[] Jungle_B = new Type[]
{
typeof( Troll ), typeof( WhippingVine ), typeof( GiantSerpent ), typeof( Gargoyle ),
typeof( Mantis ), typeof( GiantLizard ), typeof( Raptor )
};
private static Type[] Jungle_C = new Type[]
{
typeof( Wyvern ), typeof( Cyclops ), typeof( Meglasaur ), typeof( Stegosaurus ),
};
private static Type[] Jungle_D = new Type[]
{
typeof( Balron ), typeof( Daemon ), typeof( Hydra ), typeof( CyclopsChief ),
typeof( Dragon ), typeof( Tyranasaur )
};
private static Type[] Jungle_E = new Type[]
{
typeof( Pixie )
};
private static Type[] Field_A = new Type[]
{
typeof( Hobgoblin ), typeof( HobgoblinChief ), typeof( HobgoblinShaman ),
typeof( DireWolf ), typeof( Ratman ), typeof( Skeleton ), typeof( SkeletonArcher ),
typeof( GiantSpider )
};
private static Type[] Field_B = new Type[]
{
typeof( AirElemental ), typeof( Corpser ), typeof( Ettin ), typeof( Gargoyle ),
typeof( GiantRaven ), typeof( GiantHawk ), typeof( Hippogriff ), typeof( Ogre )
};
private static Type[] Field_C = new Type[]
{
typeof( Harpy ), typeof( Beetle ), typeof( Centaur )
};
private static Type[] Field_D = new Type[]
{
typeof( Dragon ), typeof( HillGiant ), typeof( Daemon ), typeof( Roc ),
typeof( Ogre )
};
private static Type[] Field_E = new Type[]
{
typeof( Griffon ), typeof( Balron )
};
private static Type[] Snow_A = new Type[]
{
typeof( FrostSpider ), typeof( FrostOoze ), typeof( IceSerpent ),
typeof( IceSalamander ), typeof( IceToad )
};
private static Type[] Snow_B = new Type[]
private static Type[] Field_A = new Type[]
{
typeof( IceFiend ), typeof( FrostTroll ), typeof( SnowEttin ),
typeof( IceElemental)
};
private static Type[] Snow_C = new Type[]
{
typeof( SnowElemental ), typeof( GargoyleIce )
};
private static Type[] Snow_D = new Type[]
{
typeof( Balron ), typeof( Daemon ), typeof( Hydra ),
typeof( FrostGiant ), typeof( ArcticOgreLord )
};
private static Type[] Snow_E = new Type[]
{
typeof( WhiteWyrm )
typeof( Hobgoblin ), typeof( HobgoblinChief ), typeof( HobgoblinShaman ),
typeof( DireWolf ), typeof( Ratman ), typeof( Skeleton ), typeof( SkeletonArcher ),
typeof( GiantSpider ), typeof( Snake )
};
private static Type[] Desert_A = new Type[]
{
typeof( SandVortex ), typeof( Scorpion )
};
private static Type[] Desert_B = new Type[]
{
typeof( EarthElemental ), typeof( SandVortex ), typeof( FireElemental ), typeof( LavaSerpent ),
typeof( RatmanArcher ), typeof( RatmanMage ), typeof( Sphinx )
};
private static Type[] Desert_C = new Type[]
{
typeof( SandSpider ), typeof( Manticore ), typeof( Mummy ),
typeof( RoyalSphinx ), typeof( FireGargoyle ),
};
private static Type[] Desert_D = new Type[]
{
typeof( Dragon ), typeof( FireBeetle ), typeof( Daemon ), typeof( Efreet ),
typeof( SandGiant ), typeof( Hydra ), typeof( Balron ), typeof( AncientSphinx )
};
private static Type[] Desert_E = new Type[]
{
typeof( AncientSphinx ), typeof( AncientWyrm )
typeof( SandSpider ), typeof( Snake ), typeof( FireToad ), typeof( Skeleton ),
typeof( SkeletonArcher ), typeof( BoneClaw )
};
private static Type[] Swamp_A = new Type[]
{
typeof( Alligator ), typeof( GiantRat ), typeof( Slime ), typeof( Mongbat )
typeof( Alligator ), typeof( GiantRat ), typeof( Slime ), typeof( Mongbat ),
typeof( Corpser ), typeof( WhippingVine ), typeof( Shambler )
};
//------------------------ Tier B -------------------------------------------------------
private static Type[] Dirt_B = new Type[]
{
typeof( Dwarf ), typeof( Caveman ), typeof( SkeletalMage ), typeof( Ghoul ),
typeof( Gazer ), typeof( Gargoyle ), typeof( EarthElemental ), typeof( Minion ),
typeof( LargeSlime )
};
private static Type[] Forest_B = new Type[]
{
typeof( StandardOrc ), typeof( OrcCaptain ), typeof( OrcishLord ), typeof( Hobgoblin ),
typeof( Ratman ), typeof( Ettin ), typeof( Ogre ), typeof( Troll ), typeof( Bugbear ),
typeof( Owlbear ), typeof( TerathanDrone ), typeof( Reaper ), typeof( WoodElemental ),
typeof( Werewolf )
};
private static Type[] Jungle_B = new Type[]
{
typeof( Sakkhra ), typeof( SakkhraShaman ), typeof( Cobra ), typeof( Viper ),
typeof( Drasolisk ), typeof( GiantLizard ), typeof( GoraxHorned )
};
private static Type[] Field_B = new Type[]
{
typeof( Ettin ), typeof( Ogre ), typeof( Troll ), typeof( Gazer ), typeof( DireWolf ),
typeof( Sasquatch )
};
private static Type[] Snow_B = new Type[]
{
typeof( SnowEttin ), typeof( Yeti ), typeof( IceImp ), typeof( IceSerpent )
};
private static Type[] Desert_B = new Type[]
{
typeof( AntaurWorker ), typeof( AntaurSoldier ), typeof( SandScorpion ),
typeof( Scorpion ), typeof( Scarab ), typeof( Sphinx ), typeof( HellCat ),
typeof( LavaLizard ), typeof( FireImp ), typeof( HellHound )
};
private static Type[] Swamp_B = new Type[]
{
typeof( GiantSerpent ), typeof( Mantis ), typeof( SwampTentacle ),
typeof( Lizardman ), typeof( GiantLizard ), typeof( TerathanDrone )
typeof( Lizardman ), typeof( SwampTentacle ), typeof( Fungal ), typeof( Sludge )
};
//----------------------------------- Tier C -------------------------------------
private static Type[] Dirt_C = new Type[]
{
typeof( CorpseGolem ), typeof( Shade ), typeof( Spectre ), typeof( Wraith ),
typeof( Xorn ), typeof( Drake ), typeof( Manticore ), typeof( IronBeetle )
};
private static Type[] Forest_C = new Type[]
{
typeof( Beetle ), typeof( BloodSpider ), typeof( Fairy ), typeof( TerathanWarrior ),
typeof( OgreLord ), typeof( Satyr ), typeof( Kith )
};
private static Type[] Jungle_C = new Type[]
{
typeof( Mantis ), typeof( GoraxSlicer ), typeof( Kobra ), typeof( SavageLeader )
};
private static Type[] Field_C = new Type[]
{
typeof( Wisp ), typeof( AirElemental ), typeof( Cyclops ), typeof( LightningElemental ),
typeof( StormCloud ), typeof( Minotaur )
};
private static Type[] Snow_C = new Type[]
{
typeof( IceSalamander ), typeof( FrostTroll ), typeof( IceElemental ), typeof( ArcticOgreLord ),
typeof( SnowElemental )
};
private static Type[] Desert_C = new Type[]
{
typeof( FireSalamander ), typeof( DeadlyScorpion ), typeof( FireBeetle ), typeof( FlameCrawler ),
typeof( Mummy ), typeof( AntLion ), typeof( SandVortex ), typeof( FireGargoyle ), typeof( LavaDrake )
};
private static Type[] Swamp_C = new Type[]
{
typeof( SwampThing ), typeof( SwampTentacle ), typeof( TerathanWarrior )
typeof( FungalMage ), typeof( OphidianMage ), typeof( BloodLotus ), typeof( MudElemental ),
typeof( OphidianWarrior ), typeof( SwampDragon ), typeof( SwampThing )
};
//------------------------------------- Tier D -----------------------------------------
private static Type[] Dirt_D = new Type[]
{
typeof( CyclopsChief ), typeof( MinotaurLord ), typeof( GargoyleCrimson ),
typeof( BoneDrake ), typeof( Lich ), typeof( Genie ), typeof( DemonClaw ),
typeof( Demoness ), typeof( Seeker )
};
private static Type[] Forest_D = new Type[]
{
typeof( HobgoblinArcher ), typeof( OgreMagi ), typeof( RatmanArcher ), typeof( Pixie ),
typeof( RatmanMage ), typeof( VampiricDrake ), typeof( TerathanMatriarch ), typeof( Ent )
};
private static Type[] Jungle_D = new Type[]
{
typeof( SilverSerpent ), typeof( Drakkhen ), typeof( FireNaga )
};
private static Type[] Field_D = new Type[]
{
typeof( Centaur ), typeof( ShamblingMound ), typeof( Titan ), typeof( Cerberus )
};
private static Type[] Snow_D = new Type[]
{
typeof( GargoyleIce ), typeof( WaterElementalElder ), typeof( Serperus )
};
private static Type[] Desert_D = new Type[]
{
typeof( MummyLord ), typeof( RoyalSphinx ), typeof( AntaurLord ), typeof( Haderus )
};
private static Type[] Swamp_D = new Type[]
{
typeof( JungleGiant ), typeof( Viper ), typeof( SilverSerpent ), typeof( TerathanAvenger ),
typeof( TerathanMatriarch )
};
private static Type[] Swamp_E = new Type[]
{
typeof( Wisp ), typeof( AncientWyrm )
typeof( OphidianKnight ), typeof( OphidianArchmage ), typeof( PoisonElemental ),
typeof( AcidElemental ), typeof( GasCloud )
};
// 2. Insert the Terrain checking logic here
//------------------------------------- Tier E ------------------------------------------
private static Type[] Dirt_E = new Type[]
{
typeof( Daemon ), typeof( Dragon ), typeof( MountainGiant )
};
private static Type[] Forest_E = new Type[]
{
typeof( HillGiant ), typeof( ForestGiant ), typeof( Hydra ), typeof( Roc )
};
private static Type[] Jungle_E = new Type[]
{
typeof( Naga ), typeof( JungleGiant ), typeof( NagaQueen )
};
private static Type[] Field_E = new Type[]
{
typeof( CyclopsLord ), typeof( Balron ), typeof( StormGiant ), typeof( Dragon )
};
private static Type[] Snow_E = new Type[]
{
typeof( FrostGiant ), typeof( IceFiend ), typeof( WhiteWyrm ), typeof( IceDevil )
};
private static Type[] Desert_E = new Type[]
{
typeof( ArcaneScarab ), typeof( SandGiant ), typeof( Succubus )
};
private static Type[] Swamp_E = new Type[]
{
typeof( OphidianMatriarch ), typeof( PoisonElementalElder ), typeof( AncientWyrm )
};
//---------------------------- End of Mob Definitions --------------------------------------
public static Terrain GetTerrain( Map map, Point3D location, int x, int y )
{
if ( map == Map.Internal || x < 0 || y < 0 )
@ -398,14 +422,12 @@ namespace Server
return ground;
}
// 3. Update RandomSpawn to call GetTerrain instead of looking for spawn.Terrain
public static Mobile RandomSpawn( Item spawn, Point3D loc, Map map )
{
Mobile m = null;
spawn.MoveToWorld( loc, map );
int tries = 100;
// Calculate the terrain directly from the map coordinates
Terrain terrain = GetTerrain( map, loc, spawn.X, spawn.Y );
if ( terrain != Terrain.Water && terrain != Terrain.Cave && terrain != Terrain.Dirt && terrain != Terrain.Rock )

View file

@ -14,7 +14,7 @@ namespace Server.Mobiles
Name = "a giant hawk";
Body = 224;
BaseSoundID = 0x2EE;
Hue = 2708;
Hue = 843;
SetStr( 126, 155 );
SetDex( 81, 105 );