Excellzone

Forum and disscussions since 2010


You are not connected. Please login or register

View previous topic View next topic Go down Message [Page 1 of 1]

#1
Excell

avatar
Head Administer
Head Administer
Code:
[color=#000000][color=#007700]public [/color][color=#0000BB]boolean gainItem[/color][color=#007700]([/color][color=#0000BB]int id[/color][color=#007700], [/color][color=#0000BB]short quantity[/color][color=#007700], [/color][color=#0000BB]boolean randomStats[/color][color=#007700], [/color][color=#0000BB]boolean show[/color][color=#007700]) {
        if ([/color][color=#0000BB]quantity [/color][color=#007700]>= [/color][color=#0000BB]0[/color][color=#007700]) {
            [/color][color=#0000BB]MapleItemInformationProvider ii [/color][color=#007700]= [/color][color=#0000BB]MapleItemInformationProvider[/color][color=#007700].[/color][color=#0000BB]getInstance[/color][color=#007700]();
            [/color][color=#0000BB]IItem item [/color][color=#007700]= [/color][color=#0000BB]ii[/color][color=#007700].[/color][color=#0000BB]getEquipById[/color][color=#007700]([/color][color=#0000BB]id[/color][color=#007700]);
            [/color][color=#0000BB]MapleInventoryType type [/color][color=#007700]= [/color][color=#0000BB]ii[/color][color=#007700].[/color][color=#0000BB]getInventoryType[/color][color=#007700]([/color][color=#0000BB]id[/color][color=#007700]);
            if ([/color][color=#0000BB]type[/color][color=#007700].[/color][color=#0000BB]equals[/color][color=#007700]([/color][color=#0000BB]MapleInventoryType[/color][color=#007700].[/color][color=#0000BB]EQUIP[/color][color=#007700]) && ![/color][color=#0000BB]ii[/color][color=#007700].[/color][color=#0000BB]isThrowingStar[/color][color=#007700]([/color][color=#0000BB]item[/color][color=#007700].[/color][color=#0000BB]getItemId[/color][color=#007700]()) && ![/color][color=#0000BB]ii[/color][color=#007700].[/color][color=#0000BB]isBullet[/color][color=#007700]([/color][color=#0000BB]item[/color][color=#007700].[/color][color=#0000BB]getItemId[/color][color=#007700]())) {
                if (![/color][color=#0000BB]getInventory[/color][color=#007700]([/color][color=#0000BB]type[/color][color=#007700]).[/color][color=#0000BB]isFull[/color][color=#007700]()) {
                    if ([/color][color=#0000BB]randomStats[/color][color=#007700]) {
                        [/color][color=#0000BB]MapleInventoryManipulator[/color][color=#007700].[/color][color=#0000BB]addFromDrop[/color][color=#007700]([/color][color=#0000BB]getClient[/color][color=#007700](), [/color][color=#0000BB]ii[/color][color=#007700].[/color][color=#0000BB]randomizeStats[/color][color=#007700]([/color][color=#0000BB]getClient[/color][color=#007700](), ([/color][color=#0000BB]Equip[/color][color=#007700]) [/color][color=#0000BB]item[/color][color=#007700]), [/color][color=#0000BB]false[/color][color=#007700]);
                    } else {
                        [/color][color=#0000BB]MapleInventoryManipulator[/color][color=#007700].[/color][color=#0000BB]addFromDrop[/color][color=#007700]([/color][color=#0000BB]getClient[/color][color=#007700](), ([/color][color=#0000BB]Equip[/color][color=#007700]) [/color][color=#0000BB]item[/color][color=#007700], [/color][color=#0000BB]false[/color][color=#007700]);
                    }
                } else {

                    [/color][color=#0000BB]dropMessage[/color][color=#007700]([/color][color=#0000BB]1[/color][color=#007700], [/color][color=#DD0000]"Your inventory is full. Please remove an item from your " [/color][color=#007700]+ [/color][color=#0000BB]type[/color][color=#007700].[/color][color=#0000BB]name[/color][color=#007700]().[/color][color=#0000BB]toLowerCase[/color][color=#007700]() + [/color][color=#DD0000]" inventory."[/color][color=#007700]);
                    return [/color][color=#0000BB]false[/color][color=#007700];
                }
            } else if ([/color][color=#0000BB]MapleInventoryManipulator[/color][color=#007700].[/color][color=#0000BB]checkSpace[/color][color=#007700]([/color][color=#0000BB]getClient[/color][color=#007700](), [/color][color=#0000BB]id[/color][color=#007700], [/color][color=#0000BB]quantity[/color][color=#007700], [/color][color=#DD0000]""[/color][color=#007700])) {
                if ([/color][color=#0000BB]id [/color][color=#007700]>= [/color][color=#0000BB]5000000 [/color][color=#007700]&& [/color][color=#0000BB]id [/color][color=#007700]<= [/color][color=#0000BB]5000100[/color][color=#007700]) {
                    if ([/color][color=#0000BB]quantity [/color][color=#007700]> [/color][color=#0000BB]1[/color][color=#007700]) {
                        [/color][color=#0000BB]quantity [/color][color=#007700]= [/color][color=#0000BB]1[/color][color=#007700];
                    }
                    [/color][color=#0000BB]int petId [/color][color=#007700]= [/color][color=#0000BB]MaplePet[/color][color=#007700].[/color][color=#0000BB]createPet[/color][color=#007700]([/color][color=#0000BB]id[/color][color=#007700]);
                    [/color][color=#0000BB]MapleInventoryManipulator[/color][color=#007700].[/color][color=#0000BB]addById[/color][color=#007700]([/color][color=#0000BB]getClient[/color][color=#007700](), [/color][color=#0000BB]id[/color][color=#007700], ([/color][color=#0000BB]short[/color][color=#007700]) [/color][color=#0000BB]1[/color][color=#007700], [/color][color=#0000BB]null[/color][color=#007700], [/color][color=#0000BB]petId[/color][color=#007700]);
                    if ([/color][color=#0000BB]show[/color][color=#007700]) {
                        [/color][color=#0000BB]this[/color][color=#007700].[/color][color=#0000BB]getClient[/color][color=#007700]().[/color][color=#0000BB]getSession[/color][color=#007700]().[/color][color=#0000BB]write[/color][color=#007700]([/color][color=#0000BB]MaplePacketCreator[/color][color=#007700].[/color][color=#0000BB]getShowItemGain[/color][color=#007700]([/color][color=#0000BB]id[/color][color=#007700], [/color][color=#0000BB]quantity[/color][color=#007700]));
                    }
                } else {
                    [/color][color=#0000BB]MapleInventoryManipulator[/color][color=#007700].[/color][color=#0000BB]addById[/color][color=#007700]([/color][color=#0000BB]getClient[/color][color=#007700](), [/color][color=#0000BB]id[/color][color=#007700], [/color][color=#0000BB]quantity[/color][color=#007700], [/color][color=#DD0000]""[/color][color=#007700]);
                }
            } else {

                [/color][color=#0000BB]dropMessage[/color][color=#007700]([/color][color=#0000BB]1[/color][color=#007700], [/color][color=#DD0000]"Your inventory is full. Please remove an item from your " [/color][color=#007700]+ [/color][color=#0000BB]type[/color][color=#007700].[/color][color=#0000BB]name[/color][color=#007700]().[/color][color=#0000BB]toLowerCase[/color][color=#007700]() + [/color][color=#DD0000]" inventory."[/color][color=#007700]);
                return [/color][color=#0000BB]false[/color][color=#007700];
            }
            if ([/color][color=#0000BB]show[/color][color=#007700]) {
                [/color][color=#0000BB]this[/color][color=#007700].[/color][color=#0000BB]getClient[/color][color=#007700]().[/color][color=#0000BB]getSession[/color][color=#007700]().[/color][color=#0000BB]write[/color][color=#007700]([/color][color=#0000BB]MaplePacketCreator[/color][color=#007700].[/color][color=#0000BB]getShowItemGain[/color][color=#007700]([/color][color=#0000BB]id[/color][color=#007700], [/color][color=#0000BB]quantity[/color][color=#007700], [/color][color=#0000BB]true[/color][color=#007700]));
            }
        } else {
            [/color][color=#0000BB]MapleInventoryManipulator[/color][color=#007700].[/color][color=#0000BB]removeById[/color][color=#007700]([/color][color=#0000BB]getClient[/color][color=#007700](), [/color][color=#0000BB]MapleItemInformationProvider[/color][color=#007700].[/color][color=#0000BB]getInstance[/color][color=#007700]().[/color][color=#0000BB]getInventoryType[/color][color=#007700]([/color][color=#0000BB]id[/color][color=#007700]), [/color][color=#0000BB]id[/color][color=#007700], -[/color][color=#0000BB]quantity[/color][color=#007700], [/color][color=#0000BB]false[/color][color=#007700], [/color][color=#0000BB]false[/color][color=#007700]);
        }
        return [/color][color=#0000BB]true[/color][color=#007700];
    }
[/color][/color]

View user profile http://excellzone.mrforum.net

View previous topic View next topic Back to top Message [Page 1 of 1]


Permissions in this forum:
You cannot reply to topics in this forum