-
-
Notifications
You must be signed in to change notification settings - Fork 112
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Niklas G <niegoedde@gmail.com>
- Loading branch information
Showing
34 changed files
with
1,862 additions
and
123 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
60 changes: 60 additions & 0 deletions
60
Library/RSBot.Core/Client/ReferenceObjects/RefQuestReward.cs
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,60 @@ | ||
namespace RSBot.Core.Client.ReferenceObjects | ||
{ | ||
public class RefQuestReward : IReference<uint> | ||
{ | ||
#region Fields | ||
|
||
public uint QuestId; | ||
public string QuestCodeName; | ||
public bool IsView; | ||
public bool IsBasicReward; | ||
public bool IsItemReward; | ||
public bool IsCheckCondition; | ||
public bool IsCheckCountry; | ||
public bool IsCheckClass; | ||
public bool IsCheckGender; | ||
public int Gold; | ||
public int Exp; | ||
public int SPExp; | ||
public int SP; | ||
public int AP; | ||
public string APType; | ||
public byte Hwan; | ||
public byte InventorySlots; | ||
public byte ItemRewardType; | ||
public byte SelectionCount; | ||
|
||
#endregion Fields | ||
|
||
public uint PrimaryKey => QuestId; | ||
|
||
public bool Load(ReferenceParser parser) | ||
{ | ||
parser.TryParse(0, out QuestId); | ||
parser.TryParse(1, out QuestCodeName); | ||
parser.TryParse(2, out IsView); | ||
parser.TryParse(3, out IsBasicReward); | ||
parser.TryParse(4, out IsItemReward); | ||
parser.TryParse(5, out IsCheckCondition); | ||
parser.TryParse(6, out IsCheckCountry); | ||
parser.TryParse(7, out IsCheckClass); | ||
parser.TryParse(8, out IsCheckGender); | ||
|
||
//9?! | ||
|
||
parser.TryParse(10, out Gold); | ||
parser.TryParse(11, out Exp); | ||
parser.TryParse(12, out SPExp); | ||
parser.TryParse(13, out SP); | ||
parser.TryParse(14, out AP); | ||
parser.TryParse(15, out APType); | ||
parser.TryParse(16, out Hwan); | ||
parser.TryParse(17, out InventorySlots); | ||
parser.TryParse(18, out ItemRewardType); | ||
parser.TryParse(19, out SelectionCount); | ||
|
||
return true; | ||
} | ||
} | ||
} | ||
|
38 changes: 38 additions & 0 deletions
38
Library/RSBot.Core/Client/ReferenceObjects/RefQuestRewardItem.cs
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,38 @@ | ||
namespace RSBot.Core.Client.ReferenceObjects | ||
{ | ||
public class RefQuestRewardItem : IReference | ||
{ | ||
#region Fields | ||
|
||
public uint QuestId; | ||
public string QuestCodeName; | ||
public byte RewardType; | ||
public string ItemCodeName; | ||
public string OptionalItemCode; | ||
public int OptionalItemCount; | ||
public int AchieveQuantity; | ||
public string RentItemCodeName; | ||
|
||
public RefObjItem Item => ItemCodeName == "xxx" ? null : Game.ReferenceManager.GetRefItem(ItemCodeName); | ||
|
||
public RefObjItem OptionalItem => OptionalItemCode == "xxx" ? null : Game.ReferenceManager.GetRefItem(OptionalItemCode); | ||
public RefObjItem RentItem => OptionalItemCode == "xxx" ? null : Game.ReferenceManager.GetRefItem(RentItemCodeName); | ||
|
||
#endregion Fields | ||
|
||
public bool Load(ReferenceParser parser) | ||
{ | ||
parser.TryParse(0, out QuestId); | ||
parser.TryParse(1, out QuestCodeName); | ||
parser.TryParse(2, out RewardType); | ||
parser.TryParse(3, out ItemCodeName); | ||
parser.TryParse(4, out OptionalItemCode); | ||
parser.TryParse(5, out OptionalItemCount); | ||
parser.TryParse(6, out AchieveQuantity); | ||
parser.TryParse(7, out RentItemCodeName); | ||
|
||
return true; | ||
} | ||
} | ||
} | ||
|
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,44 @@ | ||
using System.Text; | ||
|
||
namespace RSBot.Core.Extensions | ||
{ | ||
public static class StringExtension | ||
{ | ||
#region Methods | ||
|
||
public static string JoymaxFormat<T1>(this string unformatted, T1 valA) | ||
{ | ||
var stringBulder = new StringBuilder(unformatted); | ||
stringBulder = stringBulder.Replace("%d", "%s"); | ||
|
||
stringBulder = stringBulder.Replace("%s", valA.ToString(), 0, stringBulder.ToString().IndexOf("%s") + 2); | ||
|
||
return stringBulder.ToString(); | ||
} | ||
|
||
public static string JoymaxFormat<T1, T2>(this string unformatted, T1 valA, T2 valB) | ||
{ | ||
var stringBulder = new StringBuilder(unformatted); | ||
stringBulder = stringBulder.Replace("%d", "%s"); | ||
|
||
stringBulder = stringBulder.Replace("%s", valA.ToString(), 0, stringBulder.ToString().IndexOf("%s") + 2); | ||
stringBulder = stringBulder.Replace("%s", valB.ToString(), 0, stringBulder.ToString().IndexOf("%s") + 2); | ||
|
||
return stringBulder.ToString(); | ||
} | ||
|
||
public static string JoymaxFormat<T1, T2, T3>(this string unformatted, T1 valA, T2 valB, T3 valC) | ||
{ | ||
var stringBulder = new StringBuilder(unformatted); | ||
stringBulder = stringBulder.Replace("%d", "%s"); | ||
|
||
stringBulder = stringBulder.Replace("%s", valA.ToString(), 0, stringBulder.ToString().IndexOf("%s") + 2); | ||
stringBulder = stringBulder.Replace("%s", valB.ToString(), 0, stringBulder.ToString().IndexOf("%s") + 2); | ||
stringBulder = stringBulder.Replace("%s", valC.ToString(), 0, stringBulder.ToString().IndexOf("%s") + 2); | ||
|
||
return stringBulder.ToString(); | ||
} | ||
|
||
#endregion Methods | ||
} | ||
} |
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.