Jump to content
  • 0
Sign in to follow this  
l2jkain

Help TownManager aCis

Question

Hi, I'm adapting the Town Manager event for aCis. 

When I change this TownManager.getTown(Config.TW_TOWN_ID).setIsTWZone(true);

 

for 

ZoneManager.getInstance().getZoneById(i, TownZone.class).setIsTWZone(true);

 

generates the error

 

GSyA0X0.png

 

what did I do wrong ?

 

TownManager of jserver :

 

public static final L2TownZone getTown(int townId)
    {
        for (L2TownZone temp : ZoneManager.getInstance().getAllZones(L2TownZone.class))
        {
            if (temp.getTownId() == townId)
            {
                return temp;
            }
        }
        return null;
    }
    
    /**
     * Returns the town at that position (if any)
     * @param x
     * @param y
     * @param z
     * @return
     */
    public static final L2TownZone getTown(int x, int y, int z)
    {
        for (L2ZoneType temp : ZoneManager.getInstance().getZones(x, y, z))
        {
            if (temp instanceof L2TownZone)
            {
                return (L2TownZone) temp;
            }
        }
        return null;
    }

Share this post


Link to post
Share on other sites

6 answers to this question

Recommended Posts

  • 0
Posted (edited)
6 minutes ago, melron said:

TownWarManager:106

 

106 

 

this TownManager.getTown(Config.TW_TOWN_ID).setIsTWZone(true);

 

for 

ZoneManager.getInstance().getZoneById(i, TownZone.class).setIsTWZone(true);

Edited by l2jkain

Share this post


Link to post
Share on other sites
  • 0

what is 'i'? 

 

you could use a null check first...

final TownZone tempZone = ZoneManager.getInstance().getZoneById(i, TownZone.class);
if (tempZone != null)
	tempZone.setIsTWZone(true);
else
	System.out.println("Zone not found with id " + i);

 

Share this post


Link to post
Share on other sites
  • 0
12 minutes ago, melron said:

what is 'i'? 

 

you could use a null check first...


final TownZone tempZone = ZoneManager.getInstance().getZoneById(i, TownZone.class);
if (tempZone != null)
	tempZone.setIsTWZone(true);
else
	System.out.println("Zone not found with id " + i);

 

 


 

I created a check in ZoneManager for all town zones and it worked perfectly,

this should work.

ZoneManager.getInstance (). GetZoneById (i, TownZone.class) .setIsTWZone (true)

I created this in ZoneManager


public TownZone getTown (int townId)
{
for (TownZone temp: ZoneManager.getInstance (). getAllZones (TownZone.class))
{
if (temp.getTownId () == townId)
return temp;
}
return null;
}

 

   

Share this post


Link to post
Share on other sites

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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.



  • Posts

    • Hello, I'm looking for server which focus on developing Olympiad as a main entertainment while events / PvP spots etc are for getting better at it. Don't get me wrong, typical PvP servers aren't like this, because you have to choose either to balance PvP or Olympiad.   One time there was like I don't know maybe 10 years ago or more server called War of Races. Of course at that time it had many bugs but Olympiad was playful and very funny because it wasn't sure if you lose as a Dagger vs Glad as example. There was like that class beats that and that beats that but if you are skilled and you have good equipment you still have chance to kill class which normally would beat you.   I used to develop L2j server as a hobby to be similar like WoR but better by writing my own code (I used to earn for living as a Java developer) but usually was getting bored after some time and never finished any (overwhelmed by other things which should have been done to start a server - I just wanted to write code :D). I was starting and stopping projects few times, but every time from clean aCis package, because I had every time new idea. Even now I have my own mods for acis 372 revision made few months ago, but again I gave up. There is written like 30-40% features which I wanted (and there are many of them). This time a main goal was to make interlude server which is like IDLE games :). You quickly farm, exp and get items but you are MORTAL (you can add additional lives so you wouldn't have to create new char every death - death is defined so not every die means death) and when you die for ever (which means you have to create new char) you are getting progress in your SOUL - bonuses like increased enchant rate, increased BoG drop rate, increased skill enchantment rate, increased adena rate, increased HP/CP/MP, decreased skill CD, increased epic jewelry drop and many many more are assigned to account so each character have benefits from it. I added some extra features like blessed BoG (if skill enchantment fails it doesn't break), wyvern from item, random box giving items with chance, merchant for selling items++ or buying them (if someone sold) with tax etc. So to start a server I would finish these which are in progress and cut the others. I would include them later.   I guess there isn't server like this but maybe someone know something similar? I want to play for like few days to 1 week for fun and still be able to kill someone who played for long time - that's the goal for this server - for people like me who want to play for fun for few days and come back after few weeks. Even if server is staying for long time I want to have similar chance as others. The only difference would be that if someone is playing longer he can get full stuff in like 1-5 days after death and guy who just joined can do this in like 1 to 2 weeks and need to pay more attention for not being killed.   Are there any people interested in such an idea? Please vote so I can know if it is worth to waste time for developing such server (or maybe it is better to cut description and put it in other topic in other section with link for this topic?).   So who exactly I'm looking for? Well, lets turn roles - I'm not looking for someone. I don't mind if there won't be a person or people who might be looking for me. I'm here if you are looking for a developer (for aCis) or to be more precise a mate with who you want to open a server. However there are some rules which I want to obey.   1. The only thing I do is coding server mods and playing. Yes - playing. In order to have a good balanced server we need time and experience to do that. Of course I will balance it at the beginning as much as I can, but you can't have a really good balance unless you play and experience your mistakes by your own. I will play as a ordinary player. If you want to make a good community you have to be part of it rather than being above them. I know people always complain about hidden GMs who are playing on their own servers. So lets don't make it hidden. Usually they are childish by having better equ than others having fun with killing weaker players. Well, for me that's not fun. I'm having fun by improving things. I want to be transparent from beginning. I have more fun having equal fight rather than giving my self equipment, but I'm not giving a statement that I won't give my self an item, because in some situations I will have to do this to be sure about imbalance and fixing it.   2. We make server with my ideas. Of course I will listen to yours and if they are not against mine we can merge them. I'm not interested in developing java server. I'm interested in making my own ideas to come true. That's my hobby. I just want a playful server and making it more playful with a time.   Maybe I could describe it more but well, I hope this text will be enough to roughly understand the meaning. So your job would be the rest things to do. If you are interested write here and give me a PM.  
    • what about skype and emails that are also on sale?
    • Hello everyone,
      now you can download our stable configuration files for Freya client.
      These files are from stable version and our new not tested updates not included in this files.
        Download Configurations files for stable version - Freya - Click here for download ( not included configuration from beta (freya) mean new not tested updates )


      Have a nice day
      L2jPDT
  • Topics

×