summaryrefslogtreecommitdiff
path: root/src/map/skill.c
diff options
context:
space:
mode:
author(no author) <(no author)@54d463be-8e91-2dee-dedb-b68131a5f0ec>2005-01-26 11:20:38 +0000
committer(no author) <(no author)@54d463be-8e91-2dee-dedb-b68131a5f0ec>2005-01-26 11:20:38 +0000
commit8ca00fc7e0e1457b1cb1537e2caeefa150344360 (patch)
treeb6818621e3485148c6adf755afd0dae24c1e8575 /src/map/skill.c
parent317ba93ee42b32c369f7aa7f669f4acb3ac72e60 (diff)
downloadhercules-8ca00fc7e0e1457b1cb1537e2caeefa150344360.tar.gz
hercules-8ca00fc7e0e1457b1cb1537e2caeefa150344360.tar.bz2
hercules-8ca00fc7e0e1457b1cb1537e2caeefa150344360.tar.xz
hercules-8ca00fc7e0e1457b1cb1537e2caeefa150344360.zip
Added status_get_sc_def for calculating resistance against status abnormalities
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@997 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/skill.c')
-rw-r--r--src/map/skill.c70
1 files changed, 20 insertions, 50 deletions
diff --git a/src/map/skill.c b/src/map/skill.c
index 8c2ff23be..000025e08 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -1045,7 +1045,7 @@ int skill_additional_effect( struct block_list* src, struct block_list *bl,int s
struct pet_data *pd=NULL;
int skill,skill2;
- int rate,luk;
+ int rate;
int sc_def_mdef,sc_def_vit,sc_def_int,sc_def_luk;
int sc_def_mdef2,sc_def_vit2,sc_def_int2,sc_def_luk2;
@@ -1064,44 +1064,23 @@ int skill_additional_effect( struct block_list* src, struct block_list *bl,int s
nullpo_retr(0, pd = (struct pet_data *)src); // [Valaris]
}
+ if(bl->type == BL_PC) {
+ nullpo_retr(0, dstsd=(struct map_session_data *)bl);
+ } else if(bl->type == BL_MOB) {
+ nullpo_retr(0, dstmd=(struct mob_data *)bl); //未使用?
+ }
+
//?象の耐性
- luk = status_get_luk(bl);
- sc_def_mdef=100 - (3 + status_get_mdef(bl) + luk/3);
- sc_def_vit=100 - (3 + status_get_vit(bl) + luk/3);
- sc_def_int=100 - (3 + status_get_int(bl) + luk/3);
- sc_def_luk=100 - (3 + luk);
+ sc_def_mdef = status_get_sc_def_mdef(bl);
+ sc_def_vit = status_get_sc_def_vit(bl);
+ sc_def_int = status_get_sc_def_int(bl);
+ sc_def_luk = status_get_sc_def_luk(bl);
+
//自分の耐性
- luk = status_get_luk(src);
- sc_def_mdef2=100 - (3 + status_get_mdef(src) + luk/3);
- sc_def_vit2=100 - (3 + status_get_vit(src) + luk/3);
- sc_def_int2=100 - (3 + status_get_int(src) + luk/3);
- sc_def_luk2=100 - (3 + luk);
- if(bl->type==BL_PC)
- dstsd=(struct map_session_data *)bl;
- else if(bl->type==BL_MOB){
- dstmd=(struct mob_data *)bl; //未使用?
- if(sc_def_mdef<50)
- sc_def_mdef=50;
- if(sc_def_vit<50)
- sc_def_vit=50;
- if(sc_def_int<50)
- sc_def_int=50;
- if(sc_def_luk<50)
- sc_def_luk=50;
- }
- if (dstsd && dstsd->sc_count && dstsd->sc_data[SC_GOSPEL].timer != -1 &&
- dstsd->sc_data[SC_GOSPEL].val4 == BCT_PARTY &&
- dstsd->sc_data[SC_GOSPEL].val3 == 3) {
- sc_def_mdef -= 25;
- sc_def_vit -= 25;
- sc_def_int -= 25;
- }
- if(sc_def_mdef<0)
- sc_def_mdef=0;
- if(sc_def_vit<0)
- sc_def_vit=0;
- if(sc_def_int<0)
- sc_def_int=0;
+ sc_def_mdef2 = status_get_sc_def_mdef(src);
+ sc_def_vit2 = status_get_sc_def_vit(src);
+ sc_def_int2 = status_get_sc_def_int(src);
+ sc_def_luk2 = status_get_sc_def_luk(src);
switch(skillid){
case 0: /* 通常攻? */
@@ -2674,7 +2653,7 @@ int skill_castend_damage_id( struct block_list* src, struct block_list *bl,int s
{
struct status_change *sc_data = status_get_sc_data(bl);
int sc_def_mdef, rate, damage;
- sc_def_mdef = 100 - (3 + status_get_mdef(bl) + status_get_luk(bl)/3);
+ sc_def_mdef = status_get_sc_def_mdef(bl);
rate = (skilllv*3+35)*sc_def_mdef/100-(status_get_int(bl)+status_get_luk(bl))/15;
rate = rate<=5?5:rate;
if (sc_data && sc_data[SC_FREEZE].timer != -1) {
@@ -2957,23 +2936,14 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int
sc_dex=status_get_mdef(bl);
sc_luk=status_get_luk(bl);
- sc_def_vit = 100 - (3 + status_get_vit(bl) + status_get_luk(bl)/3);
- //sc_def_vit = 100 - (3 + status_get_vit(bl) + status_get_luk(bl)/3);
- sc_def_mdef = 100 - (3 + status_get_mdef(bl) + status_get_luk(bl)/3);
+ sc_def_vit = status_get_sc_def_vit(bl);
+ sc_def_mdef = status_get_sc_def_mdef (bl);
if(bl->type==BL_PC){
nullpo_retr(1, dstsd=(struct map_session_data *)bl);
}else if(bl->type==BL_MOB){
nullpo_retr(1, dstmd=(struct mob_data *)bl);
- if(sc_def_vit>50)
- sc_def_vit=50;
- if(sc_def_mdef>50)
- sc_def_mdef=50;
- }
- if(sc_def_vit < 0)
- sc_def_vit=0;
- if(sc_def_mdef < 0)
- sc_def_mdef=0;
+ }
if(bl == NULL || bl->prev == NULL)
return 1;