Ir para conteúdo
  • Cadastre-se

L2jMega Pré-Configurado


MeGaPacKl

Posts recomendados

5 horas atrás, LucasDesigner disse:

 

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

o codigo não é o mesmo do video deveria funcionar semelhantemente mas não funcionou postei para ver se alguem conseguiria fazer funcionar.

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

Link para o comentário
Compartilhar em outros sites


19 minutos atrás, *-*InSaNo*-* disse:

o codigo não é o mesmo do video deveria funcionar semelhantemente mas não funcionou postei para ver se alguem conseguiria fazer funcionar.

amigo o mod do video e o mod que o elfcast post aqui no video .. agora o mod que tem na souce do mega é diferente ..

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

Link para o comentário
Compartilhar em outros sites

3 horas atrás, Chepi Matlu Martinez disse:

COMO EDITO SETS AMOR FAKE PLAYERS, TEM SET GRADO A, QUERO COLOCA SETS GRADO D

TUdo no core pra troca sets ou se nao fazer uma config no game

Link para o comentário
Compartilhar em outros sites

18 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

 

  Ocultar conteúdo

 

 



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]

quem te passou esse codigo ai? é parecido com o que tem no meu, mas esse tem mais config, e parece tbm q ta faltando uma parte do codigo. vou da uma testada nesse codigo e postar print dele funcionando.

1xFoI0n.jpg.5e0903bc1b582f95590d4a4c1fce368a.jpg

Link para o comentário
Compartilhar em outros sites

1 hora atrás, LucasDesigner disse:

amigo o mod do video e o mod que o elfcast post aqui no video .. agora o mod que tem na souce do mega é diferente ..

eu sei que e diferente um amigo gringo me passou este codigo.

apenas leia e interprete corretamente assim vamos evitar muita cv desnecessária ok?

MeGaPacKl

supostamente os bots farma e bate pvp se vc tiver fleg tbm é atacado

Editado por *-*InSaNo*-*

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

Link para o comentário
Compartilhar em outros sites

55 minutos atrás, *-*InSaNo*-* disse:

alguem que tenha conseguido por o mod que postei funcionar na pack  posta ai pra galera pq ak ta osso

esta faltando partes desse codigo que vc postou!

esse codigo que vc postou é o mesmo que tem na minha pack l2jmega, porem essa dai tem mais config e metodos que estao falando.

Editado por MeGaPacKl

1xFoI0n.jpg.5e0903bc1b582f95590d4a4c1fce368a.jpg

Link para o comentário
Compartilhar em outros sites

1 minuto atrás, MeGaPacKl disse:

esta faltando partes desse codigo que vc postou!

esse codigo que vc postou é o mesmo que tem na minha pack l2jmega, porem essa dai tem mais config e metodos que estao falando.

então mais o Insanitybr postou o video do mod, ele podia contribuir com agente

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

Link para o comentário
Compartilhar em outros sites

bom dia a todos!
 

 

Tentei por para Rodar a rev aqui para dar uma olhada,

 

vi que houve um problema logo no inicio.

 

Alguem poderia me passar os programas para que eu possa colocar online? pois a versão do java que tenho acredito seja diferente da que pede

 

 

Abaixo segue imagem do erro 

 

https://uploaddeimagens.com.br/imagens/sem_titulo-png-3733acad-71cd-4739-8f09-8194945ea6dc

Link para o comentário
Compartilhar em outros sites

2 horas atrás, ~> STIGMATA <~ disse:

bom dia a todos!
 

 

Tentei por para Rodar a rev aqui para dar uma olhada,

 

vi que houve um problema logo no inicio.

 

Alguem poderia me passar os programas para que eu possa colocar online? pois a versão do java que tenho acredito seja diferente da que pede

 

 

Abaixo segue imagem do erro 

 

https://uploaddeimagens.com.br/imagens/sem_titulo-png-3733acad-71cd-4739-8f09-8194945ea6dc

usa java 8 

Link para o comentário
Compartilhar em outros sites

6 horas atrás, Insanitybr disse:

usa java 8 

foi esse o problema, consegui logar com sucesso...

 

 

 

Porem estou com um negocio qe preciso tirar eh como se fosse um log do que eu uso.

 

https://uploaddeimagens.com.br/imagens/shot00000-jpg-fae3cd13-2622-4156-afdc-74e838ac7c08

 

Alguem poderia ajudar?

 

 

 

Link para o comentário
Compartilhar em outros sites

3 minutos atrás, ~> STIGMATA <~ disse:

foi esse o problema, consegui logar com sucesso ...

 

 

 

Por causa do meu negócio é preciso tirar eh como se fosse um log do que eu uso.

 

https://uploaddeimagens.com.br/imagens/shot00000-jpg-fae3cd13-2622-4156-afdc-74e838ac7c08

 

Alguem poderia ajudar?

 

 

 

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

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

Link para o comentário
Compartilhar em outros sites

44 minutos atrás, *-*InSaNo*-* disse:

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

Obrigado mano!

Link para o comentário
Compartilhar em outros sites

58 minutos atrás, l2triedge disse:

como faço para deixar os bot online permanente? eles so ficam meia hora depois some

No arquivo Phantom vc altera o tempo lá tá o número 30 contando em minutos é só mudar

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

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.






×
×
  • 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.