viewing paste Unknown #5929 | 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
/*==========================================
 * Puts homunculus into morph state
 * and gives ITEMID_STRANGE_EMBRYO.
 *------------------------------------------*/
BUILDIN_FUNC(morphembryo)
{
    struct item item_tmp;
    int m_class, i=0;
    TBL_PC *sd;
 
    sd = script_rid2sd(st);
    if( sd == NULL || sd->hd == NULL )
        return 0;
 
    if( merc_is_hom_active(sd->hd) ) {
        m_class = hom_class2mapid(sd->hd->homunculus.class_);
 
        if ( m_class != -1 && m_class&HOM_EVO && sd->hd->homunculus.level >= 99 ) {
            memset(&item_tmp, 0, sizeof(item_tmp));
            item_tmp.nameid = ITEMID_STRANGE_EMBRYO;
            item_tmp.identify = 1;
 
            if( item_tmp.nameid == 0 || (i = pc_additem(sd, &item_tmp, 1, LOG_TYPE_SCRIPT)) ) {
                clif_additem(sd, 0, 0, i);
                clif_emotion(&sd->bl, E_SWT); // Fail to avoid item drop exploit.
            } else {
                merc_hom_vaporize(sd, HOM_ST_MORPH);
                script_pushint(st, 1);
                return 0;
            }
        } else
            clif_emotion(&sd->hd->bl, E_SWT);
    } else
        clif_emotion(&sd->bl, E_SWT);
 
    script_pushint(st, 0);
 
    return 0;
}
 
 
 
BUILDIN_FUNC(checkhomcall)
{
    TBL_PC *sd = script_rid2sd(st);
    TBL_HOM *hd;
 
    if( sd == NULL )
        return 0;
 
    hd = sd->hd;
 
    if( !hd )
        script_pushint(st, -1);
    else
        script_pushint(st, hd->homunculus.vaporize);
 
    return 0;
}
Viewed 1397 times, submitted by Streusel.