[Add-On]Magic Barrel in FM

Newbie Spellweaver
Joined
Mar 2, 2011
Messages
28
Reaction score
5
This is a Mini Version of Magic Barrel
My friend told me that some server had a Magic Barrel and you stand on it and say I want blahblahblah and it drops. I decided to make a mini version.
You stand on the barrel in FM and type @roids @specs @snailme or @GM-Hat and it drops
Copy and paste this is PlayerCommands.java and compile.
PHP:
} else if (splitted[0].equals("roids") || splitted[0].equals("specs") || splitted[0].equals("snailme") || splitted[0].equals("GM-Hat")) {
    if (player.getMap().getId() == 910000000) {
        if (player.getPosition().y > -17 && player.getPosition().x >= 335 && player.getPosition().x <= 365) {
            int itemId = splitted[0].equals("roids") ? 2022162 : splitted[0].equals("specs") ? 1022082 : splitted[0].equals("snailme") ? 2210006 : 1002140;
            player.getMap().spawnItemDrop(player.getObjectId(), player.getPosition(), player, new Item(itemId, (byte) 0, (short) 1), player.getPosition(), true, true);
            player.dropMessage("Your wish is my command.");
        } else {
            player.dropMessage("You must be on the magic barrel.");
        }
    } else {
        player.dropMessage("You must be on the Free Market.");
    }
}
I'm pretty sure this works. If theres any problems let me know.
 
Last edited by a moderator:
Re: Magic Barrel in FM

Kind of huge though. Also, this is wrong, it will drop if someone else is over the barrel and even, if no one is over the barrel it will say "Your wish is my command.".

PHP:
} else if (splitted[0].equals("roids") || splitted[0].equals("specs") || splitted[0].equals("snailme") || splitted[0].equals("GM-Hat")) {
    if (player.getMap().getId() == 910000000) {
	    if (player.getPosition().y > -17 && player.getPosition().x >= 335 && player.getPosition().x <= 365) {
		    int itemId = splitted[0].equals("roids") ? 2022162 : splitted[0].equals("specs") ? 1022082 : splitted[0].equals("snailme") ? 2210006 : 1002140;
			player.getMap().spawnItemDrop(player.getObjectId(), player.getPosition(), player, new Item(itemId, (byte) 0, (short) 1), player.getPosition(), true, true);
			player.dropMessage("Your wish is my command.");
		} else {
		    player.dropMessage("You must be on the magic barrel.");
		}
    } else {
        player.dropMessage("You must be on the Free Market.");
    }
}
 
Re: Magic Barrel in FM

First of all, where is the barrel. Is it an actual image? Or is it just figurative o-o.

Secondly I dont get the point of it IF you have to use commands, its just over complicating the drop command. The original version and this arent alike at all from what i can see.

Nice try I suppose, but the "!drop" command was already invented.
 
Re: Magic Barrel in FM

First of all, where is the barrel. Is it an actual image? Or is it just figurative o-o.

Secondly I dont get the point of it IF you have to use commands, its just over complicating the drop command. The original version and this arent alike at all from what i can see.

Nice try I suppose, but the "!drop" command was already invented.


I don't think it's meant for GM's.
 
Re: Magic Barrel in FM

} else if (splitted[0].equals("roids") || splitted[0].equals("specs") || splitted[0].equals("snailme") || splitted[0].equals("GM-Hat")) {
if (player.getMap().getId() == 910000000) {
if (player.getPosition().y > -17 && player.getPosition().x >= 335 && player.getPosition().x <= 365) {
int itemId = splitted[0].equals("roids") ? 2022162 : splitted[0].equals("specs") ? 1022082 : splitted[0].equals("snailme") ? 2210006 : 1002140;
player.getMap().spawnItemDrop(player.getObjectId(), player.getPosition(), player, new Item(itemId, (byte) 0, (short) 1), player.getPosition(), true, true);
player.dropMessage("Your wish is my command.");
} else {
player.dropMessage("You must be on the magic barrel.");
}
} else {
player.dropMessage("You must be on the Free Market.");
}
}

this doesnt work for moopledev v83.
 
Re: Magic Barrel in FM

} else if (splitted[0].equals("roids") || splitted[0].equals("specs") || splitted[0].equals("snailme") || splitted[0].equals("GM-Hat")) {
if (player.getMap().getId() == 910000000) {
if (player.getPosition().y > -17 && player.getPosition().x >= 335 && player.getPosition().x <= 365) {
int itemId = splitted[0].equals("roids") ? 2022162 : splitted[0].equals("specs") ? 1022082 : splitted[0].equals("snailme") ? 2210006 : 1002140;
player.getMap().spawnItemDrop(player.getObjectId(), player.getPosition(), player, new Item(itemId, (byte) 0, (short) 1), player.getPosition(), true, true);
player.dropMessage("Your wish is my command.");
} else {
player.dropMessage("You must be on the magic barrel.");
}
} else {
player.dropMessage("You must be on the Free Market.");
}
}

this doesnt work for moopledev v83.
Thank you for being so accurate.
 
Re: Magic Barrel in FM

First of all, where is the barrel. Is it an actual image? Or is it just figurative o-o.

Secondly I dont get the point of it IF you have to use commands, its just over complicating the drop command. The original version and this arent alike at all from what i can see.

Nice try I suppose, but the "!drop" command was already invented.

In the FM, the little barrel next to the tele arrow
 
Re: Magic Barrel in FM

} else if (splitted[0].equals("roids") || splitted[0].equals("specs") || splitted[0].equals("snailme") || splitted[0].equals("GM-Hat")) {
if (player.getMap().getId() == 910000000) {
if (player.getPosition().y > -17 && player.getPosition().x >= 335 && player.getPosition().x <= 365) {
int itemId = splitted[0].equals("roids") ? 2022162 : splitted[0].equals("specs") ? 1022082 : splitted[0].equals("snailme") ? 2210006 : 1002140;
player.getMap().spawnItemDrop(player.getObjectId(), player.getPosition(), player, new Item(itemId, (byte) 0, (short) 1), player.getPosition(), true, true);
player.dropMessage("Your wish is my command.");
} else {
player.dropMessage("You must be on the magic barrel.");
}
} else {
player.dropMessage("You must be on the Free Market.");
}
}

this doesnt work for moopledev v83.

Uhh, change some stuff around? Like player to chr for one. I got it to work.
 
Re: Magic Barrel in FM

chr instead of player works until player.getMap().spawnItemDrop(player.getObjectId(), player.getPosition(), player, new Item(itemId, (byte) 0, (short) 1),
could u post the edited code for moopledev.?
 
Re: Magic Barrel in FM

I don't really understand the point of this... players are going to stand on the magic barrel all day spamming the command @specs.
 
Re: Magic Barrel in FM

You could easily just put it in MovePlayerHandler.java. Whether or not this is safe performance-wise is not clear. I doubt it'll slow down the server that much, though.
 
Back