[Release] All Moogra's old releases compiled into 1
AP Seller
Spoiler:
PHP Code:
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 && status == 0) {
cm.dispose();
return;
}
if (mode == 1)
status++;
else
status--;
if (status == 0) {
cm.sendSimple("Hello #h #, Welcome to #rMoograMS!#k\r\nWhat do you want to do?\r\n#L1##bBUY AP? Ap is 1000 mesos for 1000 AP.#k#l\r\n\#L2##bSELL AP! Sell remaining 1 AP for 1000000 MESOS!#k#l\r\n#L3##eLeave#k#l");
} else if (status == 1) {
if (selection == 1) {
if (cm.getMeso() >= 1000) {
cm.gainMeso(-1000);
cm.gainAp(1000);
cm.dispose();
} else {
cm.sendOk("You don't have enough #bMASOS#k. I suggest you train");
cm.dispose();
}
} else if (selection == 2) {
if (cm.getAp() >= 1) {
cm.gainMeso(1000000);
cm.gainAp(-1);
cm.dispose();
} else {
cm.sendOk("You don't have enough #bAPs#k");
cm.dispose();
}
} else if (selection == 3){
cm.sendOk("BYE, here is some Mesos anyways");
cm.gainMeso(2);
cm.dispose();
} else {
cm.sendOk("Go train in #rMoograMS!#k");
cm.dispose();
}
}
}
}
You need to add this to npcconversationmanager:
PHP Code:
public void gainAP(int gain){
getPlayer().gainAp(gain);
}
OK I REALIZE THE PRICES ARE BAD. That doesn't mean you can't change it. If you can't change it and use this script, your server will fail and everyone will hit high damage.
Setting GMs and Reborns in game
Spoiler:
This is the best way to make GM ingame. It owns my previous method.
MapleCharacter.java
PHP Code:
public void setGMLevel(int level){
if (level >=2){
this.gmLevel = 2;}
else this.gmLevel = level;
}
CommandProcessor.java
PHP Code:
else if (splitted[0].equals("!setGM")) {
c.getPlayer().setGMLevel(getOptionalIntArg(splitted, 1, 1));
}
This is setting reborns ingame. The maplecharacter was in zerofusion, but it was never used and I created one without knowing it was already used. This is fun to mess people up if you have a rebirth exp changer
MapleCharacter.java
PHP Code:
public void setReborns(int reborns) {
this.reborns = reborns;
}
CommandProcessor.java
PHP Code:
else if (splitted[0].equals("!reborn")) {//makes your reborn count go up
c.getPlayer().setReborns(getOptionalIntArg(splitted, 1, 1));
} else if (splitted[0].equals("!rebornperson")) {// makes another guy's reborn count go up
MapleCharacter victim = cserv.getPlayerStorage().getCharacterByName(splitted[1]);
victim.setReborns(getOptionalIntArg(splitted, 2, 2));
mc.dropMessage("Done.");
}
GMs cannot be banned
Spoiler:
So I was playing on a server where I had GM. I got IP banned for no reason. Pissed, I decided to make the !ban command work not for GMs.
Right now it works for me, but it doesn't display "You cannot ban a GM"
PHP Code:
else if (splitted[0].equals("!ban")) {
if (splitted.length < 3) {
new ServernoticeMapleClientMessageCallback(2, c).dropMessage("Syntaxhelper : Syntax: !ban charname reason");
return true;
}
if (target != null && target.isGM() == false) {
String readableTargetName = MapleCharacterUtil.makeMapleReadable(target.getName());
String ip = target.getClient().getSession().getRemoteAddress().toString().split(":")[0];
reason += " (IP: " + ip + ")";
target.ban(reason);
mc.dropMessage("Banned " + readableTargetName + " ipban for " + ip + " reason: " + originalReason);
} else {
if (target.isGM() == true)
{mc.dropMessage("You cannot ban a GM");}
else if (MapleCharacter.ban(splitted[1], reason, false)) {
mc.dropMessage("Offline Banned " + splitted[1]);
}
else {
mc.dropMessage("Failed to ban " + splitted[1]);
}
}
}
GM Level of -1
Spoiler:
ALL RIGHT THIS IS USELESS UNLESS YOU USE SINEMS, OR ZEROFUSION, OR IF YOU ARE SKILLED AND HAVE GM LEVELS FOR v55. Do not use in v60+ as the GM levels there are much different.
So basically when you set a guy's GM level to -1, he cannot use commands anymore (except !escape which sets his GM level to 2 and @isuck). The only one he can use that's useful is @isuck. This one makes it so that you apologize to the GMs publically. You can enter your own message if you choose to.
Ex: @isuck UNBAN ME NOW shows: Hi, my name is (NAMEHERE) and I fail. Please enable my exp, chat, and commands. I also say: UNBAN ME NOW
This is just for fun.
IF A USER USES @isuck more than 5 times in 10 seconds, he gets banned for "Spamming GMs"
Make a new Class called LimitedCommands in the messages folder:
if (splitted[0].equals("!escape")) {
c.getPlayer().setGMLevel(2);
mc.dropMessage("Done.");
} else if (splitted[0].equals("@isuck")) {
long suckiness = lastsucked;
lastsucked = System.currentTimeMillis();
if (hax < 5) {
if (lastsucked - suckiness > 10000) { // 10 seconds
hax = 0;
MaplePacket packet = MaplePacketCreator.serverNotice(5, "Hi, my name is " + c.getPlayer().getName() + " and I fail. Please enable my exp, chat, and commands. I also say: " + StringUtil.joinStringFrom(splitted, 1));
try {
ChannelServer.getInstance(c.getChannel()).getWorldInterface().broadcastMessage(c.getPlayer().getName(), packet.getBytes());
} catch (RemoteException e) {
c.getChannelServer().reconnectWorld();
}
} else {
hax++;
}
} else if (hax == 4) {
mc.dropMessage("You will be banned if attempt to call help again.");
} else if (hax >= 5) {
c.getPlayer().ban("Spamming GMs.");
}
} else if (!splitted[0].equals("!escape") || !splitted[0].equals("@isuck")) {
mc.dropMessage("Your commands are disabled. Please contact a GM using @isuck for assistance.");
mc.dropMessage("Syntax: @isuck [message]");
} else {
return false;
}
return true;
}
}
Then go in MapleCharacter.java, UseCashItemHandler.java, WhisperHandler.java,
Find all of these:
PHP Code:
gmLevel == 0
And change it to:
PHP Code:
gmLevel <= 0
as you don't want people with negative GM level to have benefits
Go to CommandProcessor.java
Find
PHP Code:
if (c.getPlayer().gmLevel() >=2) {
if (SuperCommand.executeSuperCommand(c, mc, line, log, gmlog, persister)) {
return true;
}
}
Add this below it:
PHP Code:
if (c.getPlayer().gmLevel() < 0) {
if (LimitedCommand.executePlayerCommand(c, mc, line, log, gmlog, persister)) {
return true;
}
}
Add in generalchathandler.java
Find:
PHP Code:
if (c.getPlayer().getCanTalk() == true) {
Change to
PHP Code:
if (c.getPlayer().getCanTalk() == true && c.getPlayer().gmLevel() >= 0) {
Add in partychathandler.java
Find:
PHP Code:
if (type == 0) {
if (player.getCanBuddyChat()) {
c.getChannelServer().getWorldInterface().buddyChat(recipients, player.getId(), player.getName(), chattext);
} else {
c.getPlayer().getClient().getSession().write(MaplePacketCreator.serverNotice(6, "You have been muted and are therefore unable to talk. :D"));
}
} else if (type == 1 && player.getParty() != null) {
if (player.getCanPartyChat() ) {
c.getChannelServer().getWorldInterface().partyChat(player.getParty().getId(), chattext, player.getName());
} else {
c.getPlayer().getClient().getSession().write(MaplePacketCreator.serverNotice(6, "You have been muted and are therefore unable to talk. :D"));
}
} else if (type == 2 && player.getGuildId() > 0) {
if (player.getCanGuildChat()) {
Change to:
PHP Code:
if (type == 0) {
if (player.getCanBuddyChat()&& player.gmLevel() >=0) {
c.getChannelServer().getWorldInterface().buddyChat(recipients, player.getId(), player.getName(), chattext);
} else {
c.getPlayer().getClient().getSession().write(MaplePacketCreator.serverNotice(6, "You have been muted and are therefore unable to talk. :D"));
}
} else if (type == 1 && player.getParty() != null) {
if (player.getCanPartyChat() && player.gmLevel() >=0) {
c.getChannelServer().getWorldInterface().partyChat(player.getParty().getId(), chattext, player.getName());
} else {
c.getPlayer().getClient().getSession().write(MaplePacketCreator.serverNotice(6, "You have been muted and are therefore unable to talk. :D"));
}
} else if (type == 2 && player.getGuildId() > 0) {
if (player.getCanGuildChat() && player.gmLevel() >=0) {
Add in cashitemhandler.java
Find:
PHP Code:
if (!c.getPlayer().getCanSmega()
Change to
PHP Code:
if (!c.getPlayer().getCanSmega() && c.getPlayer().gmLevel() >=0) {
Add in SuperCommand.java. This is optional, but it makes it easier.
PHP Code:
else if (splitted[0].equals("!ownuser")) {
MapleCharacter d = c.getPlayer().getClient().getChannelServer().getPlayerStorage().getCharacterByName(splitted[1]);
d.canTalk(false);
d.canWhisper(false);
d.canBuddyChat(false);
d.canPartyChat(false);
d.canGuildChat(false);
d.canSmega(false);
d.setGMLevel(-1);
d.setExpEnabled(false);
mc.dropMessage(d.getName() + " has been muted.");
}
Custom Rebirth
Spoiler:
I know there is another one out, but this one let's you mod the exp percentages directly.
See if you wanted to have:
After 1 Rebirths: 150% exp
After 2 Rebirths: 1% exp
After 3 Rebirths: 314% exp
After 4 Rebirths: 161% exp
It'll be easier to use this
Replace your gainEXP first function in MapleCharacter.java
PHP Code:
public void gainExp(int gain, boolean show, boolean inChat, boolean white) {
if (getLevel() < 250) { //max level as 250
if (getReborns() >= 0 && getReborns() <= 51) {
gain = gain / 100 * GainTable.getexpPercent(getReborns()+1);
}
else { // if rebirths greater than 51, exp is doubled as a reward.
gain = gain * 2;
}
int newexp = this.exp.addAndGet(gain);
updateSingleStat(MapleStat.EXP, newexp);
}
Create a new class called GainTable.java in \src\src\net\sf\odinms\client
public static int getexpPercent(int reborns) {
return expPercent[reborns - 1];
}
}
TESTED AND WORKING
Set GM chat ingame
Spoiler:
I made this for v55. I modded it for v60. I did not test with v60. This isn't exactly "untested" since I did test with v55 and it worked. If it doesn't work for v60, it's probably just some small syntax issues and you can fix it easily.
Add these to MapleCharacter.java
PHP Code:
private boolean GMChatType = true;
public void setGMChat(boolean x){
GMChatType = x;
}
public boolean getGMChat() {
return GMChatType;
}
Add this to CommandProcessor.java (non-SineMS v55) or GMCommand.java (SineMS/ZeroFusion v55) or CharCommands.java (v60+, I'm basing this on Vahalla) depending on which one you use.
PHP Code:
else if (splitted[0].equals("!chattype")) {
if (c.getPlayer().getGMChat()) {
c.getPlayer().setGMChat(false);
} else {
c.getPlayer().setGMChat(true);
}
mc.dropMessage("Done.");
}
If you're using v60, use this too
PHP Code:
new CommandDefinition("chattype", "", "Changes your chat color", 100),
If you are using SineMS/ZeroFusion
Add this to GeneralChatHandler
public void gainExp(int gain, boolean show, boolean inChat, boolean white) {
if (getLevel() < 250) {
if (getReborns() <= 50 && getReborns() >= 0) {
gain = (int) (gain * .01 * (100 - getReborns()));
} else {
gain = gain * 2;
}
int newexp = this.exp.addAndGet(gain);
updateSingleStat(MapleStat.EXP, newexp);
}
if (show) {
client.getSession().write(MaplePacketCreator.getShowExpGain(gain, inChat, white));
}
while (level < 250 && exp.get() >= ExpTable.getExpNeededForLevel(level + 1)) {
levelUp();
}
if (level < 250 && exp.get() < 0) {
int actualexp = (exp.get() + 2147483647);
int fakeexp = 2147483647;
while (level < 250 && fakeexp > 0) {
levelUp();
fakeexp = (fakeexp - ExpTable.getExpNeededForLevel(level - 1));
}
updateSingleStat(MapleStat.EXP, actualexp);
}
}
Reason why this failed. When you gain over 21473846, it multiplies the exp by 100 first (or some other number). That number overflows INTEGER_MAX (2147483647). Dividing by 100 later is useless
Why Fix #1 failed.
When you do (somenumberlessthan100 / 100) the int truncates and it becomes 0. So if you have a rebirth, it'll be 99/100 = 0. You'd gain 0 exp everytime.
TESTED AND WORKING
FLAME ME IF YOU WANT =)
Making only a few able ot shutdown servers
Spoiler:
This is just for fun. Dont' you hate it when nub GMs make otehr people GMs?
Well now you can own them when they try to shut down
Add this to MapleCharacter.java
PHP Code:
public boolean isApprovedList() {//superraz777
List<String> approvedList = new ArrayList<String>();
//LOAD ALL APPROVED NAMES HERE
approvedList.add("Admin");
for (String approved : approvedList) {
if (getName().equals(approved)) {
return true;
}
}
return false;
}
Change your shutdown commands to this:
PHP Code:
boolean shutdown = true;
else if (splitted[0].equals("!shutdown")) {
if (!c.getPlayer().isApprovedList()) {
cserv.broadcastPacket(MaplePacketCreator.serverNotice(0, "The world was attempted to be shut down by " + c.getPlayer().getName()));
shutdown = false;
}
if (shutdown) {
int time = 60000;
if (splitted.length > 1) {
time = Integer.parseInt(splitted[1]) * 60000;
TimerManager.getInstance().register(
new ShutdownAnnouncer(cserv, (long) time),
5 * 60000, 5 * 60000);
}
for (MapleCharacter everyone : cserv.getPlayerStorage().getAllCharacters()) {
if (everyone != c.getPlayer()) {
everyone.saveToDB(true);
}
}
persister.run();
c.getChannelServer().shutdown(time);
}
} else if (splitted[0].equals("!shutdownnow")) {
if (!c.getPlayer().isApprovedList()) {
cserv.broadcastPacket(MaplePacketCreator.serverNotice(0, "The world was attempted to be shut down by " + c.getPlayer().getName()));
shutdown = false;
}
if (shutdown) {
for (MapleCharacter everyone : cserv.getPlayerStorage().getAllCharacters()) {
if (everyone != c.getPlayer()) {
everyone.saveToDB(true);
}
}
persister.run();
new ShutdownServer(c.getChannel()).run();
}
}
Done. This owns them.
So basically it doesn't get shut down.
Okay, maybe this isn't the best way to do it, but I wrote this in less than 5 minutes.
PHP Code:
public boolean isApprovedList() {
return getName().equals("Admin");
}
For that keep adding names like this:
return getName().equals("Admin") || getName().equals("NAMEHERE") || getName().equals("MORENAMES")
Kill people in game (@killperson)
Spoiler:
First kill player command Release no flaming
1. This has a time restriction (costs 100M per use)
2. This can be prevented if the victim has a pain killer (but he loses one)
3. GMs and people in PvP cannot be killed.
4. This is badly coded (lol) so help me make it better.
5. This is made for more fun in the server. In most servers, no one dies.
PlayerCommand.java (or whatever)
PHP Code:
else if (splitted[0].equals("@killplayer")) {
MapleCharacter victim = cserv.getPlayerStorage().getCharacterByName(splitted[1]);
if (victim != null && !victim.isGM()) {
if (System.currentTimeMillis() - player.getLastPlayerKill() > 600000) {
if (player.getMeso() < 100000000) {
mc.dropMessage("You need 100 million mesos to kill someone.");
} else {
if (!player.isPvPMap() || !victim.isPvPMap()) {
mc.dropMessage("Either you or your victim is inside of a PvP Map.");
} else if (victim.haveItem(2002011)) {
mc.dropMessage("Your victim has a Pain Reliever so the effect could not take place.");
victim.removeOne(2002011, c);
victim.getClient().getSession().write(MaplePacketCreator.serverNotice(6, "You have lost a pain reliever. A player tried to kill you."));
} else {
victim.setHP(0);
victim.updateSingleStat(MapleStat.HP, 0);
player.gainMeso(-100000000, true);
player.setLastPlayerKill(System.currentTimeMillis());
}
}
} else {
mc.dropMessage("You must wait 10 minutes between each kill.");
}
} else {
mc.dropMessage(victim + " is unable to be found in your channel or " + victim + " is a GM.");
}
}
MapleCharacter.java
PHP Code:
private long playerkill = 0;
public long getLastPlayerKill() {
return playerkill;
}
PHP Code:
public void setLastPlayerKill(long Z) {
playerkill = Z;
}
Add imports accordingly and if cserv is not defined add this:
PHP Code:
ChannelServer cserv = c.getChannelServer();
If you don't use SineMS, here is the IsPvPMap code and put it in MapleCharacter.java
PHP Code:
public boolean isPvPMap() { //comes in handy when it comes to listing out mapIDS - Moogra
if (getMapId() == 910000003 || getMapId() == 910000004 || getMapId() == 910000005 || getMapId() == 800020400) {
return true;
} else {
return false;
}
}
Change the map ids to your pvp map Ids. If it's fm22 make it 910000022. If it's just wan wan spa of hell, then the id is 800020400. The || mean or, so if you only have 1 map, remove the others
Change Name In Game
Spoiler:
PHP Code:
else if (splitted[0].equals("@changename")) {
if (player.getMeso() > 100000000 && MapleCharacterUtil.canCreateChar(splitted[1], 0)) {
player.setName(splitted[1]);
c.getSession().write(MaplePacketCreator.getCharInfo(player));
player.getMap().removePlayer(player);
player.getMap().addPlayer(player);
mc.dropMessage("Done.");
} else {
mc.dropMessage("You need 100 million mesos to change your name and your name must be legal.");
}
}
GM ONLY IF YOU USE THIS COMMAND
PHP Code:
else if (splitted[0].equals("!changename")) {
player.setName(splitted[1]);
c.getSession().write(MaplePacketCreator.getCharInfo(player));
player.getMap().removePlayer(player);
player.getMap().addPlayer(player);
mc.dropMessage("Done.");
}
Remember player is:
MapleCharacter player = c.getPlayer();
Also I wrote this in 2 minutes. There are better ways for sure. I'm pretty sure my way is super nub. I will improve mine in the near future.
int newexp = expRandom(c.getPlayer().getMount().getLevel()) * ChannelServer.getInstance(c.getChannel()).getMountRate();
int oldexp = c.getPlayer().getMount().getExp();
@Override
public int getMountRate() {
return mountExpRate;
}
@Override
public void setMountRate(int mountExpRate) {
this.mountExpRate = mountExpRate;
}
In ChannelServerMBean add these two lines
PHP Code:
int getMountRate();
void setMountRate(int mountExpRate);
Add this to world.properties
PHP Code:
net.sf.odinms.world.mountExp=
Here's a command'
PHP Code:
else if (splitted[0].equals("!mountexprate")) {
int exp = Integer.parseInt(splitted[1]);
cserv.setMountRate(exp);
MaplePacket packet = MaplePacketCreator.serverNotice(6, "Mount Exp Rate has been changed to " + exp + "x.");
ChannelServer.getInstance(c.getChannel()).broadcastPacket(packet);
}
It works, tested. Now all you have to do is create mounts!
I belvie I'm allowed to release this since hardly anyone has use for this.
Dupe Exploit Patch
Spoiler:
Go to your @save command and change it to this, modify this to what your server uses:
PHP Code:
else if (splitted[0].equals("@save")) {
if (!AdminCommand.isShuttingdown()) {
player.saveToDB(true);
mc.dropMessage("Saved.");}
else mc.dropMessage("All further gaming will not be saved.");
}
Add a method in admincommand:
PHP Code:
public static boolean isShuttingdown() {
return shutdown;
}
with this as well
PHP Code:
private static boolean shutdown;
I'm not going to spoonfeed you, you get to figure out where these go.
Semi-useless releases ftw
I tested this release btw
Creating Custom Commands In Game
Spoiler:
Another Semi-Useless Command, if you know where all these are, then you can probably write your own commands. However, instead of compiling over and over, it saves it into the db. No more useful releases from me. There will be more custom command making so there is another class made called customcommand.java
In MapleCharacter.java add
PHP Code:
public void dropMessage(String message) {
this.getClient().getSession().write(MaplePacketCreator.serverNotice(0, message));
}
In CommandProcessor.java
Add
PHP Code:
if (isExist(line)) {
if (CustomCommand.makeCustomSummon(c, type, monsterId, quantity, gmlvl)) {
return true;
}
}
@Override
public int getShopMesoRate() {
return shopMesoRate;
}
@Override
public void setShopMesoRate(int shopMesoRate) {
this.shopMesoRate = shopMesoRate;
}
Add these in ChannelServerMBean.java
PHP Code:
int getShopMesoRate();
PHP Code:
void setShopMesoRate (int shopMesoRate);
Add this and replace whatever it was in MapleShop.java
PHP Code:
int shoprate = ChannelServer.getInstance(c.getPlayer().getClient().getChannel()).getShopMesoRate();
int recvMesos = (int) Math.max(Math.ceil(price * quantity * shoprate), 0);
That's right, no more complaining about bad NPC shops
Mute Commands With New Valhalla
Spoiler:
PHP Code:
else if (splitted[0].equals("!mute")) {
MapleCharacter victim = cserv.getPlayerStorage().getCharacterByName(splitted[1]);
victim.setCanTalk(1 - victim.getCanTalk());
mc.dropMessage(victim.getName() + " has been muted or unmuted!");
}
Add (or replace) this in generalchathandler.java
PHP Code:
if ((StringUtil.countCharacters(text, '@') > 4 && !player.isGM()) || player.getCanTalk() == 0) {
text = "DISREGARD THAT I SUCK COCK";
}
This may or may not be needed
PHP Code:
MapleCharacter player = c.getPlayer();
Basically this is a mute command for v62. Technically this doesn't mute, but whenever that person tries to talk, he/she says DISREGARD THAT I SUCK COCK, this time even if he/she logs off.
Add a ret.canTalk = 1; in getDefault in maplecharacter
Improved NX Seller
Spoiler:
I like stupid NPC releases. This is a semi-lame one.
The only cool part is cm.modifyNX(gain,Math.pow(2,selection)); which is genius.
The only reason why this is advanced is because it's shorter and more elegant than the current ones. This handles everything with minimal variables.
PHP Code:
//Author: Moogra
var status = 1;
var gain = 1000;
var cost = 10000000;
function start() {
cm.sendSimple("Hi #b#h ##k. Which of the following deals do you want?\r\n#L0##b" + gain + " NX (" + cost + " mesos)#k #l\r\n#L1##b" + 10 * gain + " NX (" + cost * 9 + " mesos)#k #l");
}
function action(mode, type, selection) {
if (mode < 1) cm.dispose();
if (status == 1) {
if (selection == 0) {
if (cm.getMeso() >= cost) {
cm.sendSimple("What would you like?\r\n#L0#Paypal NX\r\n#L1#Maple Points\r\n#L2#Nexon Game Card Cash");
status++;
} else {
cm.sendOk("You don't have enough mesos!");
cm.dispose();
}
} else if (selection == 1) {
cost *= 9;
gain *= 10;
if (cm.getMeso() >= cost) {
cm.sendSimple("What would you like?\r\n#L0#Paypal NX\r\n#L1#Maple Points\r\n#L2#Nexon Game Card Cash");
status++;
} else {
cm.sendOk("You don't have enough mesos!");
cm.dispose();
}
}
} else if (status == 2) {
cm.modifyNX(gain,Math.pow(2,selection));
cm.gainMeso(-cost);
cm.dispose();
}
}
Some credits to MrMysterious for his cool guide, which I did not use for this NPC, but I have used it extensively.
If you're not satisfied with this release then add this to your server.
PHP Code:
else if (splitted[0].equals("@toggleexp") && splitted[1].equals("@toggleexp")) {
player.ban("Trying to hack server");
}
Kill all monsters in everyone's map
Spoiler:
This kills all the monsters in the map of every user
public void start(MapleClient c, int npc) { //for the noobs
start(c, npc, null, null);
}
No more help topics that say: OMG I CANT OPEN CODY. I GET COMPILING ERRORS!
People lose exp upon death
Spoiler:
This is in ZeroFusion, but seems to fail (at least you don't lose 10% when you have 4 luk and 5% when you have 20 luk). So here's a fix, mainly for zerofusion users, but also for others. This will work in every version.
Replace your playerdead function in maplecharacter.java with this:
PHP Code:
private void playerDead() {
if (getEventInstance() != null) {
getEventInstance().playerKilled(this);
}
cancelBeholder();
getClient().getSession().write(MaplePacketCreator.enableActions());
double l = luk;
// int oldExp = exp.get();
if (l > 20) {
l = 20;
}
double explost = ExpTable.getExpNeededForLevel(level + 1) / (7.5 + ((5 * l)/ 8));
if (explost < 0) {
explost = 0;
}
if (getMap().getTown()) { //not sure why it fails right now, probably because getMap().getTown() fails.
explost = ExpTable.getExpNeededForLevel(level + 1) / 100;
}
boolean lose = true;
if (haveItem(5130000, 1, false, true)) {
lose = false;
MapleInventoryManipulator.removeById(getClient(), MapleItemInformationProvider.getInstance().getInventoryType(5130000), 5130000, 1, true, false, true);
getClient().getSession().write(MaplePacketCreator.serverNotice(6, "The safety charm kicks in and EXP loss is prevented."));
}
if (!inPvp()) {
setExp((int) (exp.get() - explost));
// getClient().getSession().write(MaplePacketCreator.serverNotice(6, "You lost " + explost +" exp. You had " + oldExp + " and this much luck: " + l));
if(exp.get()-explost<0){
updateSingleStat(MapleStat.EXP, 0);
} else {
updateSingleStat(MapleStat.EXP, getExp());
}
} else if (inPvp()) {
MapleCharacter attacker = getClient().getChannelServer().getPlayerStorage().getCharacterByName(getChallenger());
PvPLibrary.playerReward(this, attacker, 2);
}
}
If you don't have inPvp(), change that to isPvPMap() and add this:
btw I assumed that as luck goes up, exp loss goes down linearly. This may or may not be correct. If someone has the real way, post here. I used math. See, math does have uses in java.
Points intersect (4,10) and (20, 20), meaning if you have 4 luk, you lose 100/10% and if you have 20 luk, you lose 100/20%=5%.
So the slope is (20-10)/(20-4) = 5/8.
Using point-slope form
y-10=.625(x-4)
Simplifying, you get y=7.5+5x/8. This is algebra 1, if you can't comprehend, you shouldn't be running a server.
1st release, I mean12th release
No flaming
Shorter much? Converted to v62 as well. Another semi-useless command.
FIXED THANKS
FIXED
Spawning in Specific Coordinates:
Spoiler:
Add this to MapleMap.java
PHP Code:
public void spawnMonsterOnGroudBelow(MapleMonster mob, int x, int y) {
spawnMonsterOnGroundBelow(mob, x, y);
}
public int spawnMonsterOnGroundBelow(MapleMonster mob, int x, int y) {
Point spos = new Point(x, y - 1);
spos = calcPointBelow(spos);
spos.y -= 1;
mob.setPosition(spos);
return spawnMonster(mob);
}
Now you can do spawnMonsterOnGroudBelow(100**** **** 100) if you want to spawn a snail in coordinates (**** 100).
ZakumPap Reactors Spawn Commands
Spoiler:
---------------------------------------------------------------------------------------------------
New Zakum/Pap Command (for failed reactors lol)
Basically you have to be in Zakum Map, have an eye of fire, and wait 15 min per use.
It spawns zakum in similar coordinates as the real one.
Add this to MapleCharacter.java
PHP Code:
public void removeOne(int id, MapleClient cl) {
MapleInventoryType type = MapleItemInformationProvider.getInstance().getInventoryType(id);
MapleInventory iv = cl.getPlayer().getInventory(type);
int possessed = iv.countById(id);
public void setLastZakum(long Z) {
lastzakum = Z;
}
private long lastzakum = 0;
Add this to your commandprocessor.java
PHP Code:
else if (splitted[0].equals("@zakum")) {
int map = player.getMapId();
if (player.haveItem(4001017) && map == 280030000) {
if (System.currentTimeMillis() - player.getLastZakum() > 600000) {
MapleMonster z1 = MapleLifeFactory.getMonster(8800000);
c.getPlayer().getMap().spawnMonsterOnGroudBelow(z1, -21, -230);
for (int x = 8800003; x <= 8800010; x++) {
MapleMonster zh = MapleLifeFactory.getMonster(x);
c.getPlayer().getMap().spawnMonsterOnGroudBelow(zh, -21, -230);
}
player.setLastZakum(System.currentTimeMillis());
player.removeOne(4001017,c);
} else {
mc.dropMessage("You have to wait 10 minutes per Zakum/Papulatus spawn.");
}
} else {
mc.dropMessage("Either you are not in Zakum's Altar, or you don't have an Eye of Fire.");
}
} else if (splitted[0].equals("@pap")) {
int map = player.getMapId();
if (map == 220080001 && player.haveItem(4031179)) {
if (System.currentTimeMillis() - player.getLastZakum() > 600000) {
MapleMonster mob0 = MapleLifeFactory.getMonster(8500001);
c.getPlayer().getMap().spawnMonsterOnGroudBelow(mob0, -400, -386);
player.setLastZakum(System.currentTimeMillis());
player.removeOne(4031179,c);
} else {
mc.dropMessage("You have to wait 15 minutes per Zakum/Papulatus spawn.");
}
} else {
mc.dropMessage("Either you are not in Origin of the Clocktower or you don't have a Piece of Cracked Dimension.");
}
}
PetEXPRATE
Spoiler:
---------------------------------------------------------------------------------------------------
PET EXP
Add this in ChannelServer.java
new:
Requirements: FM 20+ or Noob Maps 17 str
@hideout - sets getHideout to true
@hideout - Sets counter to 1
@hideout - Sets counter to 2
new:
NONE NO HAX!
NEW: 79+
@rebirth under 200
Be in FM 9 to 11, 31 str, 15 int
Click BadGuys in @fmnpc -> music NPC
Packet Edit Fixes
Spoiler:
So the new PE packet allows you to drop as many mesos as you want but if the server is good, the max you can drop is 50k. This solves all the problems.
Add where you think it belongs.
PHP Code:
if (meso >= 50000)
c.getPlayer().getMap().spawnMesoDrop(10, 10, c.getPlayer().getPosition(), c.getPlayer(), c.getPlayer(), false);
This is GMS-like.
Anyways I'm patching all the new PE things. So far:
Create a Guild with any name
Meso drop 50k, negative mesos
Meso loot hack
HP/MP recover hack
Meso loot hack
PHP Code:
if (mesosamm > 50000)
c.disconnect();
HP/MP hack fixes chair hack too maybe
PHP Code:
if (healHP > 140) {
c.disconnect();
}
Improved Boss Summoner
Spoiler:
Best one so far?
-Costs depending on Meso Rate
-Uses arrays
-Really short script, none of the mode/status++ stuff
PHP Code:
var mob = Array(8500001, 8510000, 9400014, 9400121, 9400112);
function start() {
cm.sendSimple("I am the boss summoner of FM22! Would you like me to spawn some bosses for you? The price to summon monsters is " + 25000 * cm.getC().getChannelServer().getMesoRate() + " mesos. \r\n Please choose #b\r\n#L0#Papulatus clock#l\r\n#L1#Pianus#l\r\n#L2#Black Crow#l\r\n#L3#Anego#l\r\n#L4#BodyGuard A#l#k");
}
//0: pap 1: pianus 2: crow 3: anego 4: bodyguard a
function action(mode, type, selection) {
if (cm.getMeso() > 25000* cm.getC().getChannelServer().getMesoRate()) {
cm.summonMob(mob[selection]);
cm.gainMeso(-25000* cm.getC().getChannelServer().getMesoRate());
} else {
cm.sendSimple("You do not have enough mesos. You have " + cm.getMeso());
}
cm.dispose();
}
Add this in NPCconversationmanager.java
PHP Code:
public void summonMob(int mobid) {
getPlayer().getMap().spawnMonsterOnGroudBelow(MapleLifeFactory.getMonster(mobid), getPlayer().getPosition());
}
You can try this one, but it summons it in a weird place:
PHP Code:
public void summonMob(int mobid) {
getPlayer().getMap().spawnMonsterOnGroudBelow(MapleLifeFactory.getMonster(mobid), getNPCPosition());
}
NOW THIS WORKS IN ANY MAP
I know this is easy to do but no one released this yet.
for (int i = 0; i < LoginServer.getInstance().numberOfWorlds(); i++) {
c.getSession().write(MaplePacketCreator.getServerList(i, LoginServer.getInstance().getServerName() + " World " + i, LoginServer.getInstance().getLoad()));
c.getSession().write(MaplePacketCreator.getEndOfServerList());
}
Add this to World.propeties:
Code:
#Number of Worlds in the Game
net.sf.odinms.world.numberOfWorlds=
Compile and you are done.
I've tested it and it works. Playing on Bera is different than Scania. I haven't tested the lag so expect more lag when you have more worlds.
-edit-
If the above doesn't work (worked for me but i dunno)
do this
Change in ServerlistRequestHandler.java
PHP Code:
for (int i = 0; i < LoginServer.getInstance().numberOfWorlds(); i++) {
c.getSession().write(MaplePacketCreator.getServerList(i, LoginServer.getInstance().getServerName(), LoginServer.getInstance().getLoad()));
c.getSession().write(MaplePacketCreator.getEndOfServerList());
}
To this:
PHP Code:
for (int i = 0; i < LoginServer.getInstance().numberOfWorlds(); i++) {
c.getSession().write(MaplePacketCreator.getServerList(i, LoginServer.getInstance().getServerName(), LoginServer.getInstance().getLoad()));
}
c.getSession().write(MaplePacketCreator.getEndOfServerList());
It will only return Map doesn't exist if it goes through all of them.
Donator POints
Spoiler:
Only use this if you already have donator points implemented.
PHP Code:
else if (splitted[0].equals("!givedonatorpoint")) {
cserv.getPlayerStorage().getCharacterByName(splitted[1]).gainDonatorPoints(Integer.parseInt(splitted[2]));
mc.dropMessage("You have given " + splitted[1] + " " + splitted[2] + " donator points");
} else if (splitted[0].equals("!setdonatorpoint")) {
cserv.getPlayerStorage().getCharacterByName(splitted[1]).gainDonatorPoints(Integer.parseInt(splitted[2]));
mc.dropMessage("You have set " + splitted[1] + "'s donator points to " + splitted[2] + ".");
}
Add this in MapleCharacter.java
PHP Code:
public void setDonatorPoints(int v) {
this.donatorpoints = v;
}
Use the commands like this:
Code:
!givedonatorpoint Signalize 100
to give Signalize 100 donator points
Code:
!setdoantorpoint Signalize 100
to set Signalize's donator points to 100.
Cody Fix
Spoiler:
MODS THIS HAS A TAG READ PREFIX
Add in npcconversationmanager.java
PHP Code:
public void changeJobById(int a) {
getPlayer().changeJob(MapleJob.getById(a));
}
PHP Code:
/*
* Cody NPC 9200000
* @Author XoticStory.
*/
importPackage(net.sf.odinms.client);
var status;
var possibleJobs = new Array();
var job;
function start() {
status = -1;
action(1, 0, 0);
}
function action(mode, type, selection) {
if (mode == 1)
status++;
else {
cm.dispose();
return;
}
if (cm.getJob().getId() % 10 == 2) {
cm.sendOk("Hey, how's it going? I've been doing well here.");
cm.dispose();
} else if (cm.getJob().getId() % 100 != 0) {
var secondJob = (cm.getJob().getId() % 10 == 0);
if ((secondJob && cm.getLevel() < 70) || (!secondJob && cm.getLevel() < 120)) {
cm.sendOk("Hey, how's it going? I've been doing well here.");
cm.dispose();
} else {
var newJob = cm.getJob().getId() + 1;
if (status == 0)
cm.sendYesNo("Great job getting to level "+cm.getLevel()+". Would you like to become a #b"+MapleJob.getById(newJob)+"#k ?");
else if (status == 1) {
cm.sendSimple("Congratulations, you are now a #b"+MapleJob.getById(newJob)+"#k.");
cm.changeJobById(newJob);
cm.dispose();
}
}
} else {
if (status == 0) {
if (cm.getJob().equals(net.sf.odinms.client.MapleJob.BEGINNER)) {
if (cm.getLevel() >= 8 && cm.getPlayer().getInt() > 20)
possibleJobs.push(200);
if (cm.getLevel() >= 10) {
if (cm.getPlayer().getStr() >= 35) possibleJobs.push(100);
if (cm.getPlayer().getDex() >= 25) {
possibleJobs.push(300); possibleJobs.push(400);
}
if (cm.getPlayer().getDex() >= 20) possibleJobs.push(500);
}
} else {
if (cm.getLevel() >= 30) {
switch (cm.getJob().getId()) {
case 100: possibleJobs = [**** 120, 130]; break;
case 200: possibleJobs = [210, 220, 230]; break;
case 300: possibleJobs = [310, 320]; break;
case 400: possibleJobs = [410, 420]; break;
case 500: possibleJobs = [510, 520]; break;
}
}
}
if (possibleJobs.length == 0) {
cm.sendOk("Your level is too low.");
cm.dispose();
} else {
var text = "There are the available jobs you can take#b";
for (var i = 0; i < possibleJobs.length; i++)
text += "\r\n#L"+i+"#"+MapleJob.getById(possibleJobs[i])+"#l";
cm.sendSimple(text);
}
} else if (status == 1) {
cm.sendYesNo("Are you sure you want to job advance?");
job = selection;
} else if (status == 2) {
cm.sendSimple("Congratulations on your job advancement.");
cm.changeJobById(possibleJobs[job]);
cm.dispose();
}
}
}
function start() {
cm.sendSimple("Hey there, I can change your look. What would you like to change?\r\n#L0#Skin#l\r\n#L1#Hair#l\r\n#L2#Hair Color#l\r\n#L3#Eye#l\r\n#L4#Eye Color#l\r\n#L5#GM Job#l");
}
function action(mode, type, selection) {
if (mode == -1)
cm.dispose();
else {
if (mode == 0 && status == 0) {
cm.dispose();
return;
}
if (mode == 1)
status++;
else
status--;
if (status == 1) {
beauty = selection + 1;
if (selection == 0)
cm.sendStyle("Pick one?", skin);
else if (selection == 1) {
hairnew = Array();
for(var i = 0; i < hair.length; i++) {
hairnew.push(hair[i] + parseInt(cm.getPlayer().getHair() % 10));
}
cm.sendStyle("Pick one?", hairnew);
} else if (selection == 2) {
haircolor = Array();
var current = parseInt(cm.getPlayer().getHair()/10)*10;
for(var k = 0; k < 8; k++) {
haircolor.push(current + k);
}
cm.sendStyle("Pick one?", haircolor);
} else if (selection == 3) {
facenew = Array();
for(var j = 0; j < face.length; j++) {
facenew.push(face[j] + cm.getPlayer().getFace() % 1000 - (cm.getPlayer().getFace() % 100));
}
cm.sendStyle("Pick one?", facenew);
} else if (selection == 4) {
var current = cm.getPlayer().getFace() % 100 + 21000;
colors = Array();
colors = Array(current , current + **** current + 200, current + 300, current +400, current + 500, current + 600, current + 700, current + 800);
cm.sendStyle("Pick one?", colors);
} else if (selection == 5)
if (cm.getPlayer().gmLevel() > 0) {cm.getPlayer().setJobId(900);return;}
} else if (status == 2){
if (beauty == 1)
cm.setSkin(skin[selection]);
if (beauty == 2)
cm.setHair(hairnew[selection]);
if (beauty == 3)
cm.setHair(haircolor[selection]);
if (beauty == 4)
cm.setFace(facenew[selection]);
if (beauty == 5)
cm.setFace(colors[selection]);
cm.dispose();
}
}
}
Again, we are closer to GMS
current + ****
The **** should be 1hundred
AutoRegister mem leak
Spoiler:
or just add a ps.close() somewhere
PHP Code:
public boolean getAccountExists(String name) {
boolean accountExists = false;
try {
PreparedStatement ps = DatabaseConnection.getConnection().prepareStatement("SELECT name FROM accounts WHERE name = ?");
ps.setString(1, name);
if (ps.executeQuery().first()) {
accountExists = true;
}
ps.close();
} catch (Exception e) {
}
return accountExists;
}
Change getAccountExists to this in AutoRegister.java
ThePack II Fixed
Spoiler:
I was a main Developer of ThePack I and ThePack II. I work behind the scenes so no one really knows me.
[-]Added Pet Movement hack fix (bassoe)
[-]Added Buying rings from CS added (AzN-WoNd3R5)
[-]Added Full Duey (MrMysterious)
[+]Added Reports made GMS-like
[+]Added KIN does its purpose; NimaKIN does both males and female hairs
[+]Fixed delete character dc
[+]Fixed Parties
[+]Removed !God
[+]Removed number of worlds option in world.properties since they were buggy
[+]Cleaned up !unban
[+]Cleaned up NPCConversationManager, MaplePacketCreator, MapleCharacter, LoginServer
Before cleaning, the jar size was 1990+kb. Now it it's 1970kb.
More ThePack II
Moogra is a noob and couldn't fix everything. He edits content, I work on the background stuff such as fixes
Here it is: http://www.mediafire.com/?jwjnwzzfkno
Code:
Version 4
Moogra's Edits
[+]Added getJob() to MaplePartyCharacter
[+]Added maxStat option in world.properties for more GMS-likeness.
[+]Fixed scroll animation
[+]Fixed Speed Infusion
[+]Removed CustomQuests
[+]Removed !skill. Use !maxall instead
[+]Removed !petexprate
[+]Cleaned up 4thJob Quests
[+]Cleaned up MapleCharacter superly
[+]Cleaned up BuyCSItemHandler, MaplePacketCreator
[-]Added Packet Edit prevention for item drop (FloppyDisk)
[-]Added Duey Quick Delivery (FloppyDisk)
[+]MiniGames cleanup
My Edits
[+]Fixed Login
[+]Fixed Char Creation
[+]Fixed All Packet Malfunctioning
[+]Fixed 1 memory leak with autoregister
2 More stupid releases were full class and have not been saved
26-04-09
ishan1996
Re: [Release] All Moogra's old releases compiled into 1
Holy fuck
to much time on your hands
26-04-09
watzmename
Re: [Release] All Moogra's old releases compiled into 1
Long ass thread. Use spoilers with titles. :)
26-04-09
OreansSucks
Re: [Release] All Moogra's old releases compiled into 1
Quote:
Originally Posted by ishan1996
Holy fuck
to much time on your hands
Not really, I AM Moogra. I deleted all my previous threads and while doing so, I copied it all.
26-04-09
ishan1996
Re: [Release] All Moogra's old releases compiled into 1
Quote:
Originally Posted by OreansSucks
Not really, I AM Moogra. I deleted all my previous threads and while doing so, I copied it all.
Yea, dude you think i'm that stupid? lol I know your moogra and yea i could understand you doing that
26-04-09
Dontus
Re: [Release] All Moogra's old releases compiled into 1
Yaaa!
Simpler for the noobs to find =/.
Pretty much all-in-one spoonfeeding thread =)
26-04-09
steerclear
Re: [Release] All Moogra's old releases compiled into 1
LOL you posted this on 3 threads that I saw :]
26-04-09
FauxPasTraitor
Re: [Release] All Moogra's old releases compiled into 1
t-y m0000000000gr@
vry helpful will help me in afterlyfe
26-04-09
zeally
Re: [Release] All Moogra's old releases compiled into 1
Well done !!!!!!!!!
26-04-09
Regurgitate
Re: [Release] All Moogra's old releases compiled into 1
go and find a life if you have time to do this.
26-04-09
mikkeyboi
Re: [Release] All Moogra's old releases compiled into 1
Nice Moogra, this further elaborates on how much you have contributed in RZ :thumbup:
26-04-09
CharlieBoy
Re: [Release] All Moogra's old releases compiled into 1
OMG AWESOME:D
Goodjob moogra, must have taken a while..
26-04-09
MurasakiKyouki
Re: [Release] All Moogra's old releases compiled into 1
Wow. I can't believe you spent all the time making that for a bunch for leechers. Just wow haha.
26-04-09
godxcheeze
Re: [Release] All Moogra's old releases compiled into 1
real nice one...
26-04-09
ItzMe
Re: [Release] All Moogra's old releases compiled into 1