Monster race changes.

This commit is contained in:
MobiusDev 2017-08-02 20:48:31 +00:00
parent 88c545a5f4
commit 94d2283c8a
33 changed files with 117 additions and 1393 deletions

View File

@ -406,9 +406,6 @@
<admin command="admin_mobgroup_attackgrp" accessLevel="100" />
<admin command="admin_mobgroup_invul" accessLevel="100" />
<!-- ADMIN MONSTER RACE -->
<admin command="admin_mons" accessLevel="100" />
<!-- ADMIN PATH NODE -->
<admin command="admin_pn_info" accessLevel="100" />
<admin command="admin_show_path" accessLevel="100" />

View File

@ -419,9 +419,6 @@ DefaultFinishTime = 5
# Misc Settings
# ---------------------------------------------------------------------------
# Default: True
AllowRace = True
# Default: True
AllowWater = True

View File

@ -1,19 +0,0 @@
<html><body><br><br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_Chat 0">Back</Button><br>
In a monster race eight monsters race at the same time. If you guess which monster is expected to finish first and buy that monster's race ticket, based upon the odds to win you will receive an appropriate amount of Adena.<br>
<font color="LEVEL">How the Race Works</font>Monster races run every 20 minutes in real time.<br>
<font color="LEVEL">How to Participate</font><br>
You can purchase a monster race ticket through a race manager NPC. Only between 18 minutes before the start of a race until 3 minutes before the race begins can you buy a ticket for the applicable race. When you purchase a ticket through a race manager, you can find out the names of the participating monsters and their current statistics. Three minutes before a race starts, the race manager will stop ticket sales and announce the monsters' individual odds for the current race.<br>
<font color="LEVEL">Betting</font><br>
There are two types of race betting. The Win bet means that you back a particular monster to win 1st place. The Place bet means that you will have to guess the 1st and 2nd place monsters, regardless of who finishes first or second.<br>
<font color="00FFFF">Win</font><br1>
* Among the entire betting amount for Win betting, after subtracting the race track's own share of profit, the amount left will be your total winnings. Three minutes before the race, each monster's expected odds are announced. Each Win ticket's dividend amount is calculated by multiplying the odds by the price of a ticket. The odds are never less than 1.<br1>
* The prize money does not get transferred to the next race.<br>
<font color="00FFFF">Place</font><br1>
* Place betting is a way of betting when you correctly guess the two monsters who will finish first and second regardless of their order. The method of calculating the dividend amount is the same as Win betting.<br1>
* Currently place betting is not available.<br>
<font color="LEVEL">End of Race</font><br>
When a race is over, the race manager will shout the results of the race. You can trade your ticket for Adena by speaking to a race manager NPC. Check the Winning Information Data to find out the types of bets and total winnings for the race you bet on, as well as your win status and prize amount. If you won, you can receive your prize money thorough a race manager NPC. If you did not win, a race manager will buy back your ticket for a small amount of money.<br>
If a server goes down while tickets are being sold, or while a race is in progress, the race will be cancelled. You can receive a full refund for your ticket for a cancelled race through a race manager.<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_Chat 0">Back</Button>
</body></html>

View File

@ -1,94 +0,0 @@
<html><body>
<center>Monster Race Betting <font color="00ffff">To Win</font> (Race #<font color="LEVEL"> 1race</font>)<br1>
<img src="L2UI.SquareWhite" width=270 height=1>
<img src="L2UI.SquareBlank" width=1 height=3>
</center>
<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=40 align=center>Rating</td>
<td fixwidth=30 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=30>1</td>
<td fixwidth=152><font color="LEVEL">Mob1</font></td>
<td fixwidth=50 align=center>&$745;</td>
<td fixwidth=30 align=right><font color="00ffff">13%</font></td>
</tr>
<tr>
<td><button action="bypass -h npc_%objectId%_BuyTicket 2" back="L2UI.rightBtn2" fore="L2UI.rightBtn1" width=14 height=13></td>
<td>2</td>
<td><font color="LEVEL">Mob2</font></td>
<td align=center>&$745;</td>
<td align=right><font color="00ffff">6%</font></td>
</tr>
<tr>
<td><button action="bypass -h npc_%objectId%_BuyTicket 3" back="L2UI.rightBtn2" fore="L2UI.rightBtn1" width=14 height=13></td>
<td>3</td>
<td><font color="LEVEL">Mob3</font></td>
<td align=center>&$747;</td>
<td align=right><font color="00ffff">4%</font></td>
</tr>
<tr>
<td><button action="bypass -h npc_%objectId%_BuyTicket 4" back="L2UI.rightBtn2" fore="L2UI.rightBtn1" width=14 height=13></td>
<td>4</td>
<td><font color="LEVEL">Mob4</font></td>
<td align=center>&$745;</td>
<td align=right><font color="00ffff">12%</font></td>
</tr>
<tr>
<td><button action="bypass -h npc_%objectId%_BuyTicket 5" back="L2UI.rightBtn2" fore="L2UI.rightBtn1" width=14 height=13></td>
<td>5</td>
<td><font color="LEVEL">Mob5</font></td>
<td align=center>&$745;</td>
<td align=right><font color="00ffff">14%</font></td>
</tr>
<tr>
<td><button action="bypass -h npc_%objectId%_BuyTicket 6" back="L2UI.rightBtn2" fore="L2UI.rightBtn1" width=14 height=13></td>
<td>6</td>
<td><font color="LEVEL">Mob6</font></td>
<td align=center>&$745;</td>
<td align=right><font color="00ffff">13%</font></td>
</tr>
<tr>
<td><button action="bypass -h npc_%objectId%_BuyTicket 7" back="L2UI.rightBtn2" fore="L2UI.rightBtn1" width=14 height=13></td>
<td>7</td>
<td><font color="LEVEL">Mob7</font></td>
<td align=center>&$745;</td>
<td align=right><font color="00ffff">13%</font></td>
</tr>
<tr>
<td><button action="bypass -h npc_%objectId%_BuyTicket 8" back="L2UI.rightBtn2" fore="L2UI.rightBtn1" width=14 height=13></td>
<td>8</td>
<td><font color="LEVEL">Mob8</font></td>
<td align=center>&$746;</td>
<td align=right><font color="00ffff">14%</font></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>
<table width=270 border=0 cellpadding=0 cellspacing=0>
<tr>
<td width=70 height=20><button value="Back" action="bypass -h npc_%objectId%_Chat 0" back="L2UI.DefaultButton_click" fore="L2UI.DefaultButton" width=67 height=19></td>
<td width=130 align=center>Select Lane :<font color="LEVEL"> No1</font></td>
<td width=70 align=right><button value="Quantity" action="bypass -h npc_%objectId%_BuyTicket 10" back="L2UI.DefaultButton_click" fore="L2UI.DefaultButton" width=67 height=19></td>
</tr>
</table>
</body></html>

View File

@ -1,42 +0,0 @@
<html><body>
<center>Monster Race Betting <font color="00ffff">To Win</font> (Race #<font color="LEVEL"> 1race</font>)<br1>
<img src="L2UI.SquareWhite" width=270 height=1>
<img src="L2UI.SquareBlank" width=1 height=3>
</center>
<table width=270 border=0 bgcolor="111111">
<tr>
<td fixwidth=60>Lane Selection</td>
<td fixwidth=140 align=center>Racer's Name </td>
<td fixwidth=40 align=center>Rating</td>
<td fixwidth=30 align=right>Odds</td>
</tr>
</table>
<table width=270 border=0>
<tr>
<td fixwidth=13><img src="L2UI.rightBtn2" width=14 height=13></td>
<td fixwidth=30>0place</td>
<td fixwidth=152><font color="LEVEL">Mob1</font></td>
<td fixwidth=50 align=center>&$745;</td>
<td fixwidth=30 align=right><font color="00ffff">13%</font></td>
</tr>
</table>
<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>
</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>
<table width=270 border=0 cellpadding=0 cellspacing=0>
<tr>
<td width=70 height=20><button value="Select Lane" action="bypass -h npc_%objectId%_BuyTicket 0" back="L2UI.DefaultButton_click" fore="L2UI.DefaultButton" width=67 height=19></td>
<td width=130 align=center>Purchase Price :<font color="LEVEL"> 0adena</font></td>
<td width=70 align=right><button value="Confirm" action="bypass -h npc_%objectId%_BuyTicket 20" back="L2UI.DefaultButton_click" fore="L2UI.DefaultButton" width=67 height=19></td>
</tr>
</table>
</body></html>

View File

@ -1,52 +0,0 @@
<html><body>
<center>Monster Race <font color="00ffff">Single</font> Ticket Purchase (Race #<font color="LEVEL"> 1race</font>)<br1>
<img src="L2UI.SquareWhite" width=270 height=1>
<img src="L2UI.SquareBlank" width=1 height=3>
</center>
<table width=270 border=0 bgcolor="111111">
<tr>
<td fixwidth=60>Lane Selection</td>
<td fixwidth=140 align=center>Racer's Name</td>
<td fixwidth=40 align=center>Rating</td>
<td fixwidth=30 align=right>Odds</td>
</tr>
</table>
<table width=270 border=0>
<tr>
<td fixwidth=13><img src="L2UI.rightBtn2" width=14 height=13></td>
<td fixwidth=30>0place</td>
<td fixwidth=152><font color="LEVEL">Mob1</font></td>
<td fixwidth=50 align=center>&$745;</td>
<td fixwidth=30 align=right><font color="00ffff">13%</font></td>
</tr>
</table>
<table width=270 border=0 bgcolor=111111>
<tr>
<td fixwidth=60>Bet Amount </td>
<td fixwidth=200></td>
</tr>
<tr>
<td>Bet Amount </td>
<td><font color="LEVEL">0adena</font> Adena</td>
</tr>
<tr>
<td>Tax </td>
<td><font color="LEVEL">0tax</font> Adena</td>
</tr>
<tr>
<td>Total </td>
<td><font color="LEVEL">0total</font> Adena</td>
</tr>
</table><br>
<center>If the information is correct, please click Confirm.</center><br>
<img src="L2UI.SquareBlank" width=270 height=10>
<img src="L2UI.SquareWhite" width=270 height=1>
<img src="L2UI.SquareBlank" width=270 height=5>
<table width=270 border=0 cellpadding=0 cellspacing=0>
<tr>
<td width=70 height=20><button value=&$141; action="bypass -h npc_%objectId%_Chat 0" back="L2UI.DefaultButton_click" fore="L2UI.DefaultButton" width=67 height=19></td>
<td width=130 align=center><button value="Select Lane" action="bypass -h npc_%objectId%_BuyTicket 0" back="L2UI.DefaultButton_click" fore="L2UI.DefaultButton" width=67 height=19></td>
<td width=70 align=right><button value=&$140; action="bypass -h npc_%objectId%_BuyTicket 21" back="L2UI.DefaultButton_click" fore="L2UI.DefaultButton" width=67 height=19></td>
</tr>
</table>
</body></html>

View File

@ -1,74 +0,0 @@
<html><body>
<center>Monster Race Betting <font color="00ffff">To Win</font> View Odds (Race #<font color="LEVEL"> 1race</font> )<br1>
<img src="L2UI.SquareWhite" width=270 height=1>
<img src="L2UI.SquareBlank" width=1 height=3>
</center>
<table width=270 border=0 bgcolor=111111>
<tr>
<td fixwidth=40 align=left>Lane</td>
<td fixwidth=130 align=center>Racer's Name</td>
<td fixwidth=100 align=right>Odds</td>
</tr>
</table>
<table width=270 border=0>
<tr>
<td fixwidth=40>No.1</td>
<td fixwidth=130 align=left><font color="LEVEL">Mob1</font></td>
<td fixwidth=100 align=right><font color="00ffff">&$804;</font> </td>
</tr>
<tr>
<td fixwidth=40>No.2</td>
<td fixwidth=130 align=left><font color="LEVEL">Mob2</font></td>
<td fixwidth=100 align=right><font color="00ffff">&$804;</font> </td>
</tr>
<tr>
<td fixwidth=40>No.3</td>
<td fixwidth=130 align=left><font color="LEVEL">Mob3</font></td>
<td fixwidth=100 align=right><font color="00ffff">&$804;</font> </td>
</tr>
<tr>
<td fixwidth=40>No.4</td>
<td fixwidth=130 align=left><font color="LEVEL">Mob4</font></td>
<td fixwidth=100 align=right><font color="00ffff">&$804;</font> </td>
</tr>
<tr>
<td fixwidth=40>No.5</td>
<td fixwidth=130 align=left><font color="LEVEL">Mob5</font></td>
<td fixwidth=100 align=right><font color="00ffff">&$804;</font> </td>
</tr>
<tr>
<td fixwidth=40>No.6</td>
<td fixwidth=130 align=left><font color="LEVEL">Mob6</font></td>
<td fixwidth=100 align=right><font color="00ffff">&$804;</font> </td>
</tr>
<tr>
<td fixwidth=40>No.7</td>
<td fixwidth=130 align=left><font color="LEVEL">Mob7</font></td>
<td fixwidth=100 align=right><font color="00ffff">&$804;</font> </td>
</tr>
<tr>
<td fixwidth=40>No.8</td>
<td fixwidth=130 align=left><font color="LEVEL">Mob8</font></td>
<td fixwidth=100 align=right><font color="00ffff">&$804;</font> </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>
<table width=270 border=0 cellpadding=0 cellspacing=0>
<tr>
<td width=90 height=20><button value="Back" action="bypass -h npc_%objectId%_Chat 0" back="L2UI.DefaultButton_click" fore="L2UI.DefaultButton" width=67 height=19></td>
<td width=90></td>
<td width=90 align=right><button value="Racer Info" action="bypass -h npc_%objectId%_ShowInfo" back="L2UI.DefaultButton_click" fore="L2UI.DefaultButton" width=67 height=19></td>
</tr>
</table>
</body></html>

View File

@ -1,80 +0,0 @@
<html><body>
<center>Participating Monsters<br1>
<img src="L2UI.SquareWhite" width=270 height=1>
<img src="L2UI.SquareBlank" width=1 height=3>
</center>
<table width=270 border=0 bgcolor=111111>
<tr>
<td fixwidth=40 align=left>Lane</td>
<td fixwidth=140 align=center>Racer's Name</td>
<td fixwidth=50 align=center>Rating</td>
<td fixwidth=40 align=right>Odds</td>
</tr>
</table>
<table width=270 border=0>
<tr>
<td fixwidth=40>1</td>
<td fixwidth=140 align=left><font color="LEVEL">Mob1</font></td>
<td fixwidth=50 align=center>&$747;</td>
<td fixwidth=40 align=right><font color="00ffff">12%</font></td>
</tr>
<tr>
<td fixwidth=40>2</td>
<td fixwidth=140 align=left><font color="LEVEL">Mob2</font></td>
<td fixwidth=50 align=center>&$745;</td>
<td fixwidth=40 align=right><font color="00ffff">6%</font></td>
</tr>
<tr>
<td fixwidth=40>3</td>
<td fixwidth=140 align=left><font color="LEVEL">Mob3</font></td>
<td fixwidth=50 align=center>&$746;</td>
<td fixwidth=40 align=right><font color="00ffff">3%</font></td>
</tr>
<tr>
<td fixwidth=40>4</td>
<td fixwidth=140 align=left><font color="LEVEL">Mob4</font></td>
<td fixwidth=50 align=center>&$747;</td>
<td fixwidth=40 align=right><font color="00ffff">7%</font></td>
</tr>
<tr>
<td fixwidth=40>5</td>
<td fixwidth=140 align=left><font color="LEVEL">Mob5</font></td>
<td fixwidth=50 align=center>&$747;</td>
<td fixwidth=40 align=right><font color="00ffff">4%</font></td>
</tr>
<tr>
<td fixwidth=40>6</td>
<td fixwidth=140 align=left><font color="LEVEL">Mob6</font></td>
<td fixwidth=50 align=center>&$747;</td>
<td fixwidth=40 align=right><font color="00ffff">14%</font></td>
</tr>
<tr>
<td fixwidth=40>7</td>
<td fixwidth=140 align=left><font color="LEVEL">Mob7</font></td>
<td fixwidth=50 align=center>&$747;</td>
<td fixwidth=40 align=right><font color="00ffff">26%</font></td>
</tr>
<tr>
<td fixwidth=40>8</td>
<td fixwidth=140 align=left><font color="LEVEL">Mob8</font></td>
<td fixwidth=50 align=center>&$745;</td>
<td fixwidth=40 align=right><font color="00ffff">5%</font></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>
<table width=270 border=0 cellpadding=0 cellspacing=0><tr>
<td width=90 height=20><button value="Back" action="bypass -h npc_%objectId%_Chat 0" back="L2UI.DefaultButton_click" fore="L2UI.DefaultButton" width=67 height=19></td>
<td width=90></td>
<td width=90></td>
</tr></table></body></html>

View File

@ -1,29 +0,0 @@
<html><body>
<center>Confirm Monster Race Bet / Calculate Winnings</center>
<img src="L2UI.SquareWhite" width=270 height=1>
<img src="L2UI.SquareBlank" width=1 height=3>
<table width=270 border=0 bgcolor=111111>
<tr><td fixwidth=60>Winnings for a Race.</td><td fixwidth=60 align=right>Lane</td><td fixwidth=160 align=right>Bet Amount</td></tr>
<tr><td fixwidth=60 fixheight=1></td><td fixwidth=60></td><td fixwidth=160></td></tr>
</table>
<table width=270 border=0>
<tr>
<td><Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_Chat 8">1 Race Number</Button></td>
<td align=right><font color="LEVEL">1</font> Number</td>
<td align=right><font color="LEVEL">100</font> Adena</td>
</tr>
</table>
<img src="L2UI.SquareWhite" width=270 height=1>
<table width=270 border=0>
<tr><td width=90><Button ALIGN=LEFT ICON="NORMAL" action="bypass _mrsl01_1">Previous List</Button></td><td width=90 align=center>1 Page </td><td width=90 align=right><Button ALIGN=LEFT ICON="NORMAL" action="bypass _mrsl01_2"> Next List</Button></td></tr>
</table>
<img src="L2UI.SquareWhite" width=270 height=1>
<img src="L2UI.SquareBlank" width=270 height=5>
<table width=270 border=0 cellpadding=0 cellspacing=0>
<tr>
<td width=90 height=20><button value="Back" action="bypass -h npc_%objectId%_Chat 0" back="L2UI.DefaultButton_click" fore="L2UI.DefaultButton" width=67 height=19></td>
<td width=90></td>
<td width=90></td>
</tr></table></body></html>

View File

@ -1,25 +0,0 @@
<html><body>
<center>Confirm Monster Race Bet / Calculate Winnings</center>
<img src="L2UI.SquareWhite" width=270 height=1>
<img src="L2UI.SquareBlank" width=1 height=3>
<table width=270 border=0>
<tr>
<td width=230>Race #19090<br>
Lane 1<br>
Bet: 100 adena<br>
1st place: Lane [4]<br>
Odds:[0.01]
</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>
<table width=270 border=0 cellpadding=0 cellspacing=0>
<tr>
<td width=90 height=20><button value="Previous" action="bypass -h npc_%objectId%_Chat 7" back="L2UI.DefaultButton_click" fore="L2UI.DefaultButton" width=67 height=19></td>
<td width=90></td>
<td width=90 align=right><button value="Calculate" action="bypass _mrsl03_30635184" back="L2UI.DefaultButton_click" fore="L2UI.DefaultButton" width=67 height=19></td>
</tr></table>
</body></html>

View File

@ -1,56 +0,0 @@
<html><body>
<center>View Monster Race Results</center>
<img src="L2UI.SquareWhite" width=270 height=1>
<img src="L2UI.SquareBlank" width=1 height=3>
<table width=270 border=0 bgcolor=111111>
<tr><td fixwidth=60>Race Number</td><td fixwidth=70 align=center>1st Finish</td><td fixwidth=70 align=center>2nd Finish</td><td fixwidth=70 align=right>Odds Rate for Win Bet</td></tr>
</table>
<table width=270 border=0>
<tr><td fixwidth=60 fixheight=1></td><td fixwidth=70></td><td fixwidth=70></td><td fixwidth=70></td></tr>
<tr>
<td><font color="LEVEL">7</font> th</td>
<td><font color="LEVEL">8</font> Lane </td><td><font color="LEVEL">1</font> Lane</td>
<td align=right><font color="00ffff">0.00</font> Times</td>
</tr>
<tr>
<td><font color="LEVEL">6</font> th</td>
<td><font color="LEVEL">4</font> Lane </td><td><font color="LEVEL">8</font> Lane</td>
<td align=right><font color="00ffff">0.00</font> Times</td>
</tr>
<tr>
<td><font color="LEVEL">5</font> th</td>
<td><font color="LEVEL">7</font> Lane </td><td><font color="LEVEL">2</font> Lane</td>
<td align=right><font color="00ffff">0.00</font> Times</td>
</tr>
<tr>
<td><font color="LEVEL">4</font> th</td>
<td><font color="LEVEL">6</font> Lane </td><td><font color="LEVEL">8</font> Lane</td>
<td align=right><font color="00ffff">0.00</font> Times</td>
</tr>
<tr>
<td><font color="LEVEL">3</font> th</td>
<td><font color="LEVEL">4</font> Lane </td><td><font color="LEVEL">1</font> Lane</td>
<td align=right><font color="00ffff">0.00</font> Times</td>
</tr>
<tr>
<td><font color="LEVEL">2</font> th</td>
<td><font color="LEVEL">1</font> Lane </td><td><font color="LEVEL">8</font> Lane</td>
<td align=right><font color="00ffff">0.00</font> Times</td>
</tr>
<tr>
<td><font color="LEVEL">1</font> th</td>
<td><font color="LEVEL">7</font> Lane </td><td><font color="LEVEL">6</font> Lane</td>
<td align=right><font color="00ffff">0.00</font> Times</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>
<table width=270 border=0 cellpadding=0 cellspacing=0>
<tr>
<td width=90 height=20><button value="Back" action="bypass -h npc_%objectId%_Chat 0" back="L2UI.DefaultButton_click" fore="L2UI.DefaultButton" width=67 height=19></td>
<td width=90></td>
<td width=90></td>
</tr>
</table>
</body></html>

View File

@ -1,15 +1,3 @@
<html>
<body>
<center>Monster Race Manager</center>
<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%_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%_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>
<html><body>Monster Race Manager:<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_Quest TeleportToRaceTrack" msg="1298;Monster Race Track">Exit the Monster Race Track</Button>
</body></html>

View File

@ -99,7 +99,6 @@ import handlers.admincommandhandlers.AdminManor;
import handlers.admincommandhandlers.AdminMenu;
import handlers.admincommandhandlers.AdminMessages;
import handlers.admincommandhandlers.AdminMobGroup;
import handlers.admincommandhandlers.AdminMonsterRace;
import handlers.admincommandhandlers.AdminOlympiad;
import handlers.admincommandhandlers.AdminPForge;
import handlers.admincommandhandlers.AdminPathNode;
@ -405,7 +404,6 @@ public class MasterHandler
AdminMenu.class,
AdminMessages.class,
AdminMobGroup.class,
AdminMonsterRace.class,
AdminOlympiad.class,
AdminPathNode.class,
AdminPcCafePoints.class,

View File

@ -1,166 +0,0 @@
/*
* This file is part of the L2J Mobius project.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package handlers.admincommandhandlers;
import com.l2jmobius.gameserver.MonsterRace;
import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.handler.IAdminCommandHandler;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.network.SystemMessageId;
import com.l2jmobius.gameserver.network.serverpackets.DeleteObject;
import com.l2jmobius.gameserver.network.serverpackets.MonRaceInfo;
import com.l2jmobius.gameserver.network.serverpackets.PlaySound;
import com.l2jmobius.gameserver.network.serverpackets.SystemMessage;
/**
* This class handles following admin commands: - invul = turns invulnerability on/off
* @version $Revision: 1.1.6.4 $ $Date: 2007/07/31 10:06:00 $
*/
public class AdminMonsterRace implements IAdminCommandHandler
{
private static final String[] ADMIN_COMMANDS =
{
"admin_mons"
};
protected static int state = -1;
@Override
public boolean useAdminCommand(String command, L2PcInstance activeChar)
{
if (command.equalsIgnoreCase("admin_mons"))
{
handleSendPacket(activeChar);
}
return true;
}
@Override
public String[] getAdminCommandList()
{
return ADMIN_COMMANDS;
}
private void handleSendPacket(L2PcInstance activeChar)
{
/*
* -1 0 to initialize the race 0 15322 to start race 13765 -1 in middle of race -1 0 to end the race 8003 to 8027
*/
final int[][] codes =
{
{
-1,
0
},
{
0,
15322
},
{
13765,
-1
},
{
-1,
0
}
};
final MonsterRace race = MonsterRace.getInstance();
if (state == -1)
{
state++;
race.newRace();
race.newSpeeds();
final MonRaceInfo spk = new MonRaceInfo(codes[state][0], codes[state][1], race.getMonsters(), race.getSpeeds());
activeChar.sendPacket(spk);
activeChar.broadcastPacket(spk);
}
else if (state == 0)
{
state++;
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.THEY_RE_OFF);
sm.addInt(0);
activeChar.sendPacket(sm);
final PlaySound SRace = new PlaySound(1, "S_Race", 0, 0, 0, 0, 0);
activeChar.sendPacket(SRace);
activeChar.broadcastPacket(SRace);
final PlaySound SRace2 = new PlaySound(0, "ItemSound2.race_start", 1, 121209259, 12125, 182487, -3559);
activeChar.sendPacket(SRace2);
activeChar.broadcastPacket(SRace2);
final MonRaceInfo spk = new MonRaceInfo(codes[state][0], codes[state][1], race.getMonsters(), race.getSpeeds());
activeChar.sendPacket(spk);
activeChar.broadcastPacket(spk);
ThreadPoolManager.getInstance().scheduleGeneral(new RunRace(codes, activeChar), 5000);
}
}
class RunRace implements Runnable
{
private final int[][] codes;
private final L2PcInstance activeChar;
public RunRace(int[][] pCodes, L2PcInstance pActiveChar)
{
codes = pCodes;
activeChar = pActiveChar;
}
@Override
public void run()
{
// int[][] speeds1 = MonsterRace.getInstance().getSpeeds();
// MonsterRace.getInstance().newSpeeds();
// int[][] speeds2 = MonsterRace.getInstance().getSpeeds();
/*
* int[] speed = new int[8]; for (int i=0; i<8; i++) { for (int j=0; j<20; j++) { //LOGGER.info("Adding "+speeds1[i][j] +" and "+ speeds2[i][j]); speed[i] += (speeds1[i][j]*1); // + (speeds2[i][j]*1); } LOGGER.info("Total speed for "+(i+1)+" = "+speed[i]); }
*/
final MonRaceInfo spk = new MonRaceInfo(codes[2][0], codes[2][1], MonsterRace.getInstance().getMonsters(), MonsterRace.getInstance().getSpeeds());
activeChar.sendPacket(spk);
activeChar.broadcastPacket(spk);
ThreadPoolManager.getInstance().scheduleGeneral(new RunEnd(activeChar), 30000);
}
}
private static class RunEnd implements Runnable
{
private final L2PcInstance activeChar;
public RunEnd(L2PcInstance pActiveChar)
{
activeChar = pActiveChar;
}
@Override
public void run()
{
DeleteObject obj = null;
for (int i = 0; i < 8; i++)
{
obj = new DeleteObject(MonsterRace.getInstance().getMonsters()[i]);
activeChar.sendPacket(obj);
activeChar.broadcastPacket(obj);
}
state = -1;
}
}
}

View File

@ -97,7 +97,6 @@
<npc id="31210" x="12882" y="181053" z="-3560" heading="49152" respawnTime="60sec"/>
<npc id="30995" x="12964" y="181600" z="-3567" heading="12703" respawnTime="60sec"/>
<npc id="31031" x="17264" y="170160" z="-3509" heading="16384" respawnTime="5sec"/>
<npc id="31031" x="13168" y="182594" z="-3500" heading="16384" respawnTime="5sec"/>
<npc id="31031" x="13582" y="181667" z="-3500" heading="16384" respawnTime="5sec"/>
<npc id="20208" x="49361" y="113389" z="-1898" heading="0" respawnTime="60sec"/>
<npc id="20208" x="50467" y="113567" z="-1898" heading="0" respawnTime="60sec"/>

View File

@ -3599,7 +3599,7 @@
<height normal="23.5" />
</collision>
</npc>
<npc id="30995" level="70" type="L2RaceManager" name="Race Manager" title="Monster Race Track">
<npc id="30995" level="70" type="L2Npc" name="Race Manager" title="Monster Race Track">
<race>DWARF</race>
<sex>FEMALE</sex>
<stats str="40" int="21" dex="30" wit="20" con="43" men="10">

View File

@ -488,7 +488,6 @@ public final class Config
public static int INSTANCE_FINISH_TIME;
public static boolean RESTORE_PLAYER_INSTANCE;
public static int EJECT_DEAD_PLAYER_TIME;
public static boolean ALLOW_RACE;
public static boolean ALLOW_WATER;
public static boolean ALLOW_RENTPET;
public static boolean ALLOW_FISHING;
@ -1787,7 +1786,6 @@ public final class Config
INSTANCE_FINISH_TIME = General.getInt("DefaultFinishTime", 5);
RESTORE_PLAYER_INSTANCE = General.getBoolean("RestorePlayerInstance", false);
EJECT_DEAD_PLAYER_TIME = General.getInt("EjectDeadPlayerTime", 1);
ALLOW_RACE = General.getBoolean("AllowRace", true);
ALLOW_WATER = General.getBoolean("AllowWater", true);
ALLOW_RENTPET = General.getBoolean("AllowRentPet", false);
ALLOW_FISHING = General.getBoolean("AllowFishing", true);

View File

@ -377,7 +377,6 @@ public class GameServer
ItemsAutoDestroy.getInstance();
}
MonsterRace.getInstance();
TaskManager.getInstance();
AntiFeedManager.getInstance().registerEvent(AntiFeedManager.GAME_ID);

View File

@ -1,150 +0,0 @@
/*
* This file is part of the L2J Mobius project.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.l2jmobius.gameserver;
import java.lang.reflect.Constructor;
import java.util.logging.Level;
import java.util.logging.Logger;
import com.l2jmobius.commons.util.Rnd;
import com.l2jmobius.gameserver.data.xml.impl.NpcData;
import com.l2jmobius.gameserver.model.actor.L2Npc;
import com.l2jmobius.gameserver.model.actor.templates.L2NpcTemplate;
public class MonsterRace
{
protected static final Logger LOGGER = Logger.getLogger(MonsterRace.class.getName());
private final L2Npc[] _monsters;
private int[][] _speeds;
private final int[] _first, _second;
protected MonsterRace()
{
_monsters = new L2Npc[8];
_speeds = new int[8][20];
_first = new int[2];
_second = new int[2];
}
public static MonsterRace getInstance()
{
return SingletonHolder._instance;
}
public void newRace()
{
int random = 0;
for (int i = 0; i < 8; i++)
{
final int id = 31003;
random = Rnd.get(24);
while (true)
{
for (int j = i - 1; j >= 0; j--)
{
if (_monsters[j].getTemplate().getId() == (id + random))
{
random = Rnd.get(24);
continue;
}
}
break;
}
try
{
final L2NpcTemplate template = NpcData.getInstance().getTemplate(id + random);
final Constructor<?> constructor = Class.forName("com.l2jmobius.gameserver.model.actor.instance." + template.getType() + "Instance").getConstructors()[0];
_monsters[i] = (L2Npc) constructor.newInstance(template);
}
catch (Exception e)
{
LOGGER.log(Level.WARNING, "", e);
}
// LOGGER.info("Monster "+i+" is id: "+(id+random));
}
newSpeeds();
}
public void newSpeeds()
{
_speeds = new int[8][20];
int total = 0;
_first[1] = 0;
_second[1] = 0;
for (int i = 0; i < 8; i++)
{
total = 0;
for (int j = 0; j < 20; j++)
{
if (j == 19)
{
_speeds[i][j] = 100;
}
else
{
_speeds[i][j] = Rnd.get(60) + 65;
}
total += _speeds[i][j];
}
if (total >= _first[1])
{
_second[0] = _first[0];
_second[1] = _first[1];
_first[0] = 8 - i;
_first[1] = total;
}
else if (total >= _second[1])
{
_second[0] = 8 - i;
_second[1] = total;
}
}
}
/**
* @return Returns the monsters.
*/
public L2Npc[] getMonsters()
{
return _monsters;
}
/**
* @return Returns the speeds.
*/
public int[][] getSpeeds()
{
return _speeds;
}
public int getFirstPlace()
{
return _first[0];
}
public int getSecondPlace()
{
return _second[0];
}
private static class SingletonHolder
{
protected static final MonsterRace _instance = new MonsterRace();
}
}

View File

@ -77,7 +77,6 @@ public enum InstanceType
L2ObservationInstance(L2Npc),
L2OlympiadManagerInstance(L2Npc),
L2PetManagerInstance(L2MerchantInstance),
L2RaceManagerInstance(L2Npc),
L2TeleporterInstance(L2Npc),
L2VillageMasterInstance(L2NpcInstance),
// Doormens

View File

@ -1,540 +0,0 @@
/*
* This file is part of the L2J Mobius project.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.l2jmobius.gameserver.model.actor.instance;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
import com.l2jmobius.gameserver.MonsterRace;
import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.enums.InstanceType;
import com.l2jmobius.gameserver.idfactory.IdFactory;
import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.actor.L2Npc;
import com.l2jmobius.gameserver.model.actor.templates.L2NpcTemplate;
import com.l2jmobius.gameserver.model.itemcontainer.Inventory;
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
import com.l2jmobius.gameserver.network.SystemMessageId;
import com.l2jmobius.gameserver.network.serverpackets.ActionFailed;
import com.l2jmobius.gameserver.network.serverpackets.DeleteObject;
import com.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
import com.l2jmobius.gameserver.network.serverpackets.InventoryUpdate;
import com.l2jmobius.gameserver.network.serverpackets.MonRaceInfo;
import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
import com.l2jmobius.gameserver.network.serverpackets.PlaySound;
import com.l2jmobius.gameserver.network.serverpackets.SystemMessage;
import com.l2jmobius.gameserver.util.Broadcast;
public class L2RaceManagerInstance extends L2Npc
{
public static final int LANES = 8;
public static final int WINDOW_START = 0;
private static List<L2RaceManagerInstance> _managers;
protected static int _raceNumber = 4;
// Time Constants
private static final long SECOND = 1000;
private static final long MINUTE = 60 * SECOND;
private static int _minutes = 5;
// States
private static final int ACCEPTING_BETS = 0;
private static final int WAITING = 1;
private static final int STARTING_RACE = 2;
private static final int RACE_END = 3;
private static int _state = RACE_END;
protected static final int[][] _codes =
{
{
-1,
0
},
{
0,
15322
},
{
13765,
-1
}
};
private static boolean _notInitialized = true;
protected static MonRaceInfo _packet;
protected static final int _cost[] =
{
100,
500,
1000,
5000,
10000,
20000,
50000,
100000
};
public L2RaceManagerInstance(L2NpcTemplate template)
{
super(template);
setInstanceType(InstanceType.L2RaceManagerInstance);
if (_notInitialized)
{
_notInitialized = false;
_managers = new CopyOnWriteArrayList<>();
final ThreadPoolManager s = ThreadPoolManager.getInstance();
s.scheduleGeneralAtFixedRate(new Announcement(SystemMessageId.TICKETS_ARE_NOW_AVAILABLE_FOR_MONSTER_RACE_S1), 0, 10 * MINUTE);
s.scheduleGeneralAtFixedRate(new Announcement(SystemMessageId.NOW_SELLING_TICKETS_FOR_MONSTER_RACE_S1), 30 * SECOND, 10 * MINUTE);
s.scheduleGeneralAtFixedRate(new Announcement(SystemMessageId.TICKETS_ARE_NOW_AVAILABLE_FOR_MONSTER_RACE_S1), MINUTE, 10 * MINUTE);
s.scheduleGeneralAtFixedRate(new Announcement(SystemMessageId.NOW_SELLING_TICKETS_FOR_MONSTER_RACE_S1), MINUTE + (30 * SECOND), 10 * MINUTE);
s.scheduleGeneralAtFixedRate(new Announcement(SystemMessageId.TICKET_SALES_FOR_THE_MONSTER_RACE_WILL_END_IN_S1_MINUTE_S), 2 * MINUTE, 10 * MINUTE);
s.scheduleGeneralAtFixedRate(new Announcement(SystemMessageId.TICKET_SALES_FOR_THE_MONSTER_RACE_WILL_END_IN_S1_MINUTE_S), 3 * MINUTE, 10 * MINUTE);
s.scheduleGeneralAtFixedRate(new Announcement(SystemMessageId.TICKET_SALES_FOR_THE_MONSTER_RACE_WILL_END_IN_S1_MINUTE_S), 4 * MINUTE, 10 * MINUTE);
s.scheduleGeneralAtFixedRate(new Announcement(SystemMessageId.TICKET_SALES_FOR_THE_MONSTER_RACE_WILL_END_IN_S1_MINUTE_S), 5 * MINUTE, 10 * MINUTE);
s.scheduleGeneralAtFixedRate(new Announcement(SystemMessageId.TICKET_SALES_FOR_THE_MONSTER_RACE_WILL_END_IN_S1_MINUTE_S), 6 * MINUTE, 10 * MINUTE);
s.scheduleGeneralAtFixedRate(new Announcement(SystemMessageId.TICKETS_SALES_ARE_CLOSED_FOR_MONSTER_RACE_S1_ODDS_ARE_POSTED), 7 * MINUTE, 10 * MINUTE);
s.scheduleGeneralAtFixedRate(new Announcement(SystemMessageId.MONSTER_RACE_S2_WILL_BEGIN_IN_S1_MINUTE_S), 7 * MINUTE, 10 * MINUTE);
s.scheduleGeneralAtFixedRate(new Announcement(SystemMessageId.MONSTER_RACE_S2_WILL_BEGIN_IN_S1_MINUTE_S), 8 * MINUTE, 10 * MINUTE);
s.scheduleGeneralAtFixedRate(new Announcement(SystemMessageId.MONSTER_RACE_S1_WILL_BEGIN_IN_30_SECONDS), (8 * MINUTE) + (30 * SECOND), 10 * MINUTE);
s.scheduleGeneralAtFixedRate(new Announcement(SystemMessageId.MONSTER_RACE_S1_IS_ABOUT_TO_BEGIN_COUNTDOWN_IN_FIVE_SECONDS), (8 * MINUTE) + (50 * SECOND), 10 * MINUTE);
s.scheduleGeneralAtFixedRate(new Announcement(SystemMessageId.THE_RACE_WILL_BEGIN_IN_S1_SECOND_S), (8 * MINUTE) + (55 * SECOND), 10 * MINUTE);
s.scheduleGeneralAtFixedRate(new Announcement(SystemMessageId.THE_RACE_WILL_BEGIN_IN_S1_SECOND_S), (8 * MINUTE) + (56 * SECOND), 10 * MINUTE);
s.scheduleGeneralAtFixedRate(new Announcement(SystemMessageId.THE_RACE_WILL_BEGIN_IN_S1_SECOND_S), (8 * MINUTE) + (57 * SECOND), 10 * MINUTE);
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);
}
@Override
public boolean isAutoAttackable(L2Character attacker)
{
if (attacker.isMonster())
{
return true;
}
return super.isAutoAttackable(attacker);
}
class Announcement implements Runnable
{
private final SystemMessageId _type;
public Announcement(SystemMessageId pType)
{
_type = pType;
}
@Override
public void run()
{
makeAnnouncement(_type);
}
}
public void makeAnnouncement(SystemMessageId type)
{
final SystemMessage sm = SystemMessage.getSystemMessage(type);
switch (type.getId())
{
case 816: // SystemMessageId.TICKETS_ARE_NOW_AVAILABLE_FOR_MONSTER_RACE_S1
case 817: // SystemMessageId.NOW_SELLING_TICKETS_FOR_MONSTER_RACE_S1
if (_state != ACCEPTING_BETS)
{// LOGGER.info("Race Initializing");
_state = ACCEPTING_BETS;
startRace();
} // else{LOGGER.info("Race open");}
sm.addInt(_raceNumber);
break;
case 818: // SystemMessageId.TICKET_SALES_FOR_THE_MONSTER_RACE_WILL_END_IN_S1_MINUTE_S
case 820: // SystemMessageId.MONSTER_RACE_S2_WILL_BEGIN_IN_S1_MINUTE_S
case 823: // SystemMessageId.THE_RACE_WILL_BEGIN_IN_S1_SECOND_S
sm.addInt(_minutes);
if (type.getId() == 820)
{
sm.addInt(_raceNumber);
}
_minutes--;
break;
case 819: // SystemMessageId.TICKETS_SALES_ARE_CLOSED_FOR_MONSTER_RACE_S1_ODDS_ARE_POSTED
// LOGGER.info("Sales closed");
sm.addInt(_raceNumber);
_state = WAITING;
_minutes = 2;
break;
case 821: // SystemMessageId.MONSTER_RACE_S1_WILL_BEGIN_IN_30_SECONDS
case 822: // SystemMessageId.MONSTER_RACE_S1_IS_ABOUT_TO_BEGIN_COUNTDOWN_IN_FIVE_SECONDS
case 825: // SystemMessageId.MONSTER_RACE_S1_IS_FINISHED
sm.addInt(_raceNumber);
_minutes = 5;
break;
case 826: // SystemMessageId.FIRST_PRIZE_GOES_TO_THE_PLAYER_IN_LANE_S1_SECOND_PRIZE_GOES_TO_THE_PLAYER_IN_LANE_S2
// LOGGER.info("Placing");
_state = RACE_END;
sm.addInt(MonsterRace.getInstance().getFirstPlace());
sm.addInt(MonsterRace.getInstance().getSecondPlace());
break;
}
// _logn.info("Counter: "+minutes);
// LOGGER.info("State: "+state);
broadcast(sm);
// LOGGER.info("Player's known: "+getKnownPlayers().size());
if (type == SystemMessageId.THEY_RE_OFF)
{
// LOGGER.info("Starting race");
_state = STARTING_RACE;
startRace();
_minutes = 5;
}
}
protected void broadcast(IClientOutgoingPacket pkt)
{
for (L2RaceManagerInstance manager : _managers)
{
if (!manager.isDead())
{
Broadcast.toKnownPlayers(manager, pkt);
}
}
}
public void sendMonsterInfo()
{
broadcast(_packet);
}
private void startRace()
{
final MonsterRace race = MonsterRace.getInstance();
if (_state == STARTING_RACE)
{
// state++;
final PlaySound SRace = new PlaySound(1, "S_Race", 0, 0, 0, 0, 0);
broadcast(SRace);
final PlaySound SRace2 = new PlaySound(0, "ItemSound2.race_start", 1, 121209259, 12125, 182487, -3559);
broadcast(SRace2);
_packet = new MonRaceInfo(_codes[1][0], _codes[1][1], race.getMonsters(), race.getSpeeds());
sendMonsterInfo();
ThreadPoolManager.getInstance().scheduleGeneral(new RunRace(), 5000);
}
else
{
// state++;
race.newRace();
race.newSpeeds();
_packet = new MonRaceInfo(_codes[0][0], _codes[0][1], race.getMonsters(), race.getSpeeds());
sendMonsterInfo();
}
}
@Override
public void onBypassFeedback(L2PcInstance player, String command)
{
if (command.startsWith("BuyTicket") && (_state != ACCEPTING_BETS))
{
player.sendPacket(SystemMessageId.MONSTER_RACE_TICKETS_ARE_NO_LONGER_AVAILABLE);
command = "Chat 0";
}
if (command.startsWith("ShowOdds") && (_state == ACCEPTING_BETS))
{
player.sendPacket(SystemMessageId.MONSTER_RACE_PAYOUT_INFORMATION_IS_NOT_AVAILABLE_WHILE_TICKETS_ARE_BEING_SOLD);
command = "Chat 0";
}
if (command.startsWith("BuyTicket"))
{
int val = Integer.parseInt(command.substring(10));
if (val == 0)
{
player.setRace(0, 0);
player.setRace(1, 0);
}
if (((val == 10) && (player.getRace(0) == 0)) || ((val == 20) && (player.getRace(0) == 0) && (player.getRace(1) == 0)))
{
val = 0;
}
showBuyTicket(player, val);
}
else if (command.equals("ShowOdds"))
{
showOdds(player);
}
else if (command.equals("ShowInfo"))
{
showMonsterInfo(player);
}
else if (command.equals("calculateWin"))
{
// displayCalculateWinnings(player);
}
else if (command.equals("viewHistory"))
{
// displayHistory(player);
}
else
{
// getKnownList().removeKnownObject(player);
super.onBypassFeedback(player, command);
}
}
public void showOdds(L2PcInstance player)
{
if (_state == ACCEPTING_BETS)
{
return;
}
final int npcId = getTemplate().getId();
String filename, search;
final NpcHtmlMessage html = new NpcHtmlMessage(getObjectId());
filename = getHtmlPath(npcId, 5);
html.setFile(player.getHtmlPrefix(), filename);
for (int i = 0; i < 8; i++)
{
final int n = i + 1;
search = "Mob" + n;
html.replace(search, MonsterRace.getInstance().getMonsters()[i].getTemplate().getName());
}
html.replace("1race", String.valueOf(_raceNumber));
html.replace("%objectId%", String.valueOf(getObjectId()));
player.sendPacket(html);
player.sendPacket(ActionFailed.STATIC_PACKET);
}
public void showMonsterInfo(L2PcInstance player)
{
final int npcId = getTemplate().getId();
String filename, search;
final NpcHtmlMessage html = new NpcHtmlMessage(getObjectId());
filename = getHtmlPath(npcId, 6);
html.setFile(player.getHtmlPrefix(), filename);
for (int i = 0; i < 8; i++)
{
final int n = i + 1;
search = "Mob" + n;
html.replace(search, MonsterRace.getInstance().getMonsters()[i].getTemplate().getName());
}
html.replace("%objectId%", String.valueOf(getObjectId()));
player.sendPacket(html);
player.sendPacket(ActionFailed.STATIC_PACKET);
}
public void showBuyTicket(L2PcInstance player, int val)
{
if (_state != ACCEPTING_BETS)
{
return;
}
final int npcId = getTemplate().getId();
SystemMessage sm;
String filename, search, replace;
final NpcHtmlMessage html = new NpcHtmlMessage(getObjectId());
if (val < 10)
{
filename = getHtmlPath(npcId, 2);
html.setFile(player.getHtmlPrefix(), filename);
for (int i = 0; i < 8; i++)
{
final int n = i + 1;
search = "Mob" + n;
html.replace(search, MonsterRace.getInstance().getMonsters()[i].getTemplate().getName());
}
search = "No1";
if (val == 0)
{
html.replace(search, "");
}
else
{
html.replace(search, "" + val);
player.setRace(0, val);
}
}
else if (val < 20)
{
if (player.getRace(0) == 0)
{
return;
}
filename = getHtmlPath(npcId, 3);
html.setFile(player.getHtmlPrefix(), filename);
html.replace("0place", "" + player.getRace(0));
search = "Mob1";
replace = MonsterRace.getInstance().getMonsters()[player.getRace(0) - 1].getTemplate().getName();
html.replace(search, replace);
search = "0adena";
if (val == 10)
{
html.replace(search, "");
}
else
{
html.replace(search, "" + _cost[val - 11]);
player.setRace(1, val - 10);
}
}
else if (val == 20)
{
if ((player.getRace(0) == 0) || (player.getRace(1) == 0))
{
return;
}
filename = getHtmlPath(npcId, 4);
html.setFile(player.getHtmlPrefix(), filename);
html.replace("0place", "" + player.getRace(0));
search = "Mob1";
replace = MonsterRace.getInstance().getMonsters()[player.getRace(0) - 1].getTemplate().getName();
html.replace(search, replace);
search = "0adena";
final int price = _cost[player.getRace(1) - 1];
html.replace(search, "" + price);
search = "0tax";
final int tax = 0;
html.replace(search, "" + tax);
search = "0total";
final int total = price + tax;
html.replace(search, "" + total);
}
else
{
if ((player.getRace(0) == 0) || (player.getRace(1) == 0))
{
return;
}
final int ticket = player.getRace(0);
final int priceId = player.getRace(1);
if (!player.reduceAdena("Race", _cost[priceId - 1], this, true))
{
return;
}
player.setRace(0, 0);
player.setRace(1, 0);
sm = SystemMessage.getSystemMessage(SystemMessageId.ACQUIRED_S1_S2);
sm.addInt(_raceNumber);
sm.addItemName(4443);
player.sendPacket(sm);
final L2ItemInstance item = new L2ItemInstance(IdFactory.getInstance().getNextId(), 4443);
item.setCount(1);
item.setEnchantLevel(_raceNumber);
item.setCustomType1(ticket);
item.setCustomType2(_cost[priceId - 1] / 100);
player.getInventory().addItem("Race", item, player, this);
final InventoryUpdate iu = new InventoryUpdate();
iu.addItem(item);
final L2ItemInstance adenaupdate = player.getInventory().getItemByItemId(Inventory.ADENA_ID);
iu.addModifiedItem(adenaupdate);
player.sendInventoryUpdate(iu);
return;
}
html.replace("1race", String.valueOf(_raceNumber));
html.replace("%objectId%", String.valueOf(getObjectId()));
player.sendPacket(html);
player.sendPacket(ActionFailed.STATIC_PACKET);
}
public static class Race
{
private final Info[] _info;
public Race(Info[] pInfo)
{
_info = pInfo;
}
public Info getLaneInfo(int lane)
{
return _info[lane];
}
public class Info
{
private final int _id;
private final int _place;
private final int _odds;
private final int _payout;
public Info(int pId, int pPlace, int pOdds, int pPayout)
{
_id = pId;
_place = pPlace;
_odds = pOdds;
_payout = pPayout;
}
public int getId()
{
return _id;
}
public int getOdds()
{
return _odds;
}
public int getPayout()
{
return _payout;
}
public int getPlace()
{
return _place;
}
}
}
class RunRace implements Runnable
{
@Override
public void run()
{
_packet = new MonRaceInfo(_codes[2][0], _codes[2][1], MonsterRace.getInstance().getMonsters(), MonsterRace.getInstance().getSpeeds());
sendMonsterInfo();
ThreadPoolManager.getInstance().scheduleGeneral(new RunEnd(), 30000);
}
}
class RunEnd implements Runnable
{
@Override
public void run()
{
makeAnnouncement(SystemMessageId.FIRST_PRIZE_GOES_TO_THE_PLAYER_IN_LANE_S1_SECOND_PRIZE_GOES_TO_THE_PLAYER_IN_LANE_S2);
makeAnnouncement(SystemMessageId.MONSTER_RACE_S1_IS_FINISHED);
_raceNumber++;
DeleteObject obj = null;
for (int i = 0; i < 8; i++)
{
obj = new DeleteObject(MonsterRace.getInstance().getMonsters()[i]);
broadcast(obj);
}
}
}
}

View File

@ -420,7 +420,7 @@ DefaultFinishTime = 5
# ---------------------------------------------------------------------------
# Default: True
AllowRace = True
AllowRace = False
# Default: True
AllowWater = True

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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);

View File

@ -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();
}
}
}

View File

@ -420,7 +420,7 @@ DefaultFinishTime = 5
# ---------------------------------------------------------------------------
# Default: True
AllowRace = True
AllowRace = False
# Default: True
AllowWater = True

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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);

View File

@ -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();
}
}
}