[Release] Small version of Bomberman PVP

Status
Not open for further replies.
Joined
Apr 7, 2008
Messages
570
Reaction score
31
in maplemap.java
replace the killmonster function with this (there are 2, select them both, then replace)
Code:
public void killMonster (final MapleMonster monster, final MapleCharacter chr, final boolean withDrops) {
  killMonster(monster, chr, withDrops, false, 1);
 }
 
 
 @SuppressWarnings("static-access")
 public void killMonster (final MapleMonster monster, final MapleCharacter chr, final boolean withDrops, final boolean secondTime, int animation) {
  if (monster.getId() == 8810018 && !secondTime) {
   TimerManager.getInstance().schedule(new Runnable() {
    @Override
    public void run() {
     killMonster(monster, chr, withDrops, true, 1);
     killAllMonsters(false);
    }
   }, 3000);
   return;
                }
  if (monster.getBuffToGive() > -1) {
   MapleItemInformationProvider mii = MapleItemInformationProvider.getInstance();
   MapleStatEffect statEffect = mii.getItemEffect(monster.getBuffToGive());
   for (MapleMapObject mmo : this.getAllPlayer()) {
    MapleCharacter character = (MapleCharacter) mmo;
    statEffect.applyTo(character);
   }
  }
  if (monster.getId() == 8810018) {
   MaplePacket packet = MaplePacketCreator.serverNotice(6, "To the crew who have defeated Horntail after numerous attempts, we salute you! You are the true heroes of Leafre!");
   try {
    chr.getClient().getChannelServer().getInstance(chr.getClient().getChannel()).getWorldInterface().broadcastMessage(chr.getName(), packet.getBytes());
   } catch (RemoteException e) {
    chr.getClient().getChannelServer().reconnectWorld();
   }
  }
  spawnedMonstersOnMap.decrementAndGet();
  monster.setHp(0);
  broadcastMessage(MaplePacketCreator.killMonster(monster.getObjectId(), animation), monster.getPosition());
  removeMapObject(monster);
  if (monster.getId() >= 8800003 || monster.getId() <= 8800010) {
                        boolean makeZakReal = false;
                        Collection<MapleMapObject> objects = getMapObjects();
                        for (MapleMapObject object : objects) {
    MapleMonster mons = getMonsterByOid(object.getObjectId());
    if (mons != null) {
     switch (mons.getId()) {
      case 8800003:
      case 8800004:
      case 8800005:
      case 8800006:
      case 8800007:
      case 8800008:
      case 8800009:
      case 8800010:
       makeZakReal = true;
       break;
     }
    }
                        }
                        if (makeZakReal) {
    for (MapleMapObject object : objects) {
     MapleMonster mons = chr.getMap().getMonsterByOid(object.getObjectId());
     if (mons != null) {
      if (mons.getId() == 8800000) {
       broadcastMessage(MaplePacketCreator.makeMonsterReal(mons));
       updateMonsterController(mons);
      }
     }
    }
                        }
 
                }
  MapleCharacter dropOwner = monster.killBy(chr);
  if (withDrops && !monster.dropsDisabled()) {
   if (dropOwner == null) {
    dropOwner = chr;
   }
   dropFromMonster(dropOwner, monster);
  }
 }
in takedamagehandler.java
add the imports
Code:
import net.sf.odinms.net.MaplePacket;
import net.sf.odinms.client.MapleStat;

find if (!player.isHidden()) {
replace that "function" with
Code:
if (!player.isHidden()) {
                    if (monsteridfrom == 9300166) {
                        player.setBombPoints(player.getBombPoints() - 1);
                        if (player.getBombPoints() < 1) {
                            player.setHp(0);
                            player.updateSingleStat(MapleStat.HP, 0);
                            player.setBombPoints(5);
                            MaplePacket packet = MaplePacketCreator.serverNotice(0, "[Update] Player " + player.getName() + " is dead");
                            c.getPlayer().getMap().broadcastMessage(packet);
                            return;
                        } else {
                            MaplePacket packet = MaplePacketCreator.serverNotice(0, "[Update] Player " + player.getName() + " now has " + player.getBombPoints() + " points");
                            c.getPlayer().getMap().broadcastMessage(packet);
                         return;
                        }
                    } else {
   player.getMap().broadcastMessage(player,
    MaplePacketCreator.damagePlayer(damagefrom, monsteridfrom, player.getId(), damage, fake, direction, is_pgmr, pgmr, is_pg, oid, pos_x, pos_y), false);
                        player.checkBerserk();
                    }
  }

in maplecharacter.java
find
Code:
private int gmlevel;
add this beneath it
Code:
private int bombpoints;

then find
Code:
public int getGender() {
        return gender;
    }

add this beneath it
Code:
public int getBombPoints() {
                return bombpoints;
        }

find
Code:
public void setGender(int gender) {
        this.gender = gender;
    }

add this beneath it
Code:
public void setBombPoints(int bombpoints) {
                this.bombpoints = bombpoints;
        }

now for the npcs
i used this for a npc, 2012025
so make 2012025.js
Code:
var status = 0;
var pvpmap = 925100700;
function start() {
 status = -1;
 action(1, 0, 0);
}
function action(mode, type, selection) {
 if (mode == -1) {
  cm.dispose();
 } else {
  if (mode == 0) {
   cm.sendOk("OK then, see you next time!");
      cm.dispose();
      return;
    }
  if (mode == 1)
      status++;
    else
      status--;
    if (status == 0) {
   cm.sendYesNo("Hey, Do you want to do the Bomberman PVP?");
  } else {
   cm.gainItem(2100067, -(cm.itemQuantity(2100067)));
   cm.gainItem(2100067, 100);
   cm.warp(pvpmap);
   cm.dispose();
  }
 }
}

Now guon, the npc in the pvp map
2094002.js
Code:
var status = 0;
var mapid = 925100700;
function start() {
 status = -1;
 action(1, 0, 0);
}
function action(mode, type, selection) {
 if (mode == -1) {
  cm.dispose();
 } else {
  if (mode == 0) {
   cm.sendOk("OK then, see you next time!");
      cm.dispose();
      return;
    }
  if (mode == 1)
      status++;
    else
      status--;
    if (status == 0) {
   cm.sendSimple("#b#L1#I wanna restore bombs#l\r\n#L2#I want to get out#k#l");
  } else {
   if (selection == 1) {
    if (cm.itemQuantity(2100067) <= 10) {
     cm.gainItem(2100067, 25);
     cm.dispose();
    } else {
     cm.sendOk("you have more then 10 bombs\r\nSo its not time to restore yet");
     cm.dispose();
    }
   } else {
    cm.warp(100000000);
    cm.gainItem(2100067, -(cm.itemQuantity(2100067)));
    cm.dispose();
   }
  }
 }
}

This is just the small release, nejevoli wanted me to release it..
im not here to fix errors, make sure you make a backup of your 2 files

Credits: Nejevoli for the idea, Nejevoli for helping me with the bombs effect
Me, for actually making it, and releasing here

please note: there may come an update in the future with a system that if you kill someone you get a Point
and you can exchange that points for like, items and stuff

enjoy
 
Last edited:
sufi , i told him to lol, but yeah this is the base. he's got a better one on his server thats for sure, and hmmm, its the base so you guys can tweak it or add more stuffs to it.

good luck on this. dont ask us how to fix bugs or w/e , its tested and working on chickenms.

next few updates of this might be the bombpoints recorded in mysql, theme rooms like

forest theme - one of the ellinia map
underwater theme - one of the aqua road map
desert theme - ariant map

and a few more bomberman pvp rooms will be created, you may choose to block the portal of the maps and remove monsters from the map you are using.

or just perhaps you wanna add boomers (yellow bomb mobs) that drops the bombs for the player to pick up to use, feel free to give your ideas here, so bassoe aka kippieJ can update this thread.
 
nice idea, maybe can throw mobs at each other =]
 
sufi , i told him to lol, but yeah this is the base. he's got a better one on his server thats for sure, and hmmm, its the base so you guys can tweak it or add more stuffs to it.

good luck on this. dont ask us how to fix bugs or w/e , its tested and working on chickenms.

next few updates of this might be the bombpoints recorded in mysql, theme rooms like

forest theme - one of the ellinia map
underwater theme - one of the aqua road map
desert theme - ariant map

and a few more bomberman pvp rooms will be created, you may choose to block the portal of the maps and remove monsters from the map you are using.

or just perhaps you wanna add boomers (yellow bomb mobs) that drops the bombs for the player to pick up to use, feel free to give your ideas here, so bassoe aka kippieJ can update this thread.
yeah i noticed. since chickenms was the first to implement this.
 
errr.... Like changing the idea of bombs.;. and maps.
 
Status
Not open for further replies.
Back