public override void OnThink() { if (!DontCast && UsesOnThink) { if (DateTime.Now > m_LastCast) { if (SpellToCast != null) { DebugSay("Trying to cast {0}", SpellToCast); BlueSpellInfo.UseBluePower(this, SpellToCast); } m_LastCast = DateTime.Now + CastDelay; } } if (this.Target != null) { if (AI != AIType.AI_Mage /*&& AI != AIType.AI_Necromage && AI != AIType.AI_Paladin*/) { if (this.Target.Flags == TargetFlags.Harmful && Combatant != null) { this.Target.Invoke(this, Combatant); } else if (this.Target.Flags == TargetFlags.Beneficial) { this.Target.Invoke(this, this); } } } }
public override void OnResponse(NetState sender, RelayInfo info) { Mobile from = sender.Mobile; if (info.ButtonID < 100 && info.ButtonID > 0) { BlueSpellInfo.UseBluePower(from, info.ButtonID - 1); if (from.HasGump(typeof(BlueSpellsKnownGump))) { from.CloseGump(typeof(BlueSpellsKnownGump)); } from.SendGump(new BlueSpellsKnownGump(from)); } else if (info.ButtonID > 99 && info.ButtonID < (BlueSpellInfo.SPELLCOUNT + 100)) { if (from.HasGump(typeof(BlueSpellsKnownGump))) { from.CloseGump(typeof(BlueSpellsKnownGump)); } from.SendGump(new BlueSpellsKnownGump(from)); if (from.HasGump(typeof(BlueSpellInfoGump))) { from.CloseGump(typeof(BlueSpellInfoGump)); } from.SendGump(new BlueSpellInfoGump(info.ButtonID - 100)); } }
public override void OnActionCombat() { if (DateTime.Now > m_LastCast && Hits < (HitsMax / 4)) { BlueSpellInfo.UseBluePower(this, SpellToCast); m_LastCast = DateTime.Now + CastDelay; } base.OnActionCombat(); }
public BlueSpellsKnownGump(Mobile from) : base(0, 0) { m_From = from; if (!BlueMageControl.IsBlueMage(m_From)) { return; } this.Closable = true; this.Disposable = true; this.Dragable = true; this.Resizable = false; bool[] boollist = BlueMageControl.GetBoolList(m_From); int count = 0, x = 0, y = 0; List <LabelInfo> labels = new List <LabelInfo>(); for (int i = 0; i < boollist.Length; i++) { if (boollist[i]) { x = (count % 2) == 0 ? 15 : 140; y = (((count / 2) - 1) * 25) + 125; labels.Add(new LabelInfo(x, y, 1365, BlueSpellInfo.GetName(i), i)); count++; } } int knownY = labels.Count / 2 + 1; AddPage(0); AddBackground(0, 0, 190 + 80, 85, 9270); // Top layer AddBackground(0, 80, 190 + 80, (knownY * 25) + 30, 9270); // Middle Layer AddBackground(0, 85 + (knownY * 25) + 30 - 10, 190 + 80, 85, 9270); // Bottem Layer AddImage(15, 15, 11013, 1365); // Arms book AddLabel(60, 15, 1365, @"Blue Spells Known"); AddLabel(28 + 40, 85 + (knownY * 25) + 25 + 12, 1365, @"Created By Peoharen"); AddImage(75 + 40, 85 + (knownY * 25) + 25 + 32, 113, 1365); // Virtue for (int i = 0; i < labels.Count; i++) { AddButton(labels[i].X, labels[i].Y + 5, 1209, 1210, labels[i].SpellNumber + 1, GumpButtonType.Reply, 0); AddButton(labels[i].X + 20, labels[i].Y + 3, 22153, 22154, labels[i].SpellNumber + 100, GumpButtonType.Reply, 0); AddLabel(labels[i].X + 40, labels[i].Y, labels[i].Hue, labels[i].Words); } }
public BlueSpellInfoGump(int number) : base(0, 0) { this.Closable = true; this.Disposable = true; this.Dragable = true; this.Resizable = false; AddPage(0); AddBackground(0, 0, 230, 155, 9270); // Background string name = BlueSpellInfo.GetName(number); AddLabel(15, 15, 1365, name); // Spell Name AddHtml(15, 40, 200, 100, GetDescription(number), true, true); }
public static string GetDescription(int number) { Type t = BlueSpellInfo.GetSpellType(number); object[] attrs = t.GetCustomAttributes(typeof(DescriptionAttribute), true); if (attrs != null && attrs.Length > 0) { DescriptionAttribute attr = attrs[0] as DescriptionAttribute; if (attr != null) { return(attr.Description); } } return(null); }
public override void OnActionCombat() { if (!DontCast && !UsesOnThink) { if (DateTime.Now > m_LastCast) { if (SpellToCast != null) { DebugSay("Trying to cast {0}", SpellToCast.ToString()); BlueSpellInfo.UseBluePower(this, SpellToCast); } m_LastCast = DateTime.Now + CastDelay; } } base.OnActionCombat(); }
public override void OnTalk(PlayerMobile player) { if (QuestHelper.DeliveryArrived(player, this)) { return; } else if (QuestHelper.InProgress(player, this)) { return; } else if (QuestHelper.QuestLimitReached(player)) { return; } BlueSpellInfo.UpdateTitle(player); BaseQuest quest = null; if (player.Skills[SkillName.Forensics].Base < 51.0) { quest = QuestHelper.RandomQuest(player, new Type[] { typeof(BlueMageTrainingQuest) }, this); } else if (!BlueMageControl.IsBlueMage(player)) { if (!QuestHelper.InProgress(player, this)) { player.CloseGump(typeof(BlueMageQuestionsGump)); player.SendGump(new BlueMageQuestionsGump(player, this)); } else { Say("You need to seek your mark."); } } else { List <Type> types = new List <Type>(); types.Add(typeof(BlueMageTierOneSlayerQuest)); types.Add(typeof(BlueMageTierTwoSlayerQuest)); types.Add(typeof(BlueMageTierThreeSlayerQuest)); //types.Add( typeof( FindingQuinaQuest ) ); //if ( BlueSpellInfo.KnowsAllMoves( player ) ) //{ //types.Add( typeof( BattleKaysaQuest ) ); //types.Add( typeof( BattleRakdosQuest ) ); //if ( BlueSpellInfo.KnowsAllSpells( player ) ) //{ // types.Add( typeof( BattleTalimQuest ) ); //} //} //if ( BlueSpellInfo.KnowsAllSpells( player ) ) //{ //types.Add( typeof( BattleMatoQuest ) ); //types.Add( typeof( BattleMarkovQuest ) ); //} quest = QuestHelper.RandomQuest(player, types.ToArray(), this); } if (quest != null) { player.CloseGump(typeof(MondainQuestGump)); player.SendGump(new MondainQuestGump(quest)); } }
public static void BM_OnCommand(CommandEventArgs e) { if (e.Mobile.AccessLevel == AccessLevel.Counselor) { e.Mobile.SendMessage(1365, "Counselors are not allowed to use Blue Magic"); return; } else if (!BlueMageControl.IsBlueMage(e.Mobile) && e.Mobile.AccessLevel == AccessLevel.Player) { e.Mobile.SendMessage("You must be a blue mage to use this command."); return; } else if (!Multis.DesignContext.Check(e.Mobile)) { return; // They are customizing their house } string spellstring = e.GetString(0).ToLower(); if (spellstring == null || spellstring == "") { if (e.Mobile.HasGump(typeof(BlueSpellsKnownGump))) { e.Mobile.CloseGump(typeof(BlueSpellsKnownGump)); } e.Mobile.SendGump(new BlueSpellsKnownGump(e.Mobile)); } else if (spellstring == "help") { e.Mobile.SendMessage(1365, "\"[bm\" + spellname (lower or upper case, it don't matter) to cast the spell."); e.Mobile.SendMessage(1365, "\"[bm\" opens a menu listing details on the spells you know."); e.Mobile.SendMessage(1365, "\"[bm study\" Allows you to try and study a corpse to learn a blue spell [requires high forensics]"); if (e.Mobile.AccessLevel >= AccessLevel.GameMaster) { e.Mobile.SendMessage(1365, "[Seer+] \"[bm get\" allows you to target a player and get their list of spell's known."); e.Mobile.SendMessage(1365, "[Seer+] \"[bm giveitem\" Gives you most of the items a blue mage would use."); } if (e.Mobile.AccessLevel > AccessLevel.Seer) { e.Mobile.SendMessage(1365, "[Admin+] \"[bm log\" opens a gump containing the information of all registered blue mages and spells known by them."); } } else if (spellstring == "get" && e.Mobile.AccessLevel >= AccessLevel.GameMaster) { e.Mobile.SendMessage(1365, "Target a player you get their list of spells known."); e.Mobile.Target = new SpellKnownTarget(); } else if (spellstring == "log" && e.Mobile.AccessLevel > AccessLevel.Seer) { if (e.Mobile.HasGump(typeof(BlueMageLogGump))) { e.Mobile.CloseGump(typeof(BlueMageLogGump)); } e.Mobile.SendGump(new BlueMageLogGump()); } else if (spellstring == "learnall" && e.Mobile.AccessLevel > AccessLevel.GameMaster) { BlueMageControl.LearnAll(e.Mobile); e.Mobile.SendMessage(1365, "Learning all blue spells"); } else if (spellstring == "giveitems" && e.Mobile.AccessLevel > AccessLevel.GameMaster) { GiveItems(e.Mobile); e.Mobile.SendMessage(1365, "Giving Items"); } else if (spellstring == "cave" /*&& e.Mobile.AccessLevel > AccessLevel.Player*/) { e.Mobile.MoveToWorld(new Point3D(1704, 591, 9), Map.Ilshenar); } else if (spellstring == "study") { if (e.Mobile.Skills[SkillName.Forensics].Value < 100.0) { e.Mobile.SendMessage(1365, "Your Forensics isn't high enough to use this."); } else { e.Mobile.Target = new StudyTarget(); e.Mobile.SendMessage(1365, "Target the corpse of a monster you killed to study it."); } } else if (spellstring == "giveall" && e.Mobile.AccessLevel > AccessLevel.Counselor) { BlueMageControl.LearnAll(e.Mobile); e.Mobile.SendMessage(1365, "Learning all blue spells"); string prams = e.ArgString; if (prams.Contains("skills")) { if (e.Mobile.Backpack != null) { e.Mobile.Backpack.DropItem(new BlueSkillBall(-1)); } } if (prams.Contains("items")) { GiveItems(e.Mobile); } } else { int number = 100; try { number = Convert.ToInt32(spellstring); } catch {} if (number != 100) { BlueSpellInfo.UseBluePower(e.Mobile, number); } else { if (BlueSpellInfo.UseBluePower(e.Mobile, spellstring) == false) { e.Mobile.SendMessage("No such spell can be found."); } } } }