Jump to content
La fin ?! Elle est là ! ×
×
×
  • Create New...

[JAVA] Ajouter le mode heroique pour AR 47


sahino
 Share

Recommended Posts

Bonjour a tous,

 

Prémier: Désole je encri le tutorial en anglais, mon francais est pas bon ;)

 

Ancestra.java

 

   //Game Modes
   public static boolean HEROIC_MODE = false;

&

else if (param.equalsIgnoreCase("HEROIC_MODE")) {
if (value.equalsIgnoreCase("true")) {
HEROIC_MODE = true;
} else {
HEROIC_MODE = false;
}
}

SocketManager:

   public static void GAME_SEND_GAMEOVER(PrintWriter out) {
       String packet = "GO";
       send(out, packet);
       {
       }
   }

GameThread:

Add in "parseGamePacket" this:

           case 'F':
               Game_freeSoul();
           break;

& under parseGamePacket:

   private void Game_freeSoul() {
       if (Ancestra.HEROIC_MODE){
           SocketManager.GAME_SEND_GAMEOVER(_out);
           _perso.set_isDeath(1);
           _perso._reachedLevel = _perso.get_lvl();
       }
   }

& parseAccountPacket case:

           case 'R':
               int charaID = Integer.parseInt(packet.substring(2));
               _perso = _compte.get_persos().get(charaID);
               _perso.set_isDeath(0);
               _perso.add_deathCount(1);
               _perso._capital = 0;
               _perso.set_lvl(Ancestra.CONFIG_START_LEVEL);
               _perso.set_kamas(Ancestra.CONFIG_START_KAMAS);
               _perso.set_isGrave(false);
               _perso.warpToStartPos();
               _perso._title = 0;
               _perso._items.isEmpty();
               SocketManager.GAME_SEND_PERSO_LIST(_out, _compte.get_persos());
               break;

Fight

Search "verifIfTeamAllDead" and at the bottom, where the energy loose and the warp is coded, you need to add this:

               //TODO perte d'energie
               if (Ancestra.HEROIC_MODE){
                   F.getPersonnage().Dead();
               } else {
                   F.getPersonnage().warpToSavePos();
                   F.getPersonnage().set_PDV(1);
                   F.getPersonnage().resetAS();
                   SocketManager.GAME_SEND_STATS_PACKET(F.getPersonnage());
               try {
                   Thread.sleep(200);
               } catch (Exception E) {
               };
               F.getPersonnage().set_canAggro(true);
               }

Personnages

   public int _isDeath = 0; // 0 = not death & 1 = is death
   public int _deathCount = 0;
   public int _reachedLevel = 0;
   public boolean _isGrave = false;

parseALK:

   public String parseALK()
   {
       String perso = "";
       perso += this._GUID+";";
       perso += this._name+";";
       perso += this._lvl+";";
       perso += this._gfxID+";";
       perso += (this._color1!= -1?Integer.toHexString(this._color1):"-1")+";";
       perso += (this._color2!= -1?Integer.toHexString(this._color2):"-1")+";";
       perso += (this._color3!= -1?Integer.toHexString(this._color3):"-1")+";";
       perso += getGMStuffString()+ ";";
       perso += this._isMerchant+";";//merchant
       perso += "1;";
       if(Ancestra.HEROIC_MODE){
           perso += this._isDeath+";";
           perso += this._deathCount+";";
           perso += this._reachedLevel; // HEROIC MODE
       } else {
           perso += (";;");
       }
       return "|"+perso;
   }

& parseToGM

   public String parseToGM()
   {
       String str = "";
       if(_fight == null)// Hors combat
       {
           str+= _curCell.getID()+";";
           str+= _orientation+";";
           str+= "0"+";";//FIXME:?
           str+= _GUID+";";
           str+= _name+";";
           str+= _classe;
           str+= (this.get_title()>0?(","+this.get_title()+";"):(";"));
           str+= (_isGrave ? getGraveMorph() : Integer.valueOf(this._gfxID))+"^"+_size+";";//gfxID^size
           str+= _sexe+";";
           str+= _align+",";//1,0,0,4055064
           str+= "0,";//FIXME:?
           str+= (_showWings?getGrade():"0")+",";
           str+= _GUID+";";
           str+= (_color1==-1?"-1":Integer.toHexString(_color1))+";";
           str+= (_color2==-1?"-1":Integer.toHexString(_color2))+";";
           str+= (_color3==-1?"-1":Integer.toHexString(_color3))+";";
           str+= getGMStuffString()+";";
           if(Ancestra.AURA_SYSTEM)
           {
               str+= (_lvl>99?(_lvl>199?(2):(1)):(0))+";";
           }else
           {
               str+= "0;";
           }
           str+= ";";//Emote
           str+= ";";//Emote timer
           if(this._guildMember!=null && this._guildMember.getGuild().getMembers().size()>9)
           {
               str += this._guildMember.getGuild().get_name()+";"+this._guildMember.getGuild().get_emblem()+";";
           }
           else str+= ";;";
           str+= /* Restriction */ "0;";//TODO: Restriction
           str+= (_onMount&&_mount!=null?_mount.get_color():"")+";";
           str+= ";";
       }
       return str;
   }

   private String getGraveMorph() {
       return this._classe + "3";
   }

& at the End (bottom)

   public void Dead() {
        SocketManager.send(this, "M112");
        this.set_isGrave(true);
        SocketManager.GAME_SEND_MESSAGE(this, "Write /release to free the Soul!", Ancestra.CONFIG_MOTD_COLOR);
   }

   public void set_isDeath(int isDeath) {
           this._isDeath = isDeath;
   }

   public void add_deathCount(int deathCount){
       this._deathCount =+ deathCount;
   }

   public int get_isDeath() {
       return _isDeath;
   }

   public int get_deathCount() {
       return _deathCount;
   }

   public int get_reachedLevel() {
       return _reachedLevel;
   }

   public boolean get_isGrave(){
       return _isGrave;
   }

   public boolean set_isGrave(boolean isGrave){
       return _isGrave = isGrave;
   }

 

Fini de Tutorial ;) 100% by Defura

 

un petit merci est pas un mort x)

 

Cordialement, Defura.

Link to comment
Share on other sites

  • Replies 13
  • Created
  • Last Reply

Top Posters In This Topic

  • 1 year later...
  • 3 weeks later...
Merci du partage, quelqu'un à testé ? (:

 

Posté par Thedark - 22-03-2012 19:09

Moi j'ai testé il y a des probléme sur les code

Posté par Thedark - 23-03-2012 12:04

Exemple : (Ancestrar.Heroic-mode) fait comme sa (ancestra.heroic-mode) régle les code svp!

 

Est-ce que d'autres personnes ont testé svp ? Merci.

Link to comment
Share on other sites

 Share



Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.