Пример #1
0
            private static void DoSpeech(PlayerMobile targ, string toSay)
            {
                IPooledEnumerable eable = targ.Map.GetClientsInRange(targ.Location, 15);

                if (targ.UseUnicodeSpeech)
                {
                    foreach (NetState state in eable)
                        if (state != null && (!state.Mobile.HasFilter || targ.InLOS(state.Mobile)))
                            state.Send(new UnicodeMessage(targ.Serial, targ.Body, MessageType.Regular, targ.SpeechHue, 3, "ENU", targ.Name, toSay));
                }
                else
                {
                    foreach (NetState state in eable)
                        if (state != null && (!state.Mobile.HasFilter || targ.InLOS(state.Mobile)))
                            state.Send(new AsciiMessage(targ.Serial, targ.Body, MessageType.Regular, targ.SpeechHue, 3, targ.Name, toSay));
                }

                eable.Free();
            }
Пример #2
0
        public bool TryEffectTarget(PlayerMobile from, Mobile target, bool isAreaEffect)
        {
            if (from == null || from.Deleted || !from.Alive || from.IsDeadBondedPet)
                return false;
            if (target == null || target.Deleted || !target.Alive || target.IsDeadBondedPet)
                return false;

            if (isAreaEffect)
            {
                if (from.IsAllyOf(target))
                {
                    if (Repetitions > 0)
                    {
                        RecurrentPrayerTimer timer = new RecurrentPrayerTimer(from, target, this);
                        timer.Start();
                    }
                    return DoPrayerEffect(from, target);
                }
                else
                    return false;
            }
            else
            {
                if (target.InRange(target.Location, m_Range) && from.InLOS(target))
                {
                    SpellHelper.Turn(from, target);
                    if (Repetitions > 0)
                    {
                        RecurrentPrayerTimer timer = new RecurrentPrayerTimer(from, target, this);
                        timer.Start();
                    }
                    return DoPrayerEffect(from, target);
                }
                else
                {
                    from.SendMessage("You are too far away.");
                    return false;
                }
            }

            return false;
        }
Пример #3
0
        public static void FightingBackToBack( PlayerMobile pm, bool movingaway )
        {
            ArrayList list = new ArrayList();
            ArrayList allies = new ArrayList();
            ArrayList leavelist = new ArrayList();

            if( pm.Feats.GetFeatLevel(FeatList.BackToBack) > 0 )
            {
                if( pm.Warmode && !pm.Mounted )
                {
                    foreach( Mobile m in pm.GetMobilesInRange( 2 ) )
                        list.Add( m );

                    for( int i = 0; i < list.Count; ++i )
                    {
                        PlayerMobile m = (Mobile)list[i] as PlayerMobile;
                        Mobile x = m as Mobile;
                        Mobile y = pm as Mobile;

                        if( m is PlayerMobile && m != pm && m.Warmode && !m.Mounted )
                        {
                            if( m == null || m.Deleted || m.Map != pm.Map || !m.Alive || !pm.CanSee( m ) || m.Feats.GetFeatLevel(FeatList.BackToBack) < 1 || !pm.AllyList.Contains( x ) || !m.AllyList.Contains( y ) )
                                continue;

                            if( pm.InLOS( m ) )
                                allies.Add( m );
                        }
                    }

                    if( allies.Count > 0 )
                    {
                        for( int i = 0; i < allies.Count; ++i )
                        {
                            PlayerMobile m = (Mobile)allies[i] as PlayerMobile;

                            if( !m.BackToBack )
                            {
                                BackToBackBonus( m, true );
                            }

                            if( !pm.BackToBack )
                            {
                                BackToBackBonus( pm, true );
                            }
                        }
                    }

                    else
                    {
                        if( pm.BackToBack )
                        {
                            BackToBackBonus( pm, false );
                        }

                        if( !movingaway )
                        {
                            foreach( Mobile mob in pm.GetMobilesInRange( 3 ) )
                                leavelist.Add( mob );

                            for( int i = 0; i < leavelist.Count; ++i )
                            {
                                PlayerMobile m = (Mobile)leavelist[i] as PlayerMobile;

                                if( m != pm && m is PlayerMobile )
                                {
                                    FightingBackToBack( m, true );
                                }
                            }
                        }
                    }
                }

                else
                {
                    if( pm.BackToBack )
                    {
                        BackToBackBonus( pm, false );
                    }
                }
            }
        }