private SkillIcon(SkillName skill) { this.skill = skill; table.Controls.Add(new LabelEx(skill.ToString(), ConfigEx.GetElement(8, "SkillIconSize"))); Location = new Point(ConfigEx.GetAttribute(Location.X, "locX", "Skills", skill.ToString()), ConfigEx.GetAttribute(Location.Y, "locY", "Skills", skill.ToString())); }
public ArmorOfCrafting(int bonus, int itemID, int skill) : base(itemID) { i_SkillBonus = bonus; i_Skill = skill; Weight = 1; PhysicalBonus = 2 + Utility.Random((int)(1.6 * bonus)); FireBonus = 4 + Utility.Random((int)(1.6 * bonus)); ColdBonus = 3 + Utility.Random((int)(1.6 * bonus)); PoisonBonus = 3 + Utility.Random((int)(1.6 * bonus)); EnergyBonus = 3 + Utility.Random((int)(1.6 * bonus)); switch (i_Skill) { default: case 0: sn_SkillName = SkillName.Blacksmith; break; case 1: sn_SkillName = SkillName.Mining; break; case 2: sn_SkillName = SkillName.Tailoring; break; case 3: sn_SkillName = SkillName.Carpentry; break; case 4: sn_SkillName = SkillName.Lumberjacking; break; } string s_Type = ""; switch (itemID) { case 5062: default: ItemID = 5062; s_Type = "gloves"; break; case 7609: ItemID = 7609; s_Type = "cap"; break; case 5068: ItemID = 5068; s_Type = "tunic"; break; case 5063: ItemID = 5063; s_Type = "gorget"; break; case 5069: ItemID = 5069; s_Type = "arms"; break; case 5067: ItemID = 5067; s_Type = "leggings"; break; } if (i_SkillBonus < 1) { Name = "Apprentices " + s_Type + " of " + sn_SkillName.ToString(); } else if (i_SkillBonus <= 3) { Name = "Novices " + s_Type + " of " + sn_SkillName.ToString(); } else { Name = "Masters " + s_Type + " of " + sn_SkillName.ToString(); } this.Hue = CraftResources.GetHue((CraftResource)Utility.RandomMinMax((int)CraftResource.DullCopper, (int)CraftResource.Platinum)); }
public ArmorOfTailoring(int bonus, int itemID, int skill) : base(itemID) { i_SkillBonus = bonus; i_Skill = skill; Weight = 1; PhysicalBonus = 2 + Utility.Random((int)(1.6 * bonus)); FireBonus = 4 + Utility.Random((int)(1.6 * bonus)); ColdBonus = 3 + Utility.Random((int)(1.6 * bonus)); PoisonBonus = 3 + Utility.Random((int)(1.6 * bonus)); EnergyBonus = 3 + Utility.Random((int)(1.6 * bonus)); { sn_SkillName = SkillName.Tailoring; } string s_Type = ""; switch (itemID) { case 5062: default: ItemID = 5062; s_Type = "gloves"; break; case 7609: ItemID = 7609; s_Type = "cap"; break; case 5068: ItemID = 5068; s_Type = "tunic"; break; case 5063: ItemID = 5063; s_Type = "gorget"; break; case 5069: ItemID = 5069; s_Type = "arms"; break; case 5067: ItemID = 5067; s_Type = "leggings"; break; } if (i_SkillBonus < 1) { Name = "Apprentices " + s_Type + " of " + sn_SkillName.ToString(); } else if (i_SkillBonus <= 3) { Name = "Novices " + s_Type + " of " + sn_SkillName.ToString(); } else { Name = "Masters " + s_Type + " of " + sn_SkillName.ToString(); } this.Hue = CraftResources.GetHue((CraftResource)Utility.RandomMinMax((int)CraftResource.SpinedLeather, (int)CraftResource.EtherealLeather)); }
public BaseSkill GetSkill(SkillName name) { BaseSkill sk; sk = typeof(SkillGenerator).GetMethod(name.ToString(), System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic).Invoke(this, null) as BaseSkill; return(sk); }
private static void OnTarget(Mobile from, object targeted, object state) { object[] args = state as object[]; SkillName toLower = (SkillName)args[0]; SkillName toRaise = (SkillName)args[1]; if (targeted is Mobile) { Mobile targ = (Mobile)targeted; Skill targLower = targ.Skills[toLower]; Skill targRaise = targ.Skills[toRaise]; if (targLower == null || targRaise == null) { return; } double swapBase = targRaise.Base, swapCap = targRaise.Cap; targRaise.Base = targLower.Base; targRaise.Cap = targLower.Cap; targLower.Base = swapBase; targLower.Cap = swapCap; CommandLogging.LogChangeProperty(from, targ, String.Format("{0} was exchanged for", toLower), toRaise.ToString()); from.SendMessage("{0}\'s {1} skill has been exchanged for {2} {3} skill.", targ.RawName, toLower.ToString(), (targ.Female ? "her" : "his"), toRaise.ToString()); } else { from.SendMessage("This only works for mobiles."); } }
public virtual string GetLabelName() { if (Amount > 1) { return("+{0} " + SkillName.ToString() + " Skill Scrolls : " + Amount); } return("a +{0} " + SkillName.ToString() + " Skill Scroll"); }
/// <summary> /// 读取技能数据 /// </summary> /// <param name="name">技能名称</param> /// <returns>技能数据</returns> public static SkillData LoadSkillData(SkillName name) { Debug.Log("Load " + name); if (name.ToString().StartsWith("TestSkill")) { return(Resources.Load <SkillData>("Skill/TestSkill")); } return(Resources.Load <SkillData>(GameDB.Instance.skillDataPath.paths[(int)name])); //return skillCache.LoadData(name); }
public void Casting(SkillName name, float totalTime, bool reverseProgress = false) { this.reverseProgress = reverseProgress; prograssBar.value = reverseProgress?0:1; timeLeftText.text = totalTime.ToString("0.0"); skillName.text = name.ToString(); castTimer = Time.time; castingTime = totalTime; skillIcon.mainTexture = ResourceLoader.Skill.GetIcon(name); }
// Does search... returns ArrayList reference for mobiles that matched public static ArrayList FindSkillMobs(SkillName skill, int elapsed) { if (elapsed == 0) { elapsed = 2; // Default } //ArrayList MobStates = NetState.Instances; List <NetState> MobStates = NetState.Instances; ArrayList MobMatches = new ArrayList(NetState.Instances.Count); LogHelper Logger = new LogHelper("findskill.log", false, true); // Loop through active connections' mobiles and check conditions for (int i = 0; i < MobStates.Count; ++i) { Mobile m = MobStates[i].Mobile; // If m defined & PlayerMobile, get involved (not explicit) if (m != null) { if (m is PlayerMobile) { PlayerMobile pm = (PlayerMobile)m; SkillName LastSkill = pm.LastSkillUsed; DateTime LastTime = pm.LastSkillTime; // Check time & skill, display if match if (LastSkill == skill && DateTime.Now <= (LastTime + TimeSpan.FromSeconds(elapsed * 60))) { MobMatches.Add(pm); } } } } if (MobMatches.Count > 0) { // Loop through matches and log before returning foreach (PlayerMobile pm in MobMatches) { Logger.Log(LogType.Mobile, pm, skill.ToString()); } Logger.Finish(); } return(MobMatches); }
public ConditionFunction FindCondition(SkillName skillName) { var condition = typeof(Condition).GetMethod(skillName.ToString()); if (condition == null) { logService.AddEntry(this, $"{skillName} has no condition defined, defaulting to return cast inside grift / rift.", LogLevel.Debug); condition = typeof(Condition).GetMethod(nameof(Condition.DefaultAlways)); } return((ConditionFunction)Delegate.CreateDelegate(typeof(ConditionFunction), condition)); }
public static bool TryParse(Mobile m, string toParse, ref SkillName skill) { try { skill = (SkillName)Enum.Parse(typeof(SkillName), toParse, true); } catch { m.SendMessage("{0} is an invalid skill name.", skill.ToString()); return(false); } return(true); }
public static bool TryParse( Mobile m, string toParse, ref SkillName skill ) { try { skill = (SkillName)Enum.Parse( typeof( SkillName ), toParse, true ); } catch { m.SendMessage( "{0} is an invalid skill name.", skill.ToString() ); return false; } return true; }
/// <summary> /// 通过技能名创建对应的技能类的实例 /// </summary> /// <param name="name">技能名</param> /// <returns>对应的技能类的实例</returns> public static ISkill CreateSkill(SkillName name) { if (!isInit) { Init(); } if (skillDict.ContainsKey(name)) { Type type = skillDict[name]; return((ISkill)Activator.CreateInstance(type)); } UnityEngine.Debug.Log("No class for skill named :" + name.ToString()); return(null); }
/// <summary> /// 通过技能名创建对应的技能类的实例 /// </summary> /// <param name="name">技能名</param> /// <returns>对应的技能类的实例</returns> public static ISkill CreateSkill(SkillName name) { if (!isInit) { Init(); } int index = (int)name; if (classIndex.SkillClasses[index] != null) { Type type = classIndex.SkillClasses[index]; return((ISkill)Activator.CreateInstance(type)); } UnityEngine.Debug.Log("No class for skill named :" + name.ToString()); return(null); }
public override void GetProperties(ObjectPropertyList list) { base.GetProperties(list); string desc = String.Format("Charges: {0:#,#}", _Charges) + "\n" + String.Format("<BASEFONT COLOR=#00FF00>Use: Increases the {0} bonus of an item by {1:f1}<BASEFONT COLOR=#FFFFFF>", _Skill.ToString(), _Value); list.Add(1070722, desc); // ~1_NOTHING~ }
public ArmorOfCrafting( int bonus, int itemID, int skill ) : base( itemID ) { i_SkillBonus = bonus; i_Skill = skill; Weight = 1; PhysicalBonus = 2 + Utility.Random((int)(1.6*bonus)); FireBonus = 4 + Utility.Random((int)(1.6*bonus)); ColdBonus = 3 + Utility.Random((int)(1.6*bonus)); PoisonBonus = 3 + Utility.Random((int)(1.6*bonus)); EnergyBonus = 3 + Utility.Random((int)(1.6*bonus)); switch (i_Skill) { default: case 0: sn_SkillName = SkillName.Blacksmith; break; case 1: sn_SkillName = SkillName.Mining; break; case 2: sn_SkillName = SkillName.Tailoring; break; case 3: sn_SkillName = SkillName.Carpentry; break; case 4: sn_SkillName = SkillName.Lumberjacking; break; } string s_Type = ""; switch (itemID) { case 5062: default: ItemID = 5062; s_Type = "gloves"; break; case 7609: ItemID = 7609; s_Type = "cap"; break; case 5068: ItemID = 5068; s_Type = "tunic"; break; case 5063: ItemID = 5063; s_Type = "gorget"; break; case 5069: ItemID = 5069; s_Type = "arms"; break; case 5067: ItemID = 5067; s_Type = "leggings"; break; } if (i_SkillBonus < 1) Name = "Apprentices " + s_Type + " of " + sn_SkillName.ToString(); else if (i_SkillBonus <= 3) Name = "Novices " + s_Type + " of " + sn_SkillName.ToString(); else Name = "Masters " + s_Type + " of " + sn_SkillName.ToString(); this.Hue = CraftResources.GetHue( (CraftResource)Utility.RandomMinMax( (int)CraftResource.DullCopper, (int)CraftResource.Sunstone ) ); }
public static Texture2D GetIcon(SkillName name) { return(Resources.Load(iconPath + name.ToString()) as Texture2D); }
public static GameObject GetSkillPrefab(SkillName name) { return(Resources.Load("SkillPrefabs/" + name.ToString()) as GameObject); }
public override void OnSingleClick(Mobile from) { this.LabelTo(from, Name + " [" + m_Skill1.ToString() + "/" + m_Skill2.ToString() + "]"); }
// Does search... returns ArrayList reference for mobiles that matched public static ArrayList FindSkillMobs(SkillName skill, int elapsed) { if (elapsed == 0) elapsed = 2; // Default //ArrayList MobStates = NetState.Instances; List<NetState> MobStates = NetState.Instances; ArrayList MobMatches = new ArrayList(NetState.Instances.Count); LogHelper Logger = new LogHelper("findskill.log", false, true); // Loop through active connections' mobiles and check conditions for (int i = 0; i < MobStates.Count; ++i) { Mobile m = MobStates[i].Mobile; // If m defined & PlayerMobile, get involved (not explicit) if (m != null) { if (m is PlayerMobile) { PlayerMobile pm = (PlayerMobile)m; SkillName LastSkill = pm.LastSkillUsed; DateTime LastTime = pm.LastSkillTime; // Check time & skill, display if match if (LastSkill == skill && DateTime.Now <= (LastTime + TimeSpan.FromSeconds(elapsed * 60))) MobMatches.Add(pm); } } } if (MobMatches.Count > 0) { // Loop through matches and log before returning foreach (PlayerMobile pm in MobMatches) Logger.Log(LogType.Mobile, pm, skill.ToString()); Logger.Finish(); } return MobMatches; }
/// <summary> /// Saves the skill. /// </summary> /// <returns>Skill object</returns> public Skill SaveSkill() { SqlDataReader result; DatabaseConnection dbconn = new DatabaseConnection(); SqlCommand command = new SqlCommand(); SqlConnection connection = new SqlConnection(dbconn.SQLSEVERConnString); try { connection.Open(); command.Connection = connection; command.CommandType = CommandType.StoredProcedure; command.CommandText = "InsertUpdate_Skill"; command.Parameters.Add(dbconn.GenerateParameterObj("@SkillID", SqlDbType.Int, SkillID.ToString(), 0)); command.Parameters.Add(dbconn.GenerateParameterObj("@SkillName", SqlDbType.VarChar, SkillName.ToString(), 100)); command.Parameters.Add(dbconn.GenerateParameterObj("@SkillDescription", SqlDbType.VarChar, SkillDescription.ToString(), 1000)); command.Parameters.Add(dbconn.GenerateParameterObj("@AbilityID", SqlDbType.Int, AbilityID.ToString(), 0)); command.Parameters.Add(dbconn.GenerateParameterObj("@TrainedSkill", SqlDbType.Bit, TrainedSkill.ToString(), 0)); command.Parameters.Add(dbconn.GenerateParameterObj("@SkillTrainingFeatID", SqlDbType.Int, SkillTrainingFeatID.ToString(), 0)); command.Parameters.Add(dbconn.GenerateParameterObj("@AmorProfAffected", SqlDbType.Bit, AmorProfAffected.ToString(), 0)); result = command.ExecuteReader(); result.Read(); SetReaderToObject(ref result); } catch { Exception e = new Exception(); this._insertUpdateOK = false; this._insertUpdateMessage.Append(e.Message + " Inner Exception= " + e.InnerException); throw e; } finally { command.Dispose(); connection.Close(); } return(this); }
protected override void Save() { ConfigEx.SetAttribute(Location.X, "locX", "Skills", skill.ToString()); ConfigEx.SetAttribute(Location.Y, "locY", "Skills", skill.ToString()); }
public override string ToString() { return("ID: " + CharacterSkillID.ToString() + " UserID: " + SkillName.ToString()); }
public override string ToString() { return(m_Skill.ToString()); }
public virtual bool CheckSkills(Mobile m) { if (m.Skills[MoveSkill].Value < RequiredSkill) { string args = string.Format("{0}\t{1}\t ", RequiredSkill.ToString("F1"), MoveSkill.ToString()); m.SendLocalizedMessage(1063013, args); // You need at least ~1_SKILL_REQUIREMENT~ ~2_SKILL_NAME~ skill to use that ability. return(false); } return(true); }