Exemple #1
0
        public void Effect(Point3D loc, Map map, bool checkMulti)
        {
            if (!SpellHelper.CheckTravel(Caster, TravelCheckType.GateFrom))
            {
            }
            else if (!SpellHelper.CheckTravel(Caster, map, loc, TravelCheckType.GateTo))
            {
            }
            else if ((checkMulti && SpellHelper.CheckMulti(loc, map)))
            {
                Caster.SendLocalizedMessage(501942); // That location is blocked.
            }
            else if (m_Book != null && m_Book.CurCharges <= 0 && m_Scroll != null)
            {
                Caster.SendLocalizedMessage(502412); // There are no charges left on that item.
            }
            else if (CheckSequence())
            {
                /*if (m_Entry != null && m_Book != null && m_Scroll == null)
                 *  --m_Entry.ChargesLeft;
                 * else */
                if (SphereSpellTarget is RecallRune)
                {
                    RecallRune rune = (RecallRune)SphereSpellTarget;

                    if (rune.ChargesLeft > 0)
                    {
                        --rune.ChargesLeft;
                    }
                    else if (rune.ChargesLeft == 0)
                    {
                        FinishSequence();
                        return;
                    }
                }
                else if (SphereSpellTarget is Runebook)
                {
                    RunebookEntry e = ((Runebook)SphereSpellTarget).Default;

                    /*if (e.ChargesLeft > 0)
                     *  --e.ChargesLeft;
                     * else*/
                    if (e.ChargesLeft == 0)
                    {
                        FinishSequence();
                        return;
                    }
                }

                CustomRegion cR;
                ISpell       markSpell = new Sixth.MarkSpell(Caster, null);

                if ((cR = Caster.Region as CustomRegion) != null && cR.Controller.IsRestrictedSpell(this))
                {
                    Caster.SendAsciiMessage("You can't gate here.");
                }
                else if (Region.Find(loc, map) is HouseRegion || ((cR = Region.Find(loc, map) as CustomRegion) != null && (cR.Controller.IsRestrictedSpell(this) || cR.Controller.IsRestrictedSpell(markSpell))))
                {
                    Caster.SendAsciiMessage("You can't gate to that spot.");
                }
                else
                {
                    InternalItem firstGate  = new InternalItem(loc, map);
                    InternalItem secondGate = new InternalItem(Caster.Location, Caster.Map);

                    firstGate.MoveToWorld(Caster.Location, Caster.Map);
                    Effects.PlaySound(Caster.Location, Caster.Map, Sound);
                    secondGate.MoveToWorld(loc, map);
                    Effects.PlaySound(loc, map, Sound);
                }
            }

            FinishSequence();
        }
Exemple #2
0
        public void Effect(Point3D loc, Map map, bool checkMulti)
        {
            if (!SpellHelper.CheckTravel(Caster, TravelCheckType.RecallFrom))
            {
            }
            else if (!SpellHelper.CheckTravel(Caster, map, loc, TravelCheckType.RecallTo))
            {
            }
            else if ((checkMulti && SpellHelper.CheckMulti(loc, map)))
            {
                Caster.SendLocalizedMessage(501942); // That location is blocked.
            }
            else if (m_Book != null && m_Book.CurCharges <= 0 && m_Scroll != null)
            {
                Caster.SendLocalizedMessage(502412); // There are no charges left on that item.
            }
            else if (CheckSequence())
            {
                Regions.CustomRegion cR = null;
                ISpell markSpell        = new Sixth.MarkSpell(Caster, null);

                if ((cR = Caster.Region as Regions.CustomRegion) != null && cR.Controller.IsRestrictedSpell(this))
                {
                    Caster.SendAsciiMessage("You can't recall here.");
                }
                else if (Region.Find(loc, map) is Regions.HouseRegion || ((cR = Region.Find(loc, map) as Regions.CustomRegion) != null && (cR.Controller.IsRestrictedSpell(this) || cR.Controller.IsRestrictedSpell(markSpell))))
                {
                    Caster.SendAsciiMessage("You can't recall to that spot.");
                }
                else if (Region.Find(loc, map) is Regions.GreenAcres && Caster.AccessLevel == AccessLevel.Player)
                {
                    Caster.SendAsciiMessage("You cannot recall to Green Acres");
                }
                else
                {
                    BaseCreature.TeleportPets(Caster, loc, map, true);

                    /*if (m_Entry != null && m_Book != null && m_Scroll == null)
                     *  --m_Entry.ChargesLeft;
                     * else*/
                    if (m_Book != null && m_Scroll != null)
                    {
                        --m_Book.CurCharges;
                        /*--m_Entry.ChargesLeft;*/
                    }

                    if (SphereSpellTarget is RecallRune)
                    {
                        RecallRune rune = (RecallRune)SphereSpellTarget;

                        if (rune.ChargesLeft > 0)
                        {
                            --rune.ChargesLeft;
                        }
                        else if (rune.ChargesLeft == 0)
                        {
                            FinishSequence();
                            return;
                        }
                    }

                    if (SphereSpellTarget is Runebook)
                    {
                        RunebookEntry e = ((Runebook)SphereSpellTarget).Default;

                        /*if (e.ChargesLeft > 0)
                         *  --e.ChargesLeft;
                         * else*/
                        if (m_Book.CurCharges == 0)
                        {
                            FinishSequence();
                            return;
                        }
                    }

                    Caster.MoveToWorld(loc, map);
                    Caster.PlaySound(Sound);
                    Caster.RevealingAction();
                }
            }
            FinishSequence();
        }
        public void Effect(Point3D loc, Map map, bool checkMulti)
        {
            if (!SpellHelper.CheckTravel(Caster, TravelCheckType.GateFrom))
            {
            }
            else if (!SpellHelper.CheckTravel(Caster, map, loc, TravelCheckType.GateTo))
            {
            }
            else if ((checkMulti && SpellHelper.CheckMulti(loc, map)))
            {
                Caster.SendLocalizedMessage(501942); // That location is blocked.
            }
            else if (m_Book != null && m_Book.CurCharges <= 0 && m_Scroll != null)
            {
                Caster.SendLocalizedMessage(502412); // There are no charges left on that item.
            }
            else if (CheckSequence())
            {
                /*if (m_Entry != null && m_Book != null && m_Scroll == null)
                    --m_Entry.ChargesLeft;
                else */
                if (SphereSpellTarget is RecallRune)
                {
                    RecallRune rune = (RecallRune)SphereSpellTarget;

                    if (rune.ChargesLeft > 0)
                        --rune.ChargesLeft;
                    else if (rune.ChargesLeft == 0)
                    {
                        FinishSequence();
                        return;
                    }
                }
                else if (SphereSpellTarget is Runebook)
                {
                    RunebookEntry e = ((Runebook)SphereSpellTarget).Default;

                    /*if (e.ChargesLeft > 0)
                        --e.ChargesLeft;
                    else*/
                    if (e.ChargesLeft == 0)
                    {
                        FinishSequence();
                        return;
                    }
                }

                CustomRegion cR;
                ISpell markSpell = new Sixth.MarkSpell(Caster, null); 
                
                if ((cR = Caster.Region as CustomRegion) != null && cR.Controller.IsRestrictedSpell(this))
                    Caster.SendAsciiMessage("You can't gate here.");
                else if (Region.Find(loc, map) is HouseRegion || ((cR = Region.Find(loc, map) as CustomRegion) != null && (cR.Controller.IsRestrictedSpell(this) || cR.Controller.IsRestrictedSpell(markSpell))))
                    Caster.SendAsciiMessage("You can't gate to that spot.");
                else
                {
                    InternalItem firstGate = new InternalItem(loc, map);
                    InternalItem secondGate = new InternalItem(Caster.Location, Caster.Map);

                    firstGate.MoveToWorld(Caster.Location, Caster.Map);
                    Effects.PlaySound(Caster.Location, Caster.Map, Sound);
                    secondGate.MoveToWorld(loc, map);
                    Effects.PlaySound(loc, map, Sound);
                }
            }

            FinishSequence();
        }
Exemple #4
0
		public void Effect( Point3D loc, Map map, bool checkMulti )
		{
			if ( !SpellHelper.CheckTravel( Caster, TravelCheckType.RecallFrom ) )
			{
			}
			else if ( !SpellHelper.CheckTravel( Caster, map, loc, TravelCheckType.RecallTo ) )
			{
			}
			else if ( (checkMulti && SpellHelper.CheckMulti( loc, map )) )
			{
				Caster.SendLocalizedMessage( 501942 ); // That location is blocked.
			}
            else if (m_Book != null && m_Book.CurCharges <= 0 && m_Scroll != null)
			{
				Caster.SendLocalizedMessage( 502412 ); // There are no charges left on that item.
			}
			else if ( CheckSequence() )
			{
                Regions.CustomRegion cR = null;
                ISpell markSpell = new Sixth.MarkSpell(Caster, null);

                if ((cR = Caster.Region as Regions.CustomRegion) != null && cR.Controller.IsRestrictedSpell(this))
                    Caster.SendAsciiMessage("You can't recall here.");
                else if (Region.Find(loc, map) is Regions.HouseRegion || ((cR = Region.Find(loc, map) as Regions.CustomRegion) != null && (cR.Controller.IsRestrictedSpell(this) || cR.Controller.IsRestrictedSpell(markSpell))))
                    Caster.SendAsciiMessage("You can't recall to that spot.");
                else if (Region.Find(loc, map) is Regions.GreenAcres && Caster.AccessLevel == AccessLevel.Player)
                    Caster.SendAsciiMessage("You cannot recall to Green Acres");
                else
                {
                    BaseCreature.TeleportPets(Caster, loc, map, true);

                    /*if (m_Entry != null && m_Book != null && m_Scroll == null)
                        --m_Entry.ChargesLeft;
                    else*/
                    if (m_Book != null && m_Scroll != null)
                    {
                        --m_Book.CurCharges;
                        /*--m_Entry.ChargesLeft;*/
                    }

                    if (SphereSpellTarget is RecallRune)
                    {
                        RecallRune rune = (RecallRune) SphereSpellTarget;

                        if (rune.ChargesLeft > 0)
                            --rune.ChargesLeft;
                        else if (rune.ChargesLeft == 0)
                        {
                            FinishSequence();
                            return;
                        }
                    }

                    if (SphereSpellTarget is Runebook)
                    {
                        RunebookEntry e = ((Runebook) SphereSpellTarget).Default;

                        /*if (e.ChargesLeft > 0)
                            --e.ChargesLeft;
                        else*/
                        if (e.ChargesLeft == 0)
                        {
                            FinishSequence();
                            return;
                        }
                    }

                    Caster.MoveToWorld(loc, map);
                    Caster.PlaySound(Sound);
                    Caster.RevealingAction();
                }
			}
			FinishSequence();
		}