public override bool CheckCast() { WarpBlockerTotem recallBlocker = WarpBlockerTotem.RecallBlockerTriggered(Caster, WarpBlockerTotem.MovementMode.TeleportOut, Caster.Location, Caster.Map); if (recallBlocker != null) { if (recallBlocker.PreventTeleportOutResponse != "") { Caster.SendMessage(recallBlocker.PreventTeleportOutResponse); } else { Caster.SendMessage(WarpBlockerTotem.DefaultTeleportOutResponse); } return(false); } if (Server.Misc.WeightOverloading.IsOverloaded(Caster)) { Caster.SendLocalizedMessage(502359, "", 0x22); // Thou art too encumbered to move. return(false); } else if (!Caster.CanBeginAction(typeof(TeleportSpell))) { Caster.SendLocalizedMessage(502644, "", 0x22); //You have not yet recovered from casting a spell. return(false); } //return true; return(SpellHelper.CheckTravel(Caster, TravelCheckType.TeleportFrom)); }
public override bool CheckCast() { PlayerMobile pm_Caster = Caster as PlayerMobile; WarpBlockerTotem recallBlocker = WarpBlockerTotem.RecallBlockerTriggered(Caster, WarpBlockerTotem.MovementMode.RecallOut, Caster.Location, Caster.Map); if (recallBlocker != null) { if (recallBlocker.PreventRecallOutResponse != "") { Caster.SendMessage(recallBlocker.PreventRecallOutResponse); } else { Caster.SendMessage(WarpBlockerTotem.DefaultRecallOutResponse); } return(false); } else if (Caster.Criminal) { Caster.SendLocalizedMessage(1005561, "", 0x22); // Thou'rt a criminal and cannot escape so easily. return(false); } else if (SpellHelper.CheckCombat(Caster)) { Caster.SendLocalizedMessage(1005564, "", 0x22); // Wouldst thou flee during the heat of battle?? return(false); } else if (Server.Misc.WeightOverloading.IsOverloaded(Caster)) { Caster.SendLocalizedMessage(502359, "", 0x22); // Thou art too encumbered to move. return(false); } if (pm_Caster != null) { if (pm_Caster.RecallRestrictionExpiration > DateTime.UtcNow) { string timeRemaining = Utility.CreateTimeRemainingString(DateTime.UtcNow, pm_Caster.RecallRestrictionExpiration, false, true, true, true, true); pm_Caster.SendMessage("You are unable to cast this spell for another " + timeRemaining + "."); return(false); } } return(SpellHelper.CheckTravel(Caster, TravelCheckType.RecallFrom)); }
public void Effect(Point3D loc, Map map, bool checkMulti) { PlayerMobile pm = Caster as PlayerMobile; BaseShip ship = BaseShip.FindShipAt(loc, map); WarpBlockerTotem recallBlocker = WarpBlockerTotem.RecallBlockerTriggered(Caster, WarpBlockerTotem.MovementMode.RecallIn, loc, map); if (recallBlocker != null) { if (recallBlocker.PreventRecallInResponse != "") { Caster.SendMessage(recallBlocker.PreventRecallInResponse); } else { Caster.SendMessage(WarpBlockerTotem.DefaultRecallInResponse); } } else if (map == null || (!Core.AOS && Caster.Map != map)) { Caster.SendLocalizedMessage(1005569); // You can not recall to another facet. } else if (!SpellHelper.CheckTravel(Caster, map, loc, TravelCheckType.RecallTo)) { Caster.SendLocalizedMessage(501802); // Thy spell doth not appear to work... } else if (SpellHelper.IsAnyT2A(map, loc) && pm != null) { } else if (Server.Misc.WeightOverloading.IsOverloaded(Caster)) { Caster.SendLocalizedMessage(502359, "", 0x22); // Thou art too encumbered to move. } else if (map != Map.Felucca) { Caster.SendLocalizedMessage(1019004); // You are not allowed to travel there. } else if (Caster.MurderCounts >= Mobile.MurderCountsRequiredForMurderer && map != Map.Felucca) { Caster.SendLocalizedMessage(1019004); // You are not allowed to travel there. } else if (!SpellHelper.CheckIfOK(Caster.Map, loc.X, loc.Y, loc.Z)) { Caster.SendLocalizedMessage(501942); // That location is blocked. } else if ((checkMulti && SpellHelper.CheckMulti(loc, map))) { Caster.SendLocalizedMessage(501942); // That location is blocked. } else if (SpellHelper.IsSolenHiveLoc(loc)) { Caster.SendLocalizedMessage(1019004); // You are not allowed to travel there. } else if (SpellHelper.IsStarRoom(loc)) { Caster.SendLocalizedMessage(1019004); // You are not allowed to travel there. } else if (SpellHelper.IsWindLoc(loc)) { Caster.SendLocalizedMessage(1019004); // You are not allowed to travel there. } else if (ship != null && ship.Owner != Caster) { Caster.SendLocalizedMessage(1019004); // You are not allowed to travel there. } else if ((m_Book != null && m_Book.CurCharges <= 0) || (m_RuneTome != null && m_RuneTome.RecallCharges <= 0)) { Caster.SendMessage("There are no recall charges left on that item."); } else if (CheckSequence()) { if (m_Book != null) { --m_Book.CurCharges; } if (m_RuneTome != null) { --m_RuneTome.RecallCharges; } Point3D sourceLocation = Caster.Location; Map sourceMap = Caster.Map; Point3D targetLocation = loc; Map targetMap = map; //Player Enhancement Customization: PhaseShift bool phaseShift = false; //PlayerEnhancementPersistance.IsCustomizationEntryActive(Caster, CustomizationType.PhaseShift); if (phaseShift) { Caster.MoveToWorld(loc, map); Effects.PlaySound(sourceLocation, sourceMap, 0x1FC); Effects.SendLocationEffect(sourceLocation, sourceMap, 0x3967, 30, 15, 2499, 0); Effects.PlaySound(targetLocation, targetMap, 0x1FC); Effects.SendLocationEffect(targetLocation, targetMap, 0x3967, 30, 15, 2499, 0); } else { Caster.PlaySound(0x1FC); Caster.MoveToWorld(loc, map); Caster.PlaySound(0x1FC); } } FinishSequence(); }
public override void OnResponse(NetState state, RelayInfo info) { Mobile from = state.Mobile; PlayerMobile player = from as PlayerMobile; if (player == null) { return; } PageType type = (PageType)(-1); switch (info.ButtonID) { case 0: // Close/Cancel { from.SendLocalizedMessage(501235, "", 0x35); // Help request aborted. break; } case 1: // General question { type = PageType.Question; break; } case 2: // Stuck { BaseHouse house = BaseHouse.FindHouseAt(player); WarpBlockerTotem recallBlocker = WarpBlockerTotem.RecallBlockerTriggered(player, WarpBlockerTotem.MovementMode.HelpStuck, player.Location, player.Map); if (house != null) { player.Location = house.BanLocation; } else if (recallBlocker != null) { if (recallBlocker.PreventHelpStuckResponse != "") { player.SendMessage(recallBlocker.PreventHelpStuckResponse); } else { player.SendMessage(WarpBlockerTotem.DefaultHelpStuckResponse); } } else if (player.Region.IsPartOf(typeof(Server.Regions.Jail))) { player.SendLocalizedMessage(1041530, "", 0x35); // You'll need a better jailbreak plan then that! } else if (CheckCombat(player)) { player.SendMessage("You have been in combat too recently to use this option."); } else if (player.RecallRestrictionExpiration > DateTime.UtcNow) { player.SendMessage("You must wait for your Recall Restriction to expire before you may use this option."); } else if (player.CanUseStuckMenu() && from.Region.CanUseStuckMenu(player) && !player.Frozen) { StuckMenu menu = new StuckMenu(player, player, true); menu.BeginClose(); player.SendGump(menu); } else { type = PageType.Stuck; } break; } case 3: // Report bug or contact Origin { type = PageType.Bug; break; } case 4: // Game suggestion { type = PageType.Suggestion; break; } case 5: // Account management { type = PageType.Account; break; } case 6: // Other { type = PageType.Other; break; } case 7: // Harassment: verbal/exploit { type = PageType.VerbalHarassment; break; } case 8: // Harassment: physical { type = PageType.PhysicalHarassment; break; } } if (type != (PageType)(-1) && PageQueue.CheckAllowedToPage(from)) { from.SendGump(new PagePromptGump(from, type)); } }
public void Target(IPoint3D p) { IPoint3D orig = p; Map map = Caster.Map; SpellHelper.GetSurfaceTop(ref p); Point3D pP = new Point3D(p); WarpBlockerTotem recallBlocker = WarpBlockerTotem.RecallBlockerTriggered(Caster, WarpBlockerTotem.MovementMode.TeleportIn, pP, Caster.Map); if (recallBlocker != null) { if (recallBlocker.PreventTeleportInResponse != "") { Caster.SendMessage(recallBlocker.PreventTeleportInResponse); } else { Caster.SendMessage(WarpBlockerTotem.DefaultTeleportInResponse); } } else if (Server.Misc.WeightOverloading.IsOverloaded(Caster)) { Caster.SendLocalizedMessage(502359, "", 0x22); // Thou art too encumbered to move. } else if (!SpellHelper.CheckTravel(Caster, TravelCheckType.TeleportFrom)) { Caster.SendLocalizedMessage(501942); // That location is blocked. } else if (!SpellHelper.CheckTravel(Caster, map, pP, TravelCheckType.TeleportTo)) { Caster.SendLocalizedMessage(501942); // That location is blocked. } else if (map == null || !map.CanSpawnMobile(p.X, p.Y, p.Z)) { Caster.SendLocalizedMessage(501942); // That location is blocked. } else if (SpellHelper.CheckMulti(pP, map)) { Caster.SendLocalizedMessage(501942); // That location is blocked. } else { if (CheckSequence()) { SpellHelper.Turn(Caster, orig); Mobile m = Caster; Point3D from = m.Location; Point3D to = pP; m.Location = to; m.ProcessDelta(); int spellHue = Enhancements.GetMobileSpellHue(Caster, Enhancements.SpellType.Teleport); if (m.Player) { Effects.SendLocationParticles(EffectItem.Create(from, m.Map, EffectItem.DefaultDuration), 0x3728, 10, 10, spellHue, 0, 2023, 0); //Player Enhancement Customization: Blink bool blink = false; //PlayerEnhancementPersistance.IsCustomizationEntryActive(Caster, CustomizationType.Blink); if (blink) { int distance = Utility.GetDistance(from, to); Point3D effectStep = from; for (int a = 0; a < distance + 1; a++) { Timer.DelayCall(TimeSpan.FromSeconds(a * .05), delegate { if (m == null) { return; } Direction direction = Utility.GetDirection(effectStep, to); effectStep = SpecialAbilities.GetPointByDirection(effectStep, direction); Effects.SendLocationParticles(EffectItem.Create(effectStep, m.Map, EffectItem.DefaultDuration), 0x3728, 10, 10, spellHue, 0, 2023, 0); m.PlaySound(0x5C6); }); } } else { Effects.SendLocationParticles(EffectItem.Create(to, m.Map, EffectItem.DefaultDuration), 0x3728, 10, 10, spellHue, 0, 2023, 0); m.PlaySound(0x1FE); } } else { m.FixedParticles(0x376A, 9, 32, 0x13AF, spellHue, 0, EffectLayer.Waist); m.PlaySound(0x1FE); } IPooledEnumerable eable = m.GetItemsInRange(0); foreach (Item item in eable) { if (item is Server.Spells.Sixth.ParalyzeFieldSpell.ParalyzeFieldItem || item is Server.Spells.Fifth.PoisonFieldSpell.PoisonFieldItem || item is Server.Spells.Fourth.FireFieldSpell.FireFieldItem) { item.OnMoveOver(m); } } eable.Free(); m.BeginAction(typeof(TeleportSpell)); Timer.DelayCall(TimeSpan.FromSeconds(6), delegate { m.EndAction(typeof(TeleportSpell)); }); } } FinishSequence(); }
public void Effect(Point3D loc, Map map, bool checkMulti) { WarpBlockerTotem recallBlocker = WarpBlockerTotem.RecallBlockerTriggered(Caster, WarpBlockerTotem.MovementMode.GateIn, loc, map); if (recallBlocker != null) { if (recallBlocker.PreventGateOutResponse != "") { Caster.SendMessage(recallBlocker.PreventGateOutResponse); } else { Caster.SendMessage(WarpBlockerTotem.DefaultGateOutResponse); } } else if (map == null || (!Core.AOS && Caster.Map != map)) { Caster.SendLocalizedMessage(1005570); // You can not gate to another facet. } else if (!SpellHelper.CheckTravel(Caster, map, loc, TravelCheckType.GateTo)) { Caster.SendLocalizedMessage(501802); // Thy spell doth not appear to work... } else if (map != Map.Felucca) { Caster.SendLocalizedMessage(1019004); // You are not allowed to travel there. } else if (Caster.MurderCounts >= Mobile.MurderCountsRequiredForMurderer && map != Map.Felucca) { Caster.SendLocalizedMessage(1019004); // You are not allowed to travel there. } else if (!SpellHelper.CheckIfOK(Caster.Map, loc.X, loc.Y, loc.Z)) { Caster.SendLocalizedMessage(501942); // That location is blocked. } else if ((checkMulti && SpellHelper.CheckMulti(loc, map))) { Caster.SendLocalizedMessage(501942); // That location is blocked. } else if (SpellHelper.IsSolenHiveLoc(loc)) { Caster.SendLocalizedMessage(501802); // Thy spell doth not appear to work... } else if (SpellHelper.IsStarRoom(loc)) { Caster.SendLocalizedMessage(501802); // Thy spell doth not appear to work... } else if (SpellHelper.IsWindLoc(Caster.Location)) { Caster.SendLocalizedMessage(501802); // Thy spell doth not appear to work... } else if (SpellHelper.IsWindLoc(loc)) { Caster.SendLocalizedMessage(501802); // Thy spell doth not appear to work... } else if (BaseShip.FindShipAt(loc, map) != null) { Caster.SendLocalizedMessage(501802); // Thy spell doth not appear to work... } else if (m_RuneTome != null && m_RuneTome.GateCharges <= 0) { Caster.SendMessage("There are no gate charges left on that item."); } else if (CheckSequence() && CheckCast()) { if (m_RuneTome != null) { --m_RuneTome.GateCharges; } Caster.SendLocalizedMessage(501024); // You open a magical gate to another location //Player Enhancement Customization: Traveler bool traveler = false; //PlayerEnhancementPersistance.IsCustomizationEntryActive(Caster, CustomizationType.Traveler); if (traveler) { //First Gate Effects.PlaySound(Caster.Location, Caster.Map, 0x5CE); Effects.SendLocationParticles(EffectItem.Create(Caster.Location, Caster.Map, TimeSpan.FromSeconds(0.5)), 6899, 10, 30, 0, 0, 5029, 0); InternalItem firstGate = new InternalItem(loc, map); firstGate.Visible = false; firstGate.MoveToWorld(Caster.Location, Caster.Map); //Second Gate Effects.PlaySound(loc, map, 0x5CE); Effects.SendLocationParticles(EffectItem.Create(loc, map, TimeSpan.FromSeconds(0.5)), 6899, 10, 30, 0, 0, 5029, 0); InternalItem secondGate = new InternalItem(Caster.Location, Caster.Map); secondGate.Visible = false; secondGate.MoveToWorld(loc, map); Timer.DelayCall(TimeSpan.FromSeconds(1.25), delegate { if (firstGate != null) { if (!firstGate.Deleted) { firstGate.Visible = true; } } if (secondGate != null) { if (!secondGate.Deleted) { secondGate.Visible = true; } } }); } else { Effects.PlaySound(Caster.Location, Caster.Map, 0x20E); InternalItem firstGate = new InternalItem(loc, map); firstGate.MoveToWorld(Caster.Location, Caster.Map); Effects.PlaySound(loc, map, 0x20E); InternalItem secondGate = new InternalItem(Caster.Location, Caster.Map); secondGate.MoveToWorld(loc, map); } } FinishSequence(); }
public override bool CheckCast() { PlayerMobile pm_Caster = Caster as PlayerMobile; WarpBlockerTotem recallBlocker = WarpBlockerTotem.RecallBlockerTriggered(Caster, WarpBlockerTotem.MovementMode.GateOut, Caster.Location, Caster.Map); if (recallBlocker != null) { if (recallBlocker.PreventGateInResponse != "") { Caster.SendMessage(recallBlocker.PreventGateInResponse); } else { Caster.SendMessage(WarpBlockerTotem.DefaultGateInResponse); } return(false); } else if (Caster.Criminal) { Caster.SendLocalizedMessage(1005561, "", 0x22); // Thou'rt a criminal and cannot escape so easily. return(false); } else if (SpellHelper.CheckCombat(Caster)) { Caster.SendLocalizedMessage(1005564, "", 0x22); // Wouldst thou flee during the heat of battle?? return(false); } else if (BaseBoat.FindBoatAt(Caster.Location, Caster.Map) != null) { Caster.SendMessage("You may not cast this spell while at sea."); return(false); } if (pm_Caster != null) { if (pm_Caster.RecallRestrictionExpiration > DateTime.UtcNow) { int minutes = pm_Caster.RecallRestrictionExpiration.Subtract(DateTime.UtcNow).Minutes; int seconds = pm_Caster.RecallRestrictionExpiration.Subtract(DateTime.UtcNow).Seconds; string sTime = ""; if (minutes > 1) { sTime += minutes.ToString() + " minutes "; } else if (minutes == 1) { sTime += minutes.ToString() + " minute "; } if (seconds > 1) { sTime += seconds.ToString() + " seconds "; } else if (seconds == 1) { sTime += seconds.ToString() + " second "; } sTime = sTime.Trim(); if (sTime != "") { pm_Caster.SendMessage("You are unable to cast this spell for another " + sTime + "."); } return(false); } } return(SpellHelper.CheckTravel(Caster, TravelCheckType.GateFrom)); }
public void Target(RecallRune rune) { // IPY : Protection for DungeonMiningSystem. if (Caster.Map == Map.Ilshenar) { Caster.SendLocalizedMessage(501802); // Thy spell doth not appear to work... return; } WarpBlockerTotem recallBlocker = WarpBlockerTotem.RecallBlockerTriggered(Caster, WarpBlockerTotem.MovementMode.Mark, Caster.Location, Caster.Map); if (recallBlocker != null) { if (recallBlocker.PreventMarkResponse != "") { Caster.SendMessage(recallBlocker.PreventMarkResponse); } else { Caster.SendMessage(WarpBlockerTotem.DefaultMarkResponse); } } else if (!Caster.CanSee(rune)) { Caster.SendLocalizedMessage(500237); // Target can not be seen. } else if (!SpellHelper.CheckTravel(Caster, TravelCheckType.Mark)) { Caster.SendLocalizedMessage(501802); // Thy spell doth not appear to work... } else if (Caster.Map != Map.Felucca) { Caster.SendLocalizedMessage(501802); // Thy spell doth not appear to work... } else if (SpellHelper.CheckMulti(Caster.Location, Caster.Map)) { Caster.SendLocalizedMessage(501942); // That location is blocked. } else if (SpellHelper.IsSolenHiveLoc(Caster.Location)) { Caster.SendLocalizedMessage(501802); // Thy spell doth not appear to work... } else if (SpellHelper.IsStarRoom(Caster.Location)) { Caster.SendLocalizedMessage(501802); // Thy spell doth not appear to work... } else if (SpellHelper.IsWindLoc(Caster.Location)) { Caster.SendLocalizedMessage(501802); // Thy spell doth not appear to work... } else if (BaseBoat.FindBoatAt(Caster.Location, Caster.Map) != null) { Caster.SendMessage("You cannot mark a location at sea."); } else if (CheckSequence()) { rune.Mark(Caster); int spellHue = 0; // PlayerEnhancementPersistance.GetSpellHueFor(Caster, HueableSpell.Mark); Caster.PlaySound(0x1FA); Effects.SendLocationEffect(Caster, Caster.Map, 14201, 16, spellHue, 0); } FinishSequence(); }
public void Effect(Point3D loc, Map map, bool checkMulti) { PlayerMobile pm = Caster as PlayerMobile; BaseBoat boat = BaseBoat.FindBoatAt(loc, map); WarpBlockerTotem recallBlocker = WarpBlockerTotem.RecallBlockerTriggered(Caster, WarpBlockerTotem.MovementMode.RecallIn, loc, map); if (recallBlocker != null) { if (recallBlocker.PreventRecallInResponse != "") { Caster.SendMessage(recallBlocker.PreventRecallInResponse); } else { Caster.SendMessage(WarpBlockerTotem.DefaultRecallInResponse); } } else if (map == null || (!Core.AOS && Caster.Map != map)) { Caster.SendLocalizedMessage(1005569); // You can not recall to another facet. } else if (!SpellHelper.CheckTravel(Caster, map, loc, TravelCheckType.RecallTo)) { Caster.SendLocalizedMessage(501802); // Thy spell doth not appear to work... } else if (SpellHelper.IsAnyT2A(map, loc) && pm != null) { } else if (Server.Misc.WeightOverloading.IsOverloaded(Caster)) { Caster.SendLocalizedMessage(502359, "", 0x22); // Thou art too encumbered to move. } else if (map != Map.Felucca) { Caster.SendLocalizedMessage(1019004); // You are not allowed to travel there. } else if (Caster.ShortTermMurders >= 5 && map != Map.Felucca) { Caster.SendLocalizedMessage(1019004); // You are not allowed to travel there. } else if (!SpellHelper.CheckIfOK(Caster.Map, loc.X, loc.Y, loc.Z)) { Caster.SendLocalizedMessage(501942); // That location is blocked. } else if ((checkMulti && SpellHelper.CheckMulti(loc, map))) { Caster.SendLocalizedMessage(501942); // That location is blocked. } else if (SpellHelper.IsSolenHiveLoc(loc)) { Caster.SendLocalizedMessage(1019004); // You are not allowed to travel there. } else if (SpellHelper.IsStarRoom(loc)) { Caster.SendLocalizedMessage(1019004); // You are not allowed to travel there. } else if (SpellHelper.IsWindLoc(loc)) { Caster.SendLocalizedMessage(1019004); // You are not allowed to travel there. } else if (boat != null && boat.Owner != Caster) { Caster.SendLocalizedMessage(1019004); // You are not allowed to travel there. } else if (m_Book != null && m_Book.CurCharges <= 0) { Caster.SendLocalizedMessage(502412); // There are no charges left on that item. } else if (CheckSequence()) { if (m_Book != null) { --m_Book.CurCharges; } var astralLeash = Caster.Backpack.FindItemByType <AstralLeash>(); if (astralLeash != null && !astralLeash.Deleted && astralLeash.CanConsume() && Caster.Followers > 0) { if (BaseCreature.TeleportPets(Caster, loc, map, false)) { astralLeash.Consume(); } } Point3D sourceLocation = Caster.Location; Map sourceMap = Caster.Map; Point3D targetLocation = loc; Map targetMap = map; //Player Enhancement Customization: PhaseShift bool phaseShift = PlayerEnhancementPersistance.IsCustomizationEntryActive(Caster, CustomizationType.PhaseShift); if (phaseShift) { Caster.MoveToWorld(loc, map); Effects.PlaySound(sourceLocation, sourceMap, 0x1FC); Effects.SendLocationEffect(sourceLocation, sourceMap, 0x3967, 30, 15, 2499, 0); Effects.PlaySound(targetLocation, targetMap, 0x1FC); Effects.SendLocationEffect(targetLocation, targetMap, 0x3967, 30, 15, 2499, 0); } else { Caster.PlaySound(0x1FC); Caster.MoveToWorld(loc, map); Caster.PlaySound(0x1FC); } } FinishSequence(); }