예제 #1
0
    def apply(self, client, args):
        X = int(args[0])
        if " " in args[1]:
            Y = int(args[1].split()[0])
            Z = int(args[1].split()[1])
        else:
            Y = int(args[1])
            Z = -1

        subAreas = DAO.getMaps().getSubAreaOfPos(X, Y)
        if len(subAreas) > 1 and Z == -1:
            client.send(
                ConsoleMessage(
                    0,
                    "This position contains a lots of subArea so try one of this .."
                ))
            for pos in subAreas:
                client.send(
                    ConsoleMessage(
                        0, "gopos " + str(X) + " " + str(Y) + " " +
                        str(pos.getSubAreaId()) + " (Or choose teleport " +
                        str(pos.getId()) + " -1 )"))

        else:
            if Z == -1:
                Z = subAreas[0].getSubAreaId()

            map = DAO.getMaps().findMapByPos(X, Y, Z)
            if map is None:
                client.send(ConsoleMessage(0, "Undefined map .."))
                pass

            client.getCharacter().teleport(map.getId(),
                                           map.getAnyCellWalakable().getId())
예제 #2
0
 def apply(self, client, args):
     target = DAO.getPlayers().getCharacter(args[1])
     if target is None or target.getClient() is None:
         client.send(ConsoleMessage(0, "The target is missing"))
     else:
         target.addExperience((DAO.getExps().getPlayerMinExp(int(args[0])) +
                               1) - target.getExperience())
         client.send(ConsoleMessage(0, "The level has been upped"))
 def apply(self, client, args):
     try:
         cellid = int(args[0])
         object = int(args[1])
         durability = int(args[2])
         durabilityMax = int(args[3])
         DAO.getPaddocks().find(
             client.getCharacter().getCurrentMap().getId()).addPaddockItem(
                 PaddockItem(cellid, object,
                             ItemDurability(durability, durabilityMax)))
         client.send(ConsoleMessage(0, "Item successfully added"))
     except:
         client.send(ConsoleMessage(0, "Error"))
 def apply(self, client, args):
     target = DAO.getPlayers().getCharacter(args[0])
     if target is None:
         client.send(ConsoleMessage(0, "The target is missing"))
     else:
         sb = StringBuilder()
         for player in DAO.getPlayers().getByIp(target.getClient().getIP()):
             sb.append("Player ").append(player.getNickName())
             sb.append(" Level ").append(player.getLevel())
             sb.append(" PH ").append(player.getHonor())
             sb.append(" MapPos ").append(
                 player.getCurrentMap().posToString()).append("\n")
         sb.append("IP ").append(target.getClient().getIP())
         sb.append(" Nickname ").append(target.getAccount().nickName)
         client.send(ConsoleMessage(0, sb.toString()))
예제 #5
0
 def apply(self, client, args):
     target = DAO.getPlayers().getCharacter(args[0])
     if target is None or target.getClient() is None:
         client.send(ConsoleMessage(0, "The target is missing"))
     else:
         target.getClient().timeOut()
         client.send(ConsoleMessage(0, "The target has been expelled"))
예제 #6
0
    def apply(self, client, args):
        id = int(args[0])
        cell = int(args[1])
        dir = int(args[2])

        npc = DAO.getNpcs().findTemplate(id)

        client.send(GameRolePlayShowActorMessage(npc.getProjection(cell, dir)))
예제 #7
0
    def apply(self,client,args):
        target = DAO.getPlayers().getCharacterOwner(args[0]);

        if target == -1 :
            client.send(ConsoleMessage(0, "The target is missing"));
        else:
            Main.getInterClient().send(AccountTookAwayMessage(target));
            client.send(ConsoleMessage(0, "The target has been unsuspended"));
예제 #8
0
 def apply(self,client,args):
     target = DAO.getPlayers().getCharacter(args[0]);
     if target is None or target.getClient() is None :
         client.send(ConsoleMessage(0, "The target is missing"));
     else:
         time = Instant.now().plus(int(args[1]), ChronoUnit.HOURS).toEpochMilli();
         Main.getInterClient().send(PlayerSuspendedMessage(time,target.getAccount().getId()));
         target.getClient().timeOut();
         client.send(ConsoleMessage(0, "The target has been banned for "+ args[1] +" hours"));
예제 #9
0
 def apply(self,client,args):
     target = DAO.getPlayers().getCharacter(args[1]);
     if target is None or target.getClient() is None :
         client.send(ConsoleMessage(0, "The target is missing"));
     elif ArrayUtils.contains(client.getCharacter().getTitles(), int(args[0])):
         client.send(ConsoleMessage(0, "The target possesses already the title"));
     else:
         client.getCharacter().setTitles(ArrayUtils.add(client.getCharacter().getTitles(), int(args[0])));
         client.send(TitleGainedMessage(int(args[0])));
         client.send(ConsoleMessage(0, "The title has been added"));
예제 #10
0
 def apply(self, client, args):
     target = DAO.getPlayers().getCharacter(args[1])
     if target is None or target.getClient() is None:
         client.send(ConsoleMessage(0, "The target is missing"))
     elif ArrayUtils.contains(target.getOrnaments(), int(args[0])):
         client.send(
             ConsoleMessage(0, "The target possesses already the ornament"))
     else:
         target.setOrnaments(
             ArrayUtils.add(target.getOrnaments(), int(args[0])))
         target.send(OrnamentGainedMessage(int(args[0])))
         client.send(ConsoleMessage(0, "The ornament has been added"))
예제 #11
0
 def apply(self, client, args):
     target = DAO.getPlayers().getCharacter(args[0])
     if target is None or target.getClient() is None:
         client.send(ConsoleMessage(0, "The target is missing"))
     else:
         time = Instant.now().plus(int(args[1]),
                                   ChronoUnit.MINUTES).toEpochMilli()
         PlayerInst.getPlayerInst(target.getID()).setMutedTime(time)
         target.send(TextInformationMessage(1, 123, str(int(args[1]) * 60)))
         client.send(
             ConsoleMessage(
                 0,
                 "The target has been muted for " + args[1] + " minutes"))
예제 #12
0
    def apply(self, client, args):
        try:
            level = int(args[0])
        except BaseException:
            level = 200

        if level < 2 or level > 200:
            layerController.sendServerMessage(client, "Niveau invalide")
        else:
            client.getCharacter().addExperience(
                (DAO.getExps().getPlayerMinExp(level) + 1) -
                client.getCharacter().getExperience())
            action = client.getGameAction(GameActionTypeEnum.TUTORIAL)
            action.keepGoing()
예제 #13
0
    def apply(self, client, args):
        id = int(args[0])
        qua = int(args[1])
        if args[2] == "max":
            type = EffectGenerationType.MAX_EFFECTS
        elif args[2] == "min":
            type = EffectGenerationType.MIN_EFFECTS
        else:
            type = EffectGenerationType.NORMAL

        if (id is 13470 or id is 12736 or id is 11792
                or id is 11563) and client.getAccount().right < 4:
            id = 8876

        template = DAO.getItemTemplates().getTemplate(id)

        if template is None:
            client.send(ConsoleMessage(0, "Inexistant item"))
            pass
        if not template.getSuperType() is None and template.getSuperType(
        ) is ItemSuperTypeEnum.SUPERTYPE_PET:
            qua = 1

        item = InventoryItem.getInstance(
            DAO.getItems().nextItemId(), id, 63,
            client.getCharacter().getID(), qua,
            EffectHelper.generateIntegerEffect(template.getPossibleEffects(),
                                               type, template.isWeapon()))
        if client.getCharacter().getInventoryCache().add(item, True):
            item.setNeedInsert(True)

        client.send(
            ConsoleMessage(
                0,
                String.format("%s  added to your inventory with %s stats",
                              template.getNameId(), type.toString())))
예제 #14
0
 def apply(self, client, args):
     target = DAO.getPlayers().getCharacter(args[1])
     if target is None or target.getClient() is None:
         client.send(ConsoleMessage(0, "The target is missing"))
     else:
         target.addHonor(int(args[0]), True)
예제 #15
0
 def apply(self,client,args):
     target = DAO.getPlayers().getCharacter(args[0]);
     if target is None:
         client.send(ConsoleMessage(0, "The target is missing"));
     else:
         client.teleport(target.getMapid(),target.getCell().getId());
예제 #16
0
 def apply(self, client, args):
     players = DAO.getPlayers().getPlayers()
     for player in players:
         player.save(False)
     client.send(ConsoleMessage(0, "Save ended"))