summaryrefslogtreecommitdiff
path: root/src/map/status.c
diff options
context:
space:
mode:
authorInkfish <Inkfish@54d463be-8e91-2dee-dedb-b68131a5f0ec>2009-06-19 13:26:50 +0000
committerInkfish <Inkfish@54d463be-8e91-2dee-dedb-b68131a5f0ec>2009-06-19 13:26:50 +0000
commitc1d7d16b0e4010b27591f37ee93a1ca8d1137ecb (patch)
treeffa19893e7d612e011d2d441a48ed23c37a15898 /src/map/status.c
parenta36580661f18d01c8b4f97be7d56d827df520638 (diff)
downloadhercules-c1d7d16b0e4010b27591f37ee93a1ca8d1137ecb.tar.gz
hercules-c1d7d16b0e4010b27591f37ee93a1ca8d1137ecb.tar.bz2
hercules-c1d7d16b0e4010b27591f37ee93a1ca8d1137ecb.tar.xz
hercules-c1d7d16b0e4010b27591f37ee93a1ca8d1137ecb.zip
* Implemented script command "areamobuseskill" and skill NPC_INVINCIBLE and NPC_INVINCIBLEOFF. (topic:217330)
* Using items no longer cancels invincibility(but using target and ground skills through items does). (bugreport:3259) * Fixed Butterfly Wings not working during GVG. (bugreport:3264) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13897 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/status.c')
-rw-r--r--src/map/status.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/map/status.c b/src/map/status.c
index 54d019a48..467626106 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -388,6 +388,8 @@ void initChangeTables(void)
set_sc( NPC_HELLPOWER , SC_HELLPOWER , SI_HELLPOWER , SCB_NONE );
set_sc( NPC_WIDEHELLDIGNITY , SC_HELLPOWER , SI_HELLPOWER , SCB_NONE );
+ set_sc( NPC_INVINCIBLE , SC_INVINCIBLE , SI_INVINCIBLE , SCB_SPEED );
+ set_sc( NPC_INVINCIBLEOFF , SC_INVINCIBLEOFF , SI_BLANK , SCB_SPEED );
set_sc( CASH_BLESSING , SC_BLESSING , SI_BLESSING , SCB_STR|SCB_INT|SCB_DEX );
set_sc( CASH_INCAGI , SC_INCREASEAGI , SI_INCREASEAGI , SCB_AGI|SCB_SPEED );
@@ -665,6 +667,13 @@ int status_damage(struct block_list *src,struct block_list *target,int hp, int s
sc = status_get_sc(target);
+ if( battle_config.invincible_nodamage && src && sc && sc->data[SC_INVINCIBLE] && !sc->data[SC_INVINCIBLEOFF] )
+ {
+ if( !sp )
+ return 0;
+ hp = 0;
+ }
+
if( hp && !(flag&1) ) {
if( sc ) {
struct status_change_entry *sce;
@@ -3798,6 +3807,8 @@ static unsigned short status_calc_speed(struct block_list *bl, struct status_cha
val = max( val, 55 );
if( sc->data[SC_AVOID] )
val = max( val, 10 * sc->data[SC_AVOID]->val1 );
+ if( sc->data[SC_INVINCIBLE] && !sc->data[SC_INVINCIBLEOFF] )
+ val = max( val, 75 );
//FIXME: official items use a single bonus for this [ultramage]
if( sc->data[SC_SPEEDUP0] ) // temporary item-based speedup
@@ -3822,7 +3833,7 @@ static unsigned short status_calc_speed(struct block_list *bl, struct status_cha
speed = 200;
if( sc->data[SC_DEFENDER] )
speed = max(speed, 200);
- if( sc->data[SC_WALKSPEED] ) // ChangeSpeed
+ if( sc->data[SC_WALKSPEED] && sc->data[SC_WALKSPEED]->val1 > 0 ) // ChangeSpeed
speed = speed * 100 / sc->data[SC_WALKSPEED]->val1;
}