|
@@ -13012,23 +13012,49 @@ static int skill_unit_onplace(struct skill_unit *unit, struct block_list *bl, un
|
|
skill_id = sg->skill_id; //In case the group is deleted, we need to return the correct skill id, still.
|
|
skill_id = sg->skill_id; //In case the group is deleted, we need to return the correct skill id, still.
|
|
switch (sg->unit_id) {
|
|
switch (sg->unit_id) {
|
|
case UNT_SPIDERWEB:
|
|
case UNT_SPIDERWEB:
|
|
- if( sc && sc->data[SC_SPIDERWEB] && sc->data[SC_SPIDERWEB]->val1 > 0 ) {
|
|
|
|
- // If you are fiberlocked and can't move, it will only increase your fireweakness level. [Inkfish]
|
|
|
|
- sc->data[SC_SPIDERWEB]->val2++;
|
|
|
|
- break;
|
|
|
|
- } else if( sc && battle_check_target(&unit->bl,bl,sg->target_flag) > 0 ) {
|
|
|
|
- int sec = skill_get_time2(sg->skill_id,sg->skill_lv);
|
|
|
|
- if( status_change_start(ss, bl,type,10000,sg->skill_lv,1,sg->group_id,0,sec,SCSTART_NORATEDEF) ) {
|
|
|
|
- const struct TimerData* td = sc->data[type]?get_timer(sc->data[type]->timer):NULL;
|
|
|
|
- if( td )
|
|
|
|
- sec = DIFF_TICK(td->tick, tick);
|
|
|
|
- map_moveblock(bl, unit->bl.x, unit->bl.y, tick);
|
|
|
|
- clif_fixpos(bl);
|
|
|
|
- sg->val2 = bl->id;
|
|
|
|
|
|
+ if (sc) {
|
|
|
|
+ //Duration in PVM is: 1st - 8s, 2nd - 16s, 3rd - 8s
|
|
|
|
+ //Duration in PVP is: 1st - 4s, 2nd - 8s, 3rd - 12s
|
|
|
|
+ int sec = skill_get_time2(sg->skill_id, sg->skill_lv);
|
|
|
|
+ const struct TimerData* td;
|
|
|
|
+ if (map_flag_vs(bl->m))
|
|
|
|
+ sec /= 2;
|
|
|
|
+ if (sc->data[type]) {
|
|
|
|
+ if (sc->data[type]->val2 && sc->data[type]->val3 && sc->data[type]->val4) {
|
|
|
|
+ //Already triple affected, immune
|
|
|
|
+ sg->limit = DIFF_TICK(tick, sg->tick);
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ //Don't increase val1 here, we need a higher val in status_change_start so it overwrites the old one
|
|
|
|
+ if (map_flag_vs(bl->m) && sc->data[type]->val1 < 3)
|
|
|
|
+ sec *= (sc->data[type]->val1 + 1);
|
|
|
|
+ else if(!map_flag_vs(bl->m) && sc->data[type]->val1 < 2)
|
|
|
|
+ sec *= (sc->data[type]->val1 + 1);
|
|
|
|
+ //Add group id to status change
|
|
|
|
+ if (sc->data[type]->val2 == 0)
|
|
|
|
+ sc->data[type]->val2 = sg->group_id;
|
|
|
|
+ else if (sc->data[type]->val3 == 0)
|
|
|
|
+ sc->data[type]->val3 = sg->group_id;
|
|
|
|
+ else if (sc->data[type]->val4 == 0)
|
|
|
|
+ sc->data[type]->val4 = sg->group_id;
|
|
|
|
+ //Overwrite status change with new duration
|
|
|
|
+ if (td = get_timer(sc->data[type]->timer))
|
|
|
|
+ status_change_start(ss, bl, type, 10000, sc->data[type]->val1 + 1, sc->data[type]->val2, sc->data[type]->val3, sc->data[type]->val4,
|
|
|
|
+ max(DIFF_TICK(td->tick, tick), sec), SCSTART_NORATEDEF);
|
|
}
|
|
}
|
|
- else
|
|
|
|
- sec = 3000; //Couldn't trap it?
|
|
|
|
- sg->limit = DIFF_TICK(tick,sg->tick)+sec;
|
|
|
|
|
|
+ else {
|
|
|
|
+ if (status_change_start(ss, bl, type, 10000, 1, sg->group_id, 0, 0, sec, SCSTART_NORATEDEF)) {
|
|
|
|
+ td = sc->data[type] ? get_timer(sc->data[type]->timer) : NULL;
|
|
|
|
+ if (td)
|
|
|
|
+ sec = DIFF_TICK(td->tick, tick);
|
|
|
|
+ map_moveblock(bl, unit->bl.x, unit->bl.y, tick);
|
|
|
|
+ clif_fixpos(bl);
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ sec = 3000; //Couldn't trap it?
|
|
|
|
+ }
|
|
|
|
+ sg->val2 = bl->id;
|
|
|
|
+ sg->limit = DIFF_TICK(tick, sg->tick) + sec;
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
case UNT_SAFETYWALL:
|
|
case UNT_SAFETYWALL:
|
|
@@ -14054,7 +14080,7 @@ int skill_unit_onout(struct skill_unit *src, struct block_list *bl, unsigned int
|
|
type = status_skill2sc(sg->skill_id);
|
|
type = status_skill2sc(sg->skill_id);
|
|
sce = (sc && type != -1)?sc->data[type]:NULL;
|
|
sce = (sc && type != -1)?sc->data[type]:NULL;
|
|
|
|
|
|
- if( bl->prev==NULL || (status_isdead(bl) && sg->unit_id != UNT_ANKLESNARE && sg->unit_id != UNT_SPIDERWEB) ) //Need to delete the trap if the source died.
|
|
|
|
|
|
+ if (bl->prev == NULL || (status_isdead(bl) && sg->unit_id != UNT_ANKLESNARE)) //Need to delete the trap if the source died.
|
|
return 0;
|
|
return 0;
|
|
|
|
|
|
switch(sg->unit_id){
|
|
switch(sg->unit_id){
|
|
@@ -18081,6 +18107,23 @@ static int skill_unit_timer_sub(DBKey key, DBData *data, va_list ap)
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
|
|
|
|
|
|
+ case UNT_SPIDERWEB:
|
|
|
|
+ {
|
|
|
|
+ struct block_list* target = map_id2bl(group->val2);
|
|
|
|
+ struct status_change *sc;
|
|
|
|
+ //Clear group id from status change
|
|
|
|
+ if (target && (sc = status_get_sc(target)) != NULL && sc->data[SC_SPIDERWEB]) {
|
|
|
|
+ if (sc->data[SC_SPIDERWEB]->val2 == group->group_id)
|
|
|
|
+ sc->data[SC_SPIDERWEB]->val2 = 0;
|
|
|
|
+ else if (sc->data[SC_SPIDERWEB]->val3 == group->group_id)
|
|
|
|
+ sc->data[SC_SPIDERWEB]->val3 = 0;
|
|
|
|
+ else if (sc->data[SC_SPIDERWEB]->val4 == group->group_id)
|
|
|
|
+ sc->data[SC_SPIDERWEB]->val4 = 0;
|
|
|
|
+ }
|
|
|
|
+ skill_delunit(unit);
|
|
|
|
+ }
|
|
|
|
+ break;
|
|
|
|
+
|
|
case UNT_REVERBERATION:
|
|
case UNT_REVERBERATION:
|
|
case UNT_NETHERWORLD:
|
|
case UNT_NETHERWORLD:
|
|
if( unit->val1 <= 0 ) { // If it was deactivated.
|
|
if( unit->val1 <= 0 ) { // If it was deactivated.
|