viewing paste camouflage_timered | C

Posted on the
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
case SC_CAMOUFLAGE:
            if (!status_charge(bl, 0, 7 - sce->val1))
                break;
            if (sd) {
                if ((sce->val2 & 1) != 1) {
                    status->cri += sd->base_status.cri * 1 / 10; //+10% per second
                    if (status->cri > 1000) { //max 100%
                        status->cri = 1000;
                        sce->val2 |= 1;
                    }
                    clif_updatestatus(sd, SP_CRITICAL);
                }
                if ((sce->val2 & 2) != 2) {
                    status->def2 -= sd->base_status.def2 * 1 / 20; //-5% per second
                    if (status->def2 < 0) { //min 0
                        status->def2 = 0;
                        sce->val2 |= 2;
                    }
                    clif_updatestatus(sd, SP_DEF1);
                }
                sce->val4++;
                if ((sce->val4) < 11) {
                    status->rhw.atk += 30;
                    clif_updatestatus(sd, SP_ATK2);
                }
            }
            sc_timer_next(1000 + tick, status_change_timer, bl->id, data);
            return 0;
Viewed 1185 times, submitted by lighta.