protected override void OnTick() { //m_Player.SendMessage("Start Location: {0} , Current Location: {1}", startLoc.ToString(), m_Targ.Location.ToString()); if (m_Player.Deleted || m_Targ.Deleted || chains.Deleted) { return; } else if (!m_Player.Alive || !m_Targ.Alive) { m_Player.SendMessage("Your attempt to shackle them has become pointless."); return; } else if (m_Targ.Location != startLoc) { m_Player.SendMessage("You were unable to keep your target restrained while you applied the shackles."); return; } else { m_Player.Emote("*Shackles {0}, rendering them helpless*", m_Targ.Name); m_Targ.SendMessage("You've been shackled!"); m_Targ.ClearHands(); chains.Layer = Layer.TwoHanded; chains.Movable = false; chains.m_Attempts = 0; m_Targ.EquipItem(chains); m_Targ.Send(new SpeedMode(2)); } }
public void StartEscape(Mobile from) { TeiravonMobile m = from as TeiravonMobile; m_Escape = new EscapeTimer(m, this); m_Escape.Start(); m.Emote("*Struggles against their shackles*"); }
protected override void OnTick() { if (!m_Grabber.Alive || !m_Grabbed.Alive || m_Grabber.NetState == null || m_Grabbed.NetState == null) { m_Grabber.Emote("*loses {0} hold on {1}!*", m_Grabber.Female ? "her" : "his", m_Grabbed.Name); Release(); return; } if (m_Count % 6 == 0) { int grabvalue = 0; int defendvalue = 0; GetValues(m_Grabber, m_Grabbed, out grabvalue, out defendvalue); // We have a hold on them still. if (grabvalue > defendvalue || (grabvalue == defendvalue && Utility.RandomBool())) { m_Grabber.Stam -= GetStamLoss(grabvalue - defendvalue); m_Count = 0; // We increment count later on. } // No longer have our hold else { m_Grabber.Emote("*loses {0} hold on {1}!*", m_Grabber.Female ? "her" : "his", m_Grabbed.Name); Release(); return; } } if (m_OldLocation != m_Grabber.Location) { m_Grabbed.MoveToWorld(m_Grabber.Location, m_Grabber.Map); } m_OldLocation = m_Grabber.Location; m_Count++; }
public override void Drink(Mobile from) { TeiravonMobile m_Player = (TeiravonMobile)from; if (m_Player.CanDrink(PEffect)) { m_Player.Emote("*begins to fade from view...*"); m_Timer = Timer.DelayCall(TimeSpan.FromSeconds(0.75), new TimerStateCallback(DoHide), new object[] { from }); } base.Drink(from); }
public override void Drink(Mobile from) { TeiravonMobile m_Player = (TeiravonMobile)from; if (m_Player.CanDrink(PEffect) && m_Player.CanDrink(PotionEffect.LesserFloat) && m_Player.CanDrink(PotionEffect.Float) && m_Player.InLOS(new Point3D(m_Player.X, m_Player.Y, m_Player.Z + 30))) { m_Player.Z += 5; m_Player.CantWalk = true; m_Player.Emote("*begin to hover off the ground!*"); } base.Drink(from); }
protected override void OnTarget(Mobile from, object targ) { if (targ is BaseCreature) { bool summoned = false; m_Creature = (BaseCreature)targ; Type[] m_Summoned = new Type[] { typeof(Skeleton), typeof(SkeletalKnight), typeof(Mummy), typeof(Zombie), typeof(SkeletalDragon), typeof(Wraith), typeof(ChaosDaemon), typeof(BoneDemon) }; if (m_Creature.Controled && m_Creature.ControlMaster == m_Player) { for (int i = 0; i < m_Summoned.Length; i++) { if (m_Summoned[i] == m_Creature.GetType()) { summoned = true; break; } } if (summoned) { m_Player.SendMessage("You send the creature back to the netherworld!"); m_Player.Emote("*You see {0} send the {1} back to the netherworld*", m_Player.Name, m_Creature.Name); m_Creature.Delete(); } else { m_Player.SendMessage("That is not a creature from the netherworld."); } } else { m_Player.SendMessage("You don't have power over that creature."); } } else { m_Player.SendMessage("You can only dismiss summoned creatures."); } }
protected override void OnTarget(Mobile from, object targ) { if (!(targ is TeiravonMobile)) { from.SendMessage("You can only splint that!"); } else { m_player = (TeiravonMobile)from; m_targ = (TeiravonMobile)targ; if (m_targ == m_player) { m_player.SendMessage("You cannot splint yourself!"); } else if (!m_targ.Alive) { m_player.SendMessage("That person is not alive!"); } else if (!(m_player.InRange(m_targ.Location, 2))) { m_player.SendMessage("You are too far away"); } else { Container pack = m_player.Backpack; if (pack != null) { BaseWeapon wpn = (BaseWeapon)m_player.Weapon; pack.DropItem(wpn); } BaseWeapon.BlockEquip(m_player, TimeSpan.FromSeconds(6.0)); int healmin = (int)((m_player.Skills.Healing.Value + m_player.Skills.Anatomy.Value) / 3); int healmax = (int)((m_player.Skills.Healing.Value + m_player.Skills.Anatomy.Value) / 2); int healamt = Utility.RandomMinMax(healmin, healmax); m_player.Emote("Begins splinting {0}", m_targ.Name); m_timer = new InternalTimer(m_player, m_targ, healamt, splint); m_timer.Start(); } } }
protected override void OnTick() { try { TeiravonMobile m_Player = (TeiravonMobile)World.FindMobile((Serial)m_PlayerSerial); Item m_TimerHelper = World.FindItem((Serial)m_HelperSerial); if (m_Player == null) { return; } if (m_TimerHelper == null) { return; } if (m_Stats) { m_Player.Str += m_StrMod; m_Player.Dex += m_DexMod; m_Player.Int += m_IntMod; m_Player.MaxMana += m_ManaMaxMod; m_Player.MaxStam += m_StamMaxMod; m_Player.MaxHits += m_HitsMaxMod; } if (m_Skills) { for (int i = 0; i <= 51; i++) { m_Player.Skills[i].Base += m_SkillMods[i]; } } if (m_Feat) { m_Player.SetActiveFeats(m_FeatMod, false); m_Player.CheckResistanceBonus(); } if (m_MessageOn) { m_Player.SendMessage(m_Message); } if (m_EmoteOn) { m_Player.Emote(m_Emote); } if (m_TimerHelper != null && m_TimerHelper is TimerHelper) { m_TimerHelper.Delete(); } if (m_PotionOn) { switch (m_PotionEffect) { case PotionEffect.Chameleon: m_Player.SolidHueOverride = -1; m_Player.SetActivePotions(Server.Items.PotionEffect.Chameleon, false); break; case PotionEffect.Float: case PotionEffect.GreaterFloat: case PotionEffect.LesserFloat: if (m_PotionEffect == PotionEffect.LesserFloat) { m_Player.Z -= 5; } else if (m_PotionEffect == PotionEffect.Float) { m_Player.Z -= 10; } else if (m_PotionEffect == PotionEffect.GreaterFloat) { m_Player.Z -= 15; } m_Player.CantWalk = false; m_Player.SetActivePotions(Server.Items.PotionEffect.LesserFloat, false); m_Player.SetActivePotions(Server.Items.PotionEffect.Float, false); m_Player.SetActivePotions(Server.Items.PotionEffect.GreaterFloat, false); m_Player.Emote("*fall down with a thud!*"); break; case PotionEffect.Sustenance: m_Player.SetActivePotions(Server.Items.PotionEffect.Sustenance, false); break; case PotionEffect.GreaterSustenance: m_Player.SetActivePotions(Server.Items.PotionEffect.GreaterSustenance, false); break; case PotionEffect.GenderSwap: m_Player.BodyMod = 0; m_Player.SetActivePotions(Server.Items.PotionEffect.GenderSwap, false); break; case PotionEffect.Invisibility: if (m_Player.GetActivePotions(m_PotionEffect) && m_Player.Hidden) { m_Player.Hidden = false; m_Player.SetActivePotions(PotionEffect.Invisibility, false); } else if (m_Player.GetActivePotions(m_PotionEffect) && !m_Player.Hidden) { m_Player.SetActivePotions(PotionEffect.Invisibility, false); } break; case PotionEffect.ManaRefresh: m_Player.SetActivePotions(Server.Items.PotionEffect.ManaRefresh, false); break; case PotionEffect.TotalManaRefresh: m_Player.SetActivePotions(Server.Items.PotionEffect.TotalManaRefresh, false); break; case PotionEffect.MagicResist: m_Player.SetActivePotions(Server.Items.PotionEffect.MagicResist, false); break; case PotionEffect.Invulnerability: m_Player.SetActivePotions(Server.Items.PotionEffect.Invulnerability, false); m_Player.Blessed = false; break; case PotionEffect.ElvenElixer: m_Player.SetActivePotions(Server.Items.PotionEffect.ElvenElixer, false); break; case PotionEffect.PlantGrowth: m_Player.SetActivePotions(Server.Items.PotionEffect.PlantGrowth, false); break; case PotionEffect.OreRefinement: m_Player.SetActivePotions(Server.Items.PotionEffect.OreRefinement, false); break; case PotionEffect.DwarvenRage: m_Player.SetActivePotions(Server.Items.PotionEffect.DwarvenRage, false); break; case PotionEffect.DrowWeb: m_Player.SetActivePotions(Server.Items.PotionEffect.DrowWeb, false); break; case PotionEffect.DrowPoisonImmune: m_Player.SetActivePotions(Server.Items.PotionEffect.DrowPoisonImmune, false); break; case PotionEffect.OrcGrowth: m_Player.SetActivePotions(Server.Items.PotionEffect.OrcGrowth, false); m_Player.OBody = 0; break; case PotionEffect.HumanEnhance: m_Player.SetActivePotions(Server.Items.PotionEffect.HumanEnhance, false); break; case PotionEffect.PetHeal: m_Player.SetActivePotions(Server.Items.PotionEffect.PetHeal, false); break; } } } catch { return; } }