Skip to content

Commit

Permalink
added /e3camp and cleaned up some code
Browse files Browse the repository at this point in the history
added IgnoreStackRules for spells and dots/debuffs now pay attention to it.
  • Loading branch information
RekkasGit committed Apr 8, 2024
1 parent e35acd2 commit 9a7e6be
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 22 deletions.
5 changes: 5 additions & 0 deletions E3Next/Data/Spell.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ void Parse(IniData parsedData)
{
Debug = true;
}
else if (value.Equals("IgnoreStackRules", StringComparison.OrdinalIgnoreCase))
{
IgnoreStackRules = true;
}
else if (value.StartsWith("HealthMax|", StringComparison.OrdinalIgnoreCase))
{
HealthMax = GetArgument<Int32>(value);
Expand Down Expand Up @@ -798,6 +802,7 @@ public decimal MyCastTime
public Int64 LastUpdateCheckFromTopicUpdate = 0;
public bool IsShortBuff = false;
public Int32 HealthMax = 100;
public bool IgnoreStackRules = false;


public override string ToString()
Expand Down
10 changes: 3 additions & 7 deletions E3Next/Processors/Alerts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,7 @@ private static void RegisterEvents()


if (!Basics.IsPaused) return;
Basics.IsPaused = false;
E3.Bots.Broadcast("\agRunning E3 again!");
Basics.Pause(false);
});
pattern = @"It will take you about 30 seconds to prepare your camp\.";
EventProcessor.RegisterEvent("PauseForCamp30", pattern, (x) => {
Expand All @@ -211,9 +210,7 @@ private static void RegisterEvents()
{
return;
}
if (Basics.IsPaused) return;
Basics.IsPaused = true;
E3.Bots.Broadcast("\arPAUSING E3!");
Basics.Pause(true);
});
pattern = @"It will take about 20 more seconds to prepare your camp\.";
EventProcessor.RegisterEvent("PauseForCamp20", pattern, (x) => {
Expand All @@ -224,8 +221,7 @@ private static void RegisterEvents()
return;
}
if (Basics.IsPaused) return;
Basics.IsPaused = true;
E3.Bots.Broadcast("\arPAUSING E3!");
Basics.Pause(true);
});

pattern = @"It will take about 5 more seconds to prepare your camp\.";
Expand Down
52 changes: 43 additions & 9 deletions E3Next/Processors/Basics.cs
Original file line number Diff line number Diff line change
Expand Up @@ -279,8 +279,32 @@ public static void RegisterEvents()
PubServer.AddTopicMessage("WorldShutdown", $"{minutes}");
}
});
EventProcessor.RegisterCommand("/e3camp", (x) =>
{
string user = string.Empty;

if (x.args.Count > 0)
{
if (!e3util.FilterMe(x))
{
Pause(true);
MQ.Cmd("/camp");

}
}
else
{
if (!e3util.FilterMe(x))
{
Pause(true);
MQ.Cmd("/camp");
}
//we are telling people to follow us
E3.Bots.BroadcastCommandToGroup("/e3camp " + E3.CurrentName, x);

EventProcessor.RegisterCommand("/e3treport", (x) =>
}
});
EventProcessor.RegisterCommand("/e3treport", (x) =>
{
if(x.args.Count > 0)
{
Expand Down Expand Up @@ -668,25 +692,21 @@ public static void RegisterEvents()
{
if (IsPaused)
{
IsPaused = false;
E3.Bots.Broadcast("\agRunning E3 again!");
Pause(false);
}
}
else if (x.args[0].Equals("on", StringComparison.OrdinalIgnoreCase))
{
if(!IsPaused)
{
IsPaused = true;
E3.Bots.Broadcast("\arPAUSING E3!");

Pause(true);
}
}
}
else
{
IsPaused = IsPaused ? false : true;
if (IsPaused) E3.Bots.Broadcast("\arPAUSING E3!");
if (!IsPaused) E3.Bots.Broadcast("\agRunning E3 again!");

Pause(IsPaused ? false : true);

}

Expand Down Expand Up @@ -887,7 +907,21 @@ private static void PrintE3TReport_Information(Spell spell, Int32 timeInMS,Int32

}
}
public static void Pause(bool on)
{
if(on && IsPaused==false)
{
IsPaused = true;
E3.Bots.Broadcast("\arPAUSING E3!");


}
else if(!on && IsPaused==true)
{
IsPaused = false;
E3.Bots.Broadcast("\agRunning E3 again!");
}
}
private static void PrintE3TReportEntries()
{
foreach (var spell in E3.CharacterSettings.Report_Entries)
Expand Down
15 changes: 9 additions & 6 deletions E3Next/Processors/DebuffDot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -449,13 +449,16 @@ private static void CastLongTermSpell(Int32 mobid, List<Data.Spell> spells, Dict
if (shouldContinue) { continue; }
}

if (!MQ.Query<bool>($"${{Spell[{spell.SpellID}].StacksTarget}}"))
if(!spell.IgnoreStackRules)
{
//spell won't land based on stacking, move to next
continue;
}

var result = Casting.Cast(mobid, spell, Heals.SomeoneNeedsHealing);
if (!MQ.Query<bool>($"${{Spell[{spell.SpellID}].StacksTarget}}"))
{
//spell won't land based on stacking, move to next
continue;
}
}

var result = Casting.Cast(mobid, spell, Heals.SomeoneNeedsHealing);
if (result == CastReturn.CAST_INTERRUPTFORHEAL)
{
return;
Expand Down

0 comments on commit 9a7e6be

Please sign in to comment.