summaryrefslogtreecommitdiff
path: root/src/map/status.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/map/status.c')
-rw-r--r--src/map/status.c35
1 files changed, 22 insertions, 13 deletions
diff --git a/src/map/status.c b/src/map/status.c
index fefa63508..6a73bbb71 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -660,7 +660,7 @@ void initChangeTables(void) {
set_sc( SO_FIREWALK , SC_PROPERTYWALK , SI_PROPERTYWALK , SCB_NONE );
set_sc( SO_ELECTRICWALK , SC_PROPERTYWALK , SI_PROPERTYWALK , SCB_NONE );
set_sc( SO_SPELLFIST , SC_SPELLFIST , SI_SPELLFIST , SCB_NONE );
- set_sc( SO_DIAMONDDUST , SC_CRYSTALIZE , SI_COLD , SCB_NONE );//Will add flags in major balance update 8 [Rytech]
+ set_sc_with_vfx( SO_DIAMONDDUST , SC_CRYSTALIZE , SI_COLD , SCB_NONE ); // it does show the snow icon on mobs but doesn't affect it.
set_sc( SO_CLOUD_KILL , SC_POISON , SI_CLOUDKILL , SCB_NONE );
set_sc( SO_STRIKING , SC_STRIKING , SI_STRIKING , SCB_WATK|SCB_CRI );
set_sc( SO_WARMER , SC_WARMER , SI_WARMER , SCB_NONE );
@@ -966,6 +966,7 @@ void initChangeTables(void) {
StatusChangeStateTable[SC_VACUUM_EXTREME] |= SCS_NOMOVE;
StatusChangeStateTable[SC_CURSEDCIRCLE_ATKER] |= SCS_NOMOVE;
StatusChangeStateTable[SC_CURSEDCIRCLE_TARGET] |= SCS_NOMOVE;
+ StatusChangeStateTable[SC_CRYSTALIZE] |= SCS_NOMOVE|SCS_NOMOVECOND;
/* StatusChangeState (SCS_) NOPICKUPITEMS */
StatusChangeStateTable[SC_HIDING] |= SCS_NOPICKITEM;
@@ -987,7 +988,7 @@ void initChangeTables(void) {
StatusChangeStateTable[SC_OBLIVIONCURSE] |= SCS_NOCAST;
StatusChangeStateTable[SC_WHITEIMPRISON] |= SCS_NOCAST;
StatusChangeStateTable[SC__INVISIBILITY] |= SCS_NOCAST;
- StatusChangeStateTable[SC_CRYSTALIZE] |= SCS_NOCAST;
+ StatusChangeStateTable[SC_CRYSTALIZE] |= SCS_NOCAST|SCS_NOCASTCOND;
StatusChangeStateTable[SC__IGNORANCE] |= SCS_NOCAST;
StatusChangeStateTable[SC_DEEPSLEEP] |= SCS_NOCAST;
StatusChangeStateTable[SC_SATURDAYNIGHTFEVER] |= SCS_NOCAST;
@@ -1486,7 +1487,7 @@ int status_check_skilluse(struct block_list *src, struct block_list *target, int
//on dead characters, said checks are left to skill.c [Skotlex]
if (target && status_isdead(target))
return 0;
- if( src && (sc = status_get_sc(src)) && sc->data[SC_CRYSTALIZE] )
+ if( src && (sc = status_get_sc(src)) && sc->data[SC_CRYSTALIZE] && src->type != BL_MOB)
return 0;
}
@@ -1518,7 +1519,7 @@ int status_check_skilluse(struct block_list *src, struct block_list *target, int
if( sc && sc->count ) {
- if( sc->opt1 >0 && sc->opt1 != OPT1_BURNING && skill_num != SR_GENTLETOUCH_CURE ) { //Stuned/Frozen/etc
+ if( sc->opt1 >0 && (sc->opt1 != OPT1_CRYSTALIZE && src->type != BL_MOB) && sc->opt1 != OPT1_BURNING && skill_num != SR_GENTLETOUCH_CURE ) { //Stuned/Frozen/etc
if (flag != 1) //Can't cast, casted stuff can't damage.
return 0;
if (!(skill_get_inf(skill_num)&INF_GROUND_SKILL))
@@ -3371,7 +3372,8 @@ void status_calc_state( struct block_list *bl, struct status_change *sc, enum sc
|| (sc->data[SC_BASILICA] && sc->data[SC_BASILICA]->val4 == bl->id) // Basilica caster cannot move
|| (sc->data[SC_GRAVITATION] && sc->data[SC_GRAVITATION]->val3 == BCT_SELF)
|| (sc->data[SC_CLOAKING] && //Need wall at level 1-2
- sc->data[SC_CLOAKING]->val1 < 3 && !(sc->data[SC_CLOAKING]->val4&1))
+ sc->data[SC_CLOAKING]->val1 < 3 && !(sc->data[SC_CLOAKING]->val4&1)
+ || (sc->data[SC_CRYSTALIZE] && bl->type != BL_MOB))
) {
sc->cant.move += ( start ? 1 : -1 );
}
@@ -3381,8 +3383,7 @@ void status_calc_state( struct block_list *bl, struct status_change *sc, enum sc
if( flag&SCS_NOCAST ) {
if( !(flag&SCS_NOCASTCOND) ) {
sc->cant.cast += ( start ? 1 : -1 );
- } else {
- /* to date there are usable conditions on nocast sclist */
+ } else if( (sc->data[SC_CRYSTALIZE] && bl->type != BL_MOB) ){
sc->cant.cast += ( start ? 1 : -1 );
}
}
@@ -8048,11 +8049,10 @@ int status_change_start(struct block_list* bl,enum sc_type type,int rate,int val
case SC_FREEZE: sc->opt1 = OPT1_FREEZE; break;
case SC_STUN: sc->opt1 = OPT1_STUN; break;
case SC_SLEEP:
- case SC_DEEPSLEEP:
- sc->opt1 = OPT1_SLEEP;
- break;
- case SC_BURNING: sc->opt1 = OPT1_BURNING; break; // Burning need this to be showed correctly. [pakpil]
- case SC_WHITEIMPRISON: sc->opt1 = OPT1_IMPRISON; break;
+ case SC_DEEPSLEEP: sc->opt1 = OPT1_SLEEP; break;
+ case SC_BURNING: sc->opt1 = OPT1_BURNING; break; // Burning need this to be showed correctly. [pakpil]
+ case SC_WHITEIMPRISON: sc->opt1 = OPT1_IMPRISON; break;
+ case SC_CRYSTALIZE: sc->opt1 = OPT1_CRYSTALIZE; break;
//OPT2
case SC_POISON: sc->opt2 |= OPT2_POISON; break;
case SC_CURSE: sc->opt2 |= OPT2_CURSE; break;
@@ -8895,6 +8895,7 @@ int status_change_end_(struct block_list* bl, enum sc_type type, int tid, const
case SC_DEEPSLEEP:
case SC_BURNING:
case SC_WHITEIMPRISON:
+ case SC_CRYSTALIZE:
sc->opt1 = 0;
break;
@@ -9194,6 +9195,7 @@ int status_change_timer(int tid, unsigned int tick, int id, intptr_t data)
map_foreachinrange( status_change_timer_sub, bl, sce->val3, BL_CHAR, bl, sce, type, tick);
if( --(sce->val2)>0 ){
+ sce->val4 += 250; // use for Shadow Form 2 seconds checking.
sc_timer_next(250+tick, status_change_timer, bl->id, data);
return 0;
}
@@ -9748,7 +9750,8 @@ int status_change_timer(int tid, unsigned int tick, int id, intptr_t data)
case SC_CRYSTALIZE:
if( --(sce->val4) >= 0 )
{ // Drains 2% of HP and 1% of SP every seconds.
- status_charge(bl, status->max_hp * 2 / 100, status->max_sp / 100);
+ if( bl->type != BL_MOB) // doesn't work on mobs
+ status_charge(bl, status->max_hp * 2 / 100, status->max_sp / 100);
sc_timer_next(1000 + tick, status_change_timer, bl->id, data);
return 0;
}
@@ -9907,6 +9910,9 @@ int status_change_timer_sub(struct block_list* bl, va_list ap)
switch( type ) {
case SC_SIGHT: /* ƒTƒCƒg */
+ if( tsc && tsc->data[SC__SHADOWFORM] && (sce && sce->val4 >0 && sce->val4%2000 == 0) && // for every 2 seconds do the checking
+ rnd()%100 < 100-tsc->data[SC__SHADOWFORM]->val1*10 ) // [100 - (Skill Level x 10)] %
+ status_change_end(bl, SC__SHADOWFORM, INVALID_TIMER);
case SC_CONCENTRATE:
status_change_end(bl, SC_HIDING, INVALID_TIMER);
status_change_end(bl, SC_CLOAKING, INVALID_TIMER);
@@ -9926,6 +9932,9 @@ int status_change_timer_sub(struct block_list* bl, va_list ap)
if(battle_check_target( src, bl, BCT_ENEMY ) > 0)
skill_attack(BF_MAGIC,src,src,bl,AL_RUWACH,1,tick,0);
}
+ if( tsc && tsc->data[SC__SHADOWFORM] && (sce && sce->val4 >0 && sce->val4%2000 == 0) && // for every 2 seconds do the checking
+ rnd()%100 < 100-tsc->data[SC__SHADOWFORM]->val1*10 ) // [100 - (Skill Level x 10)] %
+ status_change_end(bl, SC__SHADOWFORM, INVALID_TIMER);
break;
case SC_SIGHTBLASTER:
if (battle_check_target( src, bl, BCT_ENEMY ) > 0 &&