Jump to content

Recommended Posts

Posted

https://prnt.sc/-ayn6JgifLR3


https://prnt.sc/RLZ5wbF7PgCl

καλησπερα σε ολους, εχω κολλησει 6 ωρες σε αυτο το σημειο περιπου θα ηθελα μια βοηθεια απο καποιον που ξερει κατι παραπανω. 

μολις εβαλα 2 κωδικες που βρηκα, εκανα compile. 
και εχω κωλησει 6 ωρες σε αυτο το σημειο ψαχνω να βρω τι φταιει... 
και δεν με αφηνει να μπω μεσα...

ενα Help ρεει... 

Posted (edited)

dokimase na kaneis ta * kai to localhost 127.0.0.1 ean eisai local 

h na t kaneis rename se localhost 

Edited by MarGaZeaS
Posted (edited)
3 hours ago, Red-Hair-Shanks said:

Το δοκιμασα και εξακολλουθει να μην με αφηνει να συνεχισω...

 

2 hours ago, Zake said:

Βάλε TCP firewall exceptions στα 2106 και 7777 ports.

Αυτο δεν ξερω πως μπωρω να το κανω αλλα θα το ψαξω μηπως και φταιει αυτο... 
<< edit:
image.png.4e00d8657b0ca313b5d39b715bf27162.png
Τελικα το βρηκα το εκανα αλλα δεν ανοιγει παλι 😞 >>

Εχω αλλαξει κ Client 2 φορες σε περιπτωση που ηταν αυτο η αιτια αλλα πρεπει να ειναι κατι αλλο...

Edited by cryptonakos4444
Posted

κλίκαρε εκεί

https://prnt.sc/68roomnbLGS7

 γράψε firewall.cpl 

https://prnt.sc/zSkGw3MvOFW3

πήγαινε στα advanced settings

https://prnt.sc/8r2-2HD_wyTT

πήγαινε στα inbound rules

https://prnt.sc/Z00AnpvaLJuf

μετά new rule, διάλεξε port στα radio buttons-> next -> διάλεξε TCP και στα ports γράψε 2106 -> next -> Allow The Connection -> Next -> άφησε τσεκαρισμένα τα Domain, Private, Public -> Next -> Βάλε name TCP Loginserver -> Finish.

Κάνε το ίδιο και για το 7777 port απλώς σαν name βάλε TCP Gameserver

Posted (edited)

me 127.0.0.1 mporeis na mpeis mono an einai sta config to idio. an valeis sta config public ip den mporeis na mpeis me 127.0.01. den exei tetoio sistima to acis einai custom. vale sta config 127.0.0.1 kai sto .ini to idio kai den koitaei oute port tpt. an den mpainei exeis kanei kapou allou lathos. episis les evales 2 kodikes. ti kodikes?

Edited by andy1984
Posted (edited)
Quote
package net.sf.l2j.gameserver.handler.itemhandlers;

Pvpitem.java



package net.sf.l2j.gameserver.handler.itemhandlers;

import net.sf.l2j.gameserver.handler.IItemHandler;
import net.sf.l2j.gameserver.model.actor.Playable;
import net.sf.l2j.gameserver.model.actor.instance.Player;
import net.sf.l2j.gameserver.model.item.instance.ItemInstance;
import net.sf.l2j.gameserver.model.olympiad.OlympiadManager;
import net.sf.l2j.gameserver.network.SystemMessageId;


public class Pvpitem implements IItemHandler
{
    
    @Override
    public void useItem(Playable playable, ItemInstance item, boolean forceUse)
    {
        if (!(playable instanceof Player))
            return;
        
        Player player = (Player) playable;
        if (player.isInCombat())
        {
            player.sendMessage("You can't use this item because you are in combat");
            return;
        }
        if (player.getKarma() > 0)
        {
            player.sendMessage("You can't use this item if you have karma.");
            return;
        }
        if (player.isCursedWeaponEquipped())
        {
            player.sendMessage("You can't use this item with a cursed weapon.");
            return;
        }
        if (player.isDead())
        {
            player.sendMessage("You can't use this item while you are dead.");
            return;
        }
        if (player.getActiveTradeList() != null || player.getActiveEnchantItem() != null)
        {
            player.sendMessage("Cannot use while trading/enchanting");
            return;
        }
        else if (player.isInOlympiadMode() || OlympiadManager.getInstance().isRegisteredInComp(player))
        {
            player.sendPacket(SystemMessageId.YOU_ARE_NOT_AUTHORIZED_TO_DO_THAT);
            return;
        }
        
        final int pvps = player.getPvpKills() + 1000;
        player.setPvpKills(pvps);
        player.broadcastUserInfo();
        player.sendMessage("Your PVP count is now " + pvps);
        playable.destroyItem("Consume", item.getObjectId(), 1, null, false);
    }
}
package net.sf.l2j.gameserver.handler;

ItemHandler.java



        registerItemHandler(new ClanItem());
        registerItemHandler(new ExpAndSpItem()); 
        registerItemHandler(new CleanKarma());
      + registerItemHandler(new Pvpitem());
        
    }
    
    public void registerItemHandler(IItemHandler handler)
    {
        _datatable.put(handler.getClass().getSimpleName().intern().hashCode(), handler);
    }
    

 

Quote
### Eclipse Workspace Patch 1.0
#P aCis
diff --git aCis_game/config/npcs.properties aCis_game/config/npcs.properties
index c05f8a9..2eea0f1 100644
--- aCis_game/config/npcs.properties
+++ aCis_game/config/npcs.properties
@@ -201,4 +201,19 @@
 MinNPCAnimation = 20
 MaxNPCAnimation = 40
 MinMonsterAnimation = 10
-MaxMonsterAnimation = 40
\ No newline at end of file
+MaxMonsterAnimation = 40
+
+# id of the skill to cast when the summon item is used, the standard skill is 2046 of all pets
+SkillIdUseCastAgathion = 2046
+
+# It just follows the owner without doing any random social actions or movements.
+AgathionOnlyFollow = False
+
+# Allow social action if the npc has any, every 1s has a 10% chance to perform a social action
+AgathionAllowSocial = True
+
+# Heal the owner, only heal when he is not in certain conditions, pvp, with karma, oly, duel, pvp zone.
+AgathionHealOwner = False
+
+# Percentage of health for when it will start healing the owner. 0.25 = 25%
+AgathionPercentToHeal = 0.25
\ No newline at end of file
diff --git aCis_game/java/net/sf/l2j/Config.java aCis_game/java/net/sf/l2j/Config.java
index 65daaa6..c0b79d0 100644
--- aCis_game/java/net/sf/l2j/Config.java
+++ aCis_game/java/net/sf/l2j/Config.java
@@ -326,6 +326,13 @@
    public static int MIN_MONSTER_ANIMATION;
    public static int MAX_MONSTER_ANIMATION;
    
+   /** Agathion */
+   public static int SKILL_ID_AGATHION;
+   public static boolean AGATHION_ONLY_FOLLOW;
+   public static boolean AGATHION_ALLOW_SOCIAL;
+   public static boolean AGATHION_HEAL_OWNER;
+   public static double AGATHION_PERCENT_TO_HEAL;
+   
    // --------------------------------------------------
    // Players
    // --------------------------------------------------
@@ -949,6 +956,12 @@
        MAX_NPC_ANIMATION = npcs.getProperty("MaxNPCAnimation", 40);
        MIN_MONSTER_ANIMATION = npcs.getProperty("MinMonsterAnimation", 10);
        MAX_MONSTER_ANIMATION = npcs.getProperty("MaxMonsterAnimation", 40);
+       
+       SKILL_ID_AGATHION = npcs.getProperty("SkillIdUseCastAgathion", 2046);
+       AGATHION_ONLY_FOLLOW = npcs.getProperty("AgathionOnlyFollow", false);
+       AGATHION_ALLOW_SOCIAL = npcs.getProperty("AgathionAllowSocial", true);
+       AGATHION_HEAL_OWNER = npcs.getProperty("AgathionHealOwner", false);
+       AGATHION_PERCENT_TO_HEAL = npcs.getProperty("AgathionPercentToHeal", 0.25);
    }
    
    /**
diff --git aCis_game/java/net/sf/l2j/gameserver/handler/itemhandlers/SummonItems.java aCis_game/java/net/sf/l2j/gameserver/handler/itemhandlers/SummonItems.java
index 1792260..268ba86 100644
--- aCis_game/java/net/sf/l2j/gameserver/handler/itemhandlers/SummonItems.java
+++ aCis_game/java/net/sf/l2j/gameserver/handler/itemhandlers/SummonItems.java
@@ -2,6 +2,7 @@
 
 import java.util.List;
 
+import net.sf.l2j.Config;
 import net.sf.l2j.gameserver.data.SkillTable;
 import net.sf.l2j.gameserver.data.xml.NpcData;
 import net.sf.l2j.gameserver.data.xml.SummonItemData;
@@ -41,6 +42,25 @@
        
        final IntIntHolder sitem = SummonItemData.getInstance().getSummonItem(item.getItemId());
        
+       final NpcTemplate npcTemplate = NpcData.getInstance().getTemplate(sitem.getId());
+       if (npcTemplate == null)
+           return;
+       
+       if (npcTemplate.getType().equalsIgnoreCase("Agathion"))
+       {
+           if (player.getAgathion() != null)
+           {
+               player.getAgathion().unSummon(player);
+               item.setAgathion(player, false);
+               player.sendMessage("Agathion has been unsummoned");
+               return;
+           }
+           item.setAgathion(player, true);
+           item.checkProtected(player);
+           player.getAI().tryToCast(player, SkillTable.getInstance().getInfo(Config.SKILL_ID_AGATHION, 1), false, false, item.getObjectId());
+           return;
+       }
+       
        if ((player.getSummon() != null || player.isMounted()) && sitem.getValue() > 0)
        {
            player.sendPacket(SystemMessageId.SUMMON_ONLY_ONE);
@@ -53,10 +73,6 @@
            return;
        }
        
-       final NpcTemplate npcTemplate = NpcData.getInstance().getTemplate(sitem.getId());
-       if (npcTemplate == null)
-           return;
-       
        switch (sitem.getValue())
        {
            case 0: // static summons (like Christmas tree)
diff --git aCis_game/java/net/sf/l2j/gameserver/handler/skillhandlers/SummonCreature.java aCis_game/java/net/sf/l2j/gameserver/handler/skillhandlers/SummonCreature.java
index 30cc469..3881cd3 100644
--- aCis_game/java/net/sf/l2j/gameserver/handler/skillhandlers/SummonCreature.java
+++ aCis_game/java/net/sf/l2j/gameserver/handler/skillhandlers/SummonCreature.java
@@ -6,10 +6,12 @@
 import net.sf.l2j.gameserver.enums.skills.SkillType;
 import net.sf.l2j.gameserver.geoengine.GeoEngine;
 import net.sf.l2j.gameserver.handler.ISkillHandler;
+import net.sf.l2j.gameserver.idfactory.IdFactory;
 import net.sf.l2j.gameserver.model.World;
 import net.sf.l2j.gameserver.model.WorldObject;
 import net.sf.l2j.gameserver.model.actor.Creature;
 import net.sf.l2j.gameserver.model.actor.Player;
+import net.sf.l2j.gameserver.model.actor.instance.Agathion;
 import net.sf.l2j.gameserver.model.actor.instance.Pet;
 import net.sf.l2j.gameserver.model.actor.template.NpcTemplate;
 import net.sf.l2j.gameserver.model.holder.IntIntHolder;
@@ -41,10 +43,6 @@
        if (item.getOwnerId() != player.getObjectId() || item.getLocation() != ItemLocation.INVENTORY)
            return;
        
-       // Owner has a pet listed in world.
-       if (World.getInstance().getPet(player.getObjectId()) != null)
-           return;
-       
        // Check summon item validity.
        final IntIntHolder summonItem = SummonItemData.getInstance().getSummonItem(item.getItemId());
        if (summonItem == null)
@@ -55,6 +53,34 @@
        if (npcTemplate == null)
            return;
        
+       if (npcTemplate.getType().equalsIgnoreCase("Agathion"))
+       {
+           if (player.getAgathion() != null)
+               player.getAgathion().unSummon(player);
+           
+           Agathion summon;
+           summon = new Agathion(IdFactory.getInstance().getNextId(), npcTemplate, player);
+           player.setAgathion(summon);
+           
+           summon.getStatus().setMaxHpMp();
+           summon.forceRunStance();
+           
+           final SpawnLocation spawnLoc = activeChar.getPosition().clone();
+           spawnLoc.addStrictOffset(40);
+           spawnLoc.setHeadingTo(activeChar.getPosition());
+           spawnLoc.set(GeoEngine.getInstance().getValidLocation(activeChar, spawnLoc));
+           
+           summon.spawnMe(spawnLoc);
+           summon.setInvul(true);
+           summon.getAI().setFollowStatus(true);
+           item.setAgathionItem(player);
+           return;
+       }
+       
+       // Owner has a pet listed in world.
+       if (World.getInstance().getPet(player.getObjectId()) != null)
+           return;
+       
        // Add the pet instance to world.
        final Pet pet = Pet.restore(item, npcTemplate, player);
        if (pet == null)
diff --git aCis_game/java/net/sf/l2j/gameserver/model/actor/Player.java aCis_game/java/net/sf/l2j/gameserver/model/actor/Player.java
index 023516a..64c28dd 100644
--- aCis_game/java/net/sf/l2j/gameserver/model/actor/Player.java
+++ aCis_game/java/net/sf/l2j/gameserver/model/actor/Player.java
@@ -107,6 +107,7 @@
 import net.sf.l2j.gameserver.model.actor.container.player.Request;
 import net.sf.l2j.gameserver.model.actor.container.player.ShortcutList;
 import net.sf.l2j.gameserver.model.actor.container.player.SubClass;
+import net.sf.l2j.gameserver.model.actor.instance.Agathion;
 import net.sf.l2j.gameserver.model.actor.instance.Door;
 import net.sf.l2j.gameserver.model.actor.instance.FestivalMonster;
 import net.sf.l2j.gameserver.model.actor.instance.Folk;
@@ -373,6 +374,7 @@
    private final QuestList _questList = new QuestList(this);
    
    private Summon _summon;
+   private Agathion aga;
    private TamedBeast _tamedBeast;
    
    private int _partyRoom;
@@ -6489,6 +6491,9 @@
            else if (_summon != null)
                _summon.unSummon(this);
            
+           if (getAgathion() != null)
+               aga.unSummon(this);
+           
            // Stop all scheduled tasks.
            stopChargeTask();
            
@@ -7407,4 +7412,14 @@
        
        return gms;
    }
+   
+   public void setAgathion(Agathion aga)
+   {
+       this.aga = aga;
+   }
+   
+   public Agathion getAgathion()
+   {
+       return aga;
+   }
 }
\ No newline at end of file
diff --git aCis_game/java/net/sf/l2j/gameserver/model/actor/cast/PlayerCast.java aCis_game/java/net/sf/l2j/gameserver/model/actor/cast/PlayerCast.java
index f666547..778fc12 100644
--- aCis_game/java/net/sf/l2j/gameserver/model/actor/cast/PlayerCast.java
+++ aCis_game/java/net/sf/l2j/gameserver/model/actor/cast/PlayerCast.java
@@ -273,7 +273,7 @@
        switch (skill.getSkillType())
        {
            case SUMMON:
-               if (!((L2SkillSummon) skill).isCubic() && (_actor.getSummon() != null || _actor.isMounted()))
+               if (!((L2SkillSummon) skill).isAgathion() && !((L2SkillSummon) skill).isCubic() && (_actor.getSummon() != null || _actor.isMounted()))
                {
                    _actor.sendPacket(SystemMessageId.SUMMON_ONLY_ONE);
                    return false;
diff --git aCis_game/java/net/sf/l2j/gameserver/model/actor/instance/Agathion.java aCis_game/java/net/sf/l2j/gameserver/model/actor/instance/Agathion.java
new file mode 100644
index 0000000..584ac24
--- /dev/null
+++ aCis_game/java/net/sf/l2j/gameserver/model/actor/instance/Agathion.java
@@ -0,0 +1,133 @@
+package net.sf.l2j.gameserver.model.actor.instance;
+
+import java.util.concurrent.Future;
+
+import net.sf.l2j.commons.math.MathUtil;
+import net.sf.l2j.commons.pool.ThreadPool;
+import net.sf.l2j.commons.random.Rnd;
+
+import net.sf.l2j.Config;
+import net.sf.l2j.gameserver.enums.ZoneId;
+import net.sf.l2j.gameserver.model.actor.Npc;
+import net.sf.l2j.gameserver.model.actor.Player;
+import net.sf.l2j.gameserver.model.actor.template.NpcTemplate;
+import net.sf.l2j.gameserver.model.item.instance.ItemInstance;
+import net.sf.l2j.gameserver.model.location.Location;
+import net.sf.l2j.gameserver.model.location.SpawnLocation;
+import net.sf.l2j.gameserver.network.serverpackets.PetDelete;
+import net.sf.l2j.gameserver.network.serverpackets.SocialAction;
+
+/**
+ * @author maxi5
+ *
+ */
+public class Agathion extends Npc
+{
+   private Player _owner;
+   private Future<?> _followTask;
+   
+   private ItemInstance item;
+   
+   public Agathion(int objectId, NpcTemplate template, Player owner)
+   {
+       super(objectId, template);
+       
+        // Set the magical circle animation.
+       setShowSummonAnimation(true);
+       
+       // Set the Player owner.
+       _owner = owner;
+   }
+   
+   @Override
+   public void onSpawn()
+   {
+       followToOwner();
+       super.onSpawn();
+   }
+   
+   public void unSummon(Player owner)
+   {
+       // Abort attack, cast and move.
+       abortAll(true);
+       
+       if (item != null)
+           item.setAgathion(owner, false);
+       
+       owner.sendPacket(new PetDelete(2, getObjectId()));
+       owner.setAgathion(null);
+       
+       if (owner.getSummon() != null)
+           owner.getSummon().sendInfo(owner);
+       owner.broadcastUserInfo();
+       
+       if (_followTask != null)
+           _followTask.cancel(true);
+       
+       decayMe();
+       deleteMe();
+       
+       super.deleteMe();
+   }
+   
+   public void followToOwner()
+   {
+       if (_followTask == null)
+           _followTask = ThreadPool.scheduleAtFixedRate(new Follow(this), 1000, 1000);
+       
+       SpawnLocation loc = _owner.getPosition();
+       final int rnd = Rnd.get(-30, +30);
+       final boolean action = Rnd.get(100) < 15;
+
+       if (!checkIfInRange(2000, this, _owner))
+           teleportTo(_owner.getPosition(), 30);
+       else if (!checkIfInRange(1000, this, _owner))
+           instantTeleportTo(_owner.getPosition(), 30);
+       
+       if (_owner.isMoving())
+           getAI().tryToFollow(_owner, false);
+       else
+       {
+           if (checkIfInRange(30, this, _owner))
+               getAI().tryToIdle();
+           if (!Config.AGATHION_ONLY_FOLLOW && (!checkIfInRange(75, this, _owner) || action))
+               getAI().tryToMoveTo(new Location(loc.getX()+rnd, loc.getY()+rnd, loc.getZ()), null);
+           if (Config.AGATHION_HEAL_OWNER && !action && !getCast().isCastingNow())
+           {
+               if (_owner.isInOlympiadMode() || _owner.isInDuel() || _owner.getPvpFlag() != 0 || _owner.isInsideZone(ZoneId.PVP) || _owner.getKarma() != 0)
+                   return;
+               
+               if ((_owner.getStatus().getHpRatio() < Config.AGATHION_PERCENT_TO_HEAL))
+                   getAI().tryToCast(_owner, 1011, 18);
+           }
+           else if (!Config.AGATHION_ONLY_FOLLOW && Config.AGATHION_ALLOW_SOCIAL && !isMoving() && action && !getCast().isCastingNow())
+               broadcastPacket(new SocialAction(this, 1));
+       }
+   }
+
+   private static class Follow implements Runnable
+   {
+       private final Agathion agathion;
+       
+       protected Follow(Agathion aga)
+       {
+           agathion = aga;
+       }
+       
+       @Override
+       public void run()
+       {
+           agathion.followToOwner();
+       }   
+   }
+   
+   public static boolean checkIfInRange(int range, Npc npc, Player player)
+   {
+       return MathUtil.checkIfInRange((int) (range + npc.getCollisionRadius()), npc, player, true);
+   }
+   
+   public void setAgathionItem(ItemInstance item)
+   {
+       this.item = item;
+   }
+}
\ No newline at end of file
diff --git aCis_game/java/net/sf/l2j/gameserver/model/item/instance/ItemInstance.java aCis_game/java/net/sf/l2j/gameserver/model/item/instance/ItemInstance.java
index 8429f78..940e74b 100644
--- aCis_game/java/net/sf/l2j/gameserver/model/item/instance/ItemInstance.java
+++ aCis_game/java/net/sf/l2j/gameserver/model/item/instance/ItemInstance.java
@@ -4,6 +4,7 @@
 import java.sql.PreparedStatement;
 import java.sql.ResultSet;
 import java.util.List;
+import java.util.concurrent.Future;
 import java.util.concurrent.ScheduledFuture;
 import java.util.concurrent.locks.ReentrantLock;
 import java.util.logging.Level;
@@ -104,6 +105,9 @@
    
    private int _shotsMask = 0;
    
+   private boolean isAgathion;
+   private Future<?> _protectedTask;
+   
    /**
     * Constructor of the ItemInstance from the objectId and the itemId.
     * @param objectId : int designating the ID of the object in the world
@@ -487,7 +491,7 @@
     */
    public boolean isDropable()
    {
-       return isAugmented() ? false : _item.isDropable();
+       return isAgathion || isAugmented() ? false : _item.isDropable();
    }
    
    /**
@@ -495,7 +499,7 @@
     */
    public boolean isDestroyable()
    {
-       return isQuestItem() ? false : _item.isDestroyable();
+       return isAgathion || isQuestItem() ? false : _item.isDestroyable();
    }
    
    /**
@@ -503,7 +507,7 @@
     */
    public boolean isTradable()
    {
-       return isAugmented() ? false : _item.isTradable();
+       return isAgathion || isAugmented() ? false : _item.isTradable();
    }
    
    /**
@@ -521,7 +525,7 @@
    public boolean isDepositable(boolean isPrivateWareHouse)
    {
        // equipped, hero and quest items
-       if (isEquipped() || !_item.isDepositable())
+       if (isEquipped() || !_item.isDepositable() || isAgathion)
            return false;
        
        if (!isPrivateWareHouse)
@@ -1275,4 +1279,47 @@
        
        return Integer.compare(item.getObjectId(), getObjectId());
    }
+   
+   public void setAgathion(Player player, boolean isAgathion)
+   {
+       this.isAgathion = isAgathion;
+   }
+   
+   public void checkProtected(Player player)
+   {
+       if (_protectedTask != null)
+           _protectedTask.cancel(true);
+       _protectedTask = ThreadPool.schedule(new Protected(player), 5500);
+   }
+
+   public boolean isAgathion()
+   {
+       return isAgathion;
+   }
+   
+   public void setAgathionItem(Player player)
+   {
+       player.getAgathion().setAgathionItem(this);
+   }   
+
+   private class Protected implements Runnable
+   {
+       private final Player player;
+       
+       protected Protected(Player player)
+       {
+           this.player = player;
+       }
+       
+       @Override
+       public void run()
+       {
+           if (player.getAgathion() != null)
+               isAgathion = true;
+           else 
+               isAgathion = false;
+           if (_protectedTask != null)
+               _protectedTask.cancel(true);
+       }
+   }
 }
\ No newline at end of file
diff --git aCis_game/java/net/sf/l2j/gameserver/network/clientpackets/Action.java aCis_game/java/net/sf/l2j/gameserver/network/clientpackets/Action.java
index e963ca2..781a634 100644
--- aCis_game/java/net/sf/l2j/gameserver/network/clientpackets/Action.java
+++ aCis_game/java/net/sf/l2j/gameserver/network/clientpackets/Action.java
@@ -3,6 +3,7 @@
 import net.sf.l2j.gameserver.model.World;
 import net.sf.l2j.gameserver.model.WorldObject;
 import net.sf.l2j.gameserver.model.actor.Player;
+import net.sf.l2j.gameserver.model.actor.instance.Agathion;
 import net.sf.l2j.gameserver.model.entity.Duel.DuelState;
 import net.sf.l2j.gameserver.network.SystemMessageId;
 import net.sf.l2j.gameserver.network.serverpackets.ActionFailed;
@@ -57,6 +58,12 @@
            return;
        }
        
+       if (target instanceof Agathion)
+       {
+           player.sendPacket(ActionFailed.STATIC_PACKET);
+           return;
+       }
+       
        target.onAction(player, false, _isShiftAction);
    }
    
diff --git aCis_game/java/net/sf/l2j/gameserver/network/clientpackets/AttackRequest.java aCis_game/java/net/sf/l2j/gameserver/network/clientpackets/AttackRequest.java
index 5bbd7e8..e091a24 100644
--- aCis_game/java/net/sf/l2j/gameserver/network/clientpackets/AttackRequest.java
+++ aCis_game/java/net/sf/l2j/gameserver/network/clientpackets/AttackRequest.java
@@ -3,6 +3,7 @@
 import net.sf.l2j.gameserver.model.World;
 import net.sf.l2j.gameserver.model.WorldObject;
 import net.sf.l2j.gameserver.model.actor.Player;
+import net.sf.l2j.gameserver.model.actor.instance.Agathion;
 import net.sf.l2j.gameserver.network.SystemMessageId;
 import net.sf.l2j.gameserver.network.serverpackets.ActionFailed;
 
@@ -54,6 +55,12 @@
            return;
        }
        
+       if (target instanceof Agathion)
+       {
+           player.sendPacket(ActionFailed.STATIC_PACKET);
+           return;
+       }
+       
        // (player.getTarget() == target) -> This happens when you control + click a target without having had it selected beforehand. Behaves as the Action packet and will NOT trigger an attack.
        target.onAction(player, (player.getTarget() == target), _isShiftAction);
    }
diff --git aCis_game/java/net/sf/l2j/gameserver/network/clientpackets/RequestDestroyItem.java aCis_game/java/net/sf/l2j/gameserver/network/clientpackets/RequestDestroyItem.java
index b9c239f..b603b41 100644
--- aCis_game/java/net/sf/l2j/gameserver/network/clientpackets/RequestDestroyItem.java
+++ aCis_game/java/net/sf/l2j/gameserver/network/clientpackets/RequestDestroyItem.java
@@ -58,6 +58,12 @@
            return;
        }
        
+       if (itemToRemove.isAgathion())
+       {
+           player.sendPacket(SystemMessageId.CANNOT_DISCARD_THIS_ITEM);
+           return;
+       }
+       
        if (itemToRemove.isEquipped() && (!itemToRemove.isStackable() || (itemToRemove.isStackable() && _count >= itemToRemove.getCount())))
        {
            final ItemInstance[] unequipped = player.getInventory().unequipItemInSlotAndRecord(itemToRemove.getLocationSlot());
diff --git aCis_game/java/net/sf/l2j/gameserver/network/clientpackets/RequestDropItem.java aCis_game/java/net/sf/l2j/gameserver/network/clientpackets/RequestDropItem.java
index 6fc1ab5..1f91749 100644
--- aCis_game/java/net/sf/l2j/gameserver/network/clientpackets/RequestDropItem.java
+++ aCis_game/java/net/sf/l2j/gameserver/network/clientpackets/RequestDropItem.java
@@ -48,7 +48,7 @@
        if (item.isQuestItem())
            return;
        
-       if (_count > item.getCount())
+       if (_count > item.getCount() || item.isAgathion())
        {
            player.sendPacket(SystemMessageId.CANNOT_DISCARD_THIS_ITEM);
            return;
diff --git aCis_game/java/net/sf/l2j/gameserver/skills/l2skills/L2SkillSummon.java aCis_game/java/net/sf/l2j/gameserver/skills/l2skills/L2SkillSummon.java
index cf1d5e5..d0942ad 100644
--- aCis_game/java/net/sf/l2j/gameserver/skills/l2skills/L2SkillSummon.java
+++ aCis_game/java/net/sf/l2j/gameserver/skills/l2skills/L2SkillSummon.java
@@ -13,6 +13,7 @@
 import net.sf.l2j.gameserver.model.actor.Creature;
 import net.sf.l2j.gameserver.model.actor.Player;
 import net.sf.l2j.gameserver.model.actor.Summon;
+import net.sf.l2j.gameserver.model.actor.instance.Agathion;
 import net.sf.l2j.gameserver.model.actor.instance.Servitor;
 import net.sf.l2j.gameserver.model.actor.instance.SiegeSummon;
 import net.sf.l2j.gameserver.model.actor.template.NpcTemplate;
@@ -25,6 +26,7 @@
    private final int _npcId;
    private final float _expPenalty;
    private final boolean _isCubic;
+   private final boolean _isAgathion;
    
    private final int _activationTime;
    private final int _activationChance;
@@ -47,6 +49,7 @@
        _npcId = set.getInteger("npcId", 0); // default for undescribed skills
        _expPenalty = set.getFloat("expPenalty", 0.f);
        _isCubic = set.getBool("isCubic", false);
+       _isAgathion = set.getBool("isAgathion", false);
        
        _activationTime = set.getInteger("activationtime", 8);
        _activationChance = set.getInteger("activationchance", 30);
@@ -84,7 +87,7 @@
                if (player.isInObserverMode())
                    return false;
                
-               if (player.getSummon() != null)
+               if (!_isAgathion && player.getSummon() != null)
                {
                    player.sendPacket(SystemMessageId.SUMMON_ONLY_ONE);
                    return false;
@@ -130,6 +133,34 @@
        }
        else
        {
+           if (_isAgathion)
+           {
+               NpcTemplate summonTemplate = NpcData.getInstance().getTemplate(_npcId);
+
+               if (summonTemplate == null)
+               {
+                   LOGGER.warn("Couldn't properly spawn with id {} ; the template is missing.", _npcId);
+                   return;
+               }
+               if (activeChar.getAgathion() != null)
+                   activeChar.getAgathion().unSummon(activeChar);
+               Agathion summon;
+               summon = new Agathion(IdFactory.getInstance().getNextId(), summonTemplate, activeChar);
+               activeChar.setAgathion(summon);
+               summon.getStatus().setMaxHpMp();
+               summon.forceRunStance();
+               
+               final SpawnLocation spawnLoc = activeChar.getPosition().clone();
+               spawnLoc.addStrictOffset(40);
+               spawnLoc.setHeadingTo(activeChar.getPosition());
+               spawnLoc.set(GeoEngine.getInstance().getValidLocation(activeChar, spawnLoc));
+               
+               summon.spawnMe(spawnLoc);
+               summon.setInvul(true);
+               summon.getAI().setFollowStatus(true);
+               return;
+           }
+           
            if (activeChar.getSummon() != null || activeChar.isMounted())
                return;
            
@@ -174,6 +205,11 @@
        return _isCubic;
    }
    
+   public final boolean isAgathion()
+   {
+       return _isAgathion;
+   }
+   
    public final int getTotalLifeTime()
    {
        return _summonTotalLifeTime;
 

 

On 1/22/2024 at 2:34 PM, andy1984 said:

me 127.0.0.1 mporeis na mpeis mono an einai sta config to idio. an valeis sta config public ip den mporeis na mpeis me 127.0.01. den exei tetoio sistima to acis einai custom. vale sta config 127.0.0.1 kai sto .ini to idio kai den koitaei oute port tpt. an den mpainei exeis kanei kapou allou lathos. episis les evales 2 kodikes. ti kodikes?

autous tous 2 kodikes exw valei... twra auto me ta confing pou les nomizw dokimasa ta pada... kai to estila k kapou alou na to doun alla den vrike kanis akri... kai apo oti katalava k olas an 8es na kaneis enan swsto server prepei na gineis sub sto acis gia na exeis prosvasi se kwdikes k fixes... ektos an psaksis toso polu i gnorizeis toso kala ta arxeia oste na boris na vgazis kodikes apo costum source k na ta vazis sto diko sou... pou entaksi mou fenete arketa tryhard gia to tpt stin ousia gia na glitoseis 120 euro pou einai gia ena xrono sub... 

tora me to sugekrimeno pack to exw afisi 2 meres tora na sou pw tin ali8eia den boresa na vrw ti fteei k den anoigei... 

8es na sou anoiksw teamviewer na to deis mipos ?

Edited by cryptonakos4444

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  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.



×
×
  • Create New...