ModernUO/Projects/UOContent/Mobiles
Kamron Batman 6d51b33cf8
feat: Add CanSpawnMobile overload with props Z-range support. (#2293)
### Summary

- Adds CanSpawnMobile(x, y, minZ, maxZ, canSwim, cantWalk, out spawnZ) overload for finding spawn surfaces within a Z range
- Adds CanSpawnItem(x, y, minZ, maxZ, out spawnZ) for item spawning with Surface+Impassable support (tables, furniture)
- Uses bitmask optimization inspired by Item.DropToWorld's m_OpenSlots pattern for O(1) surface/blocker checks
- HomeRange spawners now use surface detection to set proper Z bounds

### Key Changes

Map.cs:
- CanSpawnMobile with Z-range finds lowest valid surface for mobiles
- CanSpawnItem with Z-range finds lowest valid surface for items (including tables)
- CanFitItem for point-check item placement on Surface+Impassable tiles
- Bitmask approach eliminates nested loops and stackalloc arrays

Spawners:
- Simplified GetSpawnPosition using new Z-range methods
- HomeRange setter detects surface below spawner for proper Z bounds
- Consistent handling for mobiles and items

### Bug Fixes

- Water tiles (Impassable | Wet) no longer block swimming mobs
- Items can now spawn on tables/furniture (Surface+Impassable)

### Test Plan

- Run dotnet test - 631 tests pass
- Manual testing: multi-story spawning, water mobs, item spawning on tables
- Verify HomeRange spawner movement shifts bounds correctly
2025-12-27 17:01:15 -08:00
..
Abilities chore: Use var everywhere (#2294) 2025-12-27 16:47:28 -08:00
AI feat: Add CanSpawnMobile overload with props Z-range support. (#2293) 2025-12-27 17:01:15 -08:00
Animals chore: Fixes variable types for possible performance issues (#2172) 2025-05-01 21:54:41 -07:00
Familiars fix: Fixes movement pathing while in combat (#2271) 2025-11-16 10:14:06 -08:00
Guards feat: Changes Spawner HomeRange to SpawnBounds (#2290) 2025-12-26 18:07:26 -08:00
Healers feat: Adds PlayerDeathEvent and CreatureDeathEvent using code generated events (#1927) 2024-09-05 21:23:03 -07:00
Hireables chore: Use var everywhere (#2294) 2025-12-27 16:47:28 -08:00
Monsters chore: Use var everywhere (#2294) 2025-12-27 16:47:28 -08:00
Special fix: Fixes tentacles not getting removed from harrower's list (#2239) 2025-07-24 14:18:16 -07:00
Townfolk chore: Use var everywhere (#2294) 2025-12-27 16:47:28 -08:00
Vendors chore: Use var everywhere (#2294) 2025-12-27 16:47:28 -08:00
BaseCreature.cs chore: Use var everywhere (#2294) 2025-12-27 16:47:28 -08:00
NPCSpeeds.cs feat: Overhauls AI (Speech/Movement) (#2232) 2025-07-18 22:39:57 -07:00
PlayerMobile.cs chore: Use var everywhere (#2294) 2025-12-27 16:47:28 -08:00
VirtualMountItem.cs fix: Fixes mount stamina, adds Pub46+ Ethereal stamina (#1716) 2024-04-05 21:05:16 -07:00