public override int PlayEndingEffect(Mobile from, bool failed, bool lostMaterial, bool toolBroken, int quality, bool makersMark, CraftItem item) { if (toolBroken) { from.SendLocalizedMessage(1044038); // You have worn out your tool } if (!typeofSpellScroll.IsAssignableFrom(item.ItemType)) // not a scroll { if (failed) { if (lostMaterial) { return(1044043); // You failed to create the item, and some of your materials are lost. } else { return(1044157); // You failed to create the item, but no materials were lost. } } else { if (quality == 0) { return(502785); // You were barely able to make this item. It's quality is below average. } else if (makersMark && quality == 2) { //Player Enhancement Customization: Artisan if (PlayerEnhancementPersistance.IsCustomizationEntryActive(from, CustomizationType.Artisan)) { CustomizationAbilities.Artisan(from, from.Location, from.Map); } return(1044156); // You create an exceptional quality item and affix your maker's mark. } else if (quality == 2) { return(1044155); // You create an exceptional quality item. } else { return(1044154); // You create the item. } } } else { if (failed) { return(501630); // You fail to inscribe the scroll, and the scroll is ruined. } else { return(501629); // You inscribe the spell and put the scroll in your backpack. } } }
public void Target(Mobile mobile) { if (!Caster.CanSee(mobile) || mobile.Hidden) { Caster.SendLocalizedMessage(500237); // Target can not be seen. } //It was on IPY but seems right...U cant hide vendor and others with higher access level. else if (mobile is Mobiles.BaseVendor || mobile is Mobiles.PlayerVendor || mobile is Mobiles.PlayerBarkeeper || mobile.AccessLevel > Caster.AccessLevel) { Caster.SendLocalizedMessage(501857); // This spell won't work on that! } else if (CheckBSequence(mobile)) { SpellHelper.Turn(Caster, mobile); int spellHue = 0; //Player Enhancement Customization: Vanish bool vanish = PlayerEnhancementPersistance.IsCustomizationEntryActive(Caster, CustomizationType.Vanish); if (vanish) { CustomizationAbilities.Vanish(mobile); } else { Effects.SendLocationParticles(EffectItem.Create(new Point3D(mobile.X, mobile.Y, mobile.Z + 16), Caster.Map, EffectItem.DefaultDuration), 0x376A, 10, 15, spellHue, 0, 5045, 0); mobile.PlaySound(0x3C4); } mobile.Hidden = true; if (mobile is BaseCreature) { var bc = mobile as BaseCreature; if (!bc.Controlled && !bc.Summoned && (!bc.InitialInnocent || bc.AlwaysAttackable || bc.IsMurderer())) { Caster.CriminalAction(false); } } RemoveTimer(mobile); //Changed to the duration of IPY TimeSpan duration = TimeSpan.FromSeconds(Caster.Skills[SkillName.Magery].Value * 1.2); // 120% of magery Timer t = new InternalTimer(mobile, duration); m_Table[mobile] = t; t.Start(); } FinishSequence(); }
public override int PlayEndingEffect(Mobile from, bool failed, bool lostMaterial, bool toolBroken, int quality, bool makersMark, CraftItem item) { if (toolBroken) { from.SendLocalizedMessage(1044038); // You have worn out your tool } if (failed) { if (lostMaterial) { return(1044043); // You failed to create the item, and some of your materials are lost. } else { return(1044157); // You failed to create the item, but no materials were lost. } } else { from.PlaySound(0x41); // glass breaking if (quality == 0) { return(502785); // You were barely able to make this item. It's quality is below average. } else if (makersMark && quality == 2) { //Player Enhancement Customization: Artisan if (PlayerEnhancementPersistance.IsCustomizationEntryActive(from, CustomizationType.Artisan)) { CustomizationAbilities.Artisan(from, from.Location, from.Map); } return(1044156); // You create an exceptional quality item and affix your maker's mark. } else if (quality == 2) { return(1044155); // You create an exceptional quality item. } else { return(1044154); // You create the item. } } }
public static void OnLogin(PlayerMobile player) { if (player == null) { return; } PlayerEnhancementPersistance.CheckAndCreatePlayerEnhancementAccountEntry(player); player.m_PlayerEnhancementAccountEntry.AuditCustomizationEntries(); player.m_PlayerEnhancementAccountEntry.AuditSpellHueEntries(); //Hoarder bool hoarder = PlayerEnhancementPersistance.IsCustomizationEntryActive(player, CustomizationType.Hoarder); if (hoarder) { if (player.BankBox != null) { if (player.BankBox.MaxItems == 125) { player.BankBox.MaxItems += 25; } } } //Bench Player bool benchPlayer = PlayerEnhancementPersistance.IsCustomizationEntryActive(player, CustomizationType.BenchPlayer); if (benchPlayer) { Account account = player.Account as Account; if (account == null) { return; } if (account.CharacterLimit == 5) { account.CharacterLimit = 6; } } }
public override bool OnMoveOver(Mobile mobile) { if (Visible && m_Caster != null && SpellHelper.ValidIndirectTarget(m_Caster, mobile) && m_Caster.CanBeHarmful(mobile, false)) { m_Caster.DoHarmful(mobile); //Player Enhancement Customization: Venomous bool venomous = PlayerEnhancementPersistance.IsCustomizationEntryActive(m_Caster, CustomizationType.Venomous); if (venomous) { CustomizationAbilities.Venomous(mobile); } else { mobile.PlaySound(0x474); } ApplyPoisonTo(mobile); } return(true); }
public static int GetMaxStableSlots(PlayerMobile player) { if (player == null) { return(0); } int stableSlots = 10; //Animal Taming stableSlots += (int)(Math.Floor(player.Skills[SkillName.AnimalTaming].Value / 20)); if (player.Skills[SkillName.AnimalTaming].Value == 120) { stableSlots += 4; } //Animal Lore stableSlots += (int)(Math.Floor(player.Skills[SkillName.AnimalLore].Value / 20)); if (player.Skills[SkillName.AnimalLore].Value == 120) { stableSlots += 4; } if (PlayerEnhancementPersistance.IsCustomizationEntryActive(player, CustomizationType.Herdsman)) { stableSlots += 5; } if (PlayerEnhancementPersistance.IsCustomizationEntryActive(player, CustomizationType.Rancher)) { stableSlots += 5; } return(stableSlots); }
public InternalItem(Point3D loc, Map map, Mobile caster) : base(128) { Visible = false; Movable = false; //Player Enhancement Customization: Geomancer if (PlayerEnhancementPersistance.IsCustomizationEntryActive(caster, CustomizationType.Geomancer)) { ItemID = 376; } int spellHue = PlayerEnhancementPersistance.GetSpellHueFor(caster, HueableSpell.WallOfStone); Hue = spellHue; MoveToWorld(loc, map); if (caster.InLOS(this)) { Visible = true; } else { Delete(); } if (Deleted) { return; } m_Timer = new InternalTimer(this, TimeSpan.FromSeconds(10.0)); m_Timer.Start(); m_End = DateTime.UtcNow + TimeSpan.FromSeconds(10.0); }
protected override void OnTick() { if (m_Item.Deleted) { return; } if (!m_Item.Visible) { if (m_InLOS && m_CanFit) { m_Item.Visible = true; } else { m_Item.Delete(); } if (!m_Item.Deleted) { m_Item.ProcessDelta(); Effects.SendLocationParticles(EffectItem.Create(m_Item.Location, m_Item.Map, EffectItem.DefaultDuration), 0x376A, 9, 10, 5040); } } else if (DateTime.UtcNow > m_Item.m_End) { m_Item.Delete(); Stop(); } else { Map map = m_Item.Map; Mobile caster = m_Item.m_Caster; if (map != null && caster != null) { bool eastToWest = (m_Item.ItemID == 0x3915); IPooledEnumerable eable = map.GetMobilesInBounds(new Rectangle2D(m_Item.X - (eastToWest ? 0 : 1), m_Item.Y - (eastToWest ? 1 : 0), (eastToWest ? 1 : 2), (eastToWest ? 2 : 1))); foreach (Mobile m in eable) { if ((m.Z + 16) > m_Item.Z && (m_Item.Z + 12) > m.Z && SpellHelper.ValidIndirectTarget(caster, m) && caster.CanBeHarmful(m, false)) { m_Queue.Enqueue(m); } } eable.Free(); while (m_Queue.Count > 0) { Mobile mobile = (Mobile)m_Queue.Dequeue(); caster.DoHarmful(mobile); //Player Enhancement Customization: Venomous bool venomous = PlayerEnhancementPersistance.IsCustomizationEntryActive(caster, CustomizationType.Venomous); if (venomous) { CustomizationAbilities.Venomous(mobile); } else { mobile.PlaySound(0x474); } m_Item.ApplyPoisonTo(mobile); } } } }
public static void DoEmote(PlayerMobile player, CustomizationType emote) { if (player == null) { return; } if (player.Squelched || player.StealthSquelchedExpiration > DateTime.UtcNow) { player.SendMessage("You cannot speak at the moment."); return; } if (!player.Alive && player.AccessLevel == AccessLevel.Player) { player.SendMessage("You must be alive in order to use an Emote."); return; } bool active = PlayerEnhancementPersistance.IsCustomizationEntryActive(player, emote); if (!active && player.AccessLevel == AccessLevel.Player) { player.SendMessage("You have not unlocked and activated this Emote."); return; } if (DateTime.UtcNow < player.NextEmoteAllowed && player.AccessLevel == AccessLevel.Player) { string timeRemaining = Utility.CreateTimeRemainingString(DateTime.UtcNow, player.NextEmoteAllowed, false, true, true, true, true); player.SendMessage("You may not use another emote for " + timeRemaining + "."); return; } bool shortCooldown = PlayerEnhancementPersistance.IsCustomizationEntryActive(player, CustomizationType.EmoteFrequency); TimeSpan cooldown = PlayerMobile.EmoteCooldownLong; if (shortCooldown) { cooldown = PlayerMobile.EmoteCooldownShort; } player.NextEmoteAllowed = DateTime.UtcNow + cooldown; string text = ""; int sound = 0; switch (emote) { case CustomizationType.EmoteYes: text = "*nods*"; if (player.Female) { sound = Utility.RandomList(0x337); } else { sound = Utility.RandomList(0x449); } break; case CustomizationType.EmoteNo: text = "*shakes head*"; if (player.Female) { sound = Utility.RandomList(0x322); } else { sound = Utility.RandomList(0x432); } break; case CustomizationType.EmoteHiccup: text = "*hiccup*"; if (player.Female) { sound = Utility.RandomList(0x31E); } else { sound = Utility.RandomList(0x42E); } break; case CustomizationType.EmoteConfused: text = "*huh*"; if (player.Female) { sound = Utility.RandomList(0x31F); } else { sound = Utility.RandomList(0x42F); } break; case CustomizationType.EmoteGroan: text = "*groans*"; if (player.Female) { sound = Utility.RandomList(0x31B); } else { sound = Utility.RandomList(0x42B); } break; case CustomizationType.EmoteBurp: text = "*burp*"; if (player.Female) { sound = Utility.RandomList(0x30E); } else { sound = Utility.RandomList(0x41D); } break; case CustomizationType.EmoteGreet: text = "*waves*"; if (player.Female) { sound = Utility.RandomList(0x31D); } else { sound = Utility.RandomList(0x42D); } break; case CustomizationType.EmoteLaugh: text = "*laughs*"; if (player.Female) { sound = Utility.RandomList(0x31A, 0x321); } else { sound = Utility.RandomList(0x42A, 0x431); } break; case CustomizationType.EmoteClap: text = "*claps*"; if (player.Female) { sound = Utility.RandomList(0x30C); } else { sound = Utility.RandomList(0x41B); } break; case CustomizationType.EmoteCough: text = "*coughs*"; if (player.Female) { sound = Utility.RandomList(0x311, 0x312); } else { sound = Utility.RandomList(0x420, 0x421); } break; case CustomizationType.EmoteCry: text = "*cries*"; if (player.Female) { sound = Utility.RandomList(0x313); } else { sound = Utility.RandomList(0x422); } break; case CustomizationType.EmoteFart: text = "*farts*"; if (player.Female) { sound = Utility.RandomList(0x318); } else { sound = Utility.RandomList(0x428); } break; case CustomizationType.EmoteSurprised: text = "*looks surprised*"; if (player.Female) { sound = Utility.RandomList(0x319, 0x323, 0x32B); } else { sound = Utility.RandomList(0x429, 0x433, 0x43D); } break; case CustomizationType.EmoteAnger: text = "*looks angry*"; if (player.Female) { sound = Utility.RandomList(0x31C); } else { sound = Utility.RandomList(0x42C); } break; case CustomizationType.EmoteKiss: text = "*kisses*"; if (player.Female) { sound = Utility.RandomList(0x320); } else { sound = Utility.RandomList(0x430); } break; case CustomizationType.EmoteHurt: text = "*looks hurt*"; if (player.Female) { sound = Utility.RandomList(0x14B, 0x14C, 0x14D, 0x14E, 0x14F, 0x57E, 0x57B); } else { sound = Utility.RandomList(0x154, 0x155, 0x156, 0x159, 0x589, 0x5F6, 0x436, 0x437, 0x43B, 0x43C); } break; case CustomizationType.EmoteOops: text = "*oops*"; if (player.Female) { sound = Utility.RandomList(0x32C); } else { sound = Utility.RandomList(0x43E); } break; case CustomizationType.EmotePuke: text = "*pukes*"; if (player.Female) { sound = Utility.RandomList(0x32D); } else { sound = Utility.RandomList(0x43F); } break; case CustomizationType.EmoteYell: text = "*yells*"; if (player.Female) { sound = Utility.RandomList(0x32E, 0x338); } else { sound = Utility.RandomList(0x440, 0x44A); } break; case CustomizationType.EmoteShush: text = "*shh*"; if (player.Female) { sound = Utility.RandomList(0x32F); } else { sound = Utility.RandomList(0x441); } break; case CustomizationType.EmoteSick: text = "*looks sick*"; if (player.Female) { sound = Utility.RandomList(0x30D, 0x331, 0x332); } else { sound = Utility.RandomList(0x41F, 0x443, 0x444); } break; case CustomizationType.EmoteSleep: text = "*looks tired*"; if (player.Female) { sound = Utility.RandomList(0x333, 0x336); } else { sound = Utility.RandomList(0x445, 0x448); } break; case CustomizationType.EmoteWhistle: text = "*whistles*"; if (player.Female) { sound = Utility.RandomList(0x335); } else { sound = Utility.RandomList(0x447); } break; case CustomizationType.EmoteSpit: text = "*spits*"; if (player.Female) { sound = Utility.RandomList(0x334); } else { sound = Utility.RandomList(0x446); } break; } player.PublicOverheadMessage(MessageType.Emote, 0, false, text); player.PlaySound(sound); }
public void Target(Mobile mobile) { if (!Caster.CanSee(mobile) || mobile.Hidden) { Caster.SendLocalizedMessage(500237); // Target can not be seen. } else if (CheckHSequence(mobile)) { SpellHelper.Turn(Caster, mobile); SpellHelper.CheckReflect((int)this.Circle, Caster, ref mobile); if (mobile.Spell != null) { mobile.Spell.OnCasterHurt(); } mobile.Paralyzed = false; bool success = false; if (CheckMagicResist(mobile) && mobile is PlayerMobile) { mobile.SendLocalizedMessage(501783); // You feel yourself resisting magical energy. } else { ApplyEffect(Caster, mobile); success = true; } //Player Enhancement Customization: Venomous bool venomous = PlayerEnhancementPersistance.IsCustomizationEntryActive(Caster, CustomizationType.Venomous); if (venomous) { if (success) { CustomizationAbilities.Venomous(mobile); } else { mobile.FixedParticles(0x374A, 10, 15, 5021, 0, 0, EffectLayer.Waist); mobile.PlaySound(0x474); } } else { mobile.FixedParticles(0x374A, 10, 15, 5021, 0, 0, EffectLayer.Waist); mobile.PlaySound(0x474); } DungeonArmor.PlayerDungeonArmorProfile casterDungeonArmor = new DungeonArmor.PlayerDungeonArmorProfile(Caster, null); if (casterDungeonArmor.MatchingSet && !casterDungeonArmor.InPlayerCombat && mobile is BaseCreature) { if (Utility.RandomDouble() <= casterDungeonArmor.DungeonArmorDetail.PoisonSpellNoManaCostChance) { Caster.Mana += 9; Caster.SendMessage("You feel a rush of energy from your armor, fueling mana into the spell."); Effects.PlaySound(Caster.Location, Caster.Map, 0x64B); Effects.SendLocationParticles(EffectItem.Create(Caster.Location, Caster.Map, EffectItem.DefaultDuration), 0x376A, 9, 32, casterDungeonArmor.DungeonArmorDetail.EffectHue, 0, 5005, 0); } } } FinishSequence(); }
public override void OnCast() { if (!Caster.CanBeginAction(typeof(IncognitoSpell))) { Caster.SendLocalizedMessage(1005559); // This spell is already in effect. } else if (KinPaint.IsWearingKinPaint(Caster)) { Caster.SendMessage("You cannot can incognito while wearing kin paint"); } else if (DisguiseTimers.IsDisguised(Caster)) { Caster.SendLocalizedMessage(1061631); // You can't do that while disguised. } else if (!Caster.CanBeginAction(typeof(PolymorphSpell)) || Caster.IsBodyMod) { DoFizzle(); } else if (CheckSequence()) { if (Caster.BeginAction(typeof(IncognitoSpell))) { DisguiseTimers.StopTimer(Caster); bool shadowSkin = false; //Player Enhancement Customization: Shadowskin if (PlayerEnhancementPersistance.IsCustomizationEntryActive(Caster, CustomizationType.Shadowskin)) { Caster.HueMod = 18999; shadowSkin = true; } else { Caster.HueMod = Caster.Race.RandomSkinHue(); } Caster.NameMod = Caster.Female ? NameList.RandomName("female") : NameList.RandomName("male"); PlayerMobile pm = Caster as PlayerMobile; if (pm != null && pm.Race != null) { pm.SetHairMods(pm.Race.RandomHair(pm.Female), pm.Race.RandomFacialHair(pm.Female)); pm.HairHue = pm.Race.RandomHairHue(); pm.FacialHairHue = pm.Race.RandomHairHue(); } Caster.FixedParticles(0x373A, 10, 15, 5036, EffectLayer.Head); Caster.PlaySound(0x3BD); BaseArmor.ValidateMobile(Caster); StopTimer(Caster); int val = (int)(Caster.Skills[SkillName.Magery].Value * 1.2); if (val > 144) { val = 144; } else if (val < 15) { val = 15; } if (shadowSkin && val > 30) { val = 30; } TimeSpan length = TimeSpan.FromSeconds(val); Timer t = new InternalTimer(Caster, length); m_Timers[Caster] = t; t.Start(); } else { Caster.SendMessage("You are already under the effect of the Incognito spell."); } } 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.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(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 (BaseBoat.FindBoatAt(loc, map) != null) { Caster.SendLocalizedMessage(501802); // Thy spell doth not appear to work... } else if (CheckSequence() && CheckCast()) { Caster.SendLocalizedMessage(501024); // You open a magical gate to another location //Player Enhancement Customization: Traveler bool traveler = 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 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 = PlayerEnhancementPersistance.GetSpellHueFor(Caster, HueableSpell.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 = 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.InternalItem || item is Server.Spells.Fifth.PoisonFieldSpell.InternalItem || 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) { 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(); }
public override void OnCast() { if (SpellHelper.CheckTown(Caster, Caster) && CheckSequence()) { List <Mobile> targets = new List <Mobile>(); Map map = Caster.Map; //Player Enhancement Customization: Tremor bool tremor = PlayerEnhancementPersistance.IsCustomizationEntryActive(Caster, CustomizationType.Tremors); bool enhancedSpellcast = SpellHelper.IsEnhancedSpell(Caster, null, EnhancedSpellbookType.Wizard, false, true); Boolean chargedSpellcast = SpellHelper.IsChargedSpell(Caster, null, false, Scroll != null); int range = 1 + (int)(Caster.Skills[SkillName.Magery].Value / 15.0); bool useHeightCheck = true; int maxDifferenceZ = 20; if (map != null) { foreach (Mobile m in Caster.GetMobilesInRange(range)) { int differenceZ = Math.Abs(Caster.Location.Z - m.Location.Z); if (useHeightCheck && (differenceZ >= maxDifferenceZ)) { continue; } if (Caster != m && SpellHelper.ValidIndirectTarget(Caster, m) && Caster.CanBeHarmful(m, false) && (!Core.AOS || Caster.InLOS(m))) { targets.Add(m); } } } Caster.PlaySound(0x2f3); int baseDamage = Utility.RandomMinMax(20, 25); for (int i = 0; i < targets.Count; ++i) { Mobile mobile = targets[i]; double damage = (double)Utility.RandomMinMax(5, 10); double damageBonus = 0; CheckMagicResist(mobile); if (mobile is PlayerMobile) { damage = (double)mobile.Hits * .6; } else { Boolean isTamedTarget = SpellHelper.IsTamedTarget(Caster, mobile); if (enhancedSpellcast) { if (isTamedTarget) { damageBonus += SpellHelper.EnhancedSpellTamedCreatureBonus; } else { damageBonus += SpellHelper.EnhancedSpellBonus; } } if (chargedSpellcast) { if (isTamedTarget) { damageBonus += SpellHelper.ChargedSpellTamedCreatureBonus; } else { damageBonus += SpellHelper.ChargedSpellBonus; } } mobile.FixedEffect(0x3779, 10, 20); BaseCreature bc_Target = mobile as BaseCreature; PlayerMobile pm_Target = mobile as PlayerMobile; if (bc_Target != null) { if (bc_Target.BoatOccupied != null) { damage *= BaseBoat.shipBasedAoESpellDamageToCreatureScalar; } } if (pm_Target != null) { if (pm_Target.BoatOccupied != null) { damage *= BaseBoat.shipBasedAoESpellDamageToPlayerScalar; } } damage *= GetDamageScalar(mobile, damageBonus); } Caster.DoHarmful(mobile); SpellHelper.Damage(this, Caster, mobile, damage); } if (tremor) { CustomizationAbilities.Tremor(Caster, range); } } FinishSequence(); }