Example #1
0
        public override bool OnDragDrop(Mobile from, Item dropped)
        {
            PlayerMobile player = from as PlayerMobile;

            if (this is IEvoGuardian)
            {
                return(base.OnDragDrop(from, dropped));
            }

            if (null != ControlMaster && ControlMaster.Followers > ControlMaster.FollowersMax)
            {
                ControlMaster.SendMessage(Name + " is not interested in that now!");
                return(false);
            }

            if (null != player && dropped.GetType() == GetEvoDustType())
            {
                BaseEvoDust dust = dropped as BaseEvoDust;

                if (null != dust)
                {
                    int amount = (dust.Amount * m_DustMultiplier);

                    m_Ep += amount;
                    PlaySound(665);
                    dust.Delete();
                    Emote("*" + this.Name + " absorbs the " + dust.Name + " gaining " + amount + " experience points*");
                    return(true);
                }
                return(false);
            }
            return(base.OnDragDrop(from, dropped));
        }
Example #2
0
        public override void OnThink()
        {
            base.OnThink();

            if (this is IEvoGuardian)
            {
                return;
            }

            else if (null != ControlMaster && ControlMaster.Followers > ControlMaster.FollowersMax && kOverLimitLossChance >= Utility.RandomDouble())
            {
                ControlMaster.SendMessage(Name + " is losing confidence in your ability to control so many creatures!");
                Say(1043270, Name);                   // * ~1_NAME~ looks around desperately *
                PlaySound(GetIdleSound());
                if (Loyalty > BaseCreature.MaxLoyalty / 10)
                {
                    Loyalty--;
                }
            }
            else if (m_AlwaysHappy && DateTime.Now >= m_NextHappyTime && null != ControlMaster && ControlMaster.Map == Map)
            {
                Loyalty         = BaseCreature.MaxLoyalty;
                m_NextHappyTime = DateTime.Now + TimeSpan.FromMinutes(30.0);
            }
        }
Example #3
0
        private void AddPoints(Mobile defender)
        {
            if (defender == null || defender.Deleted)
            {
                return;
            }

            if (defender is TrainingElemental && m_Stage >= m_MaxTrainingStage && null != ControlMaster)
            {
                Emote("*stops fighting*");
                Combatant     = null;
                ControlTarget = ControlMaster;
                ControlOrder  = OrderType.Follow;
                ControlMaster.SendMessage("Your pet can no longer gain experience points fighting Training Elementals!");
            }
            else if (defender is BaseCreature)
            {
                BaseCreature bc = (BaseCreature)defender;

                if (bc.Controlled != true)
                {
                    m_Ep += Utility.RandomMinMax(5 + (bc.HitsMax) / m_EpMinDivisor, 5 + (bc.HitsMax) / m_EpMaxDivisor);
                }

                if (m_Stage < m_FinalStage && m_Ep >= m_NextEpThreshold)
                {
                    Evolve(false);
                }
            }
        }
Example #4
0
 public override bool CanFriend(Mobile m)
 {
     if (ControlMaster != null && ControlMaster.NetState != null)
     {
         ControlMaster.SendLocalizedMessage(1155548); // You may not add friends to a VvV War Steed.
     }
     return(false);
 }
Example #5
0
 public override bool CanTransfer(Mobile m)
 {
     if (ControlMaster != null && ControlMaster.NetState != null)
     {
         ControlMaster.SendLocalizedMessage(1155547); // Pets obtained from VvV are non-transferable.
     }
     return(false);
 }
Example #6
0
        public override void GetContextMenuEntries(Mobile from, System.Collections.Generic.List <Server.ContextMenus.ContextMenuEntry> list)
        {
            base.GetContextMenuEntries(from, list);

            if (ControlMaster != null && ControlMaster.InRange(this, 10) && from == this.ControlMaster)
            {
                list.Add(new InternalContextMenu(this));
            }
        }
Example #7
0
        public override void AlterMeleeDamageTo(Mobile to, ref int damage)
        {
            Hits += (damage / 10);

            if (ControlMaster != null && ControlMaster.InRange(this, 5))
            {
                ControlMaster.Hits += (damage / 20);
            }
        }
Example #8
0
        public void CheckDelete()
        {
            if (DeleteTime != DateTime.MinValue && DateTime.UtcNow > DeleteTime)
            {
                if (ControlMaster != null && ControlMaster.NetState != null)
                {
                    ControlMaster.SendLocalizedMessage(1152248); // You did not take your prisoner to the Guard Captain in time.
                }

                Delete();
            }
        }
        public override void OnDeath(Container c)
        {
            if (ControlMaster != null)
            {
                TeiravonMobile m_Player = (TeiravonMobile)ControlMaster;

                m_Player.WarMountDeaths += 1;
                ControlMaster.SendMessage("Your War Mount has died.", m_Player.WarMountDeaths);
            }

            base.OnDeath(c);
        }
Example #10
0
        public void GoPoof()
        {
            if (Rider != null)
            {
                Rider = null;
            }

            if (ControlMaster != null && ControlMaster.NetState != null)
            {
                ControlMaster.PrivateOverheadMessage(Server.Network.MessageType.Regular, 1154, 1155550, ControlMaster.NetState); // *Your steed has depleted it's battle readiness!*
            }
            Delete();
        }
Example #11
0
        private void Awake()
        {
            inputActions = new ControlMaster();

            inputActions.Placement.Tap.performed += ctx => tap = ctx.performed && !EventSystem.current.IsPointerOverGameObject();
            //inputActions.Placement.Hold.performed += ctx => tap = ctx.performed && !EventSystem.current.IsPointerOverGameObject();
            inputActions.Placement.Hold.performed     += ctx => holding = ctx.performed && !EventSystem.current.IsPointerOverGameObject();
            inputActions.Placement.Hold.canceled      += ctx => { holding = ctx.performed; OnRelease(); };
            inputActions.Placement.Position.performed += ctx => mousePosition = ctx.ReadValue <Vector2>();
            inputActions.FreeLook.Delta.performed     += ctx => CameraMovement = ctx.ReadValue <Vector2>() * CameraRotationSpeed;
            inputActions.FreeLook.Rotate.performed    += ctx => RotateCam = ctx.performed && !EventSystem.current.IsPointerOverGameObject();
            inputActions.FreeLook.Rotate.canceled     += ctx => RotateCam = ctx.performed;
            inputActions.FreeLook.Pan.performed       += ctx => Pan = ctx.performed && !EventSystem.current.IsPointerOverGameObject();
            inputActions.FreeLook.Pan.canceled        += ctx => Pan = ctx.performed;
            Cinemachine.CinemachineCore.GetInputAxis   = GetAxisCustom;
        }
Example #12
0
        public override bool OnBeforeDeath()
        {
            //if (Mounted)
            //    Dismount(this);
            polymorph(719, this);
            if (ControlMaster != null && this.ControlMaster.HasGump(typeof(Luckgump)))
            {
                ControlMaster.CloseGump(typeof(Luckgump));
            }
            PackAnimal.CombineBackpacks(this);
            //if  (Utility.Random(10)<1)
            //GoldShower.DoForChamp(Location, Map);
            if (!Controlled)
            {
                baodongxi.bao(this as BaseCreature);
            }

            return(base.OnBeforeDeath());
        }
Example #13
0
        public override void OnGotMeleeAttack(Mobile attacker)
        {
            base.OnGotMeleeAttack(attacker);

            double chance = 0.10;

            if (!Controlled)
            {
                chance = 0.25;
            }
            else if (Controlled && (ControlMaster != null && ControlMaster.InRange(this, 8)))
            {
                chance = 0.30;
            }

            if (chance >= Utility.RandomDouble())
            {
                FlameStrike();
            }
        }
Example #14
0
        public void polymorph(int bodyid, xhorse m)
        {
            if (!Controlled || IsDeadPet || IsDeadBondedPet || ControlMaster == null)
            {
                return;
            }
            if (ControlMaster.HasGump(typeof(xhgump)))
            {
                ControlMaster.CloseGump(typeof(xhgump));
            }
            m.PlaySound(0x20C);
            if (Mounted)
            {
                Dismount(this);
            }

            if (bodyid == 0x191)
            {
                m.BodyMod = 0x191;
                m.HueMod  = 1009;
                if (Race != Race.Elf)
                {
                    Race = Race.Elf;
                }
                //FixedParticles(0x3728, 200, 25, 9942, EffectLayer.Waist);
                Effects.SendBoltEffect(m, true, 0, true);//Lighting
                m.FixedParticles(0x376A, 1, 31, 9961, 1160, 0, EffectLayer.Waist);

                if (m.Controlled && CanPaperdollBeOpenedBy(ControlMaster) && m.Alive)
                {
                    if (m.ControlMaster.Alive)
                    {
                        m.ControlMaster.SendGump(new xhgump(ControlMaster, m));
                    }
                }
                return;
            }
            if (bodyid == 0xbe)

            {
                m.BodyMod = 0;
                m.HueMod  = -1;
                //FixedParticles(0x3728, 200, 25, 9942, EffectLayer.Waist);
                m.FixedParticles(0x376A, 1, 31, 9961, 1160, 0, EffectLayer.Waist); //黄色环绕
                m.FixedParticles(0x37C4, 1, 31, 9502, 43, 2, EffectLayer.Waist);   //刺球

                return;
            }
            else
            {
                m.BodyMod = bodyid;
                m.HueMod  = -1;
                //FixedParticles(0x3728, 200, 25, 9942, EffectLayer.Waist);
                m.FixedParticles(0x37C4, 1, 31, 9502, 43, 2, EffectLayer.Waist);
                m.FixedParticles(0x376A, 1, 31, 9961, 1160, 0, EffectLayer.Waist);//黄色环绕

                return;
            }
            #region old polymorph
            //if (Mounted)
            //    Dismount(this);

            //if (BodyMod == 0)
            //{
            //    if (bodyid == 0x191)
            //        m.HueMod = 1009;
            //    else
            //        m.HueMod = -1;
            //    if (Mounted)
            //        Dismount(this);

            //    m.PlaySound(0x20C);
            //    m.Body = bodyid;
            //    FixedParticles(0x3728, 200, 25, 9942, EffectLayer.Waist);
            //}
            #endregion old
        }
Example #15
0
        public bool MasterInRange()
        {
            var list = GetMobilesInRange(10);

            return((from object mobile in list select mobile as PlayerMobile).Any(mob => mob != null && ControlMaster == mob && ControlMaster.Alive && ControlMaster.CanSee(this)));
        }