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!

GMS Like Snowball Event (Uses packets)

Custom Title Activated
Loyal Member
Joined
Jun 30, 2008
Messages
3,451
Reaction score
1,616
I saw that the Snowball release was bumped, and I had to release this snowball event because I find the other one stupid.
Why?Mine uses packets so no stupid checks in CloseRangeDamageHandler. And that Snowball Event was originally Bassoe's work.

net/RecvOpcode.java (v83)
PHP:
    SNOWBALL(0xD3),
    LEFT_KNOCKBACK(0xD4),

net/SendOpcode.java
PHP:
    ROLL_SNOWBALL(0x119),
    HIT_SNOWBALL(0x11A),
    SNOWBALL_MESSAGE(0x11B),
    LEFT_KNOCK_BACK(0x11C),
Want SendOpcode for other versions? REACTOR_DESTROY + 1

net/PacketProcessor.java
PHP:
            registerHandler(RecvOpcode.LEFT_KNOCKBACK, new LeftKnockbackHandler());
            registerHandler(RecvOpcode.SNOWBALL, new SnowballHandler());

net/channel/handler/LeftKnockbackHandler.java
PHP:
/*
	This file is part of the OdinMS Maple Story Server
    Copyright (C) 2008 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 as
    published by the Free Software Foundation 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.channel.handler;

import client.MapleClient;
import net.AbstractMaplePacketHandler;
import tools.MaplePacketCreator;
import tools.data.input.SeekableLittleEndianAccessor;

/**
 *
 * @author kevintjuh93
 */
public class LeftKnockbackHandler extends AbstractMaplePacketHandler {
        public void handlePacket(SeekableLittleEndianAccessor slea, final MapleClient c) {
            c.announce(MaplePacketCreator.leftKnockBack());
            c.announce(MaplePacketCreator.enableActions());
        }
}

net/channel/handler/SnowballHandler.java
PHP:
/*
This file is part of the OdinMS Maple Story Server
Copyright (C) 2008 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 as
published by the Free Software Foundation 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.channel.handler;

import client.MapleCharacter;
import client.MapleClient;
import net.AbstractMaplePacketHandler;
import server.events.MapleSnowball;
import server.maps.MapleMap;
import tools.data.input.SeekableLittleEndianAccessor;

/**
 *
 * @author kevintjuh93
 */
public final class SnowballHandler extends AbstractMaplePacketHandler{

    public void handlePacket(SeekableLittleEndianAccessor slea, MapleClient c) {
        //D3 00 02 00 00 A5 01
        MapleCharacter chr = c.getPlayer();
        MapleMap map = chr.getMap();
        final MapleSnowball snowball = map.getSnowball(chr.getTeam());
        final MapleSnowball othersnowball = map.getSnowball(chr.getTeam() == 0 ? (byte) 1 : 0);
        int what = slea.readByte();
        //slea.skip(4);

        if (snowball == null || othersnowball == null || snowball.getSnowmanHP() == 0) return;
        if ((System.currentTimeMillis() - chr.getLastSnowballAttack()) < 500) return;
        if (chr.getTeam() != (what % 2)) return;

        chr.setLastSnowballAttack(System.currentTimeMillis());
        int damage = 0;
        if (what < 2 && othersnowball.getSnowmanHP() > 0)
            damage = 10;
        else if (what == 2 || what == 3) {
            if (Math.random() < 0.03)
                damage = 45;
            else
                damage = 15;
        }

        if (what >= 0 && what <= 4)
            snowball.hit(what, damage);

    }
}

server/events/MapleEvent.java
PHP:
/*
    This file is part of the OdinMS Maple Story Server
    Copyright (C) 2008 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 as
    published by the Free Software Foundation 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.events;

/**
 *
 * @author kevintjuh93
 */
public class MapleEvent {
    private int mapid;
    private int limit;

    public MapleEvent(int mapid, int limit) {
        this.mapid = mapid;
        this.limit = limit;
    }

    public int getMapId() {
        return mapid;
    }

    public int getLimit() {
        return limit;
    }

    public void minusLimit() {
        this.limit--;
    }

    public void addLimit() {
        this.limit++;
    }
}

server/events/MapleSnowball.java
PHP:
/*
This file is part of the OdinMS Maple Story Server
Copyright (C) 2008 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 as
published by the Free Software Foundation 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.events;

import client.MapleCharacter;
import java.util.LinkedList;
import java.util.List;
import server.TimerManager;
import server.maps.MapleMap;
import tools.MaplePacketCreator;

/**
 *
 * @author kevintjuh93
 */
public class MapleSnowball {
    private MapleMap map;
    private int position = 0;
    private int hits = 25;
    private int snowmanhp = 7500;
    private boolean hittable = true;
    private int team;
    private boolean winner = false;
    List<MapleCharacter> characters = new LinkedList<MapleCharacter>();

    public MapleSnowball(int team, MapleMap map) {
        this.map = map;
        this.team = team;

        for (MapleCharacter chr : map.getCharacters()) {
            if (chr.getTeam() == team)
                characters.add(chr);
        }
    }

    public void startEvent() {
        for (MapleCharacter chr : characters) {
            if (chr != null) {
                chr.broadcast(MaplePacketCreator.rollSnowBall(false, 1, map.getSnowball(0), map.getSnowball(1)));
                chr.broadcast(MaplePacketCreator.getClock(600));
            }
        }
        TimerManager.getInstance().schedule(new Runnable() {
            @Override
            public void run() {
                if (map.getSnowball(team).getPosition() > map.getSnowball(team == 0 ? 1 : 0).getPosition()) {
                    for (MapleCharacter chr : characters) {
                        if (chr != null)
                            chr.broadcast(MaplePacketCreator.rollSnowBall(false, 3, map.getSnowball(0), map.getSnowball(0)));
                    }
                    winner = true;
                } else if (map.getSnowball(team == 0 ? 1 : 0).getPosition() > map.getSnowball(team).getPosition()) {
                    for (MapleCharacter chr : characters) {
                        if (chr != null)
                            chr.broadcast(MaplePacketCreator.rollSnowBall(false, 4, map.getSnowball(0), map.getSnowball(0)));
                    }
                    winner = true;
                } //Else
                warpOut();
            }
        }, 600000);

    }
    
    public boolean isHittable() {
        return hittable;
    }

    public void setHittable(boolean hit) {
        this.hittable = hit;
    }

    public int getPosition() {
        return position;
    }

    public int getSnowmanHP() {
        return snowmanhp;
    }

    public void setSnowmanHP(int hp) {
        this.snowmanhp = hp;
    }

    public void hit(int what, int damage) {
        if (what < 2)
            if (damage > 0)
                this.hits--;
        else {
            if (this.snowmanhp - damage < 0) {
                this.snowmanhp = 0;

                TimerManager.getInstance().schedule(new Runnable() {

                    @Override
                    public void run() {
                        setSnowmanHP(7500);
                        message(5);
                    }
                }, 10000);
            } else
                this.snowmanhp -= damage;
        map.broadcastMessage(MaplePacketCreator.rollSnowBall(false, 1, map.getSnowball(0), map.getSnowball(1)));
        }

        if (this.hits == 0) {
            this.position += 1;
            if (this.position == 45)
                map.getSnowball(team == 0 ? 1 : 0).message(1);
            else if (this.position == 290)
                map.getSnowball(team == 0 ? 1 : 0).message(2);
            else if (this.position == 560)
                map.getSnowball(team == 0 ? 1 : 0).message(3);
                
            this.hits = 25;
            map.broadcastMessage(MaplePacketCreator.rollSnowBall(false, 0, map.getSnowball(0), map.getSnowball(1)));
            map.broadcastMessage(MaplePacketCreator.rollSnowBall(false, 1, map.getSnowball(0), map.getSnowball(1)));
        }
        map.broadcastMessage(MaplePacketCreator.hitSnowBall(what, damage));
    }

    public void message(int message) {
        for (MapleCharacter chr : characters) {
            if (chr != null)
                chr.broadcast(MaplePacketCreator.snowballMessage(team, message));
        }
    }

    public void warpOut() {
        TimerManager.getInstance().schedule(new Runnable() {

            @Override
            public void run() {
                if (winner == true)
                    map.warpOutByTeam(team, 109050000);
                else
                    map.warpOutByTeam(team, 109050001);

                map.setSnowball(team, null);
            }
        }, 10000);
    }
}

tools/MaplePacketCreator.java
PHP:
    public static MaplePacket leftKnockBack() {
        MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter(2);
        mplew.writeShort(SendOpcode.LEFT_KNOCK_BACK.getValue());
        return mplew.getPacket();
    }

    public static MaplePacket rollSnowBall(boolean entermap, int type, MapleSnowball ball0, MapleSnowball ball1) {
        MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
        mplew.writeShort(SendOpcode.ROLL_SNOWBALL.getValue());
        if (entermap) {
            mplew.write0(21);
        } else {
            mplew.write(type);// 0 = move, 1 = roll, 2 is down disappear, 3 is up disappear
            mplew.writeInt(ball0.getSnowmanHP() / 75);
            mplew.writeInt(ball1.getSnowmanHP() / 75);
            mplew.writeShort(ball0.getPosition());//distance snowball down, 84 03 = max
            mplew.write(-1);
            mplew.writeShort(ball1.getPosition());//distance snowball up, 84 03 = max
            mplew.write(-1);
        }
        return mplew.getPacket();
    }

    public static MaplePacket hitSnowBall(int what, int damage) {
        MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter(7);
        mplew.writeShort(SendOpcode.HIT_SNOWBALL.getValue());
        mplew.write(what);
        mplew.writeInt(damage);
        return mplew.getPacket();
    }

    /**
     * Sends a Snowball Message<br>
     *
     * Possible values for <code>message</code>:<br>
     * 1: ... Team's snowball has passed the stage 1.<br>
     * 2: ... Team's snowball has passed the stage 2.<br>
     * 3: ... Team's snowball has passed the stage 3.<br>
     * 4: ... Team is attacking the snowman, stopping the progress<br>
     * 5: ... Team is moving again<br>
     *
     * @param message
     **/
    public static MaplePacket snowballMessage(int team, int message) {
        MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter(7);
        mplew.writeShort(SendOpcode.SNOWBALL_MESSAGE.getValue());
        mplew.write(team);// 0 is down, 1 is up
        mplew.writeInt(message);
        return mplew.getPacket();
    }

server/maps/MapleMap.java
PHP:
    private MapleSnowball snowball0 = null;
    private MapleSnowball snowball1 = null;
    
    public void setSnowball(int team, MapleSnowball ball) {
        switch (team) {
            case 0:
                this.snowball0 = ball;
		break;
            case 1:
		this.snowball1 = ball;
		break;
            default:
		break;
        }
    }

    public MapleSnowball getSnowball(int team) {
	switch (team) {
            case 0:
		return snowball0;
            case 1:
		return snowball1;
            default:
		return null;
	}
    }

    public void warpOutByTeam(int team, int mapid) {
        for (MapleCharacter chr : getCharacters()) {
            if (chr != null) {
                if (chr.getTeam() == team)
                    chr.changeMap(mapid);
            }
        }
    }
    
    public void startEvent(final MapleCharacter chr) {
        if (this.mapid == 109060000 && getSnowball(chr.getTeam()) == null) {
            setSnowball(0, new MapleSnowball(0, this));
            setSnowball(1, new MapleSnowball(1, this));
            getSnowball(chr.getTeam()).startEvent();
        }
    }

    public String getEventNPC() {
        if (mapid == 60000) {
            return "Talk to Paul!";
        } else if (mapid == 104000000) {
            return "Talk to Jean!";
        } else if (mapid == 200000000) {
            return "Talk to Martin!";
        } else if (mapid == 220000000) {
            return "Talk to Tony!";
        } else {
            return null;
        }
    }

    public boolean hasEventNPC() {
        return this.mapid == 60000 || this.mapid == 104000000 || this.mapid == 200000000 || this.mapid == 220000000;
    }
Inside addPlayer add:
PHP:
        if (mapid == 109060000)
            chr.broadcast(MaplePacketCreator.rollSnowBall(true, 0, null, null));

client/command/Commands.java
PHP:
        } else if (sub[0].equals("startevent")) {
            for (MapleCharacter chr : c.getPlayer().getMap().getCharacters()) {
                 c.getPlayer().getMap().startEvent(chr);
            }
            c.getChannelServer().setEvent(null);
        } else if (sub[0].equals("scheduleevent")) {
           if (c.getPlayer().getMap().hasEventNPC()) {
            if (sub[1].equals("treasure")) {
                c.getChannelServer().setEvent(new MapleEvent(109010000, 50));
            try {
                cserv.getWorldInterface().broadcastMessage(null, MaplePacketCreator.serverNotice(0, "Hello Scania let's play an event in " + player.getMap().getMapName() + " CH " + c.getChannel() + "! " + player.getMap().getEventNPC()).getBytes());
            } catch (Exception e) {
                cserv.reconnectWorld();
            }
            } else if (sub[1].equals("ox")) {
                c.getChannelServer().setEvent(new MapleEvent(109020001, 50));
            try {
                cserv.getWorldInterface().broadcastMessage(null, MaplePacketCreator.serverNotice(0, "Hello Scania let's play an event in " + player.getMap().getMapName() + " CH " + c.getChannel() + "! " + player.getMap().getEventNPC()).getBytes());
            } catch (Exception e) {
                cserv.reconnectWorld();
            }
            } else if (sub[1].equals("ola")) {
                c.getChannelServer().setEvent(new MapleEvent(109030101, 50)); // Wrong map but still Ola Ola
            try {
                cserv.getWorldInterface().broadcastMessage(null, MaplePacketCreator.serverNotice(0, "Hello Scania let's play an event in " + player.getMap().getMapName() + " CH " + c.getChannel() + "! " + player.getMap().getEventNPC()).getBytes());
            } catch (Exception e) {
                cserv.reconnectWorld();
            }
            } else if (sub[1].equals("fitness")) {
                c.getChannelServer().setEvent(new MapleEvent(109040000, 50));
            try {
                cserv.getWorldInterface().broadcastMessage(null, MaplePacketCreator.serverNotice(0, "Hello Scania let's play an event in " + player.getMap().getMapName() + " CH " + c.getChannel() + "! " + player.getMap().getEventNPC()).getBytes());
            } catch (Exception e) {
                cserv.reconnectWorld();
            }
            } else if (sub[1].equals("snowball")) {
                c.getChannelServer().setEvent(new MapleEvent(109060001, 50));
            try {
                cserv.getWorldInterface().broadcastMessage(null, MaplePacketCreator.serverNotice(0, "Hello Scania let's play an event in " + player.getMap().getMapName() + " CH " + c.getChannel() + "! " + player.getMap().getEventNPC()).getBytes());
            } catch (Exception e) {
                cserv.reconnectWorld();
            }
            } else if (sub[1].equals("coconut")) {
                c.getChannelServer().setEvent(new MapleEvent(109080000, 50));
            try {
                cserv.getWorldInterface().broadcastMessage(null, MaplePacketCreator.serverNotice(0, "Hello Scania let's play an event in " + player.getMap().getMapName() + " CH " + c.getChannel() + "! " + player.getMap().getEventNPC()).getBytes());
            } catch (Exception e) {
                cserv.reconnectWorld();
            }
            } else {
                player.message("Wrong Syntax: /scheduleevent treasure, ox, ola, fitness, snowball or coconut");
            }
           } else {
               player.message("You can only use this command in the following maps: 60000, 104000000, 200000000, 220000000");
           }
		} else if (sub[0].equals("warpsnowball")) {
            for (MapleCharacter chr : player.getMap().getCharacters()) {
                 chr.changeMap(109060000, chr.getTeam());
            }

net/channel/ChannelServer.java
PHP:
    private MapleEvent event;
    
    public MapleEvent getEvent() {
        return event;
    }

    public void setEvent(MapleEvent event) {
        this.event = event;
    }

client/MapleCharacter.java
PHP:
    private byte team = 0;
    private long snowballattack;

    public byte getTeam() {
        return team;
    }

    public void setTeam(int team) {
        this.team = (byte) team;
    }
    
    public long getLastSnowballAttack() {
        return snowballattack;
    }

    public void setLastSnowballAttack(long time) {
        this.snowballattack = time;
    }

scripting/npc/NPCConversationManager.java
PHP:
    public MapleEvent getEvent() {
        return c.getChannelServer().getEvent();
    }

    public void divideTeams() {
        if (getEvent() != null) {
            getPlayer().setTeam(getEvent().getLimit() % 2); //muhaha :D
        }
    }

/scripts/npc/9000001.js
PHP:
/*
    This file is part of the OdinMS Maple Story Server
    Copyright (C) 2008 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 as
    published by the Free Software Foundation 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/>.
*/
/* Edited by: kevintjuh93
    NPC Name:         Jean
    Map(s):         Victoria Road : Lith Harbour (104000000)
    Description:         Event Assistant
*/
var status = 0;

function start() {
    cm.sendNext("Hey, I'm #bJean#k. I am waiting for my brother #bPaul#k. He is supposed to be here by now...");
}

function action(mode, type, selection) {
    if (mode == -1) {
        cm.dispose();
    } else {
        if (status >= 2 && mode == 0) {
            cm.dispose();
            return;
        }
        if (mode == 1)
            status++;
        else
            status--;
        if (status == 1) {
            cm.sendNextPrev("Hmm... What should I do? The event will start, soon... Many people went to participate in the event, so we better be hurry...");
        } else if (status == 2) {
            cm.sendSimple("Hey... Why don't you go with me? I think my brother will come with other people.\r\n#L0##e1.#n#b What kind of an event is it?#k#l\r\n#L1##e2.#n#b Explain the event game to me.#k#l\r\n#L2##e3.#n#b Alright, let's go!#k#l");
        } else if (status == 3) {
            if (selection == 0) {
                cm.sendNext("All this month, MapleStory Global is celebrating its 3rd anniversary! The GM's will be holding surprise GM Events throughout the event, so stay on your toes and make sure to participate in at least one of the events for great prizes!");
                cm.dispose();
            } else if (selection == 1) {
                cm.sendSimple("There are many games for this event. It will help you a lot to know how to play the game before you play it. Choose the one you want to know more of! #b\r\n#L0# Ola Ola#l\r\n#L1# MapleStory Maple Physical Fitness Test#l\r\n#L2# Snow Ball#l\r\n#L3# Coconut Harvest#l\r\n#L4# OX Quiz#l\r\n#L5# Treasure Hunt#l#k");
            } else if (selection == 2) {
				if (cm.getEvent() != null && cm.getEvent().getLimit() > 0) {
					cm.getPlayer().saveLocation("EVENT");
					if (cm.getEvent().getMapId() == 109080000 || cm.getEvent().getMapId() == 109060001) 
						cm.divideTeams();
        
					cm.getEvent().minusLimit();
					cm.warp(cm.getEvent().getMapId());
					cm.dispose();
				} else {
					cm.sendNext("Either the event has not been started, you already have the #bScroll of Secrets#k, or you have already participated in this event within the last 24 hours. Please try again later!");
					cm.dispose();                
            }
			}
        } else if (status == 4) {
            if (selection == 0) {
                cm.sendNext("#b[Ola Ola]#k is a game where participants climb ladders to reach the top. Climb your way up and move to the next level by choosing the correct portal out of the numerous portals available. \r\n\r\nThe game consists of three levels, and the time limit is #b6 MINUTES#k. During [Ola Ola], you #bwon't be able to jump, teleport, haste, or boost your speed using potions or items#k. There are also trick portals that'll lead you to a strange place, so please be aware of those.");
                cm.dispose();
            } else if (selection == 1) {
                cm.sendNext("#b[MapleStory Physical Fitness Test] is a race through an obstacle course#k much like the Forest of Patience. You can win it by overcoming various obstacles and reach the final destination within the time limit. \r\n\r\nThe game consists of four levels, and the time limit is #b15 MINUTES#k. During [MapleStory Physical Fitness Test], you won't be able to use teleport or haste.");
                cm.dispose();
            } else if (selection == 2) {
                cm.sendNext("#b[Snowball]#k consists of two teams, Maple Team and Story Team, and the two teams duke it out to see #bwhich team rolled the snowball farther and bigger in a limited time#k. If the game cannot be decided within the time period, then the team that rolled the snowball farther wins. \r\n\r\nTo roll up the snow, attack it by pressing #bCtrl#k. All long-ranged attacks and skill-based attacks will not work here, #bonly the close-range attacks will work#k. \r\n\r\nIf a character touches the snowball, he/she'll be sent back to the starting point. Attack the snowman in front of the starting point to prevent the opposing team from rolling the snow forward. This is where a well-planned strategy works, as the team will decide whether to attack the snowball or the snowman.");
                cm.dispose();
            } else if (selection == 3) {
                cm.sendNext("#b[Coconut Harvest]#k consists of two teams, Maple Team and Story Team, and the two teams duke it out to see #bwhich team gathers up the most coconuts#k. The time limit is #b5 MINUTES#k. If the game ends in a tie, an additional 2 minutes will be awarded to determine the winner. If, for some reason, the score stays tied, then the game will end in a draw. \r\n\r\nAll long-range attacks and skill-based attacks will not work here, #bonly the close-range attacks will work#k. If you don't have a weapon for the close-range attacks, you can purchase them through an NPC within the event map. No matter the level of character, the weapon, or skills, all damages applied will be the same.\r\n\r\nBeware of the obstacles and traps within the map. If the character dies during the game, the character will be eliminated from the game. The player who strikes last before the coconut drops wins. Only the coconuts that hit the ground counts, which means the ones that do not fall off the tree, or the occasional explosion of the coconuts WILL NOT COUNT. There's also a hidden portal at one of the shells at the bottom of the map, so use that wisely!");
                cm.dispose();
            } else if (selection == 4) {
                cm.sendNext("#b[OX Quiz]#k is a game of MapleStory smarts through X's and O's. Once you join the game, turn on the minimap by pressing #bM#k to see where the X and O are. A total of #r10 questions#k will be given, and the character that answers them all correctly wins the game. \r\n\r\nOnce the question is given, use the ladder to enter the area where the correct answer may be, be it X or O. If the character does not choose an answer or is hanging on the ladder past the time limit, the character will be eliminated. Please hold your position until [CORRECT] is off the screen before moving on. To prevent cheating of any kind, all types of chatting will be turned off during the OX Quiz.");
                cm.dispose();
            } else if (selection == 5) {
                cm.sendNext("#b[Treasure Hunt]#k is a game in which your goal is to find the #btreasure scrolls#k that are hidden all over the map #rin 10 minutes#k. There will be a number of mysterious treasure chests hidden away, and once you break them apart, many items will surface from the chest. Your job is to pick out the treasure scroll from those items. \r\nTreasure chests can be destroyed using #bregular attacks#k, and once you have the treasure scroll in possession, you can trade it for the Scroll of Secrets through an NPC that's in charge of trading items. The trading NPC can be found on the Treasure Hunt map, but you can also trade your scroll through #bVikin#k of Lith Harbor.\r\n\r\nThis game has its share of hidden portals and hidden teleporting spots. To use them, press the #bup arrow#k at a certain spot, and you'll be teleported to a different place. Try jumping around, for you may also run into hidden stairs or ropes. There will also be a treasure chest that'll take you to a hidden spot, and a hidden chest that can only be found through the hidden portal, so try looking around.\r\n\r\nDuring the game of Treasure Hunt, all attack skills will be #rdisabled#k, so please break the treasure chest with the regular attack.");
                cm.dispose();
            }
        }   
  }
}

How to use?
1. For now only Lith Harbor is supported. So go to Lith Harbor and type /scheduleevent snowball
2. People can now go to the event map by talking to Jean. (There is a limit of 50 people that can participate)
3. When either the limit is reached or you think you can begin type /warpsnowball
4. Maybe show the event instructions, packets should be in your source
5. Wanna start the event? Type /startevent
6. Now watch it or leave.


I might have forgotten something, if yes please post what.
Never been tested with a lot of people. But should work :). Report any bug you find
If you want to have it GMS Like, ask it and I will post the other npc which are needed when you have lost or won the game. (Should already be posted somewhere on the forums.)

Anyways have fun :3 Snowball ftw

Don't post this anywhere else. RageZone > All
 
Last edited:
Custom Title Activated
Loyal Member
Joined
Mar 17, 2009
Messages
1,911
Reaction score
538
Nice Kev, so pro ;D
 
Custom Title Activated
Loyal Member
Joined
Jun 30, 2008
Messages
3,451
Reaction score
1,616
Nice Kev, so pro ;D
Thanks everyone,

I already knew that it used recvops but whenever I tried to hit it, it wouldn't sent a packet to the server. Only occured when sending a packet that made the snowball roll to the end. So I've tested and tested and found out I could sent 2 packets. One to make it roll and one to make it send a packet to the server. And hooray :3
 
Legendary Battlemage
Loyal Member
Joined
Sep 28, 2008
Messages
600
Reaction score
291
By the way, you misplaced a } in the NPC Script i guess?..
 
Joined
Oct 14, 2008
Messages
960
Reaction score
197
Nice but as far as I can remember the snowball thing was in happyville where you attacked that mobs which had a huge amount of hp and then they dropped alot of things :O
Anyone explain please?
 
Last edited:
Legendary Battlemage
Loyal Member
Joined
Sep 28, 2008
Messages
600
Reaction score
291
Umm, is there some bugs with the timer?..lols.. Sometimes I type /startevent and the timer shows, however, on the other hand, sometimes whenever i type that command, the timer doesn't shows..

-AuroX
 
Custom Title Activated
Loyal Member
Joined
Jun 30, 2008
Messages
3,451
Reaction score
1,616
Umm, is there some bugs with the timer?..lols.. Sometimes I type /startevent and the timer shows, however, on the other hand, sometimes whenever i type that command, the timer doesn't shows..

-AuroX
Hmm, maybe that sometimes is in the same channel, when an event was already there? Or not?
 
Newbie Spellweaver
Joined
Jul 24, 2008
Messages
18
Reaction score
0
How can I get the ball move faster?
EDIT: NVM i figured it. :p
 
Last edited:
Skilled Illusionist
Joined
Dec 31, 2008
Messages
319
Reaction score
65
It crashes after I warped with error code : -83 or 83(forget le).

Source Used:
XiuzSource v62(changed all I could change in order to be compatible with XiuzSource).
 
Last edited:
Custom Title Activated
Loyal Member
Joined
Jun 30, 2008
Messages
3,451
Reaction score
1,616
v62 packets are needed:
SendOps:
Code:
    ROLL_SNOWBALL(0xDA),
    HIT_SNOWBALL(0xDB),
    SNOWBALL_MESSAGE(0xDC),
    LEFT_KNOCK_BACK(0xDD),
RecvOps:
Code:
    SNOWBALL(0xB2),
    LEFT_KNOCKBACK(0xB3),
 
Skilled Illusionist
Joined
Dec 31, 2008
Messages
319
Reaction score
65
v62 packets are needed:
SendOps:
Code:
    ROLL_SNOWBALL(0xDA),
    HIT_SNOWBALL(0xDB),
    SNOWBALL_MESSAGE(0xDC),
    LEFT_KNOCK_BACK(0xDD),
RecvOps:
Code:
    SNOWBALL(0xB2),
    LEFT_KNOCKBACK(0xB3),



I already have those packet but it's still not working.
 
Newbie Spellweaver
Joined
Jan 24, 2009
Messages
54
Reaction score
0
Had 20 errors /: Missing methods. (I'm using LocalMS Source btw) So I just gave up xD
 
Back
Top