public AnkhPendantBonusContext(Mobile from, VirtueType type) { m_Mobile = from; m_Type = type; m_Random = -1; m_Expires = DateTime.UtcNow + TimeSpan.FromMinutes(60); switch (type) { case VirtueType.Honesty: case VirtueType.Compassion: case VirtueType.Valor: break; case VirtueType.Humility: m_Random = Utility.Random(3); break; case VirtueType.Justice: case VirtueType.Sacrafice: case VirtueType.Honor: m_DoBump = Utility.RandomBool(); break; case VirtueType.Spirituality: m_DoBump = 0.25 > Utility.RandomDouble(); m_DoBump2 = 0.25 > Utility.RandomDouble(); m_DoBump3 = 0.25 > Utility.RandomDouble(); break; } }
private static void ApplyBonus(VirtueType t, Mobile from) { m_Table[from] = new AnkhPendantBonusContext(from, t); from.Delta(MobileDelta.WeaponDamage); from.SendLocalizedMessage(1079546, string.Format("#{0}", GetCliloc(t))); }
public ShadowguardCypress(ShadowguardEncounter encounter, VirtueType type) : base(Utility.RandomList(3320, 3323, 3326, 3329)) { VirtueType = type; Encounter = encounter; Foilage = new ShadowguardCypressFoilage(Utility.RandomMinMax(this.ItemID + 1, this.ItemID + 2), this); Movable = false; }
// 0xD96, 0xD9A, public ShadowguardCypress(OrchardEncounter encounter, VirtueType type) : base(3329) { VirtueType = type; Encounter = encounter; Foilage = new ShadowguardCypressFoilage(Utility.RandomBool() ? 0xD96 : 0xD9A, this); Movable = false; }
public static void EventSink_Speech(SpeechEventArgs e) { Mobile from = e.Mobile; Item ankh = from.FindItemOnLayer(Layer.Neck); if (!(ankh is AnkhPendant)) { return; } string str = e.Speech.ToLower(); VirtueType t = VirtueType.None; if (str == "ahm") { t = VirtueType.Honesty; } else if (str == "mu") { t = VirtueType.Compassion; } else if (str == "ra") { t = VirtueType.Valor; } else if (str == "beh") { t = VirtueType.Justice; } else if (str == "cah") { t = VirtueType.Sacrafice; } else if (str == "summ") { t = VirtueType.Honor; } else if (str == "om") { t = VirtueType.Spirituality; } else if (str == "lum") { t = VirtueType.Humility; } if (t != VirtueType.None && CheckShrine(t, from)) { ApplyBonus(t, from); } }
public static bool CheckShrine(VirtueType t, Mobile from) { Region r = from.Region; Map map = from.Map; if (r is DungeonRegion || r is TownRegion || (map != Map.Trammel && map != Map.Felucca)) { return(false); } bool atShrine = false; for (int i = 0; i < m_ShrineLocs.Length; i++) { if (m_ShrineLocs[i].Contains(new Point2D(from.X, from.Y)) && (int)t == i + 1) { atShrine = true; break; } } if (atShrine) { if (IsUnderEffects(from)) { from.SendLocalizedMessage(1079544, string.Format("#{0}", GetCliloc(m_Table[from].VType))); return(false); } if (IsWaitingCooldown(from)) { TimeSpan ts = DateTime.UtcNow - m_Cooldown[from]; if (ts.TotalHours >= 1) { from.SendLocalizedMessage(1079550, ((int)ts.TotalHours).ToString()); //You can improve your fortunes again in about ~1_TIME~ hours. } else { from.SendLocalizedMessage(1079547); //Your fortunes are about to improve. } return(false); } } return(atShrine); }
private static int GetCliloc(VirtueType t) { switch (t) { default: case VirtueType.Honesty: return(1079539); case VirtueType.Compassion: return(1079535); case VirtueType.Valor: return(1079543); case VirtueType.Justice: return(1079536); case VirtueType.Sacrafice: return(1079538); case VirtueType.Honor: return(1079540); case VirtueType.Spirituality: return(1079542); case VirtueType.Humility: return(1079541); } }
public bool IsOppositeVirtue(VirtueType type) { switch (type) { default: case VirtueType.Honesty: return(this.VirtueType == VirtueType.Deceit); case VirtueType.Compassion: return(this.VirtueType == VirtueType.Despise); case VirtueType.Valor: return(this.VirtueType == VirtueType.Destard); case VirtueType.Justice: return(this.VirtueType == VirtueType.Wrong); case VirtueType.Sacrafice: return(this.VirtueType == VirtueType.Covetous); case VirtueType.Honor: return(this.VirtueType == VirtueType.Shame); case VirtueType.Spirituality: return(this.VirtueType == VirtueType.Hythloth); case VirtueType.Humility: return(this.VirtueType == VirtueType.Pride); case VirtueType.Deceit: return(this.VirtueType == VirtueType.Honesty); case VirtueType.Despise: return(this.VirtueType == VirtueType.Compassion); case VirtueType.Destard: return(this.VirtueType == VirtueType.Valor); case VirtueType.Wrong: return(this.VirtueType == VirtueType.Justice); case VirtueType.Covetous: return(this.VirtueType == VirtueType.Sacrafice); case VirtueType.Shame: return(this.VirtueType == VirtueType.Honor); case VirtueType.Hythloth: return(this.VirtueType == VirtueType.Spirituality); case VirtueType.Pride: return(this.VirtueType == VirtueType.Humility); } }