|
@@ -11325,18 +11325,29 @@ BUILDIN_FUNC(sc_end)
|
|
|
|
|
|
/**
|
|
/**
|
|
* Ends all status effects from any learned skill on the attached player.
|
|
* Ends all status effects from any learned skill on the attached player.
|
|
- * sc_end_class {<char_id>};
|
|
|
|
|
|
+ * if <job_id> was given it will end the effect of that class for the attached player
|
|
|
|
+ * sc_end_class {<char_id>{,<job_id>}};
|
|
*/
|
|
*/
|
|
BUILDIN_FUNC(sc_end_class)
|
|
BUILDIN_FUNC(sc_end_class)
|
|
{
|
|
{
|
|
struct map_session_data *sd;
|
|
struct map_session_data *sd;
|
|
uint16 skill_id;
|
|
uint16 skill_id;
|
|
- int i;
|
|
|
|
|
|
+ int class_;
|
|
|
|
|
|
if (!script_charid2sd(2, sd))
|
|
if (!script_charid2sd(2, sd))
|
|
return SCRIPT_CMD_FAILURE;
|
|
return SCRIPT_CMD_FAILURE;
|
|
|
|
|
|
- for (i = 0; i < MAX_SKILL_TREE && (skill_id = skill_tree[pc_class2idx(sd->status.class_)][i].skill_id) > 0; i++) { // Remove status specific to your current tree skills.
|
|
|
|
|
|
+ if (script_hasdata(st, 3))
|
|
|
|
+ class_ = script_getnum(st, 3);
|
|
|
|
+ else
|
|
|
|
+ class_ = sd->status.class_;
|
|
|
|
+
|
|
|
|
+ if (!pcdb_checkid(class_)) {
|
|
|
|
+ ShowError("buildin_sc_end_class: Invalid job ID '%d' given.\n", script_getnum(st, 3));
|
|
|
|
+ return SCRIPT_CMD_FAILURE;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ for (int i = 0; i < MAX_SKILL_TREE && (skill_id = skill_tree[pc_class2idx(class_)][i].skill_id) > 0; i++) {
|
|
enum sc_type sc = status_skill2sc(skill_id);
|
|
enum sc_type sc = status_skill2sc(skill_id);
|
|
|
|
|
|
if (sc > SC_COMMON_MAX && sd->sc.data[sc])
|
|
if (sc > SC_COMMON_MAX && sd->sc.data[sc])
|
|
@@ -23882,7 +23893,7 @@ struct script_function buildin_func[] = {
|
|
BUILDIN_DEF2(sc_start,"sc_start2","iiii???"),
|
|
BUILDIN_DEF2(sc_start,"sc_start2","iiii???"),
|
|
BUILDIN_DEF2(sc_start,"sc_start4","iiiiii???"),
|
|
BUILDIN_DEF2(sc_start,"sc_start4","iiiiii???"),
|
|
BUILDIN_DEF(sc_end,"i?"),
|
|
BUILDIN_DEF(sc_end,"i?"),
|
|
- BUILDIN_DEF(sc_end_class,"?"),
|
|
|
|
|
|
+ BUILDIN_DEF(sc_end_class,"??"),
|
|
BUILDIN_DEF(getstatus, "i??"),
|
|
BUILDIN_DEF(getstatus, "i??"),
|
|
BUILDIN_DEF(getscrate,"ii?"),
|
|
BUILDIN_DEF(getscrate,"ii?"),
|
|
BUILDIN_DEF(debugmes,"s"),
|
|
BUILDIN_DEF(debugmes,"s"),
|