public override void Update(long msTick) { base.Update(msTick); if (_nextAreaCheckTime < msTick) { _nextAreaCheckTime = msTick + 2000; Zone_Area newArea = Zone.ClientInfo.GetZoneAreaFor((ushort)X, (ushort)Y, Zone.ZoneId, (ushort)Z); if (newArea == null || !newArea.IsRvR) { OutOfAreaDecay(); } else if (_outofAreaCount > 0) { _outofAreaCount--; } } // RB 6/25/2016 Kill siege weapons that have decayed and are not being interacted with. if (SiegeInterface.IsAbandoned && msTick > _nextDamageTime) { ReceiveDamage(this, MaxHealth / 10); _nextDamageTime = msTick + 20 * 1000; } if (msTick > SiegeInterface.DeathTime && msTick > _nextDamageTime) { ReceiveDamage(this, MaxHealth / 10); _nextDamageTime = msTick + 20 * 1000; } }
public uint GetTokExplore(TokInterface Interface, ushort PinX, ushort PinY, byte Realm) { Zone_Area Area = GetArea(PinX, PinY, Realm); if (Area == null) { return(0); } if (Area.TokExploreEntry == 0) { return(0); } if (Interface != null && Interface.HasTok(Area.TokExploreEntry)) { return(Area.TokExploreEntry); } if (IsOnExploreArea(Area, PinX, PinY)) { if (Interface != null) { Interface.AddTok(Area.TokExploreEntry); } return(Area.TokExploreEntry); } else { return(0); } }
public static void AddZoneArea(Zone_Area Area) { List <Zone_Area> Areas; if (!_Zone_Area.TryGetValue(Area.ZoneId, out Areas)) { Areas = new List <Zone_Area>(); _Zone_Area.Add(Area.ZoneId, Areas); } Areas.Add(Area); }
public void CheckArea(Zone_Area Area) { if (!Area.IsLoaded()) { Area.Information.Loaded = true; string FileName = Program.Config.ZoneFolder + "zone" + String.Format("{0:000}", ZoneID) + "/piece" + String.Format("{0:00}", Area.Information.PieceId) + ".jpg"; try { Area.Information.File = new Bitmap(FileName); } catch (Exception e) { Log.Error("AreaMapMgr", "Invalid Piece File : " + FileName + "\n" + e.ToString()); } } }
public bool IsOnExploreArea(Zone_Area Area, ushort PinX, ushort PinY) { if (Area == null || Area.Information == null) { return(false); } if (!Area.IsOnArea(PinX, PinY)) { return(false); } CheckArea(Area); if (Area.Information.File == null) { return(false); } PinX = (ushort)(PinX / 64); PinY = (ushort)(PinY / 64); PinX -= Area.Information.OffsetX; PinY -= Area.Information.OffsetY; if (PinX >= Area.Information.Width || PinY >= Area.Information.Height || PinX < 0 || PinY < 0) { //Log.Error("IsOnExplore", "PinX=" + PinX + ",PinY=" + PinY+",ZoneId="+Area.ZoneId+",Piece="+Area.PieceId); return(false); } System.Drawing.Color Col = Area.Information.File.GetPixel(PinX, PinY); if (Col.R == 255 && Col.G == 255 && Col.B == 255) { return(false); } return(true); }
public uint GetInfluenceId(ushort PinX, ushort PinY, byte Realm) { Zone_Area Area = GetArea(PinX, PinY, Realm); if (Area == null) { return(0); } if (Area.InfluenceId == 0) { return(0); } if (IsOnExploreArea(Area, PinX, PinY)) { return(Area.InfluenceId); } else { return(0); } }