Skip to content

Commit

Permalink
fixed level party (#25)
Browse files Browse the repository at this point in the history
* data update

* fixed level party
  • Loading branch information
OGVENDETTA authored and shalzuth committed Oct 27, 2017
1 parent 4ccdfc2 commit 77e5396
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 2 deletions.
26 changes: 26 additions & 0 deletions BraveHaxvius/BraveExvius.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1100,6 +1100,32 @@ public void LevelUnit(Unit unit)
var oldMateria = oldUnit?[Variable.Materia].ToString();
SetEquipment(unit.UniqueUnitId, oldEquipment, oldMateria);
}
public void LevelPartyNew(Func<string, int> update)
{
var currentParty = int.Parse(GetUserInfo[GameObject.UserActualInfo].First()[Variable.CurrentParty].ToString());
var party = GetUserInfo[GameObject.UserPartyDeckInfo_5Eb0Rig6][currentParty];
var partyUnits = party[Variable.PartyUnits].ToString().Split(new char[1] { ',' });
var units = partyUnits.Select(u => Units.FirstOrDefault(unit => unit.UniqueUnitId == u.Split(new char[1] { ':' }).Last())).ToList();

var needsLeveling = !units.All(u => u.Level == u.UnitMaxLevel && u.Rarity == Unit.Units.FindAll(u2 => u.BaseUnitId == u2.BaseUnitId).Max(u2 => int.Parse(u2.Rarity)).ToString());
while (needsLeveling)
{
update(String.Join("\r\n", units.Select(u => u.Name + " " + u.Rarity + "*" + " level " + u.Level)));
var missionResults = DoMission(Mission.TheFarplane_2000201, false, null, null, null, false, false, false, false, false, null, 15000);
units.ForEach(unit =>
{
unit.Level = missionResults[GameObject.UserUnitInfo_8gSkPD6b].First(r => r[Variable.UniqueUnitId].ToString() == unit.UniqueUnitId)[Variable.Level].ToString();
if (unit.Level == unit.UnitMaxLevel)
{
}
});
needsLeveling = !units.All(u => u.Level == u.UnitMaxLevel);
Thread.Sleep(3000);
}
}


public void LevelParty(Func<string, int> update)
{
var growtheggs = "21:" + Equipment.GrowthEgg.EquipId + ":10";
Expand Down
2 changes: 1 addition & 1 deletion Client/MainWindow.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Client/MainWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ private void LevelPartyButton_Click(object sender, EventArgs e)
};
levelPartyButton.Enabled = false;
client.Login();
client.LevelParty(update);
client.LevelPartyNew(update);
levelPartyButton.Enabled = true;
});
t.IsBackground = true;
Expand Down

0 comments on commit 77e5396

Please sign in to comment.