Jump to content

Zodiac Event Engine


Boorinio

Recommended Posts

Anyone Can help me to fix this issue?

 

Error:

workspace\trunk\gameserver\head-src\com\l2jfrozen\gameserver\model\entity\event\ZodiacMain.java:93: error: cannot find symbol
    [javac] 	    TextBuilder tb = new TextBuilder("");
    [javac] 	                         ^
    [javac]   symbol:   class TextBuilder
    [javac]   location: class ZodiacMain

 

All ZodiacMain.java Code:

 

package com.l2jfrozen.gameserver.model.entity.event;


import java.io.File;
import java.util.ArrayList;
import java.util.List;

import com.l2jfrozen.Config;
import com.l2jfrozen.gameserver.model.entity.Announcements;
import com.l2jfrozen.gameserver.thread.ThreadPoolManager;
import com.l2jfrozen.gameserver.model.L2World;
import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
import com.l2jfrozen.gameserver.network.serverpackets.NpcHtmlMessage;

/**
* @author Boorinio
*/
public class ZodiacMain
{
public static List<String> Ips = new ArrayList<String>();
public static boolean ZodiacRegisterActive;
public static int i, max;
public static int[] count =
{
0, 0, 0, 0
};
public static boolean voting;

public static void ZodiacIn()
{
	ThreadPoolManager.getInstance().scheduleGeneral(new Runnable()
	{
		@Override
		public void run()
		{
			startVoting();
		}
	}, 60 * 1000 * Config.INITIAL_START);
}

public static void startVoting()
{
	voting = true;
	for (L2PcInstance players : L2World.getInstance().getAllPlayers())
	{	
		showHtmlWindow(players);
	}
	Announcements.getInstance().announceToAll("You have 2 minutes to vote for the event you like!");
	waitSecs(60);
	Announcements.getInstance().announceToAll("You have 1 minute to vote for the event you like!");
	waitSecs(60);
	voting = false;
	endit();

}

public static void showHtmlWindow(L2PcInstance activeChar)
{
    NpcHtmlMessage nhm = new NpcHtmlMessage(5);
    TextBuilder tb = new TextBuilder("");
    
    tb.append("<html><head><title>Zodiac Event Voting</title></head><body>");
    tb.append("<center>");
    tb.append("<td valign=\"top\"><font color=\"FF6600\">Vote for the event you want to play!</font>");
    tb.append("<br>");
    tb.append("<img src=\"SSQ_dungeon_T.SSQ_fire1_e013\" width=256 height=64>");
    tb.append("<br1>");
    tb.append("<img src=\"L2UI.SquareWhite\" width=194 height=1>");
    tb.append("<table bgcolor=333333 width=204>");
    tb.append("<tr>");
    tb.append("<td><center><button value=\"CaptureThem\" action=\"bypass -h CaptureThem\" width=75 height=21 back=\"L2UI_ch3.Btn1_normalOn\" fore=\"L2UI_ch3.Btn1_normal\"></center></td>");
    tb.append("</tr>");
    tb.append("	<tr>");
    tb.append("<td><center><button value=\"Peloponnesian\" action=\"bypass -h PeloponnesianWar\" width=75 height=21 back=\"L2UI_ch3.Btn1_normalOn\" fore=\"L2UI_ch3.Btn1_normal\"></center></td>");
    tb.append("</tr>");
    tb.append("<tr>");
    tb.append("<td><center><button value=\"CastleWars\" action=\"bypass -h CastleWars\" width=75 height=21 back=\"L2UI_ch3.Btn1_normalOn\" fore=\"L2UI_ch3.Btn1_normal\"></center></td>");
    tb.append("</tr>");
    tb.append("<tr>");
    tb.append("<td><center><button value=\"ProtectTheLdr\" action=\"bypass -h ProtectTheLdr\" width=75 height=21 back=\"L2UI_ch3.Btn1_normalOn\" fore=\"L2UI_ch3.Btn1_normal\"></center></td>");
    tb.append("</tr>");
    tb.append("</table>");
    tb.append("<font color=\"FF6600\">By Boorinio!</font>");
    tb.append("</center>");
    tb.append("</body></html>");
    nhm.setHtml(tb.toString());
    activeChar.sendPacket(nhm);
}
public static void showFinalWindow(L2PcInstance player)
  {

    NpcHtmlMessage nhm = new NpcHtmlMessage(5);
    TextBuilder tb = new TextBuilder("");
    
    tb.append("<html><title>Zodiac Event Engine</title><body>Current Votes:<br>");
    tb.append("Current Votes:<br><br>");
    tb.append("Peloponnesian War: "+count[0]+"<br>");
    tb.append("Capture Them: "+count[1]+"<br>");
    tb.append("Castle Wars: "+count[2]+"<br>");
    tb.append("Protect The Leader: "+count[3]+"<br><br>");
    tb.append("</body></html>");
    nhm.setHtml(tb.toString());
    player.sendPacket(nhm);
  }

public static void endit()
{
	max = 0;
	for (i = 0; i < 4; i++)
	{
		if (count[i] > max)
			max = i;
	}
	if (max == 0)
	{
		Announcements.getInstance().announceToAll("Peloponnesian Event has the most votes!");
		Announcements.getInstance().announceToAll("In 10 seconds the registration will open!");
		waitSecs(10);
		PeloponnesianWar.startevent();
	}
	else if (max == 1)
	{
		Announcements.getInstance().announceToAll("CaptureThem Event has the most votes!");
		Announcements.getInstance().announceToAll("In 10 seconds the registration will open!");
		waitSecs(10);
		CaptureThem.openRegistration();
	}
	else if (max == 2)
	{
		Announcements.getInstance().announceToAll("CastleWars Event has the most votes!");
		Announcements.getInstance().announceToAll("In 10 seconds the registration will open!");
		waitSecs(10);
		CastleWars.openRegi();
	}
	else if (max == 3)
	{
		Announcements.getInstance().announceToAll("ProtectTheLeader Event has the most votes!");
		Announcements.getInstance().announceToAll("In 10 seconds the registration will open!");
		waitSecs(10);
		ProtectTheLdr.startevent();
	}
	else
	{
		Announcements.getInstance().announceToAll("No votes event canceled!");
	}
	max = 0;
	for (i = 0; i < 4; i++)
	{
		count[i] = 0;
	}
	waitSecs(Config.BETWEEN_EVENTS * 60);
	startVoting();
}

public static boolean isEligible(L2PcInstance player, String ip)
{

	if (player.isinZodiac)
	{
		player.sendMessage("You are Already in Zodiac");
		return false;
	}
	if (!ZodiacRegisterActive)
	{
		player.sendMessage("Zodiac's Registrations are offline!");
		return false;
	}
	if (player.getLevel() < 76)
	{
		player.sendMessage("You are lower than 76 lvl");
		return false;
	}
	if (player.isInJail())
	{
		player.sendMessage("You are in jail...daah");
		return false;
	}
	if (player.isInOlympiadMode())
	{
		player.sendMessage("You are in olympiad mode");
		return false;
	}
	if (hasbots(ip) && Config.SAME_IP_ZODIAC)
	{
		player.sendMessage("You have already joinned with that ip");
		return false;
	}
	return true;
}

public static void waitSecs(int i)
{
	try
	{
		Thread.sleep(i * 1000);
	}
	catch (InterruptedException ie)
	{
		ie.printStackTrace();
	}
}

public static boolean hasbots(String ip)
{
	if (Ips.contains(ip))
	{
		return true;
	}
	else
		return false;
}

}

Link to comment
Share on other sites

@hvp17:

 

You make it wrong. What you have to do:

 

package com.l2jfrozen.gameserver.model.entity.event;

 

 

-import java.io.File; --- DELETE

import java.util.ArrayList;

import java.util.List;

 

+import javolution.text.TextBuilder; --- ADD

 

import com.l2jfrozen.Config;

import com.l2jfrozen.gameserver.model.entity.Announcements;

import com.l2jfrozen.gameserver.thread.ThreadPoolManager;

import com.l2jfrozen.gameserver.model.L2World;

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

import com.l2jfrozen.gameserver.network.serverpackets.NpcHtmlMessage;

Link to comment
Share on other sites

@hvp17:

 

You make it wrong. What you have to do:

 

package com.l2jfrozen.gameserver.model.entity.event;

 

 

-import java.io.File; --- DELETE

import java.util.ArrayList;

import java.util.List;

 

+import javolution.text.TextBuilder; --- ADD

 

import com.l2jfrozen.Config;

import com.l2jfrozen.gameserver.model.entity.Announcements;

import com.l2jfrozen.gameserver.thread.ThreadPoolManager;

import com.l2jfrozen.gameserver.model.L2World;

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

import com.l2jfrozen.gameserver.network.serverpackets.NpcHtmlMessage;

correct

 

Any other events will be added to this engine?

 

P.S. In V4 should be a config to set up how much time to give to register for event. ;)

Yeah there are 2 more interesting events coming though are difficult to code so it might take some time and yeah i will probably add this config

Link to comment
Share on other sites

@Boorinio

 

Anyway there is a bug in Peloponessian wars:

 

When Teams are ported in Arenas or Leaders of both teams are teleported in FinalMatch - it wait 30sec (then chekwhowon is started) - and Checkwhowon Make the both sides Winners and all get the reward - it dont wait untill one char dies in finalmatch and it donw wait untill ppl die in arenas.

 

- I expect problem in checkwhowon method.

- Probably you have forgotten for making some method in L2PCinstance that end death ppl from event.[

 

- Tested in L2jfrozen pack/i]

 

 

Suggestions:

 

Please check the color fix - when event quit you use setColorName. It could make a trouble in case of many high rates who use PVP color system ;)

Also it could be good to make in all events smth like: IF registred _player count = NULL dont start event.

 

I dont wanna be detailist :-)

Link to comment
Share on other sites

@Boorinio

 

Anyway there is a bug in Peloponessian wars:

 

When Teams are ported in Arenas or Leaders of both teams are teleported in FinalMatch - it wait 30sec (then chekwhowon is started) - and Checkwhowon Make the both sides Winners and all get the reward - it dont wait untill one char dies in finalmatch and it donw wait untill ppl die in arenas.

 

- I expect problem in checkwhowon method.

- Probably you have forgotten for making some method in L2PCinstance that end death ppl from event.[

 

- Tested in L2jfrozen pack/i]

 

 

Suggestions:

 

Please check the color fix - when event quit you use setColorName. It could make a trouble in case of many high rates who use PVP color system ;)

Also it could be good to make in all events smth like: IF registred _player count = NULL dont start event.

 

I dont wanna be detailist :-)

No you are right most of them will be done i just need some time to do it :P

Link to comment
Share on other sites

No problem ;-) I will try to help you in free time.

 

In CaptureThem event:

 

In this event you are in Coliseum and all gates are closed - when player dies he is respawned in "pre-room" that is closed so he cant join fights again - his game is over for that moment.

 

In this case i sugestose to edit:

 

public static void StartEvent()

        {

DoorTable.getInstance().getDoor(24190001).closeMe();

DoorTable.getInstance().getDoor(24190002).closeMe(); --> DoorTable.getInstance().getDoor(24190002).openMe();

DoorTable.getInstance().getDoor(24190003).closeMe(); --> DoorTable.getInstance().getDoor(24190003).openMe();

DoorTable.getInstance().getDoor(24190004).closeMe();

 

Or even delete:

public static void StartEvent()

        {

DoorTable.getInstance().getDoor(24190001).closeMe();

- DoorTable.getInstance().getDoor(24190002).closeMe();

- DoorTable.getInstance().getDoor(24190003).closeMe();

DoorTable.getInstance().getDoor(24190004).closeMe();

 

                    flags.deleteMe();

             

            }

DoorTable.getInstance().getDoor(24190001).openMe();

- DoorTable.getInstance().getDoor(24190001).openMe();

- DoorTable.getInstance().getDoor(24190002).openMe();

DoorTable.getInstance().getDoor(24190004).openMe();

 

 

So death players will be able to join the fight after death again.

Link to comment
Share on other sites

No problem ;-) I will try to help you in free time.

 

In CaptureThem event:

 

In this event you are in Coliseum and all gates are closed - when player dies he is respawned in "pre-room" that is closed so he cant join fights again - his game is over for that moment.

 

In this case i sugestose to edit:

 

public static void StartEvent()

        {

DoorTable.getInstance().getDoor(24190001).closeMe();

DoorTable.getInstance().getDoor(24190002).closeMe(); --> DoorTable.getInstance().getDoor(24190002).openMe();

DoorTable.getInstance().getDoor(24190003).closeMe(); --> DoorTable.getInstance().getDoor(24190003).openMe();

DoorTable.getInstance().getDoor(24190004).closeMe();

 

Or even delete:

public static void StartEvent()

        {

DoorTable.getInstance().getDoor(24190001).closeMe();

- DoorTable.getInstance().getDoor(24190002).closeMe();

- DoorTable.getInstance().getDoor(24190003).closeMe();

DoorTable.getInstance().getDoor(24190004).closeMe();

 

                    flags.deleteMe();

             

            }

DoorTable.getInstance().getDoor(24190001).openMe();

- DoorTable.getInstance().getDoor(24190001).openMe();

- DoorTable.getInstance().getDoor(24190002).openMe();

DoorTable.getInstance().getDoor(24190004).openMe();

 

 

So death players will be able to join the fight after death again.

You are talking about CaptureThem right? if yes then when the players are ressed they are ported inside the coliseum again, except if you missed the code...:P

Link to comment
Share on other sites

Yes, my mistake overlooked code for revive srry ;)

Btw i saw you have masterio Custom pvp implemented also - is it able to use "killer" or some other method use instead of pk.ZodiacPoints ++; ?

 

Thx ;)

Link to comment
Share on other sites

Yes, my mistake overlooked code for revive srry ;)

Btw i saw you have masterio Custom pvp implemented also - is it able to use "killer" or some other method use instead of pk.ZodiacPoints ++; ?

 

Thx ;)

well yeah pk is how the killer is named in L2jHellas i don't know it is named in l2jfrozen( probably killer) also yeah more events are underway!

Link to comment
Share on other sites

OK i fixed pk method and works perfectly now...

 

 

Anyway i have problem with Revive method - If plyaer dies during Capture Them it spawn him as it has died in normally action (like it is not in event) my code is and i dont have any error in compile/code:

 

public void doRevive()
{
	super.doRevive();
	updateEffectIcons();
	sendPacket(new EtcStatusUpdate(this));
	_reviveRequested = 0;
	_revivePower = 0;
			if (CastleWars.CastleWarsRunning)
				{
				if (CastleWars.isattacker(this))
					{

						teleToLocation(CastleWars.attackersx, CastleWars.attackersy, CastleWars.attackersz);
					}
					if (CastleWars.isdefender(this))
					{

						teleToLocation(CastleWars.defendersx, CastleWars.defendersy, CastleWars.defendersz);
					}
		}	 

	if(isInParty() && getParty().isInDimensionalRift())
	{
		if(!DimensionalRiftManager.getInstance().checkIfInPeaceZone(getX(), getY(), getZ()))
		{
			getParty().getDimensionalRift().memberRessurected(this);
		}
	if(isinZodiac && CaptureThem.CaptureThemRunning)
			    {
					getStatus().setCurrentHp(getMaxHp());
					getStatus().setCurrentMp(getMaxMp());
					getStatus().setCurrentCp(getMaxCp());
					teleToLocation(149722, 46700, -3413);
			    }
	if(isinZodiac && ProtectTheLdr.ProtectisRunning)
			{
				getStatus().setCurrentHp(getMaxHp());
				getStatus().setCurrentMp(getMaxMp());
				getStatus().setCurrentCp(getMaxCp());
				if(ProtectTheLdr._Team1.contains(this))
				{
					teleToLocation(ProtectTheLdr.team1x, ProtectTheLdr.team1y, ProtectTheLdr.team1z);
				}
				if(ProtectTheLdr._Team2.contains(this))
				{
					teleToLocation(ProtectTheLdr.team2x, ProtectTheLdr.team2y, ProtectTheLdr.team2z);
				}
			}
	}

	if((_inEventTvT && TvT.is_started() && Config.TVT_REVIVE_RECOVERY) || (_inEventCTF && CTF.is_started() && Config.CTF_REVIVE_RECOVERY) || (_inEventDM && DM.is_started() && Config.DM_REVIVE_RECOVERY))
	{
		getStatus().setCurrentHp(getMaxHp());
		getStatus().setCurrentMp(getMaxMp());
		getStatus().setCurrentCp(getMaxCp());
	}
}

 

Could you give me advise?

Link to comment
Share on other sites

OK i fixed pk method and works perfectly now...

 

 

Anyway i have problem with Revive method - If plyaer dies during Capture Them it spawn him as it has died in normally action (like it is not in event) my code is and i dont have any error in compile/code:

 

public void doRevive()
{
	super.doRevive();
	updateEffectIcons();
	sendPacket(new EtcStatusUpdate(this));
	_reviveRequested = 0;
	_revivePower = 0;
			if (CastleWars.CastleWarsRunning)
				{
				if (CastleWars.isattacker(this))
					{

						teleToLocation(CastleWars.attackersx, CastleWars.attackersy, CastleWars.attackersz);
					}
					if (CastleWars.isdefender(this))
					{

						teleToLocation(CastleWars.defendersx, CastleWars.defendersy, CastleWars.defendersz);
					}
		}	 

	if(isInParty() && getParty().isInDimensionalRift())
	{
		if(!DimensionalRiftManager.getInstance().checkIfInPeaceZone(getX(), getY(), getZ()))
		{
			getParty().getDimensionalRift().memberRessurected(this);
		}
	if(isinZodiac && CaptureThem.CaptureThemRunning)
			    {
					getStatus().setCurrentHp(getMaxHp());
					getStatus().setCurrentMp(getMaxMp());
					getStatus().setCurrentCp(getMaxCp());
					teleToLocation(149722, 46700, -3413);
			    }
	if(isinZodiac && ProtectTheLdr.ProtectisRunning)
			{
				getStatus().setCurrentHp(getMaxHp());
				getStatus().setCurrentMp(getMaxMp());
				getStatus().setCurrentCp(getMaxCp());
				if(ProtectTheLdr._Team1.contains(this))
				{
					teleToLocation(ProtectTheLdr.team1x, ProtectTheLdr.team1y, ProtectTheLdr.team1z);
				}
				if(ProtectTheLdr._Team2.contains(this))
				{
					teleToLocation(ProtectTheLdr.team2x, ProtectTheLdr.team2y, ProtectTheLdr.team2z);
				}
			}
	}

	if((_inEventTvT && TvT.is_started() && Config.TVT_REVIVE_RECOVERY) || (_inEventCTF && CTF.is_started() && Config.CTF_REVIVE_RECOVERY) || (_inEventDM && DM.is_started() && Config.DM_REVIVE_RECOVERY))
	{
		getStatus().setCurrentHp(getMaxHp());
		getStatus().setCurrentMp(getMaxMp());
		getStatus().setCurrentCp(getMaxCp());
	}
}

 

Could you give me advise?

i didn't get what you mean :P

 

Topic updated new link V4 zodiac engine +1 event

Link to comment
Share on other sites

What i mean...so in different words - when player dies in Capture Them event it is spawned on pre room (primary closed by doors) of coliseum - I have implemented all codes (doRevive is actualized too). I haven´t time to test if it works in CastleWars (respawning on defenders / attackers spot), so i will test it too.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.




×
×
  • Create New...