Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial release of the refine UI #2494

Open
wants to merge 21 commits into
base: master
from
Open
Changes from 2 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
82217a4
Initial release of the refine UI
Lemongrass3110 Oct 9, 2017
b9858f7
Added a missing index check
Lemongrass3110 Oct 9, 2017
ed664a3
Added a logic check for the feature configuration
Lemongrass3110 Oct 9, 2017
0a2d6c1
Added a feature check for existing refiners
Lemongrass3110 Oct 9, 2017
db82c45
Added downgrade logic
Lemongrass3110 Oct 9, 2017
d50cb66
Sanity check for current refine level
Lemongrass3110 Oct 10, 2017
fe391b0
Fixed Refine UI doesn't update the refine value on downrefine. Thanks…
cydh Oct 10, 2017
9c155ac
Added 'Blacksmith blessing' system in refine npcs (Basta and Mighty h…
Atemo Oct 10, 2017
2f008a5
Updated script accordly @cydh comment
Atemo Oct 13, 2017
7ae8826
Merge branch 'master' into feature/refineui
Lemongrass3110 Oct 24, 2017
0b83ac7
Merge branch 'master' into feature/refineui
aleos89 Nov 3, 2017
0864ba9
Merge branch 'master' into feature/refineui
aleos89 Feb 20, 2018
b532dfe
Corrected an emotion constant
aleos89 Feb 20, 2018
a88f3a6
Merge branch 'master' into feature/refineui
aleos89 Mar 13, 2018
fc61f81
Merge branch 'master' into feature/refineui
Lemongrass3110 Jun 1, 2018
4c80179
Merge branch 'master' into feature/refineui
Lemongrass3110 Jun 14, 2018
01727c1
Merge branch 'master' into feature/refineui
Lemongrass3110 Oct 11, 2018
dc81f71
Merge branch 'master' into feature/refineui
aleos89 Dec 7, 2018
4df192f
Follow up to dc81f71
aleos89 Dec 7, 2018
5345a0e
Merge branch 'master' into feature/refineui
Lemongrass3110 Mar 23, 2019
01e45e6
Merge branch 'master' into feature/refineui
Lemongrass3110 Mar 26, 2019
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.
+476 −18
Diff settings

Always

Just for now

@@ -67,3 +67,10 @@ feature.roulette: off
// Achievement (Note 1)
// Requires: 2015-05-13aRagexe or later
feature.achievement: on

// Refine UI (Note 3)
// Requires: 2016-10-12aRagexeRE or later
// 0 = Disabled
// 1 = Enabled
// 2 = Enabled in existing official scripts (old dialogs were removed and replaced by the UI)
feature.refineui: 0
@@ -831,7 +831,12 @@
// Achievements
772: Achievements are disabled.

//773-899 free
// @refineui
773: This command requires packet version 2016-10-12 or newer.
774: This command is disabled via configuration.
775: You have already opened the refine UI.

//776-899 free

//------------------------------------
// More atcommands message
@@ -1176,6 +1176,14 @@ Adopts the specified player with the attached character as one of the parents.

---------------------------------------

@refineui

Opens the refine user interface.

Note: This command requires packet version 2016-10-12 or newer.

---------------------------------------

@request <message>

Sends a message to all connected GMs (via the GM whisper system).
@@ -2761,7 +2761,15 @@ REFINE_ZENY_COST - Zeny
REFINE_MATERIAL_ID - Material Item ID

This function will return -1 on failure. The function fails if the cost type
is invalid or if there is no item in the equipment slot.
is invalid or if there is no item in the equipment slot.

---------------------------------------

*refineui({<char id>})

Opens the refine UI for the attached player or the given character id.

This feature requires 2016-10-12aRagexeRE or newer.

---------------------------------------

@@ -560,9 +560,20 @@ lhz_in02,282,20,7 script Fulerr 869,{
//= .@safe to the max safe refine in refine_db.txt as well.
//============================================================
function script refinemain {
disable_items;
.@npc_name$ = getarg(0);
.@features = getarg(1);

if( getbattleflag( "feature.refineui" ) == 3 ){

This comment has been minimized.

Copy link
@jenkijo

jenkijo Oct 9, 2017

Contributor

if( getbattleflag( "feature.refineui" ) == 2 ){

This comment has been minimized.

Copy link
@Lemongrass3110

Lemongrass3110 Oct 9, 2017

Author Member

This is fine like this.
1 = enabled in general
2 = enabled in scripts
=> so we want the system to be enabled & enabled in scripts => 3

This comment has been minimized.

Copy link
@jenkijo

jenkijo Oct 9, 2017

Contributor

Okay

This comment has been minimized.

Copy link
@jenkijo

jenkijo Oct 9, 2017

Contributor

When 2 = enabled in scripts is configured, I still can use @refineui

mes "["+ .@npc_name$ +"]";
mes "I've spent a long time refining powerful weapons.";
mes "You are in the presence of 장춰탕넨 [Zhang Zhuangtan]"; // TODO: find a valid translation
mes "Do you want to strengthen your equipment?";
close2;
refineui();
end;
}

disable_items;
mes "["+ .@npc_name$ +"]";
mes "I'm the Armsmith.";
mes "I can refine all kinds of weapons, armor and equipment, so let me";
@@ -9973,6 +9973,35 @@ ACMD_FUNC(adopt)
return -1;
}


/**
* Opens the refineUI
* Usage: @refineui
*/
ACMD_FUNC(refineui)
{
nullpo_retr(-1, sd);

#if PACKETVER < 20161012
clif_displaymessage(fd, msg_txt(sd, 773)); // This command requires packet version 2016-10-12 or newer.
return -1;
#else
if( !battle_config.feature_refineui ){
clif_displaymessage(fd, msg_txt(sd, 774)); // This command is disabled via configuration.
return -1;
}

if( sd->state.refineui_open ){
clif_displaymessage(fd, msg_txt(sd, 775)); // You have already opened the refine UI.
return -1;
}

clif_refineui_open(sd);
return 0;
#endif
}


#include "../custom/atcommand.inc"

/**
@@ -10270,6 +10299,7 @@ void atcommand_basecommands(void) {
ACMD_DEF(adopt),
ACMD_DEF(agitstart3),
ACMD_DEF(agitend3),
ACMD_DEF(refineui),
};
AtCommandInfo* atcommand;
int i;
@@ -8432,6 +8432,7 @@ static const struct _battle_data {
{ "feature.achievement", &battle_config.feature_achievement, 1, 0, 1, },
{ "allow_bound_sell", &battle_config.allow_bound_sell, 1, 0, 1, },
{ "event_refine_chance", &battle_config.event_refine_chance, 0, 0, 1, },
{ "feature.refineui", &battle_config.feature_refineui, 0, 0, 3, },

#include "../custom/battle_config_init.inc"
};
@@ -8562,6 +8563,13 @@ void battle_adjust_conf()
}
#endif

#if PACKETVER < 20161012
if (battle_config.feature_refineui) {
ShowWarning("conf/battle/feature.conf refine UI is enabled but it requires PACKETVER 2016-10-12 or newer, disabling...\n");
battle_config.feature_refineui = 0;
}
#endif

#ifndef CELL_NOSTACK
if (battle_config.custom_cell_stack_limit != 1)
ShowWarning("Battle setting 'custom_cell_stack_limit' takes no effect as this server was compiled without Cell Stack Limit support.\n");
@@ -634,6 +634,7 @@ extern struct Battle_Config
int feature_achievement;
int allow_bound_sell;
int event_refine_chance;
int feature_refineui;

#include "../custom/battle_config_struct.inc"
} battle_config;
Oops, something went wrong.
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.