Jump to content
  • 0

Java Code To Village.


Question

Posted

Hello guys.. What i mean with Java Code to Village? I want a code that when i press to Village to teleport me to the main town and not to the nearest location..

 

if you didnt understand me tell me to explain it more.. thank kk bb qq

Recommended Posts

  • 0
Posted

http://pastebin.com/U4x09qs3what to change for frozen version?

Δοκίμασε να περάσεις μία μόνο αυτά..

Θα αρχίσεις από το 1ο "+" μέχρι το τελευταίο. Τα υπόλοιπα είναι για να κάνεις search που να τα βάλεις.

 

L2PcInstance.java

 

    /**
     * Create a new SkillDat object and set the player _currentPetSkill.<br>
     * <br>
     * @param currentSkill
     * @param ctrlPressed
     * @param shiftPressed
     */
+   
    @SuppressWarnings("javadoc")
    public void giveItems(boolean dagger,boolean sagi,boolean mage,boolean duelist,boolean tit,boolean nixas,boolean paladin,boolean FSeeker,boolean dreadnought,boolean HellKnight,boolean swordMuse,boolean dancer)
    {
            final int[] armorIdDagger = {6590,6379,6380,6381,6382,920,858,858,889,889};
            final int[] armorIdSagi = {7577,6379,6380,6381,6382,920,858,858,889,889};
            final int[] armorIdMage = {6608,2407,5767,5779,512,920,858,858,889,889};       
            final int[] armorIdDuelist = {6580,6373,6374,6375,6376,6378,920,858,858,889,889};
            final int[] armorIdTit = {6605,6373,6374,6375,6376,6378,920,858,858,889,889};
            final int[] armorIdNixas = {6604,6379,6380,6381,6382,920,858,858,889,889};
            final int[] armorIdPaladin = {6581,6373,6374,6375,6376,6377,6378,920,858,858,889,889};
            final int[] armorIdFSeeker = {6585,6373,6374,6375,6376,6377,6378,920,858,858,889,889};
            final int[] armorIddreadnought = {6601,6373,6374,6375,6376,6378,920,858,858,889,889};  
            final int[] armorIdhellKnight = {6581,6373,6374,6375,6376,6377,6378,920,858,858,889,889};      
            final int[] armorIdswordMuse = {6581,6379,6380,6381,6382,920,858,858,889,889,6377};                    
            final int[] armorIdDancer = {6580,6379,6380,6381,6382,920,858,858,889,889};

            if(dagger)
            {
            if (armorIdDagger.length == 0)
                    return;
            L2ItemInstance items = null;
            for (int id : armorIdDagger)
            {              
                    getInventory().addItem("Armors", id, 1, this, null);           
                    items = getInventory().getItemByItemId(id);
                    items.updateDatabase();
                    getInventory().equipItemAndRecord(items);
                    getInventory().reloadEquippedItems();  
            this.broadcastCharInfo();
            this.sendPacket(new InventoryUpdate());
            this.sendPacket(new ItemList(this, false));
            this.sendPacket(new StatusUpdate(this));
            }
            }
            else if(sagi)
            {
                    if (armorIdSagi.length == 0)
                            return;
                    L2ItemInstance items = null;
                    for (int id : armorIdSagi)
                    {
                            getInventory().addItem("Armors", id, 1, this, null);           
                            items = getInventory().getItemByItemId(id);
                            items.updateDatabase();
                            getInventory().equipItemAndRecord(items);
                            getInventory().reloadEquippedItems();  
                    this.broadcastCharInfo();
                    this.sendPacket(new InventoryUpdate());
                    this.sendPacket(new ItemList(this, false));
                    this.sendPacket(new StatusUpdate(this));
                    }
            }
            else if(mage)
                    {
                            if (armorIdMage.length == 0)
                                    return;
                            L2ItemInstance items = null;
                            for (int id : armorIdMage)
                            {
                                    getInventory().addItem("Armors", id, 1, this, null);           
                                    items = getInventory().getItemByItemId(id);
                                    items.updateDatabase();
                                    getInventory().equipItemAndRecord(items);
                                    getInventory().reloadEquippedItems();  
                            this.broadcastCharInfo();
                            this.sendPacket(new InventoryUpdate());
                            this.sendPacket(new ItemList(this, false));
                            this.sendPacket(new StatusUpdate(this));                                       
                            }
                    }
            else if(duelist)
                            {
                                    if (armorIdDuelist.length == 0)
                                            return;
                                    L2ItemInstance items = null;
                                    for (int id : armorIdDuelist)
                                    {
                                            getInventory().addItem("Armors", id, 1, this, null);           
                                            items = getInventory().getItemByItemId(id);
                                            items.updateDatabase();
                                            getInventory().equipItemAndRecord(items);
                                            getInventory().reloadEquippedItems();  
                                    this.broadcastCharInfo();
                                    this.sendPacket(new InventoryUpdate());
                                    this.sendPacket(new ItemList(this, false));
                                    this.sendPacket(new StatusUpdate(this));       
                                    }
                            }
            else if(tit)
                                    {
                                            if (armorIdTit.length == 0)
                                                    return;
                                            L2ItemInstance items = null;
                                            for (int id : armorIdTit)
                                            {
                                                    getInventory().addItem("Armors", id, 1, this, null);           
                                                    items = getInventory().getItemByItemId(id);
                                                    items.updateDatabase();
                                                    getInventory().equipItemAndRecord(items);
                                                    getInventory().reloadEquippedItems();  
                                            this.broadcastCharInfo();
                                            this.sendPacket(new InventoryUpdate());
                                            this.sendPacket(new ItemList(this, false));
                                            this.sendPacket(new StatusUpdate(this));                                       
                                            }
                                    }
            else if(nixas)
                                            {
                                                    if (armorIdNixas.length == 0)
                                                            return;
                                                    L2ItemInstance items = null;
                                                    for (int id : armorIdNixas)
                                                    {
                                                            getInventory().addItem("Armors", id, 1, this, null);           
                                                            items = getInventory().getItemByItemId(id);
                                                            items.updateDatabase();
                                                            getInventory().equipItemAndRecord(items);
                                                            getInventory().reloadEquippedItems();  
                                                    this.broadcastCharInfo();
                                                    this.sendPacket(new InventoryUpdate());
                                                    this.sendPacket(new ItemList(this, false));
                                                    this.sendPacket(new StatusUpdate(this));
                                                    }
                                            }
            else if(paladin)
                                                    {
                                                            if (armorIdPaladin.length == 0)
                                                                    return;
                                                            L2ItemInstance items = null;
                                                            for (int id : armorIdPaladin)
                                                            {
                                                                    getInventory().addItem("Armors", id, 1, this, null);           
                                                                    items = getInventory().getItemByItemId(id);
                                                                    items.updateDatabase();
                                                                    getInventory().equipItemAndRecord(items);
                                                                    getInventory().reloadEquippedItems();  
                                                            this.broadcastCharInfo();
                                                            this.sendPacket(new InventoryUpdate());
                                                            this.sendPacket(new ItemList(this, false));
                                                            this.sendPacket(new StatusUpdate(this));
                                                            }                                                      
                                            }
            else if(FSeeker)
            {
                    if (armorIdFSeeker.length == 0)
                            return;
                    L2ItemInstance items = null;
                    for (int id : armorIdFSeeker)
                    {
                            getInventory().addItem("Armors", id, 1, this, null);           
                            items = getInventory().getItemByItemId(id);
                            items.updateDatabase();
                            getInventory().equipItemAndRecord(items);
                            getInventory().reloadEquippedItems();  
                    this.broadcastCharInfo();
                    this.sendPacket(new InventoryUpdate());
                    this.sendPacket(new ItemList(this, false));
                    this.sendPacket(new StatusUpdate(this));
                    }                                                      
    }
            else if(dreadnought)
            {
                    if (armorIddreadnought.length == 0)
                            return;
                    L2ItemInstance items = null;
                    for (int id : armorIddreadnought)
                    {
                            getInventory().addItem("Armors", id, 1, this, null);           
                            items = getInventory().getItemByItemId(id);
                            items.updateDatabase();
                            getInventory().equipItemAndRecord(items);
                            getInventory().reloadEquippedItems();  
                    this.broadcastCharInfo();
                    this.sendPacket(new InventoryUpdate());
                    this.sendPacket(new ItemList(this, false));
                    this.sendPacket(new StatusUpdate(this));
                    }
    }
            else if(HellKnight)
            {
                    if (armorIdhellKnight.length == 0)
                            return;
                    L2ItemInstance items = null;
                    for (int id : armorIdhellKnight)
                    {
                            getInventory().addItem("Armors", id, 1, this, null);           
                            items = getInventory().getItemByItemId(id);
                            items.updateDatabase();
                            getInventory().equipItemAndRecord(items);
                            getInventory().reloadEquippedItems();  
                    this.broadcastCharInfo();
                    this.sendPacket(new InventoryUpdate());
                    this.sendPacket(new ItemList(this, false));
                    this.sendPacket(new StatusUpdate(this));
                    }
    }
            else if(swordMuse)
            {
            if (armorIdswordMuse.length == 0)
                    return;
            L2ItemInstance items = null;
            for (int id : armorIdswordMuse)
            {              
                    getInventory().addItem("Armors", id, 1, this, null);           
                    items = getInventory().getItemByItemId(id);
                    items.updateDatabase();
                    getInventory().equipItemAndRecord(items);
                    getInventory().reloadEquippedItems();  
            this.broadcastCharInfo();
            this.sendPacket(new InventoryUpdate());
            this.sendPacket(new ItemList(this, false));
            this.sendPacket(new StatusUpdate(this));
            }
            }
            else if(dancer)
            {
            if (armorIdDancer.length == 0)
                    return;
            L2ItemInstance items = null;
            for (int id : armorIdDancer)
            {              
                    getInventory().addItem("Armors", id, 1, this, null);           
                    items = getInventory().getItemByItemId(id);
                    items.updateDatabase();
                    getInventory().equipItemAndRecord(items);
                    getInventory().reloadEquippedItems();  
            this.broadcastCharInfo();
            this.sendPacket(new InventoryUpdate());
            this.sendPacket(new ItemList(this, false));
            this.sendPacket(new StatusUpdate(this));
            }
            }
}
    
    
    /**
     *
     */
    private void broadcastCharInfo()
    {        
+    }
    public void setCurrentPetSkill(final L2Skill currentSkill, final boolean ctrlPressed, final boolean shiftPressed)

 

 

Και εδώ το ίδιο... από το πρώτο "+".

 

L2ClassMasterInstance.java

 

    /** The _instance. */
    private static L2ClassMasterInstance _instance;
+    private int newJobLevel;
 
            player.setBaseClass(classId);
            
+            if(newJobLevel == 3  && !player.isSubClassActive())
+                autoEquip(player);
            
            // player.setBaseClass(player.getActiveClass());
 
 
        html.setHtml(sb.toString());
        player.sendPacket(html);
        html = null;
        sb = null;
        return;
    }
+
    private static void autoEquip(final L2PcInstance player)
    {
            final ClassId HDagger =ClassId.adventurer;
            final ClassId Sagi =ClassId.sagittarius;
            final ClassId Duelist =ClassId.duelist;
            final ClassId Tit =ClassId.titan;
            final ClassId Nixas =ClassId.grandKhauatari;
            final ClassId Paladin =ClassId.phoenixKnight;
            final ClassId MSentinel =ClassId.moonlightSentinel;
            final ClassId FSeeker =ClassId.fortuneSeeker;
            final ClassId Maestro =ClassId.maestro;
            final ClassId dreadnought =ClassId.dreadnought;
            final ClassId hellKnight =ClassId.hellKnight;
            final ClassId evaTemplar =ClassId.evaTemplar;
            final ClassId swordMuse =ClassId.swordMuse;
            final ClassId windRider =ClassId.windRider;
            final ClassId shillienTemplar =ClassId.shillienTemplar;
            final ClassId spectralDancer =ClassId.spectralDancer;
            final ClassId ghostHunter =ClassId.ghostHunter;
            final ClassId ghostSentinel =ClassId.ghostSentinel;
           
            if(player.getClassId().equals(HDagger))
                    player.giveItems(true,false,false,false,false,false,false,false,false,false,false,false);
                   
            else if(player.getClassId().equals(Sagi))
                    player.giveItems(false,true,false,false,false,false,false,false,false,false,false,false);
                   
            else if(player.getClassId().isMage())
                    player.giveItems(false,false,true,false,false,false,false,false,false,false,false,false);
           
            else if(player.getClassId().equals(Duelist))
                    player.giveItems(false,false,false,true,false,false,false,false,false,false,false,false);
           
            else if(player.getClassId().equals(Tit))
                    player.giveItems(false,false,false,false,true,false,false,false,false,false,false,false);
           
            else if(player.getClassId().equals(Nixas))
                    player.giveItems(false,false,false,false,false,true,false,false,false,false,false,false);
           
            else if(player.getClassId().equals(Paladin))
                    player.giveItems(false,false,false,false,false,false,true,false,false,false,false,false);
           
            else if(player.getClassId().equals(MSentinel))
                    player.giveItems(false,true,false,false,false,false,false,false,false,false,false,false);
           
            else if(player.getClassId().equals(FSeeker))
                    player.giveItems(false,false,false,false,false,false,false,true,false,false,false,false);
           
            else if(player.getClassId().equals(Maestro))
                    player.giveItems(false,false,false,false,false,false,false,true,false,false,false,false);
           
            else if(player.getClassId().equals(dreadnought))
                    player.giveItems(false,false,false,false,false,false,false,false,true,false,false,false);
           
            else if(player.getClassId().equals(hellKnight))
                    player.giveItems(false,false,false,false,false,false,false,false,false,true,false,false);
           
            else if(player.getClassId().equals(evaTemplar))
                    player.giveItems(false,false,false,false,false,false,false,false,false,true,false,false);
           
            else if(player.getClassId().equals(swordMuse))                 
                    player.giveItems(false,false,false,false,false,false,false,false,false,false,true,false);
           
            else if(player.getClassId().equals(windRider))                 
                    player.giveItems(true,false,false,false,false,false,false,false,false,false,false,false);
           
            else if(player.getClassId().equals(shillienTemplar))
                    player.giveItems(false,false,false,false,false,false,false,true,false,false,false,false);
                           
            else if(player.getClassId().equals(spectralDancer))
                    player.giveItems(false,false,false,false,false,false,false,false,false,false,false,true);
           
            else if(player.getClassId().equals(ghostHunter))
                    player.giveItems(true,false,false,false,false,false,false,false,false,false,false,false);
           
            else if(player.getClassId().equals(ghostSentinel))
                    player.giveItems(false,true,false,false,false,false,false,false,false,false,false,false);
           
+    }
  • 0
Posted

No..

 

 

 

    Index: java/com/l2jserver/gameserver/network/clientpackets/RequestRestartPoint.java

    ===================================================================

    --- java/com/l2jserver/gameserver/network/clientpackets/RequestRestartPoint.java    (revision 4422)

    +++ java/com/l2jserver/gameserver/network/clientpackets/RequestRestartPoint.java    (working copy)

    @@ -178,7 +178,8 @@

                        break;

                       

                    default:

    -                   loc = MapRegionTable.getInstance().getTeleToLocation(activeChar, MapRegionTable.TeleportWhereType.Town);

    +                   loc = new Location(X, Y, Z);

                        break;

                }

               

 

  • 0
Posted (edited)

thats the problem now at eclipse.. what can i do?? need at L2PcInstance a method. but how to do it??

You added it in the wrong place, no need at L2PcInstance, just scroll down and add this method.

 

P.S. autoequip code is really hardcoded.

P.S.S. If you use autoequip in this class, delete static.

Edited by numl0ckas
  • 0
Posted (edited)

You added it in the wrong place, no need at L2PcInstance, just scroll down and add this method.

 

P.S. autoequip code is really hardcoded.

P.S.S. If you use autoequip in this class, delete static.

what you mean?? can you explain me more??

 

+ ayami's code for the To Village button didnt work.. anyone gives me an idea??

Edited by Nosti21
  • 0
Posted (edited)

what you mean?? can you explain me more??

 

+ ayami's code for the To Village button didnt work.. anyone gives me an idea??

You have give a try in the code i give you before? ( the second post on page 2).

 

 

give a try here

 

RequestRestartPoint.Java


default:
if (activeChar.getKarma() > 0 && Config.ALT_KARMA_TELEPORT_TO_FLORAN)
            {
             loc = new Location(17836, 170178, -3507);// Floran Village
             break;
            }
-      loc = MapRegionTable.getInstance().getTeleToLocation(activeChar, MapRegionTable.TeleportWhereType.Town);
-      break;
-    }
+            loc = new Location(Config.LOCX, Config.LOCY, Config.LOCZ);// Respawn Village          
+            break;
+          }

Config.java

public static boolean NEW_PLAYER_EFFECT;
+
+// Custom respawn after die.
+public static int LOCX;
+public static int LOCY;
+public static int LOCZ;
 
 
NEW_PLAYER_EFFECT = Boolean.parseBoolean(frozenSettings.getProperty("NewPlayerEffect", "True"));
+ 
+   // Custom respawn after die
+   LOCX = Integer.parseInt(frozenSettings.getProperty("LocationX", "put a loc here"));
+   LOCY = Integer.parseInt(frozenSettings.getProperty("LocationY", "put a loc here"));
+   LOCZ = Integer.parseInt(frozenSettings.getProperty("LocationZ", "put a loc here"));

frozen.properties

# New players get fireworks the first time they log in
# Default: False
NewPlayerEffect = False
+
+ # Custom respawn for dead players
+ LocationX = put a loc here
+ LocationY = put a loc here
+ LocationZ = put a loc here
Edited by 'Baggos'
  • 0
Posted

 

You have give a try in the code i give you before? ( the second post on page 2).

 

 

give a try here

 

RequestRestartPoint.Java

- default:
-      if (activeChar.getKarma() > 0 && Config.ALT_KARMA_TELEPORT_TO_FLORAN)
-      {
-       loc = new Location(17836, 170178, -3507);// Floran Village
-       break;
-      }
-      loc = MapRegionTable.getInstance().getTeleToLocation(activeChar, MapRegionTable.TeleportWhereType.Town);
-      break;
-    }
 
+ default:
+      if (activeChar.getKarma() > 0 && Config.ALT_KARMA_TELEPORT_TO_FLORAN && Config.CUSTOM_RESPAWN)
+      {
+       loc = new Location(17836, 170178, -3507);// Floran Village
+       loc = new Location(Config.LOCX, Config.LOCY, Config.LOCZ);// Respawn Village
+       break;
+      }
+    }

Config.java

public static boolean NEW_PLAYER_EFFECT;
+
+// Custom respawn after death.
+public static boolean CUSTOM_RESPAWN;
+public static int LOCX;
+public static int LOCY;
+public static int LOCZ;
 
 
NEW_PLAYER_EFFECT = Boolean.parseBoolean(frozenSettings.getProperty("NewPlayerEffect", "True"));
+ 
+   // Custom respawn after dead
+   CUSTOM_RESPAWN = Boolean.parseBoolean(frozenSettings.getProperty("CustomRespawnEnable", "True"));
+   LOCX = Integer.parseInt(frozenSettings.getProperty("LocationX", "put a loc here"));
+   LOCY = Integer.parseInt(frozenSettings.getProperty("LocationY", "put a loc here"));
+   LOCZ = Integer.parseInt(frozenSettings.getProperty("LocationZ", "put a loc here"));

 

 

That will work with Karma Baggos ... -.-

  • 0
Posted

That will work with Karma Baggos ... -.-

oh yes.. you have right... where is my mind...

 

then i hope with this

 

default:

      if (activeChar.getKarma() > 0 && Config.ALT_KARMA_TELEPORT_TO_FLORAN)

      {

       loc = new Location(17836, 170178, -3507);// Floran Village

      }

+    

+      if (Config.CUSTOM_RESPAWN)

+       loc = new Location(Config.LOCX, Config.LOCY, Config.LOCZ);// Respawn Village

+       break;

+      }

 

or just like that. (without to put Enable config).

 

default:

      if (activeChar.getKarma() > 0 && Config.ALT_KARMA_TELEPORT_TO_FLORAN)

      {

       loc = new Location(17836, 170178, -3507);// Floran Village

+     loc = new Location(Config.LOCX, Config.LOCY, Config.LOCZ);// Respawn Village

      }

  • 0
Posted

oh yes.. you have right... where is my mind...

 

then i hope with this

 

default:

      if (activeChar.getKarma() > 0 && Config.ALT_KARMA_TELEPORT_TO_FLORAN)

      {

       loc = new Location(17836, 170178, -3507);// Floran Village

      }

+    

+      if (Config.CUSTOM_RESPAWN)

+       loc = new Location(Config.LOCX, Config.LOCY, Config.LOCZ);// Respawn Village

+       break;

+      }

 

or just like that. (without to put Enable config).

 

default:

      if (activeChar.getKarma() > 0 && Config.ALT_KARMA_TELEPORT_TO_FLORAN)

      {

       loc = new Location(17836, 170178, -3507);// Floran Village

+     loc = new Location(Config.LOCX, Config.LOCY, Config.LOCZ);// Respawn Village

      }

Just stop and read the code...

  • 0
Posted (edited)

Just stop and read the code...

 

Yeah Baggos... you do the same mistake again :P

And if you want to make it with config..

if (activeChar.getKarma() > 0 && Config.ALT_KARMA_TELEPORT_TO_FLORAN)
{
loc = new Location(17836, 170178, -3507);// Floran Village
break;
}
+ if(Config.CUSTOM_RESPAWN)
+ {
+ loc = new Location(Config.RESPAWN_X, Config.RESPAWN_Y, Config.RESPAWN_Z);
+ }
loc = MapRegionTable.getInstance().getTeleToLocation(activeChar, MapRegionTable.TeleportWhereType.Town);
break;	

/For Topic...

 

http://www.maxcheaters.com/topic/180110-respawn-location-after-death/?hl=respawn

Edited by activeChar.getAdena()
  • 0
Posted

Just stop and read the code...

Tessa if you look over, the 've changed.

i typed two times the same mistake, making copy/paste from the old.

 

default:

      if (activeChar.getKarma() > 0 && Config.ALT_KARMA_TELEPORT_TO_FLORAN)

      {

       loc = new Location(17836, 170178, -3507);// Floran Village

       break;

      }

-      loc = MapRegionTable.getInstance().getTeleToLocation(activeChar, MapRegionTable.TeleportWhereType.Town);

+       loc = new Location(Config.LOCX, Config.LOCY, Config.LOCZ);// Respawn Village After Die

      break;

    }

Guest
This topic is now closed to further replies.



×
×
  • Create New...