/// <summary> /// Gets the bonus modifier for a realm/relictype. /// </summary> /// <param name="realm"></param> /// <param name="type"></param> /// <returns></returns> public static double GetRelicBonusModifier(eRealm realm, eRelicType type) { double bonus = 0.0; bool owningSelf = false; //only playerrealms can get bonus foreach (GameRelic rel in getRelics(realm, type)) { if (rel.Realm == rel.OriginalRealm) { owningSelf = true; } else { bonus += ServerProperties.Properties.RELIC_OWNING_BONUS * 0.01; } } // Bonus apply only if owning original relic if (owningSelf) { return(bonus); } return(0.0); }
public static MiniTemp GetRelicTemplate(eRealm Realm, eRelicType RelicType) { MiniTemp m_template = new MiniTemp(); switch (Realm) { case eRealm.Albion: if (RelicType == eRelicType.Magic) { m_template.Name = "Merlins Staff"; m_template.Model = 630; } else { m_template.Name = "Scabbard of Excalibur"; m_template.Model = 631; } break; case eRealm.Midgard: if (RelicType == eRelicType.Magic) { m_template.Name = "Horn of Valhalla"; m_template.Model = 635; } else { m_template.Name = "Thors Hammer"; m_template.Model = 634; } break; case eRealm.Hibernia: if (RelicType == eRelicType.Magic) { m_template.Name = "Cauldron of Dagda"; m_template.Model = 632; } else { m_template.Name = " Lughs Spear of Lightning"; m_template.Model = 633; } break; default: m_template.Name = "Unkown Relic"; m_template.Model = 633; break; } return(m_template); }
/// <summary> /// Returns an enumeration with all mounted Relics of an realm by a specified RelicType /// </summary> /// <param name="Realm"></param> /// <param name="RelicType"></param> /// <returns></returns> public static IEnumerable getRelics(eRealm Realm, eRelicType RelicType) { ArrayList realmTypeRelics = new ArrayList(); foreach (GameRelic relic in getRelics(Realm)) { if (relic.RelicType == RelicType) { realmTypeRelics.Add(relic); } } return(realmTypeRelics); }
/// <summary> /// get relic count by realm and relictype /// </summary> /// <param name="realm"></param> /// <param name="type"></param> /// <returns></returns> public static int GetRelicCount(eRealm realm, eRelicType type) { int index = 0; lock (m_relics.SyncRoot) { foreach (GameRelic relic in m_relics.Values) { if ((relic.Realm == realm) && (relic.RelicType == type) && (relic is GameRelic)) { index++; } } } return(index); }
/// <summary> /// Loads the GameRelic from Database /// </summary> /// <param name="obj">The DBRelic-object for this relic</param> public override void LoadFromDatabase(DataObject obj) { InternalID = obj.ObjectId; m_dbRelic = obj as DBRelic; CurrentRegionID = (ushort)m_dbRelic.Region; X = m_dbRelic.X; Y = m_dbRelic.Y; Z = m_dbRelic.Z; Heading = (ushort)m_dbRelic.Heading; m_relicType = (eRelicType)m_dbRelic.relicType; Realm = (eRealm)m_dbRelic.Realm; m_originalRealm = (eRealm)m_dbRelic.OriginalRealm; m_lastRealm = (eRealm)m_dbRelic.LastRealm; //get constant values MiniTemp template = GetRelicTemplate(m_originalRealm, m_relicType); m_name = template.Name; m_model = template.Model; template = null; //set still empty fields Emblem = 0; Level = 99; //generate itemtemplate for inventoryitem ItemTemplate m_itemTemp; m_itemTemp = new ItemTemplate(); m_itemTemp.Name = Name; m_itemTemp.Object_Type = (int)eObjectType.Magical; m_itemTemp.Model = Model; m_itemTemp.IsDropable = true; m_itemTemp.IsPickable = false; m_itemTemp.Level = 99; m_itemTemp.Quality = 100; m_itemTemp.Price = 0; m_itemTemp.PackSize = 1; m_itemTemp.AllowAdd = false; m_itemTemp.Weight = 1000; m_itemTemp.Id_nb = "GameRelic"; m_itemTemp.IsTradable = false; m_itemTemp.ClassType = "DOL.GS.GameInventoryRelic"; m_item = GameInventoryItem.Create <ItemTemplate>(m_itemTemp); }
/// <summary> /// Gets the bonus modifier for a realm/relictype. /// </summary> /// <param name="realm"></param> /// <param name="type"></param> /// <returns></returns> public static double GetRelicBonusModifier(eRealm realm, eRelicType type) { double bonus = 0.0; bool owningSelf = false; //only playerrealms can get bonus foreach (GameRelic rel in getRelics(realm, type)) { if (rel.Realm == rel.OriginalRealm) { owningSelf = true; } else { bonus += ServerProperties.Properties.RELIC_OWNING_BONUS*0.01; } } // Bonus apply only if owning original relic if (owningSelf) return bonus; return 0.0; }
/// <summary> /// get relic count by realm and relictype /// </summary> /// <param name="realm"></param> /// <param name="type"></param> /// <returns></returns> public static int GetRelicCount(eRealm realm, eRelicType type) { int index = 0; lock (m_relics.SyncRoot) { foreach (GameRelic relic in m_relics.Values) { if ((relic.Realm == realm) && (relic.RelicType == type) && (relic is GameRelic)) index++; } } return index; }
/// <summary> /// Returns an enumeration with all mounted Relics of an realm by a specified RelicType /// </summary> /// <param name="Realm"></param> /// <param name="RelicType"></param> /// <returns></returns> public static IEnumerable getRelics(eRealm Realm, eRelicType RelicType) { ArrayList realmTypeRelics = new ArrayList(); foreach (GameRelic relic in getRelics(Realm)) { if (relic.RelicType == RelicType) realmTypeRelics.Add(relic); } return realmTypeRelics; }
/// <summary> /// Gets the bonus modifier for a realm/relictype. /// </summary> /// <param name="realm"></param> /// <param name="type"></param> /// <returns></returns> public static double GetRelicBonusModifier(eRealm realm, eRelicType type) { double value = 0.0; //only playerrealms can get bonus foreach (GameRelic rel in getRelics(realm, type)) { if (rel.Realm != rel.OriginalRealm) value += 0.1; } return value; }
public static MiniTemp GetRelicTemplate(eRealm Realm, eRelicType RelicType) { MiniTemp m_template = new MiniTemp(); switch (Realm) { case eRealm.Albion: if (RelicType == eRelicType.Magic) { m_template.Name = "Merlins Staff"; m_template.Model = 630; } else { m_template.Name = "Scabbard of Excalibur"; m_template.Model = 631; } break; case eRealm.Midgard: if (RelicType == eRelicType.Magic) { m_template.Name = "Horn of Valhalla"; m_template.Model = 635; } else { m_template.Name = "Thors Hammer"; m_template.Model = 634; } break; case eRealm.Hibernia: if (RelicType == eRelicType.Magic) { m_template.Name = "Cauldron of Dagda"; m_template.Model = 632; } else { m_template.Name = " Lughs Spear of Lightning"; m_template.Model = 633; } break; default: m_template.Name = "Unkown Relic"; m_template.Model = 633; break; } return m_template; }
/// <summary> /// Loads the GameRelic from Database /// </summary> /// <param name="obj">The DBRelic-object for this relic</param> public override void LoadFromDatabase(DataObject obj) { InternalID = obj.ObjectId; m_dbRelic = obj as DBRelic; CurrentRegionID = (ushort)m_dbRelic.Region; X = m_dbRelic.X; Y = m_dbRelic.Y; Z = m_dbRelic.Z; Heading = (ushort)m_dbRelic.Heading; m_relicType = (eRelicType)m_dbRelic.relicType; Realm = (eRealm)m_dbRelic.Realm; m_originalRealm = (eRealm)m_dbRelic.OriginalRealm; m_lastRealm = (eRealm)m_dbRelic.LastRealm; //get constant values MiniTemp template = GetRelicTemplate(m_originalRealm, m_relicType); m_name = template.Name; m_model = template.Model; template = null; //set still empty fields Emblem = 0; Level = 99; //generate itemtemplate for inventoryitem ItemTemplate m_itemTemp; m_itemTemp = new ItemTemplate(); m_itemTemp.Name = Name; m_itemTemp.Object_Type = (int)eObjectType.Magical; m_itemTemp.Model = Model; m_itemTemp.IsDropable = true; m_itemTemp.IsPickable = false; m_itemTemp.Level = 99; m_itemTemp.Quality = 100; m_itemTemp.Price = 0; m_itemTemp.PackSize = 1; m_itemTemp.AllowAdd = false; m_itemTemp.Weight = 1000; m_itemTemp.Id_nb = "GameRelic"; m_itemTemp.IsTradable = false; m_itemTemp.ClassType = "DOL.GS.GameInventoryRelic"; m_item = GameInventoryItem.Create<ItemTemplate>(m_itemTemp); }