public final void gainGP(int amount, final boolean broadcast, final int cid) {
        if (amount == 0) { //no change, no broadcast and no sql.
            return;
        }
        if (amount + gp < 0) {
            amount = -gp;
        } //0 lowest
        if (cid > 0 && amount > 0) {
            final MapleGuildCharacter mg = getMGC(cid);
            if (mg != null) {
                mg.setGuildContribution(mg.getGuildContribution() + amount);
                if (mg.isOnline()) {
                    World.Guild.setGuildAndRank(cid, this.id, mg.getGuildRank(), mg.getGuildContribution(), mg.getAllianceRank());
                } else {
                    setOfflineGuildStatus(this.id, mg.getGuildRank(), mg.getGuildContribution(), mg.getAllianceRank(), cid);
                }
                broadcast(GuildPacket.guildContribution(id, cid, mg.getGuildContribution()));
            }
        }
        gp += amount;
        level = calculateLevel();
        broadcast(GuildPacket.updateGP(id, gp, level));
        if (broadcast) {
            broadcast(InfoPacket.getGPMsg(amount));
        }
    }