public virtual void LoadFromPosition(DBKeepPosition pos, GameKeepComponent component) { m_templateID = pos.TemplateID; m_component = component; PositionMgr.LoadKeepItemPosition(pos, this); component.AbstractKeep.Doors[m_templateID] = this; m_oldMaxHealth = MaxHealth; m_health = MaxHealth; m_name = "Keep Door"; m_oldHealthPercent = HealthPercent; m_doorID = GenerateDoorID(); m_model = 0xFFFF; m_state = eDoorState.Closed; if (AddToWorld()) { StartHealthRegeneration(); DoorMgr.RegisterDoor(this); } else { log.Error("Failed to load keep door from position! DoorID=" + m_doorID + ". Component SkinID=" + component.Skin + ". KeepID=" + component.AbstractKeep.KeepID); } }
public virtual void LoadFromPosition(DBKeepPosition pos, GameKeepComponent component) { m_templateID = pos.TemplateID; m_component = component; BannerType = (eBannerType)pos.TemplateType; PositionMgr.LoadKeepItemPosition(pos, this); component.AbstractKeep.Banners[m_templateID] = this; if (BannerType == eBannerType.Guild) { if (component.AbstractKeep.Guild != null) { ChangeGuild(); Z += 1500; this.AddToWorld(); } } else { ChangeRealm(); Z += 1000; // this works around an issue where all banners are at keep level instead of on top // with a z value > height of the keep the banners show correctly - tolakram this.AddToWorld(); } }
public void LoadFromPosition(DBKeepPosition pos, GameKeepComponent component) { if (component.Keep.DBKeep.BaseLevel < 50) { return; } m_component = component; PositionMgr.LoadKeepItemPosition(pos, this); this.m_component.Keep.TeleportStone = this; this.AddToWorld(); }
public void MoveToPosition(DBKeepPosition position) { PositionMgr.LoadKeepItemPosition(position, this); int zAdd = 1000; if (BannerType == eBannerType.Guild) { zAdd = 1500; } this.MoveTo(this.CurrentRegionID, this.X, this.Y, this.Z + zAdd, this.Heading); }
public virtual void LoadFromPosition(DBKeepPosition pos, GameKeepComponent component) { if (pos == null || component == null) { return; } m_templateID = pos.TemplateID; m_component = component; BannerType = (eBannerType)pos.TemplateType; PositionMgr.LoadKeepItemPosition(pos, this); string sKey = this.TemplateID; if (component.Keep.Banners.ContainsKey(sKey) == false) { component.Keep.Banners.Add(sKey, this); if (BannerType == eBannerType.Guild) { if (component.Keep.Guild != null) { ChangeGuild(); Position += Vector3.UnitZ * 1500; this.AddToWorld(); } } else { ChangeRealm(); Position += Vector3.UnitZ * 1000; // this works around an issue where all banners are at keep level instead of on top // with a z value > height of the keep the banners show correctly - tolakram this.AddToWorld(); } } else if (log.IsWarnEnabled) { log.Warn($"LoadFromPosition(): There is already a Banner with TemplateID {this.TemplateID} on KeepID {component.Keep.KeepID}, not adding Banner for KeepPosition_ID {pos.ObjectId} on KeepComponent_ID {component.InternalID}"); } }