viewing paste Unknown #632 | 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
BUILDIN_FUNC(homunculus_mutate)
{
    int homun_id, m_class, m_id;
    int homun_array = {6048,6049,6050,6051,6052};
    TBL_PC *sd;
 
    sd = script_rid2sd(st);
    if( sd == NULL )
        return 0;
 
    if(script_hasdata(st,2))
        homun_id = script_getnum(st,2);
    else
        homun_id = homun_array[rnd() % 5]:
 
    if(merc_is_hom_active(sd->hd)) {
        m_class = hom_class2mapid(sd->hd->homunculus.class_);
        m_id    = hom_class2mapid(homun_id);
        
        if ( m_class&HOM_EVO && m_id&HOM_S && sd->hd->homunculus.level >= 99 )
            hom_mutate(sd->hd, homun_id);
        else
            clif_emotion(&sd->hd->bl, E_SWT);
    }
    return 0;
}
Viewed 557 times, submitted by Guest.