Updated geteleminfo script command (#8168)

* Updated geteleminfo script command
* Added a new <type> "2" that returns the class ID of the elemental spirit
* Fixed Dimensions Elemental* combos: item descriptions require high elemental spirit check
* Added new constants for geteleminfo

Thanks to @aleos89 @Badarosk0 !
This commit is contained in:
Atemo 2024-03-14 14:08:45 +01:00 committed by GitHub
parent 872e31cc8d
commit a768af85ee
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 34 additions and 11 deletions

View File

@ -46814,7 +46814,8 @@ Body:
bonus2 bSkillAtk,"EM_ELEMENTAL_BUSTER_WIND",2*.@sum; bonus2 bSkillAtk,"EM_ELEMENTAL_BUSTER_WIND",2*.@sum;
bonus2 bSkillAtk,"EM_ELEMENTAL_BUSTER_POISON",2*.@sum; bonus2 bSkillAtk,"EM_ELEMENTAL_BUSTER_POISON",2*.@sum;
bonus2 bSkillAtk,"EM_ELEMENTAL_BUSTER_GROUND",2*.@sum; bonus2 bSkillAtk,"EM_ELEMENTAL_BUSTER_GROUND",2*.@sum;
if (getskilllv("EM_ELEMENTAL_BUSTER") > 0) { .@class_ = geteleminfo(ELEMINFO_CLASS);
if (getskilllv("EM_ELEMENTAL_BUSTER") > 0 && .@class_ >= 20816 && .@class_ <= 20820) {
bonus4 bAutoSpellOnSkill,"EM_DIAMOND_STORM","EM_ELEMENTAL_BUSTER",getskilllv("EM_ELEMENTAL_BUSTER"),1000; bonus4 bAutoSpellOnSkill,"EM_DIAMOND_STORM","EM_ELEMENTAL_BUSTER",getskilllv("EM_ELEMENTAL_BUSTER"),1000;
} }
} }
@ -46835,7 +46836,8 @@ Body:
bonus2 bSkillAtk,"EM_ELEMENTAL_BUSTER_WIND",2*.@sum; bonus2 bSkillAtk,"EM_ELEMENTAL_BUSTER_WIND",2*.@sum;
bonus2 bSkillAtk,"EM_ELEMENTAL_BUSTER_POISON",2*.@sum; bonus2 bSkillAtk,"EM_ELEMENTAL_BUSTER_POISON",2*.@sum;
bonus2 bSkillAtk,"EM_ELEMENTAL_BUSTER_GROUND",2*.@sum; bonus2 bSkillAtk,"EM_ELEMENTAL_BUSTER_GROUND",2*.@sum;
if (getskilllv("EM_ELEMENTAL_BUSTER") > 0 && geteleminfo(0) > 0) { .@class_ = geteleminfo(ELEMINFO_CLASS);
if (getskilllv("EM_ELEMENTAL_BUSTER") > 0 && .@class_ >= 20816 && .@class_ <= 20820) {
bonus4 bAutoSpellOnSkill,"EM_TERRA_DRIVE","EM_ELEMENTAL_BUSTER",getskilllv("EM_ELEMENTAL_BUSTER"),1000; bonus4 bAutoSpellOnSkill,"EM_TERRA_DRIVE","EM_ELEMENTAL_BUSTER",getskilllv("EM_ELEMENTAL_BUSTER"),1000;
} }
} }

View File

@ -8966,8 +8966,9 @@ Get info of elemental of attached player or player by char_id.
Other info can be obtained by 'getunitdata' command. Other info can be obtained by 'getunitdata' command.
Valid types are: Valid types are:
0: Elemental ID ELEMINFO_ID Elemental ID (ID unique to elementals unit type)
1: Elemental Game ID ELEMINFO_GAMEID Elemental Game ID
ELEMINFO_CLASS Elemental Class (ID defined in elemental_db.yml)
--------------------------------------- ---------------------------------------
\\ \\

View File

@ -24038,24 +24038,32 @@ BUILDIN_FUNC(ignoretimeout)
* geteleminfo <type>{,<char_id>}; * geteleminfo <type>{,<char_id>};
**/ **/
BUILDIN_FUNC(geteleminfo) { BUILDIN_FUNC(geteleminfo) {
TBL_ELEM *ed = NULL; map_session_data *sd = nullptr;
TBL_PC *sd = NULL;
int type = script_getnum(st,2);
if (!script_charid2sd(3, sd)) { if (!script_charid2sd(3, sd)) {
script_pushint(st, 0); script_pushint(st, 0);
return SCRIPT_CMD_SUCCESS; return SCRIPT_CMD_FAILURE;
} }
s_elemental_data *ed = nullptr;
if (!(ed = sd->ed)) { if (!(ed = sd->ed)) {
//ShowDebug("buildin_geteleminfo: Player doesn't have Elemental.\n");
script_pushint(st, 0); script_pushint(st, 0);
return SCRIPT_CMD_SUCCESS; return SCRIPT_CMD_SUCCESS;
} }
int type = script_getnum(st,2);
switch (type) { switch (type) {
case 0: script_pushint(st, ed->elemental.elemental_id); break; case ELEMINFO_ID:
case 1: script_pushint(st, ed->bl.id); break; script_pushint(st, ed->elemental.elemental_id);
break;
case ELEMINFO_GAMEID:
script_pushint(st, ed->bl.id);
break;
case ELEMINFO_CLASS:
script_pushint(st, ed->elemental.class_);
break;
default: default:
ShowError("buildin_geteleminfo: Invalid type '%d'.\n", type); ShowError("buildin_geteleminfo: Invalid type '%d'.\n", type);
script_pushint(st, 0); script_pushint(st, 0);

View File

@ -2185,6 +2185,13 @@ enum e_iteminfo : uint8 {
ITEMINFO_SUBTYPE, ITEMINFO_SUBTYPE,
}; };
/* geteleminfo script command */
enum e_eleminfo : uint8 {
ELEMINFO_ID = 0,
ELEMINFO_GAMEID,
ELEMINFO_CLASS,
};
class ConstantDatabase : public YamlDatabase { class ConstantDatabase : public YamlDatabase {
public: public:
ConstantDatabase() : YamlDatabase("CONSTANT_DB", 1) { ConstantDatabase() : YamlDatabase("CONSTANT_DB", 1) {

View File

@ -10196,6 +10196,11 @@
export_constant(ITEMINFO_ARMORLEVEL); export_constant(ITEMINFO_ARMORLEVEL);
export_constant(ITEMINFO_SUBTYPE); export_constant(ITEMINFO_SUBTYPE);
/* geteleminfo script command */
export_constant(ELEMINFO_ID);
export_constant(ELEMINFO_GAMEID);
export_constant(ELEMINFO_CLASS);
/* refine types */ /* refine types */
export_constant(REFINE_TYPE_ARMOR); export_constant(REFINE_TYPE_ARMOR);
export_constant(REFINE_TYPE_WEAPON); export_constant(REFINE_TYPE_WEAPON);