Ir para conteúdo
  • Cadastre-se

L2jMega Pré-Configurado


MeGaPacKl

Posts recomendados

2 minutos atrás, PeNaChO disse:

Na realidade, você não terá report's de bugs reais, praticamente nenhum, no pack do Marcos Sayan (project x) que foi um dos mais usados aqui na jbr, quem foi testando e "corrigindo" os bugs encontrados, na grande maioria, foi eu e ele, isso que tinha bastante gente usando e se tu olhar o tópico dele, verá o que eu disse acima.

poise... e eu fui um dos que usaram a pack dele e nao reportaram nenhum bug apesar de eu ter encontrado kk infelizmente.

A source nao será postada!

Mas vou atualizando o topico, assim que eu tiver novidades e fixado bugs que eu mesmo encontrar, mesmo sem ninguem ajudar, vai ficar ai de graça pra quem quiser usar.

Se por acaso eu parar de mexer nessa pack, eu vou postar a source no topico!!!

1xFoI0n.jpg.5e0903bc1b582f95590d4a4c1fce368a.jpg

Link para o comentário
Compartilhar em outros sites


1 minuto atrás, MeGaPacKl disse:

poise... e eu fui um dos que usaram a pack dele e nao reportaram nenhum bug apesar de eu ter encontrado kk infelizmente.

A source nao será postada!

Mas vou atualizando o topico, assim que eu tiver novidades e fixado bugs que eu mesmo encontrar, mesmo sem ninguem ajudar, vai ficar ai de graça pra quem quiser usar.

Se por acaso eu parar de mexer nessa pack, eu vou postar a source no topico!!!

Por isso prefiro fazer as coisas sozinho ou com as pessoas que ja conheço.

QdeQ9Kp.png

Link para o comentário
Compartilhar em outros sites

  • 4 weeks later...
3 horas atrás, MeGaPacKl disse:

coloquei perto do link da source o motivo é que to querendo dinheiro urgente e vou vender meu pc.

É a coisa não ta fácil pra ninguém, anuncia teu pc aqui no fórum, quem sabe alguém compra.

Creio que não seja contra as regras, pois já vi alguns tópicos de venda de computadores na área de:

Tecnologia & PC

Exemplo do anúncio ao qual ninguém se opôs:

VENDA

Boa sorte!

QdeQ9Kp.png

Link para o comentário
Compartilhar em outros sites

4 horas atrás, MeGaPacKl disse:

coloquei perto do link da source o motivo é que to querendo dinheiro urgente e vou vender meu pc.

Poderia me falar como funciona essa proteção da JGuard ? ela ta ativa ou precisa entrar em contato com eles para renovar a "key" ?

j58fx5.gif

Link para o comentário
Compartilhar em outros sites

1 hora atrás, ~Danilo Nascimento~ disse:

Poderia me falar como funciona essa proteção da JGuard ? ela ta ativa ou precisa entrar em contato com eles para renovar a "key" ?

Isso ai é so o sistema hwid!

Nao ta com aquela proteçao que aparece o splash.

 

1xFoI0n.jpg.5e0903bc1b582f95590d4a4c1fce368a.jpg

Link para o comentário
Compartilhar em outros sites

35 minutos atrás, MeGaPacKl disse:

Isso ai é so o sistema hwid!

Nao ta com aquela proteçao que aparece o splash.

 

Não entendi?! Essa proteção funciona contra bot/hack certo? Quero saber caso eu remova ela se irá funcionar normal em outra pack ? 

j58fx5.gif

Link para o comentário
Compartilhar em outros sites

1 hora atrás, ~Danilo Nascimento~ disse:

Não entendi?! Essa proteção funciona contra bot/hack certo? Quero saber caso eu remova ela se irá funcionar normal em outra pack ? 

Apenas a parte de bloqueio de hwid está funcionando, o restante não.

Aparece L2JGuard na imagem de carregamento, mas não tem a proteção.

 

Editado por Escanor
Link para o comentário
Compartilhar em outros sites

Config.java

 

public boolean estático ADMIN_READ_ITEM_ID;

        ////////////////////////////////////////////////// /////////////
        ADMIN_READ_ITEM_ID = Boolean.valueOf (players.getProperty ("AdminClickInfoItem", "true"));
        ////////////////////////////////////////////////// /////////////

paquete net.sf.l2j.gameserver.network.clientpackets.UseItem.java

+        
+ if (Config.ADMIN_READ_ITEM_ID && activeChar.isGM ())
+ activeChar.sendPacket (nuevo CreatureSay (0, Say2.PARTY, "[Información del artículo]", "ID del artículo:" + item.getItemId () + "| Name : "+ item.getItemName ()));
+        
        if (activeChar.isFishing () && item.getItem (). getDefaultAction ()! = ActionType.fishingshot)
      

 

X.properties

# Opción habilitable que al hacer doble clic en el administrador lee la información del artículo

AdminClickInfoItem = True

 

release the source, free willy ?

Editado por osvaldotl2015
I miss something
Link para o comentário
Compartilhar em outros sites

galera venho deixar pra vcs um codigo que ganhei, porem não funcionou cmg como deveria, se funcionar com alguem da uma luz ai

segundo o carinha que me passo é o mesmo mod do video

package l2f.gameserver.model.Phantoms;


import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.io.LineNumberReader;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentLinkedQueue;

import javolution.text.TextBuilder;
import javolution.util.FastList;
import javolution.util.FastMap;

import org.apache.log4j.Logger;

import l2f.commons.util.Rnd;
import l2f.gameserver.model.actor.instances.player.ShortCut;
import l2f.gameserver.model.base.InvisibleType;
import l2f.gameserver.model.base.Race;
import l2f.gameserver.Config;
import l2f.gameserver.ThreadPoolManager;
import l2f.gameserver.database.DatabaseFactory;
import l2f.gameserver.ai.CtrlIntention;
import l2f.gameserver.ai.PlayableAI.nextAction;
import l2f.gameserver.skills.AbnormalEffect;
import l2f.gameserver.skills.effects.EffectTemplate;
import l2f.gameserver.stats.Env;
import l2f.gameserver.tables.ClanTable;
import l2f.gameserver.tables.SkillTable;
import l2f.gameserver.geodata.GeoEngine;
import l2f.gameserver.model.instances.NpcInstance;
import l2f.gameserver.model.items.ItemInstance;
import l2f.gameserver.utils.ItemFunctions;
import l2f.gameserver.model.Effect;
import l2f.gameserver.model.GameObject;
import l2f.gameserver.model.GameObjectsStorage;
import l2f.gameserver.model.Skill;
import l2f.gameserver.model.World;
import l2f.gameserver.utils.Location;
import l2f.gameserver.model.Player;
import l2f.gameserver.network.serverpackets.MagicSkillUse;
import l2f.gameserver.network.serverpackets.Say2;
import l2f.gameserver.network.serverpackets.components.ChatType;
import l2f.gameserver.templates.PlayerTemplate;
import l2f.gameserver.templates.item.CreateItem;
import l2f.gameserver.templates.item.ItemTemplate;

public class PhantomPlayers
{
   private static final Logger _log= Logger.getLogger(PhantomPlayers.class.getName());
   private static String _phantomAcc = Config.PHANTOM_PLAYERS_AKK;
   private static int _PhantomsLimit = 0;
   private static int _setsCount = 0;
   private static int _setsCountClan = 0;
   private volatile int _PhantomsTownTotal = 0;
   private static int _nameColCount = 0;
   private static int _titleColCount = 0;
   private static FastList<Integer> _nameColors = new FastList<Integer>();
   private static FastList<Integer> _titleColors = new FastList<Integer>();
   private static FastList<L2Set> _sets = new FastList<L2Set>();
   private static int _setsArcherCount = 0;
   private static FastList<L2Set> _setsArcher = new FastList<L2Set>();
   private static PhantomPlayers _instance;
   private static int _setsOlyCount = 0;
   private static FastList<L2Set> _setsOly = new FastList<L2Set>();
   private static int _locsCount = 0;
   private static FastList<Location> _PhantomsTownLoc = new FastList<Location>();
   private static FastMap<Integer, L2Fantome> _phantoms = new FastMap<Integer, L2Fantome>();
   private static int _PhantomssayPhantomsCount = 0;
   private static FastList<String> _PhantomssayPhantoms = new FastList<String>();
   private static int _PhantomsdeadtalkCount = 0;
   private static FastList<String> _Phantomsdeadtalk = new FastList<String>();
   private static Map<Integer, ConcurrentLinkedQueue<Player>> _PhantomsTown = new ConcurrentHashMap<Integer, ConcurrentLinkedQueue<Player>>();
   private static Map<Integer, ConcurrentLinkedQueue<Player>> _PhantomsTownClan = new ConcurrentHashMap<Integer, ConcurrentLinkedQueue<Player>>();
   private static Map<Integer, ConcurrentLinkedQueue<Integer>> _PhantomsTownClanList = new ConcurrentHashMap<Integer, ConcurrentLinkedQueue<Integer>>();
   
   private static int buffs[][] = { // id, lvl, group
      { 306, 1, 2 },
      { 308, 1, 2 },
      { 307, 1, 2 },
      { 309, 1, 2 },
      { 266, 1, 2 },
      { 529, 1, 2 },
      { 530, 1, 2 },
      { 1303, 2, 2 },
      { 1085, 3, 2 },
      { 1040, 3, 2 },
      { 1062, 2, 2 },
      { 4703, 3, 2 },
      { 1389, 3, 2 },
      { 1461, 1, 2 },
      { 1413, 1, 2 },
      { 1191, 3, 2 },
      { 1182, 3, 2 },
      { 1189, 3, 2 },
      { 1392, 3, 2 },
      { 1035, 4, 2 },
      { 1259, 4, 2 },
      { 1460, 1, 2 },
      { 1044, 3, 2 },
      { 1078, 6, 2 },
      { 1259, 4, 2 },
      { 264, 1, 2 },
      { 265, 1, 2 },
      { 267, 1, 2 },
      { 268, 1, 2 },
      { 304, 1, 2 },
      { 349, 1, 2 },
      { 363, 1, 2 },
      { 273, 1, 2 },
      { 276, 1, 2 },
      { 365, 1, 2 },
      { 270, 1, 2 },
      { 830, 1, 2 },
      { 1500, 1, 2 },
      { 1503, 1, 2 },
      { 1501, 1, 2 },
      { 1504, 1, 2 },
      { 1323, 1, 1 },
      { 1240, 3, 1 },
      { 1501, 1, 1 },
      { 1036, 2, 1 },
      { 1062, 2, 1 },
      { 4699, 3, 1 },
      { 1388, 3, 1 },
      { 1461, 1, 1 },
      { 1191, 3, 1 },
      { 1182, 3, 1 },
      { 1189, 3, 1 },
      { 1392, 3, 1 },
      { 1352, 1, 1 },
      { 1035, 4, 1 },
      { 264, 1, 1 },
      { 265, 1, 1 },
      { 267, 1, 1 },
      { 268, 1, 1 },
      { 269, 1, 1 },
      { 304, 1, 1 },
      { 349, 1, 1 },
      { 363, 1, 1 },
      { 364, 1, 1 },
      { 271, 1, 1 },
      { 274, 1, 1 },
      { 275, 1, 1 },
      { 270, 1, 1 },
      { 269, 1, 1 },
      { 306, 1, 1 },
      { 308, 1, 1 },
      { 272, 1, 1 },
      { 307, 1, 1 },
      { 309, 1, 1 },
      { 310, 1, 1 },
      { 266, 1, 1 },
      { 529, 1, 1 },
      { 530, 1, 1 },
      { 1502, 1, 1 },
      { 1503, 1, 1 },
      { 1517, 1, 1 },
      { 1259, 4, 1 },
      { 1519, 1, 1 },
      { 1323, 1, 1 },
      { 1363, 1, 1 }, // Chant of Victory
      { 1504, 1, 1 }
      };

   public static PhantomPlayers getInstance()
   {
      return _instance;
   }

   public static void init()
   {
      _instance = new PhantomPlayers();
      _instance.load();
   }

   private void load()
   {
      parceArmors();
      parceArcherArmors();
      parceOlyArmors();
      parceColors();
      cachedeadtalk();
      if(Config.ALLOW_PHANTOM_PLAYERS)
      {
         parceTownLocs();
         parceTownClans();
         //parceTownRecs();
         cacheFantoms();
         cachesayPhantoms();
         _PhantomsLimit = Config.PHANTOM_PLAYERS_COUNT_FIRST + Config.PHANTOM_PLAYERS_COUNT_NEXT + 10;
         _PhantomsTown.put(1, new ConcurrentLinkedQueue<Player>());
         _PhantomsTown.put(2, new ConcurrentLinkedQueue<Player>());
      }
   }

   private void cacheFantoms()
   {
      new Thread(new Runnable()
    {
      @SuppressWarnings("unused")
      public void run()
      {
         String name = "";
         String new_name = "";
         Connection con = null;
         Player fantom = null;
         try
         {
            con = DatabaseFactory.getInstance().getConnection();
            con.setTransactionIsolation(1);
            PreparedStatement st = con.prepareStatement("SELECT obj_Id,char_name,title,x,y,z,clanid FROM characters WHERE account_name = ?");
            st.setString(1, _phantomAcc);
            ResultSet rs = st.executeQuery();
            rs.setFetchSize(250);
            while(rs.next())
            {
               name = rs.getString("char_name");
               _phantoms.put(Integer.valueOf(rs.getInt("obj_Id")), new L2Fantome(name, rs.getString("title"), rs.getInt("x"), rs.getInt("y"), rs.getInt("z"), rs.getInt("clanid")));
            }
            st.close();
            rs.close();
            con.close();
            _log.info("PhantomPlayers: Cached " + _phantoms.size() + " players.");
         }
         catch (Exception e)
         {
            _log.warn("PhantomPlayers: could not load chars from DB: " + e);
         }
         finally
         {
            if(con != null)
               con = null;
         }
         if (!_phantoms.isEmpty())
         {
            ThreadPoolManager.getInstance().schedule(new FantomTask(1), Config.PHANTOM_PLAYERS_DELAY_FIRST * 1000);
         }
      }
      }).start();
   }

   private void parceArmors()
   {
      if (!_sets.isEmpty())
         _sets.clear();

      LineNumberReader lnr = null;
      BufferedReader br = null;
      FileReader fr = null;
      try
      {
         File Data = new File("./config/mod/Phantom/town_sets.properties");
         if (!Data.exists())
            return;
         fr = new FileReader(Data);
         br = new BufferedReader(fr);
         lnr = new LineNumberReader(br);
         String line;
         while ((line = lnr.readLine()) != null)
         {
            if(line.trim().length() == 0 || line.startsWith("#"))
               continue;
            String[] items = line.split(",");
            int custom = 0;
            try
            {
               custom = Integer.parseInt(items[6]);
            }
            catch (Exception e)
            {
               custom = 0;
            }
            _sets.add(new L2Set(Integer.parseInt(items[0]), Integer.parseInt(items[1]), Integer.parseInt(items[2]), Integer.parseInt(items[3]), Integer.parseInt(items[4]), Integer.parseInt(items[5]), Integer.parseInt(items[6]), Integer.parseInt(items[7]),  custom));
         }
         _setsCount = _sets.size() - 1;
         _log.info("Load " + _setsCount + " phantom armor sets");
      }
      catch(Exception e)
      {
         e.printStackTrace();
      }
      finally
      {
         try
         {
            if (fr != null)
               fr.close();
            if (br != null)
               br.close();
            if (lnr != null)
               lnr.close();
         }
         catch(Exception e)
         {
         }
      }
   }

   private void parceArcherArmors()
   {
      if (!_setsArcher.isEmpty())
         _setsArcher.clear();

      LineNumberReader lnr = null;
      BufferedReader br = null;
      FileReader fr = null;
      try
      {
         File Data = new File("./config/mod/Phantom/archer_sets.properties");
         if (!Data.exists())
            return;
         fr = new FileReader(Data);
         br = new BufferedReader(fr);
         lnr = new LineNumberReader(br);
         String line;
         while ((line = lnr.readLine()) != null)
         {
            if(line.trim().length() == 0 || line.startsWith("#"))
               continue;
            String[] items = line.split(",");
            int custom = 0;
            try
            {
               custom = Integer.parseInt(items[5]);
            }
            catch (Exception e)
            {
               custom = 0;
            }
            _setsArcher.add(new L2Set(Integer.parseInt(items[0]), Integer.parseInt(items[1]), Integer.parseInt(items[2]), Integer.parseInt(items[3]), Integer.parseInt(items[4]), Integer.parseInt(items[5]), Integer.parseInt(items[6]), Integer.parseInt(items[7]), custom));
         }
         _setsArcherCount = _setsArcher.size() - 1;
         _log.info("Load " + _setsArcherCount + " Aecher phantom armor sets");
      }
      catch(IOException | NumberFormatException e)
      {
      }
      finally
      {
         try
         {
            if (fr != null)
               fr.close();
            if (br != null)
               br.close();
            if (lnr != null)
               lnr.close();
         }
         catch(Exception e)
         {
         }
      }
   }

   private void parceOlyArmors()
   {
      if (!_setsOly.isEmpty())
         _setsOly.clear();

      LineNumberReader lnr = null;
      BufferedReader br = null;
      FileReader fr = null;
      try
      {
         File Data = new File("./config/mod/Phantom/oly_sets.properties");
         if (!Data.exists())
            return;
         fr = new FileReader(Data);
         br = new BufferedReader(fr);
         lnr = new LineNumberReader(br);
         String line;
         while ((line = lnr.readLine()) != null)
         {
            if(line.trim().length() == 0 || line.startsWith("#"))
               continue;
            String[] items = line.split(",");
            int custom = 0;
            try
            {
               custom = Integer.parseInt(items[6]);
            }
            catch (Exception e)
            {
               custom = 0;
            }
            _setsOly.add(new L2Set(Integer.parseInt(items[0]), Integer.parseInt(items[1]), Integer.parseInt(items[2]), Integer.parseInt(items[3]), Integer.parseInt(items[4]), Integer.parseInt(items[5]), Integer.parseInt(items[6]), Integer.parseInt(items[7]), custom));
         }
         _setsOlyCount = _setsOly.size() - 1;
         _log.info("Load " + _setsOlyCount + " phantom Only armor sets");
      }
      catch(Exception e)
      {
         e.printStackTrace();
      }
      finally
      {
         try
         {
            if (fr != null)
               fr.close();
            if (br != null)
               br.close();
            if (lnr != null)
               lnr.close();
         }
         catch(Exception e)
         {
         }
      }
   }

   @SuppressWarnings({ "unchecked", "rawtypes" })
   private void parceTownClans()
   {
      LineNumberReader lnr = null;
      BufferedReader br = null;
      FileReader fr = null;
      try
      {
         File Data = new File("./config/mod/Phantom/town_clans.properties");
            if (!Data.exists())
               return;
         fr = new FileReader(Data);
         br = new BufferedReader(fr);
         lnr = new LineNumberReader(br);
         int clanId = 0;
         String line;
         while((line = lnr.readLine()) != null)
         {
            if (line.trim().length() == 0 || line.startsWith("#"))
               continue;
            String[] items = line.split(":");
            clanId = Integer.parseInt(items[0]);
            String[] pls = items[1].split(",");
            ConcurrentLinkedQueue players = new ConcurrentLinkedQueue();
            for (String plid : pls)
               players.add(Integer.valueOf(Integer.parseInt(plid)));
            _PhantomsTownClanList.put(Integer.valueOf(clanId), players);
         }
         _setsCountClan = _PhantomsTownClanList.size() - 1;
         _log.info("Load " + _setsCountClan + " phantom Clans");
      }
      catch (Exception e)
      {
         e.printStackTrace();
      }
      finally
      {
         try
         {
            if (fr != null)
               fr.close();
            if (br != null)
               br.close();
            if (lnr != null)
               lnr.close();
         }
         catch (Exception e1)
         {
         }
      }
   }

   private void parceTownLocs()
   {
      _PhantomsTownLoc.clear();
      LineNumberReader lnr = null;
      BufferedReader br = null;
      FileReader fr = null;
      try
      {
         File Data = new File("./config/mod/Phantom/town_locs.properties");
         if (!Data.exists())
            return;
         fr = new FileReader(Data);
         br = new BufferedReader(fr);
         lnr = new LineNumberReader(br);
         String line;
         while ((line = lnr.readLine()) != null)
         {
            if (line.trim().length() == 0 || line.startsWith("#"))
               continue;
            String[] items = line.split(",");
            _PhantomsTownLoc.add(new Location(Integer.parseInt(items[0]), Integer.parseInt(items[1]), Integer.parseInt(items[2])));
         }
         _locsCount = _PhantomsTownLoc.size() - 1;
         _log.info("Load " + _locsCount + " phantom Town Locations");
      }
      catch (Exception e)
      {
         e.printStackTrace();
      }
      finally
      {
         try
         {
            if (fr != null)
               fr.close();
            if (br != null)
               br.close();
            if (lnr != null)
               lnr.close();
         }
         catch (Exception e1)
         {
         }
      }
   }

   public void startWalk(Player phantom)
   {
      ThreadPoolManager.getInstance().schedule(new PhantomWalk(phantom), 10000);
   }

   private class PhantomWalk implements Runnable
   {
      Player _phantom;
      public PhantomWalk(Player phantom)
      {
         _phantom = phantom;
      }

      public void run()
      {
         if (_phantom.isDead())
         {    if (Config.ALLOW_PHANTOM_CHAT)
            {
            if(Rnd.get(100) < 90)
            {   
            switch (Rnd.get(1, 5))
            {
            case 1:
               Say2 cs = new Say2(_phantom.getObjectId(), ChatType.SHOUT, _phantom.getName(), getRandomdeadtalk());
               for(Player player : World.getAroundPlayers(_phantom, 10000, 3000))
                  if(player != null)
                     if(!player.isBlockAll())
                        player.sendPacket(cs);
               _phantom.kick();
               break;
            case 2:
               _phantom.kick();
               break;
            case 3:
               Say2 cs3 = new Say2(_phantom.getObjectId(), ChatType.ALL, _phantom.getName(), getRandomdeadtalk());
               for(Player player : World.getAroundPlayers(_phantom, 1200, 1000))
                  if(player != null)
                     if(!player.isBlockAll())
                        player.sendPacket(cs3);
               _phantom.kick();
               break;
            }
            }
            }
         }
            
         if (_phantom.isInWater())
            _phantom.teleToClosestTown();
         if(Rnd.get(100) < 10)
            if(Rnd.get(100) < 20)
               if (_phantom.isSitting())
                  _phantom.standUp();
         // баф фантомов
         Skill skill;
         if(Rnd.get(100) < 50)
         {
            // баф воинов
            if (!_phantom.getClassId().isMage() || _phantom.getClassId().getRace() == Race.orc)
            {
            for(int buff[] : buffs)
               if(buff[2] == 1)
               {
                     skill = SkillTable.getInstance().getInfo(buff[0], buff[1]);
                     for(EffectTemplate et : skill.getEffectTemplates())
                     {
                        Env env = new Env(_phantom, _phantom, skill);
                        Effect effect = et.getEffect(env);
                        effect.setPeriod(36000);
                        _phantom.getEffectList().addEffect(effect);
                     }
               }
            }
            //баф магов
            if (_phantom.getClassId().isMage() && _phantom.getClassId().getRace() != Race.orc)
            {
               for(int buff[] : buffs)
                  if(buff[2] == 2)
                  {
                        skill = SkillTable.getInstance().getInfo(buff[0], buff[1]);
                        for(EffectTemplate et : skill.getEffectTemplates())
                        {
                           Env env = new Env(_phantom, _phantom, skill);
                           Effect effect = et.getEffect(env);
                           effect.setPeriod(36000);
                           _phantom.getEffectList().addEffect(effect);
                        }
                  }
               
            }
            
         }
         
            
            
            /*
            for(NpcInstance npc : World.getAroundNpc(_phantom, 100, 100))
               for(int buffers_id : _buffers)
               if(npc.getNpcId() == buffers_id && !_phantom.isSitting())
               {
                  if (!_phantom.getClassId().isMage() || _phantom.getClassId().getRace() == Race.orc)
                     for(int[] buff : _warrBuff)
                        npc.broadcastPacket(new MagicSkillUse(npc, _phantom, buff[2], buff[3], 0, 0));
                  if (_phantom.getClassId().isMage() && _phantom.getClassId().getRace() != Race.orc)
                     for(int[] buff : _mageBuff)
                        npc.broadcastPacket(new MagicSkillUse(npc, _phantom, buff[2], buff[3], 0, 0));               
               }*/

         // писдеж в чат
         if (Config.ALLOW_PHANTOM_CHAT)
         {
            if(Rnd.get(100) < Config.PHANTOM_CHAT_CHANSE)
            {   
               switch (Rnd.get(1, 3))
               {
               case 1:
                  Say2 cs = new Say2(_phantom.getObjectId(), ChatType.SHOUT, _phantom.getName(), getRandomSayPhantoms());
                  for(Player player : World.getAroundPlayers(_phantom, 10000, 3000))
                     if(player != null)
                        if(!player.isBlockAll())
                           player.sendPacket(cs);
                  break;
               case 2:
                  Say2 cs2 = new Say2(_phantom.getObjectId(), ChatType.TRADE, _phantom.getName(), getRandomSayPhantoms());
                  for(Player player : World.getAroundPlayers(_phantom, 5000, 2000))
                     if(player != null)
                        if(!player.isBlockAll())
                           player.sendPacket(cs2);
                  break;
               case 3:
                  Say2 cs3 = new Say2(_phantom.getObjectId(), ChatType.ALL, _phantom.getName(), getRandomSayPhantoms());
                  for(Player player : World.getAroundPlayers(_phantom, 1200, 1000))
                     if(player != null)
                        if(!player.isBlockAll())
                           player.sendPacket(cs3);
                  break;
               }
            }
         }
         // использование анимации сосок Ы грейда
         if(Rnd.get(100) < 10)
         {
            if (!_phantom.getClassId().isMage() || _phantom.getClassId().getRace() == Race.orc)
               _phantom.broadcastPacket(new MagicSkillUse(_phantom, _phantom, 2154, 1, 0, 0));
            if (_phantom.getClassId().isMage() && _phantom.getClassId().getRace() != Race.orc)
               _phantom.broadcastPacket(new MagicSkillUse(_phantom, _phantom, 2159, 1, 0, 0));
         }
         
         // примитивная атака скилами
         if(Rnd.get(100) < 70)
         {
            if (!_phantom.getClassId().isMage() || _phantom.getClassId().getRace() == Race.orc)
               for(Player player : World.getAroundPlayers(_phantom, 100, 100))
                  if (GeoEngine.canSeeTarget(_phantom, player, false) && !player.isDead() && !player.isInZonePeace() && !_phantom.isInZonePeace() && (player.getKarma() != 0 || player.getPvpFlag() > 0))
                  {
                     if(_phantom.getRealDistance3D(player) <= _phantom.getPhysicalAttackRange() + 40)
                     {
                        _phantom.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, player);
                        try {
                           Thread.sleep(500L);
                        } catch (InterruptedException e) {
                           // TODO Auto-generated catch block
                           e.printStackTrace();
                        }
                        if (_phantom.getClassId().getRace() == Race.human)
                           _phantom.doCast(SkillTable.getInstance().getInfo(3, 2), player, true);
                        if (_phantom.getClassId().getRace() == Race.elf)
                           _phantom.doCast(SkillTable.getInstance().getInfo(3, 2), player, true);
                        if (_phantom.getClassId().getRace() == Race.darkelf)
                           _phantom.doCast(SkillTable.getInstance().getInfo(3, 2), player, true);
                        if (_phantom.getClassId().getRace() == Race.orc)
                           _phantom.doCast(SkillTable.getInstance().getInfo(29, 2), player, true);
                        if (_phantom.getClassId().getRace() == Race.dwarf)
                           _phantom.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, player);
                        if (_phantom.getClassId().getRace() == Race.kamael)
                           _phantom.doCast(SkillTable.getInstance().getInfo(468, 2), player, true);
                        try {
                           Thread.sleep(2000L);
                        } catch (InterruptedException e)
                        {
                           e.printStackTrace();
                        }
                        _phantom.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, player);
                     }
                     else
                        try {
                           Thread.sleep(500L);
                        } catch (InterruptedException e)
                         {
                           e.printStackTrace();
                        }
                        _phantom.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, player);
                  }
            if (_phantom.getClassId().isMage() && _phantom.getClassId().getRace() != Race.orc)
               for(Player player : World.getAroundPlayers(_phantom, 100, 100))
                  if (GeoEngine.canSeeTarget(_phantom, player, false) && !player.isDead() && !player.isInZonePeace() && !_phantom.isInZonePeace() && (player.getKarma() != 0 || player.getPvpFlag() > 0))
                  {
                     _phantom.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, player);
                     _phantom.doCast(SkillTable.getInstance().getInfo(1177, 2), player, true);
                  }
         }
         // атака мобов ?? Оо=)
         if(Rnd.get(100) < 40)
         {
            if (!_phantom.getClassId().isMage() || _phantom.getClassId().getRace() == Race.orc)
               for(NpcInstance npc : World.getAroundNpc(_phantom, 800, 200))
                  if (GeoEngine.canSeeTarget(_phantom, npc, false) && npc.isMonster() && !npc.isDead())
                     _phantom.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, npc);
                        _phantom.broadcastPacket(new MagicSkillUse(_phantom, _phantom, 2154, 1, 0, 0));
            if (_phantom.getClassId().isMage() && _phantom.getClassId().getRace() != Race.orc)
               for(NpcInstance npc : World.getAroundNpc(_phantom, 800, 200))
                  if (GeoEngine.canSeeTarget(_phantom, npc, false) && npc.isMonster() && !npc.isDead())
                  {
                     _phantom.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, npc);
                     _phantom.broadcastPacket(new MagicSkillUse(_phantom, _phantom, 2159, 1, 0, 0));
                     _phantom.doCast(SkillTable.getInstance().getInfo(1177, 2), npc, true);
                  }
         }
         
         // атака игроков??
         if(Rnd.get(100) < 10)
         {
            if (!_phantom.getClassId().isMage() || _phantom.getClassId().getRace() == Race.orc)
               for(Player player : World.getAroundPlayers(_phantom, 600, 200))
                  if (GeoEngine.canSeeTarget(_phantom, player, false) && !player.isDead() && !player.isInZonePeace() && !_phantom.isInZonePeace())
                     _phantom.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, player);
            
            if (_phantom.getClassId().isMage() && _phantom.getClassId().getRace() != Race.orc)
               for(Player player : World.getAroundPlayers(_phantom, 600, 200))
                  if (GeoEngine.canSeeTarget(_phantom, player, false) && !player.isDead() && !player.isInZonePeace() && !_phantom.isInZonePeace())
                  {
                     _phantom.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, player);
                     _phantom.doCast(SkillTable.getInstance().getInfo(1177, 2), player, true);
                  }
         }
         
         // подбор предметов
         if(Rnd.get(100) < 10)
            if(_phantom.getAI().getIntention() != CtrlIntention.AI_INTENTION_ATTACK || _phantom.getAI().getIntention() != CtrlIntention.AI_INTENTION_CAST)
               for(GameObject obj : World.getAroundObjects(_phantom, 800, 200))
                  if (obj.isItem())
                  _phantom.getAI().setIntention(CtrlIntention.AI_INTENTION_PICK_UP, obj);
         
         // движение
         if(Rnd.get(1000) < 1)
         {
            if(_phantom.getAI().getIntention() != CtrlIntention.AI_INTENTION_ATTACK || _phantom.getAI().getIntention() != CtrlIntention.AI_INTENTION_CAST)
               _phantom.rndWalk();   
         }
         startWalk(_phantom);
      }
   }

   // кеш фраз фантомов
   private void cachesayPhantoms()
   {
      _PhantomssayPhantoms.clear();
      LineNumberReader lnr = null;
      BufferedReader br = null;
      FileReader fr = null;
      try
      {
         File Data = new File("./config/mod/Phantom/sayPhantoms.talk");
         if (!Data.exists())
            return;
         fr = new FileReader(Data);
         br = new BufferedReader(fr);
         lnr = new LineNumberReader(br);
         String line;
         while ((line = lnr.readLine()) != null)
         {
            if (line.trim().length() == 0 || line.startsWith("#"))
               continue;
            _PhantomssayPhantoms.add(line);
         }
         _PhantomssayPhantomsCount = _PhantomssayPhantoms.size() - 1;
         _log.info("Load " + _PhantomssayPhantomsCount + " phantom say");
      }
      catch (Exception e)
      {
         e.printStackTrace();
      }
      finally
      {
         try
         {
            if (fr != null)
               fr.close();
            if (br != null)
               br.close();
            if (lnr != null)
               lnr.close();
         }
         catch (Exception e1)
         {
         }
      }
   }

   private void cachedeadtalk()
   {
      _Phantomsdeadtalk.clear();
      LineNumberReader lnr = null;
      BufferedReader br = null;
      FileReader fr = null;
      try
      {
         File Data = new File("./config/mod/Phantom/dead.talk");
         if (!Data.exists())
            return;
         fr = new FileReader(Data);
         br = new BufferedReader(fr);
         lnr = new LineNumberReader(br);
         String line;
         while ((line = lnr.readLine()) != null)
         {
            if (line.trim().length() == 0 || line.startsWith("#"))
               continue;
            _Phantomsdeadtalk.add(line);
         }
         _PhantomsdeadtalkCount = _Phantomsdeadtalk.size() - 1;
         _log.info("Load " + _PhantomsdeadtalkCount + " phantom Last");
      }
      catch (Exception e)
      {
         e.printStackTrace();
      }
      finally
      {
         try
         {
            if (fr != null)
               fr.close();
            if (br != null)
               br.close();
            if (lnr != null)
               lnr.close();
         }
         catch (Exception e1)
         {
         }
      }
   }

   private void parceColors()
   {
      _nameColors = Config.PHANTOM_PLAYERS_NAME_CLOLORS;
      _titleColors = Config.PHANTOM_PLAYERS_TITLE_CLOLORS;
      _nameColCount = _nameColors.size() - 1;
      _titleColCount = _titleColors.size() - 1;
   }

   private L2Set getRandomSet()
   {
      return _sets.get(Rnd.get(_setsCount));
   }

   @SuppressWarnings("unused")
   private L2Set getRandomArcherSet()
   {
      return _setsArcher.get(Rnd.get(_setsArcherCount));
   }

   @SuppressWarnings("unused")
   private int getRandomPhantom()
   {
      return Rnd.get(600000000, 600006081);
   }

   private int getRandomPhantomNext()
   {
      int obj = 0;
      for (int i = 6; i > 0; i--)
      {
         obj = Rnd.get(600000000, 600006081);
         if (!_PhantomsTown.get(1).contains(obj) && !_PhantomsTown.get(2).contains(obj))
            return obj;
      }
      return getRandomPhantomNext();
   }
   @SuppressWarnings("unused")
   private int getRandomClan()
   {
      return Rnd.get(600000000, 600006081);
   }

   private Location getRandomLoc()
   {
      Location loc = null;
      if(loc == null)
         loc = _PhantomsTownLoc.get(Rnd.get(0, _locsCount));
      return loc;
   }

   static class L2Set
   {
      public int _body;
      public int _gaiters;
      public int _gloves;
      public int _boots;
      public int _weapon;
      public int _custom;
      public int _shield;
      public int _cloak;
      public int _grade;
      L2Set(int bod, int gaiter, int glove, int boot, int weapon, int shield, int cloak, int grade, int custom)
      {
         _body = bod;
         _gaiters = gaiter;
         _gloves = glove;
         _boots = boot;
         _weapon = weapon;
         _shield = shield;
         _cloak = cloak;
         _grade = grade;
         _custom = custom;
      }
   }

   static class L2Fantome
   {
      public String name;
      public String title;
      public int x;
      public int y;
      public int z;
      public int clanId;
      L2Fantome(String name, String title, int x, int y, int z, int clanId)
      {
         this.name = name;
         this.title = title;
         this.x = x;
         this.y = y;
         this.z = z;
         this.clanId = clanId;
      }
   }

   public class FantomTask implements Runnable
   {
      public int _task;
      public FantomTask(int task)
      {
         _task = task;
      }
      public void run()
      {
         int count = 0;
         int count2 = 0;
         int PhantomObjId = 0;
         int PhantomObjId2 = 0;
         switch (_task)
         {
            case 1:
            {
               _log.info("PhantomPlayers: 1st wave, spawn started.");
               while(count < Config.PHANTOM_PLAYERS_COUNT_FIRST)
               {
                  Player fantom = null;
                  PhantomObjId = getRandomPhantomNext();
                  if(!(_PhantomsTown.get(1).contains(PhantomObjId)))
                  {
                     fantom = loadPhantom(PhantomObjId);
                     if(fantom == null)
                        continue;
                     _PhantomsTown.get(1).add(fantom);
                     if(Config.PHANTOM_PLAYERS_SOULSHOT_ANIM && Rnd.get(100) < 45)
                     {
                        try
                        {
                           Thread.sleep(900);
                        }
                        catch (InterruptedException e)
                        {}
                        fantom.broadcastPacket(new MagicSkillUse(fantom, fantom, 2154, 1, 0, 0));
                        if (Rnd.get(100) < 5)
                           fantom.sitDown(null);
                        if (Rnd.get(100) < 30)
                           fantom.startAbnormalEffect(AbnormalEffect.S_NAVIT);
                        try
                        {
                           Thread.sleep(300);
                        }
                        catch(InterruptedException e)
                        {
                        }
                        fantom.broadcastPacket(new MagicSkillUse(fantom, fantom, 2164, 1, 0, 0));
                     }
                     try
                     {
                        Thread.sleep(Config.PHANTOM_PLAYERS_DELAY_SPAWN_FIRST);
                     }
                     catch (InterruptedException e)
                     {
                     }
                     count++;
                  }
  &nb

[/spoiler]

Editado por *-*InSaNo*-*

L2Wok <-- Novo Servidor Interlud PvP Não Fique De Fora Dessa

Link para o comentário
Compartilhar em outros sites

11 horas atrás, *-*InSaNo*-* disse:

galera venho deixar pra vcs um codigo que ganhei, porem não funcionou cmg como deveria, se funcionar com alguem da uma luz ai

segundo o carinha que me passo é o mesmo mod do video

 

  Mostrar conteúdo oculto

 

 



package l2f.gameserver.model.Phantoms;


import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.io.LineNumberReader;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentLinkedQueue;

import javolution.text.TextBuilder;
import javolution.util.FastList;
import javolution.util.FastMap;

import org.apache.log4j.Logger;

import l2f.commons.util.Rnd;
import l2f.gameserver.model.actor.instances.player.ShortCut;
import l2f.gameserver.model.base.InvisibleType;
import l2f.gameserver.model.base.Race;
import l2f.gameserver.Config;
import l2f.gameserver.ThreadPoolManager;
import l2f.gameserver.database.DatabaseFactory;
import l2f.gameserver.ai.CtrlIntention;
import l2f.gameserver.ai.PlayableAI.nextAction;
import l2f.gameserver.skills.AbnormalEffect;
import l2f.gameserver.skills.effects.EffectTemplate;
import l2f.gameserver.stats.Env;
import l2f.gameserver.tables.ClanTable;
import l2f.gameserver.tables.SkillTable;
import l2f.gameserver.geodata.GeoEngine;
import l2f.gameserver.model.instances.NpcInstance;
import l2f.gameserver.model.items.ItemInstance;
import l2f.gameserver.utils.ItemFunctions;
import l2f.gameserver.model.Effect;
import l2f.gameserver.model.GameObject;
import l2f.gameserver.model.GameObjectsStorage;
import l2f.gameserver.model.Skill;
import l2f.gameserver.model.World;
import l2f.gameserver.utils.Location;
import l2f.gameserver.model.Player;
import l2f.gameserver.network.serverpackets.MagicSkillUse;
import l2f.gameserver.network.serverpackets.Say2;
import l2f.gameserver.network.serverpackets.components.ChatType;
import l2f.gameserver.templates.PlayerTemplate;
import l2f.gameserver.templates.item.CreateItem;
import l2f.gameserver.templates.item.ItemTemplate;

public class PhantomPlayers
{
   private static final Logger _log= Logger.getLogger(PhantomPlayers.class.getName());
   private static String _phantomAcc = Config.PHANTOM_PLAYERS_AKK;
   private static int _PhantomsLimit = 0;
   private static int _setsCount = 0;
   private static int _setsCountClan = 0;
   private volatile int _PhantomsTownTotal = 0;
   private static int _nameColCount = 0;
   private static int _titleColCount = 0;
   private static FastList<Integer> _nameColors = new FastList<Integer>();
   private static FastList<Integer> _titleColors = new FastList<Integer>();
   private static FastList<L2Set> _sets = new FastList<L2Set>();
   private static int _setsArcherCount = 0;
   private static FastList<L2Set> _setsArcher = new FastList<L2Set>();
   private static PhantomPlayers _instance;
   private static int _setsOlyCount = 0;
   private static FastList<L2Set> _setsOly = new FastList<L2Set>();
   private static int _locsCount = 0;
   private static FastList<Location> _PhantomsTownLoc = new FastList<Location>();
   private static FastMap<Integer, L2Fantome> _phantoms = new FastMap<Integer, L2Fantome>();
   private static int _PhantomssayPhantomsCount = 0;
   private static FastList<String> _PhantomssayPhantoms = new FastList<String>();
   private static int _PhantomsdeadtalkCount = 0;
   private static FastList<String> _Phantomsdeadtalk = new FastList<String>();
   private static Map<Integer, ConcurrentLinkedQueue<Player>> _PhantomsTown = new ConcurrentHashMap<Integer, ConcurrentLinkedQueue<Player>>();
   private static Map<Integer, ConcurrentLinkedQueue<Player>> _PhantomsTownClan = new ConcurrentHashMap<Integer, ConcurrentLinkedQueue<Player>>();
   private static Map<Integer, ConcurrentLinkedQueue<Integer>> _PhantomsTownClanList = new ConcurrentHashMap<Integer, ConcurrentLinkedQueue<Integer>>();
   
   private static int buffs[][] = { // id, lvl, group
      { 306, 1, 2 },
      { 308, 1, 2 },
      { 307, 1, 2 },
      { 309, 1, 2 },
      { 266, 1, 2 },
      { 529, 1, 2 },
      { 530, 1, 2 },
      { 1303, 2, 2 },
      { 1085, 3, 2 },
      { 1040, 3, 2 },
      { 1062, 2, 2 },
      { 4703, 3, 2 },
      { 1389, 3, 2 },
      { 1461, 1, 2 },
      { 1413, 1, 2 },
      { 1191, 3, 2 },
      { 1182, 3, 2 },
      { 1189, 3, 2 },
      { 1392, 3, 2 },
      { 1035, 4, 2 },
      { 1259, 4, 2 },
      { 1460, 1, 2 },
      { 1044, 3, 2 },
      { 1078, 6, 2 },
      { 1259, 4, 2 },
      { 264, 1, 2 },
      { 265, 1, 2 },
      { 267, 1, 2 },
      { 268, 1, 2 },
      { 304, 1, 2 },
      { 349, 1, 2 },
      { 363, 1, 2 },
      { 273, 1, 2 },
      { 276, 1, 2 },
      { 365, 1, 2 },
      { 270, 1, 2 },
      { 830, 1, 2 },
      { 1500, 1, 2 },
      { 1503, 1, 2 },
      { 1501, 1, 2 },
      { 1504, 1, 2 },
      { 1323, 1, 1 },
      { 1240, 3, 1 },
      { 1501, 1, 1 },
      { 1036, 2, 1 },
      { 1062, 2, 1 },
      { 4699, 3, 1 },
      { 1388, 3, 1 },
      { 1461, 1, 1 },
      { 1191, 3, 1 },
      { 1182, 3, 1 },
      { 1189, 3, 1 },
      { 1392, 3, 1 },
      { 1352, 1, 1 },
      { 1035, 4, 1 },
      { 264, 1, 1 },
      { 265, 1, 1 },
      { 267, 1, 1 },
      { 268, 1, 1 },
      { 269, 1, 1 },
      { 304, 1, 1 },
      { 349, 1, 1 },
      { 363, 1, 1 },
      { 364, 1, 1 },
      { 271, 1, 1 },
      { 274, 1, 1 },
      { 275, 1, 1 },
      { 270, 1, 1 },
      { 269, 1, 1 },
      { 306, 1, 1 },
      { 308, 1, 1 },
      { 272, 1, 1 },
      { 307, 1, 1 },
      { 309, 1, 1 },
      { 310, 1, 1 },
      { 266, 1, 1 },
      { 529, 1, 1 },
      { 530, 1, 1 },
      { 1502, 1, 1 },
      { 1503, 1, 1 },
      { 1517, 1, 1 },
      { 1259, 4, 1 },
      { 1519, 1, 1 },
      { 1323, 1, 1 },
      { 1363, 1, 1 }, // Chant of Victory
      { 1504, 1, 1 }
      };

   public static PhantomPlayers getInstance()
   {
      return _instance;
   }

   public static void init()
   {
      _instance = new PhantomPlayers();
      _instance.load();
   }

   private void load()
   {
      parceArmors();
      parceArcherArmors();
      parceOlyArmors();
      parceColors();
      cachedeadtalk();
      if(Config.ALLOW_PHANTOM_PLAYERS)
      {
         parceTownLocs();
         parceTownClans();
         //parceTownRecs();
         cacheFantoms();
         cachesayPhantoms();
         _PhantomsLimit = Config.PHANTOM_PLAYERS_COUNT_FIRST + Config.PHANTOM_PLAYERS_COUNT_NEXT + 10;
         _PhantomsTown.put(1, new ConcurrentLinkedQueue<Player>());
         _PhantomsTown.put(2, new ConcurrentLinkedQueue<Player>());
      }
   }

   private void cacheFantoms()
   {
      new Thread(new Runnable()
    {
      @SuppressWarnings("unused")
      public void run()
      {
         String name = "";
         String new_name = "";
         Connection con = null;
         Player fantom = null;
         try
         {
            con = DatabaseFactory.getInstance().getConnection();
            con.setTransactionIsolation(1);
            PreparedStatement st = con.prepareStatement("SELECT obj_Id,char_name,title,x,y,z,clanid FROM characters WHERE account_name = ?");
            st.setString(1, _phantomAcc);
            ResultSet rs = st.executeQuery();
            rs.setFetchSize(250);
            while(rs.next())
            {
               name = rs.getString("char_name");
               _phantoms.put(Integer.valueOf(rs.getInt("obj_Id")), new L2Fantome(name, rs.getString("title"), rs.getInt("x"), rs.getInt("y"), rs.getInt("z"), rs.getInt("clanid")));
            }
            st.close();
            rs.close();
            con.close();
            _log.info("PhantomPlayers: Cached " + _phantoms.size() + " players.");
         }
         catch (Exception e)
         {
            _log.warn("PhantomPlayers: could not load chars from DB: " + e);
         }
         finally
         {
            if(con != null)
               con = null;
         }
         if (!_phantoms.isEmpty())
         {
            ThreadPoolManager.getInstance().schedule(new FantomTask(1), Config.PHANTOM_PLAYERS_DELAY_FIRST * 1000);
         }
      }
      }).start();
   }

   private void parceArmors()
   {
      if (!_sets.isEmpty())
         _sets.clear();

      LineNumberReader lnr = null;
      BufferedReader br = null;
      FileReader fr = null;
      try
      {
         File Data = new File("./config/mod/Phantom/town_sets.properties");
         if (!Data.exists())
            return;
         fr = new FileReader(Data);
         br = new BufferedReader(fr);
         lnr = new LineNumberReader(br);
         String line;
         while ((line = lnr.readLine()) != null)
         {
            if(line.trim().length() == 0 || line.startsWith("#"))
               continue;
            String[] items = line.split(",");
            int custom = 0;
            try
            {
               custom = Integer.parseInt(items[6]);
            }
            catch (Exception e)
            {
               custom = 0;
            }
            _sets.add(new L2Set(Integer.parseInt(items[0]), Integer.parseInt(items[1]), Integer.parseInt(items[2]), Integer.parseInt(items[3]), Integer.parseInt(items[4]), Integer.parseInt(items[5]), Integer.parseInt(items[6]), Integer.parseInt(items[7]),  custom));
         }
         _setsCount = _sets.size() - 1;
         _log.info("Load " + _setsCount + " phantom armor sets");
      }
      catch(Exception e)
      {
         e.printStackTrace();
      }
      finally
      {
         try
         {
            if (fr != null)
               fr.close();
            if (br != null)
               br.close();
            if (lnr != null)
               lnr.close();
         }
         catch(Exception e)
         {
         }
      }
   }

   private void parceArcherArmors()
   {
      if (!_setsArcher.isEmpty())
         _setsArcher.clear();

      LineNumberReader lnr = null;
      BufferedReader br = null;
      FileReader fr = null;
      try
      {
         File Data = new File("./config/mod/Phantom/archer_sets.properties");
         if (!Data.exists())
            return;
         fr = new FileReader(Data);
         br = new BufferedReader(fr);
         lnr = new LineNumberReader(br);
         String line;
         while ((line = lnr.readLine()) != null)
         {
            if(line.trim().length() == 0 || line.startsWith("#"))
               continue;
            String[] items = line.split(",");
            int custom = 0;
            try
            {
               custom = Integer.parseInt(items[5]);
            }
            catch (Exception e)
            {
               custom = 0;
            }
            _setsArcher.add(new L2Set(Integer.parseInt(items[0]), Integer.parseInt(items[1]), Integer.parseInt(items[2]), Integer.parseInt(items[3]), Integer.parseInt(items[4]), Integer.parseInt(items[5]), Integer.parseInt(items[6]), Integer.parseInt(items[7]), custom));
         }
         _setsArcherCount = _setsArcher.size() - 1;
         _log.info("Load " + _setsArcherCount + " Aecher phantom armor sets");
      }
      catch(IOException | NumberFormatException e)
      {
      }
      finally
      {
         try
         {
            if (fr != null)
               fr.close();
            if (br != null)
               br.close();
            if (lnr != null)
               lnr.close();
         }
         catch(Exception e)
         {
         }
      }
   }

   private void parceOlyArmors()
   {
      if (!_setsOly.isEmpty())
         _setsOly.clear();

      LineNumberReader lnr = null;
      BufferedReader br = null;
      FileReader fr = null;
      try
      {
         File Data = new File("./config/mod/Phantom/oly_sets.properties");
         if (!Data.exists())
            return;
         fr = new FileReader(Data);
         br = new BufferedReader(fr);
         lnr = new LineNumberReader(br);
         String line;
         while ((line = lnr.readLine()) != null)
         {
            if(line.trim().length() == 0 || line.startsWith("#"))
               continue;
            String[] items = line.split(",");
            int custom = 0;
            try
            {
               custom = Integer.parseInt(items[6]);
            }
            catch (Exception e)
            {
               custom = 0;
            }
            _setsOly.add(new L2Set(Integer.parseInt(items[0]), Integer.parseInt(items[1]), Integer.parseInt(items[2]), Integer.parseInt(items[3]), Integer.parseInt(items[4]), Integer.parseInt(items[5]), Integer.parseInt(items[6]), Integer.parseInt(items[7]), custom));
         }
         _setsOlyCount = _setsOly.size() - 1;
         _log.info("Load " + _setsOlyCount + " phantom Only armor sets");
      }
      catch(Exception e)
      {
         e.printStackTrace();
      }
      finally
      {
         try
         {
            if (fr != null)
               fr.close();
            if (br != null)
               br.close();
            if (lnr != null)
               lnr.close();
         }
         catch(Exception e)
         {
         }
      }
   }

   @SuppressWarnings({ "unchecked", "rawtypes" })
   private void parceTownClans()
   {
      LineNumberReader lnr = null;
      BufferedReader br = null;
      FileReader fr = null;
      try
      {
         File Data = new File("./config/mod/Phantom/town_clans.properties");
            if (!Data.exists())
               return;
         fr = new FileReader(Data);
         br = new BufferedReader(fr);
         lnr = new LineNumberReader(br);
         int clanId = 0;
         String line;
         while((line = lnr.readLine()) != null)
         {
            if (line.trim().length() == 0 || line.startsWith("#"))
               continue;
            String[] items = line.split(":");
            clanId = Integer.parseInt(items[0]);
            String[] pls = items[1].split(",");
            ConcurrentLinkedQueue players = new ConcurrentLinkedQueue();
            for (String plid : pls)
               players.add(Integer.valueOf(Integer.parseInt(plid)));
            _PhantomsTownClanList.put(Integer.valueOf(clanId), players);
         }
         _setsCountClan = _PhantomsTownClanList.size() - 1;
         _log.info("Load " + _setsCountClan + " phantom Clans");
      }
      catch (Exception e)
      {
         e.printStackTrace();
      }
      finally
      {
         try
         {
            if (fr != null)
               fr.close();
            if (br != null)
               br.close();
            if (lnr != null)
               lnr.close();
         }
         catch (Exception e1)
         {
         }
      }
   }

   private void parceTownLocs()
   {
      _PhantomsTownLoc.clear();
      LineNumberReader lnr = null;
      BufferedReader br = null;
      FileReader fr = null;
      try
      {
         File Data = new File("./config/mod/Phantom/town_locs.properties");
         if (!Data.exists())
            return;
         fr = new FileReader(Data);
         br = new BufferedReader(fr);
         lnr = new LineNumberReader(br);
         String line;
         while ((line = lnr.readLine()) != null)
         {
            if (line.trim().length() == 0 || line.startsWith("#"))
               continue;
            String[] items = line.split(",");
            _PhantomsTownLoc.add(new Location(Integer.parseInt(items[0]), Integer.parseInt(items[1]), Integer.parseInt(items[2])));
         }
         _locsCount = _PhantomsTownLoc.size() - 1;
         _log.info("Load " + _locsCount + " phantom Town Locations");
      }
      catch (Exception e)
      {
         e.printStackTrace();
      }
      finally
      {
         try
         {
            if (fr != null)
               fr.close();
            if (br != null)
               br.close();
            if (lnr != null)
               lnr.close();
         }
         catch (Exception e1)
         {
         }
      }
   }

   public void startWalk(Player phantom)
   {
      ThreadPoolManager.getInstance().schedule(new PhantomWalk(phantom), 10000);
   }

   private class PhantomWalk implements Runnable
   {
      Player _phantom;
      public PhantomWalk(Player phantom)
      {
         _phantom = phantom;
      }

      public void run()
      {
         if (_phantom.isDead())
         {    if (Config.ALLOW_PHANTOM_CHAT)
            {
            if(Rnd.get(100) < 90)
            {   
            switch (Rnd.get(1, 5))
            {
            case 1:
               Say2 cs = new Say2(_phantom.getObjectId(), ChatType.SHOUT, _phantom.getName(), getRandomdeadtalk());
               for(Player player : World.getAroundPlayers(_phantom, 10000, 3000))
                  if(player != null)
                     if(!player.isBlockAll())
                        player.sendPacket(cs);
               _phantom.kick();
               break;
            case 2:
               _phantom.kick();
               break;
            case 3:
               Say2 cs3 = new Say2(_phantom.getObjectId(), ChatType.ALL, _phantom.getName(), getRandomdeadtalk());
               for(Player player : World.getAroundPlayers(_phantom, 1200, 1000))
                  if(player != null)
                     if(!player.isBlockAll())
                        player.sendPacket(cs3);
               _phantom.kick();
               break;
            }
            }
            }
         }
            
         if (_phantom.isInWater())
            _phantom.teleToClosestTown();
         if(Rnd.get(100) < 10)
            if(Rnd.get(100) < 20)
               if (_phantom.isSitting())
                  _phantom.standUp();
         // баф фантомов
         Skill skill;
         if(Rnd.get(100) < 50)
         {
            // баф воинов
            if (!_phantom.getClassId().isMage() || _phantom.getClassId().getRace() == Race.orc)
            {
            for(int buff[] : buffs)
               if(buff[2] == 1)
               {
                     skill = SkillTable.getInstance().getInfo(buff[0], buff[1]);
                     for(EffectTemplate et : skill.getEffectTemplates())
                     {
                        Env env = new Env(_phantom, _phantom, skill);
                        Effect effect = et.getEffect(env);
                        effect.setPeriod(36000);
                        _phantom.getEffectList().addEffect(effect);
                     }
               }
            }
            //баф магов
            if (_phantom.getClassId().isMage() && _phantom.getClassId().getRace() != Race.orc)
            {
               for(int buff[] : buffs)
                  if(buff[2] == 2)
                  {
                        skill = SkillTable.getInstance().getInfo(buff[0], buff[1]);
                        for(EffectTemplate et : skill.getEffectTemplates())
                        {
                           Env env = new Env(_phantom, _phantom, skill);
                           Effect effect = et.getEffect(env);
                           effect.setPeriod(36000);
                           _phantom.getEffectList().addEffect(effect);
                        }
                  }
               
            }
            
         }
         
            
            
            /*
            for(NpcInstance npc : World.getAroundNpc(_phantom, 100, 100))
               for(int buffers_id : _buffers)
               if(npc.getNpcId() == buffers_id && !_phantom.isSitting())
               {
                  if (!_phantom.getClassId().isMage() || _phantom.getClassId().getRace() == Race.orc)
                     for(int[] buff : _warrBuff)
                        npc.broadcastPacket(new MagicSkillUse(npc, _phantom, buff[2], buff[3], 0, 0));
                  if (_phantom.getClassId().isMage() && _phantom.getClassId().getRace() != Race.orc)
                     for(int[] buff : _mageBuff)
                        npc.broadcastPacket(new MagicSkillUse(npc, _phantom, buff[2], buff[3], 0, 0));               
               }*/

         // писдеж в чат
         if (Config.ALLOW_PHANTOM_CHAT)
         {
            if(Rnd.get(100) < Config.PHANTOM_CHAT_CHANSE)
            {   
               switch (Rnd.get(1, 3))
               {
               case 1:
                  Say2 cs = new Say2(_phantom.getObjectId(), ChatType.SHOUT, _phantom.getName(), getRandomSayPhantoms());
                  for(Player player : World.getAroundPlayers(_phantom, 10000, 3000))
                     if(player != null)
                        if(!player.isBlockAll())
                           player.sendPacket(cs);
                  break;
               case 2:
                  Say2 cs2 = new Say2(_phantom.getObjectId(), ChatType.TRADE, _phantom.getName(), getRandomSayPhantoms());
                  for(Player player : World.getAroundPlayers(_phantom, 5000, 2000))
                     if(player != null)
                        if(!player.isBlockAll())
                           player.sendPacket(cs2);
                  break;
               case 3:
                  Say2 cs3 = new Say2(_phantom.getObjectId(), ChatType.ALL, _phantom.getName(), getRandomSayPhantoms());
                  for(Player player : World.getAroundPlayers(_phantom, 1200, 1000))
                     if(player != null)
                        if(!player.isBlockAll())
                           player.sendPacket(cs3);
                  break;
               }
            }
         }
         // использование анимации сосок Ы грейда
         if(Rnd.get(100) < 10)
         {
            if (!_phantom.getClassId().isMage() || _phantom.getClassId().getRace() == Race.orc)
               _phantom.broadcastPacket(new MagicSkillUse(_phantom, _phantom, 2154, 1, 0, 0));
            if (_phantom.getClassId().isMage() && _phantom.getClassId().getRace() != Race.orc)
               _phantom.broadcastPacket(new MagicSkillUse(_phantom, _phantom, 2159, 1, 0, 0));
         }
         
         // примитивная атака скилами
         if(Rnd.get(100) < 70)
         {
            if (!_phantom.getClassId().isMage() || _phantom.getClassId().getRace() == Race.orc)
               for(Player player : World.getAroundPlayers(_phantom, 100, 100))
                  if (GeoEngine.canSeeTarget(_phantom, player, false) && !player.isDead() && !player.isInZonePeace() && !_phantom.isInZonePeace() && (player.getKarma() != 0 || player.getPvpFlag() > 0))
                  {
                     if(_phantom.getRealDistance3D(player) <= _phantom.getPhysicalAttackRange() + 40)
                     {
                        _phantom.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, player);
                        try {
                           Thread.sleep(500L);
                        } catch (InterruptedException e) {
                           // TODO Auto-generated catch block
                           e.printStackTrace();
                        }
                        if (_phantom.getClassId().getRace() == Race.human)
                           _phantom.doCast(SkillTable.getInstance().getInfo(3, 2), player, true);
                        if (_phantom.getClassId().getRace() == Race.elf)
                           _phantom.doCast(SkillTable.getInstance().getInfo(3, 2), player, true);
                        if (_phantom.getClassId().getRace() == Race.darkelf)
                           _phantom.doCast(SkillTable.getInstance().getInfo(3, 2), player, true);
                        if (_phantom.getClassId().getRace() == Race.orc)
                           _phantom.doCast(SkillTable.getInstance().getInfo(29, 2), player, true);
                        if (_phantom.getClassId().getRace() == Race.dwarf)
                           _phantom.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, player);
                        if (_phantom.getClassId().getRace() == Race.kamael)
                           _phantom.doCast(SkillTable.getInstance().getInfo(468, 2), player, true);
                        try {
                           Thread.sleep(2000L);
                        } catch (InterruptedException e)
                        {
                           e.printStackTrace();
                        }
                        _phantom.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, player);
                     }
                     else
                        try {
                           Thread.sleep(500L);
                        } catch (InterruptedException e)
                         {
                           e.printStackTrace();
                        }
                        _phantom.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, player);
                  }
            if (_phantom.getClassId().isMage() && _phantom.getClassId().getRace() != Race.orc)
               for(Player player : World.getAroundPlayers(_phantom, 100, 100))
                  if (GeoEngine.canSeeTarget(_phantom, player, false) && !player.isDead() && !player.isInZonePeace() && !_phantom.isInZonePeace() && (player.getKarma() != 0 || player.getPvpFlag() > 0))
                  {
                     _phantom.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, player);
                     _phantom.doCast(SkillTable.getInstance().getInfo(1177, 2), player, true);
                  }
         }
         // атака мобов ?? Оо=)
         if(Rnd.get(100) < 40)
         {
            if (!_phantom.getClassId().isMage() || _phantom.getClassId().getRace() == Race.orc)
               for(NpcInstance npc : World.getAroundNpc(_phantom, 800, 200))
                  if (GeoEngine.canSeeTarget(_phantom, npc, false) && npc.isMonster() && !npc.isDead())
                     _phantom.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, npc);
                        _phantom.broadcastPacket(new MagicSkillUse(_phantom, _phantom, 2154, 1, 0, 0));
            if (_phantom.getClassId().isMage() && _phantom.getClassId().getRace() != Race.orc)
               for(NpcInstance npc : World.getAroundNpc(_phantom, 800, 200))
                  if (GeoEngine.canSeeTarget(_phantom, npc, false) && npc.isMonster() && !npc.isDead())
                  {
                     _phantom.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, npc);
                     _phantom.broadcastPacket(new MagicSkillUse(_phantom, _phantom, 2159, 1, 0, 0));
                     _phantom.doCast(SkillTable.getInstance().getInfo(1177, 2), npc, true);
                  }
         }
         
         // атака игроков??
         if(Rnd.get(100) < 10)
         {
            if (!_phantom.getClassId().isMage() || _phantom.getClassId().getRace() == Race.orc)
               for(Player player : World.getAroundPlayers(_phantom, 600, 200))
                  if (GeoEngine.canSeeTarget(_phantom, player, false) && !player.isDead() && !player.isInZonePeace() && !_phantom.isInZonePeace())
                     _phantom.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, player);
            
            if (_phantom.getClassId().isMage() && _phantom.getClassId().getRace() != Race.orc)
               for(Player player : World.getAroundPlayers(_phantom, 600, 200))
                  if (GeoEngine.canSeeTarget(_phantom, player, false) && !player.isDead() && !player.isInZonePeace() && !_phantom.isInZonePeace())
                  {
                     _phantom.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, player);
                     _phantom.doCast(SkillTable.getInstance().getInfo(1177, 2), player, true);
                  }
         }
         
         // подбор предметов
         if(Rnd.get(100) < 10)
            if(_phantom.getAI().getIntention() != CtrlIntention.AI_INTENTION_ATTACK || _phantom.getAI().getIntention() != CtrlIntention.AI_INTENTION_CAST)
               for(GameObject obj : World.getAroundObjects(_phantom, 800, 200))
                  if (obj.isItem())
                  _phantom.getAI().setIntention(CtrlIntention.AI_INTENTION_PICK_UP, obj);
         
         // движение
         if(Rnd.get(1000) < 1)
         {
            if(_phantom.getAI().getIntention() != CtrlIntention.AI_INTENTION_ATTACK || _phantom.getAI().getIntention() != CtrlIntention.AI_INTENTION_CAST)
               _phantom.rndWalk();   
         }
         startWalk(_phantom);
      }
   }

   // кеш фраз фантомов
   private void cachesayPhantoms()
   {
      _PhantomssayPhantoms.clear();
      LineNumberReader lnr = null;
      BufferedReader br = null;
      FileReader fr = null;
      try
      {
         File Data = new File("./config/mod/Phantom/sayPhantoms.talk");
         if (!Data.exists())
            return;
         fr = new FileReader(Data);
         br = new BufferedReader(fr);
         lnr = new LineNumberReader(br);
         String line;
         while ((line = lnr.readLine()) != null)
         {
            if (line.trim().length() == 0 || line.startsWith("#"))
               continue;
            _PhantomssayPhantoms.add(line);
         }
         _PhantomssayPhantomsCount = _PhantomssayPhantoms.size() - 1;
         _log.info("Load " + _PhantomssayPhantomsCount + " phantom say");
      }
      catch (Exception e)
      {
         e.printStackTrace();
      }
      finally
      {
         try
         {
            if (fr != null)
               fr.close();
            if (br != null)
               br.close();
            if (lnr != null)
               lnr.close();
         }
         catch (Exception e1)
         {
         }
      }
   }

   private void cachedeadtalk()
   {
      _Phantomsdeadtalk.clear();
      LineNumberReader lnr = null;
      BufferedReader br = null;
      FileReader fr = null;
      try
      {
         File Data = new File("./config/mod/Phantom/dead.talk");
         if (!Data.exists())
            return;
         fr = new FileReader(Data);
         br = new BufferedReader(fr);
         lnr = new LineNumberReader(br);
         String line;
         while ((line = lnr.readLine()) != null)
         {
            if (line.trim().length() == 0 || line.startsWith("#"))
               continue;
            _Phantomsdeadtalk.add(line);
         }
         _PhantomsdeadtalkCount = _Phantomsdeadtalk.size() - 1;
         _log.info("Load " + _PhantomsdeadtalkCount + " phantom Last");
      }
      catch (Exception e)
      {
         e.printStackTrace();
      }
      finally
      {
         try
         {
            if (fr != null)
               fr.close();
            if (br != null)
               br.close();
            if (lnr != null)
               lnr.close();
         }
         catch (Exception e1)
         {
         }
      }
   }

   private void parceColors()
   {
      _nameColors = Config.PHANTOM_PLAYERS_NAME_CLOLORS;
      _titleColors = Config.PHANTOM_PLAYERS_TITLE_CLOLORS;
      _nameColCount = _nameColors.size() - 1;
      _titleColCount = _titleColors.size() - 1;
   }

   private L2Set getRandomSet()
   {
      return _sets.get(Rnd.get(_setsCount));
   }

   @SuppressWarnings("unused")
   private L2Set getRandomArcherSet()
   {
      return _setsArcher.get(Rnd.get(_setsArcherCount));
   }

   @SuppressWarnings("unused")
   private int getRandomPhantom()
   {
      return Rnd.get(600000000, 600006081);
   }

   private int getRandomPhantomNext()
   {
      int obj = 0;
      for (int i = 6; i > 0; i--)
      {
         obj = Rnd.get(600000000, 600006081);
         if (!_PhantomsTown.get(1).contains(obj) && !_PhantomsTown.get(2).contains(obj))
            return obj;
      }
      return getRandomPhantomNext();
   }
   @SuppressWarnings("unused")
   private int getRandomClan()
   {
      return Rnd.get(600000000, 600006081);
   }

   private Location getRandomLoc()
   {
      Location loc = null;
      if(loc == null)
         loc = _PhantomsTownLoc.get(Rnd.get(0, _locsCount));
      return loc;
   }

   static class L2Set
   {
      public int _body;
      public int _gaiters;
      public int _gloves;
      public int _boots;
      public int _weapon;
      public int _custom;
      public int _shield;
      public int _cloak;
      public int _grade;
      L2Set(int bod, int gaiter, int glove, int boot, int weapon, int shield, int cloak, int grade, int custom)
      {
         _body = bod;
         _gaiters = gaiter;
         _gloves = glove;
         _boots = boot;
         _weapon = weapon;
         _shield = shield;
         _cloak = cloak;
         _grade = grade;
         _custom = custom;
      }
   }

   static class L2Fantome
   {
      public String name;
      public String title;
      public int x;
      public int y;
      public int z;
      public int clanId;
      L2Fantome(String name, String title, int x, int y, int z, int clanId)
      {
         this.name = name;
         this.title = title;
         this.x = x;
         this.y = y;
         this.z = z;
         this.clanId = clanId;
      }
   }

   public class FantomTask implements Runnable
   {
      public int _task;
      public FantomTask(int task)
      {
         _task = task;
      }
      public void run()
      {
         int count = 0;
         int count2 = 0;
         int PhantomObjId = 0;
         int PhantomObjId2 = 0;
         switch (_task)
         {
            case 1:
            {
               _log.info("PhantomPlayers: 1st wave, spawn started.");
               while(count < Config.PHANTOM_PLAYERS_COUNT_FIRST)
               {
                  Player fantom = null;
                  PhantomObjId = getRandomPhantomNext();
                  if(!(_PhantomsTown.get(1).contains(PhantomObjId)))
                  {
                     fantom = loadPhantom(PhantomObjId);
                     if(fantom == null)
                        continue;
                     _PhantomsTown.get(1).add(fantom);
                     if(Config.PHANTOM_PLAYERS_SOULSHOT_ANIM && Rnd.get(100) < 45)
                     {
                        try
                        {
                           Thread.sleep(900);
                        }
                        catch (InterruptedException e)
                        {}
                        fantom.broadcastPacket(new MagicSkillUse(fantom, fantom, 2154, 1, 0, 0));
                        if (Rnd.get(100) < 5)
                           fantom.sitDown(null);
                        if (Rnd.get(100) < 30)
                           fantom.startAbnormalEffect(AbnormalEffect.S_NAVIT);
                        try
                        {
                           Thread.sleep(300);
                        }
                        catch(InterruptedException e)
                        {
                        }
                        fantom.broadcastPacket(new MagicSkillUse(fantom, fantom, 2164, 1, 0, 0));
                     }
                     try
                     {
                        Thread.sleep(Config.PHANTOM_PLAYERS_DELAY_SPAWN_FIRST);
                     }
                     catch (InterruptedException e)
                     {
                     }
                     count++;
                  }
  &nb

[/spoiler]

 

esse mod ja tem no forum amigo .. o proprio elf postou ..

Falar é fácil. Mostre-me o código.

Link para o comentário
Compartilhar em outros sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Visitante
Responder

×   Você colou conteúdo com formatação.   Remover formatação

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Processando...
  • Registre-se

    Faça parte da maior e  mais antigas comunidades sobre Lineage2 da América Latina.






  • Patrocinadores

  • Quem Está Navegando

    • Nenhum usuário registrado visualizando esta página.
  • Posts

    • Teria como fazer do dusk shield e do zombie shield dessa maneira?     Teria como fazer do dusk shield e do zombie shield dessa maneira?     Teria como fazer do dusk shield e do zombie shield dessa maneira?     Teria como fazer do dusk shield e do zombie shield dessa maneira?     Teria como fazer do dusk shield e do zombie shield dessa maneira?     Teria como fazer do dusk shield e do zombie shield dessa maneira?    
    • muchas gracias muy lindos NPC 🙂
    • relaxa jovem gafanhoto, testa as quests. e posTa os erros indesejaveis.  
    • Se alguém pudesse me ensinar como codificar as missões, eu ficaria feliz em fazer isso sozinho ou pelo menos ajudar. Eu realmente quero jogar em um servidor onde todas as quests funcionem bem e melhor ainda se você puder fazer quests customizadas!
    • mas no interlude, nem todas as quests de class,  vai mostrar onde tem que ir, ate o reborn nao mostrava quando era interlude, só mostrou depois que eles colocaram client classic pra rodar, e ficou melhor ainda quando virou hellbound em diante, mas ha sim alguma chance de modificar isso direto no script para fazer igualmente, só basta te um pouco de paciencia e persistencia exato
    • 408_PathToElvenwizard dá Orion eu tive que mexer tbm, até modifiquei e consegui deixar ela igual do Classic, com a seta e a marcação no mapa. (não retail IL) Dá pra importar py de várias revs, o foda é que não da regular as quest py através do debug em tempo real, pelo menos eu não consegui rsrs
    • Hasta el momento todas las QUESTS son completables si te guias con un tutorial de youtube. El problema es que tienen bugs de locacion y de subquests que no avanzan o no te marcan correctamente a donde ir en el mapa, cosa que en Retail si se ve como corresponde.
    • estranho, mas pelo menos a galera nunca reclamo das quests quando tinha aberto 5x, geral fez class primeira e segunda job, poucos que compraram a class
    • en RUSaCis-3.5 data pack, las Quests estan en formato .java y son diferentes a como estan redactadas en jOrion y jFrozen 1.5 (ProyectX) package net.sf.l2j.gameserver.scripting.quest; import net.sf.l2j.commons.random.Rnd; import net.sf.l2j.gameserver.enums.Paperdoll; import net.sf.l2j.gameserver.enums.QuestStatus; import net.sf.l2j.gameserver.enums.actors.ClassId; import net.sf.l2j.gameserver.model.actor.Creature; import net.sf.l2j.gameserver.model.actor.Npc; import net.sf.l2j.gameserver.model.actor.Player; import net.sf.l2j.gameserver.network.serverpackets.SocialAction; import net.sf.l2j.gameserver.scripting.QuestState; public class Q224_TestOfSagittarius extends SecondClassQuest { private static final String QUEST_NAME = "Q224_TestOfSagittarius"; // Items private static final int BERNARD_INTRODUCTION = 3294; private static final int HAMIL_LETTER_1 = 3295; private static final int HAMIL_LETTER_2 = 3296; private static final int HAMIL_LETTER_3 = 3297; private static final int HUNTER_RUNE_1 = 3298; private static final int HUNTER_RUNE_2 = 3299; private static final int TALISMAN_OF_KADESH = 3300; private static final int TALISMAN_OF_SNAKE = 3301; private static final int MITHRIL_CLIP = 3302; private static final int STAKATO_CHITIN = 3303; private static final int REINFORCED_BOWSTRING = 3304; private static final int MANASHEN_HORN = 3305; private static final int BLOOD_OF_LIZARDMAN = 3306; private static final int CRESCENT_MOON_BOW = 3028; private static final int WOODEN_ARROW = 17; // Rewards private static final int MARK_OF_SAGITTARIUS = 3293; // NPCs private static final int BERNARD = 30702; private static final int HAMIL = 30626; private static final int SIR_ARON_TANFORD = 30653; private static final int VOKIAN = 30514; private static final int GAUEN = 30717; // Monsters private static final int ANT = 20079; private static final int ANT_CAPTAIN = 20080; private static final int ANT_OVERSEER = 20081; private static final int ANT_RECRUIT = 20082; private static final int ANT_PATROL = 20084; private static final int ANT_GUARD = 20086; private static final int NOBLE_ANT = 20089; private static final int NOBLE_ANT_LEADER = 20090; private static final int BREKA_ORC_SHAMAN = 20269; private static final int BREKA_ORC_OVERLORD = 20270; private static final int MARSH_STAKATO_WORKER = 20230; private static final int MARSH_STAKATO_SOLDIER = 20232; private static final int MARSH_STAKATO_DRONE = 20234; private static final int MARSH_SPIDER = 20233; private static final int ROAD_SCAVENGER = 20551; private static final int MANASHEN_GARGOYLE = 20563; private static final int LETO_LIZARDMAN = 20577; private static final int LETO_LIZARDMAN_ARCHER = 20578; private static final int LETO_LIZARDMAN_SOLDIER = 20579; private static final int LETO_LIZARDMAN_WARRIOR = 20580; private static final int LETO_LIZARDMAN_SHAMAN = 20581; private static final int LETO_LIZARDMAN_OVERLORD = 20582; private static final int SERPENT_DEMON_KADESH = 27090; public Q224_TestOfSagittarius() { super(224, "Test Of Sagittarius"); setItemsIds(BERNARD_INTRODUCTION, HAMIL_LETTER_1, HAMIL_LETTER_2, HAMIL_LETTER_3, HUNTER_RUNE_1, HUNTER_RUNE_2, TALISMAN_OF_KADESH, TALISMAN_OF_SNAKE, MITHRIL_CLIP, STAKATO_CHITIN, REINFORCED_BOWSTRING, MANASHEN_HORN, BLOOD_OF_LIZARDMAN, CRESCENT_MOON_BOW); addQuestStart(BERNARD); addTalkId(BERNARD, HAMIL, SIR_ARON_TANFORD, VOKIAN, GAUEN); addMyDying(ANT, ANT_CAPTAIN, ANT_OVERSEER, ANT_RECRUIT, ANT_PATROL, ANT_GUARD, NOBLE_ANT, NOBLE_ANT_LEADER, BREKA_ORC_SHAMAN, BREKA_ORC_OVERLORD, MARSH_STAKATO_WORKER, MARSH_STAKATO_SOLDIER, MARSH_STAKATO_DRONE, MARSH_SPIDER, ROAD_SCAVENGER, MANASHEN_GARGOYLE, LETO_LIZARDMAN, LETO_LIZARDMAN_ARCHER, LETO_LIZARDMAN_SOLDIER, LETO_LIZARDMAN_WARRIOR, LETO_LIZARDMAN_SHAMAN, LETO_LIZARDMAN_OVERLORD, SERPENT_DEMON_KADESH); } @Override public String onAdvEvent(String event, Npc npc, Player player) { String htmltext = event; QuestState st = player.getQuestList().getQuestState(QUEST_NAME); if (st == null) return htmltext; // BERNARD if (event.equalsIgnoreCase("30702-04.htm")) { st.setState(QuestStatus.STARTED); st.setCond(1); playSound(player, SOUND_ACCEPT); giveItems(player, BERNARD_INTRODUCTION, 1); if (giveDimensionalDiamonds39(player)) htmltext = "30702-04a.htm"; } // HAMIL else if (event.equalsIgnoreCase("30626-03.htm")) { st.setCond(2); playSound(player, SOUND_MIDDLE); takeItems(player, BERNARD_INTRODUCTION, 1); giveItems(player, HAMIL_LETTER_1, 1); } else if (event.equalsIgnoreCase("30626-07.htm")) { st.setCond(5); playSound(player, SOUND_MIDDLE); takeItems(player, HUNTER_RUNE_1, 10); giveItems(player, HAMIL_LETTER_2, 1); } // SIR_ARON_TANFORD else if (event.equalsIgnoreCase("30653-02.htm")) { st.setCond(3); playSound(player, SOUND_MIDDLE); takeItems(player, HAMIL_LETTER_1, 1); } // VOKIAN else if (event.equalsIgnoreCase("30514-02.htm")) { st.setCond(6); playSound(player, SOUND_MIDDLE); takeItems(player, HAMIL_LETTER_2, 1); } return htmltext; } @Override public String onTalk(Npc npc, Player player) { String htmltext = getNoQuestMsg(); QuestState st = player.getQuestList().getQuestState(QUEST_NAME); if (st == null) return htmltext; switch (st.getState()) { case CREATED: if (player.getClassId() != ClassId.ROGUE && player.getClassId() != ClassId.ELVEN_SCOUT && player.getClassId() != ClassId.ASSASSIN) htmltext = "30702-02.htm"; else if (player.getStatus().getLevel() < 39) htmltext = "30702-01.htm"; else htmltext = "30702-03.htm"; break; case STARTED: int cond = st.getCond(); switch (npc.getNpcId()) { case BERNARD: htmltext = "30702-05.htm"; break; case HAMIL: if (cond == 1) htmltext = "30626-01.htm"; else if (cond == 2 || cond == 3) htmltext = "30626-04.htm"; else if (cond == 4) htmltext = "30626-05.htm"; else if (cond > 4 && cond < 8) htmltext = "30626-08.htm"; else if (cond == 8) { htmltext = "30626-09.htm"; st.setCond(9); playSound(player, SOUND_MIDDLE); takeItems(player, HUNTER_RUNE_2, 10); giveItems(player, HAMIL_LETTER_3, 1); } else if (cond > 8 && cond < 12) htmltext = "30626-10.htm"; else if (cond == 12) { htmltext = "30626-11.htm"; st.setCond(13); playSound(player, SOUND_MIDDLE); } else if (cond == 13) htmltext = "30626-12.htm"; else if (cond == 14) { htmltext = "30626-13.htm"; takeItems(player, BLOOD_OF_LIZARDMAN, -1); takeItems(player, CRESCENT_MOON_BOW, 1); takeItems(player, TALISMAN_OF_KADESH, 1); giveItems(player, MARK_OF_SAGITTARIUS, 1); rewardExpAndSp(player, 54726, 20250); player.broadcastPacket(new SocialAction(player, 3)); playSound(player, SOUND_FINISH); st.exitQuest(false); } break; case SIR_ARON_TANFORD: if (cond == 2) htmltext = "30653-01.htm"; else if (cond > 2) htmltext = "30653-03.htm"; break; case VOKIAN: if (cond == 5) htmltext = "30514-01.htm"; else if (cond == 6) htmltext = "30514-03.htm"; else if (cond == 7) { htmltext = "30514-04.htm"; st.setCond(8); playSound(player, SOUND_MIDDLE); takeItems(player, TALISMAN_OF_SNAKE, 1); } else if (cond > 7) htmltext = "30514-05.htm"; break; case GAUEN: if (cond == 9) { htmltext = "30717-01.htm"; st.setCond(10); playSound(player, SOUND_MIDDLE); takeItems(player, HAMIL_LETTER_3, 1); } else if (cond == 10) htmltext = "30717-03.htm"; else if (cond == 11) { htmltext = "30717-02.htm"; st.setCond(12); playSound(player, SOUND_MIDDLE); takeItems(player, MANASHEN_HORN, 1); takeItems(player, MITHRIL_CLIP, 1); takeItems(player, REINFORCED_BOWSTRING, 1); takeItems(player, STAKATO_CHITIN, 1); giveItems(player, CRESCENT_MOON_BOW, 1); giveItems(player, WOODEN_ARROW, 10); } else if (cond > 11) htmltext = "30717-04.htm"; break; } break; case COMPLETED: htmltext = getAlreadyCompletedMsg(); break; } return htmltext; } @Override public void onMyDying(Npc npc, Creature killer) { final Player player = killer.getActingPlayer(); final QuestState st = checkPlayerState(player, npc, QuestStatus.STARTED); if (st == null) return; switch (npc.getNpcId()) { case ANT: case ANT_CAPTAIN: case ANT_OVERSEER: case ANT_RECRUIT: case ANT_PATROL: case ANT_GUARD: case NOBLE_ANT: case NOBLE_ANT_LEADER: if (st.getCond() == 3 && dropItems(player, HUNTER_RUNE_1, 1, 10, 500000)) st.setCond(4); break; case BREKA_ORC_SHAMAN: case BREKA_ORC_OVERLORD: if (st.getCond() == 6 && dropItems(player, HUNTER_RUNE_2, 1, 10, 500000)) { st.setCond(7); giveItems(player, TALISMAN_OF_SNAKE, 1); } break; case MARSH_STAKATO_WORKER: case MARSH_STAKATO_SOLDIER: case MARSH_STAKATO_DRONE: if (st.getCond() == 10 && dropItems(player, STAKATO_CHITIN, 1, 1, 100000) && player.getInventory().hasItems(MANASHEN_HORN, MITHRIL_CLIP, REINFORCED_BOWSTRING)) st.setCond(11); break; case MARSH_SPIDER: if (st.getCond() == 10 && dropItems(player, REINFORCED_BOWSTRING, 1, 1, 100000) && player.getInventory().hasItems(MANASHEN_HORN, MITHRIL_CLIP, STAKATO_CHITIN)) st.setCond(11); break; case ROAD_SCAVENGER: if (st.getCond() == 10 && dropItems(player, MITHRIL_CLIP, 1, 1, 100000) && player.getInventory().hasItems(MANASHEN_HORN, REINFORCED_BOWSTRING, STAKATO_CHITIN)) st.setCond(11); break; case MANASHEN_GARGOYLE: if (st.getCond() == 10 && dropItems(player, MANASHEN_HORN, 1, 1, 100000) && player.getInventory().hasItems(REINFORCED_BOWSTRING, MITHRIL_CLIP, STAKATO_CHITIN)) st.setCond(11); break; case LETO_LIZARDMAN: case LETO_LIZARDMAN_ARCHER: case LETO_LIZARDMAN_SOLDIER: case LETO_LIZARDMAN_WARRIOR: case LETO_LIZARDMAN_SHAMAN: case LETO_LIZARDMAN_OVERLORD: if (st.getCond() == 13) { if (((player.getInventory().getItemCount(BLOOD_OF_LIZARDMAN) - 120) * 5) > Rnd.get(100)) { playSound(player, SOUND_BEFORE_BATTLE); takeItems(player, BLOOD_OF_LIZARDMAN, -1); addSpawn(SERPENT_DEMON_KADESH, player, false, 300000, true); } else dropItemsAlways(player, BLOOD_OF_LIZARDMAN, 1, 0); } break; case SERPENT_DEMON_KADESH: if (st.getCond() == 13) { if (player.getInventory().getItemIdFrom(Paperdoll.RHAND) == CRESCENT_MOON_BOW) { st.setCond(14); playSound(player, SOUND_MIDDLE); giveItems(player, TALISMAN_OF_KADESH, 1); } else addSpawn(SERPENT_DEMON_KADESH, player, false, 300000, true); } break; } } }  
×
×
  • Criar Novo...

Important Information

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.