Jump to content

Question

Posted

paidia pernaw ena java code twra sto pack kai kolisa

me ta kokina gramata einai code pou exw eidei apo compile!

 

 

package .gameserver.model.zone.type;

 

import javolution.util.FastList;

 

import .Config;

import ll.gameserver.model.L2Character;

import.gameserver.model.actor.instance.L2PcInstance;

import gameserver.model.zone.L2ZoneType;

import .util.Rnd;

 

import org.w3c.dom.Node;

 

public class L2TownZone extends L2ZoneType

{

 

    public L2TownZone(int id)

    {

super(id);

        _taxById = 0;

        _spawnLocs = new FastList<int[]>();

        _redirectTownId = 9;

        _noPeace = false;

    }

 

    public void setParameter(String s, String s1)

    {

        if(s.equals("name"))

            _townName = s1;

        else

        if(s.equals("townId"))

            _townId = Integer.parseInt(s1);

        else

        if(s.equals("redirectTownId"))

            _redirectTownId = Integer.parseInt(s1);

        else

        if(s.equals("taxById"))

            _taxById = Integer.parseInt(s1);

        else

        if(s.equals("noPeace"))

            _noPeace = Boolean.parseBoolean(s1);

        else

            super.setParameter(s, s1);

    }

 

    public void setSpawnLocs(Node node)

    {

        int ai[] = new int[3];

        Node node1 = node.getAttributes().getNamedItem("X");

        if(node1 != null)

            ai[0] = Integer.parseInt(node1.getNodeValue());

        node1 = node.getAttributes().getNamedItem("Y");

        if(node1 != null)

            ai[1] = Integer.parseInt(node1.getNodeValue());

        node1 = node.getAttributes().getNamedItem("Z");

        if(node1 != null)

            ai[2] = Integer.parseInt(node1.getNodeValue());

        if(ai != null)

            _spawnLocs.add(ai);

    }

 

    protected void onEnter(L2Character l2character)

    {

        if((l2character instanceof L2PcInstance) && ((L2PcInstance)l2character).getSiegeState() != 0 && Config.ZONE_TOWN == 1)

            return;

        if(!_noPeace && Config.ZONE_TOWN != 2)

            l2character.setInsideZone(2, true);

    }

 

    protected void onExit(L2Character l2character)

    {

        if(!_noPeace)

            l2character.setInsideZone(2, false);

    }

 

    public void onDieInside(L2Character l2character)

    {

    }

 

    public void onReviveInside(L2Character l2character)

    {

    }

 

    public String getName()

    {

        return _townName;

    }

 

    public int getTownId()

    {

        return _townId;

    }

 

    public int getRedirectTownId()

    {

        return _redirectTownId;

    }

 

    public final int[] getSpawnLoc()

    {

        int ai[] = new int[3];

        ai = (int[])_spawnLocs.get(Rnd.get(_spawnLocs.size()));

        return ai;

    }

 

    public final int getTaxById()

    {

        return _taxById;

    }

 

    private String _townName;

    private int _townId;

    private int _redirectTownId;

    private int _taxById;

    private boolean _noPeace;

    private FastList<int[]> _spawnLocs;

}

---------------------------------------------------------

kai aftw edw einai pou 8elw na perasw!

 

8elw na me help pws na to perasw gt kanw search kai den briskw tpt apo to ctrl+f.

 

@@ -95,12 +95,28 @@

{

if (character instanceof L2PcInstance)

{

+ // just a method, for efficiency

+ L2PcInstance activeChar = ((L2PcInstance)character);

+

// PVP possible during siege, now for siege participants only

// Could also check if this town is in siege, or if any siege is going on

- if (((L2PcInstance)character).getSiegeState() != 0 && Config.ZONE_TOWN == 1)

+ if (activeChar.getSiegeState() != 0 && Config.ZONE_TOWN == 1)

return;

 

//((L2PcInstance)character).sendMessage("You entered "+_townName);

+

+ if (activeChar.isDonator() && getTownId() == 7)

+ {

+ activeChar.sendMessage("Donators can't enter Gludio. You are now jailed.");

+ activeChar.setInJail(true, 10);

+ }

+ else if (activeChar.isDonator() && getTownId() == 8)

+ {

+ activeChar.sendMessage("Donators can't enter Dion. You are now jailed.");

+ activeChar.setInJail(true, 10);

+ }

+ else

+ activeChar.sendMessage("You have entered a non-restricted area.");

}

 

if (!_noPeace && Config.ZONE_TOWN != 2) character.setInsideZone(L2Character.ZONE_PEACE, true);

@@ -114,7 +130,15 @@

 

// if (character instanceof L2PcInstance)

//((L2PcInstance)character).sendMessage("You left "+_townName);

-

+

+ if (character instanceof L2PcInstance)

+ {

+ if (((L2PcInstance)character).isDonator() && (getTownId() == 7 || getTownId() == 8) && !((L2PcInstance)character).isInJail())

+ {

+ ((L2PcInstance)character).sendMessage("How you entered in first place? Oh i hate exploiters!");

+ ((L2PcInstance)character).setInJail(true, 60);

+ }

+ }

}

 

@Override

 

[move]

enas empiros dev pliz na mou dwsei to code perasmenw[/move]

4 answers to this question

Recommended Posts

  • 0
Posted

που είναι το δύσκολο

όπου βλέπεις + το προσθέτεις και μετά σβήνεις το +

και όπου βλέπεις - σβήνεις αυτή τη γραμμή.

  • 0
Posted

den mporw na to bale re otan pata ctrl+f  kai bazw if (character instanceof L2PcInstance)

den to briski etc den mporw na balw to code. geia afto zitaw help apo enan empiro dev

 

Den kaneis search tis grammes pou exoun +. Tha kaneis search autes pou den exoun oute + oute - gia na boreseis na baleis apo katw h parakatw tis grammes pou sou zitaei na prostheseis.

  • 0
Posted

Prospa8isa na to balw twra den 3erw ama einai swsto. as dei kapoios ama to ebala swsta einai to code apo katw

import org.w3c.dom.Node;

 

public class L2TownZone extends L2ZoneType

{

 

    public L2TownZone(int id)

    {

super(id);

        _taxById = 0;

        _spawnLocs = new FastList<int[]>();

        _redirectTownId = 9;

        _noPeace = false;

    }

    // just a method, for efficiency

    L2PcInstance activeChar = ((L2PcInstance)character);

   

    // PVP possible during siege, now for siege participants only

    // Could also check if this town is in siege, or if any siege is going on

 

    public void setParameter(String s, String s1)

    {

        if(s.equals("name"))

            _townName = s1;

        else

        if(s.equals("townId"))

            _townId = Integer.parseInt(s1);

        else

        if(s.equals("redirectTownId"))

            _redirectTownId = Integer.parseInt(s1);

        else

        if(s.equals("taxById"))

            _taxById = Integer.parseInt(s1);

        else

        if(s.equals("noPeace"))

            _noPeace = Boolean.parseBoolean(s1);

        else

            super.setParameter(s, s1);

    }

 

    public void setSpawnLocs(Node node)

    {

        int ai[] = new int[3];

        Node node1 = node.getAttributes().getNamedItem("X");

        if(node1 != null)

            ai[0] = Integer.parseInt(node1.getNodeValue());

        node1 = node.getAttributes().getNamedItem("Y");

        if(node1 != null)

            ai[1] = Integer.parseInt(node1.getNodeValue());

        node1 = node.getAttributes().getNamedItem("Z");

        if(node1 != null)

            ai[2] = Integer.parseInt(node1.getNodeValue());

        if(ai != null)

            _spawnLocs.add(ai);

    }

 

    protected void onEnter(L2Character l2character)

    {

        if((l2character instanceof L2PcInstance) && ((L2PcInstance)l2character).getSiegeState() != 0 && Config.ZONE_TOWN == 1)

        if (activeChar.getSiegeState() != 0 && Config.ZONE_TOWN == 1)

            return;

        if(!_noPeace && Config.ZONE_TOWN != 2)

            l2character.setInsideZone(2, true);

    }

    + if (activeChar.isDonator() && getTownId() == 7)

    {

    activeChar.sendMessage("Donators can't enter Gludio. You are now jailed.");

    activeChar.setInJail(true, 10);

    }

    else if (activeChar.isDonator() && getTownId() == 8)

    {

    activeChar.sendMessage("Donators can't enter Dion. You are now jailed.");

    activeChar.setInJail(true, 10);

    }

    else

    activeChar.sendMessage("You have entered a non-restricted area.");

    }

    protected void onExit(L2Character l2character)

    {

        if(!_noPeace)

            l2character.setInsideZone(2, false);

    }

 

    public void onDieInside(L2Character l2character)

    {

    }

 

    public void onReviveInside(L2Character l2character)

    {

    }

 

    public String getName()

    {

        return _townName;

    }

 

    public int getTownId()

    {

        return _townId;

    }

 

    public int getRedirectTownId()

    {

        return _redirectTownId;

    }

 

    public final int[] getSpawnLoc()

    {

        int ai[] = new int[3];

        ai = (int[])_spawnLocs.get(Rnd.get(_spawnLocs.size()));

        return ai;

    }

 

    public final int getTaxById()

    {

        return _taxById;

    }

 

    private String _townName;

    private int _townId;

    private int _redirectTownId;

    private int _taxById;

    private boolean _noPeace;

    private FastList<int[]> _spawnLocs;

}

 

Create an account or sign in to comment

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

Create an account

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

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Posts

    • Hello everyone,   A quick update from the Emerge team. The official launch of Emerge Eclipse x10 is just around the corner and we are currently finishing the final preparations to ensure a smooth and stable opening for all players. Our team has been working on performance improvements, network optimizations, and additional infrastructure to provide the best possible experience from day one.   🚀 Launch Date: 7 June 2026 🕕 Launch Time: 18:00 CET We would like to invite everyone to join our Discord community where all announcements, updates, events, and support information are posted first. 🌐 Website: https://l2emerge.com 💬 Discord: https://discord.gg/l2emerge Thank you for all the support and feedback during the preparation phase. We look forward to seeing both new and veteran Lineage II players on launch day. See you soon on Emerge!
    • Added an enchant NPC ( more infos on test server)     - remade autofarm system, more clever , more humanlike steps, catacomb mode in route farm and rewrite of route farming   - Updated Antibot to defend even more from more advanced adrenaline users ( not gonna write how 😂 )   - now dll of antibot will not be flagged from antivirus or defenders   - Updated some more the AI based Agent     Our discord https://discord.gg/acvqx9rbhy   L2R Off files / monthly subscription
    • Interlude will never be the same again. To celebrate our first 3 months online, L2 Detona proudly presents League of Lineage.   A brand-new game mode inspired by the world's biggest MOBAs, bringing lane battles, minions, towers, strategic objectives, and epic team fights into the world of Lineage 2. All of this while preserving the essence that made Interlude one of the most beloved chronicles in Lineage 2 history.   ⚔️ Destroy enemy towers. 🛡️ Defend your base. 👑 Lead your team to victory.   📅 Officially launching on June 12, 2026. 🔥 Jump into the action right now through System_Test and become one of the first players to experience League of Lineage. Server Rates XP: 500x SP: 500x Adena: 200x Server Features Full Official Interlude gameplay with custom modifications Exclusive MOBA Arena 3 Hour Buffs for comfortable gameplay No Class Change Quests Website: https://www.l2detona.com Images of project: https://imgur.com/a/Lajn9Ag
    • Remove google ads from site , will be perfect without this.. we do a vote and we get 2-3 google ads, its nervus. i just give feedback you do ofc what you want 🙂
  • Topics

×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and 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..