Beispiel #1
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (m_Jar.Deleted || m_Jar.HasFairy)
                {
                    return;
                }

                if (m_Jar.RootParent != from)
                {
                    from.SendLocalizedMessage(1042001);                       // That must be in your pack for you to use it.
                }
                else if (targeted is HealingFairy)
                {
                    HealingFairy fairy = (HealingFairy)targeted;

                    if (fairy.Controlled || (fairy.Summoned && fairy.SummonMaster != from))
                    {
                        from.SendMessage("You may only target a healing fairy that does not belong to someone.");
                    }
                    else
                    {
                        m_Jar.SetHasFairy(true);
                        fairy.Delete();
                    }
                }
                else
                {
                    from.SendMessage("You may only capture healing fairies with this jar.");
                }
            }
Beispiel #2
0
        public override void OnHarvestStarted(Mobile from, Item tool, HarvestDefinition def, object toHarvest)
        {
            base.OnHarvestStarted(from, tool, def, toHarvest);

//			originaly here
//			if( Core.ML )
//				from.RevealingAction();
//			originaly here end

            #region spawn healing fairy
            if (Core.ML)
            {
                from.RevealingAction();


                double chance = 0.01;                //what % chance have to spawn 0.50 = 50% - avrage waks per hour 228 (1.0 / 228 = .004 to equal 1 time per hour) (.004*2times an hour = .008  I rounded to .01)
                if (Utility.RandomDouble() < chance)
                {
                    BaseCreature fary;
                    int          x = from.X, y = from.Y, z = from.Z;
                    Map          map = from.Map;
                    fary = new HealingFairy();
                    fary.MoveToWorld(new Point3D(x, y, z), map);
                    from.SendMessage(96, "You see a \"Healing Fairy\" fly out from the tree.");
                }
//					from.SendMessage( "chance: {0} %", chance*100 ); //used for debug mode
            }
            #endregion
        }