diff options
author | Haru <haru@dotalux.com> | 2014-10-18 20:16:14 +0200 |
---|---|---|
committer | Haru <haru@dotalux.com> | 2014-10-18 20:17:24 +0200 |
commit | 243f4a871690f53cb9c33406be0b00f9045fcec0 (patch) | |
tree | 8fffe8730fe9553a0986f42d0c46f181757b4bfa /src/map | |
parent | 472bf156f9e84ed2bc22b0728f3e1df972b9d3b3 (diff) | |
download | hercules-243f4a871690f53cb9c33406be0b00f9045fcec0.tar.gz hercules-243f4a871690f53cb9c33406be0b00f9045fcec0.tar.bz2 hercules-243f4a871690f53cb9c33406be0b00f9045fcec0.tar.xz hercules-243f4a871690f53cb9c33406be0b00f9045fcec0.zip |
Revert "Some Quality of Life Changes"
- This reverts commit 4ac673941714032ada6d26fb60936ec510bbe496.
- The commit breaks some legacy code. It'll be pushed again once some
things are fixed.
Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/map')
-rw-r--r-- | src/map/pc.c | 44 | ||||
-rw-r--r-- | src/map/pc.h | 2 | ||||
-rw-r--r-- | src/map/script.c | 107 |
3 files changed, 10 insertions, 143 deletions
diff --git a/src/map/pc.c b/src/map/pc.c index 71860340d..697a24507 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -8163,47 +8163,11 @@ int pc_setfalcon(TBL_PC* sd, int flag) *------------------------------------------*/ int pc_setriding(TBL_PC* sd, int flag) { - if( flag ) - { - // Rune Knight (Dragon) - if( (sd->class_&MAPID_THIRDMASK) == MAPID_RUNE_KNIGHT ) { - if( pc->checkskill(sd, RK_DRAGONTRAINING) ) - pc->setoption(sd, sd->sc.option|flag); - } - // Ranger (Warg) - else if( (sd->class_&MAPID_THIRDMASK) == MAPID_RANGER ) { - if( pc->checkskill(sd, RA_WUGRIDER) ) - pc->setoption(sd,sd->sc.option|OPTION_WUGRIDER); - } - // Mechanic (Mado Gear) - else if( (sd->class_&MAPID_THIRDMASK) == MAPID_MECHANIC ) { - if( pc->checkskill(sd, NC_MADOLICENCE) ) - pc->setoption(sd, sd->sc.option|OPTION_MADOGEAR); - } - // Knight / Crusader (Peco Peco) - else { - if( pc->checkskill(sd, KN_RIDING) ) - pc->setoption(sd, sd->sc.option|OPTION_RIDING); - } - } - else if( pc_isriding(sd) ) - { - // Rune Knight (Dragon) - if( (sd->class_&MAPID_THIRDMASK) == MAPID_RUNE_KNIGHT ) { - pc->setoption(sd, sd->sc.option&~OPTION_DRAGON); - } - // Ranger (Warg) - else if( (sd->class_&MAPID_THIRDMASK) == MAPID_RANGER ) { - pc->setoption(sd,sd->sc.option&~OPTION_WUGRIDER); - } - // Mechanic (Mado Gear) - else if( (sd->class_&MAPID_THIRDMASK) == MAPID_MECHANIC ) { - pc->setoption(sd, sd->sc.option&~OPTION_MADOGEAR); - } - // Knight / Crusaders (Peco Peco) - else { + if( flag ){ + if( pc->checkskill(sd,KN_RIDING) > 0 ) // add peco + pc->setoption(sd, sd->sc.option|OPTION_RIDING); + } else if( pc_isriding(sd) ){ pc->setoption(sd, sd->sc.option&~OPTION_RIDING); - } } return 0; diff --git a/src/map/pc.h b/src/map/pc.h index 6159a8f26..c36704b4f 100644 --- a/src/map/pc.h +++ b/src/map/pc.h @@ -589,7 +589,7 @@ struct map_session_data { #endif #define pc_isfalcon(sd) ( (sd)->sc.option&OPTION_FALCON ) -#define pc_isriding(sd) ( (sd)->sc.option&(OPTION_RIDING|OPTION_DRAGON|OPTION_WUGRIDER|OPTION_MADOGEAR) ) +#define pc_isriding(sd) ( (sd)->sc.option&OPTION_RIDING ) #define pc_isinvisible(sd) ( (sd)->sc.option&OPTION_INVISIBLE ) #define pc_is50overweight(sd) ( (sd)->weight*100 >= (sd)->max_weight*battle->bc->natural_heal_weight_rate ) #define pc_is90overweight(sd) ( (sd)->weight*10 >= (sd)->max_weight*9 ) diff --git a/src/map/script.c b/src/map/script.c index 77b60ddd2..e70c2e10a 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -7658,29 +7658,6 @@ BUILDIN(getbrokenid) } /*========================================== - * getbrokencount - *------------------------------------------*/ -BUILDIN(getbrokencount) -{ - int i, counter = 0; - TBL_PC *sd; - - sd = script->rid2sd(st); - - if( sd == NULL ) - return true; - - for(i = 0; i < MAX_INVENTORY; i++) { - if(sd->status.inventory[i].attribute) - counter++; - } - - script_pushint(st, counter); - - return true; -} - -/*========================================== * repair [Valaris] *------------------------------------------*/ BUILDIN(repair) @@ -8681,7 +8658,7 @@ BUILDIN(checkriding) if( sd == NULL ) return true;// no player attached, report source - if( pc_isriding(sd) ) + if( pc_isriding(sd) || pc_isridingwug(sd) || pc_isridingdragon(sd) ) script_pushint(st, 1); else script_pushint(st, 0); @@ -8700,17 +8677,11 @@ BUILDIN(setriding) TBL_PC* sd; sd = script->rid2sd(st); - if( sd == NULL ) return true;// no player attached, report source if( script_hasdata(st,2) ) flag = script_getnum(st,2); - - // Color variants for Rune Knight dragon mounts. - if( (sd->class_&MAPID_THIRDMASK) == MAPID_RUNE_KNIGHT ) - flag = (flag == 1 ? OPTION_DRAGON1 : flag == 2 ? OPTION_DRAGON2 : flag == 3 ? OPTION_DRAGON3 : flag == 4 ? OPTION_DRAGON4 : flag == 5 ? OPTION_DRAGON5 : 0); - pc->setriding(sd, flag); return true; @@ -16310,57 +16281,21 @@ BUILDIN(setquest) { BUILDIN(erasequest) { struct map_session_data *sd = script->rid2sd(st); - int quest_id; if( sd == NULL ) return false; - if(script_hasdata(st, 3)) - { - if(script_getnum(st, 3) < script_getnum(st, 2)) - { - ShowError("buildin_erasequest: The second quest id must be greater than the id of the first.\n"); - return false; - } - - for(quest_id = script_getnum(st, 2); quest_id < script_getnum(st, 3); quest_id++) - { - quest->delete(sd, quest_id); - } - } - else - { - quest->delete(sd, script_getnum(st, 2)); - } - + quest->delete(sd, script_getnum(st, 2)); return true; } BUILDIN(completequest) { struct map_session_data *sd = script->rid2sd(st); - int quest_id; if( sd == NULL ) return false; - if(script_hasdata(st, 3)) - { - if(script_getnum(st, 3) < script_getnum(st, 2)) - { - ShowError("buildin_completequest: The second quest id must be greater than the id of the first.\n"); - return false; - } - - for(quest_id = script_getnum(st, 2); quest_id < script_getnum(st, 3); quest_id++) - { - quest->update_status(sd, quest_id, Q_COMPLETE); - } - } - else - { - quest->update_status(sd, script_getnum(st, 2), Q_COMPLETE); - } - + quest->update_status(sd, script_getnum(st, 2), Q_COMPLETE); return true; } @@ -16374,8 +16309,6 @@ BUILDIN(changequest) { return true; } -// Deprecated -// Please use questprogress instead. BUILDIN(checkquest) { struct map_session_data *sd = script->rid2sd(st); enum quest_check_type type = HAVEQUEST; @@ -16391,33 +16324,6 @@ BUILDIN(checkquest) { return true; } -BUILDIN(questprogress) { - struct map_session_data *sd = script->rid2sd(st); - enum quest_check_type type = HAVEQUEST; - int quest_progress = 0; - - if( sd == NULL ) - return false; - - if( script_hasdata(st, 3) ) - type = (enum quest_check_type)script_getnum(st, 3); - - quest_progress = quest->check(sd, script_getnum(st, 2), type); - - // "Fix" returned quest state value to make more sense. - // 0 = Not Started, 1 = In Progress, 2 = Completed. - if(quest_progress == -1) - quest_progress = 0; - else if(quest_progress == 0 || quest_progress == 1) - quest_progress = 1; - else - quest_progress = 2; - - script_pushint(st, quest_progress); - - return true; -} - BUILDIN(showevent) { TBL_PC *sd = script->rid2sd(st); struct npc_data *nd = map->id2nd(st->oid); @@ -17398,7 +17304,6 @@ BUILDIN(setmounting) { } return true; } - /** * Retrieves quantity of arguments provided to callfunc/callsub. * getargcount() -> amount of arguments received in a function @@ -18939,7 +18844,6 @@ void script_parse_builtin(void) { BUILDIN_DEF(getequipid,"i"), BUILDIN_DEF(getequipname,"i"), BUILDIN_DEF(getbrokenid,"i"), // [Valaris] - BUILDIN_DEF(getbrokencount,""), BUILDIN_DEF(repair,"i"), // [Valaris] BUILDIN_DEF(repairall,""), BUILDIN_DEF(getequipisequiped,"i"), @@ -19337,10 +19241,9 @@ void script_parse_builtin(void) { //Quest Log System [Inkfish] BUILDIN_DEF(questinfo, "ii??"), BUILDIN_DEF(setquest, "i"), - BUILDIN_DEF(erasequest, "i?"), - BUILDIN_DEF(completequest, "i?"), + BUILDIN_DEF(erasequest, "i"), + BUILDIN_DEF(completequest, "i"), BUILDIN_DEF(checkquest, "i?"), - BUILDIN_DEF(questprogress, "i?"), BUILDIN_DEF(changequest, "ii"), BUILDIN_DEF(showevent, "i?"), |