Skip to content

Commit

Permalink
Add pre-defined event for the player discovering a rare
Browse files Browse the repository at this point in the history
This is similar to adding a chat trigger for `$NAME has discovered` but is built-in (since it's such a common thing players want) rather than requiring the user to create a chat trigger with a custom regex.
  • Loading branch information
amoeba authored Apr 24, 2019
2 parents a279c21 + ba1d327 commit 47b2bb4
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions PluginCore.Events.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ private void CharacterFilter_LoginComplete(object sender, EventArgs e)
Core.CharacterFilter.Death += CharacterFilter_Death;

TriggerWebhooksForEvent(EVENTS.LOGIN, Core.CharacterFilter.Name + " has logged in.");
ChatPatterns.Add(new ChatPattern(EVENTS.RARE, Core.CharacterFilter.Name + " has discovered "));
}
catch (Exception ex) { Util.LogError(ex); }
}
Expand Down
1 change: 1 addition & 0 deletions PluginCore.MainView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,7 @@ private void PopulateEventChoices()
chcEventTriggerEvent.Add(EVENTDESC.LEVEL, EVENTS.LEVEL);
chcEventTriggerEvent.Add(EVENTDESC.DEATH, EVENTS.DEATH);
chcEventTriggerEvent.Add(EVENTDESC.DROPONDEATH, EVENTS.DROPONDEATH);
chcEventTriggerEvent.Add(EVENTDESC.RARE, EVENTS.RARE);
}
catch (Exception ex)
{
Expand Down
2 changes: 2 additions & 0 deletions PluginCore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public struct EVENTS {
public const string LEVEL = "LEVEL";
public const string DEATH = "DEATH";
public const string DROPONDEATH = "DROPONDEATH";
public const string RARE = "RARE";
};

public struct EVENTDESC
Expand All @@ -40,6 +41,7 @@ public struct EVENTDESC
public const string LEVEL = "You level up";
public const string DEATH = "You die";
public const string DROPONDEATH = "You drop items on death";
public const string RARE = "You find a rare";
}

// Just GameEvent events the plugin handles
Expand Down

0 comments on commit 47b2bb4

Please sign in to comment.