private static void CSSCast_OnCommand(CommandEventArgs e) { if (e.Length == 1) { if (!CentralMemory.Running || !CSS.Running) { e.Mobile.SendMessage("The Central Memory is not running. This command is disabled."); return; } if (!Multis.DesignContext.Check(e.Mobile)) { e.Mobile.SendMessage("You cannot cast while customizing!"); return; } CastCommandsModule module = (CastCommandsModule)CentralMemory.GetModule(e.Mobile.Serial, typeof(CastCommandsModule)); if (module == null) { e.Mobile.SendMessage("You do not have any commands to cast stored."); return; } CastInfo info = module.Get(e.GetString(0)); if (info == null) { e.Mobile.SendMessage("You have not assigned that command to any spells."); return; } if (SpellRestrictions.UseRestrictions && !SpellRestrictions.CheckRestrictions(e.Mobile, info.SpellType)) { e.Mobile.SendMessage("You are not allowed to cast this spell."); return; } if (!CSpellbook.MobileHasSpell(e.Mobile, info.School, info.SpellType)) { e.Mobile.SendMessage("You do not have this spell."); return; } Spell spell = SpellInfoRegistry.NewSpell(info.SpellType, info.School, e.Mobile, null); if (spell != null) { spell.Cast(); } else { e.Mobile.SendMessage("This spell has been disabled."); } } else { e.Mobile.SendMessage("Format: Cast <text>"); } }
public static LevelableModule GetAttached(Serial serial, Type levelable) { if (!CentralMemory.Contains(serial)) { AttachLevelables(serial); } return(CentralMemory.GetModule(serial, levelable) as LevelableModule); }
public override TimeSpan GetNextBulkOrder(Mobile from) { BODModule bod_mod = (BODModule)CentralMemory.GetModule(from.Serial, typeof(BODModule)); if (bod_mod != null && from != null) { return(bod_mod.NextCarpenterBulkOrder); } //if ( from is PlayerMobile ) // return ((PlayerMobile)from).NextCarpenterBulkOrder; return(TimeSpan.Zero); }
private static void EventSink_Login(LoginEventArgs args) { if (!CentralMemory.Running || !CSS.Running) { return; } Mobile m = args.Mobile; IconsModule im = (IconsModule)CentralMemory.GetModule(m.Serial, typeof(IconsModule)); if (im == null) { return; } IconsModule imRemove = new IconsModule(m.Serial); foreach (KeyValuePair <Type, IconInfo> kvp in im.Icons) { IconInfo ii = kvp.Value; if (ii == null) { imRemove.Add(ii); continue; } if (ii.SpellType == null || ii.School == School.Invalid) { imRemove.Add(ii); continue; } if (SpellRestrictions.UseRestrictions && !SpellRestrictions.CheckRestrictions(m, ii.School)) { imRemove.Add(ii); continue; } m.SendGump(new SpellIconGump(ii)); } if (im.Icons.Count > 0) { CentralMemory.AppendModule(m.Serial, (Module)imRemove, true); } }
public override Item CreateBulkOrder(Mobile from, bool fromContextMenu) { PlayerMobile pm = from as PlayerMobile; BODModule bod_mod = (BODModule)CentralMemory.GetModule(from.Serial, typeof(BODModule)); if (bod_mod == null && from == null) { return(null); } if (bod_mod != null && bod_mod.NextCarpenterBulkOrder == TimeSpan.Zero && (fromContextMenu || 0.2 > Utility.RandomDouble())) { double theirSkill = pm.Skills[SkillName.Carpentry].Base; if (theirSkill >= 70.1) { bod_mod.NextCarpenterBulkOrder = TimeSpan.FromHours(3.0); } else if (theirSkill >= 50.1) { bod_mod.NextCarpenterBulkOrder = TimeSpan.FromHours(2.0); } else { bod_mod.NextCarpenterBulkOrder = TimeSpan.FromHours(1.0); } if (theirSkill >= 70.1 && ((theirSkill - 40.0) / 300.0) > Utility.RandomDouble()) { return(new LargeCarpenterBOD()); } return(SmallCarpenterBOD.CreateRandomFor(from)); } else { CentralMemory.AppendModule(from.Serial, new BODModule(from.Serial), true); from.SendMessage("Please try again"); } return(null); }
/** * Recupera o modulo de HabilidadeRacial */ private RacaModule getRacaModule() { RacaModule tm = (RacaModule)CentralMemory.GetModule(jogador.Serial, typeof(RacaModule)); return(tm); }
/** * Recupera o modulo de talento */ private MorteModule getMorteModule() { MorteModule tm = (MorteModule)CentralMemory.GetModule(jogador.Serial, typeof(MorteModule)); return(tm); }
/** * Recupera o modulo de HabilidadeRacial */ private TalentoModule getTalentoModule() { TalentoModule tm = (TalentoModule)CentralMemory.GetModule(jogador.Serial, typeof(TalentoModule)); return(tm); }
/** * Recupera o modulo de talento */ private ClasseModule getClasseModule() { ClasseModule tm = (ClasseModule)CentralMemory.GetModule(jogador.Serial, typeof(ClasseModule)); return(tm); }
public ScrollGump(CSpellbook book, CSpellInfo info, string textHue, Mobile sender) : base(485, 175) { if (info == null || book == null || !CSS.Running) { return; } m_Info = info; m_Book = book; m_TextHue = textHue; m_CastInfo = new CastInfo(info.Type, info.School); Closable = true; Disposable = true; Dragable = true; Resizable = false; AddPage(0); AddBackground(0, 0, 200, 265, 9380); if (info.Name != null) { AddHtml(30, 3, 140, 20, String.Format("<basefont color=#{0}><center>{1}</center></font>", textHue, info.Name), false, false); } AddButton(30, 40, info.Icon, info.Icon, 3, GumpButtonType.Reply, 0); AddButton(90, 40, 2331, 2338, 1, GumpButtonType.Reply, 0); //Cast AddLabel(120, 38, 0, "Cast"); //AddButton( 90, 65, 2338, 2331, 2, GumpButtonType.Reply, 0 ); //Scribe //AddLabel( 120, 63, 0, "Scribe" ); //Info string InfoString = ""; if (info.Desc != null) { InfoString += String.Format("<basefont color=black>{0}</font><br><br>", info.Desc); } if (info.Regs != null) { string[] Regs = info.Regs.Split(';'); InfoString += String.Format("<basefont color=black>Reagents :</font><br><basefont color=#{0}>", textHue); foreach (string r in Regs) { InfoString += String.Format("-{0}<br>", r.TrimStart()); } InfoString += "</font><br>"; } if (info.Info != null) { string[] Info = info.Info.Split(';'); InfoString += String.Format("<basefont color=#{0}>", textHue); foreach (string s in Info) { InfoString += String.Format("{0}<br>", s.TrimStart()); } InfoString += "</font><br>"; } AddHtml(30, 95, 140, 130, InfoString, false, true); //End Info #region CastInfo if (CentralMemory.Running) { m_CastCommandModule = (CastCommandsModule)CentralMemory.GetModule(sender.Serial, typeof(CastCommandsModule)); AddLabel(25, 242, 0, "Key :"); if (m_CastCommandModule == null) { AddTextEntry(70, 242, 100, 20, 0, 5, ""); //Key } else { AddTextEntry(70, 242, 100, 20, 0, 5, m_CastCommandModule.GetCommandForInfo(m_CastInfo)); //Key } AddButton(175, 247, 2103, 2104, 4, GumpButtonType.Reply, 0); //KeyButton } #endregion //CastInfo }