private void Power_OnTarget(Mobile fromMobile, object obj, object state) { Player from = state as Player; Item item = obj as Item; if (item == null || item.Deleted) { return; } if (item is IEthicsItem) { EthicsItem ethicItem = EthicsItem.Find(item); if (item.Parent != fromMobile) { fromMobile.LocalOverheadMessage(MessageType.Regular, 0x3B2, false, "You may only imbue items you are wearing."); } else if (ethicItem != null && ethicItem.Ethic != Ethic.Find(fromMobile)) { fromMobile.LocalOverheadMessage(MessageType.Regular, 0x3B2, false, "The magic surrounding this item repels your attempts to imbue."); } else if (item is IFactionItem && ((IFactionItem)item).FactionItemState != null) { fromMobile.LocalOverheadMessage(MessageType.Regular, 0x3B2, false, "The magic surrounding this item is too chaotic to imbue."); } else if (item.LootType != LootType.Regular || item.BlessedFor != null) { fromMobile.LocalOverheadMessage(MessageType.Regular, 0x3B2, false, "The magic surrounding this item is too strong to imbue."); } //else if ( fromMobile.Map == Map.Felucca && !fromMobile.InRange( new Point3D( 2492, 3930, 5 ), 6 ) ) // fromMobile.LocalOverheadMessage( MessageType.Regular, 0x3B2, false, "You require the power of a heroic shrine to imbue this item." ); else if (!fromMobile.Backpack.ConsumeTotal(typeof(Gold), GoldRequired)) { fromMobile.LocalOverheadMessage(MessageType.Regular, 0x3B2, false, String.Format("You must sacrifice {0} gold piece{1} to imbue this item.", GoldRequired, (GoldRequired != 1) ? "s" : String.Empty)); } else if (CheckInvoke(from)) { if (ethicItem != null) { ethicItem.StartExpiration(); } else { EthicsItem.Imbue(item, Ethic.Hero, true, Ethic.Hero.Definition.PrimaryHue); } fromMobile.FixedEffect(0x375A, 10, 20); fromMobile.PlaySound(0x209); fromMobile.SendMessage("The item is now blessed against evil for 24 real world hours."); FinishInvoke(from); } } else { fromMobile.LocalOverheadMessage(MessageType.Regular, 0x3B2, false, "That cannot be imbued!"); } }
public Herospellbook() : base(0x2252) { Name = "Holy Tome"; Layer = Layer.OneHanded; EthicsItem.Imbue(this, Ethic.Hero, Ethic.Hero.Definition.PrimaryHue); }
public Evilspellbook() : base(0x2253) { Name = "Unholy Tome"; Layer = Layer.OneHanded; EthicsItem.Imbue(this, Ethic.Evil, Ethic.Evil.Definition.PrimaryHue); }
private void Power_OnTarget(Mobile fromMobile, object obj, object state) { Player from = state as Player; Item item = obj as Item; if (item == null || item.Deleted) { return; } if (item.Parent != fromMobile) { fromMobile.LocalOverheadMessage(MessageType.Regular, 0x3B2, false, "You may only imbue items you are wearing."); } //else if ( EthicsItem.Find( item ) != null ) // fromMobile.LocalOverheadMessage( MessageType.Regular, 0x3B2, false, "That has already been imbued." ); else if (item is IFactionItem && ((IFactionItem)item).FactionItemState != null) { fromMobile.LocalOverheadMessage(MessageType.Regular, 0x3B2, false, "The magic surrounding this item is too chaotic to imbue."); } //else if ( fromMobile.Map == Map.Felucca && !fromMobile.InRange( new Point3D( 1458, 844, 5 ), 6 ) ) // fromMobile.LocalOverheadMessage( MessageType.Regular, 0x3B2, false, "You require the power of an evil shrine to imbue this item." ); else if (!fromMobile.Backpack.ConsumeTotal(typeof(Gold), TestCenter.Enabled ? 100 : 5000)) { fromMobile.LocalOverheadMessage(MessageType.Regular, 0x3B2, false, String.Format("You must sacrifice {0} gold pieces to imbue this item.", TestCenter.Enabled ? "100" : "5,000")); } else if ((item is BaseQuiver || item is Spellbook || item is BaseClothing || item is BaseArmor || item is BaseWeapon)) { if (CheckInvoke(from)) { EthicsItem ethicItem = EthicsItem.Find(item); if (ethicItem != null) { ethicItem.StartExpiration(); } else { EthicsItem.Imbue(item, Ethic.Evil, true, Ethic.Evil.Definition.PrimaryHue); } fromMobile.FixedEffect(0x375A, 10, 20); fromMobile.PlaySound(0x209); FinishInvoke(from); } } else { fromMobile.LocalOverheadMessage(MessageType.Regular, 0x3B2, false, "You may not imbue that."); } }
private void Power_OnTarget(Mobile fromMobile, object obj, object state) { Player from = state as Player; Item item = obj as Item; if (item == null || item.Deleted) { return; } if (item is BaseArmor || item is BaseWeapon) { EthicsItem ethicItem = EthicsItem.Find(item); if (item.Parent != fromMobile) { fromMobile.LocalOverheadMessage(MessageType.Regular, 0x3B2, false, "You may only imbue items you are wearing."); } else if (ethicItem == null) { fromMobile.LocalOverheadMessage(MessageType.Regular, 0x3B2, false, "This item has not been imbued with an unholy curse."); } else if (ethicItem.Ethic != Ethic.Find(fromMobile)) { fromMobile.LocalOverheadMessage(MessageType.Regular, 0x3B2, false, "The magic surrounding this item repels your attempts to imbue."); } else if (!fromMobile.Backpack.ConsumeTotal(typeof(Emerald), EmeraldsRequired)) { fromMobile.LocalOverheadMessage(MessageType.Regular, 0x3B2, false, String.Format("You must sacrifice {0} emerald{1} to imbue this item.", EmeraldsRequired, (EmeraldsRequired != 1) ? "s" : String.Empty)); } else if (CheckInvoke(from)) { ethicItem.MakeRunic(); fromMobile.FixedEffect(0x375A, 10, 20, 1156, 0); fromMobile.PlaySound(0x209); FinishInvoke(from); } } else { fromMobile.LocalOverheadMessage(MessageType.Regular, 0x3B2, 500352); // This is neither weapon nor armor. } }
private void Power_OnTarget(Mobile fromMobile, object obj, object state) { var from = state as Player; var item = obj as Item; if (item == null || item.Deleted) { return; } if (item is IEthicsItem) { EthicsItem ethicItem = EthicsItem.Find(item); if (item.Parent != fromMobile) { fromMobile.LocalOverheadMessage(MessageType.Regular, 0x3B2, false, "You may only imbue items you are wearing."); } else if (ethicItem != null) { fromMobile.LocalOverheadMessage(MessageType.Regular, 32, false, "This item has already been imbued with an evil essence."); } else if (ethicItem != null && ethicItem.Ethic != Ethic.Find(fromMobile)) { fromMobile.LocalOverheadMessage(MessageType.Regular, 0x3B2, false, "The magic surrounding this item repels your attempts to imbue."); } else if (item is IFactionItem && ((IFactionItem)item).FactionItemState != null) { fromMobile.LocalOverheadMessage(MessageType.Regular, 0x3B2, false, "The magic surrounding this item is too chaotic to imbue."); } else if (item.LootType == LootType.Cursed) { fromMobile.LocalOverheadMessage(MessageType.Regular, 0x3B2, false, "The magic surrounding this item resists your attempts to imbue."); } else if (item.LootType == LootType.Blessed && !(item is Spellbook) || item.BlessedFor != null) { fromMobile.LocalOverheadMessage(MessageType.Regular, 0x3B2, false, "The magic surrounding this item is too strong to imbue."); } else if (!fromMobile.Backpack.ConsumeTotal(typeof(Gold), GoldRequired)) { fromMobile.LocalOverheadMessage(MessageType.Regular, 0x3B2, false, String.Format("You must sacrifice {0} gold piece{1} to imbue this item.", GoldRequired, (GoldRequired != 1) ? "s" : String.Empty)); } else if (CheckInvoke(from)) { /*if ( ethicItem != null ) * ethicItem.StartExpiration(); * else*/ EthicsItem.Imbue(item, Ethic.Evil, Ethic.Evil.Definition.PrimaryHue); fromMobile.FixedEffect(0x375A, 10, 20); fromMobile.PlaySound(0x209); fromMobile.LocalOverheadMessage(MessageType.Regular, 32, false, "You have imbued this item with an evil essence."); FinishInvoke(from); } } else { fromMobile.LocalOverheadMessage(MessageType.Regular, 0x3B2, false, "That cannot be imbued!"); } }
private void Power_OnTarget(Mobile fromMobile, object obj, object state) { var from = state as Player; var item = obj as Item; if (item == null || item.Deleted) { return; } if (item is BaseArmor || item is BaseWeapon) { EthicsItem ethicItem = EthicsItem.Find(item); if (item.Parent != fromMobile) { fromMobile.LocalOverheadMessage(MessageType.Regular, 0x3B2, false, "You may only imbue items you are wearing."); } else if (ethicItem == null) { fromMobile.LocalOverheadMessage(MessageType.Regular, 0x3B2, false, "This item has not been imbued with a holy blessing."); } else if (ethicItem.Ethic != Ethic.Find(fromMobile)) { fromMobile.LocalOverheadMessage(MessageType.Regular, 0x3B2, false, "The magic surrounding this item repels your attempts to imbue."); } else if (item is BaseWeapon && ((BaseWeapon)item).DamageLevel != WeaponDamageLevel.Regular || item is BaseArmor && ((BaseArmor)item).ProtectionLevel != ArmorProtectionLevel.Regular) { fromMobile.LocalOverheadMessage(MessageType.Regular, 0x3B2, false, "You cannot imbue magic items!"); } else if (!fromMobile.Backpack.ConsumeTotal(typeof(Sapphire), SapphiresRequired)) { fromMobile.LocalOverheadMessage(MessageType.Regular, 0x3B2, false, String.Format("You must sacrifice {0} sapphire{1} to imbue this item.", SapphiresRequired, (SapphiresRequired != 1) ? "s" : String.Empty)); } else if (CheckInvoke(from)) { if (!ethicItem.IsRunic) { ethicItem.StartExpiration(); ethicItem.MakeRunic(); fromMobile.FixedEffect(0x375A, 10, 20, 1153, 0); fromMobile.PlaySound(0x209); FinishInvoke(from); fromMobile.LocalOverheadMessage(MessageType.Regular, 90, false, "You have sanctified this item."); } else { fromMobile.LocalOverheadMessage(MessageType.Regular, 90, false, "You have already sanctified this item."); } } } else { fromMobile.LocalOverheadMessage(MessageType.Regular, 0x3B2, 500352); // This is neither weapon nor armor. } }