viewing paste Unknown #6074 | Plain text

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
Index: src/map/battle.c
===================================================================
--- src/map/battle.c    (revision 14116)
+++ src/map/battle.c    (working copy)
@@ -269,9 +269,11 @@
 int battle_calc_damage(struct block_list *src,struct block_list *bl,struct Damage *d,int damage,int skill_num,int skill_lv)
 {
        struct map_session_data *sd = NULL;
+       struct map_session_data *srcsd = NULL;
        struct status_change *sc;
        struct status_change_entry *sce;
        int div_ = d->div_, flag = d->flag;
+       char atcmd_output[50];
 
        nullpo_retr(0, bl);
 
@@ -282,6 +284,17 @@
 
        if (bl->type == BL_PC) {
                sd=(struct map_session_data *)bl;
+               srcsd=(struct map_session_data *)src;
+
+       if(flag&BF_MAGIC && srcsd->special_state.anti_no_magic_damage && sd->special_state.no_magic_damage){ //Anti-GTB by [Rad]
+               if(sd->special_state.no_magic_damage > srcsd->special_state.anti_no_magic_damage)
+               sd->special_state.no_magic_damage = sd->special_state.no_magic_damage - srcsd->special_state.anti_no_magic_damage;
+               if(sd->special_state.no_magic_damage < srcsd->special_state.anti_no_magic_damage)
+               sd->special_state.no_magic_damage = 0;
+               sprintf(atcmd_output, "GTB effect reduced to %d, due to an anti-gtb used by the attacker", sd->special_state.no_magic_damage); // Jumped to %s
+               clif_displaymessage(sd->fd, atcmd_output);
+
+               }
                //Special no damage states
                if(flag&BF_WEAPON && sd->special_state.no_weapon_damage)
                        damage -= damage*sd->special_state.no_weapon_damage/100;
@@ -529,6 +542,8 @@
                        mobskill_event((TBL_MOB*)bl,src,gettick(),MSC_SKILLUSED|(skill_num<<16));
        }
 
+       if(sd) status_calc_pc(sd,0); //calculate to return bNoMagicDamage to original
+
        return damage;
 }
 
Index: src/map/map.h
===================================================================
--- src/map/map.h       (revision 14116)
+++ src/map/map.h       (working copy)
@@ -327,7 +327,8 @@
        SP_SP_GAIN_RACE, SP_SUBRACE2, SP_UNBREAKABLE_SHOES,     // 2031-2033
        SP_UNSTRIPABLE_WEAPON,SP_UNSTRIPABLE_ARMOR,SP_UNSTRIPABLE_HELM,SP_UNSTRIPABLE_SHIELD,  // 2034-2037
        SP_INTRAVISION, SP_ADD_MONSTER_DROP_ITEMGROUP, SP_SP_LOSS_RATE, // 2038-2040
-       SP_ADD_SKILL_BLOW, SP_SP_VANISH_RATE, SP_MAGIC_SP_GAIN_VALUE, SP_MAGIC_HP_GAIN_VALUE //2041-2044
+       SP_ADD_SKILL_BLOW, SP_SP_VANISH_RATE, SP_MAGIC_SP_GAIN_VALUE, SP_MAGIC_HP_GAIN_VALUE, //2041-2044
+       SP_ANTI_NO_MAGIC_DAMAGE // counter GTB mod [Rad]
 };
 
 enum _look {
Index: src/map/pc.c
===================================================================
--- src/map/pc.c        (revision 14116)
+++ src/map/pc.c        (working copy)
@@ -2283,6 +2283,12 @@
                if(sd->state.lr_flag != 2)
                        sd->add_heal2_rate += val;
                break;
+       case SP_ANTI_NO_MAGIC_DAMAGE:
+               if(sd->state.lr_flag == 2)
+               break;
+               val+= sd->special_state.anti_no_magic_damage;
+               sd->special_state.anti_no_magic_damage = cap_value(val,0,100);
+               break;
        default:
                ShowWarning("pc_bonus: unknown type %d %d !\n",type,val);
                break;
Index: src/map/pc.h
===================================================================
--- src/map/pc.h        (revision 14116)
+++ src/map/pc.h        (working copy)
@@ -133,7 +133,7 @@
                unsigned short autobonus;
        } state;
        struct {
-               unsigned char no_weapon_damage, no_magic_damage, no_misc_damage;
+               unsigned char no_weapon_damage, no_magic_damage, no_misc_damage, anti_no_magic_damage;
                unsigned restart_full_recover : 1;
                unsigned no_castcancel : 1;
                unsigned no_castcancel2 : 1;
Viewed 315 times, submitted by unknown.