[Release] My Services

Status
Not open for further replies.
HI uhm can you make me a script so when I click on the 'Trade' button it takes you to FM
EnterMTSHandler.java
​
Code:
/*
    This file is part of the OdinMS Maple Story Server
    Copyright (C) 2008 Patrick Huy <[email protected]> 
                       Matthias Butz <[email protected]>
                       Jan Christian Meyer <[email protected]>

    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 net.sf.odinms.net.channel.handler;

import net.sf.odinms.client.MapleClient;
import net.sf.odinms.client.messages.ServernoticeMapleClientMessageCallback;
import net.sf.odinms.net.AbstractMaplePacketHandler;
import net.sf.odinms.net.channel.ChannelServer;
import net.sf.odinms.server.MaplePortal;
import net.sf.odinms.server.maps.MapleMap;
import net.sf.odinms.tools.MaplePacketCreator;
import net.sf.odinms.tools.data.input.SeekableLittleEndianAccessor;

public class EnterMTSHandler extends AbstractMaplePacketHandler {
    @Override
    public void handlePacket(SeekableLittleEndianAccessor slea, MapleClient c) {
            /*
        new ServernoticeMapleClientMessageCallback(5, c).dropMessage("The MTS is not available.");
        c.getSession().write(MaplePacketCreator.enableActions());
        //c.getSession().write(MaplePacketCreator.sendMTS());
             */    
            final int teleportTo = 910000000;
            c.getPlayer().saveLocation(SavedLocationType.FREE_MARKET);

            ChannelServer cserv = c.getChannelServer();
                    MapleMap target = cserv.getMapFactory().getMap(teleportTo);
            MaplePortal targetPortal = target.getPortal(0);
                        c.getPlayer().changeMap(target, targetPortal);
    }
}
Code:
final int teleportTo = <MAPID>
 
hey can u correc tthis NPC for me ?

it is to open other npcs
Code:
function start() { 
    cm.sendSimple ("Hello #h # ! I am Fredrick and i have travelled around the world and took some G-Star NPC's number. Pick one G-Star to talk to\r\n#L0#Job advancer (jm from the streets)#l\r\n#L1#the everything shop (cody)#l\r\n#L2#skill maxer (mia)#l\r\n#L3#pvp warper (amos the strong)#l\r\n#L4#warper (spinel)#l\r\n#L5#coloured item seller (casey)#l\r\n#L6#trophy quest (duey)#l\r\n#L7#trophy trader (mad bunny)#l\r\n#L8#nx seller (perion nana)#l\r\n#L9#resetter or adder (henesy nana)#l\r\n#L10#gm caller (jake)#l\r\n#L11#rebirther (mr.pickall)#l\r\n#L12#gambler (coco)#l\r\n#L13#first job bowman inst #l\r\n#L14#first job warrior inst #l\r\n#L15#first job magican inst #l\r\n#L16#first job thief inst #l"); 
} 

function action(mode, type, selection) { 
    cm.dispose(); 
    if (selection == 0) { 
        cm.openNpc (1052003); 
    } else if (selection == 1) { 
        cm.openNpc (9200000); 
    } else if (selection == 2) { 
        cm.openNpc (9010004); 
    } else if (selection == 3) { 
        cm.openNpc (9201043); 
    } else if (selection == 4) { 
        cm.openNpc (9000020); 
    } else if (selection == 5) { 
        cm.openNpc (1012008); 
    } else if (selection == 6) { 
        cm.openNpc (9010009); 
	} else if (selection == 7) { 
        cm.openNpc (9200001); 
	} else if (selection == 8) { 
        cm.openNpc (9201027); 
	} else if (selection == 9) { 
        cm.openNpc (9201001); 
	} else if (selection == 10) { 
        cm.openNpc (1052006); 
	} else if (selection == 11) { 
        cm.openNpc (9000008); 
	} else if (selection == 12) { 
        cm.openNpc (9000017); 
	} else if (selection == 13) { 
        cm.openNpc (1012100); 
	} else if (selection == 14) { 
        cm.openNpc (1022000); 
	} else if (selection == 15) { 
        cm.openNpc (1032001); 
	} else if (selection == 16) { 
        cm.openNpc (1052006); 
    } else { 
        cm.dispose(); 
    } 
}
it seems all ok. the function is here :
http://forum.ragezone.com/f427/release-new-opennpc-function-475009/
 
I don't know if it's something wrong with the npc or not but the girl that is supposed to evolve dragons isnt work here npc script:
it works it just doesnt evolve pets:
PHP:
/*
	Made by RMZero213 of RaGEZONE forums.
	Just keep this header here and don't claim that you made it.
 */

/*
	1032102.js
	Mar the Fairy
	Dragon Evolver
 */

importPackage(net.sf.odinms.client);
importPackage(net.sf.odinms.server);

var status = 0;

function start() {
    status = -1;
    action(1, 0, 0);
}

function action(mode, type, selection) {
    if (mode == -1) {
        cm.dispose();
    } else {
        if (mode == 0) {
            cm.sendOk("Alright, see you next time.");
            cm.dispose();
            return;
        }
        if (mode == 1)
            status++;
        else
            status--;
        if (status == 0) {
            cm.sendYesNo("I am Mar the Fairy. If you have a dragon at level 15 or higher and a rock of evolution. I can evolve your dragon. If you are lucky, you may even get a black one! Would you like me to do so?");
        } else if (status == 1) {
            if (cm.haveItem(5000028, 1)) {
                cm.gainItem(5000028, -1);
                cm.gainItem(5000029, 1);
                cm.sendOk("I don't know how you got that egg, but it has hatched, apparently!");
                cm.dispose();
            } else if (cm.getPlayer().getNoPets() <= 0) {
                cm.sendOk("Make sure your pet is equipped.");
                cm.dispose();
            } else if (cm.getPlayer().getPet(0).getItemId() < 5000029 || cm.getPlayer().getPet(0).getItemId() > 5000033 || !cm.haveItem(5380000,1)) {
                cm.sendOk("You do not meet the requirements. You need #i5380000##t5380000#, as well as either one of #d#i5000029##t5000029##k, #g#i5000030##t5000030##k, #r#i5000031##t5000031##k, #b#i5000032##t5000032##k, or #e#i5000033##t5000033##n equipped as your #eBoss pet.#n. Please come back when you do.");
                cm.dispose();
            } else if (cm.getPlayer().getPet(0).getLevel() < 15) {
                cm.sendOk("Your pet must be level 15 or above to evolve.");
                cm.dispose();
            } else if (cm.haveItem(5000029,2) || cm.haveItem(5000030,2) || cm.haveItem(5000031,2) || cm.haveItem(5000032,2) || cm.haveItem(5000033,2)) {
                cm.sendSimple("You have a dragon which isn't out, and as well as a dragon which is out. I can remove one for you. Remember that the data for the dragon I am removing will be lost.\r\n#r#L0#Remove my CASH first slot.#l#k\r\n#b#L1#Remove the first dragon in my inventory.#l#k\r\n#g#L2#No thanks.#l#k");
            } else {
                var id = cm.getPlayer().getPet(0).getItemId();
                var name = cm.getPlayer().getPet(0).getName();
                var level = cm.getPlayer().getPet(0).getLevel();
                var closeness = cm.getPlayer().getPet(0).getCloseness();
                var fullness = cm.getPlayer().getPet(0).getFullness();
                var slot = cm.getPlayer().getInventory(MapleInventoryType.CASH).getNextFreeSlot();
                //MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
                if (id < 5000029 || id > 5000033) {
                    cm.sendOk("Something wrong, try again.");
                    cm.dispose();
                }
                var rand = 1 + Math.floor(Math.random() * 10);
                var after = 0;
                if (rand >= 1 && rand <= 3) {
                    after = 5000030;
                } else if (rand >= 4 && rand <= 6) {
                    after = 5000031;
                } else if (rand >= 7 && rand <= 9) {
                    after = 5000032;
                } else if (rand == 10) {
                    after = 5000033;
                } else {
                    cm.sendOk("Something wrong. Try again.");
                    cm.dispose();
                }
                if (name.equals(MapleItemInformationProvider.getInstance().getName(id))) {
                    name = MapleItemInformationProvider.getInstance().getName(after);
                }
                cm.unequipPet();
                cm.gainItem(5380000, -1);
                cm.gainItem(id, -1);
                cm.gainPet(after, name, level, closeness, fullness);
                cm.spawnPet(slot);
                cm.sendOk("Your dragon has now evolved!! It used to be a #i" + id + "##t" + id + "#, and now it's a #i" + after + "##t" + after + "#!");
                cm.dispose();
            }
        } else if (status == 2) {
            if (selection == 0) {
                MapleInventoryManipulator.removeFromSlot(cm.getC(), MapleInventoryType.CASH, 1, 1, true);
                cm.sendOk("Your cash first slot is removed.");
            } else if (selection == 1) {
                if (cm.haveItem(5000029, 2)) {
                    cm.gainItem(5000029, -1);
                } else if (cm.haveItem(5000030, 2)) {
                    cm.gainItem(5000030, -1);
                } else if (cm.haveItem(5000031, 2)) {
                    cm.gainItem(5000031, -1);
                } else if (cm.haveItem(5000032, 2)) {
                    cm.gainItem(5000032, -1);
                } else if (cm.haveItem(5000033, 2)) {
                    cm.gainItem(5000033, -1);
                }
                cm.sendOk("The first dragon in your inventory is removed.");
            } else if (selection == 2) {
                cm.sendOk("Okay, come back next time.");
            }
            cm.dispose();
        }
    }
}
 
Hey there
i wanna ask for a thing about pet.. please tell me how to do it
how do i make pet stay on even if i change channel?
and how do i make pet spawn when i login? (only if i spawned him before logging of...)
how do i make the pet spawn when i come out of cash shio? (only if i spawned it before going in cash shop)
and how do i remove the hide skill when i come online
?
thanks in advance


p.s
in PlayerLoggedinHandler.java (wich is where the skill) i have :
SkillFactory.getSkill(9101004).getEffect(1).applyT o(player);
is it that?
because some 1 gave me a diffrent skill number...
thanks in advance
 
I would love to see a Proper Duey service. I'm sure you're not going to do it, but still. Lets try getting equal to GMS BEFORE we start coding random ass NPCs and useless ****.
 
Can you make a command that will say:

[Event] Monsters in FM 22

Then make it spawn some monsters?

Leave the areas where the monster ID's are blank. Ill insirt them
 
Status
Not open for further replies.
Back