viewing paste disable_skills | C

Posted on the
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92
Index: src/map/skill.c
===================================================================
--- src/map/skill.c     (revision 17288)
+++ src/map/skill.c     (working copy)
@@ -12706,14 +12753,9 @@
        if( sc && ( sc->data[SC__SHADOWFORM] || sc->data[SC__IGNORANCE] ) )
                return 0;
 
-       switch( skill_id ) { // Turn off check.
-               case BS_MAXIMIZE:               case NV_TRICKDEAD:      case TF_HIDING:                 case AS_CLOAKING:               case CR_AUTOGUARD:
-               case ML_AUTOGUARD:              case CR_DEFENDER:       case ML_DEFENDER:               case ST_CHASEWALK:              case PA_GOSPEL:
-               case CR_SHRINK:                 case TK_RUN:            case GS_GATLINGFEVER:   case TK_READYCOUNTER:   case TK_READYDOWN:
-               case TK_READYSTORM:             case TK_READYTURN:      case SG_FUSION:                 case RA_WUGDASH:                case KO_YAMIKUMO:
-                       if( sc && sc->data[status_skill2sc(skill_id)] )
-                               return 1;
-       }
+       //Checks if disabling skill - in which case no SP requirements are necessary
+       if( sc && skill_disable_check(sc,skill_id) )
+               return 1;
 
        // Check the skills that can be used while mounted on a warg
        if( pc_isridingwug(sd) ) {
@@ -13709,15 +13774,9 @@
        if( !sc->count )
                sc = NULL;
 
-       switch( skill_id )
-       { // Turn off check.
-       case BS_MAXIMIZE:               case NV_TRICKDEAD:      case TF_HIDING:                 case AS_CLOAKING:               case CR_AUTOGUARD:
-       case ML_AUTOGUARD:              case CR_DEFENDER:       case ML_DEFENDER:               case ST_CHASEWALK:              case PA_GOSPEL:
-       case CR_SHRINK:                 case TK_RUN:            case GS_GATLINGFEVER:   case TK_READYCOUNTER:   case TK_READYDOWN:
-       case TK_READYSTORM:             case TK_READYTURN:      case SG_FUSION:                 case KO_YAMIKUMO:
-               if( sc && sc->data[status_skill2sc(skill_id)] )
-                       return req;
-       }
+       //Checks if disabling skill - in which case no SP requirements are necessary
+       if( sc && skill_disable_check(sc,skill_id))
+               return req;
 
        idx = skill_get_index(skill_id);
        if( idx == 0 ) // invalid skill id
@@ -17658,6 +17709,38 @@
        return 0;
 }
 
+int skill_disable_check(struct status_change *sc, uint16 skill_id)
+{
+       switch( skill_id ){ // HP & SP Consumption Check
+               case BS_MAXIMIZE:
+               case NV_TRICKDEAD:
+               case TF_HIDING:
+               case AS_CLOAKING:
+               case GC_CLOAKINGEXCEED:
+               case ST_CHASEWALK:
+               case CR_DEFENDER:
+               case CR_SHRINK:
+               case CR_AUTOGUARD:
+               case ML_DEFENDER:
+               case ML_AUTOGUARD:
+               case PA_GOSPEL:
+               case GS_GATLINGFEVER:
+               case TK_READYCOUNTER:
+               case TK_READYDOWN:
+               case TK_READYSTORM:
+               case TK_READYTURN:
+               case TK_RUN:
+               case SG_FUSION:
+               case KO_YAMIKUMO:
+               case RA_WUGDASH:
+               case RA_CAMOUFLAGE:
+                       if( sc && sc->data[status_skill2sc(skill_id)] )
+                               return 1;      
+       }
+
+       return 0;
+}
+
 int skill_get_elemental_type( uint16 skill_id , uint16 skill_lv ) {
        int type = 0;
 
Index: src/map/skill.h
===================================================================
--- src/map/skill.h     (revision 17288)
+++ src/map/skill.h     (working copy)
@@ -314,6 +314,7 @@
 int skill_check_condition_castend(struct map_session_data *sd, uint16 skill_id, uint16 skill_lv);
 int skill_consume_requirement(struct map_session_data *sd, uint16 skill_id, uint16 skill_lv, short type);
 struct skill_condition skill_get_requirement(struct map_session_data *sd, uint16 skill_id, uint16 skill_lv);
+int skill_disable_check(struct status_change *sc, uint16 skill_id);
 
 int skill_check_pc_partner(struct map_session_data *sd, uint16 skill_id, short* skill_lv, int range, int cast_flag);
 // -- moonsoul (added skill_check_unit_cell)
Viewed 243 times, submitted by unknown.