summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
authorshennetsind <ind@henn.et>2013-01-29 18:19:16 -0200
committershennetsind <ind@henn.et>2013-01-29 18:19:16 -0200
commite15fe6131c970f8f7574d38f3a3cc62e1873a072 (patch)
tree0f4fde414a8eeb2e9b70acdf566ddd8d45c5eefd /src/map
parentcba3bef47e8758ab1db43bd5ee3b6fcc5f9a498b (diff)
downloadhercules-e15fe6131c970f8f7574d38f3a3cc62e1873a072.tar.gz
hercules-e15fe6131c970f8f7574d38f3a3cc62e1873a072.tar.bz2
hercules-e15fe6131c970f8f7574d38f3a3cc62e1873a072.tar.xz
hercules-e15fe6131c970f8f7574d38f3a3cc62e1873a072.zip
Fixed Bug #6305
Brandish spear can now be used by rune knights riding dragons. Made riding state check for both peco and dragon, created a new state for peco-only so that the functionality isn't lost. http://hercules.ws/board/tracker/issue-6305-brandish-spear-bug-for-rune-knight/ Signed-off-by: shennetsind <ind@henn.et>
Diffstat (limited to 'src/map')
-rw-r--r--src/map/skill.c116
-rw-r--r--src/map/skill.h4
2 files changed, 53 insertions, 67 deletions
diff --git a/src/map/skill.c b/src/map/skill.c
index 06982bea7..752b1ece0 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -13058,7 +13058,7 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id
}
break;
case ST_RIDING:
- if(!pc_isriding(sd)) {
+ if(!pc_isriding(sd) || !pc_isridingdragon(sd)) {
clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
return 0;
}
@@ -13120,73 +13120,64 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id
break;
clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
return 0;
- /**
- * Rune Knight
- **/
case ST_RIDINGDRAGON:
if( !pc_isridingdragon(sd) ) {
clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
return 0;
}
break;
- /**
- * Wug
- **/
case ST_WUG:
if( !pc_iswug(sd) ) {
clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
return 0;
}
break;
- /**
- * Riding Wug
- **/
case ST_RIDINGWUG:
if( !pc_isridingwug(sd) ){
clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
return 0;
}
break;
- /**
- * Mechanic
- **/
case ST_MADO:
if( !pc_ismadogear(sd) ) {
clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
return 0;
}
break;
- /**
- * Sorcerer
- **/
case ST_ELEMENTALSPIRIT:
if(!sd->ed) {
clif_skill_fail(sd,skill_id,USESKILL_FAIL_EL_SUMMON,0);
return 0;
}
break;
- case ST_POISONINGWEAPON:
- if (!(sc && sc->data[SC_POISONINGWEAPON])) {
- clif_skill_fail(sd, skill_id, USESKILL_FAIL_GC_POISONINGWEAPON, 0);
- return 0;
- }
- break;
- case ST_ROLLINGCUTTER:
- if (!(sc && sc->data[SC_ROLLINGCUTTER])) {
- clif_skill_fail(sd, skill_id, USESKILL_FAIL_CONDITION, 0);
- return 0;
- }
- break;
- case ST_MH_FIGHTING:
- if (!(sc && sc->data[SC_STYLE_CHANGE] && sc->data[SC_STYLE_CHANGE]->val2 == MH_MD_FIGHTING)){
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
- return 0;
- }
- case ST_MH_GRAPPLING:
- if (!(sc && sc->data[SC_STYLE_CHANGE] && sc->data[SC_STYLE_CHANGE]->val2 == MH_MD_GRAPPLING)){
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
- return 0;
- }
+ case ST_POISONINGWEAPON:
+ if (!(sc && sc->data[SC_POISONINGWEAPON])) {
+ clif_skill_fail(sd, skill_id, USESKILL_FAIL_GC_POISONINGWEAPON, 0);
+ return 0;
+ }
+ break;
+ case ST_ROLLINGCUTTER:
+ if (!(sc && sc->data[SC_ROLLINGCUTTER])) {
+ clif_skill_fail(sd, skill_id, USESKILL_FAIL_CONDITION, 0);
+ return 0;
+ }
+ break;
+ case ST_MH_FIGHTING:
+ if (!(sc && sc->data[SC_STYLE_CHANGE] && sc->data[SC_STYLE_CHANGE]->val2 == MH_MD_FIGHTING)){
+ clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ return 0;
+ }
+ case ST_MH_GRAPPLING:
+ if (!(sc && sc->data[SC_STYLE_CHANGE] && sc->data[SC_STYLE_CHANGE]->val2 == MH_MD_GRAPPLING)){
+ clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ return 0;
+ }
+ case ST_PECO:
+ if(!pc_isriding(sd)) {
+ clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ return 0;
+ }
+ break;
}
if(require.mhp > 0 && get_percentage(status->hp, status->max_hp) > require.mhp) {
@@ -17605,32 +17596,29 @@ static bool skill_parse_row_requiredb(char* split[], int columns, int current)
}
skill_split_atoi(split[9],skill_db[idx].ammo_qty);
- if( strcmpi(split[10],"hiding")==0 ) skill_db[idx].state = ST_HIDING;
- else if( strcmpi(split[10],"cloaking")==0 ) skill_db[idx].state = ST_CLOAKING;
- else if( strcmpi(split[10],"hidden")==0 ) skill_db[idx].state = ST_HIDDEN;
- else if( strcmpi(split[10],"riding")==0 ) skill_db[idx].state = ST_RIDING;
- else if( strcmpi(split[10],"falcon")==0 ) skill_db[idx].state = ST_FALCON;
- else if( strcmpi(split[10],"cart")==0 ) skill_db[idx].state = ST_CART;
- else if( strcmpi(split[10],"shield")==0 ) skill_db[idx].state = ST_SHIELD;
- else if( strcmpi(split[10],"sight")==0 ) skill_db[idx].state = ST_SIGHT;
- else if( strcmpi(split[10],"explosionspirits")==0 ) skill_db[idx].state = ST_EXPLOSIONSPIRITS;
- else if( strcmpi(split[10],"cartboost")==0 ) skill_db[idx].state = ST_CARTBOOST;
- else if( strcmpi(split[10],"recover_weight_rate")==0 ) skill_db[idx].state = ST_RECOV_WEIGHT_RATE;
- else if( strcmpi(split[10],"move_enable")==0 ) skill_db[idx].state = ST_MOVE_ENABLE;
- else if( strcmpi(split[10],"water")==0 ) skill_db[idx].state = ST_WATER;
- /**
- * New States
- **/
- else if( strcmpi(split[10],"dragon")==0 ) skill_db[idx].state = ST_RIDINGDRAGON;
- else if( strcmpi(split[10],"warg")==0 ) skill_db[idx].state = ST_WUG;
- else if( strcmpi(split[10],"ridingwarg")==0 ) skill_db[idx].state = ST_RIDINGWUG;
- else if( strcmpi(split[10],"mado")==0 ) skill_db[idx].state = ST_MADO;
- else if( strcmpi(split[10],"elementalspirit")==0 ) skill_db[idx].state = ST_ELEMENTALSPIRIT;
- else if (strcmpi(split[10], "poisonweapon") == 0) skill_db[idx].state = ST_POISONINGWEAPON;
- else if (strcmpi(split[10], "rollingcutter") == 0) skill_db[idx].state = ST_ROLLINGCUTTER;
- else if (strcmpi(split[10], "mh_fighting") == 0) skill_db[idx].state = ST_MH_FIGHTING;
- else if (strcmpi(split[10], "mh_grappling") == 0) skill_db[idx].state = ST_MH_GRAPPLING;
-
+ if( strcmpi(split[10],"hiding") == 0 ) skill_db[idx].state = ST_HIDING;
+ else if( strcmpi(split[10],"cloaking") == 0 ) skill_db[idx].state = ST_CLOAKING;
+ else if( strcmpi(split[10],"hidden") == 0 ) skill_db[idx].state = ST_HIDDEN;
+ else if( strcmpi(split[10],"riding") == 0 ) skill_db[idx].state = ST_RIDING;
+ else if( strcmpi(split[10],"falcon") == 0 ) skill_db[idx].state = ST_FALCON;
+ else if( strcmpi(split[10],"cart") == 0 ) skill_db[idx].state = ST_CART;
+ else if( strcmpi(split[10],"shield") == 0 ) skill_db[idx].state = ST_SHIELD;
+ else if( strcmpi(split[10],"sight") == 0 ) skill_db[idx].state = ST_SIGHT;
+ else if( strcmpi(split[10],"explosionspirits") == 0 ) skill_db[idx].state = ST_EXPLOSIONSPIRITS;
+ else if( strcmpi(split[10],"cartboost") == 0 ) skill_db[idx].state = ST_CARTBOOST;
+ else if( strcmpi(split[10],"recover_weight_rate") == 0 ) skill_db[idx].state = ST_RECOV_WEIGHT_RATE;
+ else if( strcmpi(split[10],"move_enable") == 0 ) skill_db[idx].state = ST_MOVE_ENABLE;
+ else if( strcmpi(split[10],"water") == 0 ) skill_db[idx].state = ST_WATER;
+ else if( strcmpi(split[10],"dragon") == 0 ) skill_db[idx].state = ST_RIDINGDRAGON;
+ else if( strcmpi(split[10],"warg") == 0 ) skill_db[idx].state = ST_WUG;
+ else if( strcmpi(split[10],"ridingwarg") == 0 ) skill_db[idx].state = ST_RIDINGWUG;
+ else if( strcmpi(split[10],"mado") == 0 ) skill_db[idx].state = ST_MADO;
+ else if( strcmpi(split[10],"elementalspirit") == 0 ) skill_db[idx].state = ST_ELEMENTALSPIRIT;
+ else if( strcmpi(split[10],"poisonweapon") == 0 ) skill_db[idx].state = ST_POISONINGWEAPON;
+ else if( strcmpi(split[10],"rollingcutter") == 0 ) skill_db[idx].state = ST_ROLLINGCUTTER;
+ else if( strcmpi(split[10],"mh_fighting") == 0 ) skill_db[idx].state = ST_MH_FIGHTING;
+ else if( strcmpi(split[10],"mh_grappling") == 0 ) skill_db[idx].state = ST_MH_GRAPPLING;
+ else if( strcmpi(split[10],"peco") == 0 ) skill_db[idx].state = ST_PECO;
/**
* Unknown or no state
**/
diff --git a/src/map/skill.h b/src/map/skill.h
index dc7499857..9b6ba1b0c 100644
--- a/src/map/skill.h
+++ b/src/map/skill.h
@@ -392,9 +392,6 @@ enum {
ST_RECOV_WEIGHT_RATE,
ST_MOVE_ENABLE,
ST_WATER,
- /**
- * 3rd States
- **/
ST_RIDINGDRAGON,
ST_WUG,
ST_RIDINGWUG,
@@ -404,6 +401,7 @@ enum {
ST_ROLLINGCUTTER,
ST_MH_FIGHTING,
ST_MH_GRAPPLING,
+ ST_PECO,
};
enum e_skill {