Jump to content
×
×
  • Create New...

[JAVA] Téléportation donjon via commande


jasonvnm
 Share

Recommended Posts

Bonjour à tous alors pour mon premier "tuto" je vais vous expliquer comment faire une commande de téléportation vers un donjon ( qui utilise le même principe qu'une commande de téléportation normale ).

 

Requis :

- Les sources de votre émulateur dérivé d'AR ou AR tout simplement.

- Un tutoriel pour compiler vos sources.

- Un cerveau qui supporte le langage français tel qu'il a été inventé.

 

Étape 1 :

Rendez-vous dans "Ancestra.java"

 

Faites CTRL + F et cherchez :

public static int CONFIG_START_CELL = 314;

Ceci fait, tapez sur ENTER ( sans lui faire trop mal ) pour laisser une ligne vide et copier/coller ce code :

public static short CONFIG_BOUFTOU_MAP = 2073;
public static short CONFIG_BOUFTOU_CELL = 353;
public static short CONFIG_CHAMP_MAP = 9768;
public static short CONFIG_CHAMP_CELL = 353;
public static short CONFIG_ENSABLE_MAP = 10156;
public static short CONFIG_ENSABLE_CELL = 353;
public static short CONFIG_INCARNAM_MAP = 10360;
public static short CONFIG_INCARNAM_CELL = 353;
public static short CONFIG_FORGERON_MAP = 2085;
public static short CONFIG_FORGERON_CELL = 353;
public static short CONFIG_SCARA_MAP = 9778;
public static short CONFIG_SCARA_CELL = 353;
public static short CONFIG_BWORK_MAP = 9750;
public static short CONFIG_BWORK_CELL = 353;
public static short CONFIG_BLOP_MAP = 11879;
public static short CONFIG_BLOP_CELL = 353;
public static short CONFIG_WABBIT_MAP = 1767;
public static short CONFIG_WABBIT_CELL = 353;
public static short CONFIG_RAT_MAP = 10191;
public static short CONFIG_RAT_CELL = 353;
public static short CONFIG_SKEUNK_MAP = 8973;
public static short CONFIG_SKEUNK_CELL = 353;
public static short CONFIG_DRAGO_MAP = 10098;
public static short CONFIG_DRAGO_CELL = 353;
public static short CONFIG_MINO_MAP = 9880;
public static short CONFIG_MINO_CELL = 353;
public static short CONFIG_CANIDE_MAP = 9645;
public static short CONFIG_CANIDE_CELL = 353;
public static short CONFIG_DRAGONCOCHON_MAP = 8541;
public static short CONFIG_DRAGONCOCHON_CELL = 353;

Ensuite dans votre config copier/coller ces lignes à la fin :

BOUFTOU_MAP = 2073
BOUFTOU_CELL = 353

CHAMP_MAP = 9768
CHAMP_CELL = 353

ENSABLE_MAP = 10156
ENSABLE_CELL = 353

INCARNAM_MAP = 10360
INCARNAM_CELL = 353

FORGERON_MAP = 2085
FORGERON_CELL = 353

SCARA_MAP = 9778;
SCARA_CELL = 353

BWORK_MAP = 9750
BWORK_CELL = 353

BLOP_MAP = 11879
BLOP_CELL = 353

WABBIT_MAP = 1767
WABBIT_CELL = 353

RAT_MAP = 10191
RAT_CELL = 353

SKEUNK_MAP = 8973
SKEUNK_CELL = 353

DRAGO_MAP = 10098
DRAGO_CELL = 353

MINO_MAP = 9880
MINO_CELL = 353

CANIDE_MAP = 9645
CANIDE_CELL = 353

DRAGONCOCHON_MAP = 8541
DRAGONCOCHON_CELL = 353

 

 

Les id's des maps et cells de vos donjons sont désormais modifiable via la config.

Mais ce n'est pas terminé ! Il faut maintenant créer les commandes de téléportation.

Pour ma part je préfère des commandes à 3 lettres.

Étape 2 :

 

Allez dans "GameThread.java"

 

Faites CTRL + F et cherchez :

if(msg.length() > 7 && msg.substring(1, 8).equalsIgnoreCase("command"))

Vous trouverez quelque chose ressemblant à ceci :

if(msg.length() > 7 && msg.substring(1, 8).equalsIgnoreCase("command"))
{
SocketManager.GAME_SEND_MESSAGE(_perso, "Commandes Disponibles : \n.start\n.infos\n.save\n Enclos : \n > Bonta : .enclos1 \n > Brakmar : .enclos2 \n Île de Nowel : .now\n Téléportation vers donjon :\n Bouftou : .bou \n Champ : .cha \n Ensablé : .ens \n Incarnam : .inc \n Forgeron : .for \n Scarafeuille : .sca \n Bwork : .bwo \n Blop : .blo \n Wabbit : .wab \n Rat noir : .rat ( Rat blanc non disponible ! ) \n Skeunk : .ske \n Dragoeuf : .dra \n Minotor : .min \n Canidés : .can \n Dragon cochon : .drc \n", Ancestra.CONFIG_MOTD_COLOR);
return;
}else

 

Après

 }else 

Copier coller ceci :

 

if(msg.length() > 3 && msg.substring(1, 4).equalsIgnoreCase("BOU"))
{
if(_perso.get_fight() != null)return;
_perso.teleport( Ancestra.CONFIG_BOUFTOU_MAP, Ancestra.CONFIG_BOUFTOU_CELL );
return;
}
if(msg.length() > 3 && msg.substring(1, 4).equalsIgnoreCase("CHA"))
{
if(_perso.get_fight() != null)return;
_perso.teleport( Ancestra.CONFIG_CHAMP_MAP, Ancestra.CONFIG_CHAMP_CELL );
return;
}
if(msg.length() > 3 && msg.substring(1, 4).equalsIgnoreCase("ENS"))
{
if(_perso.get_fight() != null)return;
_perso.teleport( Ancestra.CONFIG_ENSABLE_MAP, Ancestra.CONFIG_ENSABLE_CELL );
return;
}
if(msg.length() > 3 && msg.substring(1, 4).equalsIgnoreCase("INC"))
{
if(_perso.get_fight() != null)return;
_perso.teleport( Ancestra.CONFIG_INCARNAM_MAP, Ancestra.CONFIG_INCARNAM_CELL );
return;
}
if(msg.length() > 3 && msg.substring(1, 4).equalsIgnoreCase("FOR"))
{
if(_perso.get_fight() != null)return;
_perso.teleport( Ancestra.CONFIG_FORGERON_MAP, Ancestra.CONFIG_FORGERON_CELL );
return;
}
if(msg.length() > 3 && msg.substring(1, 4).equalsIgnoreCase("SCA"))
{
if(_perso.get_fight() != null)return;
_perso.teleport( Ancestra.CONFIG_SCARA_MAP, Ancestra.CONFIG_SCARA_CELL );
return;
}
if(msg.length() > 3 && msg.substring(1, 4).equalsIgnoreCase("BWO"))
{
if(_perso.get_fight() != null)return;
_perso.teleport( Ancestra.CONFIG_BWORK_MAP, Ancestra.CONFIG_BWORK_CELL );
return;
}
if(msg.length() > 3 && msg.substring(1, 4).equalsIgnoreCase("BLO"))
{
if(_perso.get_fight() != null)return;
_perso.teleport( Ancestra.CONFIG_BLOP_MAP, Ancestra.CONFIG_BLOP_CELL );
return;
}
if(msg.length() > 3 && msg.substring(1, 4).equalsIgnoreCase("WAB"))
{
if(_perso.get_fight() != null)return;
_perso.teleport( Ancestra.CONFIG_WABBIT_MAP, Ancestra.CONFIG_WABBIT_CELL );
return;
}
if(msg.length() > 3 && msg.substring(1, 4).equalsIgnoreCase("RAT"))
{
if(_perso.get_fight() != null)return;
_perso.teleport( Ancestra.CONFIG_RAT_MAP, Ancestra.CONFIG_RAT_CELL );
return;
}
if(msg.length() > 3 && msg.substring(1, 4).equalsIgnoreCase("SKE"))
{
if(_perso.get_fight() != null)return;
_perso.teleport( Ancestra.CONFIG_SKEUNK_MAP, Ancestra.CONFIG_SKEUNK_CELL );
return;
}
if(msg.length() > 3 && msg.substring(1, 4).equalsIgnoreCase("DRA"))
{
if(_perso.get_fight() != null)return;
_perso.teleport( Ancestra.CONFIG_DRAGO_MAP, Ancestra.CONFIG_DRAGO_CELL );
return;
}
if(msg.length() > 3 && msg.substring(1, 4).equalsIgnoreCase("MIN"))
{
if(_perso.get_fight() != null)return;
_perso.teleport( Ancestra.CONFIG_MINO_MAP, Ancestra.CONFIG_MINO_CELL );
return;
}
if(msg.length() > 3 && msg.substring(1, 4).equalsIgnoreCase("CAN"))
{
if(_perso.get_fight() != null)return;
_perso.teleport( Ancestra.CONFIG_CANIDE_MAP, Ancestra.CONFIG_CANIDE_CELL );
return;
}
if(msg.length() > 3 && msg.substring(1, 4).equalsIgnoreCase("DRC"))
{
if(_perso.get_fight() != null)return;
_perso.teleport( Ancestra.CONFIG_DRAGONCOCHON_MAP, Ancestra.CONFIG_DRAGONCOCHON_CELL );
return;
}

Étape 3 :

 

Ensuite vous compiler vos sources, vous lancez votre serveur et vous testez !

 

 

 

 

 

Pour ceux qui ont un problème, envoyez moi un MP.

Bonne journée !

Link to comment
Share on other sites

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 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.