protected override void OnTarget(Mobile from, object o) { IPoint3D p = o as IPoint3D; if (o is Mobile) { mob.SendMessage("You can't plant that on a creature!"); } else if (o is Item && o is TAVFarmSpawn) { if (cropdel) { TAVFarmSpawn FarmCrop = (TAVFarmSpawn)o; if (FarmCrop.Farmer == mob) { FarmCrop.Delete(); } else { mob.SendMessage("That is not your crop!"); } } else { mob.SendMessage("You can't plant on top of another crop!"); } } else if (!cropdel) { TAVFarmSpawn plantit = new TAVFarmSpawn(pick, mob); plantit.MoveToWorld(new Point3D(p.X, p.Y, p.Z), mob.Map); TeiravonMobile tm = (TeiravonMobile)mob; tm.FarmCrops += 1; } }
public override bool OnEquip(Mobile from) { bool ok = base.OnEquip(from); if (!ok) { return(false); } TeiravonMobile mob = from as TeiravonMobile; if (mob != null) { if (m_Name != null) { mob.NameMod = m_Name; } if (m_Title != null) { m_OldTitle = mob.Title; mob.Title = m_Title; } } return(true); }
public override void AlterLightLevel(Mobile m, ref int global, ref int personal) { if (Dungeon) { if (m is TeiravonMobile) { TeiravonMobile tm = (TeiravonMobile)m; if (tm.IsDrow() || tm.IsDwarf() || tm.IsGnome() || tm.AccessLevel > AccessLevel.Player) { global = LightCycle.DayLevel; } else if (tm.IsElf() || tm.IsOrc() || tm.IsGoblin()) { global = LightCycle.DungeonLevel / 2; } else { global = LightCycle.DungeonLevel; } } } base.AlterLightLevel(m, ref global, ref personal); }
public override bool CanEquip(Mobile m) { if (m is TeiravonMobile) { TeiravonMobile m_Player = (TeiravonMobile)m; if ((m_Player.IsOrc() || m_Player.IsGoblin())) { if (m.Hair != null) { (m.Hair).Delete(); } if (m.Beard != null) { (m.Beard).Delete(); } return(true); } } if (!base.CanEquip(m)) { return(false); } return(false); }
private void Mirage() { TeiravonMobile caster = (TeiravonMobile)this.ControlMaster; if (caster == null) { caster = (TeiravonMobile)this.SummonMaster; } if (caster == null) { return; } if (!caster.Warmode) { return; } MirrorImage.AddClone(caster); caster.FixedParticles(0x376A, 1, 14, 0x13B5, EffectLayer.Waist); caster.PlaySound(0x594); new Clone(caster).MoveToWorld(caster.Location, caster.Map); return; }
protected override void OnTarget(Mobile from, object targ) { TeiravonMobile m_player = (TeiravonMobile)from; if (targ is Mobile) { if (!(targ is TeiravonMobile)) { Mobile m_targ = (Mobile)targ; Timer m_EffectTimer = new EffectTimer(m_player, m_targ, phys, fire, nrgy, cold, pois, 0, 1 + (int)(m_player.PlayerLevel / 3), DateTime.Now + TimeSpan.FromSeconds(0.25)); m_EffectTimer.Start(); m_player.Mana -= 5 + (5 * (int)(m_player.PlayerLevel / 3)); } else { TeiravonMobile pctarg = (TeiravonMobile)targ; if (pctarg.ShadowShotReady) { m_player.SendMessage("This spell is already active on that target!"); } else { Timer m_EffectTimer = new EffectTimer(m_player, pctarg, phys, fire, nrgy, cold, pois, 0, 1 + (int)(m_player.PlayerLevel / 3), DateTime.Now + TimeSpan.FromSeconds(0.25)); m_EffectTimer.Start(); m_player.Mana -= 5 + (5 * (int)(m_player.PlayerLevel / 3)); pctarg.ShadowShotReady = true; //using shadowshotready to show spell active on target } } } else { from.SendMessage("Only Mobiles may be targeted"); } }
private static void MageSpell2_OnCommand(CommandEventArgs e) { TeiravonMobile m_Player = (TeiravonMobile)e.Mobile; if (m_Player.IsMage() && !m_Player.IsNecromancer()) { if (m_Player.Paralyzed || m_Player.Frozen) { m_Player.SendMessage("You cannot cast a spell while frozen."); } else { if (m_Player.Mana >= 5 + (5 * (int)(m_Player.PlayerLevel / 3))) { m_Player.Target = new MageSpell2Target(m_Player); } else { m_Player.SendMessage("You must have {0} mana to cast this!", 5 + (5 * (int)(m_Player.PlayerLevel / 3))); } } } else { m_Player.SendMessage("Only Elemental Mages can use this command"); } }
public override void OnDoubleClick(Mobile from) { if (from is TeiravonMobile) { TeiravonMobile m_Player = (TeiravonMobile)from; if (m_Player.IsShifted() && m_Player.Shapeshifted) { m_Player.SendMessage("You cannot apply bandages while shapeshifted."); return; } } if (from.InRange(GetWorldLocation(), Core.AOS ? 2 : 1)) { from.RevealingAction(); from.SendLocalizedMessage(500948); // Who will you use the bandages on? from.Target = new InternalTarget(this); } else { from.SendLocalizedMessage(500295); // You are too far away to do that. } }
public EffectTimer(TeiravonMobile from, int runcount, int maxcount, DateTime end) : base(end - DateTime.Now) { m_Summoner = from; Priority = TimerPriority.OneSecond; RunCount = runcount; MaxCount = maxcount; }
public MageGemTarget(Item mgem, TeiravonMobile from) : base(-1, false, TargetFlags.None) { m_Player = from; m_MGem = (MageStaffGem)mgem; if (from.IsAquamancer()) { MageClass = 1; } else if (from.IsAeromancer()) { MageClass = 2; } else if (from.IsPyromancer()) { MageClass = 3; } else if (from.IsNecromancer()) { MageClass = 4; } else if (from.IsGeomancer()) { MageClass = 5; } }
public override void OnChop(Mobile from) { if (from is TeiravonMobile) { TeiravonMobile player = (TeiravonMobile)from; Item[] wep = player.Backpack.FindItemsByType(typeof(DwarvenBallista), true); Item wepn = null; for (int i = 0; i < wep.Length; i++) { wepn = wep[i]; } if (wepn != null) { Timer timer = new TakeDownTimer(from, this, wepn); timer.Start(); } else { Timer timer = new DestroyTimer(from, this); timer.Start(); } } }
public static void GetValues(TeiravonMobile grabber, TeiravonMobile grabbed, out int grabvalue, out int defendvalue) { // Less than 1/4 life left or 1/2 stam left = subdued = no resistance if (!grabbed.Guard || grabbed.Hits <= (int)(grabbed.HitsMax * 0.25) || grabbed.Stam <= (int)(grabbed.StamMax * 0.25) || grabbed.FindItemOnLayer(Layer.TwoHanded) is Manacles) { defendvalue = 0; } else { defendvalue = grabbed.Str + grabbed.Dex + Utility.RandomMinMax(1, 10); } // No resistance = minimal cost to grab if (defendvalue == 0 || !grabbed.Guard) { grabvalue = 100; } else if (grabber.Stam <= 5) { grabvalue = 0; } else { grabvalue = grabber.Str + grabber.Stam + Utility.RandomMinMax(1, 10); } if (grabber.AccessLevel >= AccessLevel.GameMaster) { grabber.SendMessage("defendvalue: {0}, grabvalue: {1}", defendvalue, grabvalue); } }
public static void GrabRelease_OnCallback(object state) { TeiravonMobile grabbed = ( TeiravonMobile )state; grabbed.Blessed = false; grabbed.Frozen = false; }
public override void OnAdded(object parent) { base.OnAdded(parent); if (parent != null && parent is Container) { // find the parent of the container // note, the only valid additions are to the player pack. Anything else is invalid. This is to avoid exploits involving storage or transfer of questtokens object from = ((Container)parent).Parent; // check to see if it can be added if (from != null && from is TeiravonMobile) { TeiravonMobile owner = from as TeiravonMobile; if (owner.PlayerLevel < 20) { int exp = (250 * 1000); Misc.Titles.AwardExp(owner, exp); owner.SendMessage("You have gained {0}) experience", exp); Delete(); return; } } } }
protected override void OnTarget(Mobile from, object targ) { TeiravonMobile m_player = (TeiravonMobile)from; if (targ is Mobile) { Mobile m_targ = (Mobile)targ; if (m_targ.InRange(m_player.Location, 1)) { damage = Utility.RandomMinMax(1, 10) + ((int)(m_player.PlayerLevel) * 2); m_targ.FixedEffect(0x37B9, 244, 25); //AOS.Damage(m_targ, m_player, damage, phys, fire, cold, pois, nrgy); SpellHelper.Damage(TimeSpan.Zero, m_targ, m_player, damage, phys, fire, cold, pois, nrgy); m_player.Mana -= 30; TAVMageSpellCommands.AddMGSPA(m_player); } else { m_player.SendMessage("That is too far away"); } } else { from.SendMessage("Only Mobiles may be targeted"); } }
public NecromancerSummonTimer(TeiravonMobile from, BaseCreature creature, Item pentagram, DateTime end, Timer effecttimer) : base(end - DateTime.Now) { m_Summoner = from; m_Creature = creature; m_Pentagram = pentagram; m_EffectTimer = effecttimer; }
private static void MageSpell1_OnCommand(CommandEventArgs e) { TeiravonMobile m_Player = (TeiravonMobile)e.Mobile; if (!MGSPA.Contains(m_Player)) { if (m_Player.IsMage() && !m_Player.IsNecromancer()) { if (m_Player.Paralyzed || m_Player.Frozen) { m_Player.SendMessage("You cannot cast a spell while frozen."); } else { if (m_Player.Mana >= 30) { m_Player.Target = new MageSpell1Target(m_Player); } else { m_Player.SendMessage("You must have 30 mana to cast this!"); } } } else { m_Player.SendMessage("Only Elemental Mages can use this command"); } } else { m_Player.SendMessage("You must wait before using this abilitiy again."); } }
public override void OnAdd(Mobile from) { Party p = Party.Get(from); if (p != null && p.Leader != from) { from.SendLocalizedMessage(1005453); // You may only add members to the party if you are the leader. } else if (p != null && (p.Members.Count + p.Candidates.Count) >= Party.Capacity) { from.SendLocalizedMessage(1008095); // You may only have 10 in your party (this includes candidates). } else if (from is TeiravonMobile) { TeiravonMobile tm = (TeiravonMobile)from; if (tm.TeachSkill < 999) { from.SendMessage("You cannot party non students while teaching!"); } else { from.Target = new AddPartyTarget(from); } } else { from.Target = new AddPartyTarget(from); } }
protected override void OnTick() { int damage = Utility.RandomMinMax(10, 15 + (int)(m_from.PlayerLevel / 4)); m_from.MovingParticles(m_targ, 0x36E4, 5, 0, false, false, 3006, 4006, 0); m_from.PlaySound(0x1E5); SpellHelper.Damage(TimeSpan.Zero, m_targ, m_from, damage, d_ph, d_fi, d_co, d_po, d_en); if (!m_from.CanSee(m_targ) || !m_from.InLOS(m_targ)) { RunCount = MaxCount; } if (!m_targ.Alive) { RunCount = MaxCount; } if (RunCount == MaxCount) { if (m_targ is TeiravonMobile) { TeiravonMobile pctarg = (TeiravonMobile)m_targ; pctarg.ShadowShotReady = false; } } if (RunCount < MaxCount && m_from.Alive) { RunCount++; Timer m_EffectTimer = new EffectTimer(m_from, m_targ, d_ph, d_fi, d_en, d_co, d_po, RunCount, MaxCount, DateTime.Now + TimeSpan.FromSeconds(0.25)); m_EffectTimer.Start(); } }
private void CurseThem(Mobile from, Mobile targ) { TeiravonMobile m_Curse = targ as TeiravonMobile; if (m_Curse == null) { from.SendMessage("Target is not a Teiravonmobile!"); return; } for (int i = 0; i < SavedInformation.Count; i++) { if (m_Curse.Name.ToLower() == (((SavedPlayer)SavedInformation[i]).GetName()).ToLower()) { m_Found = true; } } if (m_Found) { from.SendMessage(m_Curse.Name + "'s playerdata was found in the stone. Proceeding."); from.SendMessage(m_Curse.Name + " has been cursed."); Curse(m_Curse); } else { m_Stone.SaveThis(from, m_Curse); from.SendMessage("Backing up the information of {0} the stone.", m_Curse.Name); from.SendMessage(m_Curse.Name + " has been cursed."); Curse(m_Curse); } }
protected override void OnTick() { m_iCount++; m_From.DisruptiveAction(); if (m_iCount < m_iCountMax) { m_CraftSystem.PlayCraftEffect(m_From); if (m_From.Body.Type == BodyType.Human && !m_From.Mounted) { m_From.Animate(9, 5, 1, true, false, 0); } } else { m_From.EndAction(typeof(CraftSystem)); CheckGain(); if (m_From is TeiravonMobile) { TeiravonMobile tav = m_From as TeiravonMobile; bool polish = Utility.RandomBool(); tav.NeedPolish = polish; string message = polish ? ("It could use more Polishing") : ("It could use more Finishing"); tav.SendGump(new CraftGump(tav, m_CraftSystem, m_Tool, message)); } } }
public SavedPlayer(Mobile targ) : base(0x186A) { TeiravonMobile m_Player = (TeiravonMobile)targ; PlayerName = (string)m_Player.Name; Exp = m_Player.PlayerExp; Str = m_Player.RawStr; Hits = m_Player.MaxHits; Dex = m_Player.RawDex; Stam = m_Player.MaxStam; Int = m_Player.RawInt; Mana = m_Player.MaxMana; m_Class = (int)m_Player.PlayerClass; m_Race = (int)m_Player.PlayerRace; m_Title = m_Player.Title; for (int i = 0; i < 51; i++) { m_Skills[i] = m_Player.Skills[i].Base; } Name = String.Format("Saved Player: {0}", PlayerName); Movable = false; Point3D p = new Point3D(1, 1, 0); MoveToWorld(p, Map.Felucca); }
public override void Drink(Mobile from) { TeiravonMobile m_Player = (TeiravonMobile)from; if (m_Player.CanDrink(PEffect) && (m_Player.Body == 0x190 || m_Player.Body == 0x191)) { m_Player.SendMessage("You feel a little strange..."); if (m_Player.Body == 0x190) { m_Player.BodyMod = 0x191; } else { m_Player.BodyMod = 0x190; } } else { m_Player.SendMessage("It has no effect."); m_Player.RevealingAction(); m_Player.PlaySound(0x2D6); m_Player.AddToBackpack(new Bottle()); this.Consume(); return; } base.Drink(from); }
private static void Teach_OnCommand(CommandEventArgs e) { TeiravonMobile m_Player = (TeiravonMobile)e.Mobile; Party p = Server.Engines.PartySystem.Party.Get(m_Player); if (p != null && m_Player.TeachSkill == 999) { m_Player.SendMessage("You must quit your current party in order to teach!"); } else if (m_Player.TeachingSkill == 0) { m_Player.SendMessage("You do not have enough teaching skill to teach!"); } else if (DateTime.Now < m_Player.NextTeach) { m_Player.SendMessage("It is too soon teach again!"); } else if (p == null && m_Player.TeachSkill == 999) { m_Player.SendGump(new TeachSkillGump(m_Player, m_Player.TeachingSkill)); } else if (p != null && m_Player.TeachSkill < 999) { m_Player.Target = new AddStudentTarget(m_Player); } else if (p == null && m_Player.TeachSkill < 999) { m_Player.TeachSkill = 999; } }
public override void OnDoubleClick(Mobile from) { //STARTMOD: Teiravon if (!from.CanBeginAction(typeof(BattleNet))) { from.SendMessage("You cannot do this yet."); } if (from is TeiravonMobile) { TeiravonMobile m_Player = (TeiravonMobile)from; if ((m_Player.IsShapeshifter() || m_Player.IsForester()) && (m_Player.Shapeshifted || m_Player.IsShifted())) { m_Player.SendMessage("You cannot use nets while shapeshifted."); return; } } if (IsChildOf(from.Backpack)) { from.SendMessage("Who is your target?"); from.BeginTarget(-1, true, TargetFlags.None, new TargetCallback(OnTarget)); } else { from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it. } }
public EleTransformTimer(TeiravonMobile from, int body, int strb, int dexb, int ph, int fi, int co, int po, int en, TimeSpan statdur, DateTime end) : base(end - DateTime.Now) { m_player = from; m_EleBody = body; m_StrBon = strb; m_DexBon = dexb; m_PhysAdj = ph; m_FireAdj = fi; m_ColdAdj = co; m_PoisAdj = po; m_EnerAdj = en; m_StatDur = statdur; m_player.OBody = m_EleBody; SpellHelper.AddStatBonus(m_player, m_player, StatType.Str, m_StrBon, m_StatDur); SpellHelper.AddStatBonus(m_player, m_player, StatType.Dex, m_DexBon, m_StatDur); mods.Add(new ResistanceMod(ResistanceType.Physical, m_PhysAdj)); mods.Add(new ResistanceMod(ResistanceType.Fire, m_FireAdj)); mods.Add(new ResistanceMod(ResistanceType.Cold, m_ColdAdj)); mods.Add(new ResistanceMod(ResistanceType.Poison, m_PoisAdj)); mods.Add(new ResistanceMod(ResistanceType.Energy, m_EnerAdj)); for (int i = 0; i < mods.Count; ++i) { m_player.AddResistanceMod((ResistanceMod)mods[i]); } }
public override void OnRemoved(object parent) { TeiravonMobile mob = parent as TeiravonMobile; if (mob != null) { if (m_Name != null) { mob.NameMod = null; } if (m_Title != null && m_OldTitle != null) { mob.Title = m_OldTitle; } else if (m_Title != null && m_OldTitle == null) { mob.Title = "the " + mob.PlayerRace.ToString(); } m_OldTitle = null; } base.OnRemoved(parent); }
private static void MageSpell4_OnCommand(CommandEventArgs e) { TeiravonMobile m_Player = (TeiravonMobile)e.Mobile; if (m_Player.IsMage() && !m_Player.IsNecromancer()) { if (m_Player.Paralyzed || m_Player.Frozen) { m_Player.SendMessage("You cannot cast a spell while frozen."); } else { if (m_Player.Mana >= 125) { MageAOEEffect(m_Player); } else { m_Player.SendMessage("You must have 125 mana to cast this!"); } } } else { m_Player.SendMessage("Only Elemental Mages can use this command"); } }
private void Pound() { TeiravonMobile caster = this.ControlMaster as TeiravonMobile; int poundtimes = 2 + Utility.Random(3); if (caster == null) { caster = this.SummonMaster as TeiravonMobile; } if (caster == null) { return; } if (!caster.Warmode) { return; } this.PublicOverheadMessage(MessageType.Regular, 0x2E, false, "*You see " + this.Name + " start to slam the ground."); this.Animate(9, 5, 4, true, false, 0); this.PlaySound(0x2F3); this.Paralyze(TimeSpan.FromSeconds(2.5)); PoundAoE(); Timer m_Timer = new TremorTimer(caster, 1, poundtimes, (DateTime.Now + TimeSpan.FromSeconds(0.5))); m_Timer.Start(); return; }
public override void OnClick(bool rightClick) { if (rightClick) { m_From = null; Stop(); } if (m_From is TeiravonMobile) { TeiravonMobile m_Tracker = (TeiravonMobile)m_From; if (m_Tracker.HasFeat(TeiravonMobile.Feats.AdvancedTracking) && m_From != m_Target) { if (m_Tracker.PlayerLevel < 5) { m_Tracker.SendMessage("You figure they have about {0} hitpoints left...", m_Target.Hits); } else if (m_Tracker.PlayerLevel < 10) { m_Tracker.SendMessage("You figure they have about {0} hitpoints and {1} stamina left...", m_Target.Hits, m_Target.Stam); } else if (m_Tracker.PlayerLevel < 15) { m_Tracker.SendMessage("You figure they have about {0} hitpoints, {1} stamina, and {2} mana left...", m_Target.Hits, m_Target.Stam, m_Target.Mana); } else if (m_Tracker.PlayerLevel >= 15) { m_Tracker.SendMessage("They have {0}/{1} hits, {2}/{3} stamina, and {4}/{5} mana left.", m_Target.Hits, m_Target.HitsMax, m_Target.Stam, m_Target.StamMax, m_Target.Mana, m_Target.ManaMax); } } } }