summaryrefslogtreecommitdiff
path: root/constants.gd
blob: 41f048f5c6949b131c8a179c8e84e9810b4d0856 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
class_name Constants


enum Gender {
	Female,
	Male,
	Both,
	Server,
}

## rAthena: enum pincode_state
enum PinCodeState {
	Ok = 0,
	Ask = 1,
	NotSet = 2,
	Expired = 3,
	New = 4,
	Illegal = 5,
	KSSN = 6,
	Passed = 7,
	Wrong = 8,
}

enum StatusType {
	Weight,
	MaximumWeight,
	MovementSpeed,
	BaseLevel,
	JobLevel,
}

enum EmotionType {
	Surprise,
	Question,
	Delight,
	Throb,
	Sweat,
	Aha,
	Fret,
	Anger,
	Money,
	Think,
	Scissor,
	Rock,
	Wrap,
	Flag,
	BigThrob,
	Thanks,
	Kek,
	Sorry,
	Smile,
	# ... TODO
}

static var PacketDB = {
	#LoginServerLoginPacket.HEADER: LoginServerLoginPacket,
	LoginServerLoginSuccessPacket.HEADER: LoginServerLoginSuccessPacket,
	#CharacterServerLoginPacket.HEADER: CharacterServerLoginPacket,
	CharacterServerLoginSuccessPacket.HEADER: CharacterServerLoginSuccessPacket,
	CharacterServerLoginSuccessCharacterListPacket.HEADER: CharacterServerLoginSuccessCharacterListPacket,
	CharacterListSizePacket.HEADER: CharacterListSizePacket,
	BlockCharacterPacket.HEADER: BlockCharacterPacket,
	PinCodeStatePacket.HEADER: PinCodeStatePacket,
	#RequestCharacterListPacket.HEADER: RequestCharacterListPacket,
	RequestCharacterListSuccessPacket.HEADER: RequestCharacterListSuccessPacket,
	#SelectCharacterPacket.HEADER: SelectCharacterPacket,
	CharacterSelectionSuccessPacket.HEADER: CharacterSelectionSuccessPacket,
	CharacterSelectionFailedPacket.HEADER: CharacterSelectionFailedPacket,
	#MapServerLoginPacket.HEADER: MapServerLoginPacket,
	MapServerLoginSuccessPacket.HEADER: MapServerLoginSuccessPacket,
	FriendListPacket.HEADER: FriendListPacket,
	ServerMessagePacket.HEADER: ServerMessagePacket,
	ChangeMapPacket.HEADER: ChangeMapPacket,
	ParameterChangePacket.HEADER: ParameterChangePacket,
	CoupleStatusPacket.HEADER: CoupleStatusPacket,
	UpdateAttackRangePacket.HEADER: UpdateAttackRangePacket,
	NewMailStatusPacket.HEADER: NewMailStatusPacket,
	QuestListPacket.HEADER: QuestListPacket,
	AchievementUpdatePacket.HEADER: AchievementUpdatePacket,
	AchievementListPacket.HEADER: AchievementListPacket,
	UpdateCriticalWeightPacket.HEADER: UpdateCriticalWeightPacket,
	#MapLoadedPacket.HEADER: MapLoadedPacket,
	SpriteChangePacket.HEADER: SpriteChangePacket,
	InventoryStartPacket.HEADER: InventoryStartPacket,
	RegularItemListPacket.HEADER: RegularItemListPacket,
	EquippableItemListPacket.HEADER: EquippableItemListPacket,
	InventoryEndPacket.HEADER: InventoryEndPacket,
	EquippableSwitchItemListPacket.HEADER: EquippableSwitchItemListPacket,
	MapTypePacket.HEADER: MapTypePacket,
	EntityAppeared2Packet.HEADER: EntityAppeared2Packet,
	UpdateSkillTreePacket.HEADER: UpdateSkillTreePacket,
	UpdateHotkeysPacket.HEADER: UpdateHotkeysPacket,
	ParameterChange2Packet.HEADER: ParameterChange2Packet,
	InitialStatusPacket.HEADER: InitialStatusPacket,
	ParameterChange3Packet.HEADER: ParameterChange3Packet,
	UpdatePartyInvitationState.HEADER: UpdatePartyInvitationState,
	UpdateShowEquipPacket.HEADER: UpdateShowEquipPacket,
	UpdateConfigurationPacket.HEADER: UpdateConfigurationPacket,
	ReputationPacket.HEADER: ReputationPacket,
	QuestEffectPacket.HEADER: QuestEffectPacket,
	MovingEntityAppearedPacket.HEADER: MovingEntityAppearedPacket,
	EntityDisappearedPacket.HEADER: EntityDisappearedPacket,
	NavigateToTargetPacket.HEADER: NavigateToTargetPacket,
	BroadcastFormattedMessagePacket.HEADER: BroadcastFormattedMessagePacket,
	DisplayEmotionPacket.HEADER: DisplayEmotionPacket,
	CloseDialogButtonPacket.HEADER: CloseDialogButtonPacket,
}


class FilePaths:
	const female := "¿©"
	const male := "³²"
	
	const player_head := "Àΰ£Á·/¸Ó¸®Åë"
	const player_body := "Àΰ£Á·/¸öÅë"
	
	const male_head_lookup := [2, 2, 1, 7, 5, 4, 3, 6, 8, 9, 10, 12, 11]
	const female_head_lookup := [2, 2, 4, 7, 1, 5, 3, 6, 12, 10, 9, 11, 8]
	
	
	static func get_gender_path(gender: Gender) -> String:
		if gender == Gender.Female:
			return female
		else:
			return male
	
	
	static func get_job_path(job_id: int) -> String:
		match job_id:
			0: # NOVICE
				return "Ãʺ¸ÀÚ"
			1: # SWORDMAN
				return "°Ë»Ç"
			2: # MAGICIAN
				return "À§Àúµå"
			3: # ARCHER
				return "±Ã¼Ö"
			4: # ACOLYTE
				return "¼ºÁ÷ÀÚ"
			5: # MERCHANT
				return "»ÓÀÎ"
			6: # THIEF
				return "µµµÏ"
			7: # KNIGHT
				return "񃯇"
			8: # PRIEST
				return "¼ºÅõ»ç"
			9: # WIZARD
				return "¸¶¹Ý»Ç"
			10: # BLACKSMITH
				return "Á¦Ã¶°ø"
			11: # HUNTER
				return "ÇåÅÍ"
			# ... TODO
			
			_: # NOVICE
				return "Ãʺ¸ÀÚ"
	
	
	static func get_player_head(gender: Gender, head_id: int) -> String:
		var real_head_id := head_id
		if gender == Gender.Female and head_id < female_head_lookup.size():
			real_head_id = female_head_lookup[head_id]
		elif gender == Gender.Male and head_id < male_head_lookup.size():
			real_head_id = male_head_lookup[head_id]
		
		return "%s/%s/%s_%s" % [
			player_head,
			get_gender_path(gender),
			real_head_id,
			get_gender_path(gender),
		]
	
	
	static func get_player_body(gender: Gender, job_id: int):
		return "%s/%s/%s_%s" % [
			player_body,
			get_gender_path(gender),
			get_job_path(job_id),
			get_gender_path(gender),
		]