falyptus

AncestraR - Complétion du parseToGM

May 20th, 2012
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.50 KB | None | 0 0
  1. public String parseToGM()
  2. {
  3.     StringBuilder str = new StringBuilder();
  4.     if(_fight == null)// Hors combat
  5.     {
  6.         str.append(_curCell.getID()).append(";").append(_orientation).append(";");
  7.         str.append("0").append(";");//ActorId: Défini le type d'acteur e.g: player, offlinePlayer, mobs, prisme, perco, etc
  8.         str.append(_GUID).append(";").append(_name).append(";").append(_classe);
  9.         str.append((this.get_title()>0?(","+this.get_title()+";"):(";")));
  10.         str.append(_gfxID).append("^").append(_size).append(";");//gfxID^size
  11.         str.append(_sexe).append(";").append(_align).append(",");//1,0,0,4055064
  12.         str.append(_align).append(",");//FIXED FakeAlign je crois
  13.         str.append((_showWings?getGrade():"0")).append(",");
  14.         str.append(_lvl+_GUID).append(";");//FIXED ça c'est pour voir les ailes grisé/lumineuse des autres joueurs
  15.         str.append((_color1==-1?"-1":Integer.toHexString(_color1))).append(";");
  16.         str.append((_color2==-1?"-1":Integer.toHexString(_color2))).append(";");
  17.         str.append((_color3==-1?"-1":Integer.toHexString(_color3))).append(";");
  18.         str.append(getGMStuffString()).append(";");
  19.         if(Ancestra.AURA_SYSTEM)
  20.         {
  21.             str.append((_lvl>99?(_lvl>199?(2):(1)):(0))).append(";");
  22.         }else
  23.         {
  24.             str.append("0;");
  25.         }
  26.         str.append(_emoteActive).append(";");//Emote
  27.         str.append(_emoteTime).append(";");//Emote timer
  28.         if(this._guildMember!=null && this._guildMember.getGuild().getMembers().size()>9)
  29.         {
  30.                 str.append(this._guildMember.getGuild().get_name()).append(";").append(this._guildMember.getGuild().get_emblem()).append(";");
  31.         }
  32.         else str.append(";;");
  33.         str.append(get_Speed()).append(";");//TODO: Make Restriction
  34.         str.append((_onMount&&_mount!=null?_mount.get_color():"")).append(";");
  35.         str.append(";");
  36.     }
  37.     return str.toString();
  38. }
  39.    
  40. //On crée deux champs:
  41. private int _emoteTime = 360000;
  42. private Timer emoteTimer = new Timer(1000, null);
  43.    
  44. //Remplacer set_emoteActive ou setEmoteActive (enfin je sais pas moi je lai renommé en setEmoteActive()...) par:
  45. public void setEmoteActive(int emoteActive)
  46. {
  47.     this._emoteActive = emoteActive;
  48.     if(emoteTimer.isRunning())
  49.     {
  50.         _emoteTime = 360000;
  51.         emoteTimer.restart();
  52.     } else
  53.     {
  54.         emoteTimer.addActionListener(new ActionListener()
  55.         {
  56.             @Override
  57.                 public void actionPerformed(ActionEvent arg0) {
  58.                 if(_emoteTime > 0) {
  59.                     _emoteTime = _emoteTime - 1000;
  60.                 }
  61.                 if(_emoteTime <= 0) {
  62.                     _emoteTime = 360000;
  63.                     _emoteActive = 0;
  64.                     emoteTimer.stop();
  65.                 }
  66.                 }
  67.         });
  68.         emoteTimer.start();
  69.     }
  70. }
Advertisement
Add Comment
Please, Sign In to add comment