public override bool OnMoveOver( Mobile m )
		{
			if( m.SolidHueOverride != -1 )
				return true;
			else if( m.Player && !m.Alive ) // mobile is dead
			{
				m.SolidHueOverride = -1;

				if( m_TargetMap != null && m_TargetMap != Map.Internal )
				{
					m.MoveToWorld( m_Target, m_TargetMap );
					BaseCreature.TeleportPets( m, m_Target, m_TargetMap );
				}
				else
					m.SendAsciiMessage( "This has not yet been activated" );

				m.Combatant = null;
				m.Warmode = false;
				m.Resurrect();
				return false;
			}
			else if( ( m.Player ) && ( m.Hits < m.HitsMax ) )
				m.LocalOverheadMessage( MessageType.Regular, 906, true, "For liablity issues, we require all visitors to be in perfect health!" );
			else if( m.Player && m.SolidHueOverride != 2544 )
			{
                m_CasinoTimer = new CasinoTimer(this, m);
                m_CasinoTimer.Start();				
				m.SolidHueOverride = 2544;
				m.SendAsciiMessage( "You are about to enter the Casino!" );
			}

			return true;
		}
Example #2
0
        public override void OnDoubleClick(Mobile from)
        {
            if (m_User == from && from.AccessLevel == AccessLevel.Player)
            {
                try
                {
                    from.AccessLevel = m_AL;
                    m_User = null;
                    m_AL = AccessLevel.Player;

                    if ( !from.Alive )
                    {
                        from.Hidden = true;
                        from.Resurrect();
                    }
                }
                catch
                {
                    from.SendMessage("An error occurred... Contact your supervisor or something! Don't stand there. I get so tired of people like you, gosh.");
                }
            }
            else if (m_User == null && from.AccessLevel > AccessLevel.Player)
            {
                m_AL = from.AccessLevel;
                m_User = from;
                from.AccessLevel = AccessLevel.Player;

                if ( from.Backpack != null && (!this.IsChildOf(from) || !this.IsAccessibleTo(from)))
                    from.Backpack.DropItem(this);
            }
            else
            {
                from.SendMessage("You can't use this...");
            }
        }
Example #3
0
        public override bool OnMoveOver( Mobile m )
        {
            if(m_refresh) {
                m.PlaySound( 0x214 );
                m.FixedEffect( 0x376A, 10, 16 );

                m.Resurrect();

                m.Hits = m.HitsMax;
                m.Stam = m.Dex;
                m.Mana = m.Int;
            } else {
                if ( !m.Alive && m.Map != null && m.Map.CanFit( m.Location, 16, false, false ) )
                {
                    m.PlaySound( 0x214 );
                    m.FixedEffect( 0x376A, 10, 16 );

                    m.CloseGump( typeof( ResurrectGump ) );
                    m.SendGump( new ResurrectGump( m ) );
                }
                else
                {
                    m.SendLocalizedMessage( 502391 ); // Thou can not be resurrected there!
                }
            }

            return false;
        }
Example #4
0
		public override bool OnMoveOver( Mobile m )
		{
			if( m.SolidHueOverride != -1 )
				return true;
		    if( m.Player && !m.Alive ) // mobile is dead
		    {
		        m.SolidHueOverride = -1;

		        if( m_TargetMap != null && m_TargetMap != Map.Internal )
		        {
		            m.MoveToWorld( m_Target, m_TargetMap );
		            BaseCreature.TeleportPets( m, m_Target, m_TargetMap );
		        }
		        else
		            m.SendAsciiMessage( "This has not yet been activated" );

		        m.Combatant = null;
		        m.Warmode = false;
		        m.Resurrect();
		        return false;
		    }
		    if( ( m.Player ) && ( m.Hits < m.HitsMax ) )
		        m.LocalOverheadMessage( MessageType.Regular, 906, true, "You do not have full HP." );
		    else if( m.Player && m.SolidHueOverride != 2535 )
		    {
		        new RuneTimer( this, m ).Start();
		        m.SolidHueOverride = 2535;
		    }

		    return true;
		}
Example #5
0
		public static void Resurrect( Mobile m, Item item )
		{
            if ( m.InRange(item, 2) && m.InLOS(item))
            {
                if (!m.Alive)
                {
                    if (m.Map == null || !m.Map.CanFit(m.Location, 16, false, false))
                    {
                        m.SendLocalizedMessage(502391); // Thou can not be resurrected there!
                    }
                    else if (m.Region is HouseRegion)
                    {
                        m.SendAsciiMessage("You can't get resurrected in house regions.");
                    }
                    else
                    {
                        m.PlaySound(0x214);
                        m.FixedEffect(0x376A, 10, 16);

                        m.Resurrect();

                        //m.CloseGump(typeof(ResurrectGump));
                        //m.SendGump(new ResurrectGump(m, item, ResurrectMessage.VirtueShrine));
                    }
                }
            }
            else
            {
                m.LocalOverheadMessage(MessageType.Regular, 906, 1019045); // I can't reach that.
            }	
        }
Example #6
0
 public static void TryLeaveDM(Mobile from, bool kicked)
 {
     if (IsInDeathmatch(from))
     {
         DMStone s = GetPlayerStone(from);
         from.Frozen = false;
         if (!from.Alive)
             from.Resurrect();
         if (s != null)
         {
             if (kicked)
                 s.RemovePlayer(from, true);
             else
                 s.RemovePlayer(from, false);
         }
     }
 }
Example #7
0
		public override bool OnMoveOver( Mobile m )
		{
			if ( !m.Alive && m.Map != null && m.Map.CanFit( m.Location, 16, false, false ) )
			{
				m.PlaySound( 0x214 );
				m.FixedEffect( 0x376A, 10, 16 );
				m.Resurrect();

				m.Hits = m.HitsMax;
				m.Mana = m.ManaMax;
				m.Stam = m.StamMax;
			}
			else
			{
				m.SendLocalizedMessage( 502391 ); // Thou can not be resurrected there!
			}

			return false;
		}
Example #8
0
        public override bool OnMoveOver(Mobile m)
        {
            if (!m.Alive && m.Map != null && m.Map.CanFit(m.Location, 16, false, false))
            {
                m.PlaySound(0x214);
                m.FixedEffect(0x376A, 10, 16);
                m.Resurrect();

                /*m.CloseGump( typeof( ResurrectGump ) );
                m.SendGump( new ResurrectGump( m ) );
                Taran: removed resurrect gump */
            }
            else
            {
                m.SendLocalizedMessage(502391); // Thou can not be resurrected there!
            }

            return false;
        }
Example #9
0
        public override void OnDoubleClickDead(Mobile from)
        {
            if (!from.Alive && from is PlayerMobile)
            {
                ((PlayerMobile)from).ForceResurrect();
                CommandLogging.WriteLine(from, "Refreshing and resurrecting " + from.Name);
            }
            else if (!from.Alive)
            {
                from.Resurrect();
                CommandLogging.WriteLine(from, "Refreshing and resurrecting " + from.Name);
            }

            CommandLogging.WriteLine(from, "Refreshing but not resurrecting " + from.Name);

            from.PublicOverheadMessage(MessageType.Regular, from.SpeechHue, true, "I've been refreshed.");

            from.Hits = from.HitsMax;
            from.Stam = from.StamMax;
            from.Mana = from.ManaMax;
            from.CurePoison(from);
        }
        public override bool OnMoveOver( Mobile m )
		{
            if (m.SolidHueOverride != -1)
                return true;

            if (m.IsInEvent && !AllowIsInEvent)
            {
                m.SendAsciiMessage("You cannot use this while in an event");
                return true;
            }

            if (m is PlayerMobile && !m.Alive && !AllowDead)
            {
                m.SendAsciiMessage("You cannot use this while dead");
                return true;
            }

            if (!AllowMounted && m.Player && m.Mounted)
            {
                m.SendAsciiMessage("You cannot use this while mounted");
                return true;
            }

		    if( m is PlayerMobile && ((!m.Alive && AllowDead && DeadTeleInstantly) || DelayWithCount <= 0) )
			{
                if (!base.OnMoveOver(m))
                {
                    if (!m.Alive && ResurrectDead)
                        m.Resurrect();

                    return false;
                }
                return true;
			}

            if ((m is PlayerMobile) && (m.Hits < m.HitsMax) && MustBeFullyHealed && m.Alive)
            {
                m.LocalOverheadMessage(MessageType.Regular, 906, true, "You must be fully healed to use this!");
                return true;
            }

            if (CombatCheck && SpellHelper.CheckCombat(m))
            {
                m.SendLocalizedMessage(1005564, "", 0x22); // Wouldst thou flee during the heat of battle??
                return true;
            }

            if (!AllowCriminals && (m.Criminal || Misc.NotorietyHandlers.IsGuardCandidate(m)))
            {
                m.SendAsciiMessage("Criminals or murderers can't use this teleporter!");
                return true;
            }

            if (m is PlayerMobile && m.SolidHueOverride != OnMoveOverHue)
            {
                m_TeleportTimer = new TeleportTimer(this, m);
                m_TeleportTimer.Start();
                m.SolidHueOverride = OnMoveOverHue;
                if (!String.IsNullOrEmpty(OnMoveOverMessage))
                    m.SendAsciiMessage(OnMoveOverMessage);
                return true;
            }

		    return true;
		}
Example #11
0
        private void ReadyPlayer(Mobile m)
        {
            if (!m_ScoreTable.ContainsKey(m.Serial))
                m_ScoreTable.Add(m.Serial, new ScoreKeeper(m));

            if (!m_UseSphereRules)
            {
                #region DistroCode

                bool MagicWeapons = MagicWeaponRule == pMagicWeaponRule.Allowed;
                bool MagicArmor = MagicArmorRule == pMagicArmorRule.Allowed;
                bool Potions = PotionRule == pPotionRule.Allowed;
                bool Bandages = BandageRule == pBandaidRule.Allowed;
                bool Pets = PetRule == pPetRule.Allowed;
                bool Mounts = MountRule == pMountRule.Allowed;

                if (!m.Alive)
                    m.Resurrect();

                Container bp = m.Backpack;
                Container bag = new Bag();
                bag.Hue = 38;
                BankBox bank = m.BankBox;
                Item oncurs = m.Holding;

                if (oncurs != null)
                    bp.DropItem(oncurs);

                m.CurePoison(m);

                m.Hits = m.HitsMax;
                m.Mana = m.ManaMax;
                m.Stam = m.StamMax;

                m.StatMods.Clear();

                List<Item> items = new List<Item>();

                foreach (Layer layer in PvpCore.EquipmentLayers)
                {
                    Item item = m.FindItemOnLayer(layer);

                    if (item != null)
                    {
                        if (item is BaseWeapon && !MagicWeapons)
                        {
                            BaseWeapon weapon = (BaseWeapon)item;

                            if (weapon.AccuracyLevel != WeaponAccuracyLevel.Regular)
                                items.Add(weapon);
                            else if (weapon.DamageLevel != WeaponDamageLevel.Regular)
                                items.Add(weapon);
                            else if (weapon.DurabilityLevel != WeaponDurabilityLevel.Regular)
                                items.Add(weapon);
                        }
                        else if (item is BaseArmor && !MagicArmor)
                        {
                            BaseArmor armor = (BaseArmor)item;

                            if (armor.Durability != ArmorDurabilityLevel.Regular)
                                items.Add(armor);
                            else if (armor.ProtectionLevel != ArmorProtectionLevel.Regular)
                                items.Add(armor);
                        }
                    }
                }

                if (m.Backpack != null)
                {
                    foreach (Item item in m.Backpack.Items)
                    {
                        if (item != null)
                        {
                            if (item is BaseWeapon && !MagicWeapons)
                            {
                                BaseWeapon weapon = (BaseWeapon) item;

                                if (weapon.AccuracyLevel != WeaponAccuracyLevel.Regular)
                                    items.Add(weapon);
                                else if (weapon.DamageLevel != WeaponDamageLevel.Regular)
                                    items.Add(weapon);
                                else if (weapon.DurabilityLevel != WeaponDurabilityLevel.Regular)
                                    items.Add(weapon);
                            }
                            else if (item is BaseArmor && !MagicArmor)
                            {
                                BaseArmor armor = (BaseArmor) item;

                                if (armor.Durability != ArmorDurabilityLevel.Regular)
                                    items.Add(armor);
                                else if (armor.ProtectionLevel != ArmorProtectionLevel.Regular)
                                    items.Add(armor);
                            }
                            else if (item is BasePotion && !Potions)
                                items.Add(item);
                            else if (item is EtherealMount && !Mounts)
                                items.Add(item);
                            else if (item is Bandage && !Bandages)
                                items.Add(item);
                        }
                    }
                }

                if (!Mounts)
                {
                    if (m.Mount != null)
                    {
                        IMount mount = m.Mount;
                        mount.Rider = null;
                        if (mount is BaseMount)
                        {
                            if (mount is BaseCreature)
                            {
                                BaseCreature bc = (BaseCreature)mount;
                                bc.ControlTarget = null;
                                bc.ControlOrder = OrderType.Stay;
                                bc.Internalize();

                                bc.SetControlMaster(null);
                                bc.SummonMaster = null;

                                bc.IsStabled = true;
                                m.Stabled.Add(bc);
                                MountCollection.Add(m.Serial, bc);
                                m.SendMessage(38, "Your mount has been moved to the your stables");
                            }
                        }
                    }
                }

                if (items.Count > 0)
                    m.SendMessage(38, "You had items that did not meet the requirements for the deathmatch and were thus moved to your bank.");

                foreach (Item item in items)
                    bag.AddItem(item);

                if (bag.Items.Count > 0)
                    bank.DropItem(bag);
                else
                    bag.Delete();

                #endregion
            }
            
            if (m_EventSupplier != null)
                m_EventSupplier.OnMoveOver(m);

            Contestants.Add(m);

            SpawnMobile(m);

            if ( m_GiveHorses )
                DMHorse.TryGiveHorse(m);

            if (m.NetState != null)
            {
                m.SendMessage(38, "You have joined a deathmatch");
                m.SendMessage(38, "You can check the score with \".DMScore\"");
            }
        }
Example #12
0
		public void Refresh( Mobile mob, Container cont )
		{
			if ( !mob.Alive )
			{
				mob.Resurrect();

				DeathRobe robe = mob.FindItemOnLayer( Layer.OuterTorso ) as DeathRobe;

				if ( robe != null )
					robe.Delete();

				if ( cont is Corpse )
				{
					Corpse corpse = (Corpse) cont;

					for ( int i = 0; i < corpse.EquipItems.Count; ++i )
					{
						Item item = corpse.EquipItems[i];

						if ( item.Movable && item.Layer != Layer.Hair && item.Layer != Layer.FacialHair && item.IsChildOf( mob.Backpack ) )
							mob.EquipItem( item );
					}
				}
			}

			mob.Hits = mob.HitsMax;
			mob.Stam = mob.StamMax;
			mob.Mana = mob.ManaMax;

			mob.Poison = null;
		}
Example #13
0
		public BandageContext( Mobile healer, Mobile patient, TimeSpan delay, Bandage origin )
		{
			m_Healer = healer;
			m_Patient = patient;

			if( m_Patient != null && !m_Patient.Alive )
			{
				if( m_Healer.Skills[SkillName.Anatomy].Base < 100.0 || m_Healer.Skills[SkillName.Healing].Base < 100.0 )
				{
					if( m_Healer.Skills[SkillName.Anatomy].Base < 100.0 && m_Healer.Skills[SkillName.Healing].Base < 100.0 )
					{
						m_Healer.SendAsciiMessage( "You need GM healing and anatomy to resurrect your target." );
						return;
					}
					else if( m_Healer.Skills[SkillName.Anatomy].Base < 100.0 )
					{
						m_Healer.SendAsciiMessage( "You need GM anatomy to resurrect your target." );
						return;
					}
					else if( m_Healer.Skills[SkillName.Healing].Base < 100.0 )
					{
						m_Healer.SendAsciiMessage( "You need GM healing to resurrect your target." );
						return;
					}
				}

				if( m_Healer.Hits <= 50 )
				{
					m_Healer.SendAsciiMessage( "You need to have more than 50 hp to resurrect your target" );
					return;
				}

				if( m_Patient.Region is HouseRegion )
				{
					m_Healer.SendAsciiMessage( "You can't resurrect people in house regions." );

					//Server.Multis.BaseHouse patientHouse = (m_Patient.Region as HouseRegion).House;

					////The owner can resurrect who ever he wants.
					//if (patientHouse.IsOwner(m_Healer) || patientHouse.IsCoOwner(m_Healer))
					//{
					//    m_Patient.Resurrect();
					//    m_Patient.Hits = 10;
					//    m_Healer.PublicOverheadMessage(MessageType.Regular, 0x22, true, "*You see " + m_Healer.Name + " resurrecting " + m_Patient.Name + "*");
					//    m_Healer.Hits -= 50;
					//}
					////The patient can be ressed by anoyone as long as he is an owner, co owner or friend
					//else if (patientHouse.IsOwner(m_Patient) || patientHouse.IsCoOwner(m_Patient) || patientHouse.IsFriend(m_Patient))
					//{
					//    m_Patient.Resurrect();
					//    m_Patient.Hits = 10;
					//    m_Healer.PublicOverheadMessage(MessageType.Regular, 0x22, true, "*You see " + m_Healer.Name + " resurrecting " + m_Patient.Name + "*");
					//    m_Healer.Hits -= 50;
					//}
					//else
					//{
					//    m_Patient.SendAsciiMessage("You cannot be resurrected in this region!");
					//    m_Healer.SendAsciiMessage("You cannot resurrect in this region!");
					//}
				}
				else
				{
					m_Patient.PlaySound( 0x214 );
					m_Patient.Resurrect();
					m_Patient.Hits = 10;
					m_Healer.PublicOverheadMessage( MessageType.Regular, 0x22, true, "*You see " + m_Healer.Name + " resurrecting " + m_Patient.Name + "*" );
					m_Healer.Hits -= 50;
                    origin.Consume(1);
				}
			}
			else
			{
				m_Timer = new InternalTimer( this, delay, origin );
				m_Timer.Start();
			}
		}
Example #14
0
		private void FixMobile(Mobile m)
		{
			if (!m.Alive)
				m.Resurrect();

			HandleCorpse(m);

			m.Aggressed.Clear();
			m.Aggressors.Clear();
			m.Hits = m.HitsMax;
			m.Stam = m.StamMax;
			m.Mana = m.ManaMax;
			m.DamageEntries.Clear();
			m.Combatant = null;
			m.InvalidateProperties();

            m.Criminal = false;

			StatMod mod;

			mod = m.GetStatMod("[Magic] Str Offset");
			if (mod != null && mod.Offset < 0)
				m.RemoveStatMod("[Magic] Str Offset");

			mod = m.GetStatMod("[Magic] Dex Offset");
			if (mod != null && mod.Offset < 0)
				m.RemoveStatMod("[Magic] Dex Offset");

			mod = m.GetStatMod("[Magic] Int Offset");
			if (mod != null && mod.Offset < 0)
				m.RemoveStatMod("[Magic] Int Offset");

			m.Paralyzed = false;
			m.CurePoison(m);

			// EvilOmenSpell.CheckEffect(m);
			StrangleSpell.RemoveCurse(m);
			CorpseSkinSpell.RemoveCurse(m);

			#region Buff Icons
			if (m is PlayerMobile)
			{
				PlayerMobile pm = (PlayerMobile)m;
				pm.RemoveBuff(BuffIcon.Clumsy);
				pm.RemoveBuff(BuffIcon.CorpseSkin);
				pm.RemoveBuff(BuffIcon.EvilOmen);
				pm.RemoveBuff(BuffIcon.Curse);
				pm.RemoveBuff(BuffIcon.FeebleMind);
				pm.RemoveBuff(BuffIcon.MassCurse);
				pm.RemoveBuff(BuffIcon.Paralyze);
				pm.RemoveBuff(BuffIcon.Poison);
				pm.RemoveBuff(BuffIcon.Strangle);
				pm.RemoveBuff(BuffIcon.Weaken);
			}
			#endregion

			m.SendMessage("The duel has ended.");
		}
Example #15
0
            public void attrib(Mobile who)
            {
                PlayerMobile m = who as PlayerMobile;

                RemoveRing(m);
                m.Aggressed.Clear();
                m.Aggressors.Clear();
                if (!who.Alive)
                    who.Resurrect();

                if (m.TempMount != null)
                {
                    m.TempMount.Rider = m;
                    m.TempMount = null;
                }
                m.Criminal = false;
                m.Warmode = false;
                m.PlaySound(0x214);
                m.FixedEffect(0x376A, 10, 16);
                m.Hits = m.HitsMax;
                m.Mana = m.ManaMax;
                m.Stam = m.StamMax;
            }
Example #16
0
        public void makeready(Mobile who)
        {
            PlayerMobile c = (PlayerMobile)who;
            if (!who.Alive)
                who.Resurrect();

            Container bp = c.Backpack;
            Container bankbag = new Bag();
            bankbag.Hue = 63;
            BankBox bank = c.BankBox;
            Item oncurs = c.Holding;

            if (oncurs != null)
                bp.DropItem(oncurs);

            c.SendMessage("You have 10 seconds until the duel begins");
            c.SendMessage(63, "After one of you dies, both of you will be teleported out");

            c.Criminal = true;
            c.CurePoison(c);

            c.Blessed = true;
            c.Frozen = true;

            c.Hits = c.HitsMax;
            c.Mana = c.ManaMax;
            c.Stam = c.StamMax;

            c.StatMods.Clear();

            if (bp != null)
            {
                Item toDisarm = c.FindItemOnLayer(Layer.OneHanded);

                if (toDisarm == null || !toDisarm.Movable)
                    toDisarm = c.FindItemOnLayer(Layer.TwoHanded);

                if (toDisarm != null)
                    bp.DropItem(toDisarm);

                if (c.Mount != null)
                {
                    IMount mount = c.Mount;
                    mount.Rider = null;
                    if (mount is BaseMount)
                    {
                        BaseMount oldMount = (BaseMount)mount;
                        oldMount.Map = Map.Internal;
                        c.TempMount = oldMount;
                    }
                }

                while ((BasePotion)bp.FindItemByType(typeof(BasePotion)) != null)
                {
                    BasePotion potion = (BasePotion)bp.FindItemByType(typeof(BasePotion));
                    bankbag.DropItem(potion);
                }
                while ((EtherealMount)bp.FindItemByType(typeof(EtherealMount)) != null)
                {
                    EtherealMount mount = (EtherealMount)bp.FindItemByType(typeof(EtherealMount));
                    bankbag.DropItem(mount);
                }
                /*Item[] weps = bp.FindItemsByType( typeof( BaseWeapon ) ); 
                for ( int i = 0; i < weps.Length; ++i ) 
                { 
                    Item item = (Item)weps[i];
                    BaseWeapon weapon = item as BaseWeapon;
                    if( weapon.DamageLevel > WeaponDamageLevel.Regular ) 
                                bankbag.DropItem( item );
                }*/
                if (bankbag.Items.Count > 0)
                    bank.DropItem(bankbag);
                else
                    bankbag.Delete();
            }
        }
Example #17
0
        public virtual void RemovePlayer(Mobile player)
        {
            if (player == null || player.Deleted)
                return;

            if (!Players.Contains(player))
                return;

            if (!player.Alive)
                player.Resurrect();

            if (player is PlayerMobile)
            {
                ((PlayerMobile)player).CurrentEvent = null;
                ((PlayerMobile)player).IsInEvent = false;
                ((PlayerMobile)player).Score = 0;
            }

            player.Blessed = false;

            if (player.Map != Map.Internal)
            {
                player.Location = m_Lobby;
                player.Map = m_LobbyMap;
            }
            else
            {
                player.LogoutLocation = m_Lobby;
                player.LogoutMap = m_LobbyMap;
            }
            m_Players.Remove(player);

            if (m_PlayerSupplies.ContainsKey((PlayerMobile)player))
            {
                SupplySystem.RemoveEventGear(player);
                EquipmentStorage storage = m_PlayerSupplies[(PlayerMobile)player];
                if (storage != null)
                {
                    storage.OnDoubleClick(player);
                    m_PlayerSupplies.Remove((PlayerMobile)player);
                }
            }
            player.Delta(MobileDelta.Noto);
            SendPlayerGumps();
        }
Example #18
0
 internal void doResurrection(Mobile from)
 {
     from.Frozen = false;
     if (m_ResurrectionTimers.ContainsKey(from.Serial))
     {
         m_ResurrectionTimers[from.Serial].Stop();
         m_ResurrectionTimers.Remove(from.Serial);
     }
     from.Resurrect();
     SpawnMobile(from);
     FixPlayer(from, true);
     DMHorse.TryGiveHorse(from);
 }
Example #19
0
		public void Target( Mobile m )
		{
			if ( !Caster.CanSee( m ) )
			{
				Caster.SendLocalizedMessage( 500237 ); // Target can not be seen.
			}
			else if ( m == Caster )
			{
				Caster.SendLocalizedMessage( 501039 ); // Thou can not resurrect thyself.
			}
			else if ( !Caster.Alive )
			{
				Caster.SendLocalizedMessage( 501040 ); // The resurrecter must be alive.
			}
			else if ( m.Alive )
			{
				Caster.SendLocalizedMessage( 501041 ); // Target is not dead.
			}
			else if ( !Caster.InRange( m, 10 ) )//XUO Chro xuo respell style
			{
				Caster.SendLocalizedMessage( 501042 ); // Target is not close enough.
			}
			else if ( !m.Player )
			{
				Caster.SendLocalizedMessage( 501043 ); // Target is not a being.
			}
			else if ( m.Map == null || !m.Map.CanFit( m.Location, 16, false, false ) )
			{
				Caster.SendLocalizedMessage( 501042 ); // Target can not be resurrected at that location.
				m.SendLocalizedMessage( 502391 ); // Thou can not be resurrected there!
			}
			else if ( CheckBSequence( m, true ) )
			{
                 BaseHouse house = null;

                if (m.Region is HouseRegion)
                    house = (m.Region as HouseRegion).House;

                if (house != null)
                {
                    //if (house.IsCoOwner(m) || house.IsFriend(m) || house.IsOwner(m))
                    //{
                    //    m.PlaySound(0x214);
                    //    m.FixedEffect(0x376A, 10, 16);
                    //    m.Resurrect();
                    //}
                    //else if (house.IsCoOwner(Caster) || house.IsOwner(Caster))
                    //{
                    //    m.PlaySound(0x214);
                    //    m.FixedEffect(0x376A, 10, 16);
                    //    m.Resurrect();
                    //}
                    //else
                    //{
                        m.SendAsciiMessage("You cannot be resurrected in a house!");
                        Caster.SendAsciiMessage("You cannot resurrect in a house!");
                    //}
                }
                else
                {
                    m.PlaySound(Sound);
                    m.FixedEffect(0x376A, 10, 15);
                    m.Resurrect();
                }
			}

			FinishSequence();
		}
Example #20
0
        public static void ResurrectPlayers(string arglist, Mobile triggermob, object refobject, out string status_str)
        {
            status_str = null;
            Item refitem = null;
            Mobile refmob = null;
            if (refobject is Item)
            {
                refitem = (Item)refobject;
            }
            else if (refobject is Mobile)
            {
                refmob = (Mobile)refobject;
            }
            // syntax is RESURRECT[,range][,PETS]
            // look for the range arg
            string[] str = ParseString(arglist, 3, ",");
            int range = 0;
            bool petres = false;

            if (str.Length > 1)
            {
                try
                {
                    range = int.Parse(str[1]);
                }
                catch
                {
                    status_str = "bad range arg in RESURRECT";
                }
            }
            if (str.Length > 2)
            {
                // get the range arg
                if (str[2] == "PETS")
                {
                    petres = true;
                }
            }

            try
            {
                if ((range > 0) || (triggermob != null && !triggermob.Deleted))
                {
                    // resurrect all players within range if range is > 0
                    if (range > 0)
                    {
                        IPooledEnumerable rangelist = null;
                        if (refitem != null && !refitem.Deleted)
                        {
                            rangelist = refitem.GetMobilesInRange(range);
                        }
                        else if (refmob != null && !refmob.Deleted)
                        {
                            rangelist = refmob.GetMobilesInRange(range);
                        }

                        if (rangelist != null)
                        {
                            foreach (Mobile p in rangelist)
                            {
                                if (!petres && p is PlayerMobile && p.Body.IsGhost)
                                {
                                    p.Resurrect();
                                }
                                else if (petres && p is BaseCreature && ((BaseCreature)p).ControlMaster == triggermob && ((BaseCreature)p).Controlled && ((BaseCreature)p).IsDeadPet)
                                {
                                    ((BaseCreature)p).ResurrectPet();
                                }
                            }
                            rangelist.Free();
                        }
                    }
                    else
                    {
                        // just send it to the mob who triggered
                        if (triggermob.Body.IsGhost)
                            triggermob.Resurrect();
                    }
                }
            }
            catch
            {
            }
        }
		public static void EndTeleOut( DuelStone ds, Mobile toTele )
		{
			if( toTele != null )
				if( ds != null )
				{
					if( !ds.StoneType.ToString().Contains( "Loot" ) && !toTele.Alive )
					{
						if( toTele.Corpse != null )
							toTele.MoveToWorld( toTele.Corpse.Location, toTele.Corpse.Map );

						toTele.Resurrect();
					}
					else if( toTele.Alive )
					{
						toTele.Hits = toTele.HitsMax;
						toTele.Mana = toTele.ManaMax;
						toTele.Stam = toTele.StamMax;
					}

					toTele.Location = ds.AfterDuelLocation;
					toTele.Frozen = false;

					if( !toTele.Alive )
						toTele.Resurrect();

					(toTele).HasFilter = false;

                    // Clear aggressor list
                    List<AggressorInfo> toRemove = new List<AggressorInfo>();
                    foreach (AggressorInfo aI in toTele.Aggressors)
                    {
                        if (aI.Attacker == toTele || aI.Defender == toTele)
                            toRemove.Add(aI);
                    }
                    if (toRemove.Count > 0)
                        foreach (AggressorInfo aI in toRemove)
                            toTele.Aggressors.Remove(aI);

                    toRemove.Clear();
                    foreach (AggressorInfo aI in toTele.Aggressed)
                    {
                        if (aI.Attacker == toTele || aI.Defender == toTele)
                            toRemove.Add(aI);
                    }
                    if (toRemove.Count > 0)
                        foreach (AggressorInfo aI in toRemove)
                            toTele.Aggressed.Remove(aI);


                    //AggressorInfo toRemove = null;
                    //foreach (AggressorInfo aI in toTele.Aggressors)
                    //{
                    //    if (aI.Attacker == toTele) // Might also want to 
                    //        toRemove = aI; //Add a break here
                    //}

				}
				else
					toTele.SendAsciiMessage( "Error with the stone, page a GM" );
		}