Jump to content
  • 0

Add reduce damage


Kichi

Question


  • Group:  Members
  • Topic Count:  25
  • Topics Per Day:  0.01
  • Content Count:  509
  • Reputation:   80
  • Joined:  11/20/11
  • Last Seen:  

Hi guys,

i just wanna ask, how to reduce total damage?

 

example

when you deal normal 500k ashura, will reduce to 400k when u do to novice

 

the system seem like u do ashura to other player who using thara frog card, but this is source modif i didn't ask itembonus.

 

 

thanks

Link to comment
Share on other sites

6 answers to this question

Recommended Posts


  • Group:  Developer
  • Topic Count:  153
  • Topics Per Day:  0.04
  • Content Count:  2285
  • Reputation:   745
  • Joined:  06/16/12
  • Last Seen:  

on battle.c

battle_calc_weapon_attack, on latest line before "return wd;"

 

if( target->type == BL_PC && ((TBL_PC*)bl)->class_&MAPID_UPPERMASK == MAPID_NOVICE && skill_id == MO_EXTREMITYFIST && wd.damage > 500000 )
wd.damage = 400000;

 

something like that

 

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  25
  • Topics Per Day:  0.01
  • Content Count:  509
  • Reputation:   80
  • Joined:  11/20/11
  • Last Seen:  

on battle.c

battle_calc_weapon_attack, on latest line before "return wd;"

 

 

if( target->type == BL_PC && ((TBL_PC*)bl)->class_&MAPID_UPPERMASK == MAPID_NOVICE && skill_id == MO_EXTREMITYFIST && wd.damage > 500000 )
wd.damage = 400000;

 

something like that

 

what condition is that?

would u like to write

 

total damage - 20% ?

thanks /thx

 

-- EDIT --

 

all type of damage (magic, weapon, misc) will reduce 20%

Edited by OceanBlue
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  25
  • Topics Per Day:  0.01
  • Content Count:  509
  • Reputation:   80
  • Joined:  11/20/11
  • Last Seen:  

bumb

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  153
  • Topics Per Day:  0.04
  • Content Count:  2285
  • Reputation:   745
  • Joined:  06/16/12
  • Last Seen:  

Index: battle.c
===================================================================
--- battle.c    (revision 17382)
+++ battle.c    (working copy)
@@ -3631,6 +3631,12 @@
         wd.damage += md.damage;
     }
 
+    if( target->type == BL_PC &&    // if attacker is player
+        (((TBL_PC*)target)->class_&MAPID_UPPERMASK) == MAPID_NOVICE && // if novice, change for another job u like
+        skill_id == MO_EXTREMITYFIST && // the specified skill
+        wd.damage > 500000 )    // if damage is more than
+        ATK_RATE(80);
+
     return wd;
 }
 
@@ -4277,6 +4283,12 @@
         //case HM_ERASER_CUTTER:
     }
 
+    if( target->type == BL_PC &&    // if attacker is player
+        (((TBL_PC*)target)->class_&MAPID_UPPERMASK) == MAPID_NOVICE && // if novice, change for another job u like
+        skill_id == WL_JACKFROST && // the specified skill
+        ad.damage > 500000 )    // if damage is more than
+        MATK_RATE(80);
+
     return ad;
 }
 
@@ -4593,6 +4605,12 @@
     if(tstatus->mode&MD_IGNOREMISC && md.flag&(BF_MISC) )    //misc @TODO optimize me
      md.damage = md.damage2 = 1;
 
+    if( target->type == BL_PC &&    // if attacker is player
+        (((TBL_PC*)target)->class_&MAPID_UPPERMASK) == MAPID_NOVICE && // if novice, change for another job u like
+        skill_id == WL_JACKFROST && // the specified skill
+        md.damage > 500000 )    // if damage is more than
+        md.damage = md.damage * 80 / 100;
+
     return md;
 }
 /*==========================================
 
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  25
  • Topics Per Day:  0.01
  • Content Count:  509
  • Reputation:   80
  • Joined:  11/20/11
  • Last Seen:  

Index: battle.c
===================================================================
--- battle.c    (revision 17382)
+++ battle.c    (working copy)
@@ -3631,6 +3631,12 @@
         wd.damage += md.damage;
     }
 
+    if( target->type == BL_PC &&    // if attacker is player
+        (((TBL_PC*)target)->class_&MAPID_UPPERMASK) == MAPID_NOVICE && // if novice, change for another job u like
+        skill_id == MO_EXTREMITYFIST && // the specified skill
+        wd.damage > 500000 )    // if damage is more than
+        ATK_RATE(80);
+
     return wd;
 }
 
@@ -4277,6 +4283,12 @@
         //case HM_ERASER_CUTTER:
     }
 
+    if( target->type == BL_PC &&    // if attacker is player
+        (((TBL_PC*)target)->class_&MAPID_UPPERMASK) == MAPID_NOVICE && // if novice, change for another job u like
+        skill_id == WL_JACKFROST && // the specified skill
+        ad.damage > 500000 )    // if damage is more than
+        MATK_RATE(80);
+
     return ad;
 }
 
@@ -4593,6 +4605,12 @@
     if(tstatus->mode&MD_IGNOREMISC && md.flag&(BF_MISC) )    //misc @TODO optimize me
      md.damage = md.damage2 = 1;
 
+    if( target->type == BL_PC &&    // if attacker is player
+        (((TBL_PC*)target)->class_&MAPID_UPPERMASK) == MAPID_NOVICE && // if novice, change for another job u like
+        skill_id == WL_JACKFROST && // the specified skill
+        md.damage > 500000 )    // if damage is more than
+        md.damage = md.damage * 80 / 100;
+
     return md;
 }
 /*==========================================
 

wow thanks

/thx

 

and 1 more, how about add check if opponent using mado?

 

if( pc_ismadogear(sd) )

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  153
  • Topics Per Day:  0.04
  • Content Count:  2285
  • Reputation:   745
  • Joined:  06/16/12
  • Last Seen:  

if( target->type == BL_PC && pc_ismadogear((TBL_PC*)target) )
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...