Olympiad rework.
Contributed by facab.
This commit is contained in:
		@@ -7,7 +7,6 @@ CREATE TABLE IF NOT EXISTS `olympiad_fights` (
 | 
			
		||||
  `winner` tinyint(1) unsigned NOT NULL DEFAULT '0',
 | 
			
		||||
  `start` bigint(13) unsigned NOT NULL DEFAULT '0',
 | 
			
		||||
  `time` bigint(13) unsigned NOT NULL DEFAULT '0',
 | 
			
		||||
  `classed` tinyint(1) unsigned NOT NULL DEFAULT '0',
 | 
			
		||||
  KEY `charOneId` (`charOneId`),
 | 
			
		||||
  KEY `charTwoId` (`charTwoId`)
 | 
			
		||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
 | 
			
		||||
@@ -8,8 +8,5 @@ CREATE TABLE IF NOT EXISTS `olympiad_nobles` (
 | 
			
		||||
  `competitions_lost` smallint(3) unsigned NOT NULL DEFAULT 0,
 | 
			
		||||
  `competitions_drawn` smallint(3) unsigned NOT NULL DEFAULT 0,
 | 
			
		||||
  `competitions_done_week` tinyint(3) unsigned NOT NULL DEFAULT 0,
 | 
			
		||||
  `competitions_done_week_classed` tinyint(3) unsigned NOT NULL DEFAULT 0,
 | 
			
		||||
  `competitions_done_week_non_classed` tinyint(3) unsigned NOT NULL DEFAULT 0,
 | 
			
		||||
  `competitions_done_week_team` tinyint(3) unsigned NOT NULL DEFAULT 0,
 | 
			
		||||
  PRIMARY KEY (`charId`)
 | 
			
		||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
 | 
			
		||||
@@ -9,24 +9,22 @@
 | 
			
		||||
# Also please understand what you are changing before you do so on a live server.
 | 
			
		||||
# ---------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
# Olympiad Start Time in Military hours Default 6pm (18) 
 | 
			
		||||
# Default: 18
 | 
			
		||||
# Classic: 20
 | 
			
		||||
# Olympiad Start Time in Military hours Default 8pm (20) 
 | 
			
		||||
# Default: 20
 | 
			
		||||
AltOlyStartTime = 20
 | 
			
		||||
 | 
			
		||||
# Olympiad Start Time for Min's, Default 00 so at the start of the hour.
 | 
			
		||||
# Default: 00
 | 
			
		||||
AltOlyMin = 00
 | 
			
		||||
 | 
			
		||||
# Olympiad Competition Period, Default 6 hours.
 | 
			
		||||
# Olympiad Competition Period, Default 4 hours.
 | 
			
		||||
# (If set different, should be increment by 10mins)
 | 
			
		||||
# Default: 21600000
 | 
			
		||||
# Classic: 14400000
 | 
			
		||||
# Default: 14400000
 | 
			
		||||
AltOlyCPeriod = 14400000
 | 
			
		||||
 | 
			
		||||
# Olympiad Battle Period, Default 5 minutes.
 | 
			
		||||
# Default: 300000
 | 
			
		||||
AltOlyBattle = 300000
 | 
			
		||||
# Olympiad Battle Period, Default 6 minutes.
 | 
			
		||||
# Default: 360000
 | 
			
		||||
AltOlyBattle = 360000
 | 
			
		||||
 | 
			
		||||
# Olympiad Weekly Period, Default 1 week
 | 
			
		||||
# Used for adding points to nobles
 | 
			
		||||
@@ -35,7 +33,7 @@ AltOlyWPeriod = 604800000
 | 
			
		||||
 | 
			
		||||
# Olympiad Validation Period, Default 24 Hours.
 | 
			
		||||
# Default: 86400000
 | 
			
		||||
AltOlyVPeriod = 43200000
 | 
			
		||||
AltOlyVPeriod = 86400000
 | 
			
		||||
 | 
			
		||||
# Points for reaching Noblesse for the first time
 | 
			
		||||
# Default: 10
 | 
			
		||||
@@ -45,38 +43,15 @@ AltOlyStartPoints = 10
 | 
			
		||||
# Default: 10
 | 
			
		||||
AltOlyWeeklyPoints = 10
 | 
			
		||||
 | 
			
		||||
# Required number of participants for the class based games
 | 
			
		||||
# Default: 11
 | 
			
		||||
AltOlyClassedParticipants = 11
 | 
			
		||||
 | 
			
		||||
# Required number of participants for the non-class based games
 | 
			
		||||
# Default: 11
 | 
			
		||||
AltOlyNonClassedParticipants = 11
 | 
			
		||||
 | 
			
		||||
# Required number of participants for the 3x3 teams games
 | 
			
		||||
# Default: 6
 | 
			
		||||
AltOlyTeamsParticipants = 6
 | 
			
		||||
# Required number of participants for the games
 | 
			
		||||
# Default: 20
 | 
			
		||||
AltOlyParticipants = 20
 | 
			
		||||
 | 
			
		||||
# Number used for displaying amount of registered participants, messages "Fewer than ..." or "More than ...".
 | 
			
		||||
# 0 for displaying digits instead of text phrase (old style).
 | 
			
		||||
# Default: 100
 | 
			
		||||
AltOlyRegistrationDisplayNumber = 100
 | 
			
		||||
 | 
			
		||||
# Reward for the class based games
 | 
			
		||||
# Format: itemId1,itemNum1;itemId2,itemNum2...
 | 
			
		||||
# Default: 13722,50
 | 
			
		||||
AltOlyClassedReward = 13722,50
 | 
			
		||||
 | 
			
		||||
# Reward for the non-class based games
 | 
			
		||||
# Format: itemId1,itemNum1;itemId2,itemNum2...
 | 
			
		||||
# Default: 13722,40
 | 
			
		||||
AltOlyNonClassedReward = 13722,40
 | 
			
		||||
 | 
			
		||||
# Reward for the 3x3 teams games
 | 
			
		||||
# Format: itemId1,itemNum1;itemId2,itemNum2...
 | 
			
		||||
# Default: 13722,85
 | 
			
		||||
AltOlyTeamReward = 13722,85
 | 
			
		||||
 | 
			
		||||
# ItemId used for exchanging to the points.
 | 
			
		||||
# Default: 45584
 | 
			
		||||
AltOlyCompRewItem = 45584
 | 
			
		||||
@@ -142,29 +117,18 @@ AltOlyLogFights = False
 | 
			
		||||
# Default: 60
 | 
			
		||||
AltOlyWaitTime = 60
 | 
			
		||||
 | 
			
		||||
# Divider for points in classed and non-classed games
 | 
			
		||||
# Default: 5, 5
 | 
			
		||||
AltOlyDividerClassed = 5
 | 
			
		||||
AltOlyDividerNonClassed = 5
 | 
			
		||||
# Divider for points in games
 | 
			
		||||
# Default: 5
 | 
			
		||||
AltOlyDivider = 5
 | 
			
		||||
 | 
			
		||||
# Maximum number of matches a Noblesse character can join per week
 | 
			
		||||
# Default: 70
 | 
			
		||||
# Classic: 30
 | 
			
		||||
# Default: 30
 | 
			
		||||
AltOlyMaxWeeklyMatches = 30
 | 
			
		||||
 | 
			
		||||
# Maximum number of Class-Irrelevant Individual matches a character can join per week
 | 
			
		||||
# Default: 60
 | 
			
		||||
# Classic: 30
 | 
			
		||||
AltOlyMaxWeeklyMatchesNonClassed = 30
 | 
			
		||||
 | 
			
		||||
# Maximum number of Class Individual matches a character can join per week
 | 
			
		||||
# Default: 30
 | 
			
		||||
AltOlyMaxWeeklyMatchesClassed = 30
 | 
			
		||||
 | 
			
		||||
# Maximum number of Class-Irrelevant Team matches a character can join per week
 | 
			
		||||
# Default: 10
 | 
			
		||||
AltOlyMaxWeeklyMatchesTeam = 10
 | 
			
		||||
 | 
			
		||||
# Enable competitions only on specific days.
 | 
			
		||||
# Default: 1,2,3,4,5,6,7 (SUNDAY,MONDAY,TUESDAY,WEDNESDAY,THURSDAY,FRIDAY,SATURDAY)
 | 
			
		||||
# Classic: 6,7 (FRIDAY,SATURDAY)
 | 
			
		||||
AltOlyCompetitionDays = 6,7
 | 
			
		||||
 | 
			
		||||
# ---------------------------------------------------------------------------
 | 
			
		||||
# Custom Olympiad period settings
 | 
			
		||||
@@ -190,9 +154,4 @@ AltOlyPeriod = MONTH
 | 
			
		||||
# then Olympiad will occur every 2 months.
 | 
			
		||||
# Default: 1
 | 
			
		||||
# Note! If type = DAY, multiplier must be >= 7!
 | 
			
		||||
AltOlyPeriodMultiplier = 1
 | 
			
		||||
 | 
			
		||||
# Enable competitions only on specific days.
 | 
			
		||||
# Default: 1,2,3,4,5,6,7 (SUNDAY,MONDAY,TUESDAY,WEDNESDAY,THURSDAY,FRIDAY,SATURDAY)
 | 
			
		||||
# Classic: 6,7
 | 
			
		||||
AltOlyCompetitionDays = 6,7
 | 
			
		||||
AltOlyPeriodMultiplier = 1
 | 
			
		||||
@@ -30,7 +30,6 @@ import org.l2jmobius.gameserver.model.Location;
 | 
			
		||||
import org.l2jmobius.gameserver.model.actor.Creature;
 | 
			
		||||
import org.l2jmobius.gameserver.model.actor.Npc;
 | 
			
		||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
 | 
			
		||||
import org.l2jmobius.gameserver.model.olympiad.CompetitionType;
 | 
			
		||||
import org.l2jmobius.gameserver.model.olympiad.Olympiad;
 | 
			
		||||
import org.l2jmobius.gameserver.model.olympiad.OlympiadGameManager;
 | 
			
		||||
import org.l2jmobius.gameserver.model.olympiad.OlympiadGameTask;
 | 
			
		||||
@@ -124,7 +123,7 @@ public final class OlyManager extends AbstractNpcAI implements IBypassHandler
 | 
			
		||||
				}
 | 
			
		||||
				else
 | 
			
		||||
				{
 | 
			
		||||
					OlympiadManager.getInstance().registerNoble(player, CompetitionType.NON_CLASSED);
 | 
			
		||||
					OlympiadManager.getInstance().registerNoble(player);
 | 
			
		||||
				}
 | 
			
		||||
				break;
 | 
			
		||||
			}
 | 
			
		||||
 
 | 
			
		||||
@@ -25,7 +25,7 @@ import org.l2jmobius.gameserver.model.WorldObject;
 | 
			
		||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
 | 
			
		||||
import org.l2jmobius.gameserver.model.olympiad.Olympiad;
 | 
			
		||||
import org.l2jmobius.gameserver.model.olympiad.OlympiadGameManager;
 | 
			
		||||
import org.l2jmobius.gameserver.model.olympiad.OlympiadGameNonClassed;
 | 
			
		||||
import org.l2jmobius.gameserver.model.olympiad.OlympiadGameNormal;
 | 
			
		||||
import org.l2jmobius.gameserver.model.olympiad.OlympiadGameTask;
 | 
			
		||||
import org.l2jmobius.gameserver.model.olympiad.OlympiadManager;
 | 
			
		||||
import org.l2jmobius.gameserver.model.olympiad.Participant;
 | 
			
		||||
@@ -91,7 +91,7 @@ public class AdminOlympiad implements IAdminCommandHandler
 | 
			
		||||
								final Participant[] players = new Participant[2];
 | 
			
		||||
								players[0] = new Participant(activeChar, 1);
 | 
			
		||||
								players[1] = new Participant(player, 2);
 | 
			
		||||
								task.attachGame(new OlympiadGameNonClassed(i, players));
 | 
			
		||||
								task.attachGame(new OlympiadGameNormal(i, players));
 | 
			
		||||
								return true;
 | 
			
		||||
							}
 | 
			
		||||
						}
 | 
			
		||||
@@ -251,9 +251,6 @@ public class AdminOlympiad implements IAdminCommandHandler
 | 
			
		||||
			statDat.set(Olympiad.COMP_LOST, 0);
 | 
			
		||||
			statDat.set(Olympiad.COMP_DRAWN, 0);
 | 
			
		||||
			statDat.set(Olympiad.COMP_DONE_WEEK, 0);
 | 
			
		||||
			statDat.set(Olympiad.COMP_DONE_WEEK_CLASSED, 0);
 | 
			
		||||
			statDat.set(Olympiad.COMP_DONE_WEEK_NON_CLASSED, 0);
 | 
			
		||||
			statDat.set(Olympiad.COMP_DONE_WEEK_TEAM, 0);
 | 
			
		||||
			statDat.set("to_save", true);
 | 
			
		||||
			Olympiad.addNobleStats(player.getObjectId(), statDat);
 | 
			
		||||
		}
 | 
			
		||||
 
 | 
			
		||||
@@ -59,9 +59,6 @@ public class OlympiadStat implements IUserCommandHandler
 | 
			
		||||
		
 | 
			
		||||
		final SystemMessage sm2 = SystemMessage.getSystemMessage(SystemMessageId.THE_MATCHES_THIS_WEEK_ARE_ALL_CLASS_BATTLES_THE_NUMBER_OF_MATCHES_THAT_ARE_ALLOWED_TO_PARTICIPATE_IS_S1);
 | 
			
		||||
		sm2.addInt(Olympiad.getInstance().getRemainingWeeklyMatches(nobleObjId));
 | 
			
		||||
		sm2.addInt(Olympiad.getInstance().getRemainingWeeklyMatchesClassed(nobleObjId));
 | 
			
		||||
		sm2.addInt(Olympiad.getInstance().getRemainingWeeklyMatchesNonClassed(nobleObjId));
 | 
			
		||||
		sm2.addInt(Olympiad.getInstance().getRemainingWeeklyMatchesTeam(nobleObjId));
 | 
			
		||||
		player.sendPacket(sm2);
 | 
			
		||||
		return true;
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user