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 = false; //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 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 = false; //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); } } ArenaFight.SpellCompletion(Caster, typeof(PoisonSpell)); FinishSequence(); }
public static void SphinxMystery(Mobile from) { AncientMystery.MysteryTypeDetail mysteryTypeDetail = AncientMystery.GetMysteryDetails(AncientMystery.MysteryType.Sphinx); if (mysteryTypeDetail == null || from == null) { return; } Point3D mysteryPoint = mysteryTypeDetail.m_MysteryLocation; MysteryLocation mysteryLocation = new MysteryLocation(AncientMystery.MysteryType.Sphinx, from); mysteryLocation.MoveToWorld(mysteryPoint, from.Map); List <Point3D> m_MobileLocations = new List <Point3D>(); m_MobileLocations.Add(new Point3D(1854, 957, -1)); m_MobileLocations.Add(new Point3D(1858, 956, -1)); m_MobileLocations.Add(new Point3D(1861, 958, -1)); m_MobileLocations.Add(new Point3D(1864, 961, -1)); m_MobileLocations.Add(new Point3D(1861, 966, -1)); m_MobileLocations.Add(new Point3D(1857, 968, -1)); m_MobileLocations.Add(new Point3D(1854, 966, -1)); m_MobileLocations.Add(new Point3D(1852, 962, -1)); List <MysterySphinx> m_MysterySphinx = new List <MysterySphinx>(); for (int a = 0; a < m_MobileLocations.Count; a++) { MysterySphinx mysterySphinx = new MysterySphinx(); mysterySphinx.MoveToWorld(m_MobileLocations[a], from.Map); mysteryLocation.m_Mobiles.Add(mysterySphinx); m_MysterySphinx.Add(mysterySphinx); CustomizationAbilities.Vanish(mysterySphinx); } for (int a = 0; a < m_MysterySphinx.Count; a++) { MysterySphinx mysterySphinx = m_MysterySphinx[a]; foreach (MysterySphinx duplicate in m_MysterySphinx) { mysterySphinx.m_Duplicates.Add(duplicate); } } MysterySphinx masterSphinx = m_MysterySphinx[Utility.RandomMinMax(0, m_MysterySphinx.Count - 1)]; masterSphinx.m_MasterSphinx = true; }
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 void TransformAndRestore() { if (m_Duplicates.Count == 0) { return; } List <Point3D> m_Locations = new List <Point3D>(); for (int a = 0; a < m_Duplicates.Count; a++) { MysterySphinx mysterySphinx = m_Duplicates[a]; mysterySphinx.Restore(); m_Locations.Add(mysterySphinx.Location); } int locationCount = m_Locations.Count; if (m_Locations.Count > 0) { for (int a = 0; a < m_Duplicates.Count; a++) { int index = Utility.RandomMinMax(0, m_Locations.Count - 1); m_Duplicates[a].Location = m_Locations[index]; m_Locations.RemoveAt(index); } } for (int a = 0; a < m_Duplicates.Count; a++) { CustomizationAbilities.Vanish(m_Duplicates[a]); m_Duplicates[a].m_MasterSphinx = false; m_Duplicates[a].Say("Sorry, try again."); m_Duplicates[a].m_NextSpeechAllowed = DateTime.UtcNow + NextSpeechDelay; } MysterySphinx newMasterSphinx = m_Duplicates[Utility.RandomMinMax(0, m_Duplicates.Count - 1)]; newMasterSphinx.m_MasterSphinx = true; }
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); }
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 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(); }
protected override void OnTick() { if (m_Drunk.Deleted || m_Drunk.Map == Map.Internal) { Stop(); m_Table.Remove(m_Drunk); } else if (m_Drunk.Alive) { if (m_Drunk.BAC > 60) { m_Drunk.BAC = 60; } // chance to get sober if (10 > Utility.Random(100)) { --m_Drunk.BAC; } // lose some stats m_Drunk.Stam -= 1; m_Drunk.Mana -= 1; int minActions = 1; int maxActions = 2; //Player Enhancement Customization: Drunkard bool drunkard = PlayerEnhancementPersistance.IsCustomizationEntryActive(m_Drunk, CustomizationType.Drunkard); if (drunkard) { maxActions += 4; } switch (Utility.RandomMinMax(minActions, maxActions)) { case 1: if (drunkard) { if (m_Drunk.Female) { m_Drunk.PlaySound(0x31E); } else { m_Drunk.PlaySound(0x42E); } } if (!m_Drunk.Mounted) { m_Drunk.Direction = (Direction)Utility.Random(8); } m_Drunk.PublicOverheadMessage(MessageType.Regular, 0, false, "*hic*"); break; case 2: if (drunkard) { if (m_Drunk.Female) { m_Drunk.PlaySound(0x31E); } else { m_Drunk.PlaySound(0x42E); } } m_Drunk.Animate(32, 5, 1, true, false, 0); //Stumble m_Drunk.PublicOverheadMessage(MessageType.Regular, 0, false, "*hic*"); break; case 3: if (m_Drunk.Female) { m_Drunk.PlaySound(0x31E); } else { m_Drunk.PlaySound(0x42E); } m_Drunk.Animate(21, 5, 1, true, false, 0); //Fall Backward m_Drunk.PublicOverheadMessage(MessageType.Regular, 0, false, "*hic*"); break; case 4: if (m_Drunk.Female) { m_Drunk.PlaySound(0x31E); } else { m_Drunk.PlaySound(0x42E); } m_Drunk.Animate(22, 6, 1, true, false, 0); //Fall Forward m_Drunk.PublicOverheadMessage(MessageType.Regular, 0, false, "*hic*"); break; case 5: CustomizationAbilities.DrunkardThrowBottle(m_Drunk); break; case 6: CustomizationAbilities.DrunkardVomit(m_Drunk); break; } if (m_Drunk.BAC <= 0) { Stop(); m_Table.Remove(m_Drunk); m_Drunk.SendLocalizedMessage(500850); // You feel sober. } } }
public virtual bool OnBuyItems(Mobile buyer, List <BuyItemResponse> list) { if (!IsActiveSeller) { return(false); } if (!buyer.CheckAlive()) { return(false); } if (!CheckVendorAccess(buyer)) { Say(501522); // I shall not treat with scum like thee! return(false); } IBuyItemInfo[] buyInfo = this.GetBuyInfo(); IShopSellInfo[] info = GetSellInfo(); int totalCost = 0; List <BuyItemResponse> validBuy = new List <BuyItemResponse>(list.Count); Container cont; bool bought = false; bool fromBank = false; bool fullPurchase = true; int controlSlots = buyer.FollowersMax - buyer.Followers; foreach (BuyItemResponse buy in list) { Serial ser = buy.Serial; int amount = buy.Amount; if (ser.IsItem) { Item item = World.FindItem(ser); if (item == null) { continue; } GenericBuyInfo gbi = LookupDisplayObject(item); if (gbi != null) { ProcessSinglePurchase(buy, gbi, validBuy, ref controlSlots, ref fullPurchase, ref totalCost); } else if (item != this.BuyPack && item.IsChildOf(this.BuyPack)) { if (amount > item.Amount) { amount = item.Amount; } if (amount <= 0) { continue; } foreach (IShopSellInfo ssi in info) { if (ssi.IsSellable(item)) { if (ssi.IsResellable(item)) { totalCost += ssi.GetBuyPriceFor(item) * amount; validBuy.Add(buy); break; } } } } } else if (ser.IsMobile) { Mobile mob = World.FindMobile(ser); if (mob == null) { continue; } GenericBuyInfo gbi = LookupDisplayObject(mob); if (gbi != null) { ProcessSinglePurchase(buy, gbi, validBuy, ref controlSlots, ref fullPurchase, ref totalCost); } } } if (fullPurchase && validBuy.Count == 0) { SayTo(buyer, 500190); // Thou hast bought nothing! } else if (validBuy.Count == 0) { SayTo(buyer, 500187); // Your order cannot be fulfilled, please try again. } if (validBuy.Count == 0) { return(false); } bought = (buyer.AccessLevel >= AccessLevel.GameMaster); cont = buyer.Backpack; if (!bought && cont != null) { if (cont.ConsumeTotal(typeof(Gold), totalCost)) { bought = true; } } if (!bought) { cont = buyer.FindBankNoCreate(); if (cont != null && cont.ConsumeTotal(typeof(Gold), totalCost)) { bought = true; fromBank = true; } else { SayTo(buyer, 500191); //Begging thy pardon, but thy bank account lacks these funds. } } if (!bought) { return(false); } else { buyer.PlaySound(0x32); } cont = buyer.Backpack; if (cont == null) { cont = buyer.BankBox; } Container bankbox = buyer.BankBox; foreach (BuyItemResponse buy in validBuy) { Serial ser = buy.Serial; int amount = buy.Amount; if (amount < 1) { continue; } if (ser.IsItem) { Item item = World.FindItem(ser); if (item == null) { continue; } GenericBuyInfo gbi = LookupDisplayObject(item); if (gbi != null) { ProcessValidPurchase(amount, gbi, buyer, cont, bankbox); } else { if (amount > item.Amount) { amount = item.Amount; } foreach (IShopSellInfo ssi in info) { if (ssi.IsSellable(item)) { if (ssi.IsResellable(item)) { Item buyItem; if (amount >= item.Amount) { buyItem = item; } else { buyItem = Mobile.LiftItemDupe(item, item.Amount - amount); if (buyItem == null) { buyItem = item; } } if (cont == null || !cont.TryDropItem(buyer, buyItem, false)) { if (bankbox.TryDropItem(buyer, buyItem, false)) { buyer.PrivateOverheadMessage(MessageType.Regular, 0x22, true, "Because of overweight your purchase was delivered to your bankbox.", buyer.NetState); } else { buyItem.MoveToWorld(buyer.Location, buyer.Map); } } break; } } } } } else if (ser.IsMobile) { Mobile mob = World.FindMobile(ser); if (mob == null) { continue; } GenericBuyInfo gbi = LookupDisplayObject(mob); if (gbi != null) { ProcessValidPurchase(amount, gbi, buyer, cont, bankbox); } } } if (fullPurchase) { if (buyer.AccessLevel >= AccessLevel.GameMaster) { SayTo(buyer, true, "I would not presume to charge thee anything. Here are the goods you requested."); } else if (fromBank) { SayTo(buyer, true, "The total of thy purchase is {0} gold, which has been withdrawn from your bank account. My thanks for the patronage.", totalCost); } else { SayTo(buyer, true, "The total of thy purchase is {0} gold. My thanks for the patronage.", totalCost); } } else { if (buyer.AccessLevel >= AccessLevel.GameMaster) { SayTo(buyer, true, "I would not presume to charge thee anything. Unfortunately, I could not sell you all the goods you requested."); } else if (fromBank) { SayTo(buyer, true, "The total of thy purchase is {0} gold, which has been withdrawn from your bank account. My thanks for the patronage. Unfortunately, I could not sell you all the goods you requested.", totalCost); } else { SayTo(buyer, true, "The total of thy purchase is {0} gold. My thanks for the patronage. Unfortunately, I could not sell you all the goods you requested.", totalCost); } } //Player Enhancement Customization: Customer Loyalty bool customerLoyalty = false; //PlayerEnhancementPersistance.IsCustomizationEntryActive(buyer, Custom.CustomizationType.CustomerLoyalty); if (customerLoyalty) { CustomizationAbilities.CustomerLoyalty(this); } return(true); }
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 = false; //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.ShipOccupied != null) { damage *= BaseShip.shipBasedAoESpellDamageToCreatureScalar; } } if (pm_Target != null) { if (pm_Target.ShipOccupied != null) { damage *= BaseShip.shipBasedAoESpellDamageToPlayerScalar; } } damage *= GetDamageScalar(mobile, damageBonus); } Caster.DoHarmful(mobile); SpellHelper.Damage(this, Caster, mobile, damage); } if (tremor) { CustomizationAbilities.Tremor(Caster, range); } } ArenaFight.SpellCompletion(Caster, typeof(EarthquakeSpell)); FinishSequence(); }