Пример #1
0
        // Every member in the target's party is effected by whatever you coded in SpellEffect.
        public void DoPartyEffect(BlueSpell spell, Mobile target)
        {
            Party p = Party.Get(target);

            if (p == null)
            {
                return;
            }

            for (int i = 0; i < p.Members.Count; ++i)
            {
                PartyMemberInfo pmi = (PartyMemberInfo)p.Members[i];

                if (pmi == null)
                {
                    continue;
                }

                Mobile member = pmi.Mobile;

                if (member == null)
                {
                    continue;
                }

                if (target.Map == member.Map && target.CanSee(member))
                {
                    spell.SpellEffect(member);
                }
            }

            FinishSequence();
        }
Пример #2
0
        public bool IsCriminalAction(Mobile from)
        {
            if (from == m_Owner || from.AccessLevel >= AccessLevel.GameMaster)
            {
                return(false);
            }

            if (Owner is BaseCreature && !(Owner is Guard) && !(Owner.Body.IsHuman))
            {
                return(false);
            }

            Party p = Party.Get(m_Owner);

            if (p != null && p.Contains(from))
            {
                PartyMemberInfo pmi = p[m_Owner];

                if (pmi != null && pmi.CanLoot)
                {
                    return(false);
                }
            }

            return(NotorietyHandlers.CorpseNotoriety(from, this) == Notoriety.Innocent);
        }
Пример #3
0
                public PartyTrack(Mobile from, Party party) : base(0x01, ((party.Members.Count - 1) * 9) + 4)
                {
                    for (int i = 0; i < party.Members.Count; ++i)
                    {
                        PartyMemberInfo pmi = (PartyMemberInfo)party.Members[i];

                        if (pmi == null || pmi.Mobile == from)
                        {
                            continue;
                        }

                        Mobile mob = pmi.Mobile;

                        if (Utility.InUpdateRange(from, mob) && from.CanSee(mob))
                        {
                            continue;
                        }

                        m_Stream.Write((int)mob.Serial);
                        m_Stream.Write((short)mob.X);
                        m_Stream.Write((short)mob.Y);
                        m_Stream.Write((byte)(mob.Map == null ? 0 : mob.Map.MapID));
                    }

                    m_Stream.Write((int)0);
                }
Пример #4
0
        public override void OnSetCanLoot(Mobile from, bool canLoot)
        {
            Party p = Party.Get(from);

            if (p == null)
            {
                from.SendLocalizedMessage(3000211);                 // You are not in a party.
            }
            else
            {
                PartyMemberInfo mi = p[from];

                if (mi != null)
                {
                    mi.CanLoot = canLoot;

                    if (canLoot)
                    {
                        from.SendLocalizedMessage(1005447);                         // You have chosen to allow your party to loot your corpse.
                    }
                    else
                    {
                        from.SendLocalizedMessage(1005448);                         // You have chosen to prevent your party from looting your corpse.
                    }
                }
            }
        }
Пример #5
0
        public bool IsCriminalAction(Mobile from)
        {
            if (from == m_Owner || from.AccessLevel >= AccessLevel.GameMaster)
            {
                return(false);
            }

            if (!GetFlag(CorpseFlag.LootCriminal))
            {
                return(false);
            }

            Party p = Party.Get(m_Owner);

            if (p != null && p.Contains(from))
            {
                PartyMemberInfo pmi = p[m_Owner];

                if (pmi != null && pmi.CanLoot)
                {
                    return(false);
                }
            }

            return(NotorietyHandlers.CorpseNotoriety(from, this) == Notoriety.Innocent);
        }
Пример #6
0
        public static IEnumerable <SkillMasterySpell> GetSpellsForParty(Mobile from, SkillName?allowed)
        {
            foreach (var spell in EnumerateSpells(from))
            {
                if (spell.PartyEffects && (allowed == null || spell.CastSkill != allowed))
                {
                    yield return(spell);
                }
            }

            Party p = Party.Get(from);

            if (p != null)
            {
                for (var index = 0; index < p.Members.Count; index++)
                {
                    PartyMemberInfo info = p.Members[index];

                    foreach (var spell in EnumerateSpells(info.Mobile))
                    {
                        if (spell.PartyEffects && (allowed == null || spell.CastSkill != allowed))
                        {
                            yield return(spell);
                        }
                    }
                }
            }
        }
Пример #7
0
        public override void OnCast()
        {
            Party party   = Engines.PartySystem.Party.Get(Caster);
            bool  inParty = false;

            if (CheckSequence())
            {
                ArrayList targets = new ArrayList();

                Map map = Caster.Map;

                if (map != null)
                {
                    double tile = 7;

                    foreach (Mobile m in Caster.GetMobilesInRange((int)tile))
                    {
                        if (Caster != m && SpellHelper.ValidIndirectTarget(Caster, m) && Caster.CanBeHarmful(m, false))
                        {
                            if (party != null && party.Count > 0)
                            {
                                for (int k = 0; k < party.Members.Count; ++k)
                                {
                                    PartyMemberInfo pmi    = (PartyMemberInfo)party.Members[k];
                                    Mobile          member = pmi.Mobile;
                                    if (member.Serial == m.Serial)
                                    {
                                        inParty = true;
                                    }
                                }
                                if (!inParty)
                                {
                                    targets.Add(m);
                                }
                            }
                            else
                            {
                                targets.Add(m);
                            }
                        }
                        inParty = false;
                    }
                }

                Caster.PlaySound(0x2F3);

                double damage = Damage.instance.RandDegatsMagiques(Caster, Info.skillForCasting, Info.Circle, Info.castTime) / 2;

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

                    Caster.DoHarmful(m);
                    Damage.instance.AppliquerDegatsMagiques(m, damage);
                }
            }

            FinishSequence();
        }
Пример #8
0
        public override void OnCast()
        {
            if (CheckSequence())
            {
                TimeSpan duration = TimeSpan.FromSeconds(0);
                double   amount   = 1;

                DateTime endtime = DateTime.Now + duration;

                ArrayList m_target = new ArrayList();

                Map map = Caster.Map;

                Party party = Engines.PartySystem.Party.Get(Caster);

                //Définition des cibles du sort
                m_target.Add(Caster);

                if (map != null)
                {
                    foreach (Mobile m in Caster.GetMobilesInRange(portee))
                    {
                        if (SpellHelper.ValidIndirectTarget(Caster, m) && Caster.CanBeHarmful(m, false))
                        {
                            if (party != null && party.Count > 0)
                            {
                                for (int k = 0; k < party.Members.Count; ++k)
                                {
                                    PartyMemberInfo pmi    = (PartyMemberInfo)party.Members[k];
                                    Mobile          member = pmi.Mobile;
                                    if (member.Serial == m.Serial)
                                    {
                                        m_target.Add(m);
                                    }
                                }
                            }
                        }
                    }
                }

                for (int i = 0; i < m_target.Count; ++i)
                {
                    Mobile targ = (Mobile)m_target[i];

                    StopTimer(targ);

                    m_HymneTable[targ] = amount;

                    Timer t = new HymneTimer(targ, amount, DateTime.Now + duration);
                    m_Timers[targ] = t;
                    t.Start();

                    Effects.SendTargetParticles(targ, 14170, 10, 20, 5013, 1944, 0, EffectLayer.Head); //ID, speed, dura, effect, hue, render, layer
                    targ.PlaySound(493);
                }
            }

            FinishSequence();
        }
Пример #9
0
            public override void OnResponse(GameClient sender, RelayInfo info)
            {
                int button = info.ButtonID;

                PlayerMobile from = sender.Mobile as PlayerMobile;

                from.CloseGump(typeof(ConfirmPeerlessGump));

                switch (button)
                {
                case 0:
                {
                    break;
                }

                case 1:
                {
                    Party p = Party.Get(from);

                    if (p != null)
                    {
                        for (int i = 0; i < p.Members.Count; ++i)
                        {
                            PartyMemberInfo pmi    = (PartyMemberInfo)p.Members[i];
                            PlayerMobile    member = pmi.Mobile as PlayerMobile;

                            if (m_key.Map != Map.Felucca && member.Kills >= 5)
                            {
                                continue;
                            }

                            if (member.Map == from.Map && member.Region == from.Region)
                            {
                                member.CloseGump(typeof(ConfirmPeerlessPartyGump));
                                member.SendGump(new ConfirmPeerlessPartyGump(m_key, member));
                            }
                        }
                    }

                    if (m_key != null && !m_key.Deleted)
                    {
                        from.CloseGump(typeof(ConfirmPeerlessPartyGump));
                        from.SendGump(new ConfirmPeerlessPartyGump(m_key, from));
                        m_key.Delete();
                    }

                    break;
                }
                }
            }
Пример #10
0
        public static SkillMasterySpell GetSpellForParty(Mobile from, Type type)
        {
            CheckTable(from);
            Mobile check = from;

            if (from is BaseCreature bc && (bc.Controlled || bc.Summoned) && bc.GetMaster() != null)
            {
                check = bc.GetMaster();
                CheckTable(check);
            }

            //First checks the caster
            if (m_Table.ContainsKey(check))
            {
                for (var index = 0; index < m_Table[check].Count; index++)
                {
                    SkillMasterySpell spell = m_Table[check][index];

                    if (spell != null && spell.GetType() == type)
                    {
                        return(spell);
                    }
                }
            }
            else
            {
                Party p = Party.Get(check);

                if (p != null)
                {
                    for (var index = 0; index < p.Members.Count; index++)
                    {
                        PartyMemberInfo   info  = p.Members[index];
                        SkillMasterySpell spell = GetSpell(info.Mobile, type);

                        if (spell != null && spell.PartyEffects && from.InRange(info.Mobile.Location, spell.PartyRange) && spell.CheckPartyEffects(info.Mobile))
                        {
                            return(spell);
                        }
                    }
                }
            }

            return(null);
        }
Пример #11
0
        public AckPartyLocationsEx(Mobile from, Party party) : base(0x02, ((party.Members.Count - 1) * 9) + 4)
        {
            _from  = from;
            _party = party;

            for (int i = 0; i < party.Members.Count; ++i)
            {
                PartyMemberInfo pmi = (PartyMemberInfo)party.Members[i];

                if (pmi == null)
                {
                    continue;
                }

                Mobile mob = pmi.Mobile;

                if (mob != from && mob.Player && !HasWritten(mob) && !IsOnScreen(from, mob))
                {
                    Write(mob);
                }

                foreach (AggressorInfo agi in mob.Aggressors)
                {
                    Mobile c = agi.Attacker;

                    if (c != null && c != from && c.Player && !HasWritten(c) && IsOnAnyScreen(c))
                    {
                        Write(c);
                    }
                }

                foreach (AggressorInfo agi in mob.Aggressed)
                {
                    Mobile c = agi.Defender;

                    if (c != null && c != from && c.Player && !HasWritten(c) && IsOnAnyScreen(c))
                    {
                        Write(c);
                    }
                }
            }

            m_Stream.Write((int)0);
        }
Пример #12
0
        private List <Mobile> GetParty(Mobile from)
        {
            List <Mobile> list = new List <Mobile>();

            if (from.Party is Party p)
            {
                for (var index = 0; index < p.Members.Count; index++)
                {
                    PartyMemberInfo pmInfo = p.Members[index];
                    list.Add(pmInfo.Mobile);
                }
            }
            else
            {
                list.Add(from);
            }

            return(list);
        }
Пример #13
0
        public override bool OnDragDrop(Mobile from, Item dropped)
        {
            if (dropped is GoldenSkull)
            {
                dropped.Delete();

                PublicOverheadMessage(MessageType.Regular, 0x3B2, 1050046, from.Name); // Very well, ~1_NAME~, I accept your token. You may cross.
                BeginRemove(TimeSpan.FromSeconds(4.0));

                Party p = PartySystem.Party.Get(from);

                if (p != null)
                {
                    for (int i = 0; i < p.Members.Count; ++i)
                    {
                        PartyMemberInfo pmi    = p.Members[i];
                        Mobile          member = pmi.Mobile;

                        if (member != from && member.Map == Map.Malas && member.Region.IsPartOf("Doom"))
                        {
                            if (m_AngryAt == member)
                            {
                                m_AngryAt = null;
                            }

                            member.CloseGump(typeof(ChylothPartyGump));
                            member.SendGump(new ChylothPartyGump(from, member));
                        }
                    }
                }

                if (m_AngryAt == from)
                {
                    m_AngryAt = null;
                }

                TeleportToFerry(from);

                return(false);
            }

            return(base.OnDragDrop(from, dropped));
        }
Пример #14
0
        private bool IsOnAnyScreen(Mobile mob)
        {
            for (int i = 0; i < _party.Members.Count; ++i)
            {
                PartyMemberInfo pmi = (PartyMemberInfo)_party.Members[i];

                if (pmi != null)
                {
                    Mobile friend = pmi.Mobile;

                    if (IsOnScreen(friend, mob))
                    {
                        return(true);
                    }
                }
            }

            return(false);
        }
Пример #15
0
        public bool TryBeginEncounter(Mobile m, bool fromQueue, EncounterType type)
        {
            Party p = Party.Get(m);

            if (!fromQueue && p != null)
            {
                for (var index = 0; index < p.Members.Count; index++)
                {
                    PartyMemberInfo info = p.Members[index];

                    if (!Controller.Lobby.Contains(new Point2D(info.Mobile.X, info.Mobile.Y)))
                    {
                        m.SendLocalizedMessage(1156186); // All members of your party must remain in the lobby of Shadowguard while your encounter is prepared. Make sure all members of your party are in the lobby and try again.
                        return(false);
                    }
                }
            }

            Encounter = ConstructEncounter(type);
            Controller.AddEncounter(Encounter);
            Encounter.OnBeforeBegin(m);

            return(true);
        }
Пример #16
0
                public SallosPartyTrack(Mobile from, Party party)
                    : base(0x03, ((party.Members.Count - 1) * 10) + 4)
                {
                    for (int i = 0; i < party.Members.Count; ++i)
                    {
                        PartyMemberInfo pmi = (PartyMemberInfo)party.Members[i];

                        if (pmi == null || pmi.Mobile == from)
                        {
                            continue;
                        }

                        Mobile mob = pmi.Mobile;

                        m_Stream.Write((int)mob.Serial);
                        m_Stream.Write((short)mob.X);
                        m_Stream.Write((short)mob.Y);

                        m_Stream.Write((byte)mob.Map.MapID);
                        m_Stream.Write(true);
                    }

                    m_Stream.Write((int)0);
                }
Пример #17
0
        public bool CanTryEncounter(Mobile m, EncounterType encounter)
        {
            Party p = Party.Get(m);

            if (p != null && p.Leader != m)
            {
                m.SendLocalizedMessage(1156184); // You may not start a Shadowguard encounter while in a party unless you are the party leader.
                return(false);
            }

            if (encounter == EncounterType.Roof)
            {
                if (p != null)
                {
                    for (var index = 0; index < p.Members.Count; index++)
                    {
                        PartyMemberInfo info = p.Members[index];

                        if (Table == null || !Table.ContainsKey(info.Mobile) || (Table[info.Mobile] & EncounterType.Required) != EncounterType.Required)
                        {
                            m.SendLocalizedMessage(1156249); // All members of your party must complete each of the Shadowguard Towers before attempting the finale.
                            return(false);
                        }
                    }
                }
                else if (Table == null || !Table.ContainsKey(m) || (Table[m] & EncounterType.Required) != EncounterType.Required)
                {
                    m.SendLocalizedMessage(1156196); // You must complete each level of Shadowguard before attempting the Roof.
                    return(false);
                }
            }

            if (p != null)
            {
                for (var index = 0; index < p.Members.Count; index++)
                {
                    PartyMemberInfo info = p.Members[index];

                    for (var i = 0; i < Encounters.Count; i++)
                    {
                        ShadowguardEncounter enc = Encounters[i];

                        if (enc.PartyLeader != null)
                        {
                            Party party = Party.Get(enc.PartyLeader);

                            if (enc.PartyLeader == info.Mobile || party != null && party.Contains(info.Mobile))
                            {
                                m.SendLocalizedMessage(1156189, info.Mobile.Name); // ~1_NAME~ in your party is already attempting to join a Shadowguard encounter.  Start a new party without them or wait until they are finished and try again.
                                return(false);
                            }
                        }

                        foreach (Mobile mob in Queue.Keys)
                        {
                            if (mob != null)
                            {
                                Party party = Party.Get(mob);

                                if (mob == info.Mobile || party != null && party.Contains(info.Mobile))
                                {
                                    m.SendLocalizedMessage(1156189, info.Mobile.Name); // ~1_NAME~ in your party is already attempting to join a Shadowguard encounter.  Start a new party without them or wait until they are finished and try again.
                                    return(false);
                                }
                            }
                        }
                    }
                }
            }

            for (var index = 0; index < Encounters.Count; index++)
            {
                ShadowguardEncounter instance = Encounters[index];

                if (instance.PartyLeader == m)
                {
                    return(false);
                }
            }

            return(true);
        }
Пример #18
0
        public void Target(IPoint3D p)
        {
            Party party   = Engines.PartySystem.Party.Get(Caster);
            bool  inParty = false;

            if (!Caster.CanSee(p))
            {
                Caster.SendLocalizedMessage(500237);                   // Target can not be seen.
            }
            else if (CheckSequence())
            {
                SpellHelper.Turn(Caster, p);

                SpellHelper.GetSurfaceTop(ref p);

                ArrayList targets = new ArrayList();

                Map map = Caster.Map;

                if (map != null)
                {
                    IPooledEnumerable eable = map.GetMobilesInRange(new Point3D(p), 4);

                    foreach (Mobile m in eable)
                    {
                        if (SpellHelper.ValidIndirectTarget(Caster, m) && Caster.CanSee(m) && Caster.CanBeHarmful(m, false))
                        {
                            if (party != null && party.Count > 0)
                            {
                                for (int k = 0; k < party.Members.Count; ++k)
                                {
                                    PartyMemberInfo pmi    = (PartyMemberInfo)party.Members[k];
                                    Mobile          member = pmi.Mobile;
                                    if (member.Serial == m.Serial)
                                    {
                                        inParty = true;
                                    }
                                }
                                if (!inParty)
                                {
                                    targets.Add(m);
                                }
                            }
                            else
                            {
                                targets.Add(m);
                            }
                        }
                        inParty = false;
                    }

                    eable.Free();
                }

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

                    Caster.DoHarmful(m);

                    SpellHelper.AddStatCurse(Caster, m, StatType.Str); SpellHelper.DisableSkillCheck = true;
                    SpellHelper.AddStatCurse(Caster, m, StatType.Dex);
                    SpellHelper.AddStatCurse(Caster, m, StatType.Int); SpellHelper.DisableSkillCheck = false;

                    if (m.Spell != null)
                    {
                        m.Spell.OnCasterHurt();
                    }

                    m.Paralyzed = false;

                    Effects.SendTargetParticles(m, 0x374A, 10, 15, 5028, EffectLayer.Waist);
                    m.PlaySound(0x1FB);
                }
            }

            FinishSequence();
        }
Пример #19
0
        public override void OnCast()
        {
            Party party   = Engines.PartySystem.Party.Get(Caster);
            bool  inParty = false;

            if (CheckSequence())
            {
                /* Creates a withering frost around the Caster,
                 * which deals Cold Damage to all valid targets in a radius of 5 tiles.
                 */

                Map map = Caster.Map;

                if (map != null)
                {
                    ArrayList targets = new ArrayList();

                    foreach (Mobile m in Caster.GetMobilesInRange(4))
                    {
                        if (Caster != m && Caster.InLOS(m) && SpellHelper.ValidIndirectTarget(Caster, m) && Caster.CanBeHarmful(m, false))
                        {
                            if (party != null && party.Count > 0)
                            {
                                for (int k = 0; k < party.Members.Count; ++k)
                                {
                                    PartyMemberInfo pmi    = (PartyMemberInfo)party.Members[k];
                                    Mobile          member = pmi.Mobile;
                                    if (member.Serial == m.Serial)
                                    {
                                        inParty = true;
                                    }
                                }
                                if (!inParty)
                                {
                                    targets.Add(m);
                                }
                            }
                            else
                            {
                                targets.Add(m);
                            }
                        }
                        inParty = false;
                    }

                    Effects.PlaySound(Caster.Location, map, 0x1FB);
                    Effects.PlaySound(Caster.Location, map, 0x10B);
                    Effects.SendLocationParticles(EffectItem.Create(Caster.Location, map, EffectItem.DefaultDuration), 0x37CC, 1, 40, 97, 3, 9917, 0);

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

                        Caster.DoHarmful(m);
                        Effects.SendTargetParticles(m, 0x374A, 1, 15, 9502, 97, 3, (EffectLayer)255);

                        double damage = Utility.RandomMinMax(30, 35);

                        if (CheckResisted(m))
                        {
                            damage *= 0.75;

                            m.SendLocalizedMessage(501783); // You feel yourself resisting magical energy.
                        }

                        SpellHelper.Damage(this, m, damage, 0, 0, 0, 0, 100);
                    }
                }
            }

            FinishSequence();
        }
Пример #20
0
        public bool CanEnter(Mobile m)
        {
            if (m is PlayerMobile && m_Stone != null)
            {
                PlayerMobile pm = (PlayerMobile)m;

                if (m.AccessLevel > AccessLevel.Player) // Staff can always enter.
                {
                    return(true);
                }

                // If the dungeon is full and this is a player, don't allow entrance.
                if (CountPlayers() >= m_Stone.MaxPlayers && m is PlayerMobile)
                {
                    m.SendMessage(34, "{0} is full right now. Please try again later.", m_Stone.DungeonName);
                    return(false);
                }

                // If the player is not in the allowed skills window, don't allow.
                if (pm.SkillsTotal > m_Stone.MaxSkills)
                {
                    pm.SendMessage(34, "You are too highly skilled to enter {0}.", m_Stone.DungeonName);
                    return(false);
                }
                if (pm.SkillsTotal < m_Stone.MinSkills)
                {
                    pm.SendMessage(34, "You are not skilled enough to enter {0}.", m_Stone.DungeonName);
                    return(false);
                }

                //
                //          They have passed the restrictions, check for party now
                //

                Party p = Party.Get(pm);

                //
                // if count = 0 let them in. if not, check if either has a party. (no = no enter)
                // if they do have one, check to see if it is the same.???
                if (CountPlayers() > 0)
                {
                    if (p == null) // no party so cant enter
                    {
                        pm.SendMessage(34, "You are not in a party, and the dungeon is occupied.");
                        return(false);
                    }
                    else
                    {
                        foreach (Mobile mobs in m_Stone.GetMobilesInRange(m_Stone.Size))
                        {
                            for (int i = 0; i < p.Members.Count; i++)
                            {
                                PartyMemberInfo pmem = (PartyMemberInfo)p.Members[i];
                                if (pmem.Mobile == mobs)
                                {
                                    return(true);
                                }
                            }
                        }
                        pm.SendMessage(34, "You must join the party inside to enter.");
                        return(false);
                    }
                }
            }

            // Otherwise we are good.
            return(true);
        }
Пример #21
0
        public void Target(IPoint3D p)
        {
            Party party   = Engines.PartySystem.Party.Get(Caster);
            bool  inParty = false;

            if (!Caster.CanSee(p))
            {
                Caster.SendLocalizedMessage(500237);                   // Target can not be seen.
            }
            else if (CheckSequence())
            {
                SpellHelper.Turn(Caster, p);

                if (p is Item)
                {
                    p = ((Item)p).GetWorldLocation();
                }

                ArrayList targets = new ArrayList();

                Map map = Caster.Map;

                if (map != null)
                {
                    IPooledEnumerable eable = map.GetMobilesInRange(new Point3D(p), 4);

                    foreach (Mobile m in eable)
                    {
                        if (Caster != m && SpellHelper.ValidIndirectTarget(Caster, m) && Caster.CanBeHarmful(m, false))
                        {
                            if (party != null && party.Count > 0)
                            {
                                for (int k = 0; k < party.Members.Count; ++k)
                                {
                                    PartyMemberInfo pmi    = (PartyMemberInfo)party.Members[k];
                                    Mobile          member = pmi.Mobile;
                                    if (member.Serial == m.Serial)
                                    {
                                        inParty = true;
                                    }
                                }
                                if (!inParty)
                                {
                                    targets.Add(m);
                                }
                            }
                            else
                            {
                                targets.Add(m);
                            }
                        }
                        inParty = false;
                    }

                    eable.Free();
                }

                if (targets.Count > 0)
                {
                    Effects.PlaySound(p, Caster.Map, 0x160);

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

                        //double damage = Utility.RandomMinMax(45, 90);
                        double damage = Utility.RandomMinMax(22, 45);

                        damage = SpellHelper.AdjustValue(Caster, damage);

                        if (CheckResisted(m))
                        {
                            damage *= 0.75;

                            m.SendLocalizedMessage(501783);                               // You feel yourself resisting magical energy.
                        }

                        Caster.DoHarmful(m);
                        SpellHelper.Damage(this, m, damage, 0, 0, 0, 0, 100);

                        Effects.SendMovingParticles(Caster, m, 0x36D4, 7, 0, false, true, 9501, 1, 0, 0x100);
                    }
                }
            }

            FinishSequence();
        }
Пример #22
0
        public void Target(Mobile m)
        {
            Party party   = Engines.PartySystem.Party.Get(Caster);
            bool  inParty = false;

            if (CheckHSequence(m))
            {
                SpellHelper.Turn(Caster, m);

                /* Creates a blast of poisonous energy centered on the target.
                 * The main target is inflicted with a large amount of Poison damage, and all valid targets in a radius of 2 tiles around the main target are inflicted with a lesser effect.
                 * One tile from main target receives 50% damage, two tiles from target receives 33% damage.
                 */

                CheckResisted(m);                   // Check magic resist for skill, but do not use return value

                Effects.SendLocationParticles(EffectItem.Create(m.Location, m.Map, EffectItem.DefaultDuration), 0x36B0, 1, 14, 63, 7, 9915, 0);
                Effects.PlaySound(m.Location, m.Map, 0x229);

                //double damage = Utility.RandomMinMax(10, 20) * ((300 + (GetDamageSkill(Caster) * 9)) / 1000);

                //damage = SpellHelper.AdjustValue(Caster, damage);

                int level;

                double total = Caster.Skills[SkillName.Animisme].Value; // + Caster.Skills[SkillName.Empoisonner].Value;

                if (total >= 90.0)
                {
                    level = 3;
                }
                else if (total > 70.0)
                {
                    level = 2;
                }
                else if (total > 45.0)
                {
                    level = 1;
                }
                else
                {
                    level = 0;
                }

                m.ApplyPoison(Caster, Poison.GetPoison(level));

                //SpellHelper.Damage(this, m, damage, 0, 0, 0, 0, 100);

                Map map = m.Map;

                if (map != null)
                {
                    ArrayList targets = new ArrayList();

                    foreach (Mobile targ in m.GetMobilesInRange(4))
                    {
                        if ((Caster != targ && m != targ && SpellHelper.ValidIndirectTarget(Caster, targ)) && Caster.CanBeHarmful(targ, false))
                        {
                            if (party != null && party.Count > 0)
                            {
                                for (int k = 0; k < party.Members.Count; ++k)
                                {
                                    PartyMemberInfo pmi    = (PartyMemberInfo)party.Members[k];
                                    Mobile          member = pmi.Mobile;
                                    if (member.Serial == targ.Serial)
                                    {
                                        inParty = true;
                                    }
                                }
                                if (!inParty)
                                {
                                    targets.Add(targ);
                                }
                            }
                            else
                            {
                                targets.Add(targ);
                            }
                        }
                        inParty = false;
                    }

                    for (int i = 0; i < targets.Count; ++i)
                    {
                        Mobile targ = (Mobile)targets[i];

                        targ.ApplyPoison(Caster, Poison.GetPoison(level));

                        //SpellHelper.Damage(this, targ, damage, 0, 0, 0, 0, 100);

                        /*if (!m_Table.Contains(targ))
                         * {
                         *  Timer t = new InternalTimer(targ, Caster);
                         *  t.Start();
                         *
                         *  m_Table[targ] = t;
                         * }*/
                    }
                }
            }

            FinishSequence();
        }
Пример #23
0
        public static bool Gold(Mobile from, Item item)
        {
            if (item is Gold)
            {
                Party party = Party.Get(from);

                if (party != null)
                {
                    int dividedGold = item.Amount / party.Members.Count;

                    if (dividedGold > 0)
                    {
                        item.Delete();

                        for (int j = 0; j < party.Members.Count; j++)
                        {
                            PartyMemberInfo info = party.Members[j] as PartyMemberInfo;

                            if (info != null && info.Mobile != null && info.Mobile is PlayerMobile)
                            {
                                PlayerMobile pm = info.Mobile as PlayerMobile;

                                if (pm.Backpack != null)
                                {
                                    if (pm != from)
                                    {
                                        pm.SendMessage("{0} takes gold from the corpse and divides equally among the party members: {1} for each.", from.Name, dividedGold);
                                    }
                                    else
                                    {
                                        pm.SendMessage("You take gold from the corpse and divide equally among the party members: {0} for each.", dividedGold);
                                    }

                                    Item playerGold = pm.Backpack.FindItemByType(typeof(Gold));

                                    Gold gold = new Gold(dividedGold);

                                    if (playerGold != null)
                                    {
                                        playerGold.Amount += gold.Amount;
                                    }
                                    else
                                    {
                                        pm.Backpack.AddItem(gold);
                                    }

                                    if (pm != from && WeightOverloading.IsOverloaded(pm))
                                    {
                                        pm.SendMessage("{0} keeps your share, cause you are overloaded.", from.Name);
                                        from.SendMessage("You keep {0}'s share, who is overloaded.", pm.Name);
                                        Item goldAdded = pm.Backpack.FindItemByType(typeof(Gold));
                                        goldAdded.Amount -= gold.Amount;
                                        Item goldReturned = from.Backpack.FindItemByType(typeof(Gold));
                                        goldReturned.Amount += gold.Amount;
                                    }
                                    else
                                    {
                                        pm.PlaySound(gold.GetDropSound());
                                    }
                                }
                            }
                        }

                        return(true);
                    }
                }
            }

            return(false);
        }
Пример #24
0
        public void Target(IPoint3D p)
        {
            Party party   = Engines.PartySystem.Party.Get(Caster);
            bool  inParty = false;

            /*Server.Misc.Weather weather = Server.Misc.Weather.GetWeather(Caster.Location);
             *
             * if (weather.Cloud == DensityOfCloud.FaiblePluie || weather.Cloud == DensityOfCloud.Pluie || weather.Cloud == DensityOfCloud.FortePluie)
             * {*/
            if (!Caster.CanSee(p))
            {
                Caster.SendLocalizedMessage(500237);     // Target can not be seen.
            }
            else if (CheckSequence())
            {
                SpellHelper.Turn(Caster, p);

                if (p is Item)
                {
                    p = ((Item)p).GetWorldLocation();
                }

                ArrayList targets = new ArrayList();

                Map map = Caster.Map;

                if (map != null)
                {
                    IPooledEnumerable eable = map.GetMobilesInRange(new Point3D(p), 4);

                    foreach (Mobile m in eable)
                    {
                        if (Caster != m && SpellHelper.ValidIndirectTarget(Caster, m) && Caster.CanBeHarmful(m, false))
                        {
                            if (party != null && party.Count > 0)
                            {
                                for (int k = 0; k < party.Members.Count; ++k)
                                {
                                    PartyMemberInfo pmi    = (PartyMemberInfo)party.Members[k];
                                    Mobile          member = pmi.Mobile;
                                    if (member.Serial == m.Serial)
                                    {
                                        inParty = true;
                                    }
                                }
                                if (!inParty)
                                {
                                    targets.Add(m);
                                }
                            }
                            else
                            {
                                targets.Add(m);
                            }
                        }
                        inParty = false;
                    }

                    eable.Free();
                }


                double damage = Damage.instance.RandDegatsMagiques(Caster, Info.skillForCasting, Info.Circle, Info.castTime) / 2;


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

                        Caster.DoHarmful(m);
                        Damage.instance.AppliquerDegatsMagiques(m, damage);

                        Effects.SendBoltEffect(m, true, 0);
                    }
                }
            }

            /*}
             * else
             * {
             *  Caster.SendMessage("Il n'y a pas assez de nuages pour lancer un eclair !");
             * }*/

            FinishSequence();
        }