Skip to content

Commit 67a2018

Browse files
committed
Create QuestMedalType -- quest medal category
1 parent 5889a4b commit 67a2018

File tree

2 files changed

+93
-0
lines changed

2 files changed

+93
-0
lines changed

MapleLib/WzLib/WzStructure/Data/ItemStructure/ItemIdsCategory.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ namespace MapleLib.WzLib.WzStructure.Data.ItemStructure
1010
public class ItemIdsCategory
1111
{
1212
public static int
13+
MEDAL_CATEGORY = 114,
1314
BUFF_CATEGORY = 202,
1415
PET_CATEGORY = 500;
1516

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
/*Copyright(c) 2024, LastBattle https://github.com/lastbattle/Harepacker-resurrected
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy
4+
of this software and associated documentation files (the "Software"), to deal
5+
in the Software without restriction, including without limitation the rights
6+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
copies of the Software, and to permit persons to whom the Software is
8+
furnished to do so, subject to the following conditions:
9+
10+
The above copyright notice and this permission notice shall be included in all
11+
copies or substantial portions of the Software.
12+
13+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19+
SOFTWARE.
20+
*/
21+
22+
using System;
23+
namespace MapleLib.WzLib.WzStructure.Data.QuestStructure
24+
{
25+
public enum QuestMedalType
26+
{
27+
NoneOrUnknown = 0,
28+
Job = 1,
29+
Normal = 2,
30+
Challenge = 3,
31+
Event = 4,
32+
NO = 5,
33+
}
34+
35+
public static class QuestMedalTypeExt
36+
{
37+
/// <summary>
38+
/// Human readable string
39+
/// </summary>
40+
/// <param name="state"></param>
41+
/// <returns></returns>
42+
public static string ToReadableString(this QuestMedalType state)
43+
{
44+
return state.ToString().Replace("_", " ");
45+
}
46+
47+
/// <summary>
48+
/// Converts from the string name back to enum
49+
/// </summary>
50+
/// <param name="name"></param>
51+
/// <returns></returns>
52+
public static QuestMedalType ToEnum(this string name)
53+
{
54+
// Try to parse the string to enum
55+
if (Enum.TryParse<QuestMedalType>(name.Replace(" ", "_"), out QuestMedalType result))
56+
{
57+
return (QuestMedalType)result;
58+
}
59+
return QuestMedalType.NoneOrUnknown;
60+
}
61+
62+
/// <summary>
63+
/// Converts from the area code value to enum type
64+
/// </summary>
65+
/// <param name="value"></param>
66+
/// <returns></returns>
67+
public static QuestMedalType ToEnum(int value)
68+
{
69+
if (Enum.IsDefined(typeof(QuestMedalType), value))
70+
{
71+
return (QuestMedalType)value;
72+
}
73+
else
74+
{
75+
//Console.WriteLine($"Warning: Invalid QuestAreaCodeType value {value}. Defaulting to Unknown.");
76+
return QuestMedalType.NoneOrUnknown;
77+
}
78+
}
79+
}
80+
}
81+
82+
/* 692 */
83+
/*
84+
enum $8B10128932F884E0B385C45C2A832C21
85+
{
86+
NOT_MEDAL_QUEST = 0x0,
87+
MEDAL_QUEST_JOB = 0x1,
88+
MEDAL_QUEST_NORMAL = 0x2,
89+
MEDAL_QUEST_CHALLENGE = 0x3,
90+
MEDAL_QUEST_EVENT = 0x4,
91+
MEDAL_QUEST_NO = 0x5,
92+
};*/

0 commit comments

Comments
 (0)