Jump to content

Advanced Grand Boss Observation


Recommended Posts

I'm hardly on skype anymore, pm me your skype id tho, I forgot it.

 

Also one thing I noticed was you're using a lot of static variables inside your code. (all these 'static' declarations can and should be removed)

	private static final int _Baium = 29020;
private static final int _Antharas = 29068;
private static final int _Valakas = 29028;
private static final int _AntQueen = 29001;
private static final int npcid = 36650; // npc id
private static final boolean EnableObservation = true; // Set it true to allow players to observe raidbosses
private static final boolean EnableTeleport = true; // Set it true to allow players to teleport to raidbosses
private static final int ObservationAdena = 5000;  
private static String htm = "data/scripts/custom/RaidObserver/1.htm"; //html location

 

You only need to use static variables/methods when calling them from another class or instance . Like if you were trying to access methods or a variables like '_Baium' from a different class. It is highly recommended to not use static when not needed.

 

Let's say you had another java like this, and wanted to call things from 'RaidObserver' in RaidObserver2, you would use static variables/methods in RaidObserver and call them like this in RaidObserver2:

 

public class RaidObserver2 extends Quest
{
private final int _Baium2 = RaidObserver._Baium;


public RaidObserver2(int questId, String name, String descr)
{
}

 

If "_Baium" isn't static in RaidObserver.java then it would error, not being able to access/find it.

It's sorta like a "global" variable or method, static.

For a good explanation, one of the simplest I could find, read this. http://www.leepoint.net/notes-java/flow/methods/50static-methods.html

Link to comment
Share on other sites

I'm hardly on skype anymore, pm me your skype id tho, I forgot it.

 

Also one thing I noticed was you're using a lot of static variables inside your code. (all these 'static' declarations can and should be removed)

	private static final int _Baium = 29020;
private static final int _Antharas = 29068;
private static final int _Valakas = 29028;
private static final int _AntQueen = 29001;
private static final int npcid = 36650; // npc id
private static final boolean EnableObservation = true; // Set it true to allow players to observe raidbosses
private static final boolean EnableTeleport = true; // Set it true to allow players to teleport to raidbosses
private static final int ObservationAdena = 5000;  
private static String htm = "data/scripts/custom/RaidObserver/1.htm"; //html location

 

You only need to use static variables/methods when calling them from another class or instance . Like if you were trying to access methods or a variables like '_Baium' from a different class. It is highly recommended to not use static when not needed.

 

Let's say you had another java like this, and wanted to call things from 'RaidObserver' in RaidObserver2, you would use static variables/methods in RaidObserver and call them like this in RaidObserver2:

 

public class RaidObserver2 extends Quest
{
private final int _Baium2 = RaidObserver._Baium;


public RaidObserver2(int questId, String name, String descr)
{
}

 

If "_Baium" isn't static in RaidObserver.java then it would error, not being able to access/find it.

It's sorta like a "global" variable or method, static.

For a good explanation, one of the simplest I could find, read this. http://www.leepoint.net/notes-java/flow/methods/50static-methods.html

 

Thanks for the lesson Doug. However, this code could be done easier, without use so much methods. I did it like this, because i think that people can understand it more, than make them all in 1 method :P

So if ppl understand how the code works, they can add their own things.

 

Work 100%  thx for the share

 

Good job !

Thank you too

Link to comment
Share on other sites

  • 4 weeks later...

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now



×
×
  • Create New...