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 override void LoadFromDatabase(DataObject obj) { base.LoadFromDatabase(obj); foreach (AbstractArea area in this.CurrentAreas) { if (area is KeepArea) { AbstractGameKeep keep = (area as KeepArea).Keep; Component = new GameKeepComponent(); Component.AbstractKeep = keep; Component.AbstractKeep.Banners.Add(obj.ObjectId, this); if (this.Model == AlbionGuildModel || this.Model == MidgardGuildModel || this.Model == HiberniaGuildModel) { BannerType = eBannerType.Guild; } else { BannerType = eBannerType.Realm; } if (BannerType == eBannerType.Guild && Component.AbstractKeep.Guild != null) { ChangeGuild(); } else { ChangeRealm(); } break; } } }
public override void LoadFromDatabase(DataObject obj) { if (obj == null) { return; } base.LoadFromDatabase(obj); string sKey = this.InternalID; // InternalID is set to obj.ObjectID by base.LoadFromDatabase() foreach (AbstractArea area in this.CurrentAreas) { if (area is KeepArea keepArea && keepArea.Keep is AbstractGameKeep keep) { Component = new GameKeepComponent(); Component.Keep = keep; if (keep.Banners.ContainsKey(sKey) == false) { Component.Keep.Banners.Add(sKey, this); if (this.Model == AlbionGuildModel || this.Model == MidgardGuildModel || this.Model == HiberniaGuildModel) { BannerType = eBannerType.Guild; } else { BannerType = eBannerType.Realm; } if (BannerType == eBannerType.Guild && Component.Keep.Guild != null) { ChangeGuild(); } else { ChangeRealm(); } break; } else if (log.IsWarnEnabled) { log.Warn($"LoadFromDatabase(): KeepID {keep.KeepID} already a banner using ObjectID {sKey}"); } } } // foreach }
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}"); } }
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 override void LoadFromDatabase(DataObject obj) { base.LoadFromDatabase(obj); foreach (AbstractArea area in this.CurrentAreas) { if (area is KeepArea) { AbstractGameKeep keep = (area as KeepArea).Keep; Component = new GameKeepComponent(); Component.AbstractKeep = keep; Component.AbstractKeep.Banners.Add(obj.ObjectId, this); if (this.Model == AlbionGuildModel || this.Model == MidgardGuildModel || this.Model == HiberniaGuildModel) BannerType = eBannerType.Guild; else BannerType = eBannerType.Realm; if (BannerType == eBannerType.Guild && Component.AbstractKeep.Guild != null) ChangeGuild(); else ChangeRealm(); break; } } }