コード例 #1
0
        public virtual void Open(Mobile from, bool checkSelfLoot)
        {
            if (from.AccessLevel > AccessLevel.Player || from.InRange(this.GetWorldLocation(), 2))
            {
                bool selfLoot = (checkSelfLoot && (from == m_Owner));

                if (selfLoot)
                {
                    ArrayList items = new ArrayList(this.Items);

                    bool gathered = false;
                    bool didntFit = false;

                    Container pack = from.Backpack;

                    bool checkRobe = true;

                    for (int i = 0; !didntFit && i < items.Count; ++i)
                    {
                        Item    item = (Item)items[i];
                        Point3D loc  = item.Location;

                        if ((item.Layer == Layer.Hair || item.Layer == Layer.FacialHair) || !item.Movable || !GetRestoreInfo(item, ref loc))
                        {
                            continue;
                        }

                        if (checkRobe)
                        {
                            DeathRobe robe = from.FindItemOnLayer(Layer.OuterTorso) as DeathRobe;

                            if (robe != null)
                            {
                                Map map = from.Map;

                                if (map != null && map != Map.Internal)
                                {
                                    robe.MoveToWorld(from.Location, map);
                                }
                            }
                        }

                        if (m_EquipItems.Contains(item) && from.EquipItem(item))
                        {
                            gathered = true;
                        }
                        else if (pack != null && pack.CheckHold(from, item, false, true))
                        {
                            item.Location = loc;
                            pack.AddItem(item);
                            gathered = true;
                        }
                        else
                        {
                            didntFit = true;
                        }
                    }

                    if (gathered && !didntFit)
                    {
                        m_Carved = true;

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

                        from.PlaySound(0x3E3);
                        from.SendLocalizedMessage(1062471);                           // You quickly gather all of your belongings.
                        return;
                    }

                    if (gathered && didntFit)
                    {
                        from.SendLocalizedMessage(1062472);                           // You gather some of your belongings. The rest remain on the corpse.
                    }
                }

                if (!CheckLoot(from))
                {
                    return;
                }

                PlayerMobile player = from as PlayerMobile;

                if (player != null)
                {
                    QuestSystem qs = player.Quest;

                    if (qs is UzeraanTurmoilQuest)
                    {
                        GetDaemonBoneObjective obj = qs.FindObjective(typeof(GetDaemonBoneObjective)) as GetDaemonBoneObjective;

                        if (obj != null && obj.CorpseWithBone == this && (!obj.Completed || UzeraanTurmoilQuest.HasLostDaemonBone(player)))
                        {
                            Item bone = new QuestDaemonBone();

                            if (player.PlaceInBackpack(bone))
                            {
                                obj.CorpseWithBone = null;
                                player.SendLocalizedMessage(1049341, "", 0x22);                                   // You rummage through the bones and find a Daemon Bone!  You quickly place the item in your pack.

                                if (!obj.Completed)
                                {
                                    obj.Complete();
                                }
                            }
                            else
                            {
                                bone.Delete();
                                player.SendLocalizedMessage(1049342, "", 0x22);                                   // Rummaging through the bones you find a Daemon Bone, but can't pick it up because your pack is too full.  Come back when you have more room in your pack.
                            }

                            return;
                        }
                    }
                    else if (qs is TheSummoningQuest)
                    {
                        VanquishDaemonObjective obj = qs.FindObjective(typeof(VanquishDaemonObjective)) as VanquishDaemonObjective;

                        if (obj != null && obj.Completed && obj.CorpseWithSkull == this)
                        {
                            GoldenSkull sk = new GoldenSkull();

                            if (player.PlaceInBackpack(sk))
                            {
                                obj.CorpseWithSkull = null;
                                player.SendLocalizedMessage(1050022);                                   // For your valor in combating the devourer, you have been awarded a golden skull.
                                qs.Complete();
                            }
                            else
                            {
                                sk.Delete();
                                player.SendLocalizedMessage(1050023);                                   // You find a golden skull, but your backpack is too full to carry it.
                            }
                        }
                    }
                }

                base.OnDoubleClick(from);

                if (from != m_Owner)
                {
                    from.RevealingAction();
                }
            }
            else
            {
                from.SendLocalizedMessage(500446);                   // That is too far away.
                return;
            }
        }
コード例 #2
0
        public virtual void Open(Mobile from, bool checkSelfLoot)
        {
            if (from.AccessLevel > AccessLevel.Player || from.InRange(this.GetWorldLocation(), 2))
            {
                #region Self Looting
                if (checkSelfLoot && from == m_Owner && !GetFlag(CorpseFlag.SelfLooted) && this.Items.Count != 0)
                {
                    DeathRobe robe = from.FindItemOnLayer(Layer.OuterTorso) as DeathRobe;

                    if (robe != null)
                    {
                        Map map = from.Map;

                        if (map != null && map != Map.Internal)
                        {
                            robe.MoveToWorld(from.Location, map);
                            robe.BeginDecay();
                        }
                    }

                    Container pack = from.Backpack;

                    if (m_RestoreEquip != null && pack != null)
                    {
                        List <Item> packItems = new List <Item>(pack.Items);                         // Only items in the top-level pack are re-equipped

                        for (int i = 0; i < packItems.Count; i++)
                        {
                            Item packItem = packItems[i];

                            if (m_RestoreEquip.Contains(packItem) && packItem.Movable)
                            {
                                from.EquipItem(packItem);
                            }
                        }
                    }

                    List <Item> items = new List <Item>(this.Items);

                    bool didntFit = false;

                    for (int i = 0; !didntFit && i < items.Count; ++i)
                    {
                        Item    item = items[i];
                        Point3D loc  = item.Location;

                        if (item.Layer == Layer.Hair || item.Layer == Layer.FacialHair || !item.Movable || !GetRestoreInfo(item, ref loc))
                        {
                            continue;
                        }

                        if (pack != null && pack.CheckHold(from, item, false, true))
                        {
                            item.Location = loc;
                            pack.AddItem(item);

                            if (m_RestoreEquip != null && m_RestoreEquip.Contains(item))
                            {
                                from.EquipItem(item);
                            }
                        }
                        else
                        {
                            didntFit = true;
                        }
                    }

                    from.PlaySound(0x3E3);

                    if (this.Items.Count != 0)
                    {
                        from.SendLocalizedMessage(1062472);                           // You gather some of your belongings. The rest remain on the corpse.
                    }
                    else
                    {
                        SetFlag(CorpseFlag.Carved, true);

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

                        from.SendLocalizedMessage(1062471);                           // You quickly gather all of your belongings.
                    }

                    SetFlag(CorpseFlag.SelfLooted, true);
                }
                #endregion

                if (!CheckLoot(from, null))
                {
                    return;
                }

                base.OnDoubleClick(from);
            }
            else
            {
                from.SendLocalizedMessage(500446);                   // That is too far away.
                return;
            }
        }
コード例 #3
0
ファイル: PlayerMobile.cs プロジェクト: nmcgill/UOReturns
        public override void Resurrect()
        {
            bool wasAlive = this.Alive;

            base.Resurrect();

            if ( this.Alive && !wasAlive )
            {
                Item deathRobe = new DeathRobe();

                if ( !EquipItem( deathRobe ) )
                    deathRobe.Delete();
            }
        }
コード例 #4
0
 public InternalTimer(DeathRobe c, TimeSpan delay)
     : base(delay)
 {
     this.m_Robe = c;
     this.Priority = TimerPriority.FiveSeconds;
 }
コード例 #5
0
ファイル: PlayerMobile.cs プロジェクト: Godkong/Origins
        public override void Resurrect()
        {
            bool wasAlive = this.Alive;

            base.Resurrect();

            if ( this.Alive && !wasAlive )
            {
                Item deathRobe = new DeathRobe();

                if ( !EquipItem( deathRobe ) || (this.Backpack != null && this.Backpack.Items.Count > 125) )
                    deathRobe.Delete();
            }
        }
コード例 #6
0
        public override void Resurrect()
        {
            bool wasAlive = this.Alive;

            base.Resurrect();

            if ( Alive && !wasAlive )
            {
                MagicDamageAbsorb = 0;
                MeleeDamageAbsorb = 0;

                Criminal = false;
                SkillHandlers.Stealing.ClearFor( this );

                Item deathRobe = null;
                if ( Backpack != null )
                {
                    deathRobe = Backpack.FindItemByType( typeof( DeathRobe ) );

                    if ( deathRobe == null )
                        deathRobe = deathRobe = Backpack.FindItemByType( typeof( Robe ) );
                }

                if ( deathRobe == null )
                    deathRobe = new DeathRobe();

                if ( !EquipItem( deathRobe ) )
                    deathRobe.Delete();
            }
        }
コード例 #7
0
		public override void Resurrect()
		{
			bool wasAlive = Alive;

			base.Resurrect();

			if (Alive && !wasAlive)
			{
				Item deathRobe = new DeathRobe();

				if (!EquipItem(deathRobe))
				{
					deathRobe.Delete();
                }
                #region Enhance Client
                if (this.NetState != null && this.NetState.IsKRClient)
                {
                    List<BaseHealer> listHealers = new List<BaseHealer>();
                    List<MondainQuester> listQuesters = new List<MondainQuester>();
                    foreach (Mobile m_mobile in World.Mobiles.Values)
                    {
                        MondainQuester mQuester = m_mobile as MondainQuester;
                        if (mQuester != null)
                            listQuesters.Add(mQuester);

                        BaseHealer mHealer = m_mobile as BaseHealer;
                        if (mHealer != null)
                            listHealers.Add(mHealer);
                    }

                    if (this.Corpse != null)
                        this.NetState.Send(new DisplayWaypoint(this.Corpse.Serial, this.Corpse.X, this.Corpse.Y, this.Corpse.Z, this.Corpse.Map.MapID, WaypointType.Corpse, this.Name));

                    foreach (BaseHealer healer in listHealers)
                        this.NetState.Send(new RemoveWaypoint(healer.Serial));

                    foreach (MondainQuester quester in listQuesters)
                    {
                        string name = string.Empty;
                        if (quester.Name != null)
                            name += quester.Name;
                        if (quester.Title != null)
                            name += " " + quester.Title;
                        this.Send(new DisplayWaypoint(quester.Serial, quester.X, quester.Y, quester.Z, quester.Map.MapID, WaypointType.QuestGiver, name));
                    }
                }
                #endregion

                #region Scroll of Alacrity
                if (AcceleratedStart > DateTime.UtcNow)
				{
					BuffInfo.AddBuff(this, new BuffInfo(BuffIcon.ArcaneEmpowerment, 1078511, 1078512, AcceleratedSkill.ToString()));
				}
				#endregion
			}
		}
コード例 #8
0
		public override void Resurrect()
		{
			bool wasAlive = this.Alive;

			base.Resurrect();

			if ( this.Alive && !wasAlive )
			{
				Item deathRobe = new DeathRobe();
				if ( !this.Backpack.CheckHold( this, deathRobe, false, true ) )
					deathRobe.Delete();
				else if ( !EquipItem( deathRobe ) )
					deathRobe.Delete();

                #region Scroll of Alacrity
                if (this.AcceleratedStart > DateTime.Now)
                {
                    BuffInfo.AddBuff(this, new BuffInfo(BuffIcon.ArcaneEmpowerment, 1078511, 1078512, this.AcceleratedSkill.ToString()));
                }
                #endregion
			}
		}
コード例 #9
0
        public virtual void Open(Mobile from, bool checkSelfLoot)
        {
            if (from.AccessLevel > AccessLevel.Player || from.InRange(this.GetWorldLocation(), 2))
            {
                #region Self Looting

                bool selfLoot = (checkSelfLoot && (from == m_Owner));

                if (selfLoot)
                {
                    List <Item> items = new List <Item>(this.Items);

                    bool gathered = false;
                    bool didntFit = false;

                    Container pack = from.Backpack;

                    bool checkRobe = true;

                    for (int i = 0; !didntFit && i < items.Count; ++i)
                    {
                        Item    item = items[i];
                        Point3D loc  = item.Location;

                        if (item.Layer == Layer.Hair)
                        {
                            continue;
                        }
                        if (item.Layer == Layer.FacialHair)
                        {
                            continue;
                        }
                        if (!GetRestoreInfo(item, ref loc))
                        {
                            continue;
                        }

                        if (checkRobe)
                        {
                            DeathRobe robe = from.FindItemOnLayer(Layer.OuterTorso) as DeathRobe;

                            if (robe != null)
                            {
                                if (Core.SE)
                                {
                                    robe.Delete();
                                }
                                else
                                {
                                    Map map = from.Map;

                                    if (map != null && map != Map.Internal)
                                    {
                                        robe.MoveToWorld(from.Location, map);
                                    }
                                }
                            }
                        }

                        if (m_EquipItems.Contains(item) && from.EquipItem(item))
                        {
                            gathered = true;
                        }

                        else if (pack != null && pack.CheckHold(from, item, false, true))
                        {
                            item.Location = loc;
                            pack.AddItem(item);
                            gathered = true;
                        }

                        else
                        {
                            didntFit = true;
                        }
                    }

                    if (gathered && !didntFit)
                    {
                        m_Carved = true;

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

                        from.PlaySound(0x3E3);
                        from.SendLocalizedMessage(1062471); // You quickly gather all of your belongings.

                        return;
                    }

                    if (gathered && didntFit)
                    {
                        from.SendLocalizedMessage(1062472); // You gather some of your belongings. The rest remain on the corpse.
                    }
                }

                #endregion

                if (!CheckLoot(from, null))
                {
                    return;
                }

                base.OnDoubleClick(from);

                if (from != m_Owner)
                {
                    from.RevealingAction();
                }
            }

            else
            {
                from.SendLocalizedMessage(500446); // That is too far away.
                return;
            }
        }
コード例 #10
0
            public void GoToPrison()
            {
                try
                {
                    if (m_Player == null || m_Player.Deleted)
                    {
                        return;
                    }

                    Account acct = m_Player.Account as Account;

                    // stable the players pets
                    StablePets(m_Staff, m_Player);

                    // drop holding
                    Item held = m_Player.Holding;
                    if (held != null)
                    {
                        held.ClearBounce();
                        if (m_Player.Backpack != null)
                        {
                            m_Player.Backpack.DropItem(held);
                        }
                    }
                    m_Player.Holding = null;

                    // move their items to the bank, overload if needed
                    Backpack  bag   = new Backpack();
                    ArrayList equip = new ArrayList(m_Player.Items);

                    if (m_Player.Backpack != null)
                    {
                        // count clothing items
                        int WornCount = 0;
                        foreach (Item i in equip)
                        {
                            if (Moongate.RestrictedItem(m_Player, i) == false)
                            {
                                continue;                                       // not clothes
                            }
                            else
                            {
                                WornCount++;
                            }
                        }

                        // Unequip any items being worn
                        foreach (Item i in equip)
                        {
                            if (Moongate.RestrictedItem(m_Player, i) == false)
                            {
                                continue;
                            }
                            else
                            {
                                m_Player.Backpack.DropItem(i);
                            }
                        }

                        // Get a count of all items in the player's backpack.
                        ArrayList items = new ArrayList(m_Player.Backpack.Items);

                        // Drop our new bag in the player's bank
                        m_Player.BankBox.DropItem(bag);

                        // Run through all items in player's pack, move them to the bag we just dropped in the bank
                        foreach (Item i in items)
                        {
                            m_Player.Backpack.RemoveItem(i);
                            bag.DropItem(i);
                        }
                    }

                    // handle imprisoning of logged out players
                    m_Player.MoveToWorld(m_Location, Map.Felucca);
                    if (m_Player.NetState == null)
                    {
                        m_Player.LogoutLocation = m_Location;
                        m_Player.Map            = Map.Internal;
                    }

                    // make them an inmate
                    m_Player.Inmate = true;

                    // Give them a Deathrobe, Stinger dagger, and a blank spell book
                    if (m_Player.Alive)
                    {
                        Item robe = new Server.Items.DeathRobe();
                        if (!m_Player.EquipItem(robe))
                        {
                            robe.Delete();
                        }
                    }

                    Item aiStinger = new Server.Items.AIStinger();
                    if (!m_Player.AddToBackpack(aiStinger))
                    {
                        aiStinger.Delete();
                    }

                    Item spellbook = new Server.Items.Spellbook();
                    if (!m_Player.AddToBackpack(spellbook))
                    {
                        spellbook.Delete();
                    }

                    m_Player.ShortTermCriminalCounts += 3;                                                              // how long you will stay
                    m_Player.LongTermCriminalCounts++;                                                                  // how many times you've been to prison

                    if (!m_Player.Alive && m_Player.NetState != null)
                    {
                        m_Player.CloseGump(typeof(Server.Gumps.ResurrectGump));
                        m_Player.SendGump(new Server.Gumps.ResurrectGump(m_Player, Server.Gumps.ResurrectMessage.Healer));
                    }

                    int sentence = (int)m_Player.ShortTermCriminalCounts * 4;                     // decay time in prison is 4 hours per count
                    m_Player.SendMessage("You have been imprisoned for {0} hours.", sentence);
                    m_Staff.SendMessage("{0} has been imprisoned for {1} hours.", m_Player.Name, sentence);

                    LogHelper Logger = new LogHelper("Prison.log", false, true);

                    Logger.Log(LogType.Mobile, m_Player, string.Format("{0}:{1}:{2}:{3}",
                                                                       m_Staff.Name,
                                                                       m_Staff.Location,
                                                                       m_Comment,
                                                                       sentence));
                    Logger.Finish();

                    Commands.CommandLogging.WriteLine(m_Staff, "{0} imprisoned {1}(Username: {2}) for {4} hours with reason: {3}.",
                                                      m_Staff.Name, m_Player.Name, acct.Username, m_Comment, sentence);
                    acct.Comments.Add(new AccountComment(m_Staff.Name, DateTime.Now + "\nTag count: " + (acct.Comments.Count + 1) + "\nImprisoned for " + sentence + " hours. Reason: " + m_Comment));
                }
                catch (Exception ex)
                {
                    LogHelper.LogException(ex);
                }
            }
コード例 #11
0
		public override void OnDamagedBySpell( Mobile from )
		{
			if (from.Combatant == null)
			return;

			Mobile m = from.Combatant;						

			if (m.Body == 58)
				m.Say( "I now own your soul!!!" ); 

			if (m.Body != from.Body)
                    	{
				m.BoltEffect( 0 );

				m.Body = from.Body; 
				m.Hue = from.Hue; 
				m.Name = from.Name;

      				m.Fame = from.Fame;
      				m.Karma = (0-from.Karma);
      				m.Title = from.Title;
      	 			
      				m.Str = from.Str;
      				m.Int = from.Int;
				m.Dex = from.Dex;

      				m.Hits =from.Hits + 2000;

      				m.Dex = from.Dex;
      				m.Mana = from.Mana;
      				m.Stam = from.Stam;

				m.Female = from.Female;
      	
      				m.VirtualArmor = (from.VirtualArmor +95);
      	
				Item hair = new Item( Utility.RandomList( 8265 ) );
				hair.Hue = 1167;
				hair.Layer = Layer.Hair;
				hair.Movable = false;
				m.AddItem( hair );

				Kasa hat = new Kasa();				
				hat.Hue = 1167;
				hat.Movable = false;
				m.AddItem( hat );

				DeathRobe robe = new DeathRobe();
				robe.Name = "Death Robe";
				robe.Hue = 1167;
				robe.Movable = false;
				m.AddItem( robe );
		
				Sandals sandals = new Sandals();				
				sandals.Hue = 1167;
				sandals.Movable = false;
				m.AddItem( sandals );				

				BagOfAllReagents bag = new BagOfAllReagents();
				m.AddToBackpack( bag );
			
				m.BoltEffect( 0 );
			}
			switch ( Utility.Random( 5 ) )
			{
				
				case 0: m.Say( "We are now one with each other!!" ); break;
				case 1: m.Say( "Your weak spells have no effect on me, muahahaha!!" ); break;
				case 2: m.Say( "Your end is near young adventurer!!" ); break;
				case 3: m.Say( "Thou shalt not pass my post!!" ); break;
				case 4: m.Say( "I now own your soul!!!" ); break;
			}
			from.BoltEffect( 0 );
			from.Damage( Utility.Random( 1, 50 ) );
			m.Hits += ( Utility.Random( 1, 50 ) );
		}
コード例 #12
0
ファイル: Corpse.cs プロジェクト: zerodowned/last-wish
        public virtual void Open(Mobile from, bool checkSelfLoot)
        {
            if (from.AccessLevel > AccessLevel.Player || from.InRange(this.GetWorldLocation(), 2))
            {
                #region Self Looting
                if (checkSelfLoot && from == m_Owner && !GetFlag(CorpseFlag.SelfLooted) && this.Items.Count != 0)
                {
                    DeathRobe robe = from.FindItemOnLayer(Layer.OuterTorso) as DeathRobe;

                    if (robe != null)
                    {
                        Map map = from.Map;

                        if (map != null && map != Map.Internal)
                        {
                            robe.MoveToWorld(from.Location, map);
                            robe.BeginDecay();
                        }
                    }

                    Container pack = from.Backpack;

                    if (m_RestoreEquip != null && pack != null)
                    {
                        List <Item> packItems = new List <Item>(pack.Items);                         // Only items in the top-level pack are re-equipped

                        for (int i = 0; i < packItems.Count; i++)
                        {
                            Item packItem = packItems[i];

                            if (m_RestoreEquip.Contains(packItem) && packItem.Movable)
                            {
                                from.EquipItem(packItem);
                            }
                        }
                    }

                    List <Item> items = new List <Item>(this.Items);

                    bool didntFit = false;

                    for (int i = 0; !didntFit && i < items.Count; ++i)
                    {
                        Item    item = items[i];
                        Point3D loc  = item.Location;

                        if ((item.Layer == Layer.Hair || item.Layer == Layer.FacialHair) || !item.Movable || !GetRestoreInfo(item, ref loc))
                        {
                            continue;
                        }

                        if (pack != null && pack.CheckHold(from, item, false, true))
                        {
                            item.Location = loc;
                            pack.AddItem(item);

                            if (m_RestoreEquip != null && m_RestoreEquip.Contains(item))
                            {
                                from.EquipItem(item);
                            }
                        }
                        else
                        {
                            didntFit = true;
                        }
                    }

                    from.PlaySound(0x3E3);

                    if (this.Items.Count != 0)
                    {
                        from.SendLocalizedMessage(1062472);                           // You gather some of your belongings. The rest remain on the corpse.
                    }
                    else
                    {
                        SetFlag(CorpseFlag.Carved, true);

                        this.Delete();

                        from.SendLocalizedMessage(1062471);                           // You quickly gather all of your belongings.
                    }

                    SetFlag(CorpseFlag.SelfLooted, true);
                }
                #endregion

                if (!CheckLoot(from, null))
                {
                    return;
                }

                #region Quests
                PlayerMobile player = from as PlayerMobile;

                if (player != null)
                {
                    QuestSystem qs = player.Quest;

                    if (qs is UzeraanTurmoilQuest)
                    {
                        GetDaemonBoneObjective obj = qs.FindObjective(typeof(GetDaemonBoneObjective)) as GetDaemonBoneObjective;

                        if (obj != null && obj.CorpseWithBone == this && (!obj.Completed || UzeraanTurmoilQuest.HasLostDaemonBone(player)))
                        {
                            Item bone = new QuestDaemonBone();

                            if (player.PlaceInBackpack(bone))
                            {
                                obj.CorpseWithBone = null;
                                player.SendLocalizedMessage(1049341, "", 0x22);                                   // You rummage through the bones and find a Daemon Bone!  You quickly place the item in your pack.

                                if (!obj.Completed)
                                {
                                    obj.Complete();
                                }
                            }
                            else
                            {
                                bone.Delete();
                                player.SendLocalizedMessage(1049342, "", 0x22);                                   // Rummaging through the bones you find a Daemon Bone, but can't pick it up because your pack is too full.  Come back when you have more room in your pack.
                            }

                            return;
                        }
                    }
                    else if (qs is TheSummoningQuest)
                    {
                        VanquishDaemonObjective obj = qs.FindObjective(typeof(VanquishDaemonObjective)) as VanquishDaemonObjective;

                        if (obj != null && obj.Completed && obj.CorpseWithSkull == this)
                        {
                            GoldenSkull sk = new GoldenSkull();

                            if (player.PlaceInBackpack(sk))
                            {
                                obj.CorpseWithSkull = null;
                                player.SendLocalizedMessage(1050022);                                   // For your valor in combating the devourer, you have been awarded a golden skull.
                                qs.Complete();
                            }
                            else
                            {
                                sk.Delete();
                                player.SendLocalizedMessage(1050023);                                   // You find a golden skull, but your backpack is too full to carry it.
                            }
                        }
                    }
                }

                #endregion

                base.OnDoubleClick(from);
            }
            else
            {
                from.SendLocalizedMessage(500446);                   // That is too far away.
                return;
            }
        }
コード例 #13
0
ファイル: PlayerMobile.cs プロジェクト: guy489/runuot2a
        public override void Resurrect()
        {
            bool wasAlive = this.Alive;

            base.Resurrect();

            if ( this.Alive && !wasAlive )
            {
                bool found = true;
                Item deathRobe = Backpack.FindItemByType(typeof(DeathRobe), false);
                if(deathRobe == null) {
                    deathRobe = new DeathRobe();
                    found = false;
                }

                if ( !EquipItem( deathRobe ) && !found )
                    deathRobe.Delete();
            }
        }
コード例 #14
0
		public override void OnDamagedBySpell( Mobile from )
		{
			if (Combatant == null)
				return;

			if (Body == 58)
				Say( "I will steal your Body and now your Soul..." );

			if (Body != from.Body)
            {
                BoltEffect( 0 );

                Body = from.Body;
                Hue = from.Hue;
                Name = from.Name;

                Fame = from.Fame;
                Karma = (0 -from.Karma);
                Title = from.Title;

                Str = from.Str;
                Int = from.Int;
                Dex = from.Dex;

                Hits = from.Hits;

                Dex = from.Dex;
                Mana = from.Mana;
                Stam = from.Stam;

                Female = from.Female;

                VirtualArmor = (from.VirtualArmor);

                Item hair = new Item( Utility.RandomList( 8265 ) );
                hair.Hue = 1153;
                hair.Layer = Layer.Hair;
                hair.Movable = false;
                AddItem( hair );

                JesterHat hat = new JesterHat();
                hat.Hue = 1175;
                hat.Movable = false;
                AddItem( hat );

                DeathRobe robe = new DeathRobe();
                robe.Hue = 1175;
                robe.Movable = false;
                AddItem( robe );

                Sandals sandals = new Sandals();
                sandals.Hue = 1;
                sandals.Movable = false;
                AddItem( sandals );

                Spellbook book = new Spellbook( UInt64.MaxValue );
                book.Hue = 1175;
                book.Movable = false;
                AddItem( book );

                BoltEffect( 0 );
			}
			switch ( Utility.Random( 6 ) )
			{
				case 0: Say( "You can not win with magic..." ); break;
				case 1: Say( "Your image is weak as is your mind..." ); break;
				case 2: Say( "It feels good to wear your skin..." ); break;
				case 3: Say( "I'll take over your life as soon as I end it..." ); break;
				case 4: Say( "Don't you like having a twin..." ); break;
				case 5: Say( "You lack the skills to defeat me..." ); break;
			}
			from.BoltEffect( 0 );
			from.Damage( Utility.Random( 20, 40 ) );
			Hits += ( Utility.Random( 20, 40 ) );
		}
コード例 #15
0
ファイル: PlayerMobile.cs プロジェクト: greeduomacro/annox
        public override void Resurrect()
        {
            bool wasAlive = this.Alive;

            base.Resurrect();

            if (this.Alive && !wasAlive)
            {
                Item deathRobe = new DeathRobe();

                if (!EquipItem(deathRobe))
                    deathRobe.Delete();

                //24MAR2008 Lucid's Anti Res Kill System *** START ***
                this.Blessed = true;
                this.Frozen = true;
                this.SendGump(new AntiResKillGump());
                //24MAR2008 Lucid's Anti Res Kill System *** END   ***
            }
        }
コード例 #16
0
		public override void Resurrect()
		{
			bool wasAlive = this.Alive;

			if (Mortal && AccessLevel == AccessLevel.Player)
			{
				SendMessage("Thy soul was too closely intertwined with thy flesh - thou'rt unable to incorporate a new body.");
				return;
			}

			base.Resurrect();

			// Savage kin paint re-application

			if(this.SavagePaintExpiration != TimeSpan.Zero)
			{
				// this.BodyMod = ( this.Female ? 184 : 183 );
				this.HueMod = 0;
			}

			if ( this.Alive && !wasAlive )
			{
                // restore sight to blinded ghosts
                Blind = false;                          // we can see again
                m_SightExpire = DateTime.MaxValue;      // kill timer

				bool bNewDeathrobe = true;
				if( this.Backpack != null )
				{
					Item oldDeathrobe = this.Backpack.FindItemByType( typeof( DeathRobe ), false );
					if( oldDeathrobe != null )
					{
						bNewDeathrobe = false;
						EquipItem( oldDeathrobe );
					}
				}
				if( bNewDeathrobe )
				{
					Item deathRobe = new DeathRobe();

					if ( !EquipItem( deathRobe ) )
						deathRobe.Delete();
				}

				if ( Inmate )
				{
					//When resrrecting, make sure our counts are reduced

					TimeSpan deadtime = TimeSpan.FromMinutes(0.0);
					if( m_InmateLastDeathTime == DateTime.MinValue )
					{
						//effectively 0 deadtime if it's set to minvalue
					}
					else
					{
						deadtime = DateTime.Now - m_InmateLastDeathTime;
					}

					//reduce short term by 4 hours minus half the time spent dead (modulo 8 hours)
					m_ShortTermElapse -= (TimeSpan.FromHours(4.0) - TimeSpan.FromSeconds( (deadtime.TotalSeconds%28800)/2 ) );
					//reduce long term by 20 hours minus half the time spent dead (modulo 40 hours)
					m_LongTermElapse -= (TimeSpan.FromHours(20.0) - TimeSpan.FromSeconds( (deadtime.TotalSeconds%144000)/2 ) );
				}

				InvalidateMyRunUO();
			}
		}
コード例 #17
0
ファイル: Corpse.cs プロジェクト: thehaunted88/ServUO
        public virtual void Open(Mobile from, bool checkSelfLoot)
        {
            if (from.IsStaff() || from.InRange(GetWorldLocation(), 2))
            {
                #region Self Looting
                bool selfLoot = (checkSelfLoot && (from == m_Owner));

                if (selfLoot)
                {
                    SetFlag(CorpseFlag.SelfLooted, true);

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

                    bool gathered = false;

                    for (int k = 0; k < EquipItems.Count; ++k)
                    {
                        Item item2 = EquipItems[k];

                        if (!items.Contains(item2) && item2.IsChildOf(from.Backpack))
                        {
                            items.Add(item2);
                            gathered = true;
                        }
                    }

                    bool didntFit = false;

                    Container pack = from.Backpack;

                    for (int i = 0; !didntFit && i < items.Count; ++i)
                    {
                        Item    item = items[i];
                        Point3D loc  = item.Location;

                        if ((item.Layer == Layer.Hair || item.Layer == Layer.FacialHair) || !item.Movable)
                        {
                            continue;
                        }

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

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

                        if (m_EquipItems.Contains(item) && from.EquipItem(item))
                        {
                            gathered = true;
                        }
                        else if (pack != null && pack.CheckHold(from, item, false, true))
                        {
                            item.Location = loc;
                            pack.AddItem(item);
                            gathered = true;
                        }
                        else
                        {
                            didntFit = true;
                        }
                    }

                    if (gathered && !didntFit)
                    {
                        SetFlag(CorpseFlag.Carved, true);

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

                        from.PlaySound(0x3E3);
                        from.SendLocalizedMessage(1062471); // You quickly gather all of your belongings.
                        items.Clear();
                        m_EquipItems.Clear();
                        return;
                    }

                    if (gathered)
                    {
                        from.SendLocalizedMessage(1062472); // You gather some of your belongings. The rest remain on the corpse.
                    }
                }
                #endregion

                if (!CheckLoot(from, null))
                {
                    return;
                }

                #region Quests
                PlayerMobile player = from as PlayerMobile;

                if (player != null)
                {
                    QuestSystem qs = player.Quest;

                    if (qs is TheSummoningQuest)
                    {
                        VanquishDaemonObjective obj = qs.FindObjective(typeof(VanquishDaemonObjective)) as VanquishDaemonObjective;

                        if (obj != null && obj.Completed && obj.CorpseWithSkull == this)
                        {
                            GoldenSkull sk = new GoldenSkull();

                            if (player.PlaceInBackpack(sk))
                            {
                                obj.CorpseWithSkull = null;
                                player.SendLocalizedMessage(1050022);
                                // For your valor in combating the devourer, you have been awarded a golden skull.
                                qs.Complete();
                            }
                            else
                            {
                                sk.Delete();
                                player.SendLocalizedMessage(1050023); // You find a golden skull, but your backpack is too full to carry it.
                            }
                        }
                    }
                }
                #endregion

                base.OnDoubleClick(from);
            }
            else
            {
                from.SendLocalizedMessage(500446); // That is too far away.
            }
        }
コード例 #18
0
ファイル: PlayerMobile.cs プロジェクト: g4idrijs/ServUO
		public override void Resurrect()
		{
			bool wasAlive = Alive;

			base.Resurrect();

			if (Alive && !wasAlive)
			{
				Item deathRobe = new DeathRobe();

				if (!EquipItem(deathRobe))
				{
					deathRobe.Delete();
				}

				#region Scroll of Alacrity
				if (AcceleratedStart > DateTime.UtcNow)
				{
					BuffInfo.AddBuff(this, new BuffInfo(BuffIcon.ArcaneEmpowerment, 1078511, 1078512, AcceleratedSkill.ToString()));
				}
				#endregion
			}
		}
コード例 #19
0
ファイル: OuterTorso.cs プロジェクト: 3HMonkey/DefianceUOR
 public InternalTimer(DeathRobe c, TimeSpan delay) : base(delay) => _robe = c;
コード例 #20
0
ファイル: PlayerMobile.cs プロジェクト: Telm/RunUO_EME
        /* private static void EquipItem(Item item)
        {
            EquipItem(item, false);
        }

        private static void EquipItem(Item item, bool mustEquip)
        {

            if (!Core.AOS)
                item.LootType = LootType.Newbied;

            if (from != null && from.EquipItem(item))
                return;

            Container pack = from.Backpack;

            if (!mustEquip && pack != null)
                pack.DropItem(item);
            else
                item.Delete();
        }*/
        /*
        private static void PackEquipItem(Item item)
        {
            PlayerMobile from = this.Mobile;
            if (!Core.AOS)
                item.LootType = LootType.Newbied;

            if (from != null && from.EquipItem(item))
                return;

            Container pack = from.Backpack;

            if (pack != null)
                pack.DropItem(item);
            else
                item.Delete();
        }*/
        public override void Resurrect()
        {
            bool wasAlive = this.Alive;

            this.m_ADShieldTime = DateTime.Now;
            if (this.m_ADShieldTimer != null)
            {
                this.StopTimer();
            }
            else
            {
                this.m_ADShieldTimer = new ADShieldTimer(this, c_ADShield);
                this.m_ADShieldTimer.Start();
            }

            this.SendAsciiMessage("Masz 30 sekund na ucieczke nim ktos zauwazy, ze jeszcze zyjesz");
            if (this.m_DeathTimer != null)
            {
                this.m_DeathTimer.Stop();
                this.m_DeathTimer = null;
            };

            //int z = Map.GetAverageZ( this.X, this.Y );
            //this.Z = z;
            if (this.Corpse == null)
            {
                this.SendAsciiMessage("Twoje cialo zniknelo ze swiata, zostajesz przeniesiony do miasta startowego");
                this.SendGump(new MiastoStartoweGump(this, this));
                //this.Location = this.Corpse.Location;
                this.Frozen = false;
            }
            else
            {
                this.Location = this.Corpse.Location;
                this.Frozen = false;
                #region Self MoveItemsToPackFromCorpse
                if (this.Corpse.Items.Count != 0)
                {
                    Container pack = this.Corpse;
                    Container bpack = this.Backpack;
                    if (pack != null && bpack != null)
                    {
                        List<Item> packCorpseItems = new List<Item>(this.Corpse.Items);
                        for (int i = 0; i < packCorpseItems.Count; i++)
                        {
                            Item packCorpseItem = packCorpseItems[i];
                            //this.PackItem(packCorpseItem);
                            bpack.DropItem(packCorpseItem);
                        }
                    }
                }
                #endregion
                this.Corpse.Delete();
            }

            //Server.Items.Corpse Corpses = new Server.Items.Corpse();
            //Server.Items.Corpse.CorpseDelay(this);

            base.Resurrect();

            if ( this.Alive && !wasAlive )
            {
                Item deathRobe = new DeathRobe();

                if ( !EquipItem( deathRobe ) )
                    deathRobe.Delete();
            }
        }
コード例 #21
0
        public override void Resurrect()
        {
            bool wasAlive = this.Alive;

            base.Resurrect();

            if (this.Alive && !wasAlive)
            {
                Item deathRobe = new DeathRobe();

                if (!EquipItem(deathRobe))
                    deathRobe.Delete();
            }

            #region GeNova: KR Support
            if (this.NetState != null && this.NetState.IsKRClient)
            {
                List<BaseHealer> listHealers = new List<BaseHealer>();
                List<MondainQuester> listQuesters = new List<MondainQuester>();
                foreach (Mobile m_mobile in World.Mobiles.Values)
                {
                    MondainQuester mQuester = m_mobile as MondainQuester;
                    if (mQuester != null)
                        listQuesters.Add(mQuester);

                    BaseHealer mHealer = m_mobile as BaseHealer;
                    if (mHealer != null)
                        listHealers.Add(mHealer);
                }

                if (this.Corpse != null)
                    this.NetState.Send(new DisplayWaypoint(this.Corpse.Serial, this.Corpse.X, this.Corpse.Y, this.Corpse.Z, this.Corpse.Map.MapID, 1, this.Name));

                foreach (BaseHealer healer in listHealers)
                    this.NetState.Send(new HideWaypoint(healer.Serial));

                foreach (MondainQuester quester in listQuesters)
                {
                    string name = string.Empty;
                    if (quester.Name != null)
                        name += quester.Name;
                    if (quester.Title != null)
                        name += " " + quester.Title;
                    this.Send(new DisplayWaypoint(quester.Serial, quester.X, quester.Y, quester.Z, quester.Map.MapID, 4, name));
                }
            }
            #endregion
        }
コード例 #22
0
		public override void Resurrect()
		{
			bool wasAlive = Alive;

			base.Resurrect();

			if (Alive && !wasAlive)
			{
				Item deathRobe = new DeathRobe();

				if (!EquipItem(deathRobe))
				{
					deathRobe.Delete();
				}
			}

			FactionDeath = false;
		}
コード例 #23
0
 public InternalTimer(DeathRobe c, TimeSpan delay) : base(delay)
 {
     m_Robe   = c;
     Priority = TimerPriority.FiveSeconds;
 }
コード例 #24
0
ファイル: Corpse.cs プロジェクト: dpisanu/xrunuo
        public virtual void Open(Mobile from, bool checkSelfLoot)
        {
            if (from.AccessLevel > AccessLevel.Player || from.InRange(this.GetWorldLocation(), 2))
            {
                #region Self Looting
                bool selfLoot = (checkSelfLoot && (from == m_Owner));

                if (selfLoot)
                {
                    if (from is PlayerMobile && from.NetState != null && from.NetState.Version.IsEnhanced)
                    {
                        PlayerMobile pm = (PlayerMobile)from;

                        pm.Send(new RemoveWaypoint(this.Serial.Value));
                        pm.CheckKRStartingQuestStep(27);
                    }

                    ArrayList items = new ArrayList(this.Items);

                    bool gathered = false;
                    bool didntFit = false;

                    Container pack = from.Backpack;

                    bool checkRobe = true;

                    for (int i = 0; !didntFit && i < items.Count; ++i)
                    {
                        Item    item = (Item)items[i];
                        Point3D loc  = item.Location;

                        if ((item.Layer == Layer.Hair || item.Layer == Layer.FacialHair) || !item.Movable || !GetRestoreInfo(item, ref loc))
                        {
                            continue;
                        }

                        if (checkRobe)
                        {
                            DeathRobe robe = from.FindItemOnLayer(Layer.OuterTorso) as DeathRobe;

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

                        if (m_EquipItems.Contains(item) && from.EquipItem(item))
                        {
                            gathered = true;
                        }
                        else if (pack != null && pack.CheckHold(from, item, false, true))
                        {
                            item.Location = loc;
                            pack.AddItem(item);
                            gathered = true;
                        }
                        else
                        {
                            didntFit = true;
                        }
                    }

                    if (gathered && !didntFit)
                    {
                        SetFlag(CorpseFlag.Carved, true);

                        if (ItemID == 0x2006)
                        {
                            ProcessDelta();
                            SendRemovePacket();
                            ItemID    = Utility.Random(0xECA, 9);                            // bone graphic
                            Hue       = 0;
                            Direction = Direction.North;
                            ProcessDelta();
                        }

                        from.PlaySound(0x3E3);
                        from.SendLocalizedMessage(1062471);                           // You quickly gather all of your belongings.

                        try
                        {
                            if (from is PlayerMobile && m_InsuredItems != null)
                            {
                                ArrayList   bagitems     = new ArrayList(from.Backpack.Items);
                                List <Item> insureditems = m_InsuredItems;

                                foreach (Item item in bagitems)
                                {
                                    if (insureditems.Contains(item))
                                    {
                                        Item move = from.FindItemOnLayer(item.Layer);

                                        if (move == null)
                                        {
                                            from.EquipItem(item);
                                        }
                                    }
                                }

                                m_InsuredItems = null;
                            }
                        }
                        catch
                        {
                        }

                        return;
                    }

                    if (gathered && didntFit)
                    {
                        from.SendLocalizedMessage(1062472);                           // You gather some of your belongings. The rest remain on the corpse.
                    }
                }

                #endregion

                if (!CheckLoot(from))
                {
                    return;
                }

                #region Quests
                PlayerMobile player = from as PlayerMobile;

                if (player != null)
                {
                    QuestSystem qs = player.Quest;

                    if (qs is TheSummoningQuest)
                    {
                        var obj = qs.FindObjective <VanquishDaemonObjective>();

                        if (obj != null && obj.Completed && obj.CorpseWithSkull == this)
                        {
                            var sk = new GoldenSkull();

                            if (player.PlaceInBackpack(sk))
                            {
                                obj.CorpseWithSkull = null;
                                player.SendLocalizedMessage(1050022);                                   // For your valor in combating the devourer, you have been awarded a golden skull.
                                qs.Complete();
                            }
                            else
                            {
                                sk.Delete();
                                player.SendLocalizedMessage(1050023);                                   // You find a golden skull, but your backpack is too full to carry it.
                            }
                        }
                    }
                }

                #endregion

                if (m_Owner is WeakSkeleton && from is PlayerMobile)
                {
                    ((PlayerMobile)from).CheckKRStartingQuestStep(20);
                }

                base.OnDoubleClick(from);

                if (from != m_Owner)
                {
                    from.RevealingAction();
                }
            }
            else
            {
                from.SendLocalizedMessage(500446);                   // That is too far away.
                return;
            }
        }