/// <summary> /// Reads values from AION's memory and sets struct values accordingly. /// </summary> public void Update() { if (PtrBase != 0) { PtrChild1 = (int)Memory.ReadUInt(Process.handle, (uint)PtrBase); PtrChild2 = (int)Memory.ReadUInt(Process.handle, (uint)(PtrBase + 0x04)); PtrChild3 = (int)Memory.ReadUInt(Process.handle, (uint)(PtrBase + 0x08)); AbilityID = (int)Memory.ReadUInt(Process.handle, (uint)(PtrBase + 0x0C)); if (AbilityID != 0) { AbilityName = AbilityID.ToString(); } } }
public void AddAbility(AbilityID abID, bool requiresInput, string description) { string[] ab = abID.ToString().Split('_'); string abName = string.Empty; for (int i = 0; i < ab.Length; i++) { abName += ab[i] + " "; } if (abilities == null) { abilities = new Ability[] { new Ability(abID, requiresInput, description) }; // add input playerInputSystem.AddDynamicKeys(() => abilitySystem.CallAbility(abilities[0], thisEntity), "1"); UI_Manager.instance.AddButtonAction(() => abilitySystem.CallAbility(abilities[0], thisEntity), abName + description); return; } if (abilities.Length >= 10) { // ABILITIES FULL! return; } // Extend array of abilities Ability[] origAbilities = abilities; abilities = new Ability[origAbilities.Length + 1]; for (int i = 0; i < origAbilities.Length; i++) { abilities[i] = origAbilities[i]; } abilities[abilities.Length - 1] = new Ability(abID, requiresInput, description); // add input only for new last one added string keyName = (abilities.Length).ToString(); if (abilities.Length >= 10) { keyName = "0"; } playerInputSystem.AddDynamicKeys(() => abilitySystem.CallAbility(abilities[abilities.Length - 1], thisEntity), keyName); UI_Manager.instance.AddButtonAction(() => abilitySystem.CallAbility(abilities[abilities.Length - 1], thisEntity), abName + description); }
private void OnMouseDown() { //Debug.Log("DOWN"); mouseOffset = mouseWorldPosition - (Vector2)transform.position; dragging = true; if (!inUse && placed) { foreach (GameObject child in children) { GameObject gridTileObject = child.GetComponent <Tile>().closestTile; Tile gridTile = gridTileObject.GetComponent <Tile>(); gridTile.occupied = false; } placed = false; packingManager.messenger.SendAbilityMessage("inactive", abilityID.ToString()); OnRemove?.Invoke(this.gameObject); } }
/// <summary> /// Deletes the extra class item. /// </summary> /// <returns></returns> public bool DeleteFeatPrerequisiteAbility() { 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 = "Delete_FeatPrequisiteAbility"; command.Parameters.Add(dbconn.GenerateParameterObj("@FeatID", SqlDbType.Int, FeatID.ToString(), 0)); command.Parameters.Add(dbconn.GenerateParameterObj("@AbilityID", SqlDbType.Int, AbilityID.ToString(), 0)); result = command.ExecuteReader(); } catch { Exception e = new Exception(); this._deleteOK = false; this._deletionMessage.Append(e.Message + " Inner Exception= " + e.InnerException); throw e; } finally { command.Dispose(); connection.Close(); } return(this.DeleteOK); }
/// <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); }
/// <summary> /// Saves the talent prerequiste ability. /// </summary> /// <returns>TalentPrerequisteAbility object</returns> public TalentPrerequisteAbility SaveTalentPrerequisteAbility() { 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_TalentPrerequisteAbility"; command.Parameters.Add(dbconn.GenerateParameterObj("@AbilityID", SqlDbType.Int, AbilityID.ToString(), 0)); command.Parameters.Add(dbconn.GenerateParameterObj("@TalentID", SqlDbType.Int, TalentID.ToString(), 0)); command.Parameters.Add(dbconn.GenerateParameterObj("@AbilityMinimum", SqlDbType.Int, AbilityMinimum.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); }