Server.Items.Campfire.GetEntry C# (CSharp) Méthode

GetEntry() public static méthode

public static GetEntry ( Server.Mobile player ) : CampfireEntry
player Server.Mobile
Résultat CampfireEntry
		public static CampfireEntry GetEntry( Mobile player )
		{
			return (CampfireEntry) m_Table[player];
		}

Usage Example

Exemple #1
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);
                    }
                }
            }
        }
All Usage Examples Of Server.Items.Campfire::GetEntry