Example #1
0
        public override void ApplyEffect( Mobile to, Mobile source, int intensity, Item itemSource )
        {
            if ( source != to )
                source.DoHarmful( to );
            int chance = Utility.RandomMinMax( 1, 8 );
            string sundname = "";

            BaseArmor sundered = null;
            Layer layer = Layer.FirstValid;

            switch( chance )
            {
                case 1: layer = Layer.InnerTorso; sundname = "armour"; break;
                case 2: layer = Layer.InnerLegs; sundname = "leggings"; break;
                case 3: layer = Layer.TwoHanded; sundname = "shield"; break;
                case 4: layer = Layer.Neck; sundname = "gorget"; break;
                case 5: layer = Layer.Gloves; sundname = "gauntlets"; break;
                case 6: layer = Layer.Helm; sundname = "helm"; break;
                case 7: layer = Layer.Arms; sundname = "arm pads"; break;
                case 8: layer = Layer.OneHanded; sundname = "weapon"; break;
            }

            if( to.FindItemOnLayer( layer ) != null && to.FindItemOnLayer( layer ) is BaseArmor )
                sundered = to.FindItemOnLayer( layer ) as BaseArmor;

            if( sundered != null )
            {
                int amt = (int)(intensity * Divisor);
                if ( amt <= 0 )
                    amt = 0;

                sundered.HitPoints -= Utility.Random( amt ) + 1;

                if( sundered.HitPoints < 0 )
                {
                    sundered.MaxHitPoints += sundered.HitPoints;
                    sundered.HitPoints = 0;

                    if( sundered.MaxHitPoints < 0 )
                    {
                        sundered.Delete();
                        to.Emote( "*got {0} {1} destroyed by {2}*", to.Female == true ? "her" : "his", sundname, source.Name );
                    }
                }

                to.Emote( "*got {0} {1} damaged by {2}*", to.Female == true ? "her" : "his", sundname, source.Name );
            }
        }
        public override void OnDoubleClick( Mobile from )
        {
            if( from == null || !( from is PlayerMobile ) || from.Deleted || !from.Alive || from.Frozen || from.Paralyzed )
                return;

            PlayerMobile pm = from as PlayerMobile;

            if( pm.BloodOfXorgoth != null )
            {
                from.SendMessage( "You are already under the effect of Blood of Xorgoth." );
                return;
            }

            if( from.Backpack != null && this.ParentEntity == from.Backpack )
            {
                BasePotion.PlayDrinkEffectNoBottle( from );
                from.Emote( "*lets out a roar after drinking the Blood of Xorgoth*" );
                pm.BloodOfXorgoth = new BloodOfXorgothTimer( pm, this.Power );
                pm.BloodOfXorgoth.Start();
                this.Delete();
                Pitcher pitcher = new Pitcher();
                from.Backpack.DropItem( pitcher );
            }

            else
                from.SendMessage( "That needs to be in your backpack for you to use it." );
        }
Example #3
0
 public PitchTentTimer( Mobile m, Item tent )
     : base(TimeSpan.FromSeconds( 10 ))
 {
     m_m = m;
     m_tent = tent;
     m.Emote( "*starts pitching a tent*" );
     m_loc = m.Location;
     m_tent.Movable = false;
 }
Example #4
0
        public static void Effect( Mobile attacker, Mobile defender )
        {
            if( attacker == null || defender == null || defender.Weapon is Fists || !((BaseWeapon)defender.Weapon).Movable )
                return;

            if( Utility.RandomBool() && defender.Backpack != null )
            {
                defender.Backpack.DropItem( (BaseWeapon)defender.Weapon );
                defender.Emote( "*was disarmed by {0}*", attacker.Name );
            }
            else if ( Utility.RandomBool() && attacker.Backpack != null )
            {
                attacker.Backpack.DropItem( (BaseWeapon)defender.Weapon );
                defender.Emote( "*was disarmed by {0}*", attacker.Name );
            }
            else
            {
                defender.Emote( "*{0} weapon fell to the ground*", ((IKhaerosMobile)defender).GetPossessivePronoun() );
                ((BaseWeapon)defender.Weapon).MoveToWorld( defender.Location, defender.Map );
            }
        }
Example #5
0
        public static void Effect( Mobile defender, int featlevel, int damage, string source )
        {
            if( source == null )
                source = "";

            BaseWeapon sundered = defender.Weapon as BaseWeapon;
            sundered.HitPoints -= (int)( damage * (featlevel * 0.20) );

            if( sundered.HitPoints < 0 )
            {
                sundered.MaxHitPoints += sundered.HitPoints;
                sundered.HitPoints = 0;

                if( sundered.MaxHitPoints < 1 )
                {
                    sundered.Delete();
                    defender.Emote( "*got {0} weapon destroyed{1}*", ((IKhaerosMobile)defender).GetPossessivePronoun(), source );
                }
            }

            defender.Emote( "*got {0} weapon damaged{1}*", ((IKhaerosMobile)defender).GetPossessivePronoun(), source );
        }
Example #6
0
 public override void OnComponentUsed(AddonComponent ac, Mobile from)
  {
      if (!from.InRange(GetWorldLocation(), 2))  
          from.SendMessage("You are too far away.");
      else
      {
          from.Emote("*stirs the brew*");
          from.Say("hihihihiiii!");
          from.PlaySound(32);
          if (!from.Mounted)
              from.Animate(33, 5, 1, true, false, 0);
      }
  }
      public override bool OnEquip( Mobile from ) 
      { 
      Guild g = from.Guild as Guild;
      if(DefSerUss == 0 && g != null) 
      { 
      DefSerUss = from.Serial; 
      from.Emote( "" + from.Name + ", the robe is now your personal item!" );  
      this.Name =  from.Name +"'s "  +  this.Name +" [" + g.Abbreviation + "]";
      base.OnEquip( from ); 
      return true;
      }
      else if (g == null )
      {
      this.Name = "Robe";
      this.ItemID = 7939;
      this.Hue = 0;
      this.LootType = LootType.Regular;
      base.OnEquip( from ); 
      return true;
      }
     
            else if(DefSerUss == from.Serial) 
      { 
      from.SendMessage( "Guild Form " + from.Name + " was dressed" ); 
      

   base.OnEquip( from ); 
    
   return true; 
    

      } 
      else 
      { 
      from.Emote( "*It is not your Guild item...!*" ); 
      return false; 
} 
} 
Example #8
0
        public static void FinalEffect(Mobile caster, Mobile target, int hold)
        {
            target.PlaySound(0x204);
            target.FixedParticles(0x37C4, 1, 8, 9916, 39, 3, EffectLayer.Head);
            target.FixedParticles(0x37C4, 1, 8, 9502, 39, 4, EffectLayer.Head);

            target.Emote("*is rooted to the ground, unmoving*");
            target.SendMessage("You are overwhelmed by guilt over your sins.");

            if (((IKhaerosMobile)target).StunnedTimer != null)
                ((IKhaerosMobile)target).StunnedTimer.Stop();

            ((IKhaerosMobile)target).StunnedTimer = new JusticePrisonTimer(target, hold);
            ((IKhaerosMobile)target).StunnedTimer.Start();
        }
 protected override void OnTarget( Mobile from, object targeted ) 
 { 
     if ( targeted is Mobile ) 
     { 
         Mobile targ = (Mobile)targeted; 
     if ( !from.CanSee( targ ) ) 
     { 
    from.SendMessage( "You Cannot See This Target" ); 
     } 
     else 
     { 
     targ.Emote( "* Ohh-Rah! Get Vanqusihed by the Hands of The Ice-God *" ); 
     targ.BoltEffect( 0 ); 
     targ.Damage( Utility.Random( 5, 65 ) ); 
     from.Emote( "* In Rememberance of Old Man Ice-God!*" ); 
     } 
    } 
   
 } 
Example #10
0
        public override void OnSwing( Mobile attacker, Mobile defender, bool Cleave )
        {
            IKhaerosMobile featuser = attacker as IKhaerosMobile;

            if( featuser.CanUseMartialPower )
                if( BaseWeapon.CheckStam( attacker, FeatLevel, Cleave, false ) )
                    attacker.Emote( "*focuses and attacks {0} with all {1} strength, in an attempt to stun {2}*", defender.Name, ((IKhaerosMobile)attacker).GetPossessivePronoun(), ((IKhaerosMobile)defender).GetReflexivePronoun() );
        }
Example #11
0
        public override void OnSwing( Mobile attacker, Mobile defender, bool Cleave )
        {
            if( defender.Weapon is Fists )
            {
                attacker.SendMessage( 60, "You cannot use that attack against unarmed foes." );
                ((IKhaerosMobile)attacker).DisableManeuver();
            }

            if( BaseWeapon.CheckStam( attacker, FeatLevel, Cleave, false ) )
                attacker.Emote( "*firmly clashes {0} weapon against {1}{2} weapon*", attacker.Female == true ? "her" : "his", defender.Name, defender.Name.EndsWith( "s" ) == true ? "'" : "'s" );
        }
Example #12
0
        public override void OnSwing( Mobile attacker, Mobile defender, bool Cleave )
        {
            IKhaerosMobile featuser = attacker as IKhaerosMobile;

            if ( attacker.Mounted )
            {
                attacker.SendMessage( 60, "You cannot perform this maneuver while mounted." );
                featuser.DisableManeuver();
            }
            else if ( ((IKhaerosMobile)defender).TrippedTimer != null || CombatSystemAttachment.GetCSA( defender ).PerformingSequence )
            {
                attacker.SendMessage( 60, "You cannot trip them right now." );
                featuser.DisableManeuver();
            }

            else if( ((BaseWeapon)attacker.Weapon).Skill == SkillName.Polearms )
                if( BaseWeapon.CheckStam( attacker, FeatLevel, Cleave, false ) )
                    attacker.Emote( "*swings {0} polearm in an attempt to trip {1}*", ((IKhaerosMobile)attacker).GetPossessivePronoun(), defender.Name );

            else
            {
                attacker.SendMessage( 60, "You need to be equipping a polearm in order to perform this attack." );
                featuser.DisableManeuver();
            }
        }
Example #13
0
        public override void OnGotMeleeAttack(Mobile attacker)
        {
            if (this.Map != null && attacker != this && 0.1 > Utility.RandomDouble())
            {
                if (attacker is BaseCreature)
                {
                    BaseCreature pet = (BaseCreature)attacker;
                    if (pet.ControlMaster != null && (attacker is Dragon || attacker is GreaterDragon || attacker is SkeletalDragon || attacker is WhiteWyrm || attacker is Drake))
                    {
                        Combatant = null;
                        pet.Combatant = null;
                        Combatant = null;
                        pet.IsBonded = false;
                        pet.ControlMaster = null;
                        pet.Controlled = false;
                        attacker.Emote(String.Format("* {0} decided to go wild *", attacker.Name));
                    }

                    if (pet.ControlMaster != null && 0.1 > Utility.RandomDouble())
                    {
                        Combatant = null;
                        pet.Combatant = pet.ControlMaster;
                        Combatant = null;
                        attacker.Emote(String.Format("* {0} is being angered *", attacker.Name));
                    }

                }
            }

            base.OnGotMeleeAttack(attacker);
        }
Example #14
0
        public override void OnDoubleClick(Mobile from)
        {
            if (this.RootParentEntity == from && from.HasFreeHand())
            {
                from.PlaySound(0x384);
                from.Target = new LeechTarget(this);
                from.Emote("*readies a leech in " + (from.Female ? "her" : "his") + " hand*");
                from.SendMessage("Choose a target whose blood you wish to leech.");
            }
            else if (this.RootParentEntity != from)
                from.SendMessage("That must be in your backpack to use it.");
            else if (!from.HasFreeHand())
                from.SendMessage("You must have a free hand to do that.");

            base.OnDoubleClick(from);
        }
Example #15
0
        public static void Effect( Mobile defender, int featlevel, int target )
        {
            IKhaerosMobile defplayer = defender as IKhaerosMobile;

            if( target == 0 )
                target = Utility.RandomMinMax( 1, 4 );

            switch( target )
            {
                case 1:
                {
                    if( defplayer.DisabledLegsTimer != null )
                        defplayer.DisabledLegsTimer.Stop();

                    defplayer.DisabledLegsTimer = new DisableTimer( defender, featlevel, 1, "legs" );
                    defplayer.DisabledLegsTimer.Start();
                    defender.Emote( "*got {0} legs disabled*", ((IKhaerosMobile)defender).GetPossessivePronoun() );
                    if ( defender is PlayerMobile )
                        ((PlayerMobile)defender).CantRunIconRefresh();
                    break;
                }
                case 2:
                {
                    if( defplayer.DisabledLeftArmTimer != null )
                        defplayer.DisabledLeftArmTimer.Stop();

                    defplayer.DisabledLeftArmTimer = new DisableTimer( defender, featlevel, 2, "left arm" );
                    defplayer.DisabledLeftArmTimer.Start();
                    defender.Emote( "*got {0} left arm disabled*", ((IKhaerosMobile)defender).GetPossessivePronoun() );
                    break;
                }
                case 3:
                {
                    if( defplayer.DisabledRightArmTimer != null )
                        defplayer.DisabledRightArmTimer.Stop();

                    defplayer.DisabledRightArmTimer = new DisableTimer( defender, featlevel, 3, "right arm" );
                    defplayer.DisabledRightArmTimer.Start();
                    defender.Emote( "*got {0} right arm disabled*", ((IKhaerosMobile)defender).GetPossessivePronoun() );
                    break;
                }
                case 4: goto case 1;
            }
        }
Example #16
0
 static void SetAFK(Mobile m, string message)
 {
     PlayersAfk.Add(m.Serial.Value, new AfkInfo(message, m.Location));
     m.Emote("*Is now AFK*");
 }
Example #17
0
 public override void OnSwing( Mobile attacker, Mobile defender, bool Cleave )
 {
     if( BaseWeapon.CheckStam( attacker, FeatLevel, Cleave, false ) )
         attacker.Emote( "*steps into {0} and hits {1} in a vital point*", defender.Name, ((IKhaerosMobile)defender).GetReflexivePronoun() );
 }
Example #18
0
        public virtual void DegradeArmour( Mobile defender )
        {
            int chance = Utility.RandomMinMax( 1, 7 );
            string sundname = "";

            BaseArmor sundered = null;
            Layer layer = Layer.FirstValid;

            switch( chance )
            {
                case 1: layer = Layer.InnerTorso; sundname = "armour"; break;
                case 2: layer = Layer.InnerLegs; sundname = "leggings"; break;
                case 3: layer = Layer.TwoHanded; sundname = "shield"; break;
                case 4: layer = Layer.Neck; sundname = "gorget"; break;
                case 5: layer = Layer.Gloves; sundname = "gauntlets"; break;
                case 6: layer = Layer.Helm; sundname = "helm"; break;
                case 7: layer = Layer.Arms; sundname = "arm pads"; break;
            }

            if( defender.FindItemOnLayer( layer ) != null && defender.FindItemOnLayer( layer ) is BaseArmor )
            {
                sundered = defender.FindItemOnLayer( layer ) as BaseArmor;
            }

            if( sundered != null )
            {
                sundered.HitPoints -= Utility.Random( 3 );

                if( sundered.HitPoints < 0 )
                {
                    sundered.MaxHitPoints += sundered.HitPoints;
                    sundered.HitPoints = 0;

                    if( sundered.MaxHitPoints < 0 )
                    {
                        sundered.Delete();
                        defender.Emote( "*got {0} {1} destroyed by {2}*", defender.Female == true ? "her" : "his", sundname, this.Name );
                    }
                }

                defender.Emote( "*got {0} {1} damaged by {2}*", defender.Female == true ? "her" : "his", sundname, this.Name );
            }
        }
Example #19
0
            protected override void OnTarget( Mobile from, object obj )
            {
                if( from == null || water == null || !( obj is BaseCreature || obj is BaseWeapon) || !( from is PlayerMobile ) || from.Deleted || !from.Alive || from.Frozen || from.Paralyzed )
                    return;

                Container pack = from.Backpack;

                if( obj is BaseWeapon )
                {
                    BaseWeapon weapon = obj as BaseWeapon;

                    if( weapon.RootParentEntity == null || weapon.RootParentEntity != from )
                        from.SendMessage( "The weapon needs to be in your possession to be consecrated." );

                    else if( weapon.Resource == CraftResource.Silver )
                    {
                        XmlHolyWater hwatt = XmlAttach.FindAttachment( weapon, typeof(XmlHolyWater) ) as XmlHolyWater;

                        if( hwatt != null )
                            from.SendMessage( "That weapon has already been consecrated." );

                        else if( pack != null && water.ParentEntity == pack )
                        {
                            XmlHolyWater newatt = new XmlHolyWater( Math.Max( 1, (int)(water.Power * 0.1) ), 600.0 );
                            XmlAttach.AttachTo( weapon, newatt );
                            from.SendMessage( "This weapon will remain consecrated for the next ten minutes." );
                            water.Delete();
                            Pitcher pitcher = new Pitcher();
                            weapon.InvalidateProperties();
                            pack.DropItem( pitcher );
                        }
                    }

                    else
                        from.SendMessage( "Only silver weapons can be consecrated with holy water." );

                    return;
                }

                if( !( obj is IAbyssal ) && !( obj is IUndead ) && (!(obj is PlayerMobile) && !((PlayerMobile)obj).IsVampire) )
                {
                    from.SendMessage( "Holy Water is only effective against demons and the undead." );
                    return;
                }

                BaseCreature bc = obj as BaseCreature;

                if( bc.Deleted || from.Map != bc.Map || !bc.Alive || !from.CanSee( bc ) || !from.InLOS( bc ) || !from.CanBeHarmful( bc ) )
                    return;

                PlayerMobile m = from as PlayerMobile;

                if( pack != null && water.ParentEntity == pack )
                {
                    if( BaseWeapon.CheckStam( m, 6 ) )
                    {
                        new BaseCustomSpell.SpellDamageTimer( m, bc, 0.5, water.Power ).Start();
                        from.Emote( "*throws a vial of holy water on " + bc.Name + "*" );
                        Effects.SendLocationParticles( EffectItem.Create(   bc.Location, bc.Map, EffectItem.DefaultDuration ), 0x3728, 10, 10, 5023 );
                        bc.PlaySound( 868 );
                        water.Delete();
                        Pitcher pitcher = new Pitcher();
                        pack.DropItem( pitcher );
                    }
                }

                else
                    from.SendMessage( "That needs to be in your backpack for you to use it." );
            }
Example #20
0
        public virtual void DegradeWeapon( Mobile defender )
        {
            BaseWeapon sundered = defender.Weapon as BaseWeapon;

            if( !( sundered is Fists ) )
            {
                sundered.HitPoints -= Utility.Random( 3 );

                if( sundered.HitPoints < 0 )
                {
                    sundered.MaxHitPoints += sundered.HitPoints;
                    sundered.HitPoints = 0;

                    if( sundered.MaxHitPoints < 0 )
                    {
                        sundered.Delete();
                        defender.Emote( "*got {0} weapon destroyed by {1}*", defender.Female == true ? "her" : "his", this.Name );
                    }
                }

                defender.Emote( "*got {0} weapon damaged by {1}*", defender.Female == true ? "her" : "his", this.Name );
            }
        }
        public static void Cleave( Mobile mob, Mobile killed )
        {
            if ( mob == null || killed == null || ((IKhaerosMobile)mob).CleaveAttack )
                return;

            CombatSystemAttachment csa = CombatSystemAttachment.GetCSA( mob );
            if ( csa.Charging || (csa.AttackTimer != null && csa.AttackTimer.Type == AttackType.Throw) ) // does not trigger from charge/throw
                return;
            BaseWeapon weapon = mob.Weapon as BaseWeapon;
            IKhaerosMobile attacker = mob as IKhaerosMobile;
            ArrayList list = new ArrayList();

            if ( attacker.Feats.GetFeatLevel(FeatList.Cleave) > 0 && !( mob.Weapon is BaseRanged ) )
            {
                foreach( Mobile m in mob.GetMobilesInRange( 2 ) )
                    list.Add( m );

                ArrayList targets = new ArrayList();

                for( int i = 0; i < list.Count; ++i )
                {
                    Mobile m = (Mobile)list[i];

                    if( m != killed && m != mob && Spells.SpellHelper.ValidIndirectTarget( mob, m ) )
                    {
                        if( m == null || m.Deleted || m.Map != mob.Map || !m.Alive || !mob.CanSee( m ) || !mob.CanBeHarmful( m ) || BaseAI.AreAllies( mob, m ) )
                            continue;

                        if( !mob.InRange( m, weapon.MaxRange ) )
                            continue;

                        if (mob.InLOS(m))
                        {
                            bool govAlly = false;
                            if (m is Soldier && (m as Soldier).Government != null && !(m as Soldier).Government.Deleted)
                            {
                                if (attacker is Soldier && (attacker as Soldier).Government != null && !(attacker as Soldier).Government.Deleted)
                                {
                                    if ((attacker as Soldier).Government == (m as Soldier).Government)
                                        govAlly = true;
                                    else if ((attacker as Soldier).Government.AlliedGuilds.Contains((m as Soldier).Government))
                                        govAlly = true;
                                }
                                else if (attacker is PlayerMobile)
                                {
                                    foreach (CustomGuildStone g in CustomGuildStone.Guilds)
                                    {
                                        if (CustomGuildStone.IsGuildMember(attacker as PlayerMobile, g))
                                            govAlly = (g == (m as Soldier).Government || g.AlliedGuilds.Contains((m as Soldier).Government));

                                        if (govAlly)
                                            break;
                                    }

                                    if (govAlly)
                                        continue;
                                }
                            }
                            else if (m is PlayerMobile && attacker is Soldier)
                            {
                                if ((attacker as Soldier).Government.Members.Contains(m))
                                    govAlly = true;
                                else
                                {
                                    foreach (CustomGuildStone g in CustomGuildStone.Guilds)
                                    {
                                        if (CustomGuildStone.IsGuildMember(m as PlayerMobile, g))
                                            govAlly = (attacker as Soldier).Government.AlliedGuilds.Contains(g);

                                        if(govAlly)
                                            break;
                                    }
                                }
                            }

                            if(!govAlly)
                                targets.Add(m);
                        }
                    }
                }

                if( targets.Count > 0 )
                {
                    mob.RevealingAction();
                    Mobile m = (Mobile)targets[0];
                    mob.Emote( "*unleashes a cleave attack on {0}*", m.Name );
                    attacker.CleaveAttack = true;
                    weapon.OnSwing( mob, m, ((attacker.Feats.GetFeatLevel(FeatList.Cleave) * 0.25) + 0.25), true );
                }
            }
        }
Example #22
0
        public void Carve( Mobile from, Item item )
        {
            Mobile dead = m_Owner;
            PlayerMobile fr = from as PlayerMobile;
            PlayerMobile ow = this.Owner as PlayerMobile;

            if( this.Owner != null && this.Owner is PlayerMobile && fr.IsHardcore == false) //Killer is not HC

            {
                from.SendMessage( "You are not capable of inflicting a wound on that target, as you do not possess the Hardcore merit." );
            }

            if( this.Owner != null && this.Owner is PlayerMobile && ow.IsHardcore == false && fr.IsHardcore == true)//Killer is HC, target is not
            {
                if (ow.HCWound + TimeSpan.FromHours(24) < DateTime.Now) //Must Pass 24 Hour Rule
                {
                    from.SendMessage( 32, "You inflict a finishing wound upon " + dead.Name + "!" );
                    UseDelaySystem.AddContext(from, DelayContextType.WoundCommand,TimeSpan.FromHours(1));
                    from.Emote( "*{0} wounds {1}*", from.Name , dead.Name );
                    dead.SendMessage( 32, "You have been dealt a finishing wound by {0}!", from.Name );
                    ow.HCWound = DateTime.Now;

                    if (HealthAttachment.HasHealthAttachment(dead))
                    {
                        HealthAttachment.GetHA(dead).NormalWound(from);
                    }

                    new Blood().MoveToWorld( Location, Map );
                    new Blood().MoveToWorld( Location, Map );
                    new Blood().MoveToWorld( Location, Map );
                }
                else
                from.SendMessage( "You are not capable of inflicting a wound on that target, as they have been dealt a finishing move within the past 24 hours." );
            }

            else if( this.Owner != null && this.Owner is PlayerMobile && ow.IsHardcore == true && fr.IsHardcore == true)//Killer and target are HC
            {
            if (ow.HCWound + TimeSpan.FromHours(24) < DateTime.Now) //Must Pass 24 Hour Rule
                {
                if (ow.Maimings >= 1) //Do our check for Maimings first, to see if they need a chance at PDing
                {
                    int r = Utility.Random(1,10);
             				if (ow.Maimings > r) //Escalating chance of PD based on the more injuries.
                        {
                            from.SendMessage( 32, "Rolled {0}",r);
                            from.SendMessage( 32, "You have permanently ended the life of " + dead.Name + " by inflicting a fatal wound upon them!" );
                            ow.m_DeathTimer.Stop();
                            ow.CloseGump( typeof( DeathGump ) );
                            Map deathmap = Map.Felucca;
                            Point3D permdeath = new Point3D( 5689,1768,0 );
                            dead.MoveToWorld( permdeath, deathmap );
                            from.Emote( "*{0} fatally wounds {1}*",from.Name ,dead.Name );
                            PlayerMobile PM = m_Owner as PlayerMobile;
                            string stringdeath = "A person has been slain by the hands of another; the lands of Khaeros whisper of their passing.";
                            UseDelaySystem.AddContext(from, DelayContextType.WoundCommand,TimeSpan.FromHours(1));
                            World.Broadcast( 0x35, true, "{0}", stringdeath );
                            dead.SendMessage( 32, "You have been fatally wounded, and your character is now permanently dead!" );
                            dead.CantWalk = false;
                            dead.Squelched = false;
                            ow.Lives = -1000;
                            ow.Maimings = 666; // Set Maimings to 666, so it doesn't re-maim them if they've PDed
                            dead.Kill();
                            new Blood().MoveToWorld( Location, Map );
                            new Blood().MoveToWorld( Location, Map );
                            new Blood().MoveToWorld( Location, Map );
                            new Torso().MoveToWorld( Location, Map );
                            new LeftLeg().MoveToWorld( Location, Map );
                            new LeftArm().MoveToWorld( Location, Map );
                            new RightLeg().MoveToWorld( Location, Map );
                            new RightArm().MoveToWorld( Location, Map );
                            new Head( dead.Name ).MoveToWorld( Location, Map );
                            m_Carved = true;
                            ProcessDelta();
                            SendRemovePacket();
                            ItemID = Utility.Random( 0xECA, 9 ); // bone graphic
                            Hue = 0;
                            ProcessDelta();
                        }
                }

                if (ow.Maimings < 666) //Do our check to make sure the dude aint dead already!
                {
                    //If maim count is below 2, or if the lucky dog passed his chance to DIE...

                    from.SendMessage( 32, "You inflict a grievous finishing wound upon " + dead.Name + "!" );
                    from.Emote( "*{0} inflicts a grievous wound upon {1}*",from.Name ,dead.Name );
                    UseDelaySystem.AddContext(from, DelayContextType.WoundCommand,TimeSpan.FromHours(1));
                    dead.SendMessage( 32, "You have been dealt a grievous finishing wound! Your wound count has increased by 1!" );

                    if (HealthAttachment.HasHealthAttachment(dead))
                    {
                        HealthAttachment.GetHA(dead).HCWound(from);
                    }

                    ow.Maimings += 1;
                    ow.HCWound = DateTime.Now;
                    new Blood().MoveToWorld( Location, Map );
                    new Blood().MoveToWorld( Location, Map );
                    new Blood().MoveToWorld( Location, Map );

                    //Blow through our checks to see if we should lower stats!
                    if (ow.RawHits > 25 && ow.Maimings + 1 > Utility.Random(10))
                        {
                        ow.RawHits -= Utility.RandomList(5,10);
                        dead.SendMessage( 32, "You have lost some hit points permenantly due to the wound you've sustained!" );
                        }
                    if (ow.RawStam > 25 && ow.Maimings + 1 > Utility.Random(10))
                        {
                        ow.RawStam -= Utility.RandomList(5,10);
                        dead.SendMessage( 32, "You have lost some stamina points permenantly due to the wound you've sustained!" );
                        }
                    if (ow.RawMana > 25 && ow.Maimings + 1 > Utility.Random(10))
                        {
                        ow.RawMana -= Utility.RandomList(5,10);
                        dead.SendMessage( 32, "You have lost some mana points permenantly due to the wound you've sustained!" );
                        }
                }
                }
            else
            from.SendMessage( "You are not capable of inflicting a wound on that target, as they have been dealt a finishing move within the past 24 hours." );
            }

            else if( this.Owner != null && this.Owner is PlayerMobile && ((PlayerMobile)this.Owner).Lives > -1 )
                from.SendMessage( "That person is not dead yet, so you cannot carve their body." );

            else if ( dead == null )
            {
                from.SendLocalizedMessage( 500485 ); // You see nothing useful to carve from the corpse.
            }
            else if ( ((Body)Amount).IsHuman && ItemID == 0x2006 )
            {
                new Blood( 0x122D ).MoveToWorld( Location, Map );

                new Torso().MoveToWorld( Location, Map );
                new LeftLeg().MoveToWorld( Location, Map );
                new LeftArm().MoveToWorld( Location, Map );
                new RightLeg().MoveToWorld( Location, Map );
                new RightArm().MoveToWorld( Location, Map );
                new Head( dead.Name ).MoveToWorld( Location, Map );

                m_Carved = true;

                ProcessDelta();
                SendRemovePacket();
                ItemID = Utility.Random( 0xECA, 9 ); // bone graphic
                Hue = 0;
                ProcessDelta();

                if ( IsCriminalAction( from ) )
                    from.CriminalAction( true );
            }
            else if ( dead is BaseCreature )
            {
                ((BaseCreature)dead).OnCarve( from, this );
            }
            else
            {
                from.SendLocalizedMessage( 500485 ); // You see nothing useful to carve from the corpse.
            }
        }
Example #23
0
 public InUseTimer(Mobile m, FootTrap trap, int featlevel)
     : base(TimeSpan.FromSeconds(featlevel * 2))
 {
     m_m = m;
     m_trap = trap;
     trap.InUse = true;
     m.Emote("*tries to break free from the foot trap*");
 }
Example #24
0
 static void SetBack(Mobile m)
 {
     PlayersAfk.Remove(m.Serial.Value);
     m.Emote("*Returns to the game*");
 }
Example #25
0
        // When this object -- the bottle -- is double-clicked...
        public override void OnDoubleClick(Mobile m)
        {
            if (m.Followers >= m.FollowersMax) // If the player's followers is greater than or equal to his max followers...
            {
                m.SendMessage("You need at least one free follower slot to open the bottle.");
            }
            else if (((m.InRange(this, 1) && m.CanSee(this)) || this.IsChildOf(m.Backpack)) && (!GetGooInBottle())) // If the bottle is in-range and the goo is not in its bottle...
            {
                m.SendMessage("The goo is out of its bottle!");
                m.SendLocalizedMessage(1010018); // What do you want to use this item on?

                m.Target = new BottleOfGooTarget(this, gooPet); // Creates a target from this mobile with the goo mobile thrown to the new class as a reference.
            }
            else if (((m.InRange(this, 1) && m.CanSee(this)) || this.IsChildOf(m.Backpack)) && (GetGooInBottle())) // If the bottle is in-range and the goo IS in its bottle, this function creates a new goo mobile.
            {
                gooPet = new Goo(this);

                ((GenericWarrior)gooPet).Controlled = true;
                ((GenericWarrior)gooPet).ControlMaster = m;

                gooPet.MoveToWorld(m.Location, m.Map);
                gooPet.PlaySound(0x1CC);
                gooPet.Emote("*leaps out of " + m.Name + "'s bottle!*");

                SetGooInBottle(false);
            }
            else
            {
                m.SendLocalizedMessage(500446); //That is too far away.
            }
        }
Example #26
0
 public override void OnSwing( Mobile attacker, Mobile defender, bool Cleave )
 {
     if( ValidateBackstab( attacker, defender ) )
     {
         if( BaseWeapon.CheckStam( attacker, FeatLevel, Cleave, false ) )
         {
             attacker.Emote( "*surprises {0}, landing a vicious blow to {1} neck*", defender.Name, ((IKhaerosMobile)defender).GetPossessivePronoun() );
             defender.FixedParticles( 0x37B9, 1, 5, 0x251D, 0x651, 0, EffectLayer.Waist );
         }
     }
     else
     {
         attacker.SendMessage( "You must be hidden, at the back or back flank of your opponent, and using a knife, sword or axe in order to perform this attack!" );
         ((IKhaerosMobile)attacker).DisableManeuver();
     }
 }
Example #27
0
		public SelfDestructiveBarTrash(Mobile from) : base(0) {
			Movable = false;
			Name="some trash dropped by "+from.Name;
			Timer.DelayCall(TimeSpan.FromMinutes(2.5),new TimerStateCallback(DecayTimer),this);
			switch(Utility.RandomMinMax(0,4)){
				case 0: {
					ItemID=4334;
					break;
				}
				case 1: {
					ItemID=4335;
					break;
				}
				case 2: {
					ItemID=4336;
					break;
				}
				case 3: {
					ItemID=4337;
					break;
				}
				case 4: {
					ItemID=Utility.RandomMinMax(4650,4654);
					Name="some of "+from.Name+"'s vomit";
					Hue=0x31;
					from.Emote("*vomits*");
					Server.Effects.PlaySound(from.Location,from.Map,(from.Female ? 0x32D : 0x43F));
					Timer.DelayCall(TimeSpan.FromSeconds(Utility.RandomMinMax(2,3)),new TimerStateCallback(BarkeepSpeak),from);
					break;
				}
				default: break;
			}
		}
        void OnTarget(Mobile from, object obj)
        {
            var mob = obj as Mobile;
            var corpse = obj as Corpse;

            if (mob == null && corpse == null)
            {
                from.SendMessage(33, "You can't resurrect that!");
                return;
            }

            if (corpse != null && corpse.Owner != null)
                mob = corpse.Owner;

            if (mob.IsDeadBondedPet && mob is BaseCreature)
            {
                ((BaseCreature)mob).ResurrectPet();
            }
            else if (mob.Alive)
            {
                from.SendMessage(33, "This creature is not dead!");
                return;
            }
            else
            {
                mob.Resurrect();
            }

            mob.PlaySound(0x214);
            mob.FixedEffect(0x376A, 10, 16);

            Consume();
            from.Emote("*recites a scroll of resurrection*");
            from.SendMessage(67, "The creature was brought back to life.");
        }
Example #29
0
            public static void TryTerror( Mobile from, Mobile mob )
            {
                if( from == null || mob == null || !( from is PlayerMobile ) || !from.InRange( mob, 6 ) )
                    return;

                PlayerMobile vamp = from as PlayerMobile;

                if( vamp.NextFeatUse > DateTime.Now )
                    vamp.SendMessage( "It is too early to use another ability." );

                else if( vamp.BPs < 1 )
                    vamp.SendMessage( "You lack enough blood points to use this ability." );

                else
                {
                    if( Utility.RandomMinMax( 1, 100 ) > mob.EnergyResistance )
                    {
                        mob.Emote( "*is paralyzed in fear of " + vamp.Name + vamp.GetPossessive() + " gaze*" );
                        Engines.XmlSpawner2.XmlAttach.AttachTo( mob, new Engines.XmlSpawner2.XmlParalyze( ( (double)vamp.Feats.GetFeatLevel( FeatList.Terror ) ) ) );
                    }

                    else
                        mob.Emote( "*resisted " + vamp.Name + vamp.GetPossessive() + " monstrous gaze*" );

                    vamp.BPs--;
                    vamp.PlaySound( 581 );
                    vamp.NextFeatUse = DateTime.Now + TimeSpan.FromSeconds( 60 - vamp.Level );
                    vamp.RevealingAction();

                    Engines.XmlSpawner2.CombatSystemAttachment csa = Engines.XmlSpawner2.CombatSystemAttachment.GetCSA( vamp );
                    csa.Interrupted( true );

                    if( mob is BaseCreature )
                        ( (BaseCreature)mob ).AggressiveAction( vamp );
                }
            }
Example #30
0
 public override void OnSwing( Mobile attacker, Mobile defender, bool Cleave )
 {
     if( ((IKhaerosMobile)attacker).CanUseMartialPower && BaseWeapon.CheckStam( attacker, FeatLevel, Cleave, false ) )
         attacker.Emote( "*reaches out in an attempt to strike {0} in a nerve*", defender.Name );
 }