Skip to content

Commit

Permalink
Client 406.
Browse files Browse the repository at this point in the history
  • Loading branch information
dlebansais committed Jun 23, 2024
1 parent f223558 commit 3357570
Show file tree
Hide file tree
Showing 66 changed files with 743 additions and 58 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ private void ReadTableDictionary(SkillAdvancementHintCollection collection, ref
if (hint.EndsWith("learn a new dance move."))
return null;

if (hint.EndsWith("defeat a fabled dragon of yore."))
return null;

hint = hint.Replace(" during a Full Moon,", string.Empty);

string Pattern;
Expand Down
1 change: 1 addition & 0 deletions Pipeline/Preprocessing/Objects/AI/AI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ public class AI
public AIAbilityDictionary? Abilities { get; set; }
public string? Comment { get; set; }
public string? Description { get; set; }
public int? FlyOffset { get; set; }
public bool? Flying { get; set; }
public decimal? MinDelayBetweenAbilities { get; set; }
public string? MobilityType { get; set; }
Expand Down
6 changes: 6 additions & 0 deletions Pipeline/Preprocessing/Objects/Ability/PvEAbility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ public PvEAbility(RawPvEAbility rawPvEAbility)
ArmorMitigationRatio = rawPvEAbility.ArmorMitigationRatio;
ArmorSpecificDamage = rawPvEAbility.ArmorSpecificDamage;
AttributesThatDeltaAccuracy = rawPvEAbility.AttributesThatDeltaAccuracy;
AttributesThatDeltaAoE = rawPvEAbility.AttributesThatDeltaAoE;
AttributesThatDeltaDamage = rawPvEAbility.AttributesThatDeltaDamage;
AttributesThatDeltaDamageIfTargetIsVulnerable = rawPvEAbility.AttributesThatDeltaDamageIfTargetIsVulnerable;
AttributesThatDeltaRage = rawPvEAbility.AttributesThatDeltaRage;
AttributesThatDeltaRange = rawPvEAbility.AttributesThatDeltaRange;
AttributesThatDeltaTaunt = rawPvEAbility.AttributesThatDeltaTaunt;
Expand Down Expand Up @@ -89,7 +91,9 @@ private static SelfPreEffect ParseSelfPreEffect(string rawSelfPreEffect)
public int? ArmorMitigationRatio { get; set; }
public int? ArmorSpecificDamage { get; set; }
public string[]? AttributesThatDeltaAccuracy { get; set; }
public string[]? AttributesThatDeltaAoE { get; set; }
public string[]? AttributesThatDeltaDamage { get; set; }
public string[]? AttributesThatDeltaDamageIfTargetIsVulnerable { get; set; }
public string[]? AttributesThatDeltaRage { get; set; }
public string[]? AttributesThatDeltaRange { get; set; }
public string[]? AttributesThatDeltaTaunt { get; set; }
Expand Down Expand Up @@ -125,7 +129,9 @@ public RawPvEAbility ToRawPvEAbility()
Result.ArmorMitigationRatio = ArmorMitigationRatio;
Result.ArmorSpecificDamage = ArmorSpecificDamage;
Result.AttributesThatDeltaAccuracy = AttributesThatDeltaAccuracy;
Result.AttributesThatDeltaAoE = AttributesThatDeltaAoE;
Result.AttributesThatDeltaDamage = AttributesThatDeltaDamage;
Result.AttributesThatDeltaDamageIfTargetIsVulnerable = AttributesThatDeltaDamageIfTargetIsVulnerable;
Result.AttributesThatDeltaRage = AttributesThatDeltaRage;
Result.AttributesThatDeltaRange = AttributesThatDeltaRange;
Result.AttributesThatDeltaTaunt = AttributesThatDeltaTaunt;
Expand Down
2 changes: 2 additions & 0 deletions Pipeline/Preprocessing/Objects/Ability/RawPvEAbility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ public class RawPvEAbility
public int? ArmorMitigationRatio { get; set; }
public int? ArmorSpecificDamage { get; set; }
public string[]? AttributesThatDeltaAccuracy { get; set; }
public string[]? AttributesThatDeltaAoE { get; set; }
public string[]? AttributesThatDeltaDamage { get; set; }
public string[]? AttributesThatDeltaDamageIfTargetIsVulnerable { get; set; }
public string[]? AttributesThatDeltaRage { get; set; }
public string[]? AttributesThatDeltaRange { get; set; }
public string[]? AttributesThatDeltaTaunt { get; set; }
Expand Down
3 changes: 2 additions & 1 deletion Pipeline/Preprocessing/Objects/Ability/SpecialValue.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
public class SpecialValue
{
public string[]? AttributesThatDelta { get; set; }
public string[]? AttributesThatDeltaBase { get; set; }
public string[]? AttributesThatMod { get; set; }
//public string[]? AttributesThatModBase { get; set; }
public string? DisplayType { get; set; }
public string? Label { get; set; }
public string? SkipIfThisAttributeIsZero { get; set; }
public bool? SkipIfZero { get; set; }
public string? Suffix { get; set; }
public decimal? Value { get; set; }
Expand Down
48 changes: 45 additions & 3 deletions Pipeline/Preprocessing/Objects/Effect/Effect.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
namespace Preprocessor;
using System.Collections.Generic;

namespace Preprocessor;

public class Effect
{
Expand All @@ -9,14 +11,34 @@ public Effect(RawEffect rawEffect)
DisplayMode = rawEffect.DisplayMode;
Duration = Preprocessor.ToNumberOrString(rawEffect.Duration, out IsDurationNumber);
IconId = rawEffect.IconId;
Keywords = rawEffect.Keywords;
Keywords = ParseKeywords(rawEffect.Keywords);
Name = rawEffect.Name;
Particle = EffectParticle.Parse(rawEffect.Particle);
SpewText = rawEffect.SpewText;
StackingPriority = rawEffect.StackingPriority;
StackingType = ParseStackingType(rawEffect.StackingType);
}

private static string[]? ParseKeywords(string[]? rawKeywords)
{
if (rawKeywords is null)
return null;

List<string> Result = new();
foreach (var Keyword in rawKeywords)
Result.Add(ParseKeyword(Keyword));

return Result.ToArray();
}

private static string ParseKeyword(string rawKeyword)
{
if (rawKeyword == "-")
return "Hyphen";
else
return rawKeyword;
}

private static string? ParseDescription(string? rawDescription, string[]? rawAbilityKeywords, string? rawName, out EffectDescriptionFix effectDescriptionFix)
{
effectDescriptionFix = EffectDescriptionFix.None;
Expand Down Expand Up @@ -88,7 +110,7 @@ public RawEffect ToRawEffect()
Result.DisplayMode = DisplayMode;
Result.Duration = Preprocessor.FromNumberOrString(Duration, IsDurationNumber);
Result.IconId = IconId;
Result.Keywords = Keywords;
Result.Keywords = ToRawKeywords(Keywords);
Result.Name = Name;
Result.Particle = EffectParticle.ToString(Particle);
Result.SpewText = SpewText;
Expand All @@ -98,6 +120,26 @@ public RawEffect ToRawEffect()
return Result;
}

private static string[]? ToRawKeywords(string[]? keywords)
{
if (keywords is null)
return null;

List<string> Result = new();
foreach (var Keyword in keywords)
Result.Add(ToRawKeyword(Keyword));

return Result.ToArray();
}

private static string ToRawKeyword(string keyword)
{
if (keyword == "Hyphen")
return "-";
else
return keyword;
}

private static string? ToRawDescription(string? description, EffectDescriptionFix effectDescriptionFix)
{
string? Result;
Expand Down
15 changes: 12 additions & 3 deletions Pipeline/Preprocessing/Objects/Npc/NpcService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,16 @@ public NpcService(RawNpcService rawNpcService)
private static NpcServiceCapIncrease ParseCapIncrease(string rawCapIncrease)
{
string[] Splitted = rawCapIncrease.Split(':');
if (Splitted.Length != 2)
if (Splitted.Length < 2 || Splitted.Length > 3 )
throw new PreprocessorException();

if (!int.TryParse(Splitted[1], out int Value))
throw new PreprocessorException();

NpcServiceCapIncrease Result = new() { Favor = Splitted[0], Value = Value };
string Favor = Splitted[0];
string? Purchase = Splitted.Length > 2 ? Splitted[2] : null;

NpcServiceCapIncrease Result = new() { Favor = Favor, Value = Value, Purchase = Purchase };

return Result;
}
Expand Down Expand Up @@ -110,7 +113,13 @@ public RawNpcService ToRawNpcService()
List<string> Result = new();

foreach (NpcServiceCapIncrease CapIncrease in npcServiceCapIncreases)
Result.Add($"{CapIncrease.Favor}:{CapIncrease.Value}");
{
string StringValue = $"{CapIncrease.Favor}:{CapIncrease.Value}";
if (CapIncrease.Purchase is not null)
StringValue += $":{CapIncrease.Purchase}";

Result.Add(StringValue);
}

return Result.ToArray();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
public class NpcServiceCapIncrease
{
public string? Favor { get; set; }
public string? Purchase { get; set; }
public int Value { get; set; }
}
3 changes: 3 additions & 0 deletions Pipeline/Preprocessing/Objects/PlayerTitle/PlayerTitle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ public class PlayerTitle
{
public PlayerTitle(RawPlayerTitle rawPlayerTitle)
{
AccountWide = rawPlayerTitle.AccountWide;
Keywords = rawPlayerTitle.Keywords;
(Title, Color, ColorFormat) = ParseTitle(rawPlayerTitle.Title);
Tooltip = rawPlayerTitle.Tooltip;
Expand Down Expand Up @@ -43,6 +44,7 @@ private static (string?, string?, ColorFormat?) ParseTitle(string? rawTitle)
return (rawTitle, null, null);
}

public bool? AccountWide { get; set; }
public string? Color { get; set; }
public string[]? Keywords { get; set; }
public string? Title { get; set; }
Expand All @@ -52,6 +54,7 @@ public RawPlayerTitle ToRawPlayerTitle()
{
RawPlayerTitle Result = new();

Result.AccountWide = AccountWide;
Result.Keywords = Keywords;
Result.Title = ToRawTitle(Title, ColorFormat);
Result.Tooltip = Tooltip;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

public class RawPlayerTitle
{
public bool? AccountWide { get; set; }
public string[]? Keywords { get; set; }
public string? Title { get; set; }
public string? Tooltip { get; set; }
Expand Down
3 changes: 3 additions & 0 deletions Pipeline/Preprocessing/Objects/Quest/Quest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ public Quest(RawQuest rawQuest)
DisplayedLocation = Area.FromRawAreaName(rawQuest.DisplayedLocation, out OriginalDisplayedLocation);
FavorNpc = rawQuest.FavorNpc;
FollowUpQuests = rawQuest.FollowUpQuests;
ForceBookOnWrapUp = rawQuest.ForceBookOnWrapUp;
GroupingName = rawQuest.GroupingName;
InternalName = rawQuest.InternalName;
IsAutoPreface = rawQuest.IsAutoPreface;
Expand Down Expand Up @@ -349,6 +350,7 @@ private static QuestReward ParseRewardEffectRaiseSkillToLevel(string levelReward
public string? DisplayedLocation { get; set; }
public string? FavorNpc { get; set; }
public string[]? FollowUpQuests { get; set; }
public bool? ForceBookOnWrapUp { get; set; }
public string? GroupingName { get; set; }
public string? InternalName { get; set; }
public bool? IsAutoPreface { get; set; }
Expand Down Expand Up @@ -388,6 +390,7 @@ public RawQuest ToRawQuest()
Result.DisplayedLocation = Area.ToRawAreaName(DisplayedLocation, OriginalDisplayedLocation);
Result.FavorNpc = FavorNpc;
Result.FollowUpQuests = FollowUpQuests;
Result.ForceBookOnWrapUp = ForceBookOnWrapUp;
Result.GroupingName = GroupingName;
Result.InternalName = InternalName;
Result.IsAutoPreface = IsAutoPreface;
Expand Down
1 change: 1 addition & 0 deletions Pipeline/Preprocessing/Objects/Quest/RawQuest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ public class RawQuest
public string? DisplayedLocation { get; set; }
public string? FavorNpc { get; set; }
public string[]? FollowUpQuests { get; set; }
public bool? ForceBookOnWrapUp { get; set; }
public string? GroupingName { get; set; }
public string? InternalName { get; set; }
public bool? IsAutoPreface { get; set; }
Expand Down
28 changes: 28 additions & 0 deletions Pipeline/Preprocessing/Objects/Recipe/Recipe.cs
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ private static RecipeResultEffect ParseResultEffect(string effect)
{
case "ExtractTSysPower":
return ParseExtractTSysPower(EffectName, EffectParameter);
case "CraftWaxItem":
return ParseCraftWaxItem(EffectName, EffectParameter);
case "RepairItemDurability":
return ParseRepairItemDurability(EffectName, EffectParameter);
case "TSysCraftedEquipment":
Expand Down Expand Up @@ -139,6 +141,8 @@ private static RecipeResultEffect ParseResultEffect(string effect)
case "SendItemToSaddlebag":
case "TransmogItemAppearance":
return new RecipeResultEffect() { Type = EffectName };
case "BestowRecipeIfNotKnown":
return new RecipeResultEffect() { Type = EffectName, Recipe = EffectParameter };
default:
return new RecipeResultEffect() { Type = "Special", Effect = EffectName };
}
Expand Down Expand Up @@ -193,6 +197,21 @@ private static RecipeResultEffect ParseExtractTSysPower(string effectName, strin
return new RecipeResultEffect() { Type = effectName, Augment = Augment, Skill = Skill, MinLevel = MinLevel, MaxLevel = MaxLevel };
}

private static RecipeResultEffect ParseCraftWaxItem(string effectName, string effectParameter)
{
string[] Splitted = effectParameter.Split(',');

if (Splitted.Length != 4)
throw new PreprocessorException();

string Item = Splitted[0];
string PowerWaxType = Splitted[1];
int BoostLevel = int.Parse(Splitted[2]);
int MaxHitCount = int.Parse(Splitted[3]);

return new RecipeResultEffect() { Type = effectName, Item = Item, PowerWaxType = PowerWaxType, BoostLevel = BoostLevel, MaxHitCount = MaxHitCount };
}

private static RecipeResultEffect ParseRepairItemDurability(string effectName, string effectParameter)
{
string[] Splitted = effectParameter.Split(',');
Expand Down Expand Up @@ -374,6 +393,11 @@ private static RecipeResultEffect ParseTeleport(string effectName, string effect
return new RecipeResultEffect() { Type = effectName, AreaName = AreaName, Other = Other };
}

private static RecipeResultEffect ParseBestowRecipeIfNotKnown(string effectName, string effectParameter)
{
return new RecipeResultEffect() { Type = effectName, Recipe = effectParameter };
}

private static RecipeResultEffect ParseCreateMiningSurvey(string effectName, string effectParameter)
{
return new RecipeResultEffect() { Type = CreateMiningSurvey, Effect = effectName, Item = effectParameter };
Expand Down Expand Up @@ -544,6 +568,8 @@ private static string ToRawResultEffect(RecipeResultEffect effect)
return $"{effect.Keyword}{effect.Tier}";
case "ExtractTSysPower":
return $"{effect.Type}({effect.Augment},{effect.Skill},{effect.MinLevel},{effect.MaxLevel})";
case "CraftWaxItem":
return $"{effect.Type}({effect.Item},{effect.PowerWaxType},{effect.BoostLevel},{effect.MaxHitCount})";
case "RepairItemDurability":
return ToRawRepairItemDurability(effect);
case "TSysCraftedEquipment":
Expand Down Expand Up @@ -574,6 +600,8 @@ private static string ToRawResultEffect(RecipeResultEffect effect)
return $"{effect.Type}_All_{effect.DurationInSeconds}sec";
case "PermanentlyRaiseMaxTempestEnergy":
return $"{effect.Type}({effect.Delta})";
case "BestowRecipeIfNotKnown":
return $"{effect.Type}({effect.Recipe})";
case "Special":
Debug.Assert(effect.Effect is not null);
return effect.Effect!;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public class RecipeResultEffect
public string? Other { get; set; }
public int? PowerLevel { get; set; }
public string? PowerWaxType { get; set; }
public string? Recipe { get; set; }
public Time? RepairCooldown { get; set; }
public int? RepairMaxEfficiency { get; set; }
public int? RepairMinEfficiency { get; set; }
Expand Down
3 changes: 3 additions & 0 deletions Translator/CombatParser/CombatParser.Sentences.cs
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,7 @@ public partial class CombatParser
new Sentence("In the next %f second", CombatKeyword.EffectDuration),
new Sentence("(%f second)", CombatKeyword.EffectDuration),
new Sentence("For %f minute", CombatKeyword.EffectDurationMinute),
new Sentence("That restore Armor after a 6 second delay", CombatKeyword.IfRestoreArmorAfterDelay),
new Sentence("After a %f second delay", CombatKeyword.EffectDelay),
new Sentence("After an %f second delay", CombatKeyword.EffectDelay),
new Sentence("After %f second", CombatKeyword.EffectDelay),
Expand Down Expand Up @@ -393,6 +394,7 @@ public partial class CombatParser
new Sentence("Recover %f health", CombatKeyword.RestoreHealth),
new Sentence("Recover %f power", CombatKeyword.RestorePower),
new Sentence("Power Restoration %f", CombatKeyword.RestorePower),
new Sentence("Increased by %f of the Armor restored", CombatKeyword.MultiplyPowerRestauration),
new Sentence("Restoration %f", CombatKeyword.RestoreHealth),
new Sentence("You regain %f power", CombatKeyword.RestorePower),
new Sentence("Cost no Power to cast", CombatKeyword.ZeroPowerCost),
Expand All @@ -410,6 +412,7 @@ public partial class CombatParser
new Sentence("Max Health by %f", CombatKeyword.AddMaxHealth),
new Sentence("%f Max Health", CombatKeyword.AddMaxHealth),
new Sentence("%f Max Armor", CombatKeyword.AddMaxArmor),
new Sentence("Have %f Armor restoration", CombatKeyword.MultiplyArmorRestauration),
new Sentence("Have %f Armor", CombatKeyword.AddMaxArmor),
new Sentence("Attack Range is %f", CombatKeyword.AddRange),
new Sentence("Range is %f meter", CombatKeyword.AddRange),
Expand Down
Loading

0 comments on commit 3357570

Please sign in to comment.