[HELP] CPQ - Hurricane - HEELP!

Results 1 to 4 of 4
  1. #1
    Account Upgraded | Title Enabled! GabrielSin is offline
    MemberRank
    Apr 2010 Join Date
    483Posts

    sad [HELP] CPQ - Hurricane - HEELP!

    Please Help !

    Errors tendon 'm with my CPQ when I start making battle My Characters Staying EVEN Group ( lol )

    Here how this functions , and other MapleRoyals know already corrected , anyone ? please!

    PHP Code:
    public int checkAVGLevel(int map) {
            
    MapleMap mapz c.getChannelServer().getMapFactory().getMap(mapc.getPlayer().getWorld());
            List<
    MapleMapObjectplayers mapz.getMapObjectsInRange(c.getPlayer().getPosition(), Double.POSITIVE_INFINITYArrays.asList(MapleMapObjectType.PLAYER));
            
    int level 0;
            for (
    int a 0players.size(); a++) {
                
    MapleCharacter victim = (MapleCharacterplayers.get(a);
                
    level += victim.getLevel();
            }
            return (
    level players.size());
        }
     
        public 
    int calcAvgLvl(int map) {
            
    int num 0;
            
    int avg 0;
            for (
    MapleMapObject mmo c.getChannelServer().getMapFactory().getMap(map).getAllPlayer()) {
                
    avg += ((MapleCharactermmo).getLevel();
                
    num++;
            }
            
    avg /= num;
            return 
    avg;
        }
     
        public 
    void sendCPQMapLists() {
            
    String msg "Pick a field:\\r\\n";
            for (
    int i 06i++) {
                if (
    fieldTaken(i)) {
                    if (
    fieldLobbied(i)) {
                        
    msg += "#b#L" "#Monster Carnival Field " + (1) + " Avg Lvl: " +
                                
    calcAvgLvl(980000100 100) + "#l\\r\\n";
                    } else {
                        continue;
                    }
                } else {
                    
    msg += "#b#L" "#Monster Carnival Field " + (1) + "#l\\r\\n";
                }
            }
            
    sendSimple(msg);
        }
     
        public 
    boolean fieldTaken(int field) {
            if (
    c.getChannelServer().getMapFactory().getMap(980000100 field 100).getAllPlayer().size() != 0) {
                return 
    true;
            }
            if (
    c.getChannelServer().getMapFactory().getMap(980000101 field 100).getAllPlayer().size() != 0) {
                return 
    true;
            }
            if (
    c.getChannelServer().getMapFactory().getMap(980000102 field 100).getAllPlayer().size() != 0) {
                return 
    true;
            }
            return 
    false;
        }
     
        public 
    boolean fieldLobbied(int field) {
            if (
    c.getChannelServer().getMapFactory().getMap(980000100 field 100).getAllPlayer().size() != 0) {
                return 
    true;
            }
            return 
    false;
        }
     
        public 
    void cpqLobby(int field) {
            try {
                
    MapleMap map;
                
    ChannelServer cs c.getChannelServer();
                
    map cs.getMapFactory().getMap(980000100 100 field);
                for (
    MaplePartyCharacter mpc c.getPlayer().getParty().getMembers()) {
                    
    MapleCharacter mc;
                    
    mc cs.getPlayerStorage().getCharacterByName(mpc.getName());
                    if (
    mc != null) {
                        
    mc.changeMap(mapmap.getPortal(0));
                        
    mc.getClient().getSession().write(MaplePacketCreator.serverNotice(5,
                                
    "You will now recieve challenges from other parties. If you do not accept a challenge in 3 minutes, you will be kicked out."));
                        
    mc.getClient().getSession().write(MaplePacketCreator.getClock(60));
                    }
                }
            } catch (
    Exception ex) {
                
    ex.printStackTrace();
            }
        }
     
        public 
    MapleCharacter getChrById(int id) {
            
    ChannelServer cs c.getChannelServer();
            return 
    cs.getPlayerStorage().getCharacterById(id);
        }
     
        public 
    void startCPQ(final MapleCharacter challengerint field) {
            try {
                if (
    challenger != null) {
                    if (
    challenger.getParty() == null) {
                        throw new 
    RuntimeException("Challenger's party was null!");
                    }
                    for (
    MaplePartyCharacter mpc challenger.getParty().getMembers()) {
                        
    MapleCharacter mc;
                        
    mc c.getChannelServer().getPlayerStorage().getCharacterByName(mpc.getName());
                        if (
    mc != null) {
                            
    mc.changeMap(c.getPlayer().getMap(), c.getPlayer().getMap().getPortal(0));
                            
    mc.getClient().getSession().write(MaplePacketCreator.getClock(10));
                        }
                    }
                }
                final 
    int mapid c.getPlayer().getMap().getId() + 1;
                
    TimerManager.getInstance().schedule(new Runnable() {
     
                    [
    MENTION=2000004426]Override[/MENTION]
                    public 
    void run() {
                        
    MapleMap map;
                        
    ChannelServer cs c.getChannelServer();
                        
    map cs.getMapFactory().getMap(mapid);
                        new 
    MonsterCarnival(getPlayer().getParty(), challenger.getParty(), mapid);
                        
    map.broadcastMessage(MaplePacketCreator.serverNotice(5,
                                
    "Monster Carnival has begun!"));
                    }
                }, 
    10000);
                
    mapMessage(5"Monster Carnival will begin in 10 seconds!");
            } catch (
    Exception ex) {
                
    ex.printStackTrace();
            }
        }
     
        public 
    void challengeParty(int field) {
            
    MapleCharacter leader null;
            
    MapleMap map c.getChannelServer().getMapFactory().getMap(980000100 100 field);
            for (
    MapleMapObject mmo map.getAllPlayer()) {
                
    MapleCharacter mc = (MapleCharactermmo;
                if (
    mc.getParty().getLeader().getId() == mc.getId()) {
                    
    leader mc;
                    break;
                }
            }
            if (
    leader != null) {
                if (!
    leader.isChallenged()) {
                    List<
    MaplePartyCharacterfuckwits = new LinkedList<MaplePartyCharacter>();
                    for (
    MaplePartyCharacter fucker c.getPlayer().getParty().getMembers()) {
                        
    fuckwits.add(fucker);
                    }
                    
    NPCScriptManager.getInstance().start(cnpcfileNamechr);
                    
    NPCScriptManager.getInstance().start(
                            
    "cpqchallenge"leader.getClient(), npcfuckwits);
                } else {
                    
    sendOk("The other party is currently taking on a different challenge.");
                }
            } else {
                
    sendOk("Could not find leader!");
            }
        } 


  2. #2
    Moderator Eric is offline
    ModeratorRank
    Jan 2010 Join Date
    DEV CityLocation
    3,188Posts

    Re: [HELP] CPQ - Hurricane - HEELP!

    I'm not quite understanding your question and all of the involved code above.. Are there errors with all of this or what? What do you mean the characters are staying an even group? O.o

  3. #3
    Account Upgraded | Title Enabled! GabrielSin is offline
    MemberRank
    Apr 2010 Join Date
    483Posts

    Re: [HELP] CPQ - Hurricane - HEELP!

    Quote Originally Posted by chunkarama View Post
    I'm not quite understanding your question and all of the involved code above.. Are there errors with all of this or what? What do you mean the characters are staying an even group? O.o
    When I enter the CPQ Both party 's coming one .
    Example , when i click " disband " who leaves the map I ' m not , but the other competitor .
    And With That , I can attack the monsters would be it .

  4. #4
    Account Upgraded | Title Enabled! StripedCow is offline
    MemberRank
    Jun 2011 Join Date
    813Posts

    Re: [HELP] CPQ - Hurricane - HEELP!

    Quote Originally Posted by GabrielSin View Post
    When I enter the CPQ Both party 's coming one .
    Example , when i click " disband " who leaves the map I ' m not , but the other competitor .
    And With That , I can attack the monsters would be it .
    Dude u talking to me like a SpaceMan Speak english pls...



Advertisement