public List <Actor> Actors = new List <Actor>(); //list to keep all actors which are currentl in this zone. public Zone(uint regionId, uint zoneId, byte locationNameId, byte musicSetId, int classNameId = -1, bool isMountAllowed = false, ZoneType zoneType = ZoneType.Default, string mapName = null) { Id = zoneId; Name = Encoding.ASCII.GetBytes("_areaMaster"); RegionId = regionId; MapName = mapName; PlaceName = ZoneList.LocationName[locationNameId]; ClassName = classNameId < 0 ? null : "ZoneMaster" + ZoneList.ClassName[classNameId]; MusicSet = MusicSet.Get(musicSetId); MountAllowed = isMountAllowed; LuaParameters = new LuaParameters { ActorName = "_areaMaster" + "@0" + LuaParameters.SwapEndian(zoneId).ToString("X").Substring(0, 4), ClassName = ClassName, ClassCode = 0x30400000 }; LuaParameters.Add("/Area/Zone/" + ClassName); LuaParameters.Add(false); LuaParameters.Add(true); LuaParameters.Add(MapName); LuaParameters.Add(""); LuaParameters.Add(-1); LuaParameters.Add(Convert.ToByte(isMountAllowed)); for (int i = 7; i > -1; i--) { LuaParameters.Add(((byte)zoneType & (1 << i)) != 0); } }
public static MusicSet Get(int id) { MusicSet musicSet = new MusicSet(0, 0, 0); if (MusicSets.ContainsKey(id)) { musicSet = MusicSets[id]; } return(musicSet); }