summaryrefslogtreecommitdiff
path: root/src/map/status.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-05-29 15:25:28 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-05-29 15:25:28 +0000
commitb3b97640f916a93e193e491b156877824649d25c (patch)
tree447317f0af98e70d0b732ac3199c572e08b9af23 /src/map/status.c
parente855e728ca6778580a913d8046a9e8fa652fb983 (diff)
downloadhercules-b3b97640f916a93e193e491b156877824649d25c.tar.gz
hercules-b3b97640f916a93e193e491b156877824649d25c.tar.bz2
hercules-b3b97640f916a93e193e491b156877824649d25c.tar.xz
hercules-b3b97640f916a93e193e491b156877824649d25c.zip
- Cleaned up some status_get functions.
- Optimized a bit the SC_PROVOKE code (to use val3/val4) - Fixed draining when the amount drained is negative (invoke zap rather than heal) - Implemented GS_FLING as per the current skill description. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6819 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/status.c')
-rw-r--r--src/map/status.c43
1 files changed, 25 insertions, 18 deletions
diff --git a/src/map/status.c b/src/map/status.c
index 66f1e3901..be465d848 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -344,6 +344,8 @@ void initChangeTables(void) {
set_sc(GS_ADJUSTMENT, SC_ADJUSTMENT, SI_ADJUSTMENT, SCB_HIT|SCB_FLEE);
set_sc(GS_INCREASING, SC_INCREASING, SI_ACCURACY, SCB_AGI|SCB_DEX|SCB_HIT);
set_sc(GS_GATLINGFEVER, SC_GATLINGFEVER, SI_GATLINGFEVER, SCB_FLEE|SCB_SPEED|SCB_ASPD);
+ set_sc(GS_FLING, SC_FLING, SI_NONE, SCB_DEF|SCB_DEF2);
+
//Uncomment and update when you plan on implementing.
// set_sc(NJ_TATAMIGAESHI, SC_TATAMIGAESHI, SI_BLANK);
// set_sc(NJ_UTSUSEMI, SC_UTSUSEMI, SI_MAEMI);
@@ -2696,7 +2698,7 @@ static unsigned short status_calc_batk(struct block_list *bl, struct status_chan
if(sc->data[SC_INCATKRATE].timer!=-1)
batk += batk * sc->data[SC_INCATKRATE].val1/100;
if(sc->data[SC_PROVOKE].timer!=-1)
- batk += batk * (2+3*sc->data[SC_PROVOKE].val1)/100;
+ batk += batk * sc->data[SC_PROVOKE].val3/100;
if(sc->data[SC_CONCENTRATION].timer!=-1)
batk += batk * sc->data[SC_CONCENTRATION].val2/100;
if(sc->data[SC_SKE].timer!=-1)
@@ -2729,7 +2731,7 @@ static unsigned short status_calc_watk(struct block_list *bl, struct status_chan
if(sc->data[SC_INCATKRATE].timer!=-1)
watk += watk * sc->data[SC_INCATKRATE].val1/100;
if(sc->data[SC_PROVOKE].timer!=-1)
- watk += watk * (2+3*sc->data[SC_PROVOKE].val1)/100;
+ watk += watk * sc->data[SC_PROVOKE].val3/100;
if(sc->data[SC_CONCENTRATION].timer!=-1)
watk += watk * sc->data[SC_CONCENTRATION].val2/100;
if(sc->data[SC_SKE].timer!=-1)
@@ -2884,11 +2886,11 @@ static unsigned char status_calc_def(struct block_list *bl, struct status_change
if(sc->data[SC_SKE].timer!=-1)
def -= def * 50/100;
if(sc->data[SC_PROVOKE].timer!=-1 && bl->type != BL_PC) // Provoke doesn't alter player defense.
- def -= def * (5+5*sc->data[SC_PROVOKE].val1)/100;
+ def -= def * sc->data[SC_PROVOKE].val4/100;
if(sc->data[SC_STRIPSHIELD].timer!=-1)
def -= def * sc->data[SC_STRIPSHIELD].val2/100;
- //if (sd->data[SC_FLING].timer!=-1 && bl->type != BL_PC)
- // def -= (def * sd->data[SC_FLING].val1) / 100;
+ if (sd->data[SC_FLING].timer!=-1)
+ def -= def * (sd->data[SC_FLING].val2)/100;
return cap_value(def,0,UCHAR_MAX);
}
@@ -2912,15 +2914,15 @@ static unsigned short status_calc_def2(struct block_list *bl, struct status_chan
if(sc->data[SC_SKE].timer!=-1)
def2 -= def2 * 50/100;
if(sc->data[SC_PROVOKE].timer!=-1)
- def2 -= def2 * (5+5*sc->data[SC_PROVOKE].val1)/100;
+ def2 -= def2 * sc->data[SC_PROVOKE].val4/100;
if(sc->data[SC_JOINTBEAT].timer!=-1){
if(sc->data[SC_JOINTBEAT].val2==3)
def2 -= def2 * 50/100;
else if(sc->data[SC_JOINTBEAT].val2==4)
def2 -= def2 * 25/100;
}
- //if (sd->data[SC_FLING].timer!=-1)
- // def2 -= (def2 * sd->data[SC_FLING].val1) / 100;
+ if (sd->data[SC_FLING].timer!=-1)
+ def2 -= def2 * (sd->data[SC_FLING].val3)/100;
return cap_value(def2,0,USHRT_MAX);
}
@@ -3307,19 +3309,19 @@ struct status_data *status_get_base_status(struct block_list *bl)
}
}
-int status_get_lwatk(struct block_list *bl)
+unsigned short status_get_lwatk(struct block_list *bl)
{
struct status_data *status = status_get_status_data(bl);
return status->lhw?status->lhw->atk:0;
}
-int status_get_lwatk2(struct block_list *bl)
+unsigned short status_get_lwatk2(struct block_list *bl)
{
struct status_data *status = status_get_status_data(bl);
return status->lhw?status->lhw->atk2:0;
}
-int status_get_def(struct block_list *bl)
+unsigned char status_get_def(struct block_list *bl)
{
struct unit_data *ud;
struct status_data *status = status_get_status_data(bl);
@@ -3331,18 +3333,14 @@ int status_get_def(struct block_list *bl)
return def;
}
-int status_get_speed(struct block_list *bl)
+unsigned short status_get_speed(struct block_list *bl)
{
- struct status_data *status;
-
if(bl->type==BL_NPC)//Only BL with speed data but no status_data [Skotlex]
return ((struct npc_data *)bl)->speed;
-
- status = status_get_status_data(bl);
- return status?status->speed:2000;
+ return status_get_status_data(bl)->speed;
}
-int status_get_attack_lelement(struct block_list *bl)
+unsigned char status_get_attack_lelement(struct block_list *bl)
{
struct status_data *status = status_get_status_data(bl);
return status->lhw?status->lhw->ele:0;
@@ -4826,6 +4824,15 @@ int status_change_start(struct block_list *bl,int type,int rate,int val1,int val
val3 = 5*val1; //Flee decrease
break;
+ case SC_FLING:
+ val2 = 3*val1; //Def reduction
+ val3 = 3*val1; //Def2 reduction
+ break;
+ case SC_PROVOKE:
+ //val2 signals autoprovoke.
+ val3 = 2+3*val1; //Atk increase
+ val4 = 5+5*val1; //Def reduction.
+ break;
default:
if (calc_flag == SCB_NONE && StatusSkillChangeTable[type]==0)
{ //Status change with no calc, and no skill associated...? unknown?