Skip to content

Commit 7f84fa7

Browse files
committed
Merge branch 'master' into rebalance
2 parents e79c535 + 5f7eaa4 commit 7f84fa7

File tree

18 files changed

+890
-129
lines changed

18 files changed

+890
-129
lines changed

CHANGELOG.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,24 @@ All these changes only affect Renewal. Pre-renewal is unchanged.
369369
- Rebalance of `RG_PLAGIARISM` (Intimidate)
370370
- Also increases Attack Speed by `1%` per Skill Level
371371

372+
## [v2024.06] `June 2024`
373+
374+
### Added
375+
376+
- Added the `mesnavigation()` script command, to generate navi tags valid for the current packetver. (#3300)
377+
- Added the `mesmobspawn()` script command, to generate navi tags valid for the current packetver. (#3300)
378+
- Added the `mesurl()` script command, to generate clickable URL tags valid for the current packetver. (#3300)
379+
- Added the `mestipbox()` script command, to generate tipbox tags valid for the current packetver. (#3300)
380+
381+
### Changed
382+
383+
- Refactored the Plagiarism/Reproduce skill tracking logic and removed some code duplication. (part of #3298)
384+
- Replaced the use of hardcoded `<NAVI>` tags in scripts with `mesnavigation()` calls. (#3300)
385+
386+
### Fixed
387+
388+
- Fixed the copy of one's own skills via Plagiarim or Reproduce causing the skill and its requirements to be deleted. (#3298, issue #3289)
389+
372390
## [v2024.05] `May 2024`
373391

374392
### Changed
@@ -3450,6 +3468,8 @@ Note: everything included in this release is part of PR #3198 which consists of
34503468
- New versioning scheme and project changelogs/release notes (#1853)
34513469

34523470
[Unreleased]: https://github.com/HerculesWS/Hercules/compare/stable...master
3471+
[v2024.06]: https://github.com/HerculesWS/Hercules/compare/v2024.05...v2024.06
3472+
[v2024.05]: https://github.com/HerculesWS/Hercules/compare/v2024.04...v2024.05
34533473
[v2024.04]: https://github.com/HerculesWS/Hercules/compare/v2024.03...v2024.04
34543474
[v2024.03]: https://github.com/HerculesWS/Hercules/compare/v2024.02...v2024.03
34553475
[v2024.02]: https://github.com/HerculesWS/Hercules/compare/v2023.12...v2024.02

doc/constants_pre-re.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4880,7 +4880,7 @@
48804880
### Server defines
48814881

48824882
- `PACKETVER`: 20190530
4883-
- `HERCULES_VERSION`: 202405000
4883+
- `HERCULES_VERSION`: 202406000
48844884
- `MAX_LEVEL`: 175
48854885
- `MAX_STORAGE`: 600
48864886
- `MAX_GUILD_STORAGE`: 500

doc/constants_re.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4878,7 +4878,7 @@
48784878
### Server defines
48794879

48804880
- `PACKETVER`: 20190530
4881-
- `HERCULES_VERSION`: 202405000
4881+
- `HERCULES_VERSION`: 202406000
48824882
- `MAX_LEVEL`: 175
48834883
- `MAX_STORAGE`: 600
48844884
- `MAX_GUILD_STORAGE`: 500

doc/script_commands.txt

Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2612,6 +2612,140 @@ deleted.
26122612
// This would delete all elements of the array
26132613
deletearray(.@array);
26142614

2615+
---------------------------------------
2616+
//=====================================
2617+
1.1 - Message formatting commands (tags)
2618+
//=====================================
2619+
---------------------------------------
2620+
2621+
*mesnavigation("<label>", "<map>"{, <x>{, <y>{, <show_window>{, <mode>{, <services_flag>{, <monster_id>}}}}}});
2622+
2623+
Generates and returns a <NAVI> tag with the given parameters. A <NAVI> tag when written to certain windows,
2624+
such as the one from "mes" command, will create a highlighted and clickable text, which when clicked,
2625+
starts the navigation system for the specified values.
2626+
2627+
It is important to note that for most "<modes>" values, it is expected that your client has proper navigation
2628+
files which includes the target NPC/monster, or they will fail.
2629+
2630+
If the current client doesn't support NAVI tags, returns a fall back text which generally looks like:
2631+
<label> (<map_name> <x>, <y>)
2632+
2633+
Parameters:
2634+
- label: (string, required)
2635+
The visible and clickable text. (example: "Hat maker")
2636+
2637+
- map: (string, required)
2638+
Target map name. (example: "prontera")
2639+
Note: when service_flag is NAV_WINDOW_SEARCH (-222) this becomes the search string.
2640+
2641+
- x: (int, optional, defaults to 0)
2642+
Target map X position
2643+
Note: does nothing when used with modes NAV_MODE_MAP or NAV_MODE_MOB
2644+
2645+
- y: (int, optional, defaults to 0)
2646+
Target map Y position
2647+
Note: does nothing when used with modes NAV_MODE_MAP or NAV_MODE_MOB
2648+
2649+
- show_window: (bool, optional, defaults to false)
2650+
Whether to open the navigation UI (true) or not (false) when clicking the label.
2651+
2652+
- mode: (int, optional, defaults to NAV_MODE_ALL (0))
2653+
The kind of navigation being performed. This mainly affects the messages shown by the client when you reach the map.
2654+
- NAV_MODE_ALL (0): "You have reached your destination"
2655+
- NAV_MODE_MAP (1): "You have reached the target map"
2656+
- NAV_MODE_NPC (2): "You have reached the map the NPC is at" / "You have reached the target NPC"
2657+
- NAV_MODE_MOB (3): "You have reached the map where the monster appears"
2658+
2659+
Notes:
2660+
- NAV_MODE_NPC requires client navigation files to have a NPC in the exact position or an error is shown
2661+
- NAV_MODE_MOB requires client navigation files to have <monster_id> spawn in the given map or an error is shown.
2662+
2663+
- services_flag: (int, optional, defaults to NAV_KAFRA_AND_AIRSHIP (101))
2664+
The kinds of services that may be used when calculating the route.
2665+
2666+
The following values may be summed up:
2667+
- NAV_AIRSHIP_ONLY (1): Include airships
2668+
- NAV_SCROLL_ONLY (10): Include scrolls
2669+
- NAV_KAFRA_ONLY (100): Include kafras
2670+
2671+
Summed values:
2672+
- NAV_AIRSHIP_AND_SCROLL (11)
2673+
- NAV_KAFRA_AND_AIRSHIP (101)
2674+
- NAV_KAFRA_AND_SCROLL (110)
2675+
- NAV_ALL (111)
2676+
2677+
Special values:
2678+
- NAV_WINDOW_SEARCH (-222)
2679+
This is a special value that can't be summed with others and when used,
2680+
"map" becomes a search string in the navigation UI. And client performs a search
2681+
with the special keyword "$$DB".
2682+
It is only known to work together with mode = NAV_MODE_MOB and using monster Sprite Name
2683+
as "map".
2684+
When using NAV_WINDOW_SEARCH, prefer using mesmobspawn instead.
2685+
2686+
- monster_id: (int, optional, defaults to 0)
2687+
To be used with mode = NAV_MODE_MOB. The ID of the monster being looked for.
2688+
2689+
---------------------------------------
2690+
2691+
*mesmobspawn(<monster_id>{, "<label>"})
2692+
2693+
Generates and returns a <NAVI> tag that opens the Navigation UI listing the places where <monster_id> monster spawns.
2694+
2695+
This will only work if your client navigation files are properly configured with the <monster_id> spawns.
2696+
2697+
If the current client doesn't support this feature, returns the value of <label>.
2698+
2699+
Parameters:
2700+
- monster_id: (int, required)
2701+
The ID of the monster being looked for.
2702+
2703+
- label: (string, optional, defaults to <monster_id> name)
2704+
The visible and clickable text. (example: "Target monster")
2705+
2706+
---------------------------------------
2707+
2708+
*mesurl("<label>", "url"{, <width>, <height>})
2709+
2710+
Generates and returns a <URL> tag. When presented in certain places (like with "mes" and "mesf"),
2711+
this will display a clickable text (<label>) which when clicked, opens <url> in the in-game browser
2712+
or default browser (depending on client version).
2713+
2714+
If the current client doesn't support this feature, returns a basic string in the following format:
2715+
<label> (<url>)
2716+
2717+
Parameters:
2718+
- label: (string, required)
2719+
The visible and clickable text. (example: "My site")
2720+
2721+
- url: (string, required)
2722+
The site that will open when <label> is clicked
2723+
2724+
- width: (int, optional, defaults to -1)
2725+
The width of the browser window (when using in-game browser).
2726+
When not provided (or -1), width/height is not specified.
2727+
2728+
- height: (int, optional, defaults to -1)
2729+
The height of the browser window (when using in-game browser).
2730+
When not provided (or -1), width/height is not specified.
2731+
2732+
---------------------------------------
2733+
2734+
*mestipbox("<label>", <tip_id>)
2735+
2736+
Generates and returns a <TIPBOX> tag. When presented in certain places (like with "mes" and "mesf"),
2737+
this will display a clickable text (<label>) which when clicked, opens the TipBox UI with the given <tip_id>.
2738+
2739+
If the current client doesn't support this feature, returns a simple string with "<label>"
2740+
2741+
Parameters:
2742+
- label: (string, required)
2743+
The visible and clickable text. (example: "Super Tip")
2744+
2745+
- tip_id: (int, required)
2746+
The tip ID (as set in TipBox lua file)
2747+
If 0, it shows a random tipbox
2748+
26152749
---------------------------------------
26162750
//=====================================
26172751
1 - End of Basic-Related Commands

npc/dev/test.txt

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,113 @@ function script F_TestGetItemLink_FullWeapon {
261261
return .@pass;
262262
}
263263

264+
function script F_TestMesNavigation_Basic {
265+
.@str$ = mesnavigation("Somewhere", "prt_fild08", 100, 105);
266+
267+
.@pass = false;
268+
if (PACKETVER < 20111010) {
269+
.@pass = (.@str$ == "Somewhere (prt_fild08 100, 105)");
270+
} else {
271+
.@pass = (.@str$ == "<NAVI>Somewhere<INFO>prt_fild08,100,105,</INFO></NAVI>");
272+
}
273+
274+
return .@pass;
275+
}
276+
277+
function script F_TestMesNavigation_Complete {
278+
.@str$ = mesnavigation("Some NPC", "prt_fild08", 175, 370, true, NAV_MODE_ALL, NAV_NONE);
279+
280+
.@pass = false;
281+
if (PACKETVER < 20111010) {
282+
.@pass = (.@str$ == "Some NPC (prt_fild08 175, 370)");
283+
} else {
284+
.@pass = (.@str$ == "<NAVI>Some NPC<INFO>prt_fild08,175,370,0,0,1,0</INFO></NAVI>");
285+
}
286+
287+
return .@pass;
288+
}
289+
290+
function script F_TestMesNavigation_Search {
291+
.@str$ = mesnavigation("Some Monster", "PORING", 0, 0, true, NAV_MODE_MOB, NAV_WINDOW_SEARCH);
292+
293+
.@pass = false;
294+
if (PACKETVER < 20130800) {
295+
.@pass = (.@str$ == "Some Monster");
296+
} else {
297+
.@pass = (.@str$ == "<NAVI>Some Monster<INFO>PORING,0,0,3,-222</INFO></NAVI>");
298+
}
299+
300+
return .@pass;
301+
}
302+
303+
function script F_TestMesMobSpawn_Basic {
304+
.@str$ = mesmobspawn(PORING);
305+
306+
.@pass = false;
307+
if (PACKETVER < 20130800) {
308+
.@pass = (.@str$ == "Poring");
309+
} else {
310+
.@pass = (.@str$ == "<NAVI>Poring<INFO>PORING,0,0,3,-222</INFO></NAVI>");
311+
}
312+
313+
return .@pass;
314+
}
315+
316+
function script F_TestMesMobSpawn_WithLabel {
317+
.@str$ = mesmobspawn(PORING, "Target");
318+
319+
.@pass = false;
320+
if (PACKETVER < 20130800) {
321+
.@pass = (.@str$ == "Target");
322+
} else {
323+
.@pass = (.@str$ == "<NAVI>Target<INFO>PORING,0,0,3,-222</INFO></NAVI>");
324+
}
325+
326+
return .@pass;
327+
}
328+
329+
function script F_TestMesUrl_Basic {
330+
.@str$ = mesurl("Herc", "https://herc.ws/");
331+
332+
.@pass = false;
333+
if (PACKETVER < 20111010) {
334+
.@pass = (.@str$ == "Herc (URL: https://herc.ws/)");
335+
} else {
336+
.@pass = (.@str$ == "<URL>Herc<INFO>https://herc.ws/</INFO></URL>");
337+
}
338+
339+
return .@pass;
340+
}
341+
342+
function script F_TestMesUrl_Dimensions {
343+
.@str$ = mesurl("Herc", "https://herc.ws/", 800, 600);
344+
345+
.@pass = false;
346+
if (PACKETVER < 20111010) {
347+
.@pass = (.@str$ == "Herc (URL: https://herc.ws/)");
348+
} else if (PACKETVER < 20181024) {
349+
.@pass = (.@str$ == "<URL>Herc<INFO>https://herc.ws/,800,600</INFO></URL>");
350+
} else {
351+
// dimensions are no longer supported since it now uses users' default browser.
352+
.@pass = (.@str$ == "<URL>Herc<INFO>https://herc.ws/</INFO></URL>");
353+
}
354+
355+
return .@pass;
356+
}
357+
358+
function script F_TestMesTipBox {
359+
.@str$ = mestipbox("Some tip", 1);
360+
361+
.@pass = false;
362+
if (PACKETVER < 20170712) {
363+
.@pass = (.@str$ == "Some tip");
364+
} else {
365+
.@pass = (.@str$ == "<TIPBOX>Some tip<INFO>1</INFO></TIPBOX>");
366+
}
367+
368+
return .@pass;
369+
}
370+
264371
function script HerculesSelfTestHelper {
265372
if (.once > 0)
266373
return .errors;
@@ -978,6 +1085,18 @@ function script HerculesSelfTestHelper {
9781085
callsub(OnCheck, "getitemlink: basic weapon tag", F_TestGetItemLink_BaseWeapon(), true);
9791086
callsub(OnCheck, "getitemlink: complete weapon tag", F_TestGetItemLink_FullWeapon(), true);
9801087

1088+
callsub(OnCheck, "mesnavigation: basic destination", F_TestMesNavigation_Basic(), true);
1089+
callsub(OnCheck, "mesnavigation: all params", F_TestMesNavigation_Complete(), true);
1090+
callsub(OnCheck, "mesnavigation: monster spawn search", F_TestMesNavigation_Search(), true);
1091+
1092+
callsub(OnCheck, "mesmobspawn: basic usage", F_TestMesMobSpawn_Basic(), true);
1093+
callsub(OnCheck, "mesmobspawn: with label", F_TestMesMobSpawn_WithLabel(), true);
1094+
1095+
callsub(OnCheck, "mesurl: basic usage", F_TestMesUrl_Basic(), true);
1096+
callsub(OnCheck, "mesurl: with dimensions", F_TestMesUrl_Dimensions(), true);
1097+
1098+
callsub(OnCheck, "mestipbox", F_TestMesTipBox(), true);
1099+
9811100
if (.errors) {
9821101
consolemes(CONSOLEMES_DEBUG, "Script engine self-test [ \033[0;31mFAILED\033[0m ]");
9831102
consolemes(CONSOLEMES_DEBUG, "**** The test was completed with " + .errors + " errors. ****");

0 commit comments

Comments
 (0)