public IResult PerformCommand(IMobileObject performer, ICommand command) { if (command.Parameters.Count >= 1) { IBaseObject obj = GlobalReference.GlobalValues.FindObjects.FindObjectOnPersonOrInRoom(performer, "Enchantery", 0); IEnchantery enchantery = obj as IEnchantery; if (enchantery != null) { obj = GlobalReference.GlobalValues.FindObjects.FindHeldItemsOnMob(performer, command.Parameters[0].ParameterValue, command.Parameters[0].ParameterNumber); IItem item = obj as IItem; if (item != null) { ulong goldCost = (ulong)(enchantery.CostToEnchantLevel1Item * Math.Pow(GlobalReference.GlobalValues.Settings.Multiplier, item.Level)); if (performer.Money >= goldCost) { IResult result = enchantery.Enchant(item); if (result == null) { //unable to enchant for some reason return(new Result(false, "Nothing seems to happen.")); } else { performer.Money -= goldCost; if (!result.ResultSuccess) { performer.Items.Remove(item); } } return(result); } else { return(new Result(false, string.Format("You need {0} to bind the enchantment.", GlobalReference.GlobalValues.MoneyToCoins.FormatedAsCoins(goldCost)))); } } else { return(new Result(false, string.Format("Unable to find the {0}.", command.Parameters[0].ParameterValue))); } } else { return(new Result(false, "There is nothing to enchant here with.")); } } else { return(new Result(false, "What would you like to enchant?")); } }
public IItem Sign() { IEnchantery sign = CreateItem <IEnchantery>(); sign.KeyWords.Add("sign"); sign.Attributes.Add(Item.ItemAttribute.NoGet); sign.SentenceDescription = "sign"; sign.ShortDescription = "A sign floats weightlessly in the air."; sign.LookDescription = "ƎƠȴɕȶφΩ ЉѣѼѿ ӁқԘհե"; sign.ExamineDescription = "As you continue to examine the sign it shifts into readable words. This fountain is used for enchanting items. To use the fountain use the command \"Enchant [Item].\""; return(sign); }
private IEnchantery Enchantery() { IEnchantery tempEnchantery = CreateItem <IEnchantery>(); //do this just to increment the numbers IEnchantery enchantery = new EnchantingTable(); //create the real object we need enchantery.Zone = tempEnchantery.Zone; enchantery.Id = tempEnchantery.Id; enchantery.Attributes.Add(ItemAttribute.NoGet); enchantery.KeyWords.Add("table"); enchantery.SentenceDescription = "table"; enchantery.ShortDescription = "The table glows with wisps of energy radiating upward."; enchantery.LookDescription = "The table glows faintly as wisps of energy radiate up into the air before dissipating."; enchantery.ExamineDescription = "The table once was a dark oak but with time and enchantments it has begun to glow a slight blue color casting a blue tint on everything in the room."; return(enchantery); }
private IItem Enchantery() { IEnchantery item = CreateItem <IEnchantery>(); item.SuccessRate = -.85M; item.CostToEnchantLevel1Item = (int)(1.1 * item.CostToEnchantLevel1Item); item.KeyWords.Add("table"); item.KeyWords.Add("enchant"); item.KeyWords.Add("enchanting"); item.Attributes.Add(ItemAttribute.NoGet); item.ShortDescription = "An enchanting table."; item.LookDescription = "The table at one time was nothing more than some wood but has gain magical energy from hundreds nay thousands of enchantments."; item.ExamineDescription = "Green filaments of energy spark out from the table about an inch forming arches before falling back and being reabsorbed."; item.SentenceDescription = "enchanting table"; return(item); }