viewing paste Unknown #6324 | 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
/*==========================================
 * Endows a Weapon for 30mins @ 15k Zeny.
 *------------------------------------------*/
ACMD_FUNC(endow)
{
    int zeny = 15000, endow = 0;
    nullpo_retr(-1, sd);
    endow = atoi(message);
 
    if (!message || !*message || !endow || endow < 1 || endow > 7)
    {
        clif_displaymessage(fd, "To use @endow you have to specify the Element you want.");
        clif_displaymessage(fd, "Usage: @endow 1 = fire / 2 = earth / 3 = wind / 4 = water / 5 = holy / 6 = shadow or 7 = poison.");
        return -1;
    }
 
    if(sd->status.zeny < zeny)
    {
        clif_displaymessage(fd, "Sorry, but you do not have enough Zeny to use @endow. @endow cost = 15k Zeny.");
        return -1;
    }
 
    if ((map[sd->bl.m].flag.gvg) || (map[sd->bl.m].flag.pvp))
    {
        clif_displaymessage(fd, "Sorry, but you can't use @endow on PvP or GvG Maps.");
        return -1;
    }
 
    sd->status.zeny = sd->status.zeny-zeny;
    clif_updatestatus(sd, SP_ZENY);
    switch(endow)
    {
        case 1: sc_start(&sd->bl,SC_FIREWEAPON,100,5,1800000); break;
        case 2: sc_start(&sd->bl,SC_EARTHWEAPON,100,5,1800000); break;
        case 3: sc_start(&sd->bl,SC_WINDWEAPON,100,5,1800000); break;
        case 4: sc_start(&sd->bl,SC_WATERWEAPON,100,5,1800000); break;
        case 5: sc_start(&sd->bl,SC_ASPERSIO,100,5,1800000); break;
        case 6: sc_start(&sd->bl,SC_SHADOWWEAPON,100,5,1800000); break;
        case 7: sc_start(&sd->bl,SC_ENCPOISON,100,5,1800000); break;
    }
    clif_displaymessage(fd, "You've received Endow for 30 Minutes, have fun with it!");
 
    return 0;
}
Viewed 820 times, submitted by Guest.