Monster race changes.
This commit is contained in:
@@ -420,7 +420,7 @@ DefaultFinishTime = 5
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
# Default: True
|
||||
AllowRace = True
|
||||
AllowRace = False
|
||||
|
||||
# Default: True
|
||||
AllowWater = True
|
||||
|
||||
@@ -7,15 +7,15 @@
|
||||
<table width=270 border=0 bgcolor="111111">
|
||||
<tr>
|
||||
<td fixwidth=60>Lane Selection</td>
|
||||
<td fixwidth=140 align=center>Name of Racer</td>
|
||||
<td fixwidth=130 align=center>Name of Racer</td>
|
||||
<td fixwidth=40 align=center>Rating</td>
|
||||
<td fixwidth=30 align=right>Odds</td>
|
||||
<td fixwidth=40 align=right>Odds</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<table width=270 border=0>
|
||||
<tr>
|
||||
<td fixwidth=13><button action="bypass -h npc_%objectId%_BuyTicket 1" back="L2UI.rightBtn2" fore="L2UI.rightBtn1" width=14 height=13></td>
|
||||
<td fixwidth=13><button action="bypass -h npc_%objectId%_BuyTicket 1" back="L2UI.rightBtn2" fore="L2UI.rightBtn1" width=14 height=13></button></td>
|
||||
<td fixwidth=30>1</td>
|
||||
<td fixwidth=152><font color="LEVEL">Mob1</font></td>
|
||||
<td fixwidth=50 align=center>&$745;</td>
|
||||
@@ -23,7 +23,7 @@
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><button action="bypass -h npc_%objectId%_BuyTicket 2" back="L2UI.rightBtn2" fore="L2UI.rightBtn1" width=14 height=13></td>
|
||||
<td><button action="bypass -h npc_%objectId%_BuyTicket 2" back="L2UI.rightBtn2" fore="L2UI.rightBtn1" width=14 height=13></button></td>
|
||||
<td>2</td>
|
||||
<td><font color="LEVEL">Mob2</font></td>
|
||||
<td align=center>&$745;</td>
|
||||
@@ -31,7 +31,7 @@
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><button action="bypass -h npc_%objectId%_BuyTicket 3" back="L2UI.rightBtn2" fore="L2UI.rightBtn1" width=14 height=13></td>
|
||||
<td><button action="bypass -h npc_%objectId%_BuyTicket 3" back="L2UI.rightBtn2" fore="L2UI.rightBtn1" width=14 height=13></button></td>
|
||||
<td>3</td>
|
||||
<td><font color="LEVEL">Mob3</font></td>
|
||||
<td align=center>&$747;</td>
|
||||
@@ -39,7 +39,7 @@
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><button action="bypass -h npc_%objectId%_BuyTicket 4" back="L2UI.rightBtn2" fore="L2UI.rightBtn1" width=14 height=13></td>
|
||||
<td><button action="bypass -h npc_%objectId%_BuyTicket 4" back="L2UI.rightBtn2" fore="L2UI.rightBtn1" width=14 height=13></button></td>
|
||||
<td>4</td>
|
||||
<td><font color="LEVEL">Mob4</font></td>
|
||||
<td align=center>&$745;</td>
|
||||
@@ -47,7 +47,7 @@
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><button action="bypass -h npc_%objectId%_BuyTicket 5" back="L2UI.rightBtn2" fore="L2UI.rightBtn1" width=14 height=13></td>
|
||||
<td><button action="bypass -h npc_%objectId%_BuyTicket 5" back="L2UI.rightBtn2" fore="L2UI.rightBtn1" width=14 height=13></button></td>
|
||||
<td>5</td>
|
||||
<td><font color="LEVEL">Mob5</font></td>
|
||||
<td align=center>&$745;</td>
|
||||
@@ -55,7 +55,7 @@
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><button action="bypass -h npc_%objectId%_BuyTicket 6" back="L2UI.rightBtn2" fore="L2UI.rightBtn1" width=14 height=13></td>
|
||||
<td><button action="bypass -h npc_%objectId%_BuyTicket 6" back="L2UI.rightBtn2" fore="L2UI.rightBtn1" width=14 height=13></button></td>
|
||||
<td>6</td>
|
||||
<td><font color="LEVEL">Mob6</font></td>
|
||||
<td align=center>&$745;</td>
|
||||
@@ -63,7 +63,7 @@
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><button action="bypass -h npc_%objectId%_BuyTicket 7" back="L2UI.rightBtn2" fore="L2UI.rightBtn1" width=14 height=13></td>
|
||||
<td><button action="bypass -h npc_%objectId%_BuyTicket 7" back="L2UI.rightBtn2" fore="L2UI.rightBtn1" width=14 height=13></button></td>
|
||||
<td>7</td>
|
||||
<td><font color="LEVEL">Mob7</font></td>
|
||||
<td align=center>&$745;</td>
|
||||
@@ -71,7 +71,7 @@
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><button action="bypass -h npc_%objectId%_BuyTicket 8" back="L2UI.rightBtn2" fore="L2UI.rightBtn1" width=14 height=13></td>
|
||||
<td><button action="bypass -h npc_%objectId%_BuyTicket 8" back="L2UI.rightBtn2" fore="L2UI.rightBtn1" width=14 height=13></button></td>
|
||||
<td>8</td>
|
||||
<td><font color="LEVEL">Mob8</font></td>
|
||||
<td align=center>&$746;</td>
|
||||
|
||||
@@ -23,10 +23,10 @@
|
||||
<table width=270 border=0>
|
||||
<tr><td width=100>Select Bet Amount</td>
|
||||
<td width=170>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_BuyTicket 11" >100 Adena</Button> , <Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_BuyTicket 12" >500 Adena</Button>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_BuyTicket 13" >1,000 Adena</Button> , <Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_BuyTicket 14" >5,000 Adena</Button>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_BuyTicket 15" >10,000 Adena</Button> , <Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_BuyTicket 16" >20,000 Adena</Button>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_BuyTicket 17" >50,000 Adena</Button> , <Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_BuyTicket 18" >100,000 Adena</Button>
|
||||
<a action="bypass -h npc_%objectId%_BuyTicket 11" >100 Adena</a> , <a action="bypass -h npc_%objectId%_BuyTicket 12" >500 Adena</a><br1>
|
||||
<a action="bypass -h npc_%objectId%_BuyTicket 13" >1,000 Adena</a> , <a action="bypass -h npc_%objectId%_BuyTicket 14" >5,000 Adena</a><br1>
|
||||
<a action="bypass -h npc_%objectId%_BuyTicket 15" >10,000 Adena</a> , <a action="bypass -h npc_%objectId%_BuyTicket 16" >20,000 Adena</a><br1>
|
||||
<a action="bypass -h npc_%objectId%_BuyTicket 17" >50,000 Adena</a> , <a action="bypass -h npc_%objectId%_BuyTicket 18" >100,000 Adena</a><br1>
|
||||
</td></tr>
|
||||
</table>
|
||||
<img src="L2UI.SquareBlank" width=270 height=10>
|
||||
|
||||
@@ -4,11 +4,11 @@
|
||||
<img src="L2UI.SquareWhite" width=270 height=1> <img src="L2UI.SquareBlank" width=1 height=3>
|
||||
<table width=270 border=0>
|
||||
<tr><td width=270><Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_Chat 1">Monster Race Help</Button></td></tr>
|
||||
<tr><td width=270><Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_ShowOdds">View Odds</Button></td></tr>
|
||||
<!--<tr><td width=270><Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_ShowOdds">View Odds</Button></td></tr>-->
|
||||
<tr><td width=270><Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_ShowInfo">View Monster Information</Button></td></tr>
|
||||
<tr><td width=270><Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_BuyTicket 0">Purchase Ticket</Button></td></tr>
|
||||
<tr><td width=270><Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_Chat 7">Calculate Winnings</Button></td></tr>
|
||||
<tr><td width=270><Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_Chat 9"">View Past Results</Button></td></tr>
|
||||
<tr><td width=270><Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_Chat 9">View Past Results</Button></td></tr>
|
||||
<tr><td width=270><Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_Quest TeleportToRaceTrack" msg="1298;Monster Race Track">Exit the Monster Race Track</Button></td></tr>
|
||||
</table>
|
||||
<img src="L2UI.SquareBlank" width=270 height=10> <img src="L2UI.SquareWhite" width=270 height=1> <img src="L2UI.SquareBlank" width=270 height=5>
|
||||
|
||||
@@ -378,7 +378,10 @@ public class GameServer
|
||||
ItemsAutoDestroy.getInstance();
|
||||
}
|
||||
|
||||
MonsterRace.getInstance();
|
||||
if (Config.ALLOW_RACE)
|
||||
{
|
||||
MonsterRace.getInstance();
|
||||
}
|
||||
TaskManager.getInstance();
|
||||
|
||||
AntiFeedManager.getInstance().registerEvent(AntiFeedManager.GAME_ID);
|
||||
|
||||
@@ -19,6 +19,7 @@ package com.l2jmobius.gameserver.model.actor.instance;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
|
||||
import com.l2jmobius.Config;
|
||||
import com.l2jmobius.gameserver.MonsterRace;
|
||||
import com.l2jmobius.gameserver.ThreadPoolManager;
|
||||
import com.l2jmobius.gameserver.enums.InstanceType;
|
||||
@@ -93,6 +94,12 @@ public class L2RaceManagerInstance extends L2Npc
|
||||
{
|
||||
super(template);
|
||||
setInstanceType(InstanceType.L2RaceManagerInstance);
|
||||
|
||||
if (!Config.ALLOW_RACE)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (_notInitialized)
|
||||
{
|
||||
_notInitialized = false;
|
||||
@@ -120,7 +127,6 @@ public class L2RaceManagerInstance extends L2Npc
|
||||
s.scheduleGeneralAtFixedRate(new Announcement(SystemMessageId.THE_RACE_WILL_BEGIN_IN_S1_SECOND_S), (8 * MINUTE) + (58 * SECOND), 10 * MINUTE);
|
||||
s.scheduleGeneralAtFixedRate(new Announcement(SystemMessageId.THE_RACE_WILL_BEGIN_IN_S1_SECOND_S), (8 * MINUTE) + (59 * SECOND), 10 * MINUTE);
|
||||
s.scheduleGeneralAtFixedRate(new Announcement(SystemMessageId.THEY_RE_OFF), 9 * MINUTE, 10 * MINUTE);
|
||||
// */
|
||||
}
|
||||
_managers.add(this);
|
||||
}
|
||||
@@ -256,17 +262,29 @@ public class L2RaceManagerInstance extends L2Npc
|
||||
{
|
||||
if (command.startsWith("BuyTicket") && (_state != ACCEPTING_BETS))
|
||||
{
|
||||
if (!Config.ALLOW_RACE)
|
||||
{
|
||||
return;
|
||||
}
|
||||
player.sendPacket(SystemMessageId.MONSTER_RACE_TICKETS_ARE_NO_LONGER_AVAILABLE);
|
||||
command = "Chat 0";
|
||||
}
|
||||
if (command.startsWith("ShowOdds") && (_state == ACCEPTING_BETS))
|
||||
{
|
||||
if (!Config.ALLOW_RACE)
|
||||
{
|
||||
return;
|
||||
}
|
||||
player.sendPacket(SystemMessageId.MONSTER_RACE_PAYOUT_INFORMATION_IS_NOT_AVAILABLE_WHILE_TICKETS_ARE_BEING_SOLD);
|
||||
command = "Chat 0";
|
||||
}
|
||||
|
||||
if (command.startsWith("BuyTicket"))
|
||||
{
|
||||
if (!Config.ALLOW_RACE)
|
||||
{
|
||||
return;
|
||||
}
|
||||
int val = Integer.parseInt(command.substring(10));
|
||||
if (val == 0)
|
||||
{
|
||||
@@ -281,18 +299,34 @@ public class L2RaceManagerInstance extends L2Npc
|
||||
}
|
||||
else if (command.equals("ShowOdds"))
|
||||
{
|
||||
if (!Config.ALLOW_RACE)
|
||||
{
|
||||
return;
|
||||
}
|
||||
showOdds(player);
|
||||
}
|
||||
else if (command.equals("ShowInfo"))
|
||||
{
|
||||
if (!Config.ALLOW_RACE)
|
||||
{
|
||||
return;
|
||||
}
|
||||
showMonsterInfo(player);
|
||||
}
|
||||
else if (command.equals("calculateWin"))
|
||||
{
|
||||
if (!Config.ALLOW_RACE)
|
||||
{
|
||||
return;
|
||||
}
|
||||
// displayCalculateWinnings(player);
|
||||
}
|
||||
else if (command.equals("viewHistory"))
|
||||
{
|
||||
if (!Config.ALLOW_RACE)
|
||||
{
|
||||
return;
|
||||
}
|
||||
// displayHistory(player);
|
||||
}
|
||||
else
|
||||
@@ -533,6 +567,7 @@ public class L2RaceManagerInstance extends L2Npc
|
||||
{
|
||||
obj = new DeleteObject(MonsterRace.getInstance().getMonsters()[i]);
|
||||
broadcast(obj);
|
||||
MonsterRace.getInstance().getMonsters()[i].deleteMe();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user