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 (edited)

           

	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;
	            }
	           
Edited by Ayami-
  • 0
Posted (edited)

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

RequestRestartPoint.java
 
default:
if (Config.TOWN_REVIVE_ENABLED)loc = new Location(Config.LOCATIONX, Config.LOCATIONY, Config.LOCATIONZ);
else
loc = MapRegionTable.getInstance().getTeleToLocation(activeChar, MapRegionTable.TeleportWhereType.Town);
break;
 
Config.java
 
public static boolean TOWN_REVIVE_ENABLED;
public static int LOCATIONX;
public static int LOCATIONY;
public static int LOCATIONZ;
 
 
TOWN_REVIVE_ENABLED = Boolean.parseBoolean(Feature.getProperty("TownReviveEnabled", "False"));
LOCATIONX = Integer.parseInt(Feature.getProperty("LocationX", ""));
        LOCATIONY = Integer.parseInt(Feature.getProperty("LocationY", ""));
        LOCATIONZ = Integer.parseInt(Feature.getProperty("LocationZ", ""));
 
Feature.properties
 
#-----------------------------------------------------------------------------
# Custom Respawn After Die System
#-----------------------------------------------------------------------------
# Allow system respawn system to respawn the character in custom place?
TownReviveEnabled = True
# Put the location from character respawn ( TownReviveEnabled Must be True)
LocationX = 148972
 
LocationY = 172172
 
LocationZ = -955
 
 
 
 

 

    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;

                }

               

 

same but configurable

Edited by nikosdevil20
  • 0
Posted

i will test the nikosdevil one. but i need and one help more.. i took this java code http://www.maxcheaters.com/topic/139962-share-l2jquest-change-auto-equip-armors-weapons/ and i do all the classes but didnt work.. what need to change for l2jfrozen???

  • 0
Posted

sry for double post. but nothing from those 2 codes works.. :/ maybe i do something wrong..

Maybe? For sure.. There is no way it's not working. Set X, Y, Z compile and refresh the jar file. There were few ppl who did changes and they did not replace the jar, lol :D

  • 0
Posted (edited)

you got error or what? you have make this true? TownReviveEnabled = True

Yes. no errors or something at gameserver. the players press To Village and then teleport to nearest town.

 

sweets im not so stupid.. i have change all the jars. not only one :D all the lib i have change just to test it..

Edited by Nosti21
  • 0
Posted

im going to test the ayami's way. what about the absolutepower's code?? can anyone help? i put but didnt give me the items when i do the 3rd quest..

  • 0
Posted (edited)

Yes. no errors or something at gameserver. the players press To Village and then teleport to nearest town.

 

sweets im not so stupid.. i have change all the jars. not only one :D all the lib i have change just to test it..

it works on me. maybe you add the code at wrong place? because as i remember the same lines exist for sieges etc. what pack you use? 

 

 

in l2j freya thats the place of i have add the code and works:

 

 

case 5: // Fixed or Player is a festival participant
if (!activeChar.isGM() && !activeChar.isFestivalParticipant())
{
_log.warning("Player ["+activeChar.getName()+"] called RestartPointPacket - Fixed and he isn't festival participant!");
return;
}
instanceId = activeChar.getInstanceId();
loc = new Location(activeChar.getX(), activeChar.getY(), activeChar.getZ()); // spawn them where they died
break;
case 6: // TODO: agathion ress
break;
case 27: // to jail
if (!activeChar.isInJail()) return;
loc = new Location(-114356, -249645, -2984);
break;
default:
if (Config.TOWN_REVIVE_ENABLED)loc = new Location(Config.LOCATIONX, Config.LOCATIONY, Config.LOCATIONZ);
else
loc = MapRegionTable.getInstance().getTeleToLocation(activeChar, MapRegionTable.TeleportWhereType.Town);
break;
}
 
// Teleport and revive
activeChar.setInstanceId(instanceId);
activeChar.setIsIn7sDungeon(false);
activeChar.setIsPendingRevive(true);
activeChar.teleToLocation(loc, true);
noblesse.getEffects(activeChar, activeChar);
 
}
 
 
 
maybe that help you...
Edited by nikosdevil20
  • 0
Posted

ayami's work. but i want with config. because for me its a bit hard to go to java again and again to change it.. plus i want the 3rd quest code if possible :D

when you say 3rd quest what you exactly mean?

Guest
This topic is now closed to further replies.



  • Posts

    • Hey MaxCheaters! 👋 Introducing L2Soon.com — a free international platform for Lineage 2 server announcements.   Why L2Soon? No more searching through dozens of forums and Discord servers. All new L2 server openings are in one place — updated daily, with real player online counts so you always know where people actually play.   Features: 🔔 Telegram Bot (@l2Soon_bot) — alerts 24h & 1h before server launch 📅 Accurate launch times — in your local timezone ⚔️ All chronicles — Interlude, High Five, GoD, Classic, Essence, Grand Crusade and more 🎯 Filters — by chronicle, rates (x1–x1000+) and server type (PvP, RvR, GvE, Craft, Low Rate...) ⭐ VIP servers — verified projects pinned at the top 🌍 Multi-language — EN, UK, RU, PT   Listing is completely FREE. 🔗 https://l2soon.com/en Feedback welcome — drop a comment or contact us via Telegram @l2Soon_bot
    • Download Lobby u need island for lobby Download Crow Island  
    • Website: https://l2elixir.org/ Discord: https://discord.gg/5ydPHvhbxs    
    • L2-LORENA x100 MID RATE   Interlude Nostalgia Meets Modern Gameplay   OFFICIAL OPENING:  April 4 (Saturday)  19:00 UTC+1 ⸻  MAIN INFORMATION  Adena: x5  Drop: x10  Spoil: x10  Raid Boss: x10  Seal Stones: x2  Quests: x10 ⸻  FEATURES  GM Shop up to B-Grade  Full Buffer  Premium System (x2 bonuses)  AutoFarm – FREE for everyone ⸻  SERVER CONCEPT  Classic Interlude nostalgia  Enhanced with modern interface & mechanics  Balanced PvP & PvE gameplay  Active development & custom features ⸻  WHY JOIN L2-LORENA?  No Pay-to-Win  Smooth gameplay & stable server  Competitive PvP environment  Friendly & active community ⸻  JOIN US NOW L2-LORENA 100X <<< LINK Discord: https://discord.gg/TYZ88Tgx4b  Facebook: https://www.facebook.com/share/18kwbkaYZY/?mibextid=wwXIfr   L2-LORENA Link << Discord: https://discord.gg/TYZ88Tgx4b  Facebook: https://www.facebook.com/share/18kwbkaYZY/?mibextid=wwXIfr
  • 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..