protected override void OnTick() { if (m_Drunk.Deleted || m_Drunk.Map == Map.Internal) { Stop(); m_Table.Remove(m_Drunk); } else if (m_Drunk.Alive) { TeiravonMobile tavDrunk = m_Drunk as TeiravonMobile; if (m_Drunk.BAC >= 100) { m_Drunk.BAC = 100; } // chance to get sober if (10 > Utility.Random(100) || tavDrunk.HasFeat(TeiravonMobile.Feats.BerserkerRage)) { m_Drunk.BAC -= 4; if (m_Drunk.BAC >= 100) { m_Drunk.BAC = 100; } if (m_Drunk.Stam < 10 && tavDrunk.HasFeat(TeiravonMobile.Feats.BerserkerRage)) { m_Drunk.BAC = 0; m_Drunk.SendMessage("You're too exausted to be angry."); } } // lose some stats m_Drunk.Stam -= 1 + m_Drunk.BAC / 20; m_Drunk.Mana -= 1 + m_Drunk.BAC / 20; if (Utility.Random(1, 4) == 1 && !tavDrunk.HasFeat(TeiravonMobile.Feats.BerserkerRage)) { if (!m_Drunk.Mounted) { // turn in a random direction m_Drunk.Direction = (Direction)Utility.Random(8); // heave m_Drunk.Animate(32, 5, 1, true, false, 0); } // *hic* m_Drunk.PublicOverheadMessage(Network.MessageType.Regular, 0x3B2, 500849); } if (m_Drunk.BAC <= 0) { Stop(); m_Table.Remove(m_Drunk); m_Drunk.SendLocalizedMessage(500850); // You feel sober. } } }
public virtual double GetRequiredSkill(Mobile from) { BaseWeapon weapon = from.Weapon as BaseWeapon; if (weapon != null && weapon.PrimaryAbility == this) { if (from is TeiravonMobile) { TeiravonMobile m = (TeiravonMobile)from; if (m.HasFeat(TeiravonMobile.Feats.AxeFighter) && (m.FindItemOnLayer(Layer.TwoHanded) is BaseAxe || m.FindItemOnLayer(Layer.OneHanded) is WarAxe)) { return(90.0); } else if (this is InfectiousStrike && m.HasFeat(TeiravonMobile.Feats.ExoticPoisons)) { return(90.0); } else { return(100.0); } } else { return(100.0); } } else if (weapon != null && weapon.SecondaryAbility == this) { if (from is TeiravonMobile) { TeiravonMobile m = (TeiravonMobile)from; if (m.HasFeat(TeiravonMobile.Feats.AxeFighter) && (m.FindItemOnLayer(Layer.TwoHanded) is BaseAxe) || m.FindItemOnLayer(Layer.OneHanded) is WarAxe) { return(90.0); } else if (this is InfectiousStrike && m.HasFeat(TeiravonMobile.Feats.ExoticPoisons)) { return(90.0); } else { return(100.0); } } else { return(100.0); } } return(200.0); }
public bool AddEnemy(TeiravonMobile.RacialEnemies enemy, bool extraracial) { if (extraracial) { if (m_Player.HasFeat(TeiravonMobile.Feats.ExtraRacialEnemy)) { m_Player.SendMessage("You already have the extra racial enemy feat!"); return(false); } } else { if (m_Player.HasFeat(TeiravonMobile.Feats.RacialEnemy)) { m_Player.SendMessage("You already have the racial enemy feat!"); return(false); } } if (enemy == m_Player.RacialEnemy) { m_Player.SendMessage("You already have that race as racial enemy!"); return(false); } else if (enemy == m_Player.ExtraRacialEnemy) { m_Player.SendMessage("You already have that race as extra racial enemy!"); return(false); } if (m_Player.RemainingFeats >= 1) { if (extraracial) { m_Player.ExtraRacialEnemy = enemy; m_Player.AddFeat(TeiravonMobile.Feats.ExtraRacialEnemy); } else { m_Player.RacialEnemy = enemy; m_Player.AddFeat(TeiravonMobile.Feats.RacialEnemy); } m_Player.RemainingFeats -= 1; return(true); } m_Player.SendMessage(Teiravon.Messages.NoFeatSlots); return(false); }
public override void OnClick(bool rightClick) { if (rightClick) { m_From = null; Stop(); } if (m_From is TeiravonMobile) { TeiravonMobile m_Tracker = (TeiravonMobile)m_From; if (m_Tracker.HasFeat(TeiravonMobile.Feats.AdvancedTracking) && m_From != m_Target) { if (m_Tracker.PlayerLevel < 5) { m_Tracker.SendMessage("You figure they have about {0} hitpoints left...", m_Target.Hits); } else if (m_Tracker.PlayerLevel < 10) { m_Tracker.SendMessage("You figure they have about {0} hitpoints and {1} stamina left...", m_Target.Hits, m_Target.Stam); } else if (m_Tracker.PlayerLevel < 15) { m_Tracker.SendMessage("You figure they have about {0} hitpoints, {1} stamina, and {2} mana left...", m_Target.Hits, m_Target.Stam, m_Target.Mana); } else if (m_Tracker.PlayerLevel >= 15) { m_Tracker.SendMessage("They have {0}/{1} hits, {2}/{3} stamina, and {4}/{5} mana left.", m_Target.Hits, m_Target.HitsMax, m_Target.Stam, m_Target.StamMax, m_Target.Mana, m_Target.ManaMax); } } } }
public override void OnDoubleClick(Mobile from) { if (!from.CanBeginAction(typeof(BaseWand))) { return; } if (Parent == from) { TeiravonMobile m_Player = (TeiravonMobile)from; if ((m_Player.IsAssassin() || m_Player.IsThief()) && !m_Player.HasFeat(TeiravonMobile.Feats.UseMagicDevice)) { m_Player.SendMessage("You must have the Use Magical Device to use this wand."); } else if (Charges > 0) { OnWandUse(from); } else { from.SendLocalizedMessage(1019073); // This item is out of charges. } } else { from.SendLocalizedMessage(502641); // You must equip this item to use it. } }
public void Target(Mobile m) { if (!Caster.CanSee(m)) { Caster.SendLocalizedMessage(500237); // Target can not be seen. } else if (m is BaseCreature && ((BaseCreature)m).IsAnimatedDead) { Caster.SendLocalizedMessage(1061654); // You cannot heal that which is not alive. } else if (m.IsDeadBondedPet || m_Slayer.Slays(m)) { Caster.SendLocalizedMessage(1060177); // You cannot heal a creature that is already dead! } else if (m is Golem) { Caster.LocalOverheadMessage(MessageType.Regular, 0x3B2, 500951); // You cannot heal that. } else if (m.Poisoned || Server.Items.MortalStrike.IsWounded(m)) { Caster.LocalOverheadMessage(MessageType.Regular, 0x22, (Caster == m) ? 1005000 : 1010398); } else if (CheckBSequence(m)) { SpellHelper.Turn(Caster, m); // Algorithm: (40% of magery) + (1-10) int toHeal = (int)(Caster.Skills[SkillName.Magery].Value * 0.4); toHeal += Utility.Random(1, 10); toHeal += (int)(Caster.Skills[SkillName.Healing].Value * 0.2); if (Caster is TeiravonMobile && Caster != m) { TeiravonMobile TAV = (TeiravonMobile)Caster; if (TAV.HasFeat(TeiravonMobile.Feats.HealersOath)) { toHeal = (int)(toHeal * 1.5); } if ((m.Hits + toHeal) > m.HitsMax) { toHeal = m.HitsMax - m.Hits; } int exp = toHeal * (1 + (TAV.PlayerLevel / 2)); if (exp > 0 && Misc.Titles.AwardExp(TAV, exp)) { TAV.SendMessage("You have gained {0} exp", exp); } } m.Heal(toHeal); m.FixedParticles(0x376A, 9, 32, 5030, EffectLayer.Waist); m.PlaySound(0x202); } FinishSequence(); }
public virtual int CalculateMana(Mobile from) { int mana = BaseMana; int reduction = (int)(from.Skills[SkillName.ArmsLore].Value / 2); mana -= reduction; /* double skillTotal = GetSkill( from, SkillName.Swords ) + GetSkill( from, SkillName.Macing ) + GetSkill( from, SkillName.Fencing ) + GetSkill( from, SkillName.Archery ) + GetSkill( from, SkillName.Parry ) + GetSkill( from, SkillName.Lumberjacking ) + GetSkill( from, SkillName.Stealth ) + GetSkill( from, SkillName.Poisoning ); + + if ( skillTotal >= 400.0 ) + mana -= 10; + else if ( skillTotal >= 300.0 ) + mana -= 5; + + double scalar = 1.0; + if ( !Server.Spells.Necromancy.MindRotSpell.GetMindRotScalar( from, ref scalar ) ) + scalar = 1.0; + + // Lower Mana Cost = 40% + int lmc = AosAttributes.GetValue( from, AosAttribute.LowerManaCost ); + if ( lmc > 40 ) + lmc = 40; + + scalar -= (double)lmc / 100; + mana = (int)(mana * scalar); */ // Using a special move within 3 seconds of the previous special move costs double mana if (GetContext(from) != null) { mana *= 2; } if (from is TeiravonMobile) { TeiravonMobile m = (TeiravonMobile)from; BaseWeapon w = m.Weapon as BaseWeapon; if (m.HasFeat(TeiravonMobile.Feats.AxeFighter) && (m.FindItemOnLayer(Layer.TwoHanded) is BaseAxe) || m.FindItemOnLayer(Layer.OneHanded) is WarAxe) { mana /= 2; } if (m.IsMonk() && (w is BaseStaff || w is Scimitar || w is Club || w is CrescentBlade || w is DoubleBladedStaff)) { mana /= 2; } } return(mana); }
private static void BuumBuum_OnCommand(CommandEventArgs e) { TeiravonMobile m_Player = (TeiravonMobile)e.Mobile; if (m_Player.HasFeat(TeiravonMobile.Feats.BuumBuum)) { m_Player.SendGump(new BuumBuumGump(m_Player, 0)); } else { m_Player.SendMessage(Teiravon.Colors.FeatMessageColor, Teiravon.Messages.NoAbility); } }
public override void OnDoubleClick(Mobile from) { TeiravonMobile m_Player = (TeiravonMobile)from; if (m_Player.HasFeat(TeiravonMobile.Feats.ArcaneEnchantment)) { base.OnDoubleClick(from); } else { from.SendMessage("You can't use this."); } }
public override void OnDoubleClick(Mobile from) { if (from.InRange(this.GetWorldLocation(), 1)) { TeiravonMobile m_Player = (TeiravonMobile)from; if (m_Player.IsTailor() || (m_Player.IsMerchant() && m_Player.HasFeat(TeiravonMobile.Feats.TailorTraining))) { if (this is FurnitureDyeTub && !m_Player.HasFeat(TeiravonMobile.Feats.CarpenterTraining)) { m_Player.SendMessage("Only Woodworkers can use this."); } else { if (!m_Player.HasFeat(TeiravonMobile.Feats.AdvancedDying) && !m_Player.HasFeat(TeiravonMobile.Feats.TailorTraining) && this is SpecialDyeTub) { from.SendMessage("You must have the Advanced Dying feat to use this."); return; } if (!m_Player.HasFeat(TeiravonMobile.Feats.LeatherDying) && !m_Player.HasFeat(TeiravonMobile.Feats.TailorTraining) && this is LeatherDyeTub) { from.SendMessage("You must have the Leather Dying feat to use this."); return; } from.SendLocalizedMessage(TargetMessage); from.Target = new InternalTarget(this); } } else if (m_Player.IsWoodworker() || (m_Player.IsMerchant() && m_Player.HasFeat(TeiravonMobile.Feats.CarpenterTraining))) { if (!(this is FurnitureDyeTub)) { m_Player.SendMessage("Only Tailors can use this."); } else { from.SendLocalizedMessage(TargetMessage); from.Target = new InternalTarget(this); } } else { if (!(this is FurnitureDyeTub)) { m_Player.SendMessage("Only Tailors can use this."); } else { m_Player.SendMessage("Only Woodworkers can use this."); } } } else { from.SendLocalizedMessage(500446); // That is too far away. } }
public static void HungerDecay(Mobile m) { if (m != null && m.Hunger >= 1) { m.Hunger -= 1; } if (m is TeiravonMobile) { TeiravonMobile tav = m as TeiravonMobile; if (tav.HasFeat(TeiravonMobile.Feats.BodyoftheGrave)) { tav.Hunger = 20; } } }
public override void OnDoubleClick(Mobile from) { if (from is TeiravonMobile) { TeiravonMobile m_player = (TeiravonMobile)from; if ((m_player.IsBlacksmith() && m_player.HasFeat(TeiravonMobile.Feats.ArmorEnameling) || (m_player.HasFeat(TeiravonMobile.Feats.BlacksmithTraining) && m_player.IsMerchant()))) { m_player.Target = new EnamelTarget(this.Color, this); } else { m_player.SendMessage("Only Trained Blacksmiths can use this!"); } } }
private static void SummonUndead_OnCommand(CommandEventArgs e) { TeiravonMobile m_Player = (TeiravonMobile)e.Mobile; if (!m_Player.CanBeginAction(typeof(NecroSummonGump))) { m_Player.SendMessage("You cannot do this yet."); } else if (!m_Player.HasFeat(TeiravonMobile.Feats.SummonUndead)) { m_Player.SendMessage(Teiravon.Colors.FeatMessageColor, Teiravon.Messages.NoAbility); } else { m_Player.SendGump(new NecroSummonGump(m_Player)); } }
public override void OnDoubleClick(Mobile from) { TeiravonMobile m_Player = (TeiravonMobile)from; if (m_Player.HasFeat(TeiravonMobile.Feats.ShieldBash) && m_Player.FindItemOnLayer(Layer.TwoHanded) == this) { if (m_Player.GetActiveFeats(TeiravonMobile.Feats.ShieldBash)) { m_Player.SendMessage(Teiravon.Colors.FeatMessageColor, Teiravon.Messages.TooSoon); } else { // m_Player.Target = new ShieldBashTarget( (int)this.ArmorRating ); m_Player.Target = new ShieldBashTarget((int)this.ArmorBase, this); } } }
public bool ValidateUse(Mobile from) { PlayerMobile pm = from as PlayerMobile; TeiravonMobile m_Player = (TeiravonMobile)from; if (pm == null || (!m_Player.HasFeat(TeiravonMobile.Feats.Disguise))) { // Only Members of the thieves guild are trained to use this item. from.SendMessage("You must have the proper training to use disguise kits."); } else if (!IsChildOf(from.Backpack)) { // That must be in your pack for you to use it. from.SendLocalizedMessage(1042001); } else if (!from.CanBeginAction(typeof(IncognitoSpell))) { // You cannot disguise yourself while incognitoed. from.SendLocalizedMessage(501704); } else if (TransformationSpell.UnderTransformation(from)) { // You cannot disguise yourself while in that form. from.SendLocalizedMessage(1061634); } else if (from.BodyMod == 183 || from.BodyMod == 184) { // You cannot disguise yourself while wearing body paint from.SendLocalizedMessage(1040002); } else if (!from.CanBeginAction(typeof(PolymorphSpell)) || from.IsBodyMod) { // You cannot disguise yourself while polymorphed. from.SendLocalizedMessage(501705); } else { return(true); } return(false); }
public override void OnDoubleClick(Mobile from) { if (from.Player) { TeiravonMobile m_Player = (TeiravonMobile)from; if (!m_Player.IsAlchemist() && !m_Player.HasFeat(TeiravonMobile.Feats.AlchemyScience)) { m_Player.SendMessage("It confuses you."); } else if (Formulas == 0) { m_Player.SendMessage("The tome is empty."); } else { // m_Player.SendGump( new AlchemyTomeGump( m_Player, Formulas ) ); m_Player.SendMessage("Double-click your mortar and pestle instead."); } } }
private static void Shapeshift_OnCommand(CommandEventArgs e) { TeiravonMobile m_Player = (TeiravonMobile)e.Mobile; if (!m_Player.HasFeat(TeiravonMobile.Feats.WildShape)) { m_Player.SendMessage(Teiravon.Colors.FeatMessageColor, Teiravon.Messages.NoAbility); } else if (m_Player.Mounted) { m_Player.SendMessage("You can't do this while mounted."); } else if (m_Player.IsShapeshifter() || m_Player.IsForester()) { m_Player.SendGump(new NewShapeshiftGump(m_Player)); } else { m_Player.SendMessage("Only shapeshifters/foresters can do that. "); } }
private static TimeSpan Mobile_ManaRegenRate(Mobile from) { if (from.Skills == null) { return(Mobile.DefaultManaRate); } if (!from.Meditating) { CheckBonusSkill(from, from.Mana, from.ManaMax, SkillName.Meditation); } double rate; double armorPenalty = GetArmorOffset(from); double hungermod; if (from.Hunger > 12) { hungermod = 1.0; } else { hungermod = (from.Hunger * .08); } if (Core.AOS) { double medPoints = from.Int + (from.Skills[SkillName.Meditation].Value * 2); medPoints *= (from.Skills[SkillName.Meditation].Value < 150.0) ? (from.Skills[SkillName.Meditation].Value < 100.0 ? 0.025 : .0275) : 0.03; CheckBonusSkill(from, from.Mana, from.ManaMax, SkillName.Focus); double focusPoints = (int)(from.Skills[SkillName.Focus].Value * 0.05); if (armorPenalty > 0) { medPoints = 0; // In AOS, wearing any meditation-blocking armor completely removes meditation bonus } double totalPoints = AosAttributes.GetValue(from, AosAttribute.RegenMana) + focusPoints + medPoints + (from.Meditating ? medPoints : 0.0); if (CheckTransform(from, typeof(VampiricEmbraceSpell))) { totalPoints += 3; } else if (CheckTransform(from, typeof(LichFormSpell))) { totalPoints += 13; } if (from is Mobiles.BaseCreature && ((Mobiles.BaseCreature)from).IsParagon) { totalPoints += 40; } if (from is TeiravonMobile) { TeiravonMobile tav = from as TeiravonMobile; if (tav.IsUndead() && tav.Shapeshifted && (tav.IsDarkCleric() || tav.IsNecromancer())) { totalPoints += tav.PlayerLevel; } } if (totalPoints < -1) { totalPoints = -1; } rate = 1.0 / (0.1 * (2 + (int)totalPoints)); } else { double medPoints = (from.Int + from.Skills[SkillName.Meditation].Value) * 0.5; if (medPoints <= 0) { rate = 7.0; } else if (medPoints <= 100) { rate = 7.0 - (239 * medPoints / 2400) + (19 * medPoints * medPoints / 48000); } else if (medPoints < 120) { rate = 1.0; } else { rate = 0.75; } rate += armorPenalty; if (from.Meditating) { rate *= 0.5; } if (rate < 0.5) { rate = 0.5; } else if (rate > 7.0) { rate = 7.0; } } if (from is TeiravonMobile) { if (hungermod > 0) { rate = rate / hungermod; } else { rate = 30; } TeiravonMobile m_Player = (TeiravonMobile)from; if (m_Player.HasFeat(TeiravonMobile.Feats.WholenessOfSelf)) { rate *= .75; } } return(TimeSpan.FromSeconds(rate)); }
private static TimeSpan Mobile_StamRegenRate(Mobile from) { double rate; double hungermod; if (from.Hunger > 12) { hungermod = 1.0; } else { hungermod = (from.Hunger * .08); } if (from.Player) { TeiravonMobile m_Player = (TeiravonMobile)from; if (m_Player.GetActiveFeats(TeiravonMobile.Feats.DarkAura) || m_Player.GetActiveFeats(TeiravonMobile.Feats.HolyAura) || m_Player.GetActiveFeats(TeiravonMobile.Feats.DivineAura)) { return(TimeSpan.FromSeconds(9)); } } if (from.Skills == null) { return(Mobile.DefaultStamRate); } CheckBonusSkill(from, from.Stam, from.StamMax, SkillName.Focus); int points = AosAttributes.GetValue(from, AosAttribute.RegenStam) + (int)(from.Skills[SkillName.Focus].Value * 0.1); if (CheckTransform(from, typeof(VampiricEmbraceSpell))) { points += 15; } if (from is Mobiles.BaseCreature && ((Mobiles.BaseCreature)from).IsParagon) { points += 40; } if (points < -1) { points = -1; } CampfireEntry entry = Campfire.GetEntry(from); if (entry != null && entry.Safe) { points += 40; } if (from is TeiravonMobile) { TeiravonMobile m_Player = (TeiravonMobile)from; if (m_Player.HasFeat(TeiravonMobile.Feats.WholenessOfSelf)) { points = (points + (int)(m_Player.PlayerLevel) + 6); } if (m_Player.HasFeat(TeiravonMobile.Feats.NorthernResilience)) { points += 10; } if (hungermod > 0) { rate = (1.0 / (0.1 * (2 + points))) / hungermod; } else { rate = 30; } if (rate > 30) { rate = 30; } } else { rate = (1.0 / (0.1 * (2 + points))); } return(TimeSpan.FromSeconds(rate)); }
public override void CustomSystem(Mobile thePlayer) { TeiravonMobile m_Player = (TeiravonMobile)thePlayer; int index = -1; /* Begin Ingrediants */ //index = AddCraft( typeof( SackFlour ), 1044495, 1024153, 0.0, 100.0, typeof( Wheat ), 1044489, 1, 1044490 ); index = AddCraft(typeof(Dough), 1044495, 1024157, 20.0, 60.0, typeof(SackFlour), 1044468, 1, 1044253); AddRes(index, typeof(BaseBeverage), 1046458, 1, 1044253); index = AddCraft(typeof(SweetDough), 1044495, 1041340, 60.0, 100.0, typeof(Dough), 1044469, 1, 1044253); AddRes(index, typeof(JarHoney), 1044472, 1, 1044253); index = AddCraft(typeof(CakeMix), 1044495, 1041002, 80.0, 110.0, typeof(SackFlour), 1044468, 1, 1044253); AddRes(index, typeof(SweetDough), 1044475, 1, 1044253); index = AddCraft(typeof(CookieMix), 1044495, 1024159, 70.0, 100.0, typeof(JarHoney), 1044472, 1, 1044253); AddRes(index, typeof(SweetDough), 1044475, 1, 1044253); /* End Ingrediants */ /* Begin Preparations */ index = AddCraft(typeof(UnbakedQuiche), 1044496, 1041339, 70.0, 110.0, typeof(Dough), 1044469, 1, 1044253); AddRes(index, typeof(Eggs), 1044477, 1, 1044253); // TODO: This must also support chicken and lamb legs index = AddCraft(typeof(UnbakedMeatPie), 1044496, 1041338, 50.0, 100.0, typeof(Dough), 1044469, 1, 1044253); AddRes(index, typeof(RawRibs), 1044482, 1, 1044253); index = AddCraft(typeof(UncookedSausagePizza), 1044496, 1041337, 60.0, 100.0, typeof(Dough), 1044469, 1, 1044253); AddRes(index, typeof(Sausage), 1044483, 1, 1044253); index = AddCraft(typeof(UncookedCheesePizza), 1044496, 1041341, 60.0, 100.0, typeof(Dough), 1044469, 1, 1044253); AddRes(index, typeof(CheeseWheel), 1044486, 1, 1044253); index = AddCraft(typeof(UnbakedFruitPie), 1044496, 1041334, 50.0, 100.0, typeof(Dough), 1044469, 1, 1044253); AddRes(index, typeof(Pear), 1044481, 1, 1044253); index = AddCraft(typeof(UnbakedPeachCobbler), 1044496, 1041335, 50.0, 100.0, typeof(Dough), 1044469, 1, 1044253); AddRes(index, typeof(Peach), 1044480, 1, 1044253); index = AddCraft(typeof(UnbakedApplePie), 1044496, 1041336, 50.0, 100.0, typeof(Dough), 1044469, 1, 1044253); AddRes(index, typeof(Apple), 1044479, 1, 1044253); index = AddCraft(typeof(UnbakedPumpkinPie), 1044496, 1041342, 50.0, 100.0, typeof(Dough), 1044469, 1, 1044253); AddRes(index, typeof(Pumpkin), 1044484, 1, 1044253); index = AddCraft(typeof(TribalPaint), 1044496, 1040000, 80.0, 80.0, typeof(SackFlour), 1044468, 1, 1044253); AddRes(index, typeof(TribalBerry), 1046460, 1, 1044253); /* End Preparations */ /* Begin Baking */ index = AddCraft(typeof(BreadLoaf), 1044497, 1024156, 60.0, 100.0, typeof(Dough), 1044469, 1, 1044253); SetNeedOven(index, true); index = AddCraft(typeof(Cookies), 1044497, 1025643, 70.0, 100.0, typeof(CookieMix), 1044474, 1, 1044253); SetNeedOven(index, true); index = AddCraft(typeof(Cake), 1044497, 1022537, 80.0, 110.0, typeof(CakeMix), 1044471, 1, 1044253); SetNeedOven(index, true); index = AddCraft(typeof(Muffins), 1044497, 1022539, 40.0, 90.0, typeof(SweetDough), 1044475, 1, 1044253); SetNeedOven(index, true); index = AddCraft(typeof(Quiche), 1044497, 1041345, 70.0, 110.0, typeof(UnbakedQuiche), 1044518, 1, 1044253); SetNeedOven(index, true); index = AddCraft(typeof(MeatPie), 1044497, 1041347, 50.0, 100.0, typeof(UnbakedMeatPie), 1044519, 1, 1044253); SetNeedOven(index, true); index = AddCraft(typeof(SausagePizza), 1044497, 1044517, 60.0, 100.0, typeof(UncookedSausagePizza), 1044520, 1, 1044253); SetNeedOven(index, true); index = AddCraft(typeof(CheesePizza), 1044497, 1044516, 60.0, 100.0, typeof(UncookedCheesePizza), 1044521, 1, 1044253); SetNeedOven(index, true); index = AddCraft(typeof(FruitPie), 1044497, 1041346, 50.0, 100.0, typeof(UnbakedFruitPie), 1044522, 1, 1044253); SetNeedOven(index, true); index = AddCraft(typeof(PeachCobbler), 1044497, 1041344, 50.0, 100.0, typeof(UnbakedPeachCobbler), 1044523, 1, 1044253); SetNeedOven(index, true); index = AddCraft(typeof(ApplePie), 1044497, 1041343, 50.0, 100.0, typeof(UnbakedApplePie), 1044524, 1, 1044253); SetNeedOven(index, true); index = AddCraft(typeof(PumpkinPie), 1044497, 1041348, 50.0, 100.0, typeof(UnbakedPumpkinPie), 1046461, 1, 1044253); SetNeedOven(index, true); /* End Baking */ /* Begin Barbecue */ index = AddCraft(typeof(CookedBird), 1044498, 1022487, 20.0, 80.0, typeof(RawBird), 1044470, 1, 1044253); SetNeedHeat(index, true); SetUseAllRes(index, true); index = AddCraft(typeof(ChickenLeg), 1044498, 1025640, 0.0, 60.0, typeof(RawChickenLeg), 1044473, 1, 1044253); SetNeedHeat(index, true); SetUseAllRes(index, true); index = AddCraft(typeof(FishSteak), 1044498, 1022427, 0.0, 60.0, typeof(RawFishSteak), 1044476, 1, 1044253); SetNeedHeat(index, true); SetUseAllRes(index, true); index = AddCraft(typeof(FriedEggs), 1044498, 1022486, 15.0, 75.0, typeof(Eggs), 1044477, 1, 1044253); SetNeedHeat(index, true); SetUseAllRes(index, true); index = AddCraft(typeof(LambLeg), 1044498, 1025642, 10.0, 70.0, typeof(RawLambLeg), 1044478, 1, 1044253); SetNeedHeat(index, true); SetUseAllRes(index, true); index = AddCraft(typeof(Ribs), 1044498, 1022546, 0.0, 60.0, typeof(RawRibs), 1044485, 1, 1044253); SetNeedHeat(index, true); SetUseAllRes(index, true); /* End Barbecue */ /* Begin Misc */ index = AddCraft(typeof(Stew), 1015283, "Stew", 20.0, 65.0, typeof(RawRibs), 1044485, 1); AddRes(index, typeof(BaseBeverage), 1046458, 1, 1044253); AddRes(index, typeof(Carrot), "Carrot", 2, 1044253); SetNeedHeat(index, true); index = AddCraft(typeof(GrapeJelly), 1015283, "Grape Jelly", 40.0, 85.0, typeof(Grapes), "Grapes", 1); AddRes(index, typeof(BaseBeverage), 1046458, 1, 1044253); AddRes(index, typeof(JarHoney), 1044472, 1, 1044253); index = AddCraft(typeof(PeachJam), 1015283, "Peach Jam", 40.0, 85.0, typeof(Peach), "Peach", 1); AddRes(index, typeof(BaseBeverage), 1046458, 1, 1044253); AddRes(index, typeof(JarHoney), 1044472, 1, 1044253); index = AddCraft(typeof(Tarte), 1015283, "Tarte", 60.0, 105.0, typeof(Apple), "Apple", 1); AddRes(index, typeof(Pear), 1044481, 1, 1044253); AddRes(index, typeof(SweetDough), 1044475, 1, 1044253); SetNeedOven(index, true); index = AddCraft(typeof(Marshmallow), 1015283, "Marshmallow", 50.0, 95.0, typeof(JarHoney), 1044472, 1, 1044253); AddRes(index, typeof(BaseBeverage), 1046458, 1, 1044253); SetNeedOven(index, true); index = AddCraft(typeof(SweetMutton), 1015283, "Sweet Mutton", 30.0, 75.0, typeof(RawLambLeg), 1044478, 1, 1044253); AddRes(index, typeof(JarHoney), 1044472, 1, 1044253); SetNeedHeat(index, true); /* End Misc */ if ((m_Player.HasFeat(TeiravonMobile.Feats.RacialCrafting) || m_Player.HasFeat(TeiravonMobile.Feats.MasterCraftsman)) && (m_Player.IsCook() || m_Player.IsMerchant())) { if (m_Player.IsHuman()) { index = AddCraft(typeof(HumanWine), "Racials", "Mead", 95.0, 120.0, typeof(JarHoney), "Honey", 3); AddRes(index, typeof(BaseBeverage), 1046458, 1, 1044253); index = AddCraft(typeof(HumanAle), "Racials", "Royal Ale", 95.0, 120.0, typeof(Dough), "Dough", 1); AddRes(index, typeof(BaseBeverage), 1046458, 1, 1044253); index = AddCraft(typeof(HumanBrandy), "Racials", "Peach Brandy", 95.0, 120.0, typeof(Peach), "Peach", 2); AddRes(index, typeof(BaseBeverage), 1046458, 1, 1044253); AddRes(index, typeof(JarHoney), 1044472, 1, 1044253); } else if (m_Player.IsOrc()) { index = AddCraft(typeof(OrcMrog), "Racials", "Mrog", 95.0, 120.0, typeof(RawLambLeg), "Raw Lamb Leg", 1); AddRes(index, typeof(BaseBeverage), 1046458, 1, 1044253); index = AddCraft(typeof(OrcAle), "Racials", "Blood Beer", 95.0, 120.0, typeof(Fish), "Fish", 1); AddRes(index, typeof(BaseBeverage), 1046458, 1, 1044253); } else if (m_Player.IsDrow()) { index = AddCraft(typeof(DrowWine), "Racials", "Black Widow Wine", 95.0, 120.0, typeof(Nightshade), "Nightshade", 1); AddRes(index, typeof(BaseBeverage), 1046458, 1, 1044253); index = AddCraft(typeof(DrowAle), "Racials", "Arachnid Ale", 95.0, 120.0, typeof(SpidersSilk), "Spider Silk", 1); AddRes(index, typeof(BaseBeverage), 1046458, 1, 1044253); } else if (m_Player.IsDwarf()) { index = AddCraft(typeof(DwarvenAle), "Racials", "Troll Liver Ale", 95.0, 120.0, typeof(TrollLiver), "TrollLiver", 1); AddRes(index, typeof(BaseBeverage), 1046458, 1, 1044253); index = AddCraft(typeof(DwarvenBeer), "Racials", "Granitebreaker Beer", 95.0, 120.0, typeof(Granite), "Granite", 1); AddRes(index, typeof(BaseBeverage), 1046458, 1, 1044253); } else if (m_Player.IsElf()) { index = AddCraft(typeof(ElvenFaeWine), "Racials", "Fae Wine", 95.0, 120.0, typeof(Watermelon), "Watermelon", 1); AddRes(index, typeof(BaseBeverage), 1046458, 1, 1044253); AddRes(index, typeof(JarHoney), 1044472, 1, 1044253); index = AddCraft(typeof(ElvenAle), "Racials", "Winterfrost Ale", 95.0, 120.0, typeof(Pumpkin), "Pumpkin", 1); AddRes(index, typeof(BaseBeverage), 1046458, 1, 1044253); } } }
public void Target(IPoint3D p) { if (!Caster.CanSee(p)) { Caster.SendLocalizedMessage(500237); // Target can not be seen. } else if (SpellHelper.CheckTown(p, Caster) && CheckSequence()) { SpellHelper.Turn(Caster, p); if (p is Item) { p = ((Item)p).GetWorldLocation(); } ArrayList targets = new ArrayList(); Map map = Caster.Map; bool playerVsPlayer = false; if (map != null) { IPooledEnumerable eable = map.GetMobilesInRange(new Point3D(p), 2); foreach (Mobile m in eable) { if (Core.AOS && m == Caster) { continue; } if (SpellHelper.ValidIndirectTarget(Caster, m) && Caster.CanBeHarmful(m, false)) { targets.Add(m); if (m.Player) { playerVsPlayer = true; } } } eable.Free(); } if (targets.Count == 0) { FinishSequence(); return; } double damage = 0; if (Caster is TeiravonMobile) { TeiravonMobile tav = Caster as TeiravonMobile; if (tav.IsForester() && tav.HasFeat(TeiravonMobile.Feats.TempestsWrath)) { damage = GetNewAosDamage(48, 1, 5, Caster.Player && playerVsPlayer); Mobile targ = targets[0] as Mobile; Hashtable litup = new Hashtable(); Timer m_Chain = new ChainBounce(Caster, litup, targ, damage, this); Caster.DoHarmful(targ); m_Chain.Start(); FinishSequence(); return; } else { if (Core.AOS) { damage = GetNewAosDamage(48, 1, 5, Caster.Player && playerVsPlayer); } else { damage = Utility.Random(27, 22); } if (targets.Count > 0) { if (Core.AOS && targets.Count > 1) { damage = (damage * 2) / targets.Count; } else if (!Core.AOS) { damage /= targets.Count; } for (int i = 0; i < targets.Count; ++i) { Mobile m = (Mobile)targets[i]; double toDeal = damage; if (!Core.AOS && CheckResisted(m)) { toDeal *= 0.5; m.SendLocalizedMessage(501783); // You feel yourself resisting magical energy. } Caster.DoHarmful(m); SpellHelper.Damage(this, m, toDeal, 0, 0, 0, 0, 100); m.BoltEffect(0); } } } } else { if (Core.AOS) { damage = GetNewAosDamage(48, 1, 5, Caster.Player && playerVsPlayer); } else { damage = Utility.Random(27, 22); } if (targets.Count > 0) { if (Core.AOS && targets.Count > 1) { damage = (damage * 2) / targets.Count; } else if (!Core.AOS) { damage /= targets.Count; } for (int i = 0; i < targets.Count; ++i) { Mobile m = (Mobile)targets[i]; double toDeal = damage; if (!Core.AOS && CheckResisted(m)) { toDeal *= 0.5; m.SendLocalizedMessage(501783); // You feel yourself resisting magical energy. } Caster.DoHarmful(m); SpellHelper.Damage(this, m, toDeal, 0, 0, 0, 0, 100); m.BoltEffect(0); } } } } FinishSequence(); }
public override void OnDoubleClick(Mobile from) { if (IsChildOf(from.Backpack) || Parent == from) { TeiravonMobile m_Player = (TeiravonMobile)from; CraftSystem system = this.CraftSystem; if (!m_Player.IsTinker()) { if (system == DefAlchemy.CraftSystem || system == DefGlassblowing.CraftSystem) { if (!m_Player.IsAlchemist() && !m_Player.HasFeat(TeiravonMobile.Feats.AlchemyScience) && !m_Player.HasFeat(TeiravonMobile.Feats.ExoticPoisons)) { m_Player.SendMessage("You don't have the skills to use this."); return; } if (!m_Player.HasFeat(TeiravonMobile.Feats.ExoticPoisons)) { if (m_Player.Backpack.FindItemByType(typeof(AlchemyTome)) == null) { m_Player.SendMessage("Where's your Alchemy Tome?"); return; } } } else if (system == DefBlacksmithy.CraftSystem) { if (!m_Player.IsBlacksmith() && !m_Player.IsTinker() && !m_Player.IsMerchant()) { m_Player.SendMessage("You don't have the skills to use this."); return; } } else if (system == DefBowFletching.CraftSystem) { if (!m_Player.IsWoodworker() && !m_Player.IsRanger() && !m_Player.IsArcher() && !m_Player.IsMageSlayer() && !m_Player.IsMerchant() && !m_Player.IsStrider()) { m_Player.SendMessage("You don't have the skills to use this."); return; } } else if (system == DefCarpentry.CraftSystem) { if (!m_Player.IsWoodworker() && !m_Player.IsMerchant()) { m_Player.SendMessage("You don't have the skills to use this."); return; } } else if (system == DefInscription.CraftSystem) { if (!m_Player.HasFeat(TeiravonMobile.Feats.Inscription) && !m_Player.IsAlchemist() && !m_Player.IsMerchant()) { m_Player.SendMessage("You're not sure how to do this."); return; } } else if (system == DefTailoring.CraftSystem) { if (!m_Player.IsTailor() && !m_Player.IsMerchant()) { m_Player.SendMessage("You don't have the skills to use this."); return; } } } int num = system.CanCraft(from, this, null); if (num > 0) { from.SendLocalizedMessage(num); } else { CraftContext context = system.GetContext(from); from.SendGump(new CraftGump(from, system, this, null)); } } else { from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it. } }
public void Target(Mobile m) { if (!Caster.CanSee(m)) { Caster.SendLocalizedMessage(500237); // Target can not be seen. } else if (CheckHSequence(m)) { SpellHelper.Turn(Caster, m); SpellHelper.CheckReflect((int)this.Circle, Caster, ref m); double damage; if (Caster is TeiravonMobile) { TeiravonMobile tav = Caster as TeiravonMobile; ArrayList targets = new ArrayList(); if (tav.IsForester() && tav.HasFeat(TeiravonMobile.Feats.TempestsWrath)) { m.BoltEffect(0); damage = GetNewAosDamage(28, 2, 6, Caster.Player && m.Player); int splash = (int)damage / 3; Engines.PartySystem.Party party = Engines.PartySystem.Party.Get(Caster); try { foreach (Mobile x in m.GetMobilesInRange(3)) { if (party != null && party.Contains(x)) { continue; } if (x.AccessLevel > Caster.AccessLevel) { continue; } if (x is BaseCreature) { if (((BaseCreature)x).ControlMaster == Caster) { continue; } if (((BaseCreature)x).ControlMaster != null) { Mobile v = ((BaseCreature)x).ControlMaster; if (party != null && party.Contains(v)) { continue; } } else { Effects.SendMovingEffect(m, x, 0x379F, 16, 5, true, false); AOS.Damage(x, Caster, splash, 0, 0, 0, 0, 100); } } else if (x != Caster && Caster.HarmfulCheck(x) && x != m) { Effects.SendMovingEffect(m, x, 0x379F, 16, 5, true, false); AOS.Damage(x, Caster, splash, 0, 0, 0, 0, 100); } } } catch { } SpellHelper.Damage(this, m, damage, 0, 0, 0, 0, 100); return; } // Effects.SendLocationEffect(m.Location, m.Map, 0x3789, 18); } if (Core.AOS) { damage = GetNewAosDamage(22, 1, 4, Caster.Player && m.Player); } else { damage = Utility.Random(12, 9); if (CheckResisted(m)) { damage *= 0.75; m.SendLocalizedMessage(501783); // You feel yourself resisting magical energy. } damage *= GetDamageScalar(m); } m.BoltEffect(0); SpellHelper.Damage(this, m, damage, 0, 0, 0, 0, 100); } FinishSequence(); }
private Item TryStealItem(Item toSteal, ref bool caught) { try { Item stolen = null; object root = toSteal.RootParent; if (root is TeiravonMobile) { TeiravonMobile m_Player = (TeiravonMobile)m_Thief; if (!m_Player.HasFeat(TeiravonMobile.Feats.NimbleFingers)) { m_Thief.SendMessage("You must have the Nimble Fingers Feat to steal from players."); return(null); } } if (!IsEmptyHanded(m_Thief)) { m_Thief.SendLocalizedMessage(1005584); // Both hands must be free to steal. } /* * else if ( root is Mobile && ((Mobile)root).Player && IsInnocentTo( m_Thief, (Mobile)root ) && !IsInGuild( m_Thief ) ) * { * m_Thief.SendLocalizedMessage( 1005596 ); // You must be in the thieves guild to steal from other players. * } * else if ( SuspendOnMurder && root is Mobile && ((Mobile)root).Player && IsInGuild( m_Thief ) && m_Thief.Kills > 0 ) * { * m_Thief.SendLocalizedMessage( 502706 ); // You are currently suspended from the thieves guild. * } */ else if (root is BaseVendor && ((BaseVendor)root).IsInvulnerable) { m_Thief.SendLocalizedMessage(1005598); // You can't steal from shopkeepers. } else if (root is PlayerVendor) { m_Thief.SendLocalizedMessage(502709); // You can't steal from vendors. } else if (!m_Thief.CanSee(toSteal)) { m_Thief.SendLocalizedMessage(500237); // Target can not be seen. } else if (m_Thief.Backpack == null || !m_Thief.Backpack.CheckHold(m_Thief, toSteal, false, true)) { m_Thief.SendLocalizedMessage(1048147); // Your backpack can't hold anything else. } #region Sigils else if (toSteal is Sigil) { PlayerState pl = PlayerState.Find(m_Thief); Faction faction = (pl == null ? null : pl.Faction); Sigil sig = (Sigil)toSteal; if (!m_Thief.InRange(toSteal.GetWorldLocation(), 1)) { m_Thief.SendLocalizedMessage(502703); // You must be standing next to an item to steal it. } else if (root != null) // not on the ground { m_Thief.SendLocalizedMessage(502710); // You can't steal that! } else if (faction != null) { if (!m_Thief.CanBeginAction(typeof(IncognitoSpell))) { m_Thief.SendLocalizedMessage(1010581); // You cannot steal the sigil when you are incognito } else if (DisguiseGump.IsDisguised(m_Thief)) { m_Thief.SendLocalizedMessage(1010583); // You cannot steal the sigil while disguised } else if (!m_Thief.CanBeginAction(typeof(PolymorphSpell))) { m_Thief.SendLocalizedMessage(1010582); // You cannot steal the sigil while polymorphed } else if (TransformationSpell.UnderTransformation(m_Thief)) { m_Thief.SendLocalizedMessage(1061622); // You cannot steal the sigil while in that form. } else if (pl.IsLeaving) { m_Thief.SendLocalizedMessage(1005589); // You are currently quitting a faction and cannot steal the town sigil } else if (sig.IsBeingCorrupted && sig.LastMonolith.Faction == faction) { m_Thief.SendLocalizedMessage(1005590); // You cannot steal your own sigil } else if (sig.IsPurifying) { m_Thief.SendLocalizedMessage(1005592); // You cannot steal this sigil until it has been purified } else if (m_Thief.CheckTargetSkill(SkillName.Stealing, toSteal, 80.0, 80.0)) { if (Sigil.ExistsOn(m_Thief)) { m_Thief.SendLocalizedMessage(1010258); // The sigil has gone back to its home location because you already have a sigil. } else if (m_Thief.Backpack == null || !m_Thief.Backpack.CheckHold(m_Thief, sig, false, true)) { m_Thief.SendLocalizedMessage(1010259); // The sigil has gone home because your backpack is full } else { if (sig.IsBeingCorrupted) { sig.GraceStart = DateTime.Now; // begin grace period } m_Thief.SendLocalizedMessage(1010586); // YOU STOLE THE SIGIL!!! (woah, call down now) if (sig.LastMonolith != null) { sig.LastMonolith.Sigil = null; } sig.LastStolen = DateTime.Now; return(sig); } } else { m_Thief.SendLocalizedMessage(1005594); // You do not have enough skill to steal the sigil } } else { m_Thief.SendLocalizedMessage(1005588); // You must join a faction to do that } } #endregion else if (toSteal.Parent == null || toSteal.LootType == LootType.Newbied || toSteal.CheckBlessed(root)) { m_Thief.SendLocalizedMessage(502710); // You can't steal that! } else if (Core.AOS && toSteal is Container) { m_Thief.SendLocalizedMessage(502710); // You can't steal that! } else if (!m_Thief.InRange(toSteal.GetWorldLocation(), 1)) { m_Thief.SendLocalizedMessage(502703); // You must be standing next to an item to steal it. } else if (toSteal.Parent is Mobile) { m_Thief.SendLocalizedMessage(1005585); // You cannot steal items which are equiped. } else if (root == m_Thief) { m_Thief.SendLocalizedMessage(502704); // You catch yourself red-handed. } else if (root is Mobile && ((Mobile)root).AccessLevel > AccessLevel.Player) { m_Thief.SendLocalizedMessage(502710); // You can't steal that! } else if (root is Mobile && !m_Thief.CanBeHarmful((Mobile)root)) { } else if (root is Corpse) { m_Thief.SendLocalizedMessage(502710); // You can't steal that! } else { if (!toSteal.Movable) { XmlAttachment flag = XmlAttach.FindAttachment(toSteal, typeof(XmlData), "stealable"); if (flag == null) { m_Thief.SendLocalizedMessage(502710); // You can't steal that! return(null); } } double w = toSteal.Weight + toSteal.TotalWeight; if (w > 10) { m_Thief.SendMessage("That is too heavy to steal."); } else { if (toSteal.Stackable && toSteal.Amount > 1) { int maxAmount = (int)((m_Thief.Skills[SkillName.Stealing].Value / 10.0) / toSteal.Weight); if (maxAmount < 1) { maxAmount = 1; } else if (maxAmount > toSteal.Amount) { maxAmount = toSteal.Amount; } int amount = Utility.RandomMinMax(1, maxAmount); if (amount >= toSteal.Amount) { int pileWeight = (int)Math.Ceiling(toSteal.Weight * toSteal.Amount); pileWeight *= 10; if (m_Thief.CheckTargetSkill(SkillName.Stealing, toSteal, pileWeight - 22.5, pileWeight + 27.5)) { stolen = toSteal; } } else { int pileWeight = (int)Math.Ceiling(toSteal.Weight * amount); pileWeight *= 10; if (m_Thief.CheckTargetSkill(SkillName.Stealing, toSteal, pileWeight - 22.5, pileWeight + 27.5)) { stolen = toSteal.Dupe(amount); toSteal.Amount -= amount; } } } else { int iw = (int)Math.Ceiling(w); iw *= 10; if (m_Thief.CheckTargetSkill(SkillName.Stealing, toSteal, iw - 22.5, iw + 27.5)) { stolen = toSteal; } } if (stolen != null) { m_Thief.SendLocalizedMessage(502724); // You succesfully steal the item. stolen.Movable = true; } else { m_Thief.SendLocalizedMessage(502723); // You fail to steal the item. } caught = (m_Thief.Skills[SkillName.Stealing].Value < Utility.Random(150)); } } return(stolen); } catch { return(null); } }
private static TimeSpan Mobile_HitsRegenRate(Mobile from) { bool wounded; wounded = MortalStrike.IsWounded(from); int points = AosAttributes.GetValue(from, AosAttribute.RegenHits); double rate; double hungermod; if (from.Hunger > 12) { hungermod = 1.0; } else { hungermod = (from.Hunger * .08); } if (from is BaseCreature) { if (((BaseCreature)from).IsAnimatedDead) { points -= 50; } else { points += (int)(5 * Math.Log(from.HitsMax)); } if (((BaseCreature)from).IsParagon) { points += 10; } } if (CheckTransform(from, typeof(HorrificBeastSpell))) { points += 20; } if (from is TeiravonMobile) { TeiravonMobile m_Player = (TeiravonMobile)from; if (m_Player.HasFeat(TeiravonMobile.Feats.AdvancedHealing)) { points += (points + (int)(m_Player.PlayerLevel) + 2); } if (m_Player.HasFeat(TeiravonMobile.Feats.WholenessOfSelf)) { points += (points + (int)(m_Player.PlayerLevel) + 6); } if (m_Player.IsUndead()) { points += 10; if (m_Player.IsFighter() && m_Player.Shapeshifted) { points += (m_Player.PlayerLevel / 5) * 2; } } } CampfireEntry entry = Campfire.GetEntry(from); if (entry != null && entry.Safe) { points += 40; } if (points < 0 || wounded) { points = 0; } if (from is TeiravonMobile) { if (hungermod > 0) { rate = (1.0 / (0.1 * (1 + points))) / hungermod; } else { rate = 90; } } else { rate = (1.0 / (0.1 * (1 + points))); } if (rate < .05) { rate = .05; } return(TimeSpan.FromSeconds(rate)); }
public virtual void Open(Mobile from, bool checkSelfLoot) { if (from.AccessLevel > AccessLevel.Player || from.InRange(this.GetWorldLocation(), 2)) { bool selfLoot = (checkSelfLoot && (from == m_Owner)); if (selfLoot) { ArrayList items = new ArrayList(this.Items); bool gathered = false; bool didntFit = false; Container pack = from.Backpack; bool checkRobe = true; for (int i = 0; !didntFit && i < items.Count; ++i) { Item item = (Item)items[i]; Point3D loc = item.Location; if ((item.Layer == Layer.Hair || item.Layer == Layer.FacialHair) || !item.Movable || !GetRestoreInfo(item, ref loc)) { continue; } if (checkRobe) { DeathRobe robe = from.FindItemOnLayer(Layer.OuterTorso) as DeathRobe; if (robe != null) { robe.Delete(); } } if (m_EquipItems.Contains(item) && from.EquipItem(item)) { gathered = true; } else if (pack != null && pack.CheckHold(from, item, false, true)) { item.Location = loc; pack.AddItem(item); gathered = true; } else { didntFit = true; } } if (gathered && !didntFit) { Delete(); from.PlaySound(0x3E3); from.SendLocalizedMessage(1062471); // You quickly gather all of your belongings. return; } if (gathered && didntFit) { from.SendLocalizedMessage(1062472); // You gather some of your belongings. The rest remain on the corpse. } } if (!CheckLoot(from)) { return; } TeiravonMobile player = from as TeiravonMobile; if (player != null) { QuestSystem qs = player.Quest; if (this.Owner is BaseCreature && player.HasFeat(TeiravonMobile.Feats.Scavenger) && !Scavenged) { Scavenged = true; TAVUtilities.ScavengeLoot(player, this.Owner); } if (qs is UzeraanTurmoilQuest) { GetDaemonBoneObjective obj = qs.FindObjective(typeof(GetDaemonBoneObjective)) as GetDaemonBoneObjective; if (obj != null && obj.CorpseWithBone == this && (!obj.Completed || UzeraanTurmoilQuest.HasLostDaemonBone(player))) { Item bone = new QuestDaemonBone(); if (player.PlaceInBackpack(bone)) { obj.CorpseWithBone = null; player.SendLocalizedMessage(1049341, "", 0x22); // You rummage through the bones and find a Daemon Bone! You quickly place the item in your pack. if (!obj.Completed) { obj.Complete(); } } else { bone.Delete(); player.SendLocalizedMessage(1049342, "", 0x22); // Rummaging through the bones you find a Daemon Bone, but can't pick it up because your pack is too full. Come back when you have more room in your pack. } return; } } else if (qs is TheSummoningQuest) { VanquishDaemonObjective obj = qs.FindObjective(typeof(VanquishDaemonObjective)) as VanquishDaemonObjective; if (obj != null && obj.Completed && obj.CorpseWithSkull == this) { GoldenSkull sk = new GoldenSkull(); if (player.PlaceInBackpack(sk)) { obj.CorpseWithSkull = null; player.SendLocalizedMessage(1050022); // For your valor in combating the devourer, you have been awarded a golden skull. qs.Complete(); } else { sk.Delete(); player.SendLocalizedMessage(1050023); // You find a golden skull, but your backpack is too full to carry it. } } } } base.OnDoubleClick(from); if (from != m_Owner) { from.RevealingAction(); } } else { from.SendLocalizedMessage(500446); // That is too far away. return; } }
public void Disturb(DisturbType type, bool firstCircle, bool resistable) { if (!CheckDisturb(type, firstCircle, resistable)) { return; } if (m_State == SpellState.Casting) { if (!firstCircle && Circle == SpellCircle.First && !Core.AOS) { return; } if (m_Caster is TeiravonMobile && type == DisturbType.Hurt) { TeiravonMobile TAV = m_Caster as TeiravonMobile; bool Concentrated = TAV.Skills.Meditation.Value - 35 > Utility.Random(100); if (TAV.HasFeat(TeiravonMobile.Feats.MeditativeConcentration) && Concentrated) { return; } } m_State = SpellState.None; m_Caster.Spell = null; OnDisturb(type, true); if (m_CastTimer != null) { m_CastTimer.Stop(); } if (m_AnimTimer != null) { m_AnimTimer.Stop(); } if (Core.AOS && m_Caster.Player && type == DisturbType.Hurt) { DoHurtFizzle(); } m_Caster.NextSpellTime = DateTime.Now + GetDisturbRecovery(); } else if (m_State == SpellState.Sequencing) { if (!firstCircle && Circle == SpellCircle.First && !Core.AOS) { return; } m_State = SpellState.None; m_Caster.Spell = null; OnDisturb(type, false); Targeting.Target.Cancel(m_Caster); if (Core.AOS && m_Caster.Player && type == DisturbType.Hurt) { DoHurtFizzle(); } } }
public void Target(Mobile m) { //STARTMOD if (m is BaseCreature) { BaseCreature m_Pet = (BaseCreature)m; if (m_Pet.IsDeadBondedPet) { m_Pet.PlaySound(0x214); m_Pet.FixedEffect(0x376A, 10, 16); m_Pet.ResurrectPet(); Misc.Titles.AwardFame(Caster, 500, true); return; } } //ENDMOD if (!Caster.CanSee(m)) { Caster.SendLocalizedMessage(500237); // Target can not be seen. } else if (m == Caster) { Caster.SendLocalizedMessage(501039); // Thou can not resurrect thyself. } else if (!Caster.Alive) { Caster.SendLocalizedMessage(501040); // The resurrecter must be alive. } else if (m.Alive) { Caster.SendLocalizedMessage(501041); // Target is not dead. } else if (!Caster.InRange(m, 1)) { Caster.SendLocalizedMessage(501042); // Target is not close enough. } else if (!m.Player) { Caster.SendLocalizedMessage(501043); // Target is not a being. } else if (m.Map == null || !m.Map.CanFit(m.Location, 16, false, false)) { Caster.SendLocalizedMessage(501042); // Target can not be resurrected at that location. m.SendLocalizedMessage(502391); // Thou can not be resurrected there! } else if (m.Region != null && m.Region.Name == "Khaldun") { Caster.SendLocalizedMessage(1010395); // The veil of death in this area is too strong and resists thy efforts to restore life. } else if (CheckBSequence(m, true)) { SpellHelper.Turn(Caster, m); m.PlaySound(0x214); m.FixedEffect(0x376A, 10, 16); TAVUtilities.FindCorpse(m); if (Caster is TeiravonMobile) { TeiravonMobile TAV = (TeiravonMobile)Caster; int expTo = m.HitsMax * TAV.PlayerLevel / 2; if (TAV.HasFeat(TeiravonMobile.Feats.HealersOath)) { expTo *= 3; } if (Misc.Titles.AwardExp(TAV, expTo)) { TAV.SendMessage("You have gained {0} experience.", expTo); } Misc.Titles.AwardFame(Caster, (int)(m.Fame * .1), true); } m.Resurrect(); Misc.Titles.AwardFame(m, -(int)(m.Fame * .1), true); } FinishSequence(); }
public override void CustomSystem(Mobile thePlayer) { TeiravonMobile m_Player = (TeiravonMobile)thePlayer; int index = -1; // Other Items index = AddCraft(typeof(Board), 1044294, "Boards", 0.0, 20.0, typeof(Log), "Logs", 1, 1044351); SetUseAllRes(index, true); AddCraft(typeof(BarrelStaves), 1044294, 1027857, 00.0, 25.0, typeof(Log), 1044041, 5, 1044351); AddCraft(typeof(BarrelLid), 1044294, 1027608, 11.0, 36.0, typeof(Log), 1044041, 4, 1044351); AddCraft(typeof(ShortMusicStand), 1044294, 1044313, 78.9, 100.0, typeof(Log), 1044041, 15, 1044351); AddCraft(typeof(TallMusicStand), 1044294, 1044315, 81.5, 100.0, typeof(Log), 1044041, 20, 1044351); AddCraft(typeof(Easle), 1044294, 1044317, 86.8, 100.0, typeof(Log), 1044041, 20, 1044351); if (Core.SE) { /* * index = AddCraft( typeof( RedHangingLantern ), 1044294, 1029412, 65.0, 90.0, typeof( Log ), 1044041, 5, 1044351 ); * AddRes( index, typeof( BlankScroll ), 1044377, 10, 1044378 ); * SetNeedSE( index, true ); * * index = AddCraft( typeof( WhiteHangingLantern ), 1044294, 1029416, 65.0, 90.0, typeof( Log ), 1044041, 5, 1044351 ); * AddRes( index, typeof( BlankScroll ), 1044377, 10, 1044378 ); * SetNeedSE( index, true ); * * index = AddCraft( typeof( ShojiScreen ), 1044294, 1029423, 80.0, 105.0, typeof( Log ), 1044041, 75, 1044351 ); * AddSkill( index, SkillName.Tailoring, 50.0, 55.0 ); * AddRes( index, typeof( Cloth ), 1044286, 60, 1044287 ); * SetNeedSE( index, true ); * * index = AddCraft( typeof( BambooScreen ), 1044294, 1029428, 80.0, 105.0, typeof( Log ), 1044041, 75, 1044351 ); * AddSkill( index, SkillName.Tailoring, 50.0, 55.0 ); * AddRes( index, typeof( Cloth ), 1044286, 60, 1044287 ); * SetNeedSE( index, true ); */ } // Furniture AddCraft(typeof(FootStool), 1044291, 1022910, 11.0, 36.0, typeof(Log), 1044041, 9, 1044351); AddCraft(typeof(Stool), 1044291, 1022602, 11.0, 36.0, typeof(Log), 1044041, 9, 1044351); AddCraft(typeof(BambooChair), 1044291, 1044300, 21.0, 46.0, typeof(Log), 1044041, 13, 1044351); AddCraft(typeof(WoodenChair), 1044291, 1044301, 21.0, 46.0, typeof(Log), 1044041, 13, 1044351); AddCraft(typeof(WoodenChairCushion), 1044291, "cushioned chair", 42.1, 67.1, typeof(Log), "Boards or Logs", 13, 1044351); AddCraft(typeof(FancyWoodenChairCushion), 1044291, "fancy cushioned chair", 42.1, 67.1, typeof(Log), "Boards or Logs", 15, 1044351); AddCraft(typeof(WoodenBench), 1044291, 1022860, 52.6, 77.6, typeof(Log), 1044041, 17, 1044351); AddCraft(typeof(WoodenThrone), 1044291, "wooden throne", 52.6, 77.6, typeof(Log), "Boards or Logs", 17, 1044351); AddCraft(typeof(Throne), 1044291, "royal throne", 73.6, 98.6, typeof(Log), "Boards or Logs", 19, 1044351); AddCraft(typeof(Nightstand), 1044291, 1044306, 42.1, 67.1, typeof(Log), 1044041, 17, 1044351); AddCraft(typeof(Counter), 1044291, "Counter", 62.1, 87.1, typeof(Log), 1044041, 22, 1044351); AddCraft(typeof(WritingTable), 1044291, 1022890, 63.1, 88.1, typeof(Log), 1044041, 17, 1044351); AddCraft(typeof(YewWoodTable), 1044291, "elegant table", 63.1, 88.1, typeof(Log), "Boards or Logs", 23, 1044351); AddCraft(typeof(LargeTable), 1044291, "dining table", 80.2, 100.0, typeof(Log), "Boards or Logs", 27, 1044351); if (Core.SE) { /* * index = AddCraft( typeof( ElegantLowTable ), 1044291, 1030265, 80.0, 105.0, typeof( Log ), 1044041, 35, 1044351 ); * SetNeedSE( index, true ); * * index = AddCraft( typeof( PlainLowTable ), 1044291, 1030266, 80.0, 105.0, typeof( Log ), 1044041, 35, 1044351 ); * SetNeedSE( index, true ); */ } // Containers AddCraft(typeof(WoodenBox), 1044292, 1023709, 21.0, 46.0, typeof(Log), 1044041, 10, 1044351); AddCraft(typeof(SmallCrate), 1044292, 1044309, 10.0, 35.0, typeof(Log), 1044041, 8, 1044351); AddCraft(typeof(MediumCrate), 1044292, 1044310, 31.0, 56.0, typeof(Log), 1044041, 15, 1044351); AddCraft(typeof(LargeCrate), 1044292, 1044311, 47.3, 72.3, typeof(Log), 1044041, 18, 1044351); AddCraft(typeof(WoodenChest), 1044292, 1023650, 73.6, 98.6, typeof(Log), 1044041, 20, 1044351); AddCraft(typeof(EmptyBookcase), 1044292, 1022718, 31.5, 56.5, typeof(Log), 1044041, 25, 1044351); AddCraft(typeof(FancyArmoire), 1044292, 1044312, 84.2, 105.0, typeof(Log), 1044041, 35, 1044351); AddCraft(typeof(Armoire), 1044292, 1022643, 84.2, 105.0, typeof(Log), 1044041, 35, 1044351); index = AddCraft(typeof(GraniteBox), 1044292, "Granite Storage Box", 80.0, 100.0, typeof(Log), 1044041, 10, 1044351); AddRes(index, typeof(Granite), "Granite", 1); index = AddCraft(typeof(Barrel), 1044292, "Barrel", 57.8, 82.8, typeof(BarrelStaves), 1044288, 6, 1044253); AddRes(index, typeof(BarrelHoops), 1044289, 2, 1044253); if (Core.SE) { /* * index = AddCraft( typeof( PlainWoodenChest ), 1044292, 1030251, 90.0, 115.0, typeof( Log ), 1044041, 30, 1044351 ); * SetNeedSE( index, true ); * * index = AddCraft( typeof( OrnateWoodenChest ), 1044292, 1030253, 90.0, 115.0, typeof( Log ), 1044041, 30, 1044351 ); * SetNeedSE( index, true ); * * index = AddCraft( typeof( GildedWoodenChest ), 1044292, 1030255, 90.0, 115.0, typeof( Log ), 1044041, 30, 1044351 ); * SetNeedSE( index, true ); * * index = AddCraft( typeof( WoodenFootLocker ), 1044292, 1030257, 90.0, 115.0, typeof( Log ), 1044041, 30, 1044351 ); * SetNeedSE( index, true ); * * index = AddCraft( typeof( FinishedWoodenChest ),1044292, 1030259, 90.0, 115.0, typeof( Log ), 1044041, 30, 1044351 ); * SetNeedSE( index, true ); * * index = AddCraft( typeof( TallCabinet ), 1044292, 1030261, 90.0, 115.0, typeof( Log ), 1044041, 35, 1044351 ); * SetNeedSE( index, true ); * * index = AddCraft( typeof( ShortCabinet ), 1044292, 1030263, 90.0, 115.0, typeof( Log ), 1044041, 35, 1044351 ); * SetNeedSE( index, true ); * * index = AddCraft( typeof( RedArmoire ), 1044292, 1030328, 90.0, 115.0, typeof( Log ), 1044041, 40, 1044351 ); * SetNeedSE( index, true ); * * index = AddCraft( typeof( ElegantArmoire ), 1044292, 1030330, 90.0, 115.0, typeof( Log ), 1044041, 40, 1044351 ); * SetNeedSE( index, true ); * * index = AddCraft( typeof( MapleArmoire ), 1044292, 1030328, 90.0, 115.0, typeof( Log ), 1044041, 40, 1044351 ); * SetNeedSE( index, true ); * * index = AddCraft( typeof( CherryArmoire ), 1044292, 1030328, 90.0, 115.0, typeof( Log ), 1044041, 40, 1044351 ); * SetNeedSE( index, true ); */ } index = AddCraft(typeof(Keg), 1044292, 1023711, 57.8, 82.8, typeof(BarrelStaves), 1044288, 3, 1044253); AddRes(index, typeof(BarrelHoops), 1044289, 1, 1044253); AddRes(index, typeof(BarrelLid), 1044251, 1, 1044253); // Staves and Shields AddCraft(typeof(ShepherdsCrook), 1015108, "shepherd\'s crook", 78.9, 103.9, typeof(Log), "Logs", 7); AddCraft(typeof(QuarterStaff), 1015108, "quarter staff", 73.6, 98.6, typeof(Log), "Logs", 6); AddCraft(typeof(GnarledStaff), 1015108, "gnarled staff", 78.9, 103.9, typeof(Log), "Logs", 7); AddCraft(typeof(WoodenShield), 1015108, "wooden shield", 52.6, 77.6, typeof(Log), "Logs", 9); index = AddCraft(typeof(FishingPole), 1015108, "fising pole", 68.4, 93.4, typeof(Log), "Logs", 5); AddRes(index, typeof(Cloth), 1044286, 5, 1044287); if (Core.SE) { /* * index = AddCraft( typeof( Bokuto ), 1044295, 1030227, 70.0, 95.0, typeof( Log ), 1044041, 6, 1044351 ); * SetNeedSE( index, true ); * * //index = AddCraft( typeof( Fukiya ), 1044295, 1030229, 60.0, 85.0, typeof( Log ), 1044041, 6, 1044351 ); * //SetNeedSE( index, true ); * * index = AddCraft( typeof( Tetsubo ), 1044295, 1030225, 85.0, 110.0, typeof( Log ), 1044041, 8, 1044351 ); * AddSkill( index, SkillName.Tinkering, 40.0, 45.0 ); * AddRes( index, typeof( IronIngot ), 1044036, 5, 1044037 ); * SetNeedSE( index, true ); */ } // Instruments index = AddCraft(typeof(LapHarp), 1044293, 1023762, 63.1, 88.1, typeof(Log), 1044041, 20, 1044351); AddRes(index, typeof(Cloth), 1044286, 10, 1044287); index = AddCraft(typeof(Harp), 1044293, 1023761, 78.9, 103.9, typeof(Log), 1044041, 35, 1044351); AddRes(index, typeof(Cloth), 1044286, 15, 1044287); index = AddCraft(typeof(Drums), 1044293, 1023740, 57.8, 82.8, typeof(Log), 1044041, 20, 1044351); AddRes(index, typeof(Cloth), 1044286, 10, 1044287); index = AddCraft(typeof(Lute), 1044293, 1023763, 68.4, 93.4, typeof(Log), 1044041, 25, 1044351); AddRes(index, typeof(Cloth), 1044286, 10, 1044287); index = AddCraft(typeof(Tambourine), 1044293, 1023741, 57.8, 82.8, typeof(Log), 1044041, 15, 1044351); AddRes(index, typeof(Cloth), 1044286, 10, 1044287); index = AddCraft(typeof(TambourineTassel), 1044293, 1044320, 57.8, 82.8, typeof(Log), 1044041, 15, 1044351); AddRes(index, typeof(Cloth), 1044286, 15, 1044287); // Misc index = AddCraft(typeof(SmallBedSouthDeed), 1044290, 1044321, 94.7, 113.1, typeof(Log), 1044041, 100, 1044351); AddRes(index, typeof(Cloth), 1044286, 100, 1044287); index = AddCraft(typeof(SmallBedEastDeed), 1044290, 1044322, 94.7, 113.1, typeof(Log), 1044041, 100, 1044351); AddRes(index, typeof(Cloth), 1044286, 100, 1044287); index = AddCraft(typeof(LargeBedSouthDeed), 1044290, 1044323, 94.7, 113.1, typeof(Log), 1044041, 150, 1044351); AddRes(index, typeof(Cloth), 1044286, 150, 1044287); index = AddCraft(typeof(LargeBedEastDeed), 1044290, 1044324, 94.7, 113.1, typeof(Log), 1044041, 150, 1044351); AddRes(index, typeof(Cloth), 1044286, 150, 1044287); index = AddCraft(typeof(PentagramDeed), 1044290, 1044328, 100.0, 125.0, typeof(Log), 1044041, 100, 1044351); AddRes(index, typeof(IronIngot), 1044036, 40, 1044037); index = AddCraft(typeof(AbbatoirDeed), 1044290, 1044329, 100.0, 125.0, typeof(Log), 1044041, 100, 1044351); AddRes(index, typeof(IronIngot), 1044036, 40, 1044037); if (Core.AOS) { AddCraft(typeof(PlayerBBEast), 1044290, 1062420, 85.0, 110.0, typeof(Log), 1044041, 50, 1044351); AddCraft(typeof(PlayerBBSouth), 1044290, 1062421, 85.0, 110.0, typeof(Log), 1044041, 50, 1044351); } // Blacksmithy index = AddCraft(typeof(SmallForgeDeed), 1044296, 1044330, 73.6, 98.6, typeof(Log), 1044041, 5, 1044351); AddRes(index, typeof(IronIngot), 1044036, 75, 1044037); index = AddCraft(typeof(LargeForgeEastDeed), 1044296, 1044331, 78.9, 103.9, typeof(Log), 1044041, 5, 1044351); AddRes(index, typeof(IronIngot), 1044036, 100, 1044037); index = AddCraft(typeof(LargeForgeSouthDeed), 1044296, 1044332, 78.9, 103.9, typeof(Log), 1044041, 5, 1044351); AddRes(index, typeof(IronIngot), 1044036, 100, 1044037); index = AddCraft(typeof(AnvilEastDeed), 1044296, 1044333, 73.6, 98.6, typeof(Log), 1044041, 5, 1044351); AddRes(index, typeof(IronIngot), 1044036, 150, 1044037); index = AddCraft(typeof(AnvilSouthDeed), 1044296, 1044334, 73.6, 98.6, typeof(Log), 1044041, 5, 1044351); AddRes(index, typeof(IronIngot), 1044036, 150, 1044037); // Training index = AddCraft(typeof(TrainingDummyEastDeed), 1044297, 1044335, 68.4, 93.4, typeof(Log), 1044041, 55, 1044351); AddRes(index, typeof(Cloth), 1044286, 60, 1044287); index = AddCraft(typeof(TrainingDummySouthDeed), 1044297, 1044336, 68.4, 93.4, typeof(Log), 1044041, 55, 1044351); AddRes(index, typeof(Cloth), 1044286, 60, 1044287); index = AddCraft(typeof(PickpocketDipEastDeed), 1044297, 1044337, 73.6, 98.6, typeof(Log), 1044041, 65, 1044351); AddRes(index, typeof(Cloth), 1044286, 60, 1044287); index = AddCraft(typeof(PickpocketDipSouthDeed), 1044297, 1044338, 73.6, 98.6, typeof(Log), 1044041, 65, 1044351); AddRes(index, typeof(Cloth), 1044286, 60, 1044287); // Tailoring index = AddCraft(typeof(Dressform), 1044298, 1044339, 63.1, 88.1, typeof(Log), 1044041, 25, 1044351); AddRes(index, typeof(Cloth), 1044286, 10, 1044287); index = AddCraft(typeof(SpinningwheelEastDeed), 1044298, 1044341, 73.6, 98.6, typeof(Log), 1044041, 75, 1044351); AddRes(index, typeof(Cloth), 1044286, 25, 1044287); index = AddCraft(typeof(SpinningwheelSouthDeed), 1044298, 1044342, 73.6, 98.6, typeof(Log), 1044041, 75, 1044351); AddRes(index, typeof(Cloth), 1044286, 25, 1044287); index = AddCraft(typeof(LoomEastDeed), 1044298, 1044343, 84.2, 109.2, typeof(Log), 1044041, 85, 1044351); AddRes(index, typeof(Cloth), 1044286, 25, 1044287); index = AddCraft(typeof(LoomSouthDeed), 1044298, 1044344, 84.2, 109.2, typeof(Log), 1044041, 85, 1044351); AddRes(index, typeof(Cloth), 1044286, 25, 1044287); // Cooking index = AddCraft(typeof(StoneOvenEastDeed), 1044298, 1044345, 68.4, 93.4, typeof(Log), 1044041, 85, 1044351); AddSkill(index, SkillName.Tinkering, 50.0, 55.0); AddRes(index, typeof(IronIngot), 1044036, 125, 1044037); index = AddCraft(typeof(StoneOvenSouthDeed), 1044298, 1044346, 68.4, 93.4, typeof(Log), 1044041, 85, 1044351); AddSkill(index, SkillName.Tinkering, 50.0, 55.0); AddRes(index, typeof(IronIngot), 1044036, 125, 1044037); index = AddCraft(typeof(FlourMillEastDeed), 1044298, 1044347, 94.7, 119.7, typeof(Log), 1044041, 100, 1044351); AddSkill(index, SkillName.Tinkering, 50.0, 55.0); AddRes(index, typeof(IronIngot), 1044036, 50, 1044037); index = AddCraft(typeof(FlourMillSouthDeed), 1044298, 1044348, 94.7, 119.7, typeof(Log), 1044041, 100, 1044351); AddSkill(index, SkillName.Tinkering, 50.0, 55.0); AddRes(index, typeof(IronIngot), 1044036, 50, 1044037); AddCraft(typeof(WaterTroughEastDeed), 1044298, 1044349, 94.7, 119.7, typeof(Log), 1044041, 150, 1044351); AddCraft(typeof(WaterTroughSouthDeed), 1044298, 1044350, 94.7, 119.7, typeof(Log), 1044041, 150, 1044351); //Frostcraft if (m_Player.IsFrostling()) { index = AddCraft(typeof(FrostPick), "Frostcraft", "Frostpick", 0.0, 20.0, typeof(Snow), "Snow", 2); AddRes(index, typeof(Ice), "Frost", 1); AddCraft(typeof(Frostcarver), "Frostcraft", "Frostcarver", 0, 25.0, typeof(Snow), "Snow", 3); } /* * // Housing * index = AddCraft(typeof(StonePlasterHouseDeed), "Housing", "Modest Stone and Plaster House", 95.0, 100.0, typeof(Log), 1044041, 400, 1044351); * AddRes ( index, typeof ( Granite ), "Stone", 100); * AddRes ( index, typeof (Nails ), "Nails", 500); */ if ((m_Player.HasFeat(TeiravonMobile.Feats.RacialCrafting) || m_Player.HasFeat(TeiravonMobile.Feats.MasterCraftsman)) && (m_Player.IsWoodworker() || m_Player.IsMerchant())) { if (m_Player.IsHuman()) { index = AddCraft(typeof(SmallBoatDeed), "Racials", "Small Boat", 95.0, 120.0, typeof(RedwoodLog), "Red Wood Logs", 500); AddRes(index, typeof(IronIngot), "Iron Ingots", 100); AddRes(index, typeof(Cloth), "Cloth", 100); index = AddCraft(typeof(SmallDragonBoatDeed), "Racials", "Small Dragon Boat", 95.0, 120.0, typeof(RedwoodLog), "Red Wood Logs", 500); AddRes(index, typeof(IronIngot), "Iron Ingots", 100); AddRes(index, typeof(Cloth), "Cloth", 100); index = AddCraft(typeof(MediumBoatDeed), "Racials", "Medium Boat", 95.0, 120.0, typeof(RedwoodLog), "Red Wood Logs", 750); AddRes(index, typeof(IronIngot), "Iron Ingots", 150); AddRes(index, typeof(Cloth), "Cloth", 150); index = AddCraft(typeof(MediumDragonBoatDeed), "Racials", "Medium Dragon Boat", 95.0, 120.0, typeof(RedwoodLog), "Red Wood Logs", 750); AddRes(index, typeof(IronIngot), "Iron Ingots", 150); AddRes(index, typeof(Cloth), "Cloth", 150); index = AddCraft(typeof(LargeBoatDeed), "Racials", "Large Boat", 95.0, 120.0, typeof(RedwoodLog), "Red Wood Logs", 1000); AddRes(index, typeof(IronIngot), "Iron Ingots", 200); AddRes(index, typeof(Cloth), "Cloth", 200); index = AddCraft(typeof(LargeDragonBoatDeed), "Racials", "Large Dragon Boat", 95.0, 120.0, typeof(RedwoodLog), "Red Wood Logs", 1000); AddRes(index, typeof(IronIngot), "Iron Ingots", 200); AddRes(index, typeof(Cloth), "Cloth", 200); } else if (m_Player.IsOrc()) { index = AddCraft(typeof(OrcPalisadeSouthDeed), "Racials", "Palisade (south)", 95.0, 120.0, typeof(PineLog), "Pine Logs", 100); index = AddCraft(typeof(OrcPalisadeEastDeed), "Racials", "Palisade (east)", 95.0, 120.0, typeof(PineLog), "Pine Logs", 100); index = AddCraft(typeof(OrcCombatBridgeDeed), "Racials", "Combat Bridge Section", 95.0, 120.0, typeof(PineLog), "Pine Logs", 100); } else if (m_Player.IsDrow()) { index = AddCraft(typeof(DrowBladedStaff), "Racials", "Drow Bladed Staff", 95.0, 120.0, typeof(Log), "Logs", 15); AddRes(index, typeof(VeriteIngot), "Verite Ingots", 10); index = AddCraft(typeof(DrowDoubleBladedStaff), "Racials", "Drow Double Bladed Staff", 95.0, 120.0, typeof(Log), "Logs", 15); AddRes(index, typeof(VeriteIngot), "Verite Ingots", 20); } else if (m_Player.IsDwarf()) { } else if (m_Player.IsElf()) { index = AddCraft(typeof(ElvenPracticeSword), "Racials", "Practice Sword", 95.0, 120.0, typeof(YewLog), "Yew Logs", 10); index = AddCraft(typeof(ElvenShield), "Racials", "Elven Shield", 95.0, 120.0, typeof(Log), "Logs", 25); AddRes(index, typeof(HornedLeather), "Horned Leather", 10); } } // Set the overidable material SetSubRes(typeof(Log), "Oak"); // Add every material you want the player to be able to chose from // This will overide the overidable material AddSubRes(typeof(Log), "Oak", 0.0, "You don't have enough skill/resources for that."); AddSubRes(typeof(PineLog), "Pine", 35.0, "You don't have enough skill/resources for that."); AddSubRes(typeof(RedwoodLog), "Redwood", 55.0, "You don't have enough skill/resources for that."); AddSubRes(typeof(WhitePineLog), "White Pine", 65.0, "You don't have enough skill/resources for that."); AddSubRes(typeof(AshwoodLog), "Ashwood", 75.0, "You don't have enough skill/resources for that."); AddSubRes(typeof(SilverBirchLog), "Silver Birch", 85.0, "You don't have enough skill/resources for that."); AddSubRes(typeof(YewLog), "Yew", 95.0, "You don't have enough skill/resources for that."); AddSubRes(typeof(BlackOakLog), "Black Oak", 100.0, "You don't have enough skill/resources for that."); MarkOption = true; Repair = Core.AOS; CanEnhance = false; CanFinish = true; }
public bool Cast() { bool GoblinHarm = false; bool TalathasHarm = false; if (m_Caster.Player) { TeiravonMobile m_Person = (TeiravonMobile)m_Caster; if (this is HarmSpell && m_Person.Faith == TeiravonMobile.Deity.Jareth) { GoblinHarm = true; } if (this is HarmSpell && m_Person.Faith == TeiravonMobile.Deity.Talathas) { TalathasHarm = true; } //m_Person.SendMessage( "Type: {0}", this /*, m_Caster.Spell.GetType() */ ); if (!m_Person.Magicable && !(m_Scroll is BaseWand) && !m_Person.HasFeat(TeiravonMobile.Feats.UseMagicDevice)) { m_Caster.SendMessage("You cannot cast spells."); return(false); } // else if ( (this is NecromancerSpell) && !m_Person.IsNecromancer() ) // { // m_Caster.SendMessage( "Only necromancers can cast that." ); // return false; // } else if ((this is PaladinSpell) && m_Person.Skills.Chivalry.Base < 25.0) { m_Caster.SendMessage("Only a true paladin can cast that."); return(false); } else if ((this is NecromancerSpell) && !m_Person.HasFeat(TeiravonMobile.Feats.NecroSpellbook)) { m_Caster.SendMessage("You have not learned advanced necromancy."); return(false); } else if (!(this is NecromancerSpell) && !(this is PaladinSpell) && !m_Person.CanCast(m_Info.Name) && !m_Person.HasFeat(TeiravonMobile.Feats.UseMagicDevice)) { m_Caster.SendMessage("You cannot cast this spell!"); return(false); } if (m_Person.Mounted) { int fallchance = 0; if (m_Person.RidingSkill == 0) { fallchance = 20; } else if (m_Person.RidingSkill == 1) { fallchance = 10; } else if (m_Person.RidingSkill == 2) { fallchance = 5; } if (fallchance > Utility.RandomMinMax(1, 100)) { m_Person.OnDoubleClick(m_Person); m_Person.Damage(Utility.RandomMinMax(1, 10), m_Person); m_Person.SendMessage("You fall off your mount while casting"); } } } m_StartCastTime = DateTime.Now; if (Core.AOS && m_Caster.Spell is Spell && ((Spell)m_Caster.Spell).State == SpellState.Sequencing) { ((Spell)m_Caster.Spell).Disturb(DisturbType.NewCast); } if (!m_Caster.CheckAlive()) { return(false); } else if (XmlAttach.FindAttachmentOnMobile(m_Caster, typeof(XmlData), "silenced") != null) { m_Caster.SendMessage("You cannot cast spells right now."); return(false); } else if (m_Caster.Spell != null && m_Caster.Spell.IsCasting) { m_Caster.SendLocalizedMessage(502642); // You are already casting a spell. } else if (BlockedByHorrificBeast && TransformationSpell.UnderTransformation(m_Caster, typeof(HorrificBeastSpell))) { m_Caster.SendLocalizedMessage(1061091); // You cannot cast that spell in this form. } else if (!(m_Scroll is BaseWand) && (m_Caster.Paralyzed || m_Caster.Frozen)) { m_Caster.SendLocalizedMessage(502643); // You can not cast a spell while frozen. } else if (CheckNextSpellTime && DateTime.Now < m_Caster.NextSpellTime) { m_Caster.SendLocalizedMessage(502644); // You must wait for that spell to have an effect. } else if (m_Caster.Mana >= ScaleMana(GetMana())) { if (m_Caster.Spell == null && m_Caster.CheckSpellCast(this) && CheckCast() && m_Caster.Region.OnBeginSpellCast(m_Caster, this)) { m_State = SpellState.Casting; m_Caster.Spell = this; if (RevealOnCast) { m_Caster.RevealingAction(); } //SayMantra(); TimeSpan castDelay = this.GetCastDelay(); if (GoblinHarm) { castDelay = TimeSpan.FromSeconds(.25); } if (TalathasHarm) { castDelay = TimeSpan.FromSeconds(.5); } if (m_Caster.Body.IsHuman) { int count = (int)Math.Ceiling(castDelay.TotalSeconds / AnimateDelay.TotalSeconds); if (count != 0) { m_AnimTimer = new AnimTimer(this, count); m_AnimTimer.Start(); } if (m_Info.LeftHandEffect > 0) { Caster.FixedParticles(0, 10, 5, m_Info.LeftHandEffect, EffectLayer.LeftHand); } if (m_Info.RightHandEffect > 0) { Caster.FixedParticles(0, 10, 5, m_Info.RightHandEffect, EffectLayer.RightHand); } } if (ClearHandsOnCast) { m_Caster.ClearHands(); } m_CastTimer = new CastTimer(this, castDelay); m_CastTimer.Start(); OnBeginCast(); return(true); } else { return(false); } } else { m_Caster.LocalOverheadMessage(MessageType.Regular, 0x22, 502625); // Insufficient mana } return(false); }