Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

Solaxia different channel with different global items?

Elite Diviner
Joined
Dec 10, 2012
Messages
475
Reaction score
9
Hello guys, So I knew that adding an item for all mob can be done in drop_data_global.
I was wondering if there's a way to make channel 1 drop A, but channel 2 drop B and not A?
 
Junior Spellweaver
Joined
Apr 5, 2008
Messages
152
Reaction score
65
Add a channel column to the db in that table, 0 for all channels.

Then just check the channel when going through those.
 
Upvote 0
Elite Diviner
Joined
Dec 10, 2012
Messages
475
Reaction score
9
Add a channel column to the db in that table, 0 for all channels.

Then just check the channel when going through those.

I have added a column to the DB and added the channel line somehere in MapleItemInformationProvider? ( not sure because I am not using the PC with the files now )
Then when I put channel 0 in drop_data_global both channel wont drop anything, but if I put channel 1 in drop_data_global, all channels will drop the item instead of just channel 1.
 
Upvote 0
Junior Spellweaver
Joined
Apr 5, 2008
Messages
152
Reaction score
65
It actually needs to be in MapleMap.java, there is a for loop that handles MonsterGlobalDropEntry drops. Check the channel for the drop, and the channel for the player there.
 
Upvote 0
Elite Diviner
Joined
Dec 10, 2012
Messages
475
Reaction score
9
This is what I did, sorry for not updating here as I had a final exam last week.

MonsterGlobalEntry.java
PHP:
/*
	This file is part of the OdinMS Maple Story Server
    Copyright (C) 2008 ~ 2010 Patrick Huy <patrick.huy@frz.cc>
                       Matthias Butz <matze@odinms.de>
                       Jan Christian Meyer <vimes@odinms.de>

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU Affero General Public License version 3
    as published by the Free Software Foundation. You may not use, modify
    or distribute this program under any other version of the
    GNU Affero General Public License.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU Affero General Public License for more details.

    You should have received a copy of the GNU Affero General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/
package server.life;

import java.nio.channels.Channel;

/**
 *
 * @author LightPepsi
 */
public class MonsterGlobalDropEntry {
    public MonsterGlobalDropEntry(int itemId, int chance, int continent, byte dropType, int Minimum, int Maximum, short questid, int Channel) {
    this.itemId = itemId;
    this.chance = chance;
    this.dropType = dropType;
    this.questid = questid;
    this.Minimum = Minimum;
    this.Maximum = Maximum;
    this.channel = Channel;
    }
    public byte dropType;
    public int itemId, chance, Minimum, Maximum;
    public short questid;
    public int channel;
}

Added a column to drop_data_global.

Currently stuck at the checking channel and players.

PHP:
        final List<MonsterGlobalDropEntry> globalEntry = mi.getGlobalDrop();
        // Global Drops
        for (final MonsterGlobalDropEntry de : globalEntry) {
            if (Randomizer.nextInt(999999) < de.chance) {
                if (droptype == 3) {
                    pos.x = (int) (mobpos + (d % 2 == 0 ? (40 * (d + 1) / 2) : -(40 * (d / 2))));
                } else {
                    pos.x = (int) (mobpos + ((d % 2 == 0) ? (25 * (d + 1) / 2) : -(25 * (d / 2))));
                }
                if (de.itemId == 0) {
                    //chr.getCashShop().gainCash(1, 80);
                } else {
                    if (ItemConstants.getInventoryType(de.itemId) == MapleInventoryType.EQUIP) {
                        idrop = ii.randomizeStats((Equip) ii.getEquipById(de.itemId));
                    } else {
                        idrop = new Item(de.itemId, (short) 0, (short) (de.Maximum != 1 ? Randomizer.nextInt(de.Maximum - de.Minimum) + de.Minimum : 1));
                    }
                    [B]spawnDrop(idrop, calcDropPos(pos, mob.getPosition()), mob, chr, droptype, de.questid);[/B]
                    d++;
                }
            }
        }

I assume I have to do changes to do bolded texts?
 
Upvote 0
Skilled Illusionist
Joined
Jul 17, 2010
Messages
333
Reaction score
165
I assume you have a 'channel' variable in the MapleMap.

then you can skip them by using 'continue' in a for loop.
Code:
for (final MonsterGlobalDropEntry de : globalEntry) {
    [B]if (de.channel != 0 && de.channel != this.channel) {
        continue;
    }[/B]
    if (Randomizer.nextInt(999999) < de.chance) {

or, just add a if-statement.
Code:
for (final MonsterGlobalDropEntry de : globalEntry) {
    [B]if (de.channel == 0 || de.channel == this.channel) {[/B]
        if (Randomizer.nextInt(999999) < de.chance) {
            //~snip~
        }
    [B]}[/B]
}
* channel id ~-1: disabled, 0: enabled on all channels, 1~: enabled on a specified channel
 
Upvote 0
Back
Top