-
Notifications
You must be signed in to change notification settings - Fork 241
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding methods to QuestManager (#1052)
* Fixing stance shuffling / refactoring moveto chains a bit * Fixing vendor rotate * Removing debug message * Fixing stance change for player activating switches * Adding methods to QuestManager * Adding TimeSpanExtensions * Adjusting walk/run threshold * Adding quest restrictions for portals, and portal spawning triggered by monster deaths * Updating function names * Adding HasQuestCompletes * Adding support for character titles to emotes * Added emote hooks for portal use and creature death * Adding KillTaunt and NewEnemy, updating questName@comment format * Updating broadcast emotes * Updating InqQuestSolves * Adding fixes for Aerfalle * Fixed rolling balls of death
- Loading branch information
1 parent
aad8974
commit 678681f
Showing
30 changed files
with
778 additions
and
280 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
using System; | ||
using System.Text; | ||
|
||
namespace ACE.Common.Extensions | ||
{ | ||
public static class TimeSpanExtensions | ||
{ | ||
public static string GetFriendlyString(this TimeSpan timeSpan) | ||
{ | ||
// use datetime here? | ||
// this probably won't work with numDays... | ||
//var numYears = timeSpan.GetYears(); | ||
//var numMonths = timeSpan.GetMonths(); | ||
|
||
var numDays = timeSpan.ToString("%d"); | ||
var numHours = timeSpan.ToString("%h"); | ||
var numMinutes = timeSpan.ToString("%m"); | ||
var numSeconds = timeSpan.ToString("%s"); | ||
|
||
var sb = new StringBuilder(); | ||
|
||
// did retail display months/years? | ||
|
||
//if (numYears > 0) sb.Append(numYears + "y "); | ||
//if (numMonths > 0) sb.Append(numMonths + "mo "); | ||
|
||
if (numDays != "0") sb.Append(numDays + "d "); | ||
if (numHours != "0") sb.Append(numHours + "h "); | ||
if (numMinutes != "0") sb.Append(numMinutes + "m "); | ||
if (numSeconds != "0") sb.Append(numSeconds + "s "); | ||
|
||
return sb.ToString().Trim(); | ||
} | ||
|
||
public static uint SecondsPerMonth = 60 * 60 * 24 * 30; // 30-day estimate | ||
public static uint SecondsPerYear = 60 * 60 * 24 * 365; // non-leap year | ||
|
||
public static uint GetMonths(this TimeSpan timeSpan) | ||
{ | ||
return (uint)timeSpan.TotalSeconds / SecondsPerMonth; | ||
} | ||
|
||
public static uint GetYears(this TimeSpan timeSpan) | ||
{ | ||
return (uint)timeSpan.TotalSeconds / SecondsPerYear; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.