Beispiel #1
0
  public static void doFishing(client.MapleCharacter chr) {
    int mesoMultiplier = 1;
    int expMultiplier = 1;
    switch (chr.getWorld()) {
      case 0:
        mesoMultiplier = 40000;
        expMultiplier = 20000;
        break;
    }
    int mesoAward =
        (int) (1400.0 * Math.random() + 1201) * mesoMultiplier + (6 * chr.getLevel() / 5);
    int expAward =
        (int) ((645.0 * Math.random()) * expMultiplier + (15 * chr.getLevel() / 2) / 6)
            * chr.getFishingLevel();
    if (chr.getReborns() >= 5
        && chr.getMapId() == 970020001
        && chr.haveItem(3011000)
        && chr.getChair() == 3011000) {
      int rand = (int) (3.0 * Math.random());
      int fishingexp = (int) (7.0 * Math.random()) + 1;
      switch (rand) {
        case 0:
          chr.gainMeso(mesoAward, true, true, true);
          chr.gainFishingEXP(fishingexp);
          chr.getClient()
              .getSession()
              .write(MaplePacketCreator.catchMonster(9500336, 2000017, (byte) 1));
          chr.getMap()
              .broadcastMessage(
                  chr, MaplePacketCreator.catchMonster(9500336, 2000017, (byte) 1), false);
          break;
        case 1:
          chr.gainExp(expAward, true, true);
          chr.gainFishingEXP(fishingexp);
          chr.getClient()
              .getSession()
              .write(MaplePacketCreator.catchMonster(9500336, 2000017, (byte) 1));
          chr.getMap()
              .broadcastMessage(
                  chr, MaplePacketCreator.catchMonster(9500336, 2000017, (byte) 1), false);
          break;
        case 2:
          chr.gainFishingEXP(fishingexp * 2);
          chr.getClient()
              .getSession()
              .write(MaplePacketCreator.catchMonster(9500336, 2000017, (byte) 1));
          chr.getMap()
              .broadcastMessage(
                  chr, MaplePacketCreator.catchMonster(9500336, 2000017, (byte) 1), false);
          break;
      }

    } else {
      chr.dropMessage("Please sit on your fishing chair at the fishing lagoon to fish.");
    }
  }
 public static boolean handlePortal(String name, MapleCharacter c) {
   if (name.equals(FourthJobQuests.RUSH.getValue())) {
     if (!(c.getParty().getLeader().getId() == c.getId()) && !checkRush(c)) {
       c.dropMessage("You step into the portal, but it swiftly kicks you out.");
       c.getClient().announce(MaplePacketCreator.enableActions());
     }
     if (!(c.getParty().getLeader().getId() == c.getId()) && checkRush(c)) {
       c.dropMessage("You're not the party leader.");
       c.getClient().announce(MaplePacketCreator.enableActions());
       return true;
     }
     if (!checkRush(c)) {
       c.dropMessage("Someone in your party is not a 4th Job warrior.");
       c.getClient().announce(MaplePacketCreator.enableActions());
       return true;
     }
     c.getClient()
         .getChannelServer()
         .getEventSM()
         .getEventManager("4jrush")
         .startInstance(c.getParty(), c.getMap());
     return true;
   } else if (name.equals(FourthJobQuests.BERSERK.getValue())) {
     if (!c.haveItem(4031475)) {
       c.dropMessage("The portal to the Forgotten Shrine is locked");
       c.getClient().announce(MaplePacketCreator.enableActions());
       return true;
     }
     c.getClient()
         .getChannelServer()
         .getEventSM()
         .getEventManager("4jberserk")
         .startInstance(c.getParty(), c.getMap());
     return true;
   }
   return false;
 }