示例#1
0
 public CampfireEntry(PlayerMobile player, Campfire fire)
 {
     m_Player = player;
     m_Fire   = fire;
     m_Start  = DateTime.UtcNow;
     m_Safe   = false;
 }
示例#2
0
		public CampfireRegion( Campfire campfire, Region existingRegion ) : base( "", "", campfire.Map )
		{
			Priority = Region.HousePriority;
			LoadFromXml = false;
			m_Campfire = campfire;
			m_ExistingRegion = existingRegion;
		}
示例#3
0
 public CampfireEntry(PlayerMobile player, Campfire fire)
 {
     this.m_Player = player;
     this.m_Fire   = fire;
     this.m_Start  = DateTime.Now;
     this.m_Safe   = false;
 }
示例#4
0
            public DecayTimer(Campfire owner) : base(TimeSpan.FromSeconds(1), TimeSpan.FromSeconds(1))
            {
                Priority = TimerPriority.TwoFiftyMS;

                m_Owner     = owner;
                m_StartTime = DateTime.Now;
            }
示例#5
0
 public CampfireEntry(PlayerMobile player, Campfire fire)
 {
     m_Player = player;
     m_Fire   = fire;
     m_Start  = Core.Now;
     m_Safe   = false;
 }
示例#6
0
        public override void OnDoubleClick(Mobile from)
        {
            if (RootParent == from || (from.InRange(GetWorldLocation(), 3) && from.InLOS(GetWorldLocation())))
            {
                if (!Unrolled)
                {
                    Unroll();
                    MoveToWorld(from.Location, from.Map);
                }
                else if (ItemID == 0x0A55)
                {
                    if (Parent == null)
                    {
                        IPooledEnumerable eable = from.GetItemsInRange(7);
                        Campfire          fire  = null;
                        foreach (Item item in eable)
                        {
                            if (item is Campfire)
                            {
                                fire = (Campfire)item;
                                break;
                            }
                        }
                        eable.Free();

                        if (fire != null)
                        {
                            if (fire.CanLogout(from))
                            {
                                new BedRollLogoutMenu().SendTo(from.NetState);
                            }
                            else
                            {
                                from.SendAsciiMessage("Your camp is not yet secure.");
                            }
                        }
                        else
                        {
                            Roll();
                            from.AddToBackpack(this);
                        }
                    }
                    else
                    {
                        // is in a container (not on ground)
                        Roll();
                        from.AddToBackpack(this);
                    }
                }
            }
            else
            {
                from.SendAsciiMessage("You must be closer to use that.");
            }
        }
示例#7
0
        public override void OnDoubleClick(Mobile from)
        {
            if (from == TrapOwner)
            {
                this.Delete();
                from.SendMessage("You successfully remove the trap.");
            }
            else
            {
                int trapmaxskill  = (int)Math.Round(from.Skills.RemoveTrap.Value) + (int)Math.Round(from.Skills.Tinkering.Value) + 50;
                int bonusmaxskill = (int)Math.Round(from.Skills[BonusSkill].Value);
                trapmaxskill += bonusmaxskill;
                int           trapminskill = trapmaxskill - 20;
                int           trappower    = this.TrapPower;
                int           trapcheck    = Utility.RandomMinMax(trapminskill, trapmaxskill);
                CampfireEntry entry        = Campfire.GetEntry(from);

                if (entry != null && entry.Safe)
                {
                    trapcheck += 20;
                }

                if (trappower > trapmaxskill)
                {
                    from.SendMessage("You have no chance of removing this trap.");
                    return;
                }

                if (lastused + delay > DateTime.Now)
                {
                    from.SendMessage("You must wait 7 seconds between uses.");
                    return;
                }
                else
                {
                    lastused = DateTime.Now;
                }

                if (trapcheck >= trappower)
                {
                    this.Delete();
                    from.SendMessage("You successfully remove the trap.");
                }
                else
                {
                    from.SendMessage("You fail to remove the trap.");

                    if (0.5 >= Utility.RandomDouble())
                    {
                        from.SendMessage("You accidently trigger one of the trap's components. It damages you before you can deactive it.");
                        Spells.SpellHelper.Damage(TimeSpan.FromSeconds(0.5), from, from, Utility.RandomMinMax(15, 25), 100, 0, 0, 0, 0);
                    }
                }
            }
        }
示例#8
0
        public override void OnDoubleClick(Mobile from)
        {
            if (!from.InRange(GetWorldLocation(), 2))
            {
                from.SendLocalizedMessage(500446);                   // That is too far away.
                return;
            }

            IPooledEnumerable eable = this.Map.GetItemsInRange(this.Location, 3);

            foreach (Item item in eable)
            {
                if (item is Campfire)
                {
                    Campfire campfire = item as Campfire;
                    if (campfire.CampSecure && campfire.Camper == from)
                    {
                        campfire.OwnerUsedBedroll = true;
                        from.SendGump(new CampLogoutGump(from, this));
                        eable.Free();
                        return;
                    }
                }
            }

            eable.Free();

            this.Consume();
            int x = from.X, y = from.Y;

            switch (from.Direction & Direction.Mask)
            {
            case Direction.North: --y; break;

            case Direction.South: ++y; break;

            case Direction.West:  --x; break;

            case Direction.East:  ++x; break;

            case Direction.Up:    --x; --y; break;

            case Direction.Down:  ++x; ++y; break;

            case Direction.Left:  --x; ++y; break;

            case Direction.Right: ++x; --y; break;
            }

            new Bedroll().MoveToWorld(new Point3D(x, y, from.Z), from.Map);
        }
示例#9
0
        public static bool CheckMusicianship(Mobile m)
        {
            CampfireEntry entry = Campfire.GetEntry(m);

            m.CheckSkill(SkillName.Musicianship, 0.0, 120.0);
            if (entry != null && entry.Safe)
            {
                return(((m.Skills[SkillName.Musicianship].Value + 20) / 100) > Utility.RandomDouble());
            }
            else
            {
                return((m.Skills[SkillName.Musicianship].Value / 100) > Utility.RandomDouble());
            }
        }
示例#10
0
        public override void OnDoubleClick(Mobile from)
        {
            if (this.Parent != null || !this.VerifyMove(from))
            {
                return;
            }

            if (!from.InRange(this, 2))
            {
                from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045);                 // I can't reach that.
                return;
            }

            //adam : if within a rectricted camping zone then don't allow camping, i.e., a ransom chest rect
            if (CampHelper.InRestrictedArea(from))
            {
                from.SendMessage("You do not consider it safe to secure a camp here");
                return;
            }

            if (this.ItemID == 0xA57)             // rolled
            {
                Direction dir = PlayerMobile.GetDirection4(from.Location, this.Location);

                if (dir == Direction.North || dir == Direction.South)
                {
                    this.ItemID = 0xA55;
                }
                else
                {
                    this.ItemID = 0xA56;
                }
            }
            else             // unrolled
            {
                this.ItemID = 0xA57;

                if (!from.HasGump(typeof(LogoutGump)))
                {
                    CampfireEntry entry = Campfire.GetEntry(from);

                    if (entry != null && entry.Safe)
                    {
                        from.SendGump(new LogoutGump(entry, this));
                    }
                }
            }
        }
示例#11
0
        public void CheckExistingCampfires(Mobile from)
        {
            if (from == null)
            {
                return;
            }

            Campfire oldestCampfire = null;

            int campfireCount = 0;

            for (int a = 0; a < Campfire.m_Instances.Count; a++)
            {
                Campfire campfire = Campfire.m_Instances[a];

                if (campfire == null)
                {
                    continue;
                }
                if (campfire.Deleted)
                {
                    continue;
                }
                if (campfire.m_CreatedBy != from)
                {
                    continue;
                }

                campfireCount++;

                if (oldestCampfire == null)
                {
                    oldestCampfire = campfire;
                }
            }

            if (campfireCount >= 5 && oldestCampfire != null)
            {
                if (!oldestCampfire.Deleted)
                {
                    oldestCampfire.Delete();
                }
            }
        }
示例#12
0
        public override void OnDoubleClick(Mobile from)
        {
            if (!VerifyMove(from))
            {
                return;
            }

            if (!from.InRange(GetWorldLocation(), 2))
            {
                from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that.
                return;
            }

            Point3D fireLocation = GetFireLocation(from);

            if (fireLocation == Point3D.Zero)
            {
                from.SendMessage("Voce ascendeu a fogueira"); // There is not a spot nearby to place your campfire.
            }
            else if (!from.CheckSkill(SkillName.Camping, 0.0, 100.0))
            {
                from.SendMessage("Voce nao conseguir ascender a fogueira"); // You fail to ignite the campfire.
            }
            else
            {
                Consume();

                if (!Deleted && Parent == null)
                {
                    from.PlaceInBackpack(this);
                }

                var campfire = new Campfire();
                campfire.nomeDeQUemAscendeu = from.Name;

                campfire.MoveToWorld(fireLocation, from.Map);

                if (from.Skills[SkillName.Camping].Value >= 80)
                {
                    campfire.regenera = true;
                    from.SendMessage("Voce ascende a fogueira com perfeicao. Esta fogueira regenerara HP e Stamina de jogadores proximos."); // You fail to ignite the campfire.
                }
            }
        }
示例#13
0
        public override void OnDoubleClick(Mobile from)
        {
            if (Parent != null || !VerifyMove(from))
            {
                return;
            }

            if (!from.InRange(this, 2))
            {
                from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that.
                return;
            }

            if (ItemID == 0xA57) // rolled
            {
                Direction dir = PlayerMobile.GetDirection4(from.Location, Location);

                if (dir == Direction.North || dir == Direction.South)
                {
                    ItemID = 0xA55;
                }
                else
                {
                    ItemID = 0xA56;
                }
            }
            else // unrolled
            {
                ItemID = 0xA57;

                if (!from.HasGump(typeof(LogoutGump)))
                {
                    CampfireEntry entry = Campfire.GetEntry(from);

                    if (entry != null && entry.Safe)
                    {
                        from.SendGump(new LogoutGump(entry, this));
                    }
                }
            }
        }
示例#14
0
            public override void OnResponse(NetState sender, RelayInfo info)
            {
                PlayerMobile pm = m_Entry.Player;

                m_CloseTimer.Stop();

                if (Campfire.GetEntry(pm) != m_Entry)
                {
                    return;
                }

                if (info.ButtonID == 1 && m_Entry.Safe && m_BlanketOfDarkness.Parent == null && m_BlanketOfDarkness.IsAccessibleTo(pm) &&
                    m_BlanketOfDarkness.VerifyMove(pm) && m_BlanketOfDarkness.Map == pm.Map && pm.InRange(m_BlanketOfDarkness, 2))
                {
                    pm.PlaceInBackpack(m_BlanketOfDarkness);

                    pm.BlanketOfDarknessLogout = true;
                    sender.Dispose();
                }

                Campfire.RemoveEntry(m_Entry);
            }
示例#15
0
            public override void OnResponse(NetState sender, RelayInfo info)
            {
                PlayerMobile pm = m_Entry.Player;

                m_CloseTimer.Stop();

                if (Campfire.GetEntry(pm) != m_Entry)
                {
                    return;
                }

                if (info.ButtonID == 1 && m_Entry.Safe && m_Bedroll.Parent == null && m_Bedroll.IsAccessibleTo(pm) &&
                    m_Bedroll.VerifyMove(pm) && m_Bedroll.Map == pm.Map && pm.InRange(m_Bedroll, 2))
                {
                    pm.PlaceInBackpack(m_Bedroll);

                    pm.BedrollLogout = true;
                    sender.Disconnect("Disconnected by logging with bedroll");
                }

                Campfire.RemoveEntry(m_Entry);
            }
示例#16
0
        protected override void OnTarget(Mobile from, object targeted)
        {
            if (from == null || targeted == null)
            {
                return;
            }

            m_From = from;

            if (targeted is Campfire)
            {
                m_Fire = targeted as Campfire;

                double cookskill = from.Skills[SkillName.Cooking].Value;

                m_Difficulty = cookskill;

                if (m_CookItem != null)
                {
                    if (m_CookItem is Jerky)
                    {
                        m_Difficulty -= 31.4;
                    }

                    if (m_Difficulty < 0)
                    {
                        from.SendMessage("You throw it in the fire having no idea how to cook it.");
                        m_CookItem.Delete();
                    }
                    else
                    {
                        m_CookItem.Movable = false;
                        from.SendMessage("You begin cooking.");
                        Timer.DelayCall(TimeSpan.FromSeconds((double)Utility.RandomMinMax(12, 34)), new TimerCallback(CookEnd));
                    }
                }
            }
        }
示例#17
0
 public InternalTimer(Mobile from, Campfire campfire)
     : base(TimeSpan.FromSeconds(5.0))
 {
     this.m_From = from;
     this.m_Campfire = campfire;
 }
示例#18
0
            public DecayTimer(Campfire owner) : base(TimeSpan.FromMinutes(2.0))
            {
                Priority = TimerPriority.FiveSeconds;

                m_Owner = owner;
            }
示例#19
0
		protected override void OnTarget(Mobile from, object targeted)
		{
			if (from == null || targeted == null) return;

			m_From = from;

			if (targeted is Campfire)
			{
				m_Fire = targeted as Campfire;

				double cookskill = from.Skills[SkillName.Cooking].Value;

				m_Difficulty = cookskill;

				if (m_CookItem != null)
				{
					if (m_CookItem is Jerky)
					{
						m_Difficulty -= 31.4;
					}

					if (m_Difficulty < 0)
					{
						from.SendMessage("You throw it in the fire having no idea how to cook it.");
						m_CookItem.Delete();
					}
					else
					{
						m_CookItem.Movable = false;
						from.SendMessage("You begin cooking.");
						Timer.DelayCall(TimeSpan.FromSeconds((double)Utility.RandomMinMax(12, 34)), new TimerCallback(CookEnd));
					}
				}
			}
		}
示例#20
0
        public void DetermineHeatLevel()
        {
            int MaxHeatDistance = 2;

            double BaseLightHeatScalar = 10.0;
            double OpenFireHeatScalar  = 20.0;
            double ForgeHeatScalar     = 30.0;

            double totalHeat = 0;

            if (RootParent == null)
            {
                IPooledEnumerable nearbyHeatSources = Map.GetItemsInRange(Location, MaxHeatDistance);

                foreach (Item item in nearbyHeatSources)
                {
                    double itemHeat = 0;

                    if (item.RootParent != null)
                    {
                        continue;
                    }

                    int    distance   = Utility.GetDistance(Location, item.Location);
                    double heatScalar = ((double)MaxHeatDistance + 1) - (double)distance;

                    if (Math.Abs(Location.Z - item.Location.Z) > 15)
                    {
                        continue;
                    }

                    //Organized by Ascending Priority
                    if (item is BaseLight)
                    {
                        BaseLight baseLight = item as BaseLight;

                        if (baseLight.Burning)
                        {
                            itemHeat = BaseLightHeatScalar * heatScalar;
                        }
                    }

                    if (item is BaseEquipableLight)
                    {
                        BaseEquipableLight candle = item as BaseEquipableLight;

                        if (candle.Burning)
                        {
                            itemHeat = BaseLightHeatScalar * heatScalar;
                        }
                    }

                    if (item is Campfire)
                    {
                        Campfire campfire = item as Campfire;

                        if (campfire.Status == CampfireStatus.Burning || campfire.Status == CampfireStatus.Extinguishing)
                        {
                            itemHeat = OpenFireHeatScalar * heatScalar;
                        }
                    }

                    if (item is Brazier || item is BrazierTall)
                    {
                        BaseLight brazier = item as BaseLight;

                        if (brazier.Burning)
                        {
                            itemHeat = OpenFireHeatScalar * heatScalar;
                        }
                    }

                    if (item is Forge || item is LargeForgeEast || item is LargeForgeWest || item is ForgeComponent)
                    {
                        itemHeat = ForgeHeatScalar * heatScalar;
                    }

                    totalHeat += itemHeat;
                }

                nearbyHeatSources.Free();
            }

            HeatValue = totalHeat;

            if (HeatValue > PlantPersistance.MaxHeat)
            {
                HeatValue = PlantPersistance.MaxHeat;
            }
        }
示例#21
0
 public CampfireEntry( PlayerMobile player, Campfire fire )
 {
     m_Player = player;
     m_Fire = fire;
     m_Start = DateTime.Now;
     m_Safe = false;
 }
示例#22
0
 public CampfireEntry(PlayerMobile player, Campfire fire)
 {
     this.m_Player = player;
     this.m_Fire = fire;
     this.m_Start = DateTime.UtcNow;
     this.m_Safe = false;
 }
示例#23
0
 private void CloseGump()
 {
     Campfire.RemoveEntry(m_Entry);
     m_Entry.Player.CloseGump <LogoutGump>();;
 }
示例#24
0
 private void CloseGump()
 {
     Campfire.RemoveEntry(m_Entry);
     m_Entry.Player.CloseGump(typeof(LogoutGump));
 }
示例#25
0
        public void EndHeal()
        {
            StopHeal();

            int  healerNumber = -1, patientNumber = -1;
            bool playSound   = true;
            bool checkSkills = false;

            SkillName primarySkill   = GetPrimarySkill(m_Patient);
            SkillName secondarySkill = GetSecondarySkill(m_Patient);

            BaseCreature petPatient = m_Patient as BaseCreature;

            if (!m_Healer.Alive)
            {
                healerNumber  = 500962;                // You were unable to finish your work before you died.
                patientNumber = -1;
                playSound     = false;
            }
            else if (!m_Healer.InRange(m_Patient, Bandage.Range))
            {
                healerNumber  = 500963;                // You did not stay close enough to heal your target.
                patientNumber = -1;
                playSound     = false;
            }
            else if (!m_Patient.Alive || (petPatient != null && petPatient.IsDeadPet))
            {
                double        healing = m_Healer.Skills[primarySkill].Value;
                double        anatomy = m_Healer.Skills[secondarySkill].Value;
                CampfireEntry entry   = Campfire.GetEntry(m_Healer);
                if (entry != null && entry.Safe)
                {
                    healing += 20;
                }
                double chance = ((healing - 68.0) / 50.0) - (m_Slips * 0.02);

                if (((checkSkills = (healing >= 80.0 && anatomy >= 80.0)) && chance > Utility.RandomDouble()) ||
                    (Core.SE && petPatient is Factions.FactionWarHorse && petPatient.ControlMaster == m_Healer))                        //TODO: Dbl check doesn't check for faction of the horse here?
                {
                    if (m_Patient.Map == null || !m_Patient.Map.CanFit(m_Patient.Location, 16, false, false))
                    {
                        healerNumber  = 501042;                        // Target can not be resurrected at that location.
                        patientNumber = 502391;                        // Thou can not be resurrected there!
                    }
                    else if (m_Patient.Region != null && m_Patient.Region.IsPartOf("Khaldun"))
                    {
                        healerNumber  = 1010395;                        // The veil of death in this area is too strong and resists thy efforts to restore life.
                        patientNumber = -1;
                    }
                    else
                    {
                        healerNumber  = 500965;                        // You are able to resurrect your patient.
                        patientNumber = -1;

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

                        if (petPatient != null && petPatient.IsDeadPet)
                        {
                            Mobile master = petPatient.ControlMaster;

                            if (master != null && m_Healer == master)
                            {
                                petPatient.ResurrectPet();

                                for (int i = 0; i < petPatient.Skills.Length; ++i)
                                {
                                    petPatient.Skills[i].Base -= 0.1;
                                }
                            }
                            else if (master != null && master.InRange(petPatient, 3))
                            {
                                healerNumber = 503255;                                 // You are able to resurrect the creature.

                                master.CloseGump(typeof(PetResurrectGump));
                                master.SendGump(new PetResurrectGump(m_Healer, petPatient));
                            }
                            else
                            {
                                bool found = false;

                                List <Mobile> friends = petPatient.Friends;

                                for (int i = 0; friends != null && i < friends.Count; ++i)
                                {
                                    Mobile friend = friends[i];

                                    if (friend.InRange(petPatient, 3))
                                    {
                                        healerNumber = 503255;                                         // You are able to resurrect the creature.

                                        friend.CloseGump(typeof(PetResurrectGump));
                                        friend.SendGump(new PetResurrectGump(m_Healer, petPatient));

                                        found = true;
                                        break;
                                    }
                                }

                                if (!found)
                                {
                                    healerNumber = 1049670;                                     // The pet's owner must be nearby to attempt resurrection.
                                }
                            }
                        }
                        else
                        {
                            m_Patient.CloseGump(typeof(ResurrectGump));
                            m_Patient.SendGump(new ResurrectGump(m_Patient, m_Healer));
                        }
                    }
                }
                else
                {
                    if (petPatient != null && petPatient.IsDeadPet)
                    {
                        healerNumber = 503256;                         // You fail to resurrect the creature.
                    }
                    else
                    {
                        healerNumber = 500966;                         // You are unable to resurrect your patient.
                    }
                    patientNumber = -1;
                }
            }
            else if (m_Patient.Poisoned)
            {
                m_Healer.SendLocalizedMessage(500969);                   // You finish applying the bandages.

                double        healing = m_Healer.Skills[primarySkill].Value;
                double        anatomy = m_Healer.Skills[secondarySkill].Value;
                CampfireEntry entry   = Campfire.GetEntry(m_Healer);
                if (entry != null && entry.Safe)
                {
                    healing += 20;
                }

                double chance = ((healing - 30.0) / 50.0) - (m_Patient.Poison.Level * 0.1) - (m_Slips * 0.02);

                if ((checkSkills = (healing >= 60.0 && anatomy >= 60.0)) && chance > Utility.RandomDouble())
                {
                    if (m_Patient.CurePoison(m_Healer))
                    {
                        healerNumber  = (m_Healer == m_Patient) ? -1 : 1010058; // You have cured the target of all poisons.
                        patientNumber = 1010059;                                // You have been cured of all poisons.
                    }
                    else
                    {
                        healerNumber  = -1;
                        patientNumber = -1;
                    }
                }
                else
                {
                    healerNumber  = 1010060;                    // You have failed to cure your target!
                    patientNumber = -1;
                }
            }
            else if (BleedAttack.IsBleeding(m_Patient))
            {
                healerNumber  = 1060088;                // You bind the wound and stop the bleeding
                patientNumber = 1060167;                // The bleeding wounds have healed, you are no longer bleeding!

                BleedAttack.EndBleed(m_Patient, false);
            }
            else if (MortalStrike.IsWounded(m_Patient))
            {
                healerNumber  = (m_Healer == m_Patient ? 1005000 : 1010398);
                patientNumber = -1;
                playSound     = false;
            }
            else if (m_Patient.Hits == m_Patient.HitsMax)
            {
                healerNumber  = 500967;                // You heal what little damage your patient had.
                patientNumber = -1;
            }
            else
            {
                checkSkills   = true;
                patientNumber = -1;

                double        healing = m_Healer.Skills[primarySkill].Value;
                double        anatomy = m_Healer.Skills[secondarySkill].Value;
                CampfireEntry entry   = Campfire.GetEntry(m_Healer);
                if (entry != null && entry.Safe)
                {
                    healing += 20;
                }

                double chance = ((healing + 10.0) / 100.0) - (m_Slips * 0.02);
                if (chance > Utility.RandomDouble())
                {
                    healerNumber = 500969;                     // You finish applying the bandages.

                    double min, max;

                    if (Core.AOS)
                    {
                        min = (anatomy / 8.0) + (healing / 5.0) + 4.0;
                        max = (anatomy / 6.0) + (healing / 2.5) + 4.0;
                    }
                    else
                    {
                        min = (anatomy / 5.0) + (healing / 5.0) + 3.0;
                        max = (anatomy / 5.0) + (healing / 2.0) + 10.0;
                    }

                    double toHeal = min + (Utility.RandomDouble() * (max - min));

                    toHeal += (m_Healer.Skills[SkillName.Veterinary].Value + m_Healer.Skills[SkillName.Healing].Value - healing) / 8.0;

                    if (m_Patient.Body.IsMonster || m_Patient.Body.IsAnimal)
                    {
                        toHeal += m_Patient.HitsMax / 100;
                    }

                    if (Core.AOS)
                    {
                        toHeal -= toHeal * m_Slips * 0.35;                         // TODO: Verify algorithm
                    }
                    else
                    {
                        toHeal -= m_Slips * 4;
                    }


                    if (toHeal < 1)
                    {
                        toHeal       = 1;
                        healerNumber = 500968;                         // You apply the bandages, but they barely help.
                    }

                    m_Patient.Heal((int)toHeal, m_Healer, false);
                }
                else
                {
                    healerNumber = 500968;                     // You apply the bandages, but they barely help.
                    playSound    = false;
                }
            }

            if (healerNumber != -1)
            {
                m_Healer.SendLocalizedMessage(healerNumber);
            }

            if (patientNumber != -1)
            {
                m_Patient.SendLocalizedMessage(patientNumber);
            }

            if (playSound)
            {
                m_Patient.PlaySound(0x57);
            }

            if (checkSkills)
            {
                m_Healer.CheckSkill(secondarySkill, 0.0, 120.0);
                m_Healer.CheckSkill(primarySkill, 0.0, 120.0);
            }
        }
示例#26
0
		public override void OnResponse( NetState state, RelayInfo info )
		{
			Mobile from = state.Mobile;

			Point3D fireLoc = new Point3D( from.X + 5, from.Y + 2, from.Z );

			bool deconstruct = info.IsSwitched( 2 );
			bool logout = info.IsSwitched( 3 );

			if( deconstruct )
			{
				m_Bedroll.Delete();

				from.AddToBackpack( new TravelTent() );

				Campfire fire = new Campfire();
				fire.Status = CampfireStatus.Off;
				fire.MoveToWorld( fireLoc, from.Map );
			}

			if( logout )
			{
				m_Bedroll.Delete();

				if( from.Backpack != null && from.Backpack.GetAmount( typeof( TentValidator ) ) > 0 )
				{
					from.Backpack.ConsumeTotal( typeof( TentValidator ), 1 );
				}

				from.AddToBackpack( new TravelTent() );

				Campfire fire = new Campfire();
				fire.Status = CampfireStatus.Off;
				fire.MoveToWorld( fireLoc, from.Map );

				((PlayerMobile)from).BedrollLogout = true;
				state.Dispose();
			}

			switch( info.ButtonID )
			{
				default:
				case 0:
					{
						from.CloseGump( typeof( TentManagementGump ) );
						break;
					}
			}
		}
示例#27
0
            public DecayTimer( Campfire owner )
                : base(TimeSpan.FromSeconds( 1 ), TimeSpan.FromSeconds( 1 ))
            {
                Priority = TimerPriority.TwoFiftyMS;

                m_Owner = owner;
                m_StartTime = DateTime.Now;
            }
示例#28
0
        private void OnTick()
        {
            DateTime now = DateTime.UtcNow;
            TimeSpan age = now - Created;

            if (age >= TimeSpan.FromSeconds(220.0)) // 100
            {
                Delete();
            }
            else if (age >= TimeSpan.FromSeconds(210.0)) // 90
            {
                Status = CampfireStatus.Off;
            }
            else if (age >= TimeSpan.FromSeconds(180.0)) // 60
            {
                Status = CampfireStatus.Extinguishing;
            }

            if (Status == CampfireStatus.Off || Deleted)
            {
                return;
            }

            foreach (CampfireEntry entry in new ArrayList(m_Entries))
            {
                if (!entry.Valid || entry.Player.NetState == null)
                {
                    RemoveEntry(entry);
                }
                else if (!entry.Safe && now - entry.Start >= TimeSpan.FromSeconds(60 - 45 * (entry.Player.Skills[SkillName.Camping].Value / 100))) //originally was: TimeSpan.FromSeconds(30.0)
                {
                    entry.Safe = true;
                    entry.Player.SendLocalizedMessage(500621); // The camp is now secure.

                    #region NewCamping
                    if (!entry.Player.HasGump(typeof(CampfireGump)))
                    {
                        CampfireEntry cf = Campfire.GetEntry(entry.Player);

                        if (cf != null && cf.Safe)
                        {
                            entry.Player.SendGump(new CampfireGump(cf, this));
                        }
                    }
                    #endregion
                }

                if (IsUpgraded)
                {
                    /*
                     * if(entry.Player.Hits < entry.Player.HitsMax)
                     *  entry.Player.Hits +=1;
                     * if(entry.Player.Mana < entry.Player.ManaMax)
                     *  entry.Player.Mana +=1;
                     */

                    Effects.SendLocationParticles(this, 0x3779, 1, 30, 1160, 3, 9502, 0);

                    if (!entry.IsBuffed)
                    {
                        DoBuff(entry.Player);
                        entry.IsBuffed = true;
                    }
                }
            }

            IPooledEnumerable eable = GetClientsInRange(SecureRange);

            foreach (NetState state in eable)
            {
                PlayerMobile pm = state.Mobile as PlayerMobile;

                if (pm != null && GetEntry(pm) == null)
                {
                    CampfireEntry entry = new CampfireEntry(pm, this);

                    m_Table[pm] = entry;
                    m_Entries.Add(entry);

                    pm.SendLocalizedMessage(500620); // You feel it would take a few moments to secure your camp.
                }
            }

            eable.Free();
        }
示例#29
0
			public DecayTimer( Campfire owner ) : base( TimeSpan.FromMinutes( 2.0 ) )
			{
				Priority = TimerPriority.FiveSeconds;

				m_Owner = owner;
			}
示例#30
0
				public InternalTimer( Mobile from, Campfire campfire ) : base( TimeSpan.FromSeconds( 2.5 ) )
				{
					m_From = from;
					m_Campfire = campfire;
				}
示例#31
0
 public SecureTimer(Mobile owner, Campfire campfire) : base(TimeSpan.FromSeconds(30.0))
 {
     Priority   = TimerPriority.FiveSeconds;
     m_campfire = campfire;
     m_Owner    = owner;
 }
示例#32
0
 public InternalTimer(Mobile from, Campfire campfire) : base(TimeSpan.FromSeconds(5.0))
 {
     m_From     = from;
     m_Campfire = campfire;
 }
示例#33
0
			public SecureTimer( Mobile owner , Campfire campfire) : base( TimeSpan.FromSeconds( 30.0 ) )
			{
				Priority = TimerPriority.FiveSeconds;
				m_campfire = campfire;
				m_Owner = owner;
			}