viewing paste Unknown #17780 | 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 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87
int status_change_spread( struct block_list *src, struct block_list *bl ) {
    int i, flag = 0;
    struct status_change *sc = status->get_sc(src);
    int64 tick;
    struct status_change_data data;
 
    if( !sc || !sc->count )
        return 0;
 
    tick = timer->gettick();
 
    for( i = SC_COMMON_MIN; i < SC_MAX; i++ ) {
        if( !sc->data[i] || i == SC_COMMON_MAX )
            continue;
 
        switch( i ) {
            //Debuffs that can be spreaded.
            // NOTE: We'll add/delte SCs when we are able to confirm it.
        case SC_CURSE:
        case SC_SILENCE:
        case SC_CONFUSION:
        case SC_BLIND:
        case SC_NOCHAT:
        case SC_ILLUSION:
        case SC_CRUCIS:
        case SC_DEC_AGI:
        case SC_SLOWDOWN:
        case SC_MINDBREAKER:
        case SC_DC_WINKCHARM:
        case SC_STOP:
        case SC_ORCISH:
            //case SC_NOEQUIPWEAPON://Omg I got infected and had the urge to strip myself physically.
            //case SC_NOEQUIPSHIELD://No this is stupid and shouldnt be spreadable at all.
            //case SC_NOEQUIPARMOR:// Disabled until I can confirm if it does or not. [Rytech]
            //case SC_NOEQUIPHELM:
            //case SC__STRIPACCESSARY:
        case SC_WUGBITE:
        case SC_FROSTMISTY:
        case SC_VENOMBLEED:
        case SC_DEATHHURT:
        case SC_PARALYSE:
            if( sc->data[i]->timer != INVALID_TIMER ) {
                const struct TimerData *td = timer->get(sc->data[i]->timer);
                if (td == NULL || td->func != status->change_timer || DIFF_TICK(td->tick,tick) < 0)
                    continue;
                data.tick = DIFF_TICK32(td->tick,tick);
            } else
                data.tick = INVALID_TIMER;
            break;
            // Special cases
        case SC_POISON:
        case SC_DPOISON:
            data.tick = sc->data[i]->val3 * 1000;
            break;
        case SC_FEAR:
        case SC_LEECHESEND:
            data.tick = sc->data[i]->val4 * 1000;
            break;
        case SC_BURNING:
            data.tick = sc->data[i]->val4 * 2000;
            break;
        case SC_PYREXIA:
        case SC_OBLIVIONCURSE:
            data.tick = sc->data[i]->val4 * 3000;
            break;
        case SC_MAGICMUSHROOM:
            data.tick = sc->data[i]->val4 * 4000;
            break;
        case SC_TOXIN:
        case SC_BLOODING:
            data.tick = sc->data[i]->val4 * 10000;
            break;
        default:
            continue;
        }
        if( i ) {
            data.val1 = sc->data[i]->val1;
            data.val2 = sc->data[i]->val2;
            data.val3 = sc->data[i]->val3;
            data.val4 = sc->data[i]->val4;
            status->change_start(src,bl,(sc_type)i,10000,data.val1,data.val2,data.val3,data.val4,data.tick,SCFLAG_NOAVOID|SCFLAG_FIXEDTICK|SCFLAG_FIXEDRATE);
            flag = 1;
        }
    }
 
    return flag;
}
Viewed 1035 times, submitted by milk.