Client Upload Part 2

RD Core / Commit #5

Commit Client Upload Part 2

Alex Alex committed 19/10/2026 00:06 main Patch
1,244 files +271,215 -0
A RD_Client/modules/game_database/database.otmod +13-0 View file
@@ -0,0 +1,13 @@
1+Module
2+ name: game_database
3+ description: Informacoes de menu do personagem
4+ author: Frenesy
5+ website: https://github.com/edubart/otclient
6+ sandboxed: true
7+ scripts: [ database ]
8+
9+ autoload: true
10+ autoload-priority: 1000
11+
12+ @onLoad: init()
13+ @onUnload: terminate()
A RD_Client/modules/game_database/database.otui +5-0 View file
@@ -0,0 +1,5 @@
1+MainWindow
2+ id: dataWindow
3+ size: 10 10
4+ draggable: false
5+ focusable: true
A RD_Client/modules/game_desafios/desafios.otmod +13-0 View file
@@ -0,0 +1,13 @@
1+Module
2+ name: game_desafios
3+ description: Desafios Diarios
4+ author: Frenesy
5+ website: https://github.com/edubart/otclient
6+ sandboxed: true
7+ scripts: [ desafios ]
8+
9+ autoload: true
10+ autoload-priority: 1000
11+
12+ @onLoad: init()
13+ @onUnload: terminate()
A RD_Client/modules/game_desafios/desafios.otui +395-0 View file
@@ -0,0 +1,395 @@
1+MainWindow
2+ id: desafiosWindow
3+ size: 800 400
4+ image-source: /images/custom/UI/none
5+ draggable: false
6+ focusable: true
7+ @onEscape: closer()
8+
9+ UIButton
10+ id: desafiosButton
11+ size: 61 61
12+ image-source: /images/custom/UI/desafios_on
13+ anchors.top: parent.top
14+ anchors.left: parent.left
15+ margin-left: -5
16+ margin-top: 17
17+ opacity: 0.8
18+ $pressed:
19+ opacity: 0.6
20+ $hover !pressed:
21+ opacity: 1.0
22+
23+ UIButton
24+ id: desafiosPanel
25+ size: 570 365
26+ focusable: true
27+ image-source: /images/custom/UI/central_back
28+ anchors.top: parent.top
29+ anchors.left: desafiosButton.right
30+ margin-left: 10
31+ margin-top: -10
32+
33+ Label
34+ id: textTitle
35+ !text: tr("DESAFIOS DIARIOS")
36+ text-align: center
37+ font: newfont-16px-rounded
38+ height: 22
39+ anchors.top: parent.top
40+ anchors.left: parent.left
41+ anchors.right: parent.right
42+ margin-top: 10
43+ margin-left: 20
44+ margin-right: 20
45+
46+ Label
47+ id: textDesafio
48+ !text: tr("Todos os dias, desafios sao sorteados aleatoriamente. Voce pode fazer todos, mas so pode ativar 1 por vez. Clique no desafio para ativa-lo.")
49+ font: lucida-11px-rounded
50+ text-offset: 10 10
51+ text-wrap: true
52+ height: 50
53+ image-source: /images/custom/Task/Monster_2
54+ anchors.top: textTitle.bottom
55+ anchors.left: parent.left
56+ anchors.right: parent.right
57+ margin-top: 10
58+ margin-left: 20
59+ margin-right: 20
60+
61+ VerticalScrollBar
62+ id: DesafiosPanelScrollBar
63+ anchors.top: textDesafio.bottom
64+ anchors.bottom: parent.bottom
65+ anchors.right: parent.right
66+ step: 24
67+ opacity: 0.7
68+ margin-bottom: 20
69+ margin-top: 10
70+ margin-right: 15
71+ pixels-scroll: true
72+
73+ ScrollablePanel
74+ id: DesafiosScrollPanel
75+ height: 180
76+ anchors.right: prev.left
77+ anchors.left: parent.left
78+ anchors.top: textDesafio.bottom
79+ anchors.bottom: parent.bottom
80+ vertical-scrollbar: DesafiosPanelScrollBar
81+ margin-left: 20
82+ margin-top: 10
83+ margin-right: 05
84+ margin-bottom: 20
85+ layout:
86+ type: grid
87+ cell-size: 515 60
88+ flow: true
89+ auto-spacing: false
90+
91+ UIButton
92+ id: alertMensagem
93+ height: 170
94+ image-source: /images/custom/UI/black_Panel
95+ anchors.top: parent.top
96+ anchors.left: parent.left
97+ anchors.right: parent.right
98+ margin-top: 100
99+ margin-left: -1
100+ margin-right: -1
101+
102+ UIButton
103+ height: 2
104+ image-source: /images/custom/UI/separador
105+ anchors.top: parent.top
106+ anchors.left: parent.left
107+ anchors.right: parent.right
108+ margin-top: -1
109+
110+ Label
111+ id: titleAlert
112+ height: 22
113+ font: newfont-16px-rounded
114+ text: Titulo de Alerta
115+ text-align: center
116+ anchors.top: parent.top
117+ anchors.left: parent.left
118+ anchors.right: parent.right
119+ margin-top: 25
120+ margin-left: -1
121+ margin-right: -1
122+
123+ UIButton
124+ id: circleIcon
125+ size: 70 70
126+ icon: /images/custom/Spells/Passiva/passive_1
127+ anchors.top: parent.top
128+ anchors.left: parent.left
129+ margin-top: -30
130+ margin-left: 245
131+
132+ Label
133+ id: descAlert
134+ height: 55
135+ font: verdana-11px-antialised
136+ text: Descri��o do Alerta
137+ text-align: center
138+ text-wrap: true
139+ anchors.top: circleIcon.bottom
140+ anchors.left: parent.left
141+ anchors.right: parent.right
142+ margin-top: 10
143+ margin-left: 05
144+ margin-right: 05
145+
146+ UIButton
147+ id: confirmAlert
148+ height: 25
149+ image-source: /images/custom/UI/button_2
150+ font: verdana-11px-antialised
151+ !text: tr('Confirmar')
152+ text-align: center
153+ anchors.bottom: parent.bottom
154+ anchors.left: parent.left
155+ margin-bottom: 15
156+ margin-left: 50
157+ opacity: 0.8
158+ $pressed:
159+ opacity: 0.6
160+ $hover !pressed:
161+ opacity: 1.0
162+
163+ UIButton
164+ id: cancelAlert
165+ height: 25
166+ image-source: /images/custom/UI/button_3
167+ font: verdana-11px-antialised
168+ !text: tr('Cancelar')
169+ text-align: center
170+ anchors.bottom: parent.bottom
171+ anchors.left: confirmAlert.right
172+ margin-bottom: 15
173+ margin-left: 10
174+ opacity: 0.8
175+ $pressed:
176+ opacity: 0.6
177+ $hover !pressed:
178+ opacity: 1.0
179+
180+ UIButton
181+ height: 2
182+ image-source: /images/custom/UI/separador
183+ anchors.bottom: parent.bottom
184+ anchors.left: parent.left
185+ anchors.right: parent.right
186+ margin-bottom: -1
187+
188+ UIButton
189+ id: shopButton
190+ size: 61 61
191+ image-source: /images/custom/UI/desafios_shop_on
192+ anchors.top: desafiosButton.bottom
193+ anchors.left: parent.left
194+ margin-left: -5
195+ margin-top: 10
196+ opacity: 0.8
197+ $pressed:
198+ opacity: 0.6
199+ $hover !pressed:
200+ opacity: 1.0
201+
202+ UIButton
203+ id: shopPanel
204+ size: 570 365
205+ focusable: true
206+ image-source: /images/custom/UI/central_back
207+ anchors.top: parent.top
208+ anchors.left: shopButton.right
209+ margin-left: 10
210+ margin-top: -10
211+
212+ Label
213+ id: saldoDesafioPoints
214+ font: lucida-11px-rounded
215+ text-offset: 05 05
216+ text-align: center
217+ text-wrap: true
218+ size: 150 55
219+ image-source: /images/custom/UI/button_4
220+ anchors.top: parent.top
221+ anchors.left: parent.left
222+ margin-top: 15
223+ margin-left: 20
224+ opacity: 0.8
225+
226+ Label
227+ id: shopTextDesafio
228+ !text: tr('Use seus pontos de desafio para comprar produtos exclusivos desse Shop. Voce so podera ter 1 produto ativo por vez.')
229+ font: lucida-11px-rounded
230+ text-offset: 10 10
231+ text-wrap: true
232+ height: 55
233+ image-source: /images/custom/Task/Monster_2
234+ anchors.top: parent.top
235+ anchors.left: saldoDesafioPoints.right
236+ anchors.right: parent.right
237+ margin-top: 15
238+ margin-left: 10
239+ margin-right: 20
240+
241+ VerticalScrollBar
242+ id: DesafiosShopPanelScrollBar
243+ anchors.top: shopTextDesafio.bottom
244+ anchors.bottom: parent.bottom
245+ anchors.right: parent.right
246+ step: 24
247+ opacity: 0.7
248+ margin-bottom: 20
249+ margin-top: 15
250+ margin-right: 15
251+ pixels-scroll: true
252+
253+ ScrollablePanel
254+ id: DesafiosShopScrollPanel
255+ height: 180
256+ anchors.right: prev.left
257+ anchors.left: parent.left
258+ anchors.top: shopTextDesafio.bottom
259+ anchors.bottom: parent.bottom
260+ vertical-scrollbar: DesafiosShopPanelScrollBar
261+ margin-left: 20
262+ margin-top: 15
263+ margin-right: 05
264+ margin-bottom: 20
265+ layout:
266+ type: grid
267+ cell-size: 115 162
268+ flow: true
269+ auto-spacing: true
270+
271+ UIButton
272+ id: shopMensagem
273+ height: 170
274+ image-source: /images/custom/UI/black_Panel
275+ anchors.top: parent.top
276+ anchors.left: parent.left
277+ anchors.right: parent.right
278+ margin-top: 100
279+ margin-left: -1
280+ margin-right: -1
281+
282+ UIButton
283+ height: 2
284+ image-source: /images/custom/UI/separador
285+ anchors.top: parent.top
286+ anchors.left: parent.left
287+ anchors.right: parent.right
288+ margin-top: -1
289+
290+ Label
291+ id: titleShop
292+ height: 22
293+ font: newfont-16px-rounded
294+ text: Nome do Produto
295+ text-align: center
296+ anchors.top: parent.top
297+ anchors.left: parent.left
298+ anchors.right: parent.right
299+ margin-top: 25
300+ margin-left: -1
301+ margin-right: -1
302+
303+ UIButton
304+ id: circleShop
305+ size: 70 70
306+ anchors.top: parent.top
307+ anchors.left: parent.left
308+ margin-top: -55
309+ margin-left: 245
310+
311+ Label
312+ id: descShop
313+ height: 55
314+ font: verdana-11px-antialised
315+ text: Descri��o do Alerta
316+ text-align: center
317+ text-wrap: true
318+ anchors.top: circleShop.bottom
319+ anchors.left: parent.left
320+ anchors.right: parent.right
321+ margin-top: 30
322+ margin-left: 05
323+ margin-right: 05
324+
325+ UIButton
326+ id: desafioCoin
327+ size: 150 25
328+ image-source: /images/custom/UI/button_4
329+ font: verdana-11px-antialised
330+ text-align: center
331+ anchors.bottom: parent.bottom
332+ anchors.left: parent.left
333+ margin-bottom: 15
334+ margin-left: 50
335+ opacity: 0.8
336+ $pressed:
337+ opacity: 0.6
338+ $hover !pressed:
339+ opacity: 1.0
340+
341+ UIButton
342+ id: vipShop
343+ size: 150 25
344+ image-source: /images/custom/UI/button_1
345+ font: verdana-11px-antialised
346+ text-align: center
347+ anchors.bottom: parent.bottom
348+ anchors.left: desafioCoin.right
349+ margin-bottom: 15
350+ margin-left: 10
351+ opacity: 0.8
352+ $pressed:
353+ opacity: 0.6
354+ $hover !pressed:
355+ opacity: 1.0
356+
357+ UIButton
358+ id: cancelShop
359+ size: 150 25
360+ image-source: /images/custom/UI/button_3
361+ font: verdana-11px-antialised
362+ !text: tr('Cancelar')
363+ text-align: center
364+ anchors.bottom: parent.bottom
365+ anchors.left: vipShop.right
366+ margin-bottom: 15
367+ margin-left: 10
368+ opacity: 0.8
369+ $pressed:
370+ opacity: 0.6
371+ $hover !pressed:
372+ opacity: 1.0
373+
374+ UIButton
375+ height: 2
376+ image-source: /images/custom/UI/separador
377+ anchors.bottom: parent.bottom
378+ anchors.left: parent.left
379+ anchors.right: parent.right
380+ margin-bottom: -1
381+
382+ UIButton
383+ id: exitButton
384+ image-source: /images/custom/UI/desafios_exit
385+ size: 61 61
386+ anchors.top: shopButton.bottom
387+ anchors.left: parent.left
388+ margin-left: -5
389+ margin-top: 10
390+ opacity: 0.8
391+ $pressed:
392+ opacity: 0.6
393+ $hover !pressed:
394+ opacity: 1.0
395+ @onClick: closer()
A RD_Client/modules/game_features/features.lua +249-0 View file
@@ -0,0 +1,249 @@
1+function init()
2+ connect(g_game, { onClientVersionChange = updateFeatures })
3+end
4+
5+function terminate()
6+ disconnect(g_game, { onClientVersionChange = updateFeatures })
7+end
8+
9+function updateFeatures(version)
10+ g_game.resetFeatures()
11+ if version <= 0 then
12+ return
13+ end
14+
15+ -- you can add custom features here, list of them is in the modules\gamelib\const.lua
16+ --g_game.enableFeature(GameBot)
17+ --g_game.enableFeature(GameMinimapLimitedToSingleFloor) -- it will generate minimap only for current floor
18+ --g_game.enableFeature(GameDrawAuraOnTop)
19+ --g_game.enableFeature(GameAuraAlwaysSouth)
20+ g_game.enableFeature(GameWingsAndAura)
21+ --g_game.enableFeature(GameItemTooltipV8);
22+ --g_game.enableFeature(GameOutfitEffect)
23+ g_game.enableFeature(GameMagicEffectU16)
24+ --g_game.enableFeature(GameCreatureAttachedEffect)
25+ g_game.enableFeature(GameExtendedOpcode)
26+ g_game.enableFeature(GameOutfitShaders)
27+ --g_game.enableFeature(GameCenteredOutfits)
28+ g_game.enableFeature(GameAutoOffsetOutfits)
29+
30+ g_game.enableFeature(GameDiagonalAnimatedText)
31+ g_game.enableFeature(GameSmoothWalkElevation)
32+ g_game.enableFeature(GameBigAurasCenter)
33+ g_game.enableFeature(GameWingOffset)
34+ g_game.enableFeature(GameWingsAurasEffectsShader)
35+ g_game.enableFeature(GameCreatureShader)
36+ g_game.enableFeature(GameAuraFrontAndBack)
37+ g_game.enableFeature(GameNewCreatureStacking)
38+ g_game.enableFeature(GameFormatCreatureName)
39+ g_game.enableFeature(GameItemShader)
40+ g_game.enableFeature(GameNegativeOffset)
41+ g_game.enableFeature(GameAttackSeq)
42+ g_game.enableFeature(GamePlayerMounts)
43+ --g_game.enableFeature(GameSpritesU32)
44+ g_game.enableFeature(GameSpritesAlphaChannel)
45+ g_game.enableFeature(GameEnhancedAnimations)
46+ g_game.enableFeature(GameIdleAnimations)
47+ g_game.enableFeature(GameMapDrawGroundFirst)
48+ --g_game.enableFeature(GameDistanceEffectU16)
49+ g_game.enableFeature(GameDistanceShootU16)
50+ g_game.enableFeature(GameMapDrawnGroundFirst)
51+ g_game.enableFeature(GameChangeMapAwareRange)
52+ g_game.enableFeature(GameCreatureIcons)
53+ --g_game.enableFeature(GamePacketSizeU32)
54+ g_game.enableFeature(GameLooktypeU16)
55+ g_game.enableFeature(GamePlayerStateU16)
56+ g_game.enableFeature(GameNewOutfitProtocol)
57+ g_game.enableFeature(GameExtendedClientPing)
58+ g_game.enableFeature(GameNewSpeedLaw)
59+ g_game.enableFeature(GameOGLInformation)
60+ g_game.enableFeature(GameContentRevision)
61+ g_game.enableFeature(GameAuthenticator)
62+ g_game.enableFeature(GameSessionKey)
63+ g_game.enableFeature(GameTileAddThingWithStackpos)
64+ g_game.enableFeature(GameMessageSizeCheck)
65+ g_game.enableFeature(GameChallengeOnLogin)
66+ g_game.enableFeature(GameTileAddThingWithStackpos)
67+ g_game.enableFeature(GameOutfitAttackData)
68+
69+
70+ if(version >= 770) then
71+ g_game.enableFeature(GameLooktypeU16)
72+ g_game.enableFeature(GameMessageStatements)
73+ g_game.enableFeature(GameLoginPacketEncryption)
74+ end
75+
76+ if(version >= 780) then
77+ g_game.enableFeature(GamePlayerAddons)
78+ g_game.enableFeature(GamePlayerStamina)
79+ g_game.enableFeature(GameNewFluids)
80+ g_game.enableFeature(GameMessageLevel)
81+ g_game.enableFeature(GamePlayerStateU16)
82+ g_game.enableFeature(GameNewOutfitProtocol)
83+ end
84+
85+ if(version >= 790) then
86+ g_game.enableFeature(GameWritableDate)
87+ end
88+
89+ if(version >= 840) then
90+ g_game.enableFeature(GameProtocolChecksum)
91+ g_game.enableFeature(GameAccountNames)
92+ g_game.enableFeature(GameDoubleFreeCapacity)
93+ end
94+
95+ if(version >= 841) then
96+ g_game.enableFeature(GameChallengeOnLogin)
97+ g_game.enableFeature(GameMessageSizeCheck)
98+ g_game.enableFeature(GameTileAddThingWithStackpos)
99+ end
100+
101+ if(version >= 854) then
102+ g_game.enableFeature(GameCreatureEmblems)
103+ end
104+
105+ if(version >= 860) then
106+ g_game.enableFeature(GameAttackSeq)
107+ end
108+
109+ if(version >= 862) then
110+ g_game.enableFeature(GamePenalityOnDeath)
111+ end
112+
113+ if(version >= 870) then
114+ g_game.enableFeature(GameDoubleExperience)
115+ g_game.enableFeature(GamePlayerMounts)
116+ g_game.enableFeature(GameSpellList)
117+ end
118+
119+ if(version >= 910) then
120+ g_game.enableFeature(GameNameOnNpcTrade)
121+ g_game.enableFeature(GameTotalCapacity)
122+ g_game.enableFeature(GameSkillsBase)
123+ g_game.enableFeature(GamePlayerRegenerationTime)
124+ g_game.enableFeature(GameChannelPlayerList)
125+ g_game.enableFeature(GameEnvironmentEffect)
126+ g_game.enableFeature(GameItemAnimationPhase)
127+ end
128+
129+ if(version >= 940) then
130+ g_game.enableFeature(GamePlayerMarket)
131+ end
132+
133+ if(version >= 953) then
134+ g_game.enableFeature(GamePurseSlot)
135+ g_game.enableFeature(GameClientPing)
136+ end
137+
138+ if(version >= 960) then
139+ g_game.enableFeature(GameSpritesU32)
140+ g_game.enableFeature(GameOfflineTrainingTime)
141+ end
142+
143+ if(version >= 963) then
144+ g_game.enableFeature(GameAdditionalVipInfo)
145+ end
146+
147+ if(version >= 972) then
148+ g_game.enableFeature(GameDoublePlayerGoodsMoney)
149+ end
150+
151+ if(version >= 980) then
152+ g_game.enableFeature(GamePreviewState)
153+ g_game.enableFeature(GameClientVersion)
154+ end
155+
156+ if(version >= 981) then
157+ g_game.enableFeature(GameLoginPending)
158+ g_game.enableFeature(GameNewSpeedLaw)
159+ end
160+
161+ if(version >= 984) then
162+ g_game.enableFeature(GameContainerPagination)
163+ g_game.enableFeature(GameBrowseField)
164+ end
165+
166+ if(version >= 1000) then
167+ g_game.enableFeature(GameThingMarks)
168+ g_game.enableFeature(GamePVPMode)
169+ end
170+
171+ if(version >= 1035) then
172+ g_game.enableFeature(GameDoubleSkills)
173+ g_game.enableFeature(GameBaseSkillU16)
174+ end
175+
176+ if(version >= 1036) then
177+ g_game.enableFeature(GameCreatureIcons)
178+ g_game.enableFeature(GameHideNpcNames)
179+ end
180+
181+ if(version >= 1038) then
182+ g_game.enableFeature(GamePremiumExpiration)
183+ end
184+
185+ if(version >= 1050) then
186+ g_game.enableFeature(GameEnhancedAnimations)
187+ end
188+
189+ if(version >= 1053) then
190+ g_game.enableFeature(GameUnjustifiedPoints)
191+ end
192+
193+ if(version >= 1054) then
194+ g_game.enableFeature(GameExperienceBonus)
195+ end
196+
197+ if(version >= 1055) then
198+ g_game.enableFeature(GameDeathType)
199+ end
200+
201+ if(version >= 1057) then
202+ g_game.enableFeature(GameIdleAnimations)
203+ end
204+
205+ if(version >= 1061) then
206+ g_game.enableFeature(GameOGLInformation)
207+ end
208+
209+ if(version >= 1071) then
210+ g_game.enableFeature(GameContentRevision)
211+ end
212+
213+ if(version >= 1072) then
214+ g_game.enableFeature(GameAuthenticator)
215+ end
216+
217+ if(version >= 1074) then
218+ g_game.enableFeature(GameSessionKey)
219+ end
220+
221+ if(version >= 1080) then
222+ g_game.enableFeature(GameIngameStore)
223+ end
224+
225+ if(version >= 1092) then
226+ g_game.enableFeature(GameIngameStoreServiceType)
227+ end
228+
229+ if(version >= 1093) then
230+ g_game.enableFeature(GameIngameStoreHighlights)
231+ end
232+
233+ if(version >= 1094) then
234+ g_game.enableFeature(GameAdditionalSkills)
235+ end
236+
237+ if(version >= 1100) then
238+ g_game.enableFeature(GamePrey)
239+ end
240+
241+ if(version >= 1200) then
242+ g_game.enableFeature(GameSequencedPackets)
243+ --g_game.enableFeature(GameSendWorldName)
244+ g_game.enableFeature(GamePlayerStateU32)
245+ g_game.enableFeature(GameTibia12Protocol)
246+ end
247+
248+ modules.game_things.load()
249+end
A RD_Client/modules/game_features/features.otmod +8-0 View file
@@ -0,0 +1,8 @@
1+Module
2+ name: game_features
3+ description: Manager game features
4+ reloadable: false
5+ sandboxed: true
6+ scripts: [features]
7+ @onLoad: init()
8+ @onUnload: terminate()
A RD_Client/modules/game_guildTitle/guildTitle.lua +62-0 View file
@@ -0,0 +1,62 @@
1+
2+local titleFont = "verdana-11px-rounded"
3+local OPCODE = 134
4+function init()
5+ connect(Creature, {
6+ onAppear = requestData,
7+
8+ })
9+ ProtocolGame.registerExtendedOpcode(OPCODE, handleData)
10+end
11+
12+function terminate()
13+
14+disconnect(Creature, {
15+ onAppear = requestData,
16+ })
17+ ProtocolGame.unregisterExtendedOpcode(OPCODE, handleData)
18+end
19+
20+
21+function requestData(creature)
22+if creature:isPlayer() then
23+ local tbl = {
24+ creature = creature:getId()
25+ }
26+ local protocolGame = g_game.getProtocolGame()
27+ if protocolGame then
28+ protocolGame.sendExtendedOpcode(protocolGame,OPCODE, json.encode(tbl))
29+ end
30+end
31+end
32+
33+function handleData(protocol, code, buffer)
34+ local json_status, json_data = pcall(function ()
35+ return json.decode(buffer)
36+ end)
37+
38+ if not json_status then
39+ g_logger.error("JSON error: " .. json_data)
40+ return false
41+ end
42+
43+ local data = json_data
44+ local response = json_data.response
45+ if data ~= nil then
46+ if response == "SetGuildNick" then
47+ updateTitle(data.creatureId, data.guildNick)
48+ elseif response == "SetGuildName" then
49+ updateTitle(data.creatureId, data.guildName)
50+ end
51+end
52+
53+return
54+end
55+
56+function updateTitle(creatureId, guildName)
57+ local target = g_map.getCreatureById(creatureId)
58+ if target then
59+ target:setTitle(guildName, titleFont,"#fdf3cd")
60+ end
61+ return
62+end
A RD_Client/modules/game_guildTitle/guildTitle.otmod +11-0 View file
@@ -0,0 +1,11 @@
1+Module
2+ name: game_guildTitle
3+ description: Guild Titles for Players
4+ author: Klank
5+ website: none
6+ sandboxed: true
7+ autoload: true
8+ autoload-priority: 1000
9+ scripts: [ guildTitle.lua ]
10+ @onLoad: init()
11+ @onUnload: terminate()
A RD_Client/modules/game_hotkeys/hotkeys_extra.lua +116-0 View file
@@ -0,0 +1,116 @@
1+extraHotkeys = {}
2+
3+function addExtraHotkey(name, description, callback)
4+ table.insert(extraHotkeys, {
5+ name = name:lower(),
6+ description = tr(description),
7+ callback = callback
8+ })
9+
10+end
11+
12+function setupExtraHotkeys(combobox)
13+ addExtraHotkey("none", "None", nil)
14+ addExtraHotkey("cancelAttack", "Stop attacking", function(repeated)
15+ if not repeated then
16+ g_game.attack(nil)
17+ end
18+ end)
19+ if combobox == 01 then
20+ --addExtraHotkey("attackNext", "Attack next target from battle list", function(repeated)
21+ if repeated or not modules.game_battle then
22+ return
23+ end
24+ local battlePanel = modules.game_battle.battlePanel
25+ local attackedCreature = g_game.getAttackingCreature()
26+ local nextChild = nil
27+ for i, child in ipairs(battlePanel:getChildren()) do
28+ if not child.creature or not child:isOn() then
29+ break
30+ end
31+ if child.creature ~= attackedCreature then
32+ nextChild = child
33+ nextChild = battlePanel:getFirstChild()
34+ g_game.attack(nextChild.creature)
35+ break
36+ else
37+ g_game.attack(nil)
38+ break
39+ end
40+ end
41+ return
42+ end
43+ --end)
44+
45+ addExtraHotkey("attackPrevious", "Attack previous target from battle list", function(repeated)
46+ if repeated or not modules.game_battle then
47+ return
48+ end
49+ local battlePanel = modules.game_battle.battlePanel
50+ local attackedCreature = g_game.getAttackingCreature()
51+ local prevChild = nil
52+ for i, child in ipairs(battlePanel:getChildren()) do
53+ if not child.creature or not child:isOn() then
54+ break
55+ end
56+ if child.creature == attackedCreature then
57+ break
58+ end
59+ prevChild = child
60+ end
61+ if prevChild and prevChild.creature ~= attackedCreature then
62+ g_game.attack(prevChild.creature)
63+ end
64+ end)
65+
66+ addExtraHotkey("toogleWsad", "Enable/disable wsad walking", function(repeated)
67+ if repeated or not modules.game_console then
68+ return
69+ end
70+ if not modules.game_console.consoleToggleChat:isChecked() then
71+ modules.game_console.disableChat(true)
72+ else
73+ modules.game_console.enableChat(true)
74+ end
75+ end)
76+
77+ for index, actionDetails in ipairs(extraHotkeys) do
78+ --combobox:addOption(actionDetails.description)
79+ end
80+end
81+
82+function executeExtraHotkey(action, repeated)
83+ action = action:lower()
84+ for index, actionDetails in ipairs(extraHotkeys) do
85+ if actionDetails.name == action and actionDetails.callback then
86+ actionDetails.callback(repeated)
87+ end
88+ end
89+end
90+
91+function translateActionToActionComboboxIndex(action)
92+ action = action:lower()
93+ for index, actionDetails in ipairs(extraHotkeys) do
94+ if actionDetails.name == action then
95+ return index
96+ end
97+ end
98+ return 1
99+end
100+
101+function translateActionComboboxIndexToAction(index)
102+ if index > 1 and index <= #extraHotkeys then
103+ return extraHotkeys[index].name
104+ end
105+ return nil
106+end
107+
108+function getActionDescription(action)
109+ action = action:lower()
110+ for index, actionDetails in ipairs(extraHotkeys) do
111+ if actionDetails.name == action then
112+ return actionDetails.description
113+ end
114+ end
115+ return "invalid action"
116+end
Top