Removal of hardcoded events and addition of player isOnCustomEvent methods.
This commit is contained in:
parent
d0c5cfe4c7
commit
8fdb4899ac
@ -1,28 +0,0 @@
|
|||||||
-- --------------------------------
|
|
||||||
-- Table structure for table `ctf`
|
|
||||||
-- Created by SqueezeD & Serpent for l2jfree
|
|
||||||
-- --------------------------------
|
|
||||||
DROP TABLE IF EXISTS `ctf`;
|
|
||||||
CREATE TABLE `ctf` (
|
|
||||||
`eventName` varchar(255) NOT NULL default '',
|
|
||||||
`eventDesc` varchar(255) NOT NULL default '',
|
|
||||||
`joiningLocation` varchar(255) NOT NULL default '',
|
|
||||||
`minLevel` int(4) NOT NULL default '0',
|
|
||||||
`maxLevel` int(4) NOT NULL default '0',
|
|
||||||
`npcId` int(8) NOT NULL default '0',
|
|
||||||
`npcX` int(11) NOT NULL default '0',
|
|
||||||
`npcY` int(11) NOT NULL default '0',
|
|
||||||
`npcZ` int(11) NOT NULL default '0',
|
|
||||||
`npcHeading` int(11) NOT NULL default '0',
|
|
||||||
`rewardId` int(11) NOT NULL default '0',
|
|
||||||
`rewardAmount` int(11) NOT NULL default '0',
|
|
||||||
`teamsCount` int(4) NOT NULL default '0',
|
|
||||||
`joinTime` int(11) NOT NULL default '0',
|
|
||||||
`eventTime` int(11) NOT NULL default '0',
|
|
||||||
`minPlayers` int(4) NOT NULL default '0',
|
|
||||||
`maxPlayers` int(4) NOT NULL default '0',
|
|
||||||
`delayForNextEvent` BIGINT NOT NULL DEFAULT '0'
|
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
||||||
|
|
||||||
INSERT INTO `ctf` (`eventName`, `eventDesc`, `joiningLocation`, `minLevel`, `maxLevel`, `npcId`, `npcX`, `npcY`, `npcZ`, `npcHeading`, `rewardId`, `rewardAmount`, `teamsCount`, `joinTime`, `eventTime`, `minPlayers`, `maxPlayers`, `delayForNextEvent`) VALUES
|
|
||||||
('Capture the flag', 'CTF', 'Giran', 1, 80, 70011, 82580, 148552, -3468, 16972, 8752, 1, 2, 5, 5, 2, 50, 300000);
|
|
@ -1,21 +0,0 @@
|
|||||||
-- --------------------------------
|
|
||||||
-- Table structure for ctf_teams
|
|
||||||
-- Created by SqueezeD & Serpent for l2jfree
|
|
||||||
-- --------------------------------
|
|
||||||
DROP TABLE IF EXISTS `ctf_teams`;
|
|
||||||
CREATE TABLE `ctf_teams` (
|
|
||||||
`teamId` int(4) NOT NULL default '0',
|
|
||||||
`teamName` varchar(255) NOT NULL default '',
|
|
||||||
`teamX` int(11) NOT NULL default '0',
|
|
||||||
`teamY` int(11) NOT NULL default '0',
|
|
||||||
`teamZ` int(11) NOT NULL default '0',
|
|
||||||
`teamColor` int(11) NOT NULL default '0',
|
|
||||||
`flagX` int(11) NOT NULL default '0',
|
|
||||||
`flagY` int(11) NOT NULL default '0',
|
|
||||||
`flagZ` int(11) NOT NULL default '0',
|
|
||||||
PRIMARY KEY (`teamId`)
|
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
||||||
|
|
||||||
INSERT INTO `ctf_teams` (`teamId`, `teamName`, `teamX`, `teamY`, `teamZ`, `teamColor`, `flagX`, `flagY`, `flagZ`) VALUES
|
|
||||||
(0, 'Blue', 87357, -145722, -1288, 16711680, 87358, -145979, -1291),
|
|
||||||
(1, 'Red', 87351, -139984, -1536, 255, 87359, -139584, -1536);
|
|
@ -53,9 +53,4 @@ INSERT ignore INTO custom_npc values
|
|||||||
('50000', '31228', 'Dom the Cat', '1', 'Merchant', '1', 'Monster.cat_the_cat', '9.00', '16.00', '70', 'male', 'Merchant', '40', '3862', '1493', '11.85', '2.78', '40', '43', '30', '21', '20', '10', '490', '10', '1335', '470', '780', '382', '278', '0', '333', '0', '0', '0', '88', '132', null, '0', '0', '0', 'LAST_HIT'),
|
('50000', '31228', 'Dom the Cat', '1', 'Merchant', '1', 'Monster.cat_the_cat', '9.00', '16.00', '70', 'male', 'Merchant', '40', '3862', '1493', '11.85', '2.78', '40', '43', '30', '21', '20', '10', '490', '10', '1335', '470', '780', '382', '278', '0', '333', '0', '0', '0', '88', '132', null, '0', '0', '0', 'LAST_HIT'),
|
||||||
('50007', '31324', 'Andromeda', '1', 'Wedding Manager', '1', 'NPC.a_casino_FDarkElf', '8.00', '23.00', '70', 'female', 'WeddingManager', '40', '3862', '1493', '500', '500', '40', '43', '30', '21', '20', '10', '0', '0', '9999', '9999', '999', '999', '278', '0', '333', '316', '0', '0', '55', '132', null, '0', '1', '0', 'LAST_HIT'),
|
('50007', '31324', 'Andromeda', '1', 'Wedding Manager', '1', 'NPC.a_casino_FDarkElf', '8.00', '23.00', '70', 'female', 'WeddingManager', '40', '3862', '1493', '500', '500', '40', '43', '30', '21', '20', '10', '0', '0', '9999', '9999', '999', '999', '278', '0', '333', '316', '0', '0', '55', '132', null, '0', '1', '0', 'LAST_HIT'),
|
||||||
('50008', '31228', 'Rex the Cat', '1', 'Buffer', '1', 'Monster.cat_the_cat', '9.00', '16.00', '70', 'male', 'SchemeBuffer', '40', '3862', '1493', '11.85', '2.78', '40', '43', '30', '21', '20', '10', '490', '10', '1335', '470', '780', '382', '278', '0', '333', '0', '0', '0', '88', '132', null, '0', '0', '0', 'LAST_HIT'),
|
('50008', '31228', 'Rex the Cat', '1', 'Buffer', '1', 'Monster.cat_the_cat', '9.00', '16.00', '70', 'male', 'SchemeBuffer', '40', '3862', '1493', '11.85', '2.78', '40', '43', '30', '21', '20', '10', '490', '10', '1335', '470', '780', '382', '278', '0', '333', '0', '0', '0', '88', '132', null, '0', '0', '0', 'LAST_HIT'),
|
||||||
('55555', '22124', 'Totor', '1', 'Rebirth Manager', '1', 'NPC.a_fighterguild_master_FHuman', '11.00', '27.00', '83', 'male', 'Merchant', '40', '3862', '1493', '11.85', '2.78', '40', '43', '30', '21', '20', '10', '0', '0', '1314', '470', '780', '382', '278', '0', '333', '0', '0', '0', '88', '132', null, '0', '0', '0', 'LAST_HIT'),
|
('55555', '22124', 'Totor', '1', 'Rebirth Manager', '1', 'NPC.a_fighterguild_master_FHuman', '11.00', '27.00', '83', 'male', 'Merchant', '40', '3862', '1493', '11.85', '2.78', '40', '43', '30', '21', '20', '10', '0', '0', '1314', '470', '780', '382', '278', '0', '333', '0', '0', '0', '88', '132', null, '0', '0', '0', 'LAST_HIT');
|
||||||
('70010', '31606', 'Catrina', '1', 'TvT Event Manager', '1', 'Monster2.queen_of_cat', '8.00', '15.00', '70', 'female', 'Npc', '40', '3862', '1493', '11.85', '2.78', '40', '43', '30', '21', '20', '10', '0', '0', '1314', '470', '780', '382', '278', '0', '333', '0', '0', '0', '28', '132', null, '0', '0', '0', 'LAST_HIT'),
|
|
||||||
('70011', '31606', 'Catretta', '1', 'CTF Event Manager', '1', 'Monster2.queen_of_cat', '8.00', '15.00', '70', 'female', 'Npc', '40', '3862', '1493', '11.85', '2.78', '40', '43', '30', '21', '20', '10', '0', '0', '1314', '470', '780', '382', '278', '0', '333', '0', '0', '0', '28', '132', null, '0', '0', '0', 'LAST_HIT'),
|
|
||||||
('70012', '31606', 'Catrosa', '1', 'VIP Join Manager', '1', 'Monster2.queen_of_cat', '8.00', '15.00', '70', 'female', 'Npc', '40', '3862', '1493', '11.85', '2.78', '40', '43', '30', '21', '20', '10', '0', '0', '1314', '470', '780', '382', '278', '0', '333', '0', '0', '0', '28', '132', null, '0', '0', '0', 'LAST_HIT'),
|
|
||||||
('70013', '31606', 'Catrigna', '1', 'VIP End Manager', '1', 'Monster2.queen_of_cat', '8.00', '15.00', '70', 'female', 'Npc', '40', '3862', '1493', '11.85', '2.78', '40', '43', '30', '21', '20', '10', '0', '0', '1314', '470', '780', '382', '278', '0', '333', '0', '0', '0', '28', '132', null, '0', '0', '0', 'LAST_HIT'),
|
|
||||||
('70014', '31606', 'Catrieta', '1', 'DM Event Manager', '1', 'Monster2.queen_of_cat', '8.00', '15.00', '70', 'female', 'Npc', '40', '3862', '1493', '11.85', '2.78', '40', '43', '30', '21', '20', '10', '0', '0', '1314', '470', '780', '382', '278', '0', '333', '0', '0', '0', '28', '132', null, '0', '0', '0', 'LAST_HIT');
|
|
||||||
|
@ -1,31 +0,0 @@
|
|||||||
-- --------------------------------
|
|
||||||
-- Table structure for table `dm`
|
|
||||||
-- Created by SqueezeD from l2jfree
|
|
||||||
-- --------------------------------
|
|
||||||
DROP TABLE IF EXISTS `dm`;
|
|
||||||
CREATE TABLE `dm` (
|
|
||||||
`eventName` varchar(255) NOT NULL default '',
|
|
||||||
`eventDesc` varchar(255) NOT NULL default '',
|
|
||||||
`joiningLocation` varchar(255) NOT NULL default '',
|
|
||||||
`minLevel` int(4) NOT NULL default '0',
|
|
||||||
`maxLevel` int(4) NOT NULL default '0',
|
|
||||||
`npcId` int(8) NOT NULL default '0',
|
|
||||||
`npcX` int(11) NOT NULL default '0',
|
|
||||||
`npcY` int(11) NOT NULL default '0',
|
|
||||||
`npcZ` int(11) NOT NULL default '0',
|
|
||||||
`npcHeading` int(11) NOT NULL DEFAULT '0',
|
|
||||||
`rewardId` int(11) NOT NULL default '0',
|
|
||||||
`rewardAmount` int(11) NOT NULL default '0',
|
|
||||||
`joinTime` int(11) NOT NULL DEFAULT '0',
|
|
||||||
`eventTime` int(11) NOT NULL DEFAULT '0',
|
|
||||||
`minPlayers` int(11) NOT NULL DEFAULT '0',
|
|
||||||
`maxPlayers` int(11) NOT NULL DEFAULT '0',
|
|
||||||
`color` int(11) NOT NULL default '0',
|
|
||||||
`playerX` int(11) NOT NULL default '0',
|
|
||||||
`playerY` int(11) NOT NULL default '0',
|
|
||||||
`playerZ` int(11) NOT NULL default '0',
|
|
||||||
`delayForNextEvent` BIGINT NOT NULL DEFAULT '0'
|
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
||||||
|
|
||||||
INSERT INTO `dm` values
|
|
||||||
('DM', 'A PvP Event', 'Giran', 1, 81, 70014, 82580, 148552, -3468, 1, 8752, 1, 2, 5, 2, 50, 2552550, 116615, 76200, -2729, 300000);
|
|
@ -1,9 +0,0 @@
|
|||||||
#----------------------------
|
|
||||||
# Table structure for pkkills
|
|
||||||
#----------------------------
|
|
||||||
CREATE TABLE IF NOT EXISTS `pkkills` (
|
|
||||||
`killerId` varchar(45) NOT NULL,
|
|
||||||
`killedId` varchar(45) NOT NULL,
|
|
||||||
`kills` decimal(11,0) NOT NULL,
|
|
||||||
PRIMARY KEY (`killerId` ,`killedId` )
|
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
@ -1,30 +0,0 @@
|
|||||||
-- -----------------------
|
|
||||||
-- Table structure for tvt
|
|
||||||
-- -----------------------
|
|
||||||
DROP TABLE IF EXISTS `tvt`;
|
|
||||||
CREATE TABLE `tvt` (
|
|
||||||
`eventName` varchar(255) NOT NULL DEFAULT '',
|
|
||||||
`eventDesc` varchar(255) NOT NULL DEFAULT '',
|
|
||||||
`joiningLocation` varchar(255) NOT NULL DEFAULT '',
|
|
||||||
`minLevel` int(4) NOT NULL DEFAULT '0',
|
|
||||||
`maxLevel` int(4) NOT NULL DEFAULT '0',
|
|
||||||
`npcId` int(8) NOT NULL DEFAULT '0',
|
|
||||||
`npcX` int(11) NOT NULL DEFAULT '0',
|
|
||||||
`npcY` int(11) NOT NULL DEFAULT '0',
|
|
||||||
`npcZ` int(11) NOT NULL DEFAULT '0',
|
|
||||||
`npcHeading` int(11) NOT NULL DEFAULT '0',
|
|
||||||
`rewardId` int(11) NOT NULL DEFAULT '0',
|
|
||||||
`rewardAmount` int(11) NOT NULL DEFAULT '0',
|
|
||||||
`teamsCount` int(4) NOT NULL DEFAULT '0',
|
|
||||||
`joinTime` int(11) NOT NULL DEFAULT '0',
|
|
||||||
`eventTime` int(11) NOT NULL DEFAULT '0',
|
|
||||||
`minPlayers` int(4) NOT NULL DEFAULT '0',
|
|
||||||
`maxPlayers` int(4) NOT NULL DEFAULT '0',
|
|
||||||
`delayForNextEvent` BIGINT NOT NULL DEFAULT '0'
|
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
||||||
|
|
||||||
-- ---------------------
|
|
||||||
-- Records for table tvt
|
|
||||||
-- ---------------------
|
|
||||||
INSERT INTO `tvt` values
|
|
||||||
('TVT', 'A PvP Event', 'Giran', 1, 81, 70010, 82688, 148677, -3469, 0, 8752, 1, 2, 5, 5, 2, 50, 300000);
|
|
@ -1,21 +0,0 @@
|
|||||||
-- -----------------------------
|
|
||||||
-- Table structure for tvt_teams
|
|
||||||
-- -----------------------------
|
|
||||||
DROP TABLE IF EXISTS `tvt_teams`;
|
|
||||||
CREATE TABLE `tvt_teams` (
|
|
||||||
`teamId` int(4) NOT NULL DEFAULT '0',
|
|
||||||
`teamName` varchar(255) NOT NULL DEFAULT '',
|
|
||||||
`teamX` int(11) NOT NULL DEFAULT '0',
|
|
||||||
`teamY` int(11) NOT NULL DEFAULT '0',
|
|
||||||
`teamZ` int(11) NOT NULL DEFAULT '0',
|
|
||||||
`teamColor` int(11) NOT NULL DEFAULT '0',
|
|
||||||
PRIMARY KEY (`teamId`)
|
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
||||||
|
|
||||||
-- ---------------------------
|
|
||||||
-- Records for table tvt_teams
|
|
||||||
-- ---------------------------
|
|
||||||
INSERT INTO `tvt_teams` VALUES
|
|
||||||
('0', 'Blue', '148179', '45841', '-3413', '16711680'),
|
|
||||||
('1', 'Red', '150787', '45822', '-3413', '255'),
|
|
||||||
('2', 'Green', '149496', '47826', '-3413', '26367');
|
|
@ -1,20 +0,0 @@
|
|||||||
CREATE TABLE `VIPinfo` (
|
|
||||||
`teamID` int(11) NOT NULL,
|
|
||||||
`endx` int(11) NOT NULL,
|
|
||||||
`endy` int(11) NOT NULL,
|
|
||||||
`endz` int(11) NOT NULL,
|
|
||||||
`startx` int(11) NOT NULL,
|
|
||||||
`starty` int(11) NOT NULL,
|
|
||||||
`startz` int(11) NOT NULL,
|
|
||||||
PRIMARY KEY (`teamID`)
|
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;
|
|
||||||
|
|
||||||
--
|
|
||||||
-- Dumping data for table `VIPinfo`
|
|
||||||
--
|
|
||||||
|
|
||||||
INSERT INTO `VIPinfo` VALUES (1, -84583, 242788, -3735, -101319, 213272, -3100);
|
|
||||||
INSERT INTO `VIPinfo` VALUES (2, 45714, 49703, -3065, 55782, 81597, -3610);
|
|
||||||
INSERT INTO `VIPinfo` VALUES (3, 11249, 16890, -4667, -22732, 12586, -2996);
|
|
||||||
INSERT INTO `VIPinfo` VALUES (4, -44737, -113582, -204, 27053, -88454, -3286);
|
|
||||||
INSERT INTO `VIPinfo` VALUES (5, 116047, -179059, -1026, 121145, -215673, -3571);
|
|
@ -67,43 +67,6 @@
|
|||||||
<admin command="admin_create_coin" accessLevel="80" />
|
<admin command="admin_create_coin" accessLevel="80" />
|
||||||
<admin command="admin_mass_create" accessLevel="100" />
|
<admin command="admin_mass_create" accessLevel="100" />
|
||||||
|
|
||||||
<!-- Section: CTF -->
|
|
||||||
<admin command="admin_ctf" accessLevel="80" />
|
|
||||||
<admin command="admin_ctf_name" accessLevel="80" />
|
|
||||||
<admin command="admin_ctf_desc" accessLevel="80" />
|
|
||||||
<admin command="admin_ctf_join_loc" accessLevel="80" />
|
|
||||||
<admin command="admin_ctf_edit" accessLevel="80" />
|
|
||||||
<admin command="admin_ctf_control" accessLevel="80" />
|
|
||||||
<admin command="admin_ctf_minlvl" accessLevel="80" />
|
|
||||||
<admin command="admin_ctf_maxlvl" accessLevel="80" />
|
|
||||||
<admin command="admin_ctf_tele_npc" accessLevel="80" />
|
|
||||||
<admin command="admin_ctf_tele_team" accessLevel="80" />
|
|
||||||
<admin command="admin_ctf_tele_flag" accessLevel="80" />
|
|
||||||
<admin command="admin_ctf_npc" accessLevel="80" />
|
|
||||||
<admin command="admin_ctf_npc_pos" accessLevel="80" />
|
|
||||||
<admin command="admin_ctf_reward" accessLevel="80" />
|
|
||||||
<admin command="admin_ctf_reward_amount" accessLevel="80" />
|
|
||||||
<admin command="admin_ctf_team_add" accessLevel="80" />
|
|
||||||
<admin command="admin_ctf_team_remove" accessLevel="80" />
|
|
||||||
<admin command="admin_ctf_team_pos" accessLevel="80" />
|
|
||||||
<admin command="admin_ctf_team_color" accessLevel="80" />
|
|
||||||
<admin command="admin_ctf_team_flag" accessLevel="80" />
|
|
||||||
<admin command="admin_ctf_join" accessLevel="80" />
|
|
||||||
<admin command="admin_ctf_teleport" accessLevel="80" />
|
|
||||||
<admin command="admin_ctf_start" accessLevel="80" />
|
|
||||||
<admin command="admin_ctf_abort" accessLevel="80" />
|
|
||||||
<admin command="admin_ctf_finish" accessLevel="80" />
|
|
||||||
<admin command="admin_ctf_sit" accessLevel="80" />
|
|
||||||
<admin command="admin_ctf_dump" accessLevel="80" />
|
|
||||||
<admin command="admin_ctf_save" accessLevel="80" />
|
|
||||||
<admin command="admin_ctf_load" accessLevel="80" />
|
|
||||||
<admin command="admin_ctf_jointime" accessLevel="80" />
|
|
||||||
<admin command="admin_ctf_eventtime" accessLevel="80" />
|
|
||||||
<admin command="admin_ctf_autoevent" accessLevel="80" />
|
|
||||||
<admin command="admin_ctf_minplayers" accessLevel="80" />
|
|
||||||
<admin command="admin_ctf_maxplayers" accessLevel="80" />
|
|
||||||
<admin command="admin_ctf_interval" accessLevel="80" />
|
|
||||||
|
|
||||||
<!-- Section: Delete -->
|
<!-- Section: Delete -->
|
||||||
<admin command="admin_delete" accessLevel="80" />
|
<admin command="admin_delete" accessLevel="80" />
|
||||||
|
|
||||||
@ -116,29 +79,6 @@
|
|||||||
<!-- Section: Disconnect -->
|
<!-- Section: Disconnect -->
|
||||||
<admin command="admin_character_disconnect" accessLevel="90" />
|
<admin command="admin_character_disconnect" accessLevel="90" />
|
||||||
|
|
||||||
<!-- Section: DMEngine -->
|
|
||||||
<admin command="admin_dmevent" accessLevel="80" />
|
|
||||||
<admin command="admin_dmevent_name" accessLevel="80" />
|
|
||||||
<admin command="admin_dmevent_desc" accessLevel="80" />
|
|
||||||
<admin command="admin_dmevent_join_loc" accessLevel="80" />
|
|
||||||
<admin command="admin_dmevent_minlvl" accessLevel="80" />
|
|
||||||
<admin command="admin_dmevent_maxlvl" accessLevel="80" />
|
|
||||||
<admin command="admin_dmevent_npc" accessLevel="80" />
|
|
||||||
<admin command="admin_dmevent_npc_pos" accessLevel="80" />
|
|
||||||
<admin command="admin_dmevent_reward" accessLevel="80" />
|
|
||||||
<admin command="admin_dmevent_reward_amount" accessLevel="80" />
|
|
||||||
<admin command="admin_dmevent_spawnpos" accessLevel="80" />
|
|
||||||
<admin command="admin_dmevent_color" accessLevel="80" />
|
|
||||||
<admin command="admin_dmevent_join" accessLevel="80" />
|
|
||||||
<admin command="admin_dmevent_teleport" accessLevel="80" />
|
|
||||||
<admin command="admin_dmevent_start" accessLevel="80" />
|
|
||||||
<admin command="admin_dmevent_abort" accessLevel="80" />
|
|
||||||
<admin command="admin_dmevent_finish" accessLevel="80" />
|
|
||||||
<admin command="admin_dmevent_sit" accessLevel="80" />
|
|
||||||
<admin command="admin_dmevent_dump" accessLevel="80" />
|
|
||||||
<admin command="admin_dmevent_save" accessLevel="80" />
|
|
||||||
<admin command="admin_dmevent_load" accessLevel="80" />
|
|
||||||
|
|
||||||
<!-- Section: Donator -->
|
<!-- Section: Donator -->
|
||||||
<admin command="admin_setdonator" accessLevel="100" />
|
<admin command="admin_setdonator" accessLevel="100" />
|
||||||
|
|
||||||
@ -253,29 +193,6 @@
|
|||||||
<admin command="admin_setba" accessLevel="90" />
|
<admin command="admin_setba" accessLevel="90" />
|
||||||
<admin command="admin_enchant" accessLevel="90" />
|
<admin command="admin_enchant" accessLevel="90" />
|
||||||
|
|
||||||
<!-- Section: EventEngine -->
|
|
||||||
<admin command="admin_event" accessLevel="80" />
|
|
||||||
<admin command="admin_event_new" accessLevel="80" />
|
|
||||||
<admin command="admin_event_choose" accessLevel="80" />
|
|
||||||
<admin command="admin_event_store" accessLevel="80" />
|
|
||||||
<admin command="admin_event_set" accessLevel="80" />
|
|
||||||
<admin command="admin_event_change_teams_number" accessLevel="80" />
|
|
||||||
<admin command="admin_event_announce" accessLevel="80" />
|
|
||||||
<admin command="admin_event_panel" accessLevel="80" />
|
|
||||||
<admin command="admin_event_control_begin" accessLevel="80" />
|
|
||||||
<admin command="admin_event_control_teleport" accessLevel="80" />
|
|
||||||
<admin command="admin_add" accessLevel="80" />
|
|
||||||
<admin command="admin_event_see" accessLevel="80" />
|
|
||||||
<admin command="admin_event_del" accessLevel="80" />
|
|
||||||
<admin command="admin_delete_buffer" accessLevel="80" />
|
|
||||||
<admin command="admin_event_control_sit" accessLevel="80" />
|
|
||||||
<admin command="admin_event_name" accessLevel="80" />
|
|
||||||
<admin command="admin_event_control_kill" accessLevel="80" />
|
|
||||||
<admin command="admin_event_control_res" accessLevel="80" />
|
|
||||||
<admin command="admin_event_control_prize" accessLevel="80" />
|
|
||||||
<admin command="admin_event_control_chatban" accessLevel="80" />
|
|
||||||
<admin command="admin_event_control_finish" accessLevel="80" />
|
|
||||||
|
|
||||||
<!-- Section: ExpSp -->
|
<!-- Section: ExpSp -->
|
||||||
<admin command="admin_add_exp_sp_to_character" accessLevel="90" />
|
<admin command="admin_add_exp_sp_to_character" accessLevel="90" />
|
||||||
<admin command="admin_add_exp_sp" accessLevel="90" />
|
<admin command="admin_add_exp_sp" accessLevel="90" />
|
||||||
@ -535,59 +452,6 @@
|
|||||||
<admin command="admin_st" accessLevel="80" />
|
<admin command="admin_st" accessLevel="80" />
|
||||||
<admin command="admin_mp" accessLevel="80" />
|
<admin command="admin_mp" accessLevel="80" />
|
||||||
|
|
||||||
<!-- Section: TownWar -->
|
|
||||||
<admin command="admin_townwar_start" accessLevel="80" />
|
|
||||||
<admin command="admin_townwar_end" accessLevel="80" />
|
|
||||||
|
|
||||||
<!-- Section: TvTEngine -->
|
|
||||||
<admin command="admin_tvt" accessLevel="80" />
|
|
||||||
<admin command="admin_tvt_name" accessLevel="80" />
|
|
||||||
<admin command="admin_tvt_desc" accessLevel="80" />
|
|
||||||
<admin command="admin_tvt_join_loc" accessLevel="80" />
|
|
||||||
<admin command="admin_tvt_minlvl" accessLevel="80" />
|
|
||||||
<admin command="admin_tvt_maxlvl" accessLevel="80" />
|
|
||||||
<admin command="admin_tvt_npc" accessLevel="80" />
|
|
||||||
<admin command="admin_tvt_npc_pos" accessLevel="80" />
|
|
||||||
<admin command="admin_tvt_reward" accessLevel="80" />
|
|
||||||
<admin command="admin_tvt_reward_amount" accessLevel="80" />
|
|
||||||
<admin command="admin_tvt_team_add" accessLevel="80" />
|
|
||||||
<admin command="admin_tvt_team_remove" accessLevel="80" />
|
|
||||||
<admin command="admin_tvt_team_pos" accessLevel="80" />
|
|
||||||
<admin command="admin_tvt_team_color" accessLevel="80" />
|
|
||||||
<admin command="admin_tvt_join" accessLevel="80" />
|
|
||||||
<admin command="admin_tvt_teleport" accessLevel="80" />
|
|
||||||
<admin command="admin_tvt_start" accessLevel="80" />
|
|
||||||
<admin command="admin_tvt_abort" accessLevel="80" />
|
|
||||||
<admin command="admin_tvt_finish" accessLevel="80" />
|
|
||||||
<admin command="admin_tvt_sit" accessLevel="80" />
|
|
||||||
<admin command="admin_tvt_dump" accessLevel="80" />
|
|
||||||
<admin command="admin_tvt_save" accessLevel="80" />
|
|
||||||
<admin command="admin_tvt_load" accessLevel="80" />
|
|
||||||
<admin command="admin_tvt_jointime" accessLevel="80" />
|
|
||||||
<admin command="admin_tvt_eventtime" accessLevel="80" />
|
|
||||||
<admin command="admin_tvt_autoevent" accessLevel="80" />
|
|
||||||
<admin command="admin_tvt_minplayers" accessLevel="80" />
|
|
||||||
<admin command="admin_tvt_maxplayers" accessLevel="80" />
|
|
||||||
<admin command="admin_tvtkick" accessLevel="80" />
|
|
||||||
|
|
||||||
<!-- Section: VIPEngine -->
|
|
||||||
<admin command="admin_vip" accessLevel="80" />
|
|
||||||
<admin command="admin_vip_setteam" accessLevel="80" />
|
|
||||||
<admin command="admin_vip_randomteam" accessLevel="80" />
|
|
||||||
<admin command="admin_vip_settime" accessLevel="80" />
|
|
||||||
<admin command="admin_vip_endnpc" accessLevel="80" />
|
|
||||||
<admin command="admin_vip_setdelay" accessLevel="80" />
|
|
||||||
<admin command="admin_vip_joininit" accessLevel="80" />
|
|
||||||
<admin command="admin_vip_joinnpc" accessLevel="80" />
|
|
||||||
<admin command="admin_vip_joinlocxyz" accessLevel="80" />
|
|
||||||
<admin command="admin_vip_setarea" accessLevel="80" />
|
|
||||||
<admin command="admin_vip_vipreward" accessLevel="80" />
|
|
||||||
<admin command="admin_vip_viprewardamount" accessLevel="80" />
|
|
||||||
<admin command="admin_vip_thevipreward" accessLevel="80" />
|
|
||||||
<admin command="admin_vip_theviprewardamount" accessLevel="80" />
|
|
||||||
<admin command="admin_vip_notvipreward" accessLevel="80" />
|
|
||||||
<admin command="admin_vip_notviprewardamount" accessLevel="80" />
|
|
||||||
|
|
||||||
<!-- Section: Walker -->
|
<!-- Section: Walker -->
|
||||||
<admin command="admin_walker_setmessage" accessLevel="80" />
|
<admin command="admin_walker_setmessage" accessLevel="80" />
|
||||||
<admin command="admin_walker_menu" accessLevel="80" />
|
<admin command="admin_walker_menu" accessLevel="80" />
|
||||||
|
@ -223,47 +223,6 @@ DonatorDropRate = 1.5
|
|||||||
DonatorSpoilRate = 1.5
|
DonatorSpoilRate = 1.5
|
||||||
|
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------
|
|
||||||
# Commands
|
|
||||||
# ---------------------------------------------------------------------------
|
|
||||||
|
|
||||||
# Allow players to use command .farm1
|
|
||||||
AllowFarm1Command = False
|
|
||||||
# Put your Farm1 Location ( x,y,z )
|
|
||||||
farm1_X = 81304
|
|
||||||
farm1_Y = 14589
|
|
||||||
farm1_Z = -3469
|
|
||||||
# Message after successful TP
|
|
||||||
Farm1CustomMeesage = You have been teleported to Farm Zone 1!
|
|
||||||
|
|
||||||
# Allow players to use command .farm2
|
|
||||||
AllowFarm2Command = False
|
|
||||||
# Put your Farm2 Location ( x,y,z )
|
|
||||||
farm2_X = 81304
|
|
||||||
farm2_Y = 14589
|
|
||||||
farm2_Z = -3469
|
|
||||||
# Message after successful TP
|
|
||||||
Farm2CustomMeesage = You have been teleported to Farm Zone 2!
|
|
||||||
|
|
||||||
# Allow players to use command .pvp1
|
|
||||||
AllowPvP1Command = False
|
|
||||||
# Put your Farm1 Location ( x,y,z )
|
|
||||||
pvp1_X = 81304
|
|
||||||
pvp1_Y = 14589
|
|
||||||
pvp1_Z = -3469
|
|
||||||
# Message after successful TP
|
|
||||||
PvP1CustomMeesage = You have been teleported to PvP Zone 1!
|
|
||||||
|
|
||||||
# Allow players to use command .pvp2
|
|
||||||
AllowPvP2Command = False
|
|
||||||
# Put your Farm2 Location ( x,y,z )
|
|
||||||
pvp2_X = 81304
|
|
||||||
pvp2_Y = 14589
|
|
||||||
pvp2_Z = -3469
|
|
||||||
# Message after successful TP
|
|
||||||
PvP2CustomMeesage = You have been teleported to PvP Zone 2!
|
|
||||||
|
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
# Protector
|
# Protector
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
|
@ -1,51 +0,0 @@
|
|||||||
#============================================================#
|
|
||||||
# CTF Event Engine #
|
|
||||||
#============================================================#
|
|
||||||
# CTF(Capture the flag) Event: Two teams with one flag.
|
|
||||||
|
|
||||||
# Setting for Capture The Flag
|
|
||||||
# CTFEvenTeams = NO|BALANCE|SHUFFLE
|
|
||||||
# NO means: not even teams.
|
|
||||||
# BALANCE means: Players can only join team with lowest player count.
|
|
||||||
# SHUFFLE means: Players can only participate to tzhe event and not
|
|
||||||
# direct to a team. Teams will be schuffeled in teleporting teams.
|
|
||||||
CTFEvenTeams = SHUFFLE
|
|
||||||
|
|
||||||
# Players there not participated in ctf can target ctf participants?
|
|
||||||
CTFAllowInterference = False
|
|
||||||
|
|
||||||
# Ctf participants can use potions?
|
|
||||||
CTFAllowPotions = False
|
|
||||||
|
|
||||||
# Ctf participants can summon by item?
|
|
||||||
CTFAllowSummon = False
|
|
||||||
|
|
||||||
# Remove all effects of ctf participants on event start?
|
|
||||||
CTFOnStartRemoveAllEffects = True
|
|
||||||
|
|
||||||
# Unsummon pet of ctf participants on event start?
|
|
||||||
CTFOnStartUnsummonPet = True
|
|
||||||
|
|
||||||
# On revive participants regain full hp/mp/cp ?
|
|
||||||
CTFReviveRecovery = False
|
|
||||||
|
|
||||||
# Announce all team statistics
|
|
||||||
CTFAnnounceTeamStats = False
|
|
||||||
|
|
||||||
# Announce Reward
|
|
||||||
CTFAnnounceReward = False
|
|
||||||
|
|
||||||
# Enable voice command to register on tvt/ctf events
|
|
||||||
CTFCommand = True
|
|
||||||
|
|
||||||
# Place an aura on participants team ?
|
|
||||||
CTFAura = False
|
|
||||||
|
|
||||||
# Enable event stats logger
|
|
||||||
CTFStatsLogger = True
|
|
||||||
|
|
||||||
# Spawn Team Offset to distribute players
|
|
||||||
CTFSpawnOffset = 300
|
|
||||||
|
|
||||||
# Remove Buffs on player die
|
|
||||||
CTFRemoveBuffsOnPlayerDie = False
|
|
@ -1,52 +0,0 @@
|
|||||||
#============================================================#
|
|
||||||
# DM Event Engine #
|
|
||||||
#============================================================#
|
|
||||||
# DM(DeathMatch) Event: All vs All.
|
|
||||||
|
|
||||||
# Players there not participated in DM can target DM participants?
|
|
||||||
DMAllowInterference = False
|
|
||||||
|
|
||||||
# DM participants can use potions?
|
|
||||||
DMAllowPotions = False
|
|
||||||
|
|
||||||
# DM participants can summon by item?
|
|
||||||
DMAllowSummon = False
|
|
||||||
|
|
||||||
# Remove all effects of DM participants on event start?
|
|
||||||
DMOnStartRemoveAllEffects = True
|
|
||||||
|
|
||||||
# Unsummon pet of DM participants on event start?
|
|
||||||
DMOnStartUnsummonPet = True
|
|
||||||
|
|
||||||
# Delay on revive when dead, NOTE: 20000 equals to 20 seconds, minimum 1000 (1 second)
|
|
||||||
DMReviveDelay = 20000
|
|
||||||
|
|
||||||
# On revive participants regain full hp/mp/cp ?
|
|
||||||
DMReviveRecovery = False
|
|
||||||
|
|
||||||
# Enable voice command to register on dm events (.dmjoin / .dmleave / .dminfo)
|
|
||||||
DMCommand = True
|
|
||||||
|
|
||||||
# Announce Reward
|
|
||||||
DMAnnounceReward = False
|
|
||||||
|
|
||||||
# Enable Kill Reward?
|
|
||||||
DMEnableKillReward = False
|
|
||||||
|
|
||||||
# Kill Reward ID
|
|
||||||
DMKillRewardID = 6392
|
|
||||||
|
|
||||||
# Kill Reward Amount
|
|
||||||
DMKillRewardAmount = 1
|
|
||||||
|
|
||||||
# Offset from center DM Spawn
|
|
||||||
DMSpawnOffset = 100
|
|
||||||
|
|
||||||
# Enable event stats logger
|
|
||||||
DMStatsLogger = True
|
|
||||||
|
|
||||||
# Enable healer classes into DM
|
|
||||||
DMAllowedHealerClasses = True
|
|
||||||
|
|
||||||
# Remove Buffs on player die
|
|
||||||
DMRemoveBuffsOnPlayerDie = False
|
|
@ -1,19 +0,0 @@
|
|||||||
#============================================================#
|
|
||||||
# Event Manager #
|
|
||||||
#============================================================#
|
|
||||||
# Enable auto events and start time.
|
|
||||||
|
|
||||||
# TvT auto start
|
|
||||||
# Example TVTStartTime = 20:00;21:00;22:00;
|
|
||||||
TVTEventEnabled = False
|
|
||||||
TVTStartTime = 20:00;
|
|
||||||
|
|
||||||
# CTF auto start
|
|
||||||
# Example CTFStartTime = 20:00;21:00;22:00;
|
|
||||||
CTFEventEnabled = False
|
|
||||||
CTFStartTime = 20:30;
|
|
||||||
|
|
||||||
# DM auto start
|
|
||||||
# Example DMStartTime = 20:00;21:00;22:00;
|
|
||||||
DMEventEnabled = False
|
|
||||||
DMStartTime = 21:00;
|
|
@ -1,48 +0,0 @@
|
|||||||
#============================================================#
|
|
||||||
# Town War #
|
|
||||||
#============================================================#
|
|
||||||
# TW (Town War): Town can became PvP Zone.
|
|
||||||
# ATTENTION:
|
|
||||||
# GM char can't be hit during Town war.
|
|
||||||
|
|
||||||
# //townwar_start - Starts town war in Giran
|
|
||||||
# //townwar_end - Ends townwar in Giran
|
|
||||||
# Town id
|
|
||||||
# 2: // Talking Island
|
|
||||||
# 3: // Elven village
|
|
||||||
# 1: // Dark elf village
|
|
||||||
# 4: // Orc village
|
|
||||||
# 6: // Dwarven village
|
|
||||||
# 7: // Gludio
|
|
||||||
# 5: // Gludin
|
|
||||||
# 8: // Dion
|
|
||||||
# 9: // Giran
|
|
||||||
# 10: // Oren
|
|
||||||
# 12: // Aden
|
|
||||||
# 11: // Hunters village
|
|
||||||
# 9: // Giran Harbour
|
|
||||||
# 15: // Heine
|
|
||||||
# 14: // Rune
|
|
||||||
# 13: // Goddard
|
|
||||||
# 17: // Schuttgart
|
|
||||||
# 16: // Floran
|
|
||||||
# 20: //Kamael Village
|
|
||||||
TWTownId = 9
|
|
||||||
|
|
||||||
# Set all towns?
|
|
||||||
TWAllTowns = False
|
|
||||||
|
|
||||||
# Reward for each kill
|
|
||||||
TownWarItemId = 57
|
|
||||||
TownWarItemAmount = 5000
|
|
||||||
|
|
||||||
# Give PKers karma during townwar?
|
|
||||||
AllowKarma = False
|
|
||||||
|
|
||||||
# Disable GK while in event?
|
|
||||||
DisableGK = True
|
|
||||||
|
|
||||||
# If yes it will send a ressurect ask on death.
|
|
||||||
# If no when you die youll be there dead until the event ends.
|
|
||||||
# Set to false if you want KOTH town.
|
|
||||||
SendRessOnDeath = True
|
|
@ -1,71 +0,0 @@
|
|||||||
#====================================#
|
|
||||||
# Team vs Team #
|
|
||||||
#====================================#
|
|
||||||
# TvT(Team vs Team) Event: Blue vs Red.
|
|
||||||
|
|
||||||
# Setting for Team vs. Team pvp
|
|
||||||
# TvTEvenTeams = NO|BALANCE|SHUFFLE
|
|
||||||
# NO means: not even teams.
|
|
||||||
# BALANCE means: Players can only join team with lowest player count.
|
|
||||||
# SHUFFLE means: Players can only participate to tzhe event and not direct to a team. Teams will be schuffeled in teleporting teams.
|
|
||||||
TvTEvenTeams = SHUFFLE
|
|
||||||
|
|
||||||
# players there not participated in tvt can target tvt participants?
|
|
||||||
TvTAllowInterference = False
|
|
||||||
|
|
||||||
# tvt participants can use potions?
|
|
||||||
TvTAllowPotions = True
|
|
||||||
|
|
||||||
# tvt participants can summon by item?
|
|
||||||
TvTAllowSummon = True
|
|
||||||
|
|
||||||
# remove all effects of tvt participants on event start?
|
|
||||||
TvTOnStartRemoveAllEffects = True
|
|
||||||
|
|
||||||
# unsummon pet of tvt participants on event start?
|
|
||||||
TvTOnStartUnsummonPet = True
|
|
||||||
|
|
||||||
# on revive participants regain full hp/mp/cp ?
|
|
||||||
TvTReviveRecovery = True
|
|
||||||
|
|
||||||
# announce all team statistics
|
|
||||||
TvTAnnounceTeamStats = True
|
|
||||||
|
|
||||||
# announce reward
|
|
||||||
TvTAnnounceReward = True
|
|
||||||
|
|
||||||
# give price with 0 kills
|
|
||||||
TvTPriceNoKills = True
|
|
||||||
|
|
||||||
# Enable voice command to register on tvt event
|
|
||||||
TvTCommand = True
|
|
||||||
|
|
||||||
# Delay on revive when dead, NOTE: 20000 equals to 20 seconds, minimum 1000 (1 second)
|
|
||||||
TvTReviveDelay = 10000
|
|
||||||
|
|
||||||
# Open Western Fortress doors on tvt finish
|
|
||||||
TvTOpenFortDoors = False
|
|
||||||
|
|
||||||
# Close Western Fortress doors on tvt start
|
|
||||||
TvTCloseFortDoors = False
|
|
||||||
|
|
||||||
# Open Aden Colosseum doors on tvt finish
|
|
||||||
TvTOpenAdenColosseumDoors = True
|
|
||||||
|
|
||||||
# Close Aden Colosseum doors on tvt start
|
|
||||||
TvTCloseAdenColosseumDoors = True
|
|
||||||
|
|
||||||
# TvT Top Killer reward id
|
|
||||||
TvTTopKillerRewardId = 5575
|
|
||||||
|
|
||||||
# TvT Top Killer reward quantity
|
|
||||||
TvTTopKillerRewardQty = 5000000
|
|
||||||
|
|
||||||
# Place an aura on participants team ?
|
|
||||||
TvTAura = False
|
|
||||||
|
|
||||||
# Enable event stats logger
|
|
||||||
TvTStatsLogger = True
|
|
||||||
|
|
||||||
# Remove Buffs on player die
|
|
||||||
TvTRemoveBuffsOnPlayerDie = False
|
|
@ -350,18 +350,6 @@ TimeOfWarmUp = 2
|
|||||||
NumberOfNecessaryPartyMembers = 4
|
NumberOfNecessaryPartyMembers = 4
|
||||||
|
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------
|
|
||||||
# Quake / Killing Spree System
|
|
||||||
# ---------------------------------------------------------------------------
|
|
||||||
# Enable The Killing Spree System
|
|
||||||
# When a Player Hits an Amount of pvp's an announcement appears
|
|
||||||
AllowQuakeSystem = False
|
|
||||||
|
|
||||||
# Enable Messages to GMs on 4-5 consecutive pvp of a player
|
|
||||||
# Why? to see if a char are farming!
|
|
||||||
EnableAntiPvpFarmMsg = True
|
|
||||||
|
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
# Aio System
|
# Aio System
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
|
@ -126,16 +126,6 @@ TitleForAmount4 = 00FF00
|
|||||||
PkAmount5 = 5000
|
PkAmount5 = 5000
|
||||||
TitleForAmount5 = 00FF00
|
TitleForAmount5 = 00FF00
|
||||||
|
|
||||||
# -----------------------------
|
|
||||||
# PK Info Settings
|
|
||||||
# -----------------------------
|
|
||||||
# If it is enabled then it shows pk info to the players everytime
|
|
||||||
# A pk or pvp is done. Messages are:
|
|
||||||
# "You have killed PlayerX y times".
|
|
||||||
# OR
|
|
||||||
# "You have been killed y times by PlayerX.
|
|
||||||
EnablePkInfo = False
|
|
||||||
|
|
||||||
# ----------------------------
|
# ----------------------------
|
||||||
# Custom Reward
|
# Custom Reward
|
||||||
# ----------------------------
|
# ----------------------------
|
||||||
|
@ -46,19 +46,5 @@
|
|||||||
<td><button value="ItmQty" action="bypass -h admin_set_mod ChampionRewardQty=$menu_command" width=55 height=15 back="sek.cbui94" fore="sek.cbui92"></td>
|
<td><button value="ItmQty" action="bypass -h admin_set_mod ChampionRewardQty=$menu_command" width=55 height=15 back="sek.cbui94" fore="sek.cbui92"></td>
|
||||||
<td><button value="AtkSpd" action="bypass -h admin_set_mod ChampionSpdHp=$menu_command" width=55 height=15 back="sek.cbui94" fore="sek.cbui92"></td>
|
<td><button value="AtkSpd" action="bypass -h admin_set_mod ChampionSpdHp=$menu_command" width=55 height=15 back="sek.cbui94" fore="sek.cbui92"></td>
|
||||||
</tr></table><br>
|
</tr></table><br>
|
||||||
<br><font color="aadd77">Team Vs. Team</font>
|
|
||||||
<a action="bypass -h admin_help help/l2jmod/tvt.htm"><font color="LEVEL">Help</font></a>
|
|
||||||
<table width=240><tr>
|
|
||||||
<td><button value="Enable" action="bypass -h admin_set_mod TvTEventEnabled=true" width=55 height=15 back="sek.cbui94" fore="sek.cbui92"></td>
|
|
||||||
<td><button value="Interval" action="bypass -h admin_set_mod TvTEventInterval=$menu_command" width=55 height=15 back="sek.cbui94" fore="sek.cbui92"></td>
|
|
||||||
<td><button value="PartTime" action="bypass -h admin_set_mod TvTEventParticipationTime=$menu_command" width=55 height=15 back="sek.cbui94" fore="sek.cbui92"></td>
|
|
||||||
<td><button value="RunnTime" action="bypass -h admin_set_mod TvTEventRunningTime=$menu_command" width=55 height=15 back="sek.cbui94" fore="sek.cbui92"></td>
|
|
||||||
</tr><tr>
|
|
||||||
<td><button value="Disable" action="bypass -h admin_set_mod TvTEventEnabled=false" width=55 height=15 back="sek.cbui94" fore="sek.cbui92"></td>
|
|
||||||
<td><button value="EventNpc" action="bypass -h admin_set_mod TvTEventParticipationNpcId=$menu_command" width=55 height=15 back="sek.cbui94" fore="sek.cbui92"></td>
|
|
||||||
<td> </td>
|
|
||||||
<td> </td>
|
|
||||||
</tr></table>
|
|
||||||
<br>
|
|
||||||
</center>
|
</center>
|
||||||
</body></html>
|
</body></html>
|
@ -1,20 +0,0 @@
|
|||||||
<html><body>Treasure Chest:<br>
|
|
||||||
<table width=100% border=1><tr><td>top left<br>
|
|
||||||
<a action="bypass -h npc_%objectId%_Deposit top-left">Deposit</a><br>
|
|
||||||
<a action="bypass -h npc_%objectId%_Withdraw top-left">Withdraw</a></td>
|
|
||||||
<td align="right">top right<br>
|
|
||||||
<a action="bypass -h npc_%objectId%_Deposit top-right">Deposit</a><br>
|
|
||||||
<a action="bypass -h npc_%objectId%_Withdraw top-right">Withdraw</a></td></tr>
|
|
||||||
<tr><td>mid left<br>
|
|
||||||
<a action="bypass -h npc_%objectId%_Deposit mid-left">Deposit</a><br>
|
|
||||||
<a action="bypass -h npc_%objectId%_Withdraw mid-left">Withdraw</a></td>
|
|
||||||
<td align="right">mid right<br>
|
|
||||||
<a action="bypass -h npc_%objectId%_Deposit mid-right">Deposit</a><br>
|
|
||||||
<a action="bypass -h npc_%objectId%_Withdraw mid-right">Withdraw</a></td></tr>
|
|
||||||
<tr><td>bottom left<br>
|
|
||||||
<a action="bypass -h npc_%objectId%_Deposit bottom-left">Deposit</a><br>
|
|
||||||
<a action="bypass -h npc_%objectId%_Withdraw bottom-left">Withdraw</a></td>
|
|
||||||
<td align="right">bottom right<br>
|
|
||||||
<a action="bypass -h npc_%objectId%_Deposit bottom-right">Deposit</a><br>
|
|
||||||
<a action="bypass -h npc_%objectId%_Withdraw bottom-right">Withdraw</a></td></tr>
|
|
||||||
</table></body></html>
|
|
@ -1,9 +0,0 @@
|
|||||||
<html><body>
|
|
||||||
Welcome in our server :)! I'm the Ancient World Master and I don't like if you leave the game for a long time or if you use bot... So, you have <font color="LEVEL">%Time%</font> seconds to demonstrate you are really here,
|
|
||||||
selecting the correct world I'm saying: <font color="LEVEL">%Word%</font>. Now Select the correct answer .<br>
|
|
||||||
<a action="link 100001">%Word1%</a><br>
|
|
||||||
<a action="link 100002">%Word2%</a><br>
|
|
||||||
<a action="link 100003">%Word3%</a><br>
|
|
||||||
<a action="link 100004">%Word4%</a><br>
|
|
||||||
<a action="link 100005">%Word5%</a>
|
|
||||||
</body></html>
|
|
@ -1,7 +0,0 @@
|
|||||||
<html><title>TvT Event Manager</title><body>
|
|
||||||
Registration for TvT Event:<br><br><center>
|
|
||||||
%team1name% (%team1playercount% players in)<br1>
|
|
||||||
%team2name% (%team2playercount% players in)<br>
|
|
||||||
<button value="Participate" action="bypass -h npc_%objectId%_tvt_event_participation" width=50 height=15 back="sek.cbui94" fore="sek.cbui92">
|
|
||||||
<button value="Close" action="bypass -h npc_%objectId%_Close" width=50 height=15 back="sek.cbui94" fore="sek.cbui92">
|
|
||||||
</center></body></html>
|
|
@ -1,6 +0,0 @@
|
|||||||
<html><title>TvT Event</title><body>
|
|
||||||
Cancel Registration yourself for TvT Event:<br1>
|
|
||||||
You are already registered for this event. Do you wish to cancel your participation in this Event?<br><br><center>
|
|
||||||
<button value="Yes" action="bypass -h npc_%objectId%_tvt_event_remove_participation" width=40 height=15 back="sek.cbui94" fore="sek.cbui92">
|
|
||||||
<button value="No" action="bypass -h npc_%objectId%_Close" width=40 height=15 back="sek.cbui94" fore="sek.cbui92">
|
|
||||||
</center></body></html>
|
|
@ -1,5 +0,0 @@
|
|||||||
<html><title>TvT Event</title><body>
|
|
||||||
TvT Status:<br><br><center>
|
|
||||||
%team1name% with %team1playercount% players and %team1points% points.<br1>
|
|
||||||
%team2name% with %team2playercount% players and %team2points% points.<br>
|
|
||||||
</center></body></html>
|
|
@ -84,11 +84,7 @@ public class Config
|
|||||||
private static final String PROTECT_OTHER_CONFIG_FILE = "./config/protected/Other.ini";
|
private static final String PROTECT_OTHER_CONFIG_FILE = "./config/protected/Other.ini";
|
||||||
public static final String TELNET_CONFIG_FILE = "./config/protected/Telnet.ini";
|
public static final String TELNET_CONFIG_FILE = "./config/protected/Telnet.ini";
|
||||||
// events
|
// events
|
||||||
private static final String EVENT_CTF_CONFIG_FILE = "./config/events/CtF.ini";
|
|
||||||
private static final String EVENT_DM_CONFIG_FILE = "./config/events/DM.ini";
|
|
||||||
private static final String EVENT_PC_BANG_POINT_CONFIG_FILE = "./config/events/PcBang.ini";
|
private static final String EVENT_PC_BANG_POINT_CONFIG_FILE = "./config/events/PcBang.ini";
|
||||||
private static final String EVENT_TVT_CONFIG_FILE = "./config/events/TvT.ini";
|
|
||||||
private static final String EVENT_TW_CONFIG_FILE = "./config/events/TW.ini";
|
|
||||||
// custom
|
// custom
|
||||||
private static final String BANK_CONFIG_FILE = "./config/custom/Bank.ini";
|
private static final String BANK_CONFIG_FILE = "./config/custom/Bank.ini";
|
||||||
private static final String CANCEL_SKILL_RESTORE_BUFFS_CONFIG_FILE = "./config/custom/CancelSkillRestoreBuffs.ini";
|
private static final String CANCEL_SKILL_RESTORE_BUFFS_CONFIG_FILE = "./config/custom/CancelSkillRestoreBuffs.ini";
|
||||||
@ -243,8 +239,6 @@ public class Config
|
|||||||
public static int FS_TIME_ENTRY;
|
public static int FS_TIME_ENTRY;
|
||||||
public static int FS_TIME_WARMUP;
|
public static int FS_TIME_WARMUP;
|
||||||
public static int FS_PARTY_MEMBER_COUNT;
|
public static int FS_PARTY_MEMBER_COUNT;
|
||||||
public static boolean ALLOW_QUAKE_SYSTEM;
|
|
||||||
public static boolean ENABLE_ANTI_PVP_FARM_MSG;
|
|
||||||
public static float RATE_XP;
|
public static float RATE_XP;
|
||||||
public static float RATE_SP;
|
public static float RATE_SP;
|
||||||
public static float RATE_PARTY_XP;
|
public static float RATE_PARTY_XP;
|
||||||
@ -499,36 +493,6 @@ public class Config
|
|||||||
public static boolean GIVE_CUPID_BOW;
|
public static boolean GIVE_CUPID_BOW;
|
||||||
public static boolean ANNOUNCE_WEDDING;
|
public static boolean ANNOUNCE_WEDDING;
|
||||||
|
|
||||||
public static String TVT_EVEN_TEAMS;
|
|
||||||
public static boolean TVT_ALLOW_INTERFERENCE;
|
|
||||||
public static boolean TVT_ALLOW_POTIONS;
|
|
||||||
public static boolean TVT_ALLOW_SUMMON;
|
|
||||||
public static boolean TVT_ON_START_REMOVE_ALL_EFFECTS;
|
|
||||||
public static boolean TVT_ON_START_UNSUMMON_PET;
|
|
||||||
public static boolean TVT_REVIVE_RECOVERY;
|
|
||||||
public static boolean TVT_ANNOUNCE_TEAM_STATS;
|
|
||||||
public static boolean TVT_ANNOUNCE_REWARD;
|
|
||||||
public static boolean TVT_PRICE_NO_KILLS;
|
|
||||||
public static boolean TVT_COMMAND;
|
|
||||||
public static long TVT_REVIVE_DELAY;
|
|
||||||
public static boolean TVT_OPEN_FORT_DOORS;
|
|
||||||
public static boolean TVT_CLOSE_FORT_DOORS;
|
|
||||||
public static boolean TVT_OPEN_ADEN_COLOSSEUM_DOORS;
|
|
||||||
public static boolean TVT_CLOSE_ADEN_COLOSSEUM_DOORS;
|
|
||||||
public static int TVT_TOP_KILLER_REWARD;
|
|
||||||
public static int TVT_TOP_KILLER_QTY;
|
|
||||||
public static boolean TVT_AURA;
|
|
||||||
public static boolean TVT_STATS_LOGGER;
|
|
||||||
public static boolean TVT_REMOVE_BUFFS_ON_DIE;
|
|
||||||
|
|
||||||
public static int TW_TOWN_ID;
|
|
||||||
public static boolean TW_ALL_TOWNS;
|
|
||||||
public static int TW_ITEM_ID;
|
|
||||||
public static int TW_ITEM_AMOUNT;
|
|
||||||
public static boolean TW_ALLOW_KARMA;
|
|
||||||
public static boolean TW_DISABLE_GK;
|
|
||||||
public static boolean TW_RESS_ON_DIE;
|
|
||||||
|
|
||||||
public static boolean REBIRTH_ENABLE;
|
public static boolean REBIRTH_ENABLE;
|
||||||
public static String[] REBIRTH_ITEM_PRICE;
|
public static String[] REBIRTH_ITEM_PRICE;
|
||||||
public static String[] REBIRTH_MAGE_SKILL;
|
public static String[] REBIRTH_MAGE_SKILL;
|
||||||
@ -589,38 +553,6 @@ public class Config
|
|||||||
public static int OFFLINE_MAX_DAYS;
|
public static int OFFLINE_MAX_DAYS;
|
||||||
public static boolean OFFLINE_DISCONNECT_FINISHED;
|
public static boolean OFFLINE_DISCONNECT_FINISHED;
|
||||||
|
|
||||||
public static boolean DM_ALLOW_INTERFERENCE;
|
|
||||||
public static boolean DM_ALLOW_POTIONS;
|
|
||||||
public static boolean DM_ALLOW_SUMMON;
|
|
||||||
public static boolean DM_ON_START_REMOVE_ALL_EFFECTS;
|
|
||||||
public static boolean DM_ON_START_UNSUMMON_PET;
|
|
||||||
public static long DM_REVIVE_DELAY;
|
|
||||||
public static boolean DM_COMMAND;
|
|
||||||
public static boolean DM_ENABLE_KILL_REWARD;
|
|
||||||
public static int DM_KILL_REWARD_ID;
|
|
||||||
public static int DM_KILL_REWARD_AMOUNT;
|
|
||||||
public static boolean DM_ANNOUNCE_REWARD;
|
|
||||||
public static boolean DM_REVIVE_RECOVERY;
|
|
||||||
public static int DM_SPAWN_OFFSET;
|
|
||||||
public static boolean DM_STATS_LOGGER;
|
|
||||||
public static boolean DM_ALLOW_HEALER_CLASSES;
|
|
||||||
public static boolean DM_REMOVE_BUFFS_ON_DIE;
|
|
||||||
|
|
||||||
public static String CTF_EVEN_TEAMS;
|
|
||||||
public static boolean CTF_ALLOW_INTERFERENCE;
|
|
||||||
public static boolean CTF_ALLOW_POTIONS;
|
|
||||||
public static boolean CTF_ALLOW_SUMMON;
|
|
||||||
public static boolean CTF_ON_START_REMOVE_ALL_EFFECTS;
|
|
||||||
public static boolean CTF_ON_START_UNSUMMON_PET;
|
|
||||||
public static boolean CTF_ANNOUNCE_TEAM_STATS;
|
|
||||||
public static boolean CTF_ANNOUNCE_REWARD;
|
|
||||||
public static boolean CTF_REVIVE_RECOVERY;
|
|
||||||
public static boolean CTF_COMMAND;
|
|
||||||
public static boolean CTF_AURA;
|
|
||||||
public static boolean CTF_STATS_LOGGER;
|
|
||||||
public static int CTF_SPAWN_OFFSET;
|
|
||||||
public static boolean CTF_REMOVE_BUFFS_ON_DIE;
|
|
||||||
|
|
||||||
public static boolean ONLINE_PLAYERS_ON_LOGIN;
|
public static boolean ONLINE_PLAYERS_ON_LOGIN;
|
||||||
public static boolean SUBSTUCK_SKILLS;
|
public static boolean SUBSTUCK_SKILLS;
|
||||||
public static boolean ALT_SERVER_NAME_ENABLED;
|
public static boolean ALT_SERVER_NAME_ENABLED;
|
||||||
@ -691,26 +623,6 @@ public class Config
|
|||||||
public static int HERO_CUSTOM_ITEM_ID;
|
public static int HERO_CUSTOM_ITEM_ID;
|
||||||
public static int NOOBLE_CUSTOM_ITEM_ID;
|
public static int NOOBLE_CUSTOM_ITEM_ID;
|
||||||
public static long HERO_CUSTOM_DAY;
|
public static long HERO_CUSTOM_DAY;
|
||||||
public static boolean ALLOW_FARM1_COMMAND;
|
|
||||||
public static boolean ALLOW_FARM2_COMMAND;
|
|
||||||
public static boolean ALLOW_PVP1_COMMAND;
|
|
||||||
public static boolean ALLOW_PVP2_COMMAND;
|
|
||||||
public static int FARM1_X;
|
|
||||||
public static int FARM1_Y;
|
|
||||||
public static int FARM1_Z;
|
|
||||||
public static int PVP1_X;
|
|
||||||
public static int PVP1_Y;
|
|
||||||
public static int PVP1_Z;
|
|
||||||
public static int FARM2_X;
|
|
||||||
public static int FARM2_Y;
|
|
||||||
public static int FARM2_Z;
|
|
||||||
public static int PVP2_X;
|
|
||||||
public static int PVP2_Y;
|
|
||||||
public static int PVP2_Z;
|
|
||||||
public static String FARM1_CUSTOM_MESSAGE;
|
|
||||||
public static String FARM2_CUSTOM_MESSAGE;
|
|
||||||
public static String PVP1_CUSTOM_MESSAGE;
|
|
||||||
public static String PVP2_CUSTOM_MESSAGE;
|
|
||||||
public static boolean GM_TRADE_RESTRICTED_ITEMS;
|
public static boolean GM_TRADE_RESTRICTED_ITEMS;
|
||||||
public static boolean GM_RESTART_FIGHTING;
|
public static boolean GM_RESTART_FIGHTING;
|
||||||
public static boolean PM_MESSAGE_ON_START;
|
public static boolean PM_MESSAGE_ON_START;
|
||||||
@ -762,7 +674,6 @@ public class Config
|
|||||||
public static int PK_REWARD_ID;
|
public static int PK_REWARD_ID;
|
||||||
public static int PK_REWARD_AMOUNT;
|
public static int PK_REWARD_AMOUNT;
|
||||||
public static int REWARD_PROTECT;
|
public static int REWARD_PROTECT;
|
||||||
public static boolean ENABLE_PK_INFO;
|
|
||||||
public static boolean FLAGED_PLAYER_USE_BUFFER;
|
public static boolean FLAGED_PLAYER_USE_BUFFER;
|
||||||
public static boolean FLAGED_PLAYER_CAN_USE_GK;
|
public static boolean FLAGED_PLAYER_CAN_USE_GK;
|
||||||
public static boolean PVPEXPSP_SYSTEM;
|
public static boolean PVPEXPSP_SYSTEM;
|
||||||
@ -1501,8 +1412,6 @@ public class Config
|
|||||||
{
|
{
|
||||||
FS_PARTY_MEMBER_COUNT = 4;
|
FS_PARTY_MEMBER_COUNT = 4;
|
||||||
}
|
}
|
||||||
ALLOW_QUAKE_SYSTEM = generalConfig.getBoolean("AllowQuakeSystem", false);
|
|
||||||
ENABLE_ANTI_PVP_FARM_MSG = generalConfig.getBoolean("EnableAntiPvpFarmMsg", false);
|
|
||||||
ANNOUNCE_CASTLE_LORDS = generalConfig.getBoolean("AnnounceCastleLords", false);
|
ANNOUNCE_CASTLE_LORDS = generalConfig.getBoolean("AnnounceCastleLords", false);
|
||||||
ANNOUNCE_MAMMON_SPAWN = generalConfig.getBoolean("AnnounceMammonSpawn", true);
|
ANNOUNCE_MAMMON_SPAWN = generalConfig.getBoolean("AnnounceMammonSpawn", true);
|
||||||
ALLOW_GUARDS = generalConfig.getBoolean("AllowGuards", false);
|
ALLOW_GUARDS = generalConfig.getBoolean("AllowGuards", false);
|
||||||
@ -1761,48 +1670,6 @@ public class Config
|
|||||||
ANNOUNCE_WEDDING = weddingConfig.getBoolean("AnnounceWedding", true);
|
ANNOUNCE_WEDDING = weddingConfig.getBoolean("AnnounceWedding", true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void loadTVTConfig()
|
|
||||||
{
|
|
||||||
final PropertiesParser tvtConfig = new PropertiesParser(EVENT_TVT_CONFIG_FILE);
|
|
||||||
TVT_EVEN_TEAMS = tvtConfig.getString("TvTEvenTeams", "BALANCE");
|
|
||||||
TVT_ALLOW_INTERFERENCE = tvtConfig.getBoolean("TvTAllowInterference", false);
|
|
||||||
TVT_ALLOW_POTIONS = tvtConfig.getBoolean("TvTAllowPotions", false);
|
|
||||||
TVT_ALLOW_SUMMON = tvtConfig.getBoolean("TvTAllowSummon", false);
|
|
||||||
TVT_ON_START_REMOVE_ALL_EFFECTS = tvtConfig.getBoolean("TvTOnStartRemoveAllEffects", true);
|
|
||||||
TVT_ON_START_UNSUMMON_PET = tvtConfig.getBoolean("TvTOnStartUnsummonPet", true);
|
|
||||||
TVT_REVIVE_RECOVERY = tvtConfig.getBoolean("TvTReviveRecovery", false);
|
|
||||||
TVT_ANNOUNCE_TEAM_STATS = tvtConfig.getBoolean("TvTAnnounceTeamStats", false);
|
|
||||||
TVT_ANNOUNCE_REWARD = tvtConfig.getBoolean("TvTAnnounceReward", false);
|
|
||||||
TVT_PRICE_NO_KILLS = tvtConfig.getBoolean("TvTPriceNoKills", false);
|
|
||||||
TVT_COMMAND = tvtConfig.getBoolean("TvTCommand", true);
|
|
||||||
TVT_REVIVE_DELAY = tvtConfig.getLong("TvTReviveDelay", 20000);
|
|
||||||
if (TVT_REVIVE_DELAY < 1000)
|
|
||||||
{
|
|
||||||
TVT_REVIVE_DELAY = 1000; // can't be set less then 1 second
|
|
||||||
}
|
|
||||||
TVT_OPEN_FORT_DOORS = tvtConfig.getBoolean("TvTOpenFortDoors", false);
|
|
||||||
TVT_CLOSE_FORT_DOORS = tvtConfig.getBoolean("TvTCloseFortDoors", false);
|
|
||||||
TVT_OPEN_ADEN_COLOSSEUM_DOORS = tvtConfig.getBoolean("TvTOpenAdenColosseumDoors", false);
|
|
||||||
TVT_CLOSE_ADEN_COLOSSEUM_DOORS = tvtConfig.getBoolean("TvTCloseAdenColosseumDoors", false);
|
|
||||||
TVT_TOP_KILLER_REWARD = tvtConfig.getInt("TvTTopKillerRewardId", 5575);
|
|
||||||
TVT_TOP_KILLER_QTY = tvtConfig.getInt("TvTTopKillerRewardQty", 2000000);
|
|
||||||
TVT_AURA = tvtConfig.getBoolean("TvTAura", false);
|
|
||||||
TVT_STATS_LOGGER = tvtConfig.getBoolean("TvTStatsLogger", true);
|
|
||||||
TVT_REMOVE_BUFFS_ON_DIE = tvtConfig.getBoolean("TvTRemoveBuffsOnPlayerDie", false);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void loadTWConfig()
|
|
||||||
{
|
|
||||||
final PropertiesParser twConfig = new PropertiesParser(EVENT_TW_CONFIG_FILE);
|
|
||||||
TW_TOWN_ID = twConfig.getInt("TWTownId", 9);
|
|
||||||
TW_ALL_TOWNS = twConfig.getBoolean("TWAllTowns", false);
|
|
||||||
TW_ITEM_ID = twConfig.getInt("TownWarItemId", 57);
|
|
||||||
TW_ITEM_AMOUNT = twConfig.getInt("TownWarItemAmount", 5000);
|
|
||||||
TW_ALLOW_KARMA = twConfig.getBoolean("AllowKarma", false);
|
|
||||||
TW_DISABLE_GK = twConfig.getBoolean("DisableGK", true);
|
|
||||||
TW_RESS_ON_DIE = twConfig.getBoolean("SendRessOnDeath", false);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void loadRebirthConfig()
|
public static void loadRebirthConfig()
|
||||||
{
|
{
|
||||||
final PropertiesParser rebirthConfig = new PropertiesParser(EVENT_REBIRTH_CONFIG_FILE);
|
final PropertiesParser rebirthConfig = new PropertiesParser(EVENT_REBIRTH_CONFIG_FILE);
|
||||||
@ -1882,50 +1749,6 @@ public class Config
|
|||||||
OFFLINE_DISCONNECT_FINISHED = offlineConfig.getBoolean("OfflineDisconnectFinished", true);
|
OFFLINE_DISCONNECT_FINISHED = offlineConfig.getBoolean("OfflineDisconnectFinished", true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void loadDMConfig()
|
|
||||||
{
|
|
||||||
final PropertiesParser dmConfig = new PropertiesParser(EVENT_DM_CONFIG_FILE);
|
|
||||||
DM_ALLOW_INTERFERENCE = dmConfig.getBoolean("DMAllowInterference", false);
|
|
||||||
DM_ALLOW_POTIONS = dmConfig.getBoolean("DMAllowPotions", false);
|
|
||||||
DM_ALLOW_SUMMON = dmConfig.getBoolean("DMAllowSummon", false);
|
|
||||||
DM_ON_START_REMOVE_ALL_EFFECTS = dmConfig.getBoolean("DMOnStartRemoveAllEffects", true);
|
|
||||||
DM_ON_START_UNSUMMON_PET = dmConfig.getBoolean("DMOnStartUnsummonPet", true);
|
|
||||||
DM_REVIVE_DELAY = dmConfig.getLong("DMReviveDelay", 20000);
|
|
||||||
if (DM_REVIVE_DELAY < 1000)
|
|
||||||
{
|
|
||||||
DM_REVIVE_DELAY = 1000; // can't be set less then 1 second
|
|
||||||
}
|
|
||||||
DM_REVIVE_RECOVERY = dmConfig.getBoolean("DMReviveRecovery", false);
|
|
||||||
DM_COMMAND = dmConfig.getBoolean("DMCommand", false);
|
|
||||||
DM_ENABLE_KILL_REWARD = dmConfig.getBoolean("DMEnableKillReward", false);
|
|
||||||
DM_KILL_REWARD_ID = dmConfig.getInt("DMKillRewardID", 6392);
|
|
||||||
DM_KILL_REWARD_AMOUNT = dmConfig.getInt("DMKillRewardAmount", 1);
|
|
||||||
DM_ANNOUNCE_REWARD = dmConfig.getBoolean("DMAnnounceReward", false);
|
|
||||||
DM_SPAWN_OFFSET = dmConfig.getInt("DMSpawnOffset", 100);
|
|
||||||
DM_STATS_LOGGER = dmConfig.getBoolean("DMStatsLogger", true);
|
|
||||||
DM_ALLOW_HEALER_CLASSES = dmConfig.getBoolean("DMAllowedHealerClasses", true);
|
|
||||||
DM_REMOVE_BUFFS_ON_DIE = dmConfig.getBoolean("DMRemoveBuffsOnPlayerDie", false);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void loadCTFConfig()
|
|
||||||
{
|
|
||||||
final PropertiesParser ctfConfig = new PropertiesParser(EVENT_CTF_CONFIG_FILE);
|
|
||||||
CTF_EVEN_TEAMS = ctfConfig.getString("CTFEvenTeams", "BALANCE");
|
|
||||||
CTF_ALLOW_INTERFERENCE = ctfConfig.getBoolean("CTFAllowInterference", false);
|
|
||||||
CTF_ALLOW_POTIONS = ctfConfig.getBoolean("CTFAllowPotions", false);
|
|
||||||
CTF_ALLOW_SUMMON = ctfConfig.getBoolean("CTFAllowSummon", false);
|
|
||||||
CTF_ON_START_REMOVE_ALL_EFFECTS = ctfConfig.getBoolean("CTFOnStartRemoveAllEffects", true);
|
|
||||||
CTF_ON_START_UNSUMMON_PET = ctfConfig.getBoolean("CTFOnStartUnsummonPet", true);
|
|
||||||
CTF_ANNOUNCE_TEAM_STATS = ctfConfig.getBoolean("CTFAnnounceTeamStats", false);
|
|
||||||
CTF_ANNOUNCE_REWARD = ctfConfig.getBoolean("CTFAnnounceReward", false);
|
|
||||||
CTF_REVIVE_RECOVERY = ctfConfig.getBoolean("CTFReviveRecovery", false);
|
|
||||||
CTF_COMMAND = ctfConfig.getBoolean("CTFCommand", true);
|
|
||||||
CTF_AURA = ctfConfig.getBoolean("CTFAura", true);
|
|
||||||
CTF_STATS_LOGGER = ctfConfig.getBoolean("CTFStatsLogger", true);
|
|
||||||
CTF_SPAWN_OFFSET = ctfConfig.getInt("CTFSpawnOffset", 100);
|
|
||||||
CTF_REMOVE_BUFFS_ON_DIE = ctfConfig.getBoolean("CTFRemoveBuffsOnPlayerDie", false);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void loadCustomServerConfig()
|
public static void loadCustomServerConfig()
|
||||||
{
|
{
|
||||||
final PropertiesParser customServerConfig = new PropertiesParser(OTHER_CONFIG_FILE);
|
final PropertiesParser customServerConfig = new PropertiesParser(OTHER_CONFIG_FILE);
|
||||||
@ -1997,26 +1820,6 @@ public class Config
|
|||||||
CLAN_LEADER_COLOR_CLAN_LEVEL = customServerConfig.getInt("ClanLeaderColorAtClanLevel", 1);
|
CLAN_LEADER_COLOR_CLAN_LEVEL = customServerConfig.getInt("ClanLeaderColorAtClanLevel", 1);
|
||||||
SAVE_RAIDBOSS_STATUS_INTO_DB = customServerConfig.getBoolean("SaveRBStatusIntoDB", false);
|
SAVE_RAIDBOSS_STATUS_INTO_DB = customServerConfig.getBoolean("SaveRBStatusIntoDB", false);
|
||||||
DISABLE_WEIGHT_PENALTY = customServerConfig.getBoolean("DisableWeightPenalty", false);
|
DISABLE_WEIGHT_PENALTY = customServerConfig.getBoolean("DisableWeightPenalty", false);
|
||||||
ALLOW_FARM1_COMMAND = customServerConfig.getBoolean("AllowFarm1Command", false);
|
|
||||||
ALLOW_FARM2_COMMAND = customServerConfig.getBoolean("AllowFarm2Command", false);
|
|
||||||
ALLOW_PVP1_COMMAND = customServerConfig.getBoolean("AllowPvP1Command", false);
|
|
||||||
ALLOW_PVP2_COMMAND = customServerConfig.getBoolean("AllowPvP2Command", false);
|
|
||||||
FARM1_X = customServerConfig.getInt("farm1_X", 81304);
|
|
||||||
FARM1_Y = customServerConfig.getInt("farm1_Y", 14589);
|
|
||||||
FARM1_Z = customServerConfig.getInt("farm1_Z", -3469);
|
|
||||||
PVP1_X = customServerConfig.getInt("pvp1_X", 81304);
|
|
||||||
PVP1_Y = customServerConfig.getInt("pvp1_Y", 14589);
|
|
||||||
PVP1_Z = customServerConfig.getInt("pvp1_Z", -3469);
|
|
||||||
FARM2_X = customServerConfig.getInt("farm2_X", 81304);
|
|
||||||
FARM2_Y = customServerConfig.getInt("farm2_Y", 14589);
|
|
||||||
FARM2_Z = customServerConfig.getInt("farm2_Z", -3469);
|
|
||||||
PVP2_X = customServerConfig.getInt("pvp2_X", 81304);
|
|
||||||
PVP2_Y = customServerConfig.getInt("pvp2_Y", 14589);
|
|
||||||
PVP2_Z = customServerConfig.getInt("pvp2_Z", -3469);
|
|
||||||
FARM1_CUSTOM_MESSAGE = customServerConfig.getString("Farm1CustomMeesage", "You have been teleported to Farm Zone 1!");
|
|
||||||
FARM2_CUSTOM_MESSAGE = customServerConfig.getString("Farm2CustomMeesage", "You have been teleported to Farm Zone 2!");
|
|
||||||
PVP1_CUSTOM_MESSAGE = customServerConfig.getString("PvP1CustomMeesage", "You have been teleported to PvP Zone 1!");
|
|
||||||
PVP2_CUSTOM_MESSAGE = customServerConfig.getString("PvP2CustomMeesage", "You have been teleported to PvP Zone 2!");
|
|
||||||
GM_TRADE_RESTRICTED_ITEMS = customServerConfig.getBoolean("GMTradeRestrictedItems", false);
|
GM_TRADE_RESTRICTED_ITEMS = customServerConfig.getBoolean("GMTradeRestrictedItems", false);
|
||||||
GM_RESTART_FIGHTING = customServerConfig.getBoolean("GMRestartFighting", false);
|
GM_RESTART_FIGHTING = customServerConfig.getBoolean("GMRestartFighting", false);
|
||||||
PM_MESSAGE_ON_START = customServerConfig.getBoolean("PMWelcomeShow", false);
|
PM_MESSAGE_ON_START = customServerConfig.getBoolean("PMWelcomeShow", false);
|
||||||
@ -2094,7 +1897,6 @@ public class Config
|
|||||||
ADD_SP = pvpConfig.getInt("AddSpAtPvp", 0);
|
ADD_SP = pvpConfig.getInt("AddSpAtPvp", 0);
|
||||||
ALLOW_SOE_IN_PVP = pvpConfig.getBoolean("AllowSoEInPvP", true);
|
ALLOW_SOE_IN_PVP = pvpConfig.getBoolean("AllowSoEInPvP", true);
|
||||||
ALLOW_POTS_IN_PVP = pvpConfig.getBoolean("AllowPotsInPvP", true);
|
ALLOW_POTS_IN_PVP = pvpConfig.getBoolean("AllowPotsInPvP", true);
|
||||||
ENABLE_PK_INFO = pvpConfig.getBoolean("EnablePkInfo", false);
|
|
||||||
ANNOUNCE_ALL_KILL = pvpConfig.getBoolean("AnnounceAllKill", false);
|
ANNOUNCE_ALL_KILL = pvpConfig.getBoolean("AnnounceAllKill", false);
|
||||||
ANNOUNCE_PVP_KILL = pvpConfig.getBoolean("AnnouncePvPKill", false);
|
ANNOUNCE_PVP_KILL = pvpConfig.getBoolean("AnnouncePvPKill", false);
|
||||||
ANNOUNCE_PK_KILL = pvpConfig.getBoolean("AnnouncePkKill", false);
|
ANNOUNCE_PK_KILL = pvpConfig.getBoolean("AnnouncePkKill", false);
|
||||||
@ -3144,12 +2946,6 @@ public class Config
|
|||||||
loadPvpConfig();
|
loadPvpConfig();
|
||||||
loadCraftConfig();
|
loadCraftConfig();
|
||||||
|
|
||||||
// Event config
|
|
||||||
loadCTFConfig();
|
|
||||||
loadDMConfig();
|
|
||||||
loadTVTConfig();
|
|
||||||
loadTWConfig();
|
|
||||||
|
|
||||||
// Protect
|
// Protect
|
||||||
loadFloodConfig();
|
loadFloodConfig();
|
||||||
loadProtectedOtherConfig();
|
loadProtectedOtherConfig();
|
||||||
|
@ -102,7 +102,6 @@ import org.l2jmobius.gameserver.instancemanager.RecipeManager;
|
|||||||
import org.l2jmobius.gameserver.instancemanager.ServerRestartManager;
|
import org.l2jmobius.gameserver.instancemanager.ServerRestartManager;
|
||||||
import org.l2jmobius.gameserver.instancemanager.SiegeManager;
|
import org.l2jmobius.gameserver.instancemanager.SiegeManager;
|
||||||
import org.l2jmobius.gameserver.instancemanager.TradeManager;
|
import org.l2jmobius.gameserver.instancemanager.TradeManager;
|
||||||
import org.l2jmobius.gameserver.instancemanager.events.EventManager;
|
|
||||||
import org.l2jmobius.gameserver.instancemanager.events.PcPoint;
|
import org.l2jmobius.gameserver.instancemanager.events.PcPoint;
|
||||||
import org.l2jmobius.gameserver.instancemanager.games.Lottery;
|
import org.l2jmobius.gameserver.instancemanager.games.Lottery;
|
||||||
import org.l2jmobius.gameserver.instancemanager.games.MonsterRace;
|
import org.l2jmobius.gameserver.instancemanager.games.MonsterRace;
|
||||||
@ -404,29 +403,6 @@ public class GameServer
|
|||||||
ThreadPool.scheduleAtFixedRate(PcPoint.getInstance(), Config.PCB_INTERVAL * 1000, Config.PCB_INTERVAL * 1000);
|
ThreadPool.scheduleAtFixedRate(PcPoint.getInstance(), Config.PCB_INTERVAL * 1000, Config.PCB_INTERVAL * 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
printSection("EventManager");
|
|
||||||
EventManager.getInstance().startEventRegistration();
|
|
||||||
|
|
||||||
if (EventManager.TVT_EVENT_ENABLED || EventManager.CTF_EVENT_ENABLED || EventManager.DM_EVENT_ENABLED)
|
|
||||||
{
|
|
||||||
if (EventManager.TVT_EVENT_ENABLED)
|
|
||||||
{
|
|
||||||
LOGGER.info("TVT Event is Enabled.");
|
|
||||||
}
|
|
||||||
if (EventManager.CTF_EVENT_ENABLED)
|
|
||||||
{
|
|
||||||
LOGGER.info("CTF Event is Enabled.");
|
|
||||||
}
|
|
||||||
if (EventManager.DM_EVENT_ENABLED)
|
|
||||||
{
|
|
||||||
LOGGER.info("DM Event is Enabled.");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
LOGGER.info("All events are Disabled.");
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((Config.OFFLINE_TRADE_ENABLE || Config.OFFLINE_CRAFT_ENABLE) && Config.RESTORE_OFFLINERS)
|
if ((Config.OFFLINE_TRADE_ENABLE || Config.OFFLINE_CRAFT_ENABLE) && Config.RESTORE_OFFLINERS)
|
||||||
{
|
{
|
||||||
OfflineTraderTable.restoreOfflineTraders();
|
OfflineTraderTable.restoreOfflineTraders();
|
||||||
|
@ -25,12 +25,10 @@ import org.l2jmobius.gameserver.handler.admincommandhandlers.AdminAio;
|
|||||||
import org.l2jmobius.gameserver.handler.admincommandhandlers.AdminAnnouncements;
|
import org.l2jmobius.gameserver.handler.admincommandhandlers.AdminAnnouncements;
|
||||||
import org.l2jmobius.gameserver.handler.admincommandhandlers.AdminBan;
|
import org.l2jmobius.gameserver.handler.admincommandhandlers.AdminBan;
|
||||||
import org.l2jmobius.gameserver.handler.admincommandhandlers.AdminBuffs;
|
import org.l2jmobius.gameserver.handler.admincommandhandlers.AdminBuffs;
|
||||||
import org.l2jmobius.gameserver.handler.admincommandhandlers.AdminCTFEngine;
|
|
||||||
import org.l2jmobius.gameserver.handler.admincommandhandlers.AdminCache;
|
import org.l2jmobius.gameserver.handler.admincommandhandlers.AdminCache;
|
||||||
import org.l2jmobius.gameserver.handler.admincommandhandlers.AdminChangeAccessLevel;
|
import org.l2jmobius.gameserver.handler.admincommandhandlers.AdminChangeAccessLevel;
|
||||||
import org.l2jmobius.gameserver.handler.admincommandhandlers.AdminChristmas;
|
import org.l2jmobius.gameserver.handler.admincommandhandlers.AdminChristmas;
|
||||||
import org.l2jmobius.gameserver.handler.admincommandhandlers.AdminCreateItem;
|
import org.l2jmobius.gameserver.handler.admincommandhandlers.AdminCreateItem;
|
||||||
import org.l2jmobius.gameserver.handler.admincommandhandlers.AdminDMEngine;
|
|
||||||
import org.l2jmobius.gameserver.handler.admincommandhandlers.AdminDelete;
|
import org.l2jmobius.gameserver.handler.admincommandhandlers.AdminDelete;
|
||||||
import org.l2jmobius.gameserver.handler.admincommandhandlers.AdminDestroyItems;
|
import org.l2jmobius.gameserver.handler.admincommandhandlers.AdminDestroyItems;
|
||||||
import org.l2jmobius.gameserver.handler.admincommandhandlers.AdminDonator;
|
import org.l2jmobius.gameserver.handler.admincommandhandlers.AdminDonator;
|
||||||
@ -39,7 +37,6 @@ import org.l2jmobius.gameserver.handler.admincommandhandlers.AdminEditChar;
|
|||||||
import org.l2jmobius.gameserver.handler.admincommandhandlers.AdminEditNpc;
|
import org.l2jmobius.gameserver.handler.admincommandhandlers.AdminEditNpc;
|
||||||
import org.l2jmobius.gameserver.handler.admincommandhandlers.AdminEffects;
|
import org.l2jmobius.gameserver.handler.admincommandhandlers.AdminEffects;
|
||||||
import org.l2jmobius.gameserver.handler.admincommandhandlers.AdminEnchant;
|
import org.l2jmobius.gameserver.handler.admincommandhandlers.AdminEnchant;
|
||||||
import org.l2jmobius.gameserver.handler.admincommandhandlers.AdminEventEngine;
|
|
||||||
import org.l2jmobius.gameserver.handler.admincommandhandlers.AdminExpSp;
|
import org.l2jmobius.gameserver.handler.admincommandhandlers.AdminExpSp;
|
||||||
import org.l2jmobius.gameserver.handler.admincommandhandlers.AdminFence;
|
import org.l2jmobius.gameserver.handler.admincommandhandlers.AdminFence;
|
||||||
import org.l2jmobius.gameserver.handler.admincommandhandlers.AdminFightCalculator;
|
import org.l2jmobius.gameserver.handler.admincommandhandlers.AdminFightCalculator;
|
||||||
@ -82,9 +79,6 @@ import org.l2jmobius.gameserver.handler.admincommandhandlers.AdminSuperHaste;
|
|||||||
import org.l2jmobius.gameserver.handler.admincommandhandlers.AdminTarget;
|
import org.l2jmobius.gameserver.handler.admincommandhandlers.AdminTarget;
|
||||||
import org.l2jmobius.gameserver.handler.admincommandhandlers.AdminTeleport;
|
import org.l2jmobius.gameserver.handler.admincommandhandlers.AdminTeleport;
|
||||||
import org.l2jmobius.gameserver.handler.admincommandhandlers.AdminTest;
|
import org.l2jmobius.gameserver.handler.admincommandhandlers.AdminTest;
|
||||||
import org.l2jmobius.gameserver.handler.admincommandhandlers.AdminTownWar;
|
|
||||||
import org.l2jmobius.gameserver.handler.admincommandhandlers.AdminTvTEngine;
|
|
||||||
import org.l2jmobius.gameserver.handler.admincommandhandlers.AdminVIPEngine;
|
|
||||||
import org.l2jmobius.gameserver.handler.admincommandhandlers.AdminZone;
|
import org.l2jmobius.gameserver.handler.admincommandhandlers.AdminZone;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -108,17 +102,14 @@ public class AdminCommandHandler
|
|||||||
registerAdminCommandHandler(new AdminChangeAccessLevel());
|
registerAdminCommandHandler(new AdminChangeAccessLevel());
|
||||||
registerAdminCommandHandler(new AdminChristmas());
|
registerAdminCommandHandler(new AdminChristmas());
|
||||||
registerAdminCommandHandler(new AdminCreateItem());
|
registerAdminCommandHandler(new AdminCreateItem());
|
||||||
registerAdminCommandHandler(new AdminCTFEngine());
|
|
||||||
registerAdminCommandHandler(new AdminDelete());
|
registerAdminCommandHandler(new AdminDelete());
|
||||||
registerAdminCommandHandler(new AdminDestroyItems());
|
registerAdminCommandHandler(new AdminDestroyItems());
|
||||||
registerAdminCommandHandler(new AdminDMEngine());
|
|
||||||
registerAdminCommandHandler(new AdminDonator());
|
registerAdminCommandHandler(new AdminDonator());
|
||||||
registerAdminCommandHandler(new AdminDoorControl());
|
registerAdminCommandHandler(new AdminDoorControl());
|
||||||
registerAdminCommandHandler(new AdminEditChar());
|
registerAdminCommandHandler(new AdminEditChar());
|
||||||
registerAdminCommandHandler(new AdminEditNpc());
|
registerAdminCommandHandler(new AdminEditNpc());
|
||||||
registerAdminCommandHandler(new AdminEffects());
|
registerAdminCommandHandler(new AdminEffects());
|
||||||
registerAdminCommandHandler(new AdminEnchant());
|
registerAdminCommandHandler(new AdminEnchant());
|
||||||
registerAdminCommandHandler(new AdminEventEngine());
|
|
||||||
registerAdminCommandHandler(new AdminExpSp());
|
registerAdminCommandHandler(new AdminExpSp());
|
||||||
registerAdminCommandHandler(new AdminFence());
|
registerAdminCommandHandler(new AdminFence());
|
||||||
registerAdminCommandHandler(new AdminFightCalculator());
|
registerAdminCommandHandler(new AdminFightCalculator());
|
||||||
@ -161,9 +152,6 @@ public class AdminCommandHandler
|
|||||||
registerAdminCommandHandler(new AdminTarget());
|
registerAdminCommandHandler(new AdminTarget());
|
||||||
registerAdminCommandHandler(new AdminTeleport());
|
registerAdminCommandHandler(new AdminTeleport());
|
||||||
registerAdminCommandHandler(new AdminTest());
|
registerAdminCommandHandler(new AdminTest());
|
||||||
registerAdminCommandHandler(new AdminTownWar());
|
|
||||||
registerAdminCommandHandler(new AdminTvTEngine());
|
|
||||||
registerAdminCommandHandler(new AdminVIPEngine());
|
|
||||||
registerAdminCommandHandler(new AdminZone());
|
registerAdminCommandHandler(new AdminZone());
|
||||||
|
|
||||||
LOGGER.info("AdminCommandHandler: Loaded " + _datatable.size() + " handlers.");
|
LOGGER.info("AdminCommandHandler: Loaded " + _datatable.size() + " handlers.");
|
||||||
|
@ -23,14 +23,10 @@ import java.util.logging.Logger;
|
|||||||
import org.l2jmobius.Config;
|
import org.l2jmobius.Config;
|
||||||
import org.l2jmobius.gameserver.handler.voicedcommandhandlers.AutoPotion;
|
import org.l2jmobius.gameserver.handler.voicedcommandhandlers.AutoPotion;
|
||||||
import org.l2jmobius.gameserver.handler.voicedcommandhandlers.BankingCmd;
|
import org.l2jmobius.gameserver.handler.voicedcommandhandlers.BankingCmd;
|
||||||
import org.l2jmobius.gameserver.handler.voicedcommandhandlers.CTFCmd;
|
|
||||||
import org.l2jmobius.gameserver.handler.voicedcommandhandlers.DMCmd;
|
|
||||||
import org.l2jmobius.gameserver.handler.voicedcommandhandlers.ExperienceGain;
|
import org.l2jmobius.gameserver.handler.voicedcommandhandlers.ExperienceGain;
|
||||||
import org.l2jmobius.gameserver.handler.voicedcommandhandlers.FarmPvpCmd;
|
|
||||||
import org.l2jmobius.gameserver.handler.voicedcommandhandlers.OfflineShop;
|
import org.l2jmobius.gameserver.handler.voicedcommandhandlers.OfflineShop;
|
||||||
import org.l2jmobius.gameserver.handler.voicedcommandhandlers.Online;
|
import org.l2jmobius.gameserver.handler.voicedcommandhandlers.Online;
|
||||||
import org.l2jmobius.gameserver.handler.voicedcommandhandlers.StatsCmd;
|
import org.l2jmobius.gameserver.handler.voicedcommandhandlers.StatsCmd;
|
||||||
import org.l2jmobius.gameserver.handler.voicedcommandhandlers.TvTCmd;
|
|
||||||
import org.l2jmobius.gameserver.handler.voicedcommandhandlers.Wedding;
|
import org.l2jmobius.gameserver.handler.voicedcommandhandlers.Wedding;
|
||||||
|
|
||||||
public class VoicedCommandHandler
|
public class VoicedCommandHandler
|
||||||
@ -47,21 +43,6 @@ public class VoicedCommandHandler
|
|||||||
registerVoicedCommandHandler(new BankingCmd());
|
registerVoicedCommandHandler(new BankingCmd());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Config.CTF_COMMAND)
|
|
||||||
{
|
|
||||||
registerVoicedCommandHandler(new CTFCmd());
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Config.TVT_COMMAND)
|
|
||||||
{
|
|
||||||
registerVoicedCommandHandler(new TvTCmd());
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Config.DM_COMMAND)
|
|
||||||
{
|
|
||||||
registerVoicedCommandHandler(new DMCmd());
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Config.ALLOW_WEDDING)
|
if (Config.ALLOW_WEDDING)
|
||||||
{
|
{
|
||||||
registerVoicedCommandHandler(new Wedding());
|
registerVoicedCommandHandler(new Wedding());
|
||||||
@ -72,11 +53,6 @@ public class VoicedCommandHandler
|
|||||||
registerVoicedCommandHandler(new StatsCmd());
|
registerVoicedCommandHandler(new StatsCmd());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Config.ALLOW_FARM1_COMMAND || Config.ALLOW_FARM2_COMMAND || Config.ALLOW_PVP1_COMMAND || Config.ALLOW_PVP2_COMMAND)
|
|
||||||
{
|
|
||||||
registerVoicedCommandHandler(new FarmPvpCmd());
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Config.ALLOW_ONLINE_VIEW)
|
if (Config.ALLOW_ONLINE_VIEW)
|
||||||
{
|
{
|
||||||
registerVoicedCommandHandler(new Online());
|
registerVoicedCommandHandler(new Online());
|
||||||
|
@ -1,798 +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 org.l2jmobius.gameserver.handler.admincommandhandlers;
|
|
||||||
|
|
||||||
import java.util.StringTokenizer;
|
|
||||||
|
|
||||||
import org.l2jmobius.Config;
|
|
||||||
import org.l2jmobius.gameserver.data.ItemTable;
|
|
||||||
import org.l2jmobius.gameserver.handler.IAdminCommandHandler;
|
|
||||||
import org.l2jmobius.gameserver.instancemanager.events.CTF;
|
|
||||||
import org.l2jmobius.gameserver.model.Location;
|
|
||||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
|
|
||||||
import org.l2jmobius.gameserver.util.BuilderUtil;
|
|
||||||
|
|
||||||
public class AdminCTFEngine implements IAdminCommandHandler
|
|
||||||
{
|
|
||||||
private static final String[] ADMIN_COMMANDS =
|
|
||||||
{
|
|
||||||
"admin_ctf",
|
|
||||||
"admin_ctf_name",
|
|
||||||
"admin_ctf_desc",
|
|
||||||
"admin_ctf_join_loc",
|
|
||||||
"admin_ctf_edit",
|
|
||||||
"admin_ctf_control",
|
|
||||||
"admin_ctf_minLevel",
|
|
||||||
"admin_ctf_maxLevel",
|
|
||||||
"admin_ctf_tele_npc",
|
|
||||||
"admin_ctf_tele_team",
|
|
||||||
"admin_ctf_tele_flag",
|
|
||||||
"admin_ctf_npc",
|
|
||||||
"admin_ctf_npc_pos",
|
|
||||||
"admin_ctf_reward",
|
|
||||||
"admin_ctf_reward_amount",
|
|
||||||
"admin_ctf_team_add",
|
|
||||||
"admin_ctf_team_remove",
|
|
||||||
"admin_ctf_team_pos",
|
|
||||||
"admin_ctf_team_color",
|
|
||||||
"admin_ctf_team_flag",
|
|
||||||
"admin_ctf_join",
|
|
||||||
"admin_ctf_teleport",
|
|
||||||
"admin_ctf_start",
|
|
||||||
"admin_ctf_startevent",
|
|
||||||
"admin_ctf_abort",
|
|
||||||
"admin_ctf_finish",
|
|
||||||
"admin_ctf_sit",
|
|
||||||
"admin_ctf_dump",
|
|
||||||
"admin_ctf_save",
|
|
||||||
"admin_ctf_load",
|
|
||||||
"admin_ctf_jointime",
|
|
||||||
"admin_ctf_eventtime",
|
|
||||||
"admin_ctf_autoevent",
|
|
||||||
"admin_ctf_minplayers",
|
|
||||||
"admin_ctf_maxplayers",
|
|
||||||
"admin_ctf_interval"
|
|
||||||
};
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean useAdminCommand(String command, PlayerInstance activeChar)
|
|
||||||
{
|
|
||||||
final StringTokenizer st = new StringTokenizer(command);
|
|
||||||
final String comm = st.nextToken();
|
|
||||||
if (comm == null)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (comm)
|
|
||||||
{
|
|
||||||
case "admin_ctf":
|
|
||||||
{
|
|
||||||
showMainPage(activeChar);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
case "admin_ctf_name":
|
|
||||||
{
|
|
||||||
if (st.hasMoreTokens())
|
|
||||||
{
|
|
||||||
if (CTF.setEventName(st.nextToken()))
|
|
||||||
{
|
|
||||||
showMainPage(activeChar);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
BuilderUtil.sendSysMessage(activeChar, "Cannot perform requested operation, event in progress");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
BuilderUtil.sendSysMessage(activeChar, "Usage: //ctf_name <event_name>");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
case "admin_ctf_desc":
|
|
||||||
{
|
|
||||||
if (st.hasMoreTokens())
|
|
||||||
{
|
|
||||||
if (CTF.setEventDesc(st.nextToken()))
|
|
||||||
{
|
|
||||||
showMainPage(activeChar);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
BuilderUtil.sendSysMessage(activeChar, "Cannot perform requested operation, event in progress");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
BuilderUtil.sendSysMessage(activeChar, "Usage: //ctf_desc <event_descr>");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
case "admin_ctf_join_loc":
|
|
||||||
{
|
|
||||||
if (st.hasMoreTokens())
|
|
||||||
{
|
|
||||||
if (CTF.setJoiningLocationName(st.nextToken()))
|
|
||||||
{
|
|
||||||
showMainPage(activeChar);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
BuilderUtil.sendSysMessage(activeChar, "Cannot perform requested operation, event in progress");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
BuilderUtil.sendSysMessage(activeChar, "Usage: //ctf_join_loc <event_loc_name>");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
case "admin_ctf_edit":
|
|
||||||
{
|
|
||||||
showEditPage(activeChar);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
case "admin_ctf_control":
|
|
||||||
{
|
|
||||||
showControlPage(activeChar);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
case "admin_ctf_minLevel":
|
|
||||||
{
|
|
||||||
if (st.hasMoreTokens())
|
|
||||||
{
|
|
||||||
final String lvl_s = st.nextToken();
|
|
||||||
int lvl = 0;
|
|
||||||
try
|
|
||||||
{
|
|
||||||
lvl = Integer.parseInt(lvl_s);
|
|
||||||
}
|
|
||||||
catch (NumberFormatException e)
|
|
||||||
{
|
|
||||||
BuilderUtil.sendSysMessage(activeChar, "Usage: //ctf_minLevel <min_lvl_value>");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (!CTF.checkMinLevel(lvl))
|
|
||||||
{
|
|
||||||
BuilderUtil.sendSysMessage(activeChar, "Cannot perform requested operation, Min lvl must be lower then Max");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (CTF.setMinLevel(lvl))
|
|
||||||
{
|
|
||||||
showMainPage(activeChar);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
BuilderUtil.sendSysMessage(activeChar, "Cannot perform requested operation, event in progress");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
BuilderUtil.sendSysMessage(activeChar, "Usage: //ctf_minLevel <min_lvl_value>");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
case "admin_ctf_maxLevel":
|
|
||||||
{
|
|
||||||
if (st.hasMoreTokens())
|
|
||||||
{
|
|
||||||
final String lvl_s = st.nextToken();
|
|
||||||
int lvl = 0;
|
|
||||||
try
|
|
||||||
{
|
|
||||||
lvl = Integer.parseInt(lvl_s);
|
|
||||||
}
|
|
||||||
catch (NumberFormatException e)
|
|
||||||
{
|
|
||||||
BuilderUtil.sendSysMessage(activeChar, "Usage: //ctf_maxLevel <max_lvl_value>");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (!CTF.checkMaxLevel(lvl))
|
|
||||||
{
|
|
||||||
BuilderUtil.sendSysMessage(activeChar, "Cannot perform requested operation, Max lvl must be higher then Min");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (CTF.setMaxLevel(lvl))
|
|
||||||
{
|
|
||||||
showMainPage(activeChar);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
BuilderUtil.sendSysMessage(activeChar, "Cannot perform requested operation, event in progress");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
BuilderUtil.sendSysMessage(activeChar, "Usage: //ctf_maxLevel <min_lvl_value>");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
case "admin_ctf_tele_npc":
|
|
||||||
{
|
|
||||||
activeChar.teleToLocation(CTF.getNpcLocation(), false);
|
|
||||||
showMainPage(activeChar);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
case "admin_ctf_tele_team":
|
|
||||||
{
|
|
||||||
if (st.hasMoreTokens())
|
|
||||||
{
|
|
||||||
for (String team : CTF._teams)
|
|
||||||
{
|
|
||||||
if (team.equals(st.nextToken()))
|
|
||||||
{
|
|
||||||
final int index = CTF._teams.indexOf(team);
|
|
||||||
activeChar.teleToLocation(CTF._teamsX.get(index), CTF._teamsY.get(index), CTF._teamsZ.get(index));
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
BuilderUtil.sendSysMessage(activeChar, "Usage: //ctf_tele_team <team_name>");
|
|
||||||
showMainPage(activeChar);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
BuilderUtil.sendSysMessage(activeChar, "Usage: //ctf_tele_team <team_name>");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
case "admin_ctf_tele_flag":
|
|
||||||
{
|
|
||||||
if (st.hasMoreTokens())
|
|
||||||
{
|
|
||||||
for (String team : CTF._teams)
|
|
||||||
{
|
|
||||||
if (team.equals(st.nextToken()))
|
|
||||||
{
|
|
||||||
final int index = CTF._teams.indexOf(team);
|
|
||||||
activeChar.teleToLocation(CTF._flagsX.get(index), CTF._flagsY.get(index), CTF._flagsZ.get(index));
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
BuilderUtil.sendSysMessage(activeChar, "Usage: //ctf_tele_flag <team_name>");
|
|
||||||
showMainPage(activeChar);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
BuilderUtil.sendSysMessage(activeChar, "Usage: //ctf_tele_flag <team_name>");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
case "admin_ctf_npc":
|
|
||||||
{
|
|
||||||
if (st.hasMoreTokens())
|
|
||||||
{
|
|
||||||
int id = 0;
|
|
||||||
try
|
|
||||||
{
|
|
||||||
id = Integer.parseInt(st.nextToken());
|
|
||||||
}
|
|
||||||
catch (NumberFormatException e)
|
|
||||||
{
|
|
||||||
BuilderUtil.sendSysMessage(activeChar, "Usage: //ctf_npc <npc_id>");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (CTF.setNpcId(id))
|
|
||||||
{
|
|
||||||
showMainPage(activeChar);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
BuilderUtil.sendSysMessage(activeChar, "Cannot perform requested operation, event in progress");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
BuilderUtil.sendSysMessage(activeChar, "Usage: //ctf_npc <npc_id>");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
case "admin_ctf_npc_pos":
|
|
||||||
{
|
|
||||||
CTF.setNpcPos(activeChar);
|
|
||||||
showMainPage(activeChar);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
case "admin_ctf_reward":
|
|
||||||
{
|
|
||||||
if (st.hasMoreTokens())
|
|
||||||
{
|
|
||||||
int id = 0;
|
|
||||||
try
|
|
||||||
{
|
|
||||||
id = Integer.parseInt(st.nextToken());
|
|
||||||
}
|
|
||||||
catch (NumberFormatException e)
|
|
||||||
{
|
|
||||||
BuilderUtil.sendSysMessage(activeChar, "Usage: //ctf_reward <reward_id>");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (CTF.setRewardId(id))
|
|
||||||
{
|
|
||||||
showMainPage(activeChar);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
BuilderUtil.sendSysMessage(activeChar, "Cannot perform requested operation, event in progress");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
BuilderUtil.sendSysMessage(activeChar, "Usage: //ctf_reward <reward_id>");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
case "admin_ctf_reward_amount":
|
|
||||||
{
|
|
||||||
if (st.hasMoreTokens())
|
|
||||||
{
|
|
||||||
int amount = 0;
|
|
||||||
try
|
|
||||||
{
|
|
||||||
amount = Integer.parseInt(st.nextToken());
|
|
||||||
}
|
|
||||||
catch (NumberFormatException e)
|
|
||||||
{
|
|
||||||
BuilderUtil.sendSysMessage(activeChar, "Usage: //ctf_reward_amount <reward_amount>");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (CTF.setRewardAmount(amount))
|
|
||||||
{
|
|
||||||
showMainPage(activeChar);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
BuilderUtil.sendSysMessage(activeChar, "Cannot perform requested operation, event in progress");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
BuilderUtil.sendSysMessage(activeChar, "Usage: //ctf_reward_amount <reward_amount>");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
case "admin_ctf_team_add":
|
|
||||||
{
|
|
||||||
if (st.hasMoreTokens())
|
|
||||||
{
|
|
||||||
CTF.addTeam(st.nextToken());
|
|
||||||
showMainPage(activeChar);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
BuilderUtil.sendSysMessage(activeChar, "Usage: //ctf_team_add <team_name>");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
case "admin_ctf_team_remove":
|
|
||||||
{
|
|
||||||
if (st.hasMoreTokens())
|
|
||||||
{
|
|
||||||
CTF.removeTeam(st.nextToken());
|
|
||||||
showMainPage(activeChar);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
BuilderUtil.sendSysMessage(activeChar, "Usage: //ctf_team_remove <team_name>");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
case "admin_ctf_team_pos":
|
|
||||||
{
|
|
||||||
if (st.hasMoreTokens())
|
|
||||||
{
|
|
||||||
CTF.setTeamPos(st.nextToken(), activeChar);
|
|
||||||
showMainPage(activeChar);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
BuilderUtil.sendSysMessage(activeChar, "Usage: //ctf_team_pos <team_name>");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
case "admin_ctf_team_color":
|
|
||||||
{
|
|
||||||
if (st.countTokens() == 2)
|
|
||||||
{
|
|
||||||
final String color_s = st.nextToken();
|
|
||||||
int color = 0;
|
|
||||||
try
|
|
||||||
{
|
|
||||||
color = Integer.decode("0x" + color_s);
|
|
||||||
}
|
|
||||||
catch (NumberFormatException e)
|
|
||||||
{
|
|
||||||
BuilderUtil.sendSysMessage(activeChar, "Usage: //ctf_team_color <colorHex> <teamName>");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
final String team = st.nextToken();
|
|
||||||
CTF.setTeamColor(team, color);
|
|
||||||
showMainPage(activeChar);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
BuilderUtil.sendSysMessage(activeChar, "Usage: //ctf_team_color <colorHex> <teamName>");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
case "admin_ctf_team_flag":
|
|
||||||
{
|
|
||||||
if (st.hasMoreTokens())
|
|
||||||
{
|
|
||||||
CTF.setTeamFlag(st.nextToken(), activeChar);
|
|
||||||
showMainPage(activeChar);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
BuilderUtil.sendSysMessage(activeChar, "Usage: //ctf_team_flag <teamName>");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
case "admin_ctf_join":
|
|
||||||
{
|
|
||||||
if (CTF.startJoin())
|
|
||||||
{
|
|
||||||
showMainPage(activeChar);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
BuilderUtil.sendSysMessage(activeChar, "Cannot startJoin, check LOGGER for info..");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
case "admin_ctf_teleport":
|
|
||||||
{
|
|
||||||
CTF.startTeleport();
|
|
||||||
showMainPage(activeChar);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
case "admin_ctf_start":
|
|
||||||
{
|
|
||||||
if (CTF.startEvent())
|
|
||||||
{
|
|
||||||
showMainPage(activeChar);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
BuilderUtil.sendSysMessage(activeChar, "Cannot startEvent, check LOGGER for info..");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
case "admin_ctf_startevent":
|
|
||||||
{
|
|
||||||
CTF.eventOnceStart();
|
|
||||||
showMainPage(activeChar);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
case "admin_ctf_abort":
|
|
||||||
{
|
|
||||||
BuilderUtil.sendSysMessage(activeChar, "Aborting event");
|
|
||||||
CTF.abortEvent();
|
|
||||||
showMainPage(activeChar);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
case "admin_ctf_finish":
|
|
||||||
{
|
|
||||||
CTF.finishEvent();
|
|
||||||
showMainPage(activeChar);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
case "admin_ctf_sit":
|
|
||||||
{
|
|
||||||
CTF.sit();
|
|
||||||
showMainPage(activeChar);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
case "admin_ctf_dump":
|
|
||||||
{
|
|
||||||
CTF.dumpData();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
case "admin_ctf_save":
|
|
||||||
{
|
|
||||||
CTF.saveData();
|
|
||||||
showMainPage(activeChar);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
case "admin_ctf_load":
|
|
||||||
{
|
|
||||||
CTF.loadData();
|
|
||||||
showMainPage(activeChar);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
case "admin_ctf_jointime":
|
|
||||||
{
|
|
||||||
if (st.hasMoreTokens())
|
|
||||||
{
|
|
||||||
final String time_s = st.nextToken();
|
|
||||||
int time = 0;
|
|
||||||
try
|
|
||||||
{
|
|
||||||
time = Integer.parseInt(time_s);
|
|
||||||
}
|
|
||||||
catch (NumberFormatException e)
|
|
||||||
{
|
|
||||||
BuilderUtil.sendSysMessage(activeChar, "Usage: //ctf_jointime <minutes>");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (CTF.setJoinTime(time))
|
|
||||||
{
|
|
||||||
showMainPage(activeChar);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
BuilderUtil.sendSysMessage(activeChar, "Cannot perform requested operation, event in progress");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
BuilderUtil.sendSysMessage(activeChar, "Usage: //ctf_jointime <minutes>");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
case "admin_ctf_eventtime":
|
|
||||||
{
|
|
||||||
if (st.hasMoreTokens())
|
|
||||||
{
|
|
||||||
final String time_s = st.nextToken();
|
|
||||||
int time = 0;
|
|
||||||
try
|
|
||||||
{
|
|
||||||
time = Integer.parseInt(time_s);
|
|
||||||
}
|
|
||||||
catch (NumberFormatException e)
|
|
||||||
{
|
|
||||||
BuilderUtil.sendSysMessage(activeChar, "Usage: //ctf_eventtime <minutes>");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (CTF.setEventTime(time))
|
|
||||||
{
|
|
||||||
showMainPage(activeChar);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
BuilderUtil.sendSysMessage(activeChar, "Cannot perform requested operation, event in progress");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
BuilderUtil.sendSysMessage(activeChar, "Usage: //ctf_eventtime <minutes>");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
case "admin_ctf_autoevent":
|
|
||||||
{
|
|
||||||
if ((CTF.getJoinTime() > 0) && (CTF.getEventTime() > 0))
|
|
||||||
{
|
|
||||||
CTF.autoEvent();
|
|
||||||
showMainPage(activeChar);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
BuilderUtil.sendSysMessage(activeChar, "Cannot perform requested operation, times not defined");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
case "admin_ctf_interval":
|
|
||||||
{
|
|
||||||
if (st.hasMoreTokens())
|
|
||||||
{
|
|
||||||
final String time_s = st.nextToken();
|
|
||||||
int time = 0;
|
|
||||||
try
|
|
||||||
{
|
|
||||||
time = Integer.parseInt(time_s);
|
|
||||||
}
|
|
||||||
catch (NumberFormatException e)
|
|
||||||
{
|
|
||||||
BuilderUtil.sendSysMessage(activeChar, "Usage: //ctf_interval <minutes>");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (CTF.setIntervalBetweenMatches(time))
|
|
||||||
{
|
|
||||||
showMainPage(activeChar);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
BuilderUtil.sendSysMessage(activeChar, "Cannot perform requested operation, event in progress");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
BuilderUtil.sendSysMessage(activeChar, "Usage: //ctf_interval <minutes>");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
case "admin_ctf_minplayers":
|
|
||||||
{
|
|
||||||
if (st.hasMoreTokens())
|
|
||||||
{
|
|
||||||
final String min_s = st.nextToken();
|
|
||||||
int min = 0;
|
|
||||||
try
|
|
||||||
{
|
|
||||||
min = Integer.parseInt(min_s);
|
|
||||||
}
|
|
||||||
catch (NumberFormatException e)
|
|
||||||
{
|
|
||||||
BuilderUtil.sendSysMessage(activeChar, "Usage: //ctf_minplayers <number>");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (CTF.setMinPlayers(min))
|
|
||||||
{
|
|
||||||
showMainPage(activeChar);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
BuilderUtil.sendSysMessage(activeChar, "Cannot perform requested operation, event in progress");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
BuilderUtil.sendSysMessage(activeChar, "Usage: //ctf_minplayers <number>");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
case "admin_ctf_maxplayers":
|
|
||||||
{
|
|
||||||
if (st.hasMoreTokens())
|
|
||||||
{
|
|
||||||
final String max_s = st.nextToken();
|
|
||||||
int max = 0;
|
|
||||||
try
|
|
||||||
{
|
|
||||||
max = Integer.parseInt(max_s);
|
|
||||||
}
|
|
||||||
catch (NumberFormatException e)
|
|
||||||
{
|
|
||||||
BuilderUtil.sendSysMessage(activeChar, "Usage: //ctf_maxplayers <number>");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (CTF.setMaxPlayers(max))
|
|
||||||
{
|
|
||||||
showMainPage(activeChar);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
BuilderUtil.sendSysMessage(activeChar, "Cannot perform requested operation, event in progress");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
BuilderUtil.sendSysMessage(activeChar, "Usage: //ctf_maxplayers <number>");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
default:
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String[] getAdminCommandList()
|
|
||||||
{
|
|
||||||
return ADMIN_COMMANDS;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void showEditPage(PlayerInstance activeChar)
|
|
||||||
{
|
|
||||||
final NpcHtmlMessage adminReply = new NpcHtmlMessage(5);
|
|
||||||
final StringBuilder replyMSG = new StringBuilder("<html><body>");
|
|
||||||
replyMSG.append("<center><font color=\"LEVEL\">[CTF Engine]</font></center><br><br><br>");
|
|
||||||
replyMSG.append("<table><tr><td><edit var=\"input1\" width=\"125\"></td><td><edit var=\"input2\" width=\"125\"></td></tr></table>");
|
|
||||||
replyMSG.append("<table border=\"0\"><tr>");
|
|
||||||
replyMSG.append("<td width=\"100\"><button value=\"Name\" action=\"bypass -h admin_ctf_name $input1\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
|
|
||||||
replyMSG.append("<td width=\"100\"><button value=\"Description\" action=\"bypass -h admin_ctf_desc $input1\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
|
|
||||||
replyMSG.append("<td width=\"100\"><button value=\"Join Location\" action=\"bypass -h admin_ctf_join_loc $input1\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
|
|
||||||
replyMSG.append("</tr></table><br><table><tr>");
|
|
||||||
replyMSG.append("<td width=\"100\"><button value=\"Max lvl\" action=\"bypass -h admin_ctf_maxLevel $input1\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
|
|
||||||
replyMSG.append("<td width=\"100\"><button value=\"Min lvl\" action=\"bypass -h admin_ctf_minLevel $input1\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
|
|
||||||
replyMSG.append("</tr></table><br><table><tr>");
|
|
||||||
replyMSG.append("<td width=\"100\"><button value=\"Max players\" action=\"bypass -h admin_ctf_maxplayers $input1\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
|
|
||||||
replyMSG.append("<td width=\"100\"><button value=\"Min players\" action=\"bypass -h admin_ctf_minplayers $input1\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
|
|
||||||
replyMSG.append("</tr></table><br><table><tr>");
|
|
||||||
replyMSG.append("<td width=\"100\"><button value=\"NPC\" action=\"bypass -h admin_ctf_npc $input1\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
|
|
||||||
replyMSG.append("<td width=\"100\"><button value=\"NPC Pos\" action=\"bypass -h admin_ctf_npc_pos\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
|
|
||||||
replyMSG.append("</tr></table><br><table><tr>");
|
|
||||||
replyMSG.append("<td width=\"100\"><button value=\"Reward\" action=\"bypass -h admin_ctf_reward $input1\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
|
|
||||||
replyMSG.append("<td width=\"100\"><button value=\"Reward Amount\" action=\"bypass -h admin_ctf_reward_amount $input1\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
|
|
||||||
replyMSG.append("</tr></table><br><table><tr>");
|
|
||||||
replyMSG.append("<td width=\"100\"><button value=\"Join Time\" action=\"bypass -h admin_ctf_jointime $input1\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
|
|
||||||
replyMSG.append("<td width=\"100\"><button value=\"Event Time\" action=\"bypass -h admin_ctf_eventtime $input1\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
|
|
||||||
replyMSG.append("<td width=\"100\"><button value=\"Interval Time\" action=\"bypass -h admin_ctf_interval $input1\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
|
|
||||||
replyMSG.append("</tr></table><br><table><tr>");
|
|
||||||
replyMSG.append("<td width=\"100\"><button value=\"Team Add\" action=\"bypass -h admin_ctf_team_add $input1\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
|
|
||||||
replyMSG.append("<td width=\"100\"><button value=\"Team Color\" action=\"bypass -h admin_ctf_team_color $input1 $input2\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
|
|
||||||
replyMSG.append("<td width=\"100\"><button value=\"Team Pos\" action=\"bypass -h admin_ctf_team_pos $input1\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
|
|
||||||
replyMSG.append("</tr></table><table><tr>");
|
|
||||||
replyMSG.append("<td width=\"100\"><button value=\"Team Flag\" action=\"bypass -h admin_ctf_team_flag $input1 $input2\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
|
|
||||||
replyMSG.append("<td width=\"100\"><button value=\"Team Remove\" action=\"bypass -h admin_ctf_team_remove $input1\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
|
|
||||||
replyMSG.append("</tr></table><br>");
|
|
||||||
replyMSG.append("<br><center><button value=\"Back\" action=\"bypass -h admin_ctf\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></center></body></html>");
|
|
||||||
adminReply.setHtml(replyMSG.toString());
|
|
||||||
activeChar.sendPacket(adminReply);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void showControlPage(PlayerInstance activeChar)
|
|
||||||
{
|
|
||||||
final NpcHtmlMessage adminReply = new NpcHtmlMessage(5);
|
|
||||||
final StringBuilder replyMSG = new StringBuilder("<html><body>");
|
|
||||||
replyMSG.append("<center><font color=\"LEVEL\">[CTF Engine]</font></center><br><br><br>");
|
|
||||||
replyMSG.append("<table border=\"0\"><tr>");
|
|
||||||
replyMSG.append("<td width=\"100\"><button value=\"Join\" action=\"bypass -h admin_ctf_join\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
|
|
||||||
replyMSG.append("<td width=\"100\"><button value=\"Teleport\" action=\"bypass -h admin_ctf_teleport\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
|
|
||||||
replyMSG.append("<td width=\"100\"><button value=\"Start\" action=\"bypass -h admin_ctf_start\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
|
|
||||||
replyMSG.append("</tr></table><table><tr>");
|
|
||||||
replyMSG.append("<table border=\"0\"><tr>");
|
|
||||||
replyMSG.append("<td width=\"100\"><button value=\"StartEventOnceTime\" action=\"bypass -h admin_ctf_startevent\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
|
|
||||||
replyMSG.append("</tr></table><table><tr>");
|
|
||||||
replyMSG.append("<td width=\"100\"><button value=\"Abort\" action=\"bypass -h admin_ctf_abort\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
|
|
||||||
replyMSG.append("<td width=\"100\"><button value=\"Finish\" action=\"bypass -h admin_ctf_finish\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
|
|
||||||
replyMSG.append("</tr></table><br><table><tr>");
|
|
||||||
replyMSG.append("<td width=\"100\"><button value=\"Sit Force\" action=\"bypass -h admin_ctf_sit\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
|
|
||||||
replyMSG.append("<td width=\"100\"><button value=\"Dump\" action=\"bypass -h admin_ctf_dump\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
|
|
||||||
replyMSG.append("</tr></table><br><br><table><tr>");
|
|
||||||
replyMSG.append("<td width=\"100\"><button value=\"Save\" action=\"bypass -h admin_ctf_save\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
|
|
||||||
replyMSG.append("<td width=\"100\"><button value=\"Load\" action=\"bypass -h admin_ctf_load\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
|
|
||||||
replyMSG.append("<td width=\"100\"><button value=\"Auto Event\" action=\"bypass -h admin_ctf_autoevent\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
|
|
||||||
replyMSG.append("</tr></table><br>");
|
|
||||||
replyMSG.append("<br><center><button value=\"Back\" action=\"bypass -h admin_ctf\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></center></body></html>");
|
|
||||||
adminReply.setHtml(replyMSG.toString());
|
|
||||||
activeChar.sendPacket(adminReply);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void showMainPage(PlayerInstance activeChar)
|
|
||||||
{
|
|
||||||
final NpcHtmlMessage adminReply = new NpcHtmlMessage(5);
|
|
||||||
final StringBuilder replyMSG = new StringBuilder("<html><body>");
|
|
||||||
replyMSG.append("<center><font color=\"LEVEL\">[CTF Engine]</font></center><br><br><br>");
|
|
||||||
replyMSG.append("<table><tr>");
|
|
||||||
if (!CTF.isInProgress())
|
|
||||||
{
|
|
||||||
replyMSG.append("<td width=\"100\"><button value=\"Edit\" action=\"bypass -h admin_ctf_edit\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
|
|
||||||
}
|
|
||||||
replyMSG.append("<td width=\"100\"><button value=\"Control\" action=\"bypass -h admin_ctf_control\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
|
|
||||||
replyMSG.append("</tr></table><br>");
|
|
||||||
|
|
||||||
replyMSG.append("<br><font color=\"LEVEL\">Current event...</font><br1>");
|
|
||||||
replyMSG.append("Name: <font color=\"00FF00\">" + CTF.getEventName() + "</font><br1>");
|
|
||||||
replyMSG.append("Description: <font color=\"00FF00\">" + CTF.getEventDesc() + "</font><br1>");
|
|
||||||
replyMSG.append("Joining location name: <font color=\"00FF00\">" + CTF.getJoiningLocationName() + "</font><br1>");
|
|
||||||
|
|
||||||
final Location npcLoc = CTF.getNpcLocation();
|
|
||||||
replyMSG.append("Joining NPC ID: <font color=\"00FF00\">" + CTF.getNpcId() + " on pos " + npcLoc.getX() + "," + npcLoc.getY() + "," + npcLoc.getZ() + "</font><br1>");
|
|
||||||
replyMSG.append("<button value=\"Tele->NPC\" action=\"bypass -h admin_ctf_tele_npc\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"><br>");
|
|
||||||
replyMSG.append("Reward ID: <font color=\"00FF00\">" + CTF.getRewardId() + "</font><br1>");
|
|
||||||
if (ItemTable.getInstance().getTemplate(CTF.getRewardId()) != null)
|
|
||||||
{
|
|
||||||
replyMSG.append("Reward Item: <font color=\"00FF00\">" + ItemTable.getInstance().getTemplate(CTF.getRewardId()).getName() + "</font><br1>");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
replyMSG.append("Reward Item: <font color=\"00FF00\">(unknown)</font><br1>");
|
|
||||||
}
|
|
||||||
replyMSG.append("Reward Amount: <font color=\"00FF00\">" + CTF.getRewardAmount() + "</font><br>");
|
|
||||||
replyMSG.append("Min lvl: <font color=\"00FF00\">" + CTF.getMinLevel() + "</font><br1>");
|
|
||||||
replyMSG.append("Max lvl: <font color=\"00FF00\">" + CTF.getMaxLevel() + "</font><br><br>");
|
|
||||||
replyMSG.append("Min Players: <font color=\"00FF00\">" + CTF.getMinPlayers() + "</font><br1>");
|
|
||||||
replyMSG.append("Max Players: <font color=\"00FF00\">" + CTF.getMaxPlayers() + "</font><br>");
|
|
||||||
replyMSG.append("Joining Time: <font color=\"00FF00\">" + CTF.getJoinTime() + "</font><br1>");
|
|
||||||
replyMSG.append("Event Time: <font color=\"00FF00\">" + CTF.getEventTime() + "</font><br>");
|
|
||||||
if ((CTF._teams != null) && !CTF._teams.isEmpty())
|
|
||||||
{
|
|
||||||
replyMSG.append("<font color=\"LEVEL\">Current teams:</font><br1>");
|
|
||||||
}
|
|
||||||
replyMSG.append("<center><table border=\"0\">");
|
|
||||||
for (String team : CTF._teams)
|
|
||||||
{
|
|
||||||
replyMSG.append("<tr><td width=\"100\">Name: <font color=\"FF0000\">" + team + "</font>");
|
|
||||||
if (Config.CTF_EVEN_TEAMS.equals("NO") || Config.CTF_EVEN_TEAMS.equals("BALANCE"))
|
|
||||||
{
|
|
||||||
replyMSG.append(" (" + CTF.teamPlayersCount(team) + " joined)");
|
|
||||||
}
|
|
||||||
else if (Config.CTF_EVEN_TEAMS.equals("SHUFFLE"))
|
|
||||||
{
|
|
||||||
if (CTF.isTeleport() || CTF.isStarted())
|
|
||||||
{
|
|
||||||
replyMSG.append(" (" + CTF.teamPlayersCount(team) + " in)");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
replyMSG.append("</td></tr><tr><td>");
|
|
||||||
|
|
||||||
String c = Integer.toHexString(CTF._teamColors.get(CTF._teams.indexOf(team)));
|
|
||||||
while (c.length() < 6)
|
|
||||||
{
|
|
||||||
c = "0" + c;
|
|
||||||
}
|
|
||||||
replyMSG.append("Color: <font color=\"00FF00\">0x" + c.toUpperCase() + "</font><font color=\"" + c + "\"> =) </font>");
|
|
||||||
replyMSG.append("</td></tr><tr><td>");
|
|
||||||
replyMSG.append("<button value=\"Tele->Team\" action=\"bypass -h admin_ctf_tele_team " + team + "\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\">");
|
|
||||||
replyMSG.append("</td></tr><tr><td>");
|
|
||||||
replyMSG.append(CTF._teamsX.get(CTF._teams.indexOf(team)) + ", " + CTF._teamsY.get(CTF._teams.indexOf(team)) + ", " + CTF._teamsZ.get(CTF._teams.indexOf(team)));
|
|
||||||
replyMSG.append("</td></tr><tr><td>");
|
|
||||||
replyMSG.append("Flag Id: <font color=\"00FF00\">" + CTF._flagIds.get(CTF._teams.indexOf(team)) + "</font>");
|
|
||||||
replyMSG.append("</td></tr><tr><td>");
|
|
||||||
replyMSG.append("<button value=\"Tele->Flag\" action=\"bypass -h admin_ctf_tele_flag " + team + "\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\">");
|
|
||||||
replyMSG.append("</td></tr><tr><td>");
|
|
||||||
replyMSG.append(CTF._flagsX.get(CTF._teams.indexOf(team)) + ", " + CTF._flagsY.get(CTF._teams.indexOf(team)) + ", " + CTF._flagsZ.get(CTF._teams.indexOf(team)) + "</td></tr>");
|
|
||||||
if (!CTF.isInProgress())
|
|
||||||
{
|
|
||||||
replyMSG.append("<tr><td width=\"60\"><button value=\"Remove\" action=\"bypass -h admin_ctf_team_remove " + team + "\" width=50 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td></tr><tr></tr>");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
replyMSG.append("</table></center>");
|
|
||||||
|
|
||||||
if (!CTF.isInProgress())
|
|
||||||
{
|
|
||||||
if (CTF.checkStartJoinOk())
|
|
||||||
{
|
|
||||||
replyMSG.append("<br1>");
|
|
||||||
replyMSG.append("Event is now set up. Press JOIN to start the registration.<br1>");
|
|
||||||
replyMSG.append(" <button value=\"Join\" action=\"bypass -h admin_ctf_join\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"><br1>");
|
|
||||||
replyMSG.append("<br>");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
replyMSG.append("<br1>");
|
|
||||||
replyMSG.append("Event is NOT set up. Press <font color=\"LEVEL\">EDIT</font> to create a new event, or <font color=\"LEVEL\">CONTROL</font> to load an existing event.<br1>");
|
|
||||||
replyMSG.append("<br>");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (Config.CTF_EVEN_TEAMS.equals("SHUFFLE") && !CTF.isStarted())
|
|
||||||
{
|
|
||||||
replyMSG.append("<br1>");
|
|
||||||
replyMSG.append(CTF._playersShuffle.size() + " players participating. Waiting to shuffle in teams(done on teleport)!");
|
|
||||||
replyMSG.append("<br><br>");
|
|
||||||
}
|
|
||||||
|
|
||||||
replyMSG.append("</body></html>");
|
|
||||||
adminReply.setHtml(replyMSG.toString());
|
|
||||||
activeChar.sendPacket(adminReply);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,326 +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 org.l2jmobius.gameserver.handler.admincommandhandlers;
|
|
||||||
|
|
||||||
import org.l2jmobius.gameserver.handler.IAdminCommandHandler;
|
|
||||||
import org.l2jmobius.gameserver.instancemanager.events.DM;
|
|
||||||
import org.l2jmobius.gameserver.model.Location;
|
|
||||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
|
|
||||||
import org.l2jmobius.gameserver.util.BuilderUtil;
|
|
||||||
|
|
||||||
public class AdminDMEngine implements IAdminCommandHandler
|
|
||||||
{
|
|
||||||
private static final String[] ADMIN_COMMANDS =
|
|
||||||
{
|
|
||||||
"admin_dmevent",
|
|
||||||
"admin_dmevent_name",
|
|
||||||
"admin_dmevent_desc",
|
|
||||||
"admin_dmevent_join_loc",
|
|
||||||
"admin_dmevent_minLevel",
|
|
||||||
"admin_dmevent_maxLevel",
|
|
||||||
"admin_dmevent_npc",
|
|
||||||
"admin_dmevent_npc_pos",
|
|
||||||
"admin_dmevent_reward",
|
|
||||||
"admin_dmevent_reward_amount",
|
|
||||||
"admin_dmevent_spawnpos",
|
|
||||||
"admin_dmevent_color",
|
|
||||||
"admin_dmevent_join",
|
|
||||||
"admin_dmevent_teleport",
|
|
||||||
"admin_dmevent_start",
|
|
||||||
"admin_dmevent_startevent",
|
|
||||||
"admin_dmevent_abort",
|
|
||||||
"admin_dmevent_finish",
|
|
||||||
"admin_dmevent_sit",
|
|
||||||
"admin_dmevent_dump",
|
|
||||||
"admin_dmevent_save",
|
|
||||||
"admin_dmevent_load"
|
|
||||||
};
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean useAdminCommand(String command, PlayerInstance activeChar)
|
|
||||||
{
|
|
||||||
if (command.equals("admin_dmevent"))
|
|
||||||
{
|
|
||||||
showMainPage(activeChar);
|
|
||||||
}
|
|
||||||
else if (command.startsWith("admin_dmevent_name "))
|
|
||||||
{
|
|
||||||
if (DM.setEventName(command.substring(19)))
|
|
||||||
{
|
|
||||||
showMainPage(activeChar);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
BuilderUtil.sendSysMessage(activeChar, "Cannot perform requested operation, event in progress");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (command.startsWith("admin_dmevent_desc "))
|
|
||||||
{
|
|
||||||
if (DM.setEventDesc(command.substring(19)))
|
|
||||||
{
|
|
||||||
showMainPage(activeChar);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
BuilderUtil.sendSysMessage(activeChar, "Cannot perform requested operation, event in progress");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (command.startsWith("admin_dmevent_minLevel "))
|
|
||||||
{
|
|
||||||
if (!DM.checkMinLevel(Integer.parseInt(command.substring(21))))
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (DM.setMinlvl(Integer.parseInt(command.substring(21))))
|
|
||||||
{
|
|
||||||
showMainPage(activeChar);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
BuilderUtil.sendSysMessage(activeChar, "Cannot perform requested operation, event in progress");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (command.startsWith("admin_dmevent_maxLevel "))
|
|
||||||
{
|
|
||||||
if (!DM.checkMaxLevel(Integer.parseInt(command.substring(21))))
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (DM.setMaxlvl(Integer.parseInt(command.substring(21))))
|
|
||||||
{
|
|
||||||
showMainPage(activeChar);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
BuilderUtil.sendSysMessage(activeChar, "Cannot perform requested operation, event in progress");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (command.startsWith("admin_dmevent_join_loc "))
|
|
||||||
{
|
|
||||||
if (DM.setJoiningLocationName(command.substring(23)))
|
|
||||||
{
|
|
||||||
showMainPage(activeChar);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
BuilderUtil.sendSysMessage(activeChar, "Cannot perform requested operation, event in progress");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (command.startsWith("admin_dmevent_npc "))
|
|
||||||
{
|
|
||||||
if (DM.setNpcId(Integer.parseInt(command.substring(18))))
|
|
||||||
{
|
|
||||||
showMainPage(activeChar);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
BuilderUtil.sendSysMessage(activeChar, "Cannot perform requested operation, event in progress");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (command.equals("admin_dmevent_npc_pos"))
|
|
||||||
{
|
|
||||||
DM.setNpcPos(activeChar);
|
|
||||||
showMainPage(activeChar);
|
|
||||||
}
|
|
||||||
else if (command.startsWith("admin_dmevent_reward "))
|
|
||||||
{
|
|
||||||
if (DM.setRewardId(Integer.parseInt(command.substring(21))))
|
|
||||||
{
|
|
||||||
showMainPage(activeChar);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
BuilderUtil.sendSysMessage(activeChar, "Cannot perform requested operation, event in progress");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (command.startsWith("admin_dmevent_reward_amount "))
|
|
||||||
{
|
|
||||||
if (DM.setRewardAmount(Integer.parseInt(command.substring(28))))
|
|
||||||
{
|
|
||||||
showMainPage(activeChar);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
BuilderUtil.sendSysMessage(activeChar, "Cannot perform requested operation, event in progress");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (command.equals("admin_dmevent_spawnpos"))
|
|
||||||
{
|
|
||||||
DM.setPlayersPos(activeChar);
|
|
||||||
showMainPage(activeChar);
|
|
||||||
}
|
|
||||||
else if (command.startsWith("admin_dmevent_color "))
|
|
||||||
{
|
|
||||||
if (DM.setPlayerColors(Integer.decode("0x" + command.substring(20))))
|
|
||||||
{
|
|
||||||
showMainPage(activeChar);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
BuilderUtil.sendSysMessage(activeChar, "Cannot perform requested operation, event in progress");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (command.equals("admin_dmevent_join"))
|
|
||||||
{
|
|
||||||
if (DM.startJoin())
|
|
||||||
{
|
|
||||||
showMainPage(activeChar);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
BuilderUtil.sendSysMessage(activeChar, "Cannot startJoin, check LOGGER for info..");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (command.equals("admin_dmevent_teleport"))
|
|
||||||
{
|
|
||||||
DM.startTeleport();
|
|
||||||
showMainPage(activeChar);
|
|
||||||
}
|
|
||||||
else if (command.equals("admin_dmevent_start"))
|
|
||||||
{
|
|
||||||
if (DM.startEvent())
|
|
||||||
{
|
|
||||||
showMainPage(activeChar);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
BuilderUtil.sendSysMessage(activeChar, "Cannot startEvent, check LOGGER for info..");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (command.equals("admin_dmevent_startevent"))
|
|
||||||
{
|
|
||||||
DM.startEvent();
|
|
||||||
showMainPage(activeChar);
|
|
||||||
|
|
||||||
}
|
|
||||||
else if (command.equals("admin_dmevent_abort"))
|
|
||||||
{
|
|
||||||
BuilderUtil.sendSysMessage(activeChar, "Aborting event");
|
|
||||||
DM.abortEvent();
|
|
||||||
showMainPage(activeChar);
|
|
||||||
}
|
|
||||||
else if (command.equals("admin_dmevent_finish"))
|
|
||||||
{
|
|
||||||
DM.finishEvent();
|
|
||||||
showMainPage(activeChar);
|
|
||||||
}
|
|
||||||
else if (command.equals("admin_dmevent_sit"))
|
|
||||||
{
|
|
||||||
DM.sit();
|
|
||||||
showMainPage(activeChar);
|
|
||||||
}
|
|
||||||
else if (command.equals("admin_dmevent_load"))
|
|
||||||
{
|
|
||||||
DM.loadData();
|
|
||||||
showMainPage(activeChar);
|
|
||||||
}
|
|
||||||
else if (command.equals("admin_dmevent_save"))
|
|
||||||
{
|
|
||||||
DM.saveData();
|
|
||||||
showMainPage(activeChar);
|
|
||||||
}
|
|
||||||
else if (command.equals("admin_dmevent_dump"))
|
|
||||||
{
|
|
||||||
DM.dumpData();
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String[] getAdminCommandList()
|
|
||||||
{
|
|
||||||
return ADMIN_COMMANDS;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void showMainPage(PlayerInstance activeChar)
|
|
||||||
{
|
|
||||||
final NpcHtmlMessage adminReply = new NpcHtmlMessage(5);
|
|
||||||
final StringBuilder replyMSG = new StringBuilder("<html><body>");
|
|
||||||
replyMSG.append("<center><font color=\"LEVEL\">[DeathMatch Engine]</font></center><br><br><br>");
|
|
||||||
replyMSG.append("<table><tr><td><edit var=\"input1\" width=\"125\"></td><td><edit var=\"input2\" width=\"125\"></td></tr></table>");
|
|
||||||
replyMSG.append("<table border=\"0\"><tr>");
|
|
||||||
replyMSG.append("<td width=\"100\"><button value=\"Name\" action=\"bypass -h admin_dmevent_name $input1\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
|
|
||||||
replyMSG.append("<td width=\"100\"><button value=\"Description\" action=\"bypass -h admin_dmevent_desc $input1\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
|
|
||||||
replyMSG.append("<td width=\"100\"><button value=\"Join Location\" action=\"bypass -h admin_dmevent_join_loc $input1\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
|
|
||||||
replyMSG.append("</tr></table><br><table><tr>");
|
|
||||||
replyMSG.append("</tr></table><br><table><tr>");
|
|
||||||
replyMSG.append("<td width=\"100\"><button value=\"Max lvl\" action=\"bypass -h admin_dmevent_maxLevel $input1\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
|
|
||||||
replyMSG.append("<td width=\"100\"><button value=\"Min lvl\" action=\"bypass -h admin_dmevent_minLevel $input1\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
|
|
||||||
replyMSG.append("</tr></table><br><table><tr>");
|
|
||||||
replyMSG.append("<td width=\"100\"><button value=\"NPC\" action=\"bypass -h admin_dmevent_npc $input1\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
|
|
||||||
replyMSG.append("<td width=\"100\"><button value=\"NPC Pos\" action=\"bypass -h admin_dmevent_npc_pos\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
|
|
||||||
replyMSG.append("</tr></table><br><table><tr>");
|
|
||||||
replyMSG.append("<td width=\"100\"><button value=\"Reward\" action=\"bypass -h admin_dmevent_reward $input1\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
|
|
||||||
replyMSG.append("<td width=\"100\"><button value=\"Reward Amount\" action=\"bypass -h admin_dmevent_reward_amount $input1\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
|
|
||||||
replyMSG.append("</tr></table><br><table><tr>");
|
|
||||||
replyMSG.append("<td width=\"100\"><button value=\"DM Color\" action=\"bypass -h admin_dmevent_color $input1\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
|
|
||||||
replyMSG.append("<td width=\"100\"><button value=\"DM SpawnPos\" action=\"bypass -h admin_dmevent_spawnpos\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
|
|
||||||
replyMSG.append("</tr></table><table><br><br><tr>");
|
|
||||||
replyMSG.append("<td width=\"100\"><button value=\"Join\" action=\"bypass -h admin_dmevent_join\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
|
|
||||||
replyMSG.append("<td width=\"100\"><button value=\"Teleport\" action=\"bypass -h admin_dmevent_teleport\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
|
|
||||||
replyMSG.append("<td width=\"100\"><button value=\"Start\" action=\"bypass -h admin_dmevent_start\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
|
|
||||||
replyMSG.append("</tr></table><table><tr>");
|
|
||||||
replyMSG.append("</tr></table><table><br><br><tr>");
|
|
||||||
replyMSG.append("<td width=\"100\"><button value=\"StartEventOnceTime\" action=\"bypass -h admin_dmevent_startevent\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
|
|
||||||
replyMSG.append("</tr></table><table><tr>");
|
|
||||||
replyMSG.append("<td width=\"100\"><button value=\"Abort\" action=\"bypass -h admin_dmevent_abort\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
|
|
||||||
replyMSG.append("<td width=\"100\"><button value=\"Finish\" action=\"bypass -h admin_dmevent_finish\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
|
|
||||||
replyMSG.append("</tr></table><br><table><tr>");
|
|
||||||
replyMSG.append("<td width=\"100\"><button value=\"Sit Force\" action=\"bypass -h admin_dmevent_sit\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
|
|
||||||
replyMSG.append("<td width=\"100\"><button value=\"Dump\" action=\"bypass -h admin_dmevent_dump\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
|
|
||||||
replyMSG.append("</tr></table><br><br><table><tr>");
|
|
||||||
replyMSG.append("<td width=\"100\"><button value=\"Save\" action=\"bypass -h admin_dmevent_save\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
|
|
||||||
replyMSG.append("<td width=\"100\"><button value=\"Load\" action=\"bypass -h admin_dmevent_load\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
|
|
||||||
replyMSG.append("</tr></table><br><br>");
|
|
||||||
replyMSG.append("Current event...<br1>");
|
|
||||||
replyMSG.append("Name: <font color=\"00FF00\">" + DM.getEventName() + "</font><br1>");
|
|
||||||
replyMSG.append("Description: <font color=\"00FF00\">" + DM.getEventDesc() + "</font><br1>");
|
|
||||||
replyMSG.append("Joining location name: <font color=\"00FF00\">" + DM.getJoiningLocationName() + "</font><br1>");
|
|
||||||
|
|
||||||
final Location npcLoc = DM.getNpcLocation();
|
|
||||||
replyMSG.append("Joining NPC ID: <font color=\"00FF00\">" + DM.getNpcId() + " on pos " + npcLoc.getX() + "," + npcLoc.getY() + "," + npcLoc.getZ() + "</font><br1>");
|
|
||||||
replyMSG.append("Reward ID: <font color=\"00FF00\">" + DM.getRewardId() + "</font><br1>");
|
|
||||||
replyMSG.append("Reward Amount: <font color=\"00FF00\">" + DM.getRewardAmount() + "</font><br><br>");
|
|
||||||
replyMSG.append("Min lvl: <font color=\"00FF00\">" + DM.getMinLevel() + "</font><br>");
|
|
||||||
replyMSG.append("Max lvl: <font color=\"00FF00\">" + DM.getMaxLevel() + "</font><br><br>");
|
|
||||||
replyMSG.append("Death Match Color: <font color=\"00FF00\">" + DM.getPlayerColors() + "</font><br>");
|
|
||||||
|
|
||||||
final Location playerLoc = DM.getPlayersSpawnLocation();
|
|
||||||
replyMSG.append("Death Match Spawn Pos: <font color=\"00FF00\">" + playerLoc.getX() + "," + playerLoc.getY() + "," + playerLoc.getZ() + "</font><br><br>");
|
|
||||||
replyMSG.append("Current players:<br1>");
|
|
||||||
if (!DM.hasStarted())
|
|
||||||
{
|
|
||||||
replyMSG.append("<br1>");
|
|
||||||
replyMSG.append(DM._players.size() + " players participating.");
|
|
||||||
replyMSG.append("<br><br>");
|
|
||||||
}
|
|
||||||
else if (DM.hasStarted())
|
|
||||||
{
|
|
||||||
replyMSG.append("<br1>");
|
|
||||||
replyMSG.append(DM._players.size() + " players in fighting event.");
|
|
||||||
replyMSG.append("<br><br>");
|
|
||||||
}
|
|
||||||
|
|
||||||
replyMSG.append("</body></html>");
|
|
||||||
adminReply.setHtml(replyMSG.toString());
|
|
||||||
activeChar.sendPacket(adminReply);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,805 +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 org.l2jmobius.gameserver.handler.admincommandhandlers;
|
|
||||||
|
|
||||||
import java.io.BufferedInputStream;
|
|
||||||
import java.io.BufferedReader;
|
|
||||||
import java.io.DataInputStream;
|
|
||||||
import java.io.File;
|
|
||||||
import java.io.FileInputStream;
|
|
||||||
import java.io.FileOutputStream;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.InputStreamReader;
|
|
||||||
import java.io.PrintStream;
|
|
||||||
import java.util.Iterator;
|
|
||||||
import java.util.LinkedList;
|
|
||||||
import java.util.StringTokenizer;
|
|
||||||
|
|
||||||
import org.l2jmobius.gameserver.data.sql.SpawnTable;
|
|
||||||
import org.l2jmobius.gameserver.handler.IAdminCommandHandler;
|
|
||||||
import org.l2jmobius.gameserver.instancemanager.events.GameEvent;
|
|
||||||
import org.l2jmobius.gameserver.model.World;
|
|
||||||
import org.l2jmobius.gameserver.model.actor.instance.NpcInstance;
|
|
||||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
|
||||||
import org.l2jmobius.gameserver.model.spawn.Spawn;
|
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ItemList;
|
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
|
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.PlaySound;
|
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.Revive;
|
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.SocialAction;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This class handles following admin commands: - admin = shows menu
|
|
||||||
* @version $Revision: 1.3.2.1.2.4 $ $Date: 2005/04/11 10:06:06 $
|
|
||||||
*/
|
|
||||||
public class AdminEventEngine implements IAdminCommandHandler
|
|
||||||
{
|
|
||||||
private static final String[] ADMIN_COMMANDS =
|
|
||||||
{
|
|
||||||
"admin_event",
|
|
||||||
"admin_event_new",
|
|
||||||
"admin_event_choose",
|
|
||||||
"admin_event_store",
|
|
||||||
"admin_event_set",
|
|
||||||
"admin_event_change_teams_number",
|
|
||||||
"admin_event_announce",
|
|
||||||
"admin_event_panel",
|
|
||||||
"admin_event_control_begin",
|
|
||||||
"admin_event_control_teleport",
|
|
||||||
"admin_add",
|
|
||||||
"admin_event_see",
|
|
||||||
"admin_event_del",
|
|
||||||
"admin_delete_buffer",
|
|
||||||
"admin_event_control_sit",
|
|
||||||
"admin_event_name",
|
|
||||||
"admin_event_control_kill",
|
|
||||||
"admin_event_control_res",
|
|
||||||
"admin_event_control_prize",
|
|
||||||
"admin_event_control_chatban",
|
|
||||||
"admin_event_control_finish"
|
|
||||||
};
|
|
||||||
|
|
||||||
private static String tempBuffer = "";
|
|
||||||
private static String tempName = "";
|
|
||||||
private static String tempName2 = "";
|
|
||||||
private static boolean npcsDeleted = false;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean useAdminCommand(String command, PlayerInstance activeChar)
|
|
||||||
{
|
|
||||||
if (command.equals("admin_event"))
|
|
||||||
{
|
|
||||||
showMainPage(activeChar);
|
|
||||||
}
|
|
||||||
else if (command.equals("admin_event_new"))
|
|
||||||
{
|
|
||||||
showNewEventPage(activeChar);
|
|
||||||
}
|
|
||||||
else if (command.startsWith("admin_add"))
|
|
||||||
{
|
|
||||||
tempBuffer += command.substring(10);
|
|
||||||
showNewEventPage(activeChar);
|
|
||||||
}
|
|
||||||
else if (command.startsWith("admin_event_see"))
|
|
||||||
{
|
|
||||||
final String eventName = command.substring(16);
|
|
||||||
FileInputStream fis = null;
|
|
||||||
BufferedInputStream buff = null;
|
|
||||||
DataInputStream in = null;
|
|
||||||
InputStreamReader isr = null;
|
|
||||||
BufferedReader inbr = null;
|
|
||||||
try
|
|
||||||
{
|
|
||||||
final NpcHtmlMessage adminReply = new NpcHtmlMessage(5);
|
|
||||||
fis = new FileInputStream("data/events/" + eventName);
|
|
||||||
buff = new BufferedInputStream(fis);
|
|
||||||
in = new DataInputStream(buff);
|
|
||||||
isr = new InputStreamReader(in);
|
|
||||||
inbr = new BufferedReader(isr);
|
|
||||||
|
|
||||||
final StringBuilder replyMSG = new StringBuilder("<html><body>");
|
|
||||||
replyMSG.append("<center><font color=\"LEVEL\">" + eventName + "</font><font color=\"FF0000\"> bY " + inbr.readLine() + "</font></center><br>");
|
|
||||||
replyMSG.append("<br>" + inbr.readLine());
|
|
||||||
replyMSG.append("</body></html>");
|
|
||||||
adminReply.setHtml(replyMSG.toString());
|
|
||||||
activeChar.sendPacket(adminReply);
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
finally
|
|
||||||
{
|
|
||||||
if (inbr != null)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
inbr.close();
|
|
||||||
}
|
|
||||||
catch (IOException e)
|
|
||||||
{
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (isr != null)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
isr.close();
|
|
||||||
}
|
|
||||||
catch (IOException e)
|
|
||||||
{
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (in != null)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
in.close();
|
|
||||||
}
|
|
||||||
catch (IOException e)
|
|
||||||
{
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (buff != null)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
buff.close();
|
|
||||||
}
|
|
||||||
catch (IOException e)
|
|
||||||
{
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (fis != null)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
fis.close();
|
|
||||||
}
|
|
||||||
catch (IOException e)
|
|
||||||
{
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (command.startsWith("admin_event_del"))
|
|
||||||
{
|
|
||||||
final String eventName = command.substring(16);
|
|
||||||
final File file = new File("data/events/" + eventName);
|
|
||||||
file.delete();
|
|
||||||
showMainPage(activeChar);
|
|
||||||
}
|
|
||||||
else if (command.startsWith("admin_event_name"))
|
|
||||||
{
|
|
||||||
tempName += command.substring(17);
|
|
||||||
showNewEventPage(activeChar);
|
|
||||||
}
|
|
||||||
else if (command.equalsIgnoreCase("admin_delete_buffer"))
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
tempBuffer += tempBuffer.substring(0, tempBuffer.length() - 10);
|
|
||||||
showNewEventPage(activeChar);
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
tempBuffer = "";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (command.startsWith("admin_event_store"))
|
|
||||||
{
|
|
||||||
FileOutputStream file = null;
|
|
||||||
PrintStream p = null;
|
|
||||||
try
|
|
||||||
{
|
|
||||||
file = new FileOutputStream("data/events/" + tempName);
|
|
||||||
p = new PrintStream(file);
|
|
||||||
p.println(activeChar.getName());
|
|
||||||
p.println(tempBuffer);
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
finally
|
|
||||||
{
|
|
||||||
if (p != null)
|
|
||||||
{
|
|
||||||
p.close();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (file != null)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
file.close();
|
|
||||||
}
|
|
||||||
catch (IOException e)
|
|
||||||
{
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
tempBuffer = "";
|
|
||||||
tempName = "";
|
|
||||||
showMainPage(activeChar);
|
|
||||||
}
|
|
||||||
else if (command.startsWith("admin_event_set"))
|
|
||||||
{
|
|
||||||
GameEvent.eventName = command.substring(16);
|
|
||||||
showEventParameters(activeChar, 2);
|
|
||||||
}
|
|
||||||
else if (command.startsWith("admin_event_change_teams_number"))
|
|
||||||
{
|
|
||||||
showEventParameters(activeChar, Integer.parseInt(command.substring(32)));
|
|
||||||
}
|
|
||||||
else if (command.startsWith("admin_event_panel"))
|
|
||||||
{
|
|
||||||
showEventControl(activeChar);
|
|
||||||
}
|
|
||||||
else if (command.startsWith("admin_event_control_begin"))
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
GameEvent.active = true;
|
|
||||||
GameEvent.players.clear();
|
|
||||||
GameEvent.connectionLossData.clear();
|
|
||||||
|
|
||||||
for (int j = 0; j < GameEvent.teamsNumber; j++)
|
|
||||||
{
|
|
||||||
final LinkedList<String> link = new LinkedList<>();
|
|
||||||
GameEvent.players.put(j + 1, link);
|
|
||||||
}
|
|
||||||
|
|
||||||
int i = 0;
|
|
||||||
|
|
||||||
while (!GameEvent.participatingPlayers.isEmpty())
|
|
||||||
{
|
|
||||||
final String target = getMaxLeveledPlayer();
|
|
||||||
if (!target.equals(""))
|
|
||||||
{
|
|
||||||
GameEvent.players.get(i + 1).add(target);
|
|
||||||
i = (i + 1) % GameEvent.teamsNumber;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
destroyEventNpcs();
|
|
||||||
npcsDeleted = true;
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
|
|
||||||
showEventControl(activeChar);
|
|
||||||
}
|
|
||||||
else if (command.startsWith("admin_event_control_teleport"))
|
|
||||||
{
|
|
||||||
final StringTokenizer st = new StringTokenizer(command.substring(29), "-");
|
|
||||||
|
|
||||||
while (st.hasMoreElements())
|
|
||||||
{
|
|
||||||
teleportTeam(activeChar, Integer.parseInt(st.nextToken()));
|
|
||||||
}
|
|
||||||
|
|
||||||
showEventControl(activeChar);
|
|
||||||
}
|
|
||||||
else if (command.startsWith("admin_event_control_sit"))
|
|
||||||
{
|
|
||||||
final StringTokenizer st = new StringTokenizer(command.substring(24), "-");
|
|
||||||
|
|
||||||
while (st.hasMoreElements())
|
|
||||||
{
|
|
||||||
sitTeam(Integer.parseInt(st.nextToken()));
|
|
||||||
}
|
|
||||||
|
|
||||||
showEventControl(activeChar);
|
|
||||||
}
|
|
||||||
else if (command.startsWith("admin_event_control_kill"))
|
|
||||||
{
|
|
||||||
final StringTokenizer st = new StringTokenizer(command.substring(25), "-");
|
|
||||||
|
|
||||||
while (st.hasMoreElements())
|
|
||||||
{
|
|
||||||
killTeam(activeChar, Integer.parseInt(st.nextToken()));
|
|
||||||
}
|
|
||||||
|
|
||||||
showEventControl(activeChar);
|
|
||||||
}
|
|
||||||
else if (command.startsWith("admin_event_control_res"))
|
|
||||||
{
|
|
||||||
final StringTokenizer st = new StringTokenizer(command.substring(24), "-");
|
|
||||||
|
|
||||||
while (st.hasMoreElements())
|
|
||||||
{
|
|
||||||
resTeam(Integer.parseInt(st.nextToken()));
|
|
||||||
}
|
|
||||||
|
|
||||||
showEventControl(activeChar);
|
|
||||||
}
|
|
||||||
else if (command.startsWith("admin_event_control_prize"))
|
|
||||||
{
|
|
||||||
final StringTokenizer st0 = new StringTokenizer(command.substring(26));
|
|
||||||
final StringTokenizer st = new StringTokenizer(st0.nextToken(), "-");
|
|
||||||
String n = st0.nextToken();
|
|
||||||
|
|
||||||
final StringTokenizer st1 = new StringTokenizer(n, "*");
|
|
||||||
n = st1.nextToken();
|
|
||||||
String type = "";
|
|
||||||
if (st1.hasMoreElements())
|
|
||||||
{
|
|
||||||
type = st1.nextToken();
|
|
||||||
}
|
|
||||||
|
|
||||||
final String id = st0.nextToken();
|
|
||||||
|
|
||||||
while (st.hasMoreElements())
|
|
||||||
{
|
|
||||||
regardTeam(activeChar, Integer.parseInt(st.nextToken()), Integer.parseInt(n), Integer.parseInt(id), type);
|
|
||||||
}
|
|
||||||
|
|
||||||
showEventControl(activeChar);
|
|
||||||
}
|
|
||||||
else if (command.startsWith("admin_event_control_finish"))
|
|
||||||
{
|
|
||||||
for (int i = 0; i < GameEvent.teamsNumber; i++)
|
|
||||||
{
|
|
||||||
telePlayersBack(i + 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
GameEvent.eventName = "";
|
|
||||||
GameEvent.teamsNumber = 0;
|
|
||||||
GameEvent.names.clear();
|
|
||||||
GameEvent.participatingPlayers.clear();
|
|
||||||
GameEvent.players.clear();
|
|
||||||
GameEvent.id = 12760;
|
|
||||||
GameEvent.npcs.clear();
|
|
||||||
GameEvent.active = false;
|
|
||||||
npcsDeleted = false;
|
|
||||||
}
|
|
||||||
else if (command.startsWith("admin_event_announce"))
|
|
||||||
{
|
|
||||||
StringTokenizer st = new StringTokenizer(command.substring(21));
|
|
||||||
GameEvent.id = Integer.parseInt(st.nextToken());
|
|
||||||
GameEvent.teamsNumber = Integer.parseInt(st.nextToken());
|
|
||||||
String temp = " ";
|
|
||||||
String temp2 = "";
|
|
||||||
|
|
||||||
while (st.hasMoreElements())
|
|
||||||
{
|
|
||||||
temp += st.nextToken() + " ";
|
|
||||||
}
|
|
||||||
|
|
||||||
st = new StringTokenizer(temp, "-");
|
|
||||||
Integer i = 1;
|
|
||||||
|
|
||||||
while (st.hasMoreElements())
|
|
||||||
{
|
|
||||||
temp2 = st.nextToken();
|
|
||||||
if (!temp2.equals(" "))
|
|
||||||
{
|
|
||||||
GameEvent.names.put(i, temp2.substring(1, temp2.length() - 1));
|
|
||||||
i++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
GameEvent.participatingPlayers.clear();
|
|
||||||
|
|
||||||
muestraNpcConInfoAPlayers(activeChar, GameEvent.id);
|
|
||||||
|
|
||||||
final PlaySound snd = new PlaySound(1, "B03_F");
|
|
||||||
activeChar.sendPacket(snd);
|
|
||||||
activeChar.broadcastPacket(snd);
|
|
||||||
|
|
||||||
final NpcHtmlMessage adminReply = new NpcHtmlMessage(5);
|
|
||||||
final StringBuilder replyMSG = new StringBuilder("<html><body>");
|
|
||||||
replyMSG.append("<center><font color=\"LEVEL\">[ L2J EVENT ENGINE</font></center><br>");
|
|
||||||
replyMSG.append("<center>The event <font color=\"LEVEL\">" + GameEvent.eventName + "</font> has been announced, now you can type //event_panel to see the event panel control</center><br>");
|
|
||||||
replyMSG.append("</body></html>");
|
|
||||||
adminReply.setHtml(replyMSG.toString());
|
|
||||||
activeChar.sendPacket(adminReply);
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String[] getAdminCommandList()
|
|
||||||
{
|
|
||||||
return ADMIN_COMMANDS;
|
|
||||||
}
|
|
||||||
|
|
||||||
String showStoredEvents()
|
|
||||||
{
|
|
||||||
final File dir = new File("data/events");
|
|
||||||
final String[] files = dir.list();
|
|
||||||
String result = "";
|
|
||||||
if (files == null)
|
|
||||||
{
|
|
||||||
result = "No 'data/events' directory!";
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (String file2 : files)
|
|
||||||
{
|
|
||||||
final File file = new File("data/events/" + file2);
|
|
||||||
result += "<font color=\"LEVEL\">" + file.getName() + " </font><br><button value=\"select\" action=\"bypass -h admin_event_set " + file.getName() + "\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"><button value=\"ver\" action=\"bypass -h admin_event_see " + file.getName() + "\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"><button value=\"delete\" action=\"bypass -h admin_event_del " + file.getName() + "\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"><br><br>";
|
|
||||||
}
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void showMainPage(PlayerInstance activeChar)
|
|
||||||
{
|
|
||||||
final NpcHtmlMessage adminReply = new NpcHtmlMessage(5);
|
|
||||||
final StringBuilder replyMSG = new StringBuilder("<html><body>");
|
|
||||||
replyMSG.append("<center><font color=\"LEVEL\">[ L2J EVENT ENGINE ]</font></center><br>");
|
|
||||||
replyMSG.append("<br><center><button value=\"Create NEW event \" action=\"bypass -h admin_event_new\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\">");
|
|
||||||
replyMSG.append("<center><br>Stored Events<br></center>");
|
|
||||||
replyMSG.append(showStoredEvents());
|
|
||||||
replyMSG.append("</body></html>");
|
|
||||||
|
|
||||||
adminReply.setHtml(replyMSG.toString());
|
|
||||||
activeChar.sendPacket(adminReply);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void showNewEventPage(PlayerInstance activeChar)
|
|
||||||
{
|
|
||||||
final NpcHtmlMessage adminReply = new NpcHtmlMessage(5);
|
|
||||||
final StringBuilder replyMSG = new StringBuilder("<html><body>");
|
|
||||||
replyMSG.append("<center><font color=\"LEVEL\">[ L2J EVENT ENGINE ]</font></center><br>");
|
|
||||||
replyMSG.append("<br><center>Event's Title<br><font color=\"LEVEL\">");
|
|
||||||
if (tempName.equals(""))
|
|
||||||
{
|
|
||||||
replyMSG.append("Use //event_name text to insert a new title");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
replyMSG.append(tempName);
|
|
||||||
}
|
|
||||||
|
|
||||||
replyMSG.append("</font></center><br><br>Event's description<br>");
|
|
||||||
if (tempBuffer.equals(""))
|
|
||||||
{
|
|
||||||
replyMSG.append("Use //add text o //delete_buffer to modify this text field");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
replyMSG.append(tempBuffer);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((!tempName.equals("") || !tempBuffer.equals("")))
|
|
||||||
{
|
|
||||||
replyMSG.append("<br><button value=\"Crear\" action=\"bypass -h admin_event_store\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\">");
|
|
||||||
}
|
|
||||||
|
|
||||||
replyMSG.append("</body></html>");
|
|
||||||
|
|
||||||
adminReply.setHtml(replyMSG.toString());
|
|
||||||
activeChar.sendPacket(adminReply);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void showEventParameters(PlayerInstance activeChar, int teamnumbers)
|
|
||||||
{
|
|
||||||
final NpcHtmlMessage adminReply = new NpcHtmlMessage(5);
|
|
||||||
final StringBuilder replyMSG = new StringBuilder("<html><body>");
|
|
||||||
replyMSG.append("<center><font color=\"LEVEL\">[ L2J EVENT ENGINE ]</font></center><br>");
|
|
||||||
replyMSG.append("<center><font color=\"LEVEL\">" + GameEvent.eventName + "</font></center><br>");
|
|
||||||
replyMSG.append("<br><center><button value=\"Change number of teams to\" action=\"bypass -h admin_event_change_teams_number $event_teams_number\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"> <edit var=\"event_teams_number\" width=100 height=20><br><br>");
|
|
||||||
replyMSG.append("<font color=\"LEVEL\">Team's Names</font><br>");
|
|
||||||
for (int i = 0; i < teamnumbers; i++)
|
|
||||||
{
|
|
||||||
replyMSG.append((i + 1) + ".- <edit var=\"event_teams_name" + (i + 1) + "\" width=100 height=20><br>");
|
|
||||||
}
|
|
||||||
|
|
||||||
replyMSG.append("<br><br>Announcer NPC id<edit var=\"event_npcid\" width=100 height=20><br><br><button value=\"Announce Event!!\" action=\"bypass -h admin_event_announce $event_npcid " + teamnumbers + " ");
|
|
||||||
for (int i = 0; i < teamnumbers; i++)
|
|
||||||
{
|
|
||||||
replyMSG.append("$event_teams_name" + (i + 1) + " - ");
|
|
||||||
}
|
|
||||||
|
|
||||||
replyMSG.append("\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\">");
|
|
||||||
replyMSG.append("</body></html>");
|
|
||||||
|
|
||||||
adminReply.setHtml(replyMSG.toString());
|
|
||||||
activeChar.sendPacket(adminReply);
|
|
||||||
}
|
|
||||||
|
|
||||||
void muestraNpcConInfoAPlayers(PlayerInstance activeChar, int id)
|
|
||||||
{
|
|
||||||
GameEvent.npcs.clear();
|
|
||||||
final LinkedList<PlayerInstance> temp = new LinkedList<>();
|
|
||||||
temp.clear();
|
|
||||||
|
|
||||||
for (PlayerInstance player : World.getInstance().getAllPlayers())
|
|
||||||
{
|
|
||||||
if (!temp.contains(player))
|
|
||||||
{
|
|
||||||
GameEvent.spawn(player, id);
|
|
||||||
temp.add(player);
|
|
||||||
}
|
|
||||||
for (PlayerInstance playertemp : player.getKnownList().getKnownPlayers().values())
|
|
||||||
{
|
|
||||||
if ((Math.abs(playertemp.getX() - player.getX()) < 500) && (Math.abs(playertemp.getY() - player.getY()) < 500) && (Math.abs(playertemp.getZ() - player.getZ()) < 500))
|
|
||||||
{
|
|
||||||
temp.add(playertemp);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
GameEvent.announceAllPlayers(activeChar.getName() + " wants to make an event !!! (you'll find a npc with the details around)");
|
|
||||||
}
|
|
||||||
|
|
||||||
void showEventControl(PlayerInstance activeChar)
|
|
||||||
{
|
|
||||||
final NpcHtmlMessage adminReply = new NpcHtmlMessage(5);
|
|
||||||
final StringBuilder replyMSG = new StringBuilder("<html><body>");
|
|
||||||
replyMSG.append("<center><font color=\"LEVEL\">[ L2J EVENT ENGINE ]</font></center><br><font color=\"LEVEL\">" + GameEvent.eventName + "</font><br><br><table width=200>");
|
|
||||||
replyMSG.append("<tr><td>Apply this command to teams number </td><td><edit var=\"team_number\" width=100 height=15></td></tr>");
|
|
||||||
replyMSG.append("<tr><td> </td></tr>");
|
|
||||||
|
|
||||||
if (!npcsDeleted)
|
|
||||||
{
|
|
||||||
replyMSG.append("<tr><td><button value=\"Start\" action=\"bypass -h admin_event_control_begin\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td><td><font color=\"LEVEL\">Destroys all event npcs so no more people can't participate now on</font></td></tr>");
|
|
||||||
}
|
|
||||||
|
|
||||||
replyMSG.append("<tr><td> </td></tr>");
|
|
||||||
replyMSG.append("<tr><td><button value=\"Teleport\" action=\"bypass -h admin_event_control_teleport $team_number\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td><td><font color=\"LEVEL\">Teleports the specified team to your position</font></td></tr>");
|
|
||||||
replyMSG.append("<tr><td> </td></tr>");
|
|
||||||
replyMSG.append("<tr><td><button value=\"Sit\" action=\"bypass -h admin_event_control_sit $team_number\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td><td><font color=\"LEVEL\">Sits/Stands up the team</font></td></tr>");
|
|
||||||
replyMSG.append("<tr><td> </td></tr>");
|
|
||||||
replyMSG.append("<tr><td><button value=\"Kill\" action=\"bypass -h admin_event_control_kill $team_number\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td><td><font color=\"LEVEL\">Finish with the life of all the players in the selected team</font></td></tr>");
|
|
||||||
replyMSG.append("<tr><td> </td></tr>");
|
|
||||||
replyMSG.append("<tr><td><button value=\"Resurrect\" action=\"bypass -h admin_event_control_res $team_number\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td><td><font color=\"LEVEL\">Resurrect Team's members</font></td></tr>");
|
|
||||||
replyMSG.append("<tr><td> </td></tr>");
|
|
||||||
replyMSG.append("<tr><td><button value=\"Give Item\" action=\"bypass -h admin_event_control_prize $team_number $n $id\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"> number <edit var=\"n\" width=100 height=15> item id <edit var=\"id\" width=100 height=15></td><td><font color=\"LEVEL\">Give the specified item id to every single member of the team, you can put 5*level, 5*kills or 5 in the number field for example</font></td></tr>");
|
|
||||||
replyMSG.append("<tr><td> </td></tr>");
|
|
||||||
replyMSG.append("<tr><td><button value=\"End\" action=\"bypass -h admin_event_control_finish\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td><td><font color=\"LEVEL\">Will finish the event teleporting back all the players</font></td></tr>");
|
|
||||||
replyMSG.append("</table></body></html>");
|
|
||||||
|
|
||||||
adminReply.setHtml(replyMSG.toString());
|
|
||||||
activeChar.sendPacket(adminReply);
|
|
||||||
}
|
|
||||||
|
|
||||||
String getMaxLeveledPlayer()
|
|
||||||
{
|
|
||||||
final Iterator<String> it = GameEvent.participatingPlayers.iterator();
|
|
||||||
PlayerInstance pc = null;
|
|
||||||
int max = 0;
|
|
||||||
String name = "";
|
|
||||||
|
|
||||||
while (it.hasNext())
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
tempName2 = it.next();
|
|
||||||
pc = World.getInstance().getPlayer(tempName2);
|
|
||||||
if (max < pc.getLevel())
|
|
||||||
{
|
|
||||||
max = pc.getLevel();
|
|
||||||
name = pc.getName();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
GameEvent.participatingPlayers.remove(tempName2);
|
|
||||||
}
|
|
||||||
catch (Exception e2)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
GameEvent.participatingPlayers.remove(name);
|
|
||||||
|
|
||||||
return name;
|
|
||||||
}
|
|
||||||
|
|
||||||
void destroyEventNpcs()
|
|
||||||
{
|
|
||||||
NpcInstance npc;
|
|
||||||
while (!GameEvent.npcs.isEmpty())
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
npc = (NpcInstance) World.getInstance().findObject(Integer.parseInt(GameEvent.npcs.get(0)));
|
|
||||||
final Spawn spawn = npc.getSpawn();
|
|
||||||
if (spawn != null)
|
|
||||||
{
|
|
||||||
spawn.stopRespawn();
|
|
||||||
SpawnTable.getInstance().deleteSpawn(spawn, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
npc.deleteMe();
|
|
||||||
GameEvent.npcs.remove(0);
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
GameEvent.npcs.remove(0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void teleportTeam(PlayerInstance activeChar, int team)
|
|
||||||
{
|
|
||||||
final LinkedList<String> linked = GameEvent.players.get(team);
|
|
||||||
final Iterator<String> it = linked.iterator();
|
|
||||||
|
|
||||||
while (it.hasNext())
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
final PlayerInstance pc = World.getInstance().getPlayer(it.next());
|
|
||||||
pc.setTitle(GameEvent.names.get(team));
|
|
||||||
pc.teleToLocation(activeChar.getX(), activeChar.getY(), activeChar.getZ(), true);
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void sitTeam(int team)
|
|
||||||
{
|
|
||||||
final LinkedList<String> linked = GameEvent.players.get(team);
|
|
||||||
final Iterator<String> it = linked.iterator();
|
|
||||||
|
|
||||||
while (it.hasNext())
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
final PlayerInstance pc = World.getInstance().getPlayer(it.next());
|
|
||||||
pc.eventSitForced = !pc.eventSitForced;
|
|
||||||
if (pc.eventSitForced)
|
|
||||||
{
|
|
||||||
pc.sitDown();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
pc.standUp();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void killTeam(PlayerInstance activeChar, int team)
|
|
||||||
{
|
|
||||||
final LinkedList<String> linked = GameEvent.players.get(team);
|
|
||||||
final Iterator<String> it = linked.iterator();
|
|
||||||
|
|
||||||
while (it.hasNext())
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
final PlayerInstance target = World.getInstance().getPlayer(it.next());
|
|
||||||
target.reduceCurrentHp(target.getMaxHp() + target.getMaxCp() + 1, activeChar);
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void resTeam(int team)
|
|
||||||
{
|
|
||||||
final LinkedList<String> linked = GameEvent.players.get(team);
|
|
||||||
final Iterator<String> it = linked.iterator();
|
|
||||||
|
|
||||||
while (it.hasNext())
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
final PlayerInstance character = World.getInstance().getPlayer(it.next());
|
|
||||||
character.setCurrentHpMp(character.getMaxHp(), character.getMaxMp());
|
|
||||||
character.setCurrentCp(character.getMaxCp());
|
|
||||||
|
|
||||||
final Revive revive = new Revive(character);
|
|
||||||
final SocialAction sa = new SocialAction(character.getObjectId(), 15);
|
|
||||||
character.broadcastPacket(sa);
|
|
||||||
character.sendPacket(sa);
|
|
||||||
character.sendPacket(revive);
|
|
||||||
character.broadcastPacket(revive);
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void createItem(PlayerInstance activeChar, PlayerInstance player, int id, int num)
|
|
||||||
{
|
|
||||||
player.getInventory().addItem("Event", id, num, player, activeChar);
|
|
||||||
player.sendPacket(new ItemList(player, true));
|
|
||||||
|
|
||||||
final NpcHtmlMessage adminReply = new NpcHtmlMessage(5);
|
|
||||||
final StringBuilder replyMSG = new StringBuilder("<html><body>");
|
|
||||||
replyMSG.append("CONGRATULATIONS, you should have a present in your inventory");
|
|
||||||
replyMSG.append("</body></html>");
|
|
||||||
|
|
||||||
adminReply.setHtml(replyMSG.toString());
|
|
||||||
player.sendPacket(adminReply);
|
|
||||||
}
|
|
||||||
|
|
||||||
void regardTeam(PlayerInstance activeChar, int team, int n, int id, String type)
|
|
||||||
{
|
|
||||||
final LinkedList<String> linked = GameEvent.players.get(team);
|
|
||||||
int temp = n;
|
|
||||||
|
|
||||||
final Iterator<String> it = linked.iterator();
|
|
||||||
|
|
||||||
while (it.hasNext())
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
final PlayerInstance target = World.getInstance().getPlayer(it.next());
|
|
||||||
if (type.equalsIgnoreCase("level"))
|
|
||||||
{
|
|
||||||
temp = n * target.getLevel();
|
|
||||||
}
|
|
||||||
else if (type.equalsIgnoreCase("kills"))
|
|
||||||
{
|
|
||||||
temp = n * target.kills.size();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
temp = n;
|
|
||||||
}
|
|
||||||
createItem(activeChar, target, id, temp);
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void telePlayersBack(int team)
|
|
||||||
{
|
|
||||||
resTeam(team);
|
|
||||||
|
|
||||||
final LinkedList<String> linked = GameEvent.players.get(team);
|
|
||||||
final Iterator<String> it = linked.iterator();
|
|
||||||
|
|
||||||
while (it.hasNext())
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
final PlayerInstance target = World.getInstance().getPlayer(it.next());
|
|
||||||
target.setTitle(target.eventTitle);
|
|
||||||
target.setKarma(target.eventKarma);
|
|
||||||
target.setPvpKills(target.eventPvpKills);
|
|
||||||
target.setPkKills(target.eventPkKills);
|
|
||||||
target.teleToLocation(target.eventX, target.eventY, target.eventZ, true);
|
|
||||||
target.kills.clear();
|
|
||||||
target.eventSitForced = false;
|
|
||||||
target.atEvent = false;
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,197 +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 org.l2jmobius.gameserver.handler.admincommandhandlers;
|
|
||||||
|
|
||||||
import org.l2jmobius.Config;
|
|
||||||
import org.l2jmobius.gameserver.data.sql.AnnouncementsTable;
|
|
||||||
import org.l2jmobius.gameserver.data.xml.MapRegionData;
|
|
||||||
import org.l2jmobius.gameserver.data.xml.ZoneData;
|
|
||||||
import org.l2jmobius.gameserver.handler.IAdminCommandHandler;
|
|
||||||
import org.l2jmobius.gameserver.model.World;
|
|
||||||
import org.l2jmobius.gameserver.model.WorldObject;
|
|
||||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
|
||||||
import org.l2jmobius.gameserver.model.zone.ZoneId;
|
|
||||||
import org.l2jmobius.gameserver.model.zone.type.TownZone;
|
|
||||||
|
|
||||||
public class AdminTownWar implements IAdminCommandHandler
|
|
||||||
{
|
|
||||||
private static final String[] ADMIN_COMMANDS =
|
|
||||||
{
|
|
||||||
"admin_townwar_start",
|
|
||||||
"admin_townwar_end"
|
|
||||||
};
|
|
||||||
private WorldObject _activeObject;
|
|
||||||
|
|
||||||
public WorldObject getActiveObject()
|
|
||||||
{
|
|
||||||
return _activeObject;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean useAdminCommand(String command, PlayerInstance activeChar)
|
|
||||||
{
|
|
||||||
if (command.startsWith("admin_townwar_start")) // townwar_start
|
|
||||||
{
|
|
||||||
startTW(activeChar);
|
|
||||||
}
|
|
||||||
if (command.startsWith("admin_townwar_end")) // townwar_end
|
|
||||||
{
|
|
||||||
endTW(activeChar);
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void startTW(PlayerInstance activeChar)
|
|
||||||
{
|
|
||||||
// All Towns will become War Zones
|
|
||||||
if (Config.TW_ALL_TOWNS)
|
|
||||||
{
|
|
||||||
for (TownZone zone : ZoneData.getInstance().getAllZones(TownZone.class))
|
|
||||||
{
|
|
||||||
zone.setParameter("noPeace", "true");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// A Town will become War Zone
|
|
||||||
if (!Config.TW_ALL_TOWNS && (Config.TW_TOWN_ID != 18) && (Config.TW_TOWN_ID != 21) && (Config.TW_TOWN_ID != 22))
|
|
||||||
{
|
|
||||||
MapRegionData.getInstance().getTown(Config.TW_TOWN_ID).setParameter("noPeace", "true");
|
|
||||||
}
|
|
||||||
|
|
||||||
int x;
|
|
||||||
int y;
|
|
||||||
int z;
|
|
||||||
TownZone town;
|
|
||||||
for (PlayerInstance onlinePlayer : World.getInstance().getAllPlayers())
|
|
||||||
{
|
|
||||||
if (onlinePlayer.isOnline())
|
|
||||||
{
|
|
||||||
x = onlinePlayer.getX();
|
|
||||||
y = onlinePlayer.getY();
|
|
||||||
z = onlinePlayer.getZ();
|
|
||||||
town = ZoneData.getInstance().getZone(x, y, z, TownZone.class);
|
|
||||||
if (town != null)
|
|
||||||
{
|
|
||||||
if ((town.getTownId() == Config.TW_TOWN_ID) && !Config.TW_ALL_TOWNS)
|
|
||||||
{
|
|
||||||
onlinePlayer.setInsideZone(ZoneId.PVP, false);
|
|
||||||
onlinePlayer.revalidateZone(true);
|
|
||||||
}
|
|
||||||
else if (Config.TW_ALL_TOWNS)
|
|
||||||
{
|
|
||||||
onlinePlayer.setInsideZone(ZoneId.PVP, false);
|
|
||||||
onlinePlayer.revalidateZone(true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
onlinePlayer.setInTownWar(true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Announce for all towns
|
|
||||||
if (Config.TW_ALL_TOWNS)
|
|
||||||
{
|
|
||||||
AnnouncementsTable.getInstance().criticalAnnounceToAll("Town War Event!");
|
|
||||||
AnnouncementsTable.getInstance().criticalAnnounceToAll("All towns have been set to war zone by " + activeChar.getName() + ".");
|
|
||||||
}
|
|
||||||
|
|
||||||
// Announce for one town
|
|
||||||
if (!Config.TW_ALL_TOWNS)
|
|
||||||
{
|
|
||||||
AnnouncementsTable.getInstance().criticalAnnounceToAll("Town War Event!");
|
|
||||||
AnnouncementsTable.getInstance().criticalAnnounceToAll(MapRegionData.getInstance().getTown(Config.TW_TOWN_ID).getName() + " has been set to war zone by " + activeChar.getName() + ".");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void endTW(PlayerInstance activeChar)
|
|
||||||
{
|
|
||||||
// All Towns will become Peace Zones
|
|
||||||
if (Config.TW_ALL_TOWNS)
|
|
||||||
{
|
|
||||||
MapRegionData.getInstance().getTown(1).setParameter("noPeace", "false");
|
|
||||||
MapRegionData.getInstance().getTown(2).setParameter("noPeace", "false");
|
|
||||||
MapRegionData.getInstance().getTown(3).setParameter("noPeace", "false");
|
|
||||||
MapRegionData.getInstance().getTown(4).setParameter("noPeace", "false");
|
|
||||||
MapRegionData.getInstance().getTown(5).setParameter("noPeace", "false");
|
|
||||||
MapRegionData.getInstance().getTown(6).setParameter("noPeace", "false");
|
|
||||||
MapRegionData.getInstance().getTown(7).setParameter("noPeace", "false");
|
|
||||||
MapRegionData.getInstance().getTown(8).setParameter("noPeace", "false");
|
|
||||||
MapRegionData.getInstance().getTown(9).setParameter("noPeace", "false");
|
|
||||||
MapRegionData.getInstance().getTown(10).setParameter("noPeace", "false");
|
|
||||||
MapRegionData.getInstance().getTown(11).setParameter("noPeace", "false");
|
|
||||||
MapRegionData.getInstance().getTown(12).setParameter("noPeace", "false");
|
|
||||||
MapRegionData.getInstance().getTown(13).setParameter("noPeace", "false");
|
|
||||||
MapRegionData.getInstance().getTown(14).setParameter("noPeace", "false");
|
|
||||||
MapRegionData.getInstance().getTown(15).setParameter("noPeace", "false");
|
|
||||||
MapRegionData.getInstance().getTown(16).setParameter("noPeace", "false");
|
|
||||||
MapRegionData.getInstance().getTown(17).setParameter("noPeace", "false");
|
|
||||||
MapRegionData.getInstance().getTown(19).setParameter("noPeace", "false");
|
|
||||||
}
|
|
||||||
|
|
||||||
// A Town will become Peace Zone
|
|
||||||
if (!Config.TW_ALL_TOWNS && (Config.TW_TOWN_ID != 18) && (Config.TW_TOWN_ID != 21) && (Config.TW_TOWN_ID != 22))
|
|
||||||
{
|
|
||||||
MapRegionData.getInstance().getTown(Config.TW_TOWN_ID).setParameter("noPeace", "false");
|
|
||||||
}
|
|
||||||
|
|
||||||
int x;
|
|
||||||
int y;
|
|
||||||
int z;
|
|
||||||
TownZone town;
|
|
||||||
for (PlayerInstance onlinePlayer : World.getInstance().getAllPlayers())
|
|
||||||
{
|
|
||||||
if (onlinePlayer.isOnline())
|
|
||||||
{
|
|
||||||
x = onlinePlayer.getX();
|
|
||||||
y = onlinePlayer.getY();
|
|
||||||
z = onlinePlayer.getZ();
|
|
||||||
town = ZoneData.getInstance().getZone(x, y, z, TownZone.class);
|
|
||||||
if (town != null)
|
|
||||||
{
|
|
||||||
if ((town.getTownId() == Config.TW_TOWN_ID) && !Config.TW_ALL_TOWNS)
|
|
||||||
{
|
|
||||||
onlinePlayer.setInsideZone(ZoneId.PVP, true);
|
|
||||||
onlinePlayer.revalidateZone(true);
|
|
||||||
}
|
|
||||||
else if (Config.TW_ALL_TOWNS)
|
|
||||||
{
|
|
||||||
onlinePlayer.setInsideZone(ZoneId.PVP, true);
|
|
||||||
onlinePlayer.revalidateZone(true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
onlinePlayer.setInTownWar(false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Announce for all towns
|
|
||||||
if (Config.TW_ALL_TOWNS)
|
|
||||||
{
|
|
||||||
AnnouncementsTable.getInstance().criticalAnnounceToAll("All towns have been set back to normal by " + activeChar.getName() + ".");
|
|
||||||
}
|
|
||||||
|
|
||||||
// Announce for one town
|
|
||||||
if (!Config.TW_ALL_TOWNS)
|
|
||||||
{
|
|
||||||
AnnouncementsTable.getInstance().criticalAnnounceToAll(MapRegionData.getInstance().getTown(Config.TW_TOWN_ID).getName() + " has been set back to normal by " + activeChar.getName() + ".");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String[] getAdminCommandList()
|
|
||||||
{
|
|
||||||
return ADMIN_COMMANDS;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,474 +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 org.l2jmobius.gameserver.handler.admincommandhandlers;
|
|
||||||
|
|
||||||
import java.util.StringTokenizer;
|
|
||||||
|
|
||||||
import org.l2jmobius.Config;
|
|
||||||
import org.l2jmobius.gameserver.handler.IAdminCommandHandler;
|
|
||||||
import org.l2jmobius.gameserver.instancemanager.events.TvT;
|
|
||||||
import org.l2jmobius.gameserver.model.Location;
|
|
||||||
import org.l2jmobius.gameserver.model.World;
|
|
||||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
|
|
||||||
import org.l2jmobius.gameserver.util.BuilderUtil;
|
|
||||||
|
|
||||||
public class AdminTvTEngine implements IAdminCommandHandler
|
|
||||||
{
|
|
||||||
private static final String[] ADMIN_COMMANDS =
|
|
||||||
{
|
|
||||||
"admin_tvt",
|
|
||||||
"admin_tvt_name",
|
|
||||||
"admin_tvt_desc",
|
|
||||||
"admin_tvt_join_loc",
|
|
||||||
"admin_tvt_minLevel",
|
|
||||||
"admin_tvt_maxLevel",
|
|
||||||
"admin_tvt_npc",
|
|
||||||
"admin_tvt_npc_pos",
|
|
||||||
"admin_tvt_reward",
|
|
||||||
"admin_tvt_reward_amount",
|
|
||||||
"admin_tvt_team_add",
|
|
||||||
"admin_tvt_team_remove",
|
|
||||||
"admin_tvt_team_pos",
|
|
||||||
"admin_tvt_team_color",
|
|
||||||
"admin_tvt_join",
|
|
||||||
"admin_tvt_teleport",
|
|
||||||
"admin_tvt_start",
|
|
||||||
"admin_tvt_abort",
|
|
||||||
"admin_tvt_finish",
|
|
||||||
"admin_tvt_sit",
|
|
||||||
"admin_tvt_dump",
|
|
||||||
"admin_tvt_save",
|
|
||||||
"admin_tvt_load",
|
|
||||||
"admin_tvt_jointime",
|
|
||||||
"admin_tvt_eventtime",
|
|
||||||
"admin_tvt_autoevent",
|
|
||||||
"admin_tvt_startevent",
|
|
||||||
"admin_tvt_minplayers",
|
|
||||||
"admin_tvt_maxplayers",
|
|
||||||
"admin_tvtkick",
|
|
||||||
"admin_tvt_interval"
|
|
||||||
};
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean useAdminCommand(String command, PlayerInstance activeChar)
|
|
||||||
{
|
|
||||||
if (command.equals("admin_tvt"))
|
|
||||||
{
|
|
||||||
showMainPage(activeChar);
|
|
||||||
}
|
|
||||||
else if (command.startsWith("admin_tvt_name "))
|
|
||||||
{
|
|
||||||
if (TvT.setEventName(command.substring(15)))
|
|
||||||
{
|
|
||||||
showMainPage(activeChar);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
BuilderUtil.sendSysMessage(activeChar, "Cannot perform requested operation, event in progress");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (command.startsWith("admin_tvt_desc "))
|
|
||||||
{
|
|
||||||
if (TvT.setEventDesc(command.substring(15)))
|
|
||||||
{
|
|
||||||
showMainPage(activeChar);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
BuilderUtil.sendSysMessage(activeChar, "Cannot perform requested operation, event in progress");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (command.startsWith("admin_tvt_minLevel "))
|
|
||||||
{
|
|
||||||
if (!TvT.checkMinLevel(Integer.parseInt(command.substring(17))))
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (TvT.setMinlvl(Integer.parseInt(command.substring(17))))
|
|
||||||
{
|
|
||||||
showMainPage(activeChar);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
BuilderUtil.sendSysMessage(activeChar, "Cannot perform requested operation, event in progress");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (command.startsWith("admin_tvt_maxLevel "))
|
|
||||||
{
|
|
||||||
if (!TvT.checkMaxLevel(Integer.parseInt(command.substring(17))))
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (TvT.setMaxlvl(Integer.parseInt(command.substring(17))))
|
|
||||||
{
|
|
||||||
showMainPage(activeChar);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
BuilderUtil.sendSysMessage(activeChar, "Cannot perform requested operation, event in progress");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (command.startsWith("admin_tvt_minplayers "))
|
|
||||||
{
|
|
||||||
if (TvT.setMinPlayers(Integer.parseInt(command.substring(21))))
|
|
||||||
{
|
|
||||||
showMainPage(activeChar);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
BuilderUtil.sendSysMessage(activeChar, "Cannot perform requested operation, event in progress");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (command.startsWith("admin_tvt_maxplayers "))
|
|
||||||
{
|
|
||||||
if (TvT.setMaxPlayers(Integer.parseInt(command.substring(21))))
|
|
||||||
{
|
|
||||||
showMainPage(activeChar);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
BuilderUtil.sendSysMessage(activeChar, "Cannot perform requested operation, event in progress");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (command.startsWith("admin_tvt_join_loc "))
|
|
||||||
{
|
|
||||||
if (TvT.setJoiningLocationName(command.substring(19)))
|
|
||||||
{
|
|
||||||
showMainPage(activeChar);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
BuilderUtil.sendSysMessage(activeChar, "Cannot perform requested operation, event in progress");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (command.startsWith("admin_tvt_npc "))
|
|
||||||
{
|
|
||||||
if (TvT.setNpcId(Integer.parseInt(command.substring(14))))
|
|
||||||
{
|
|
||||||
showMainPage(activeChar);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
BuilderUtil.sendSysMessage(activeChar, "Cannot perform requested operation, event in progress");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (command.equals("admin_tvt_npc_pos"))
|
|
||||||
{
|
|
||||||
TvT.setNpcPos(activeChar);
|
|
||||||
showMainPage(activeChar);
|
|
||||||
}
|
|
||||||
else if (command.startsWith("admin_tvt_reward "))
|
|
||||||
{
|
|
||||||
if (TvT.setRewardId(Integer.parseInt(command.substring(17))))
|
|
||||||
{
|
|
||||||
showMainPage(activeChar);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
BuilderUtil.sendSysMessage(activeChar, "Cannot perform requested operation, event in progress");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (command.startsWith("admin_tvt_reward_amount "))
|
|
||||||
{
|
|
||||||
if (TvT.setRewardAmount(Integer.parseInt(command.substring(24))))
|
|
||||||
{
|
|
||||||
showMainPage(activeChar);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
BuilderUtil.sendSysMessage(activeChar, "Cannot perform requested operation, event in progress");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (command.startsWith("admin_tvt_jointime "))
|
|
||||||
{
|
|
||||||
if (TvT.setJoinTime(Integer.parseInt(command.substring(19))))
|
|
||||||
{
|
|
||||||
showMainPage(activeChar);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
BuilderUtil.sendSysMessage(activeChar, "Cannot perform requested operation, event in progress");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (command.startsWith("admin_tvt_eventtime "))
|
|
||||||
{
|
|
||||||
if (TvT.setEventTime(Integer.parseInt(command.substring(20))))
|
|
||||||
{
|
|
||||||
showMainPage(activeChar);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
BuilderUtil.sendSysMessage(activeChar, "Cannot perform requested operation, event in progress");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (command.startsWith("admin_tvt_interval "))
|
|
||||||
{
|
|
||||||
if (TvT.setIntervalBetweenMatches(Integer.parseInt(command.substring(20))))
|
|
||||||
{
|
|
||||||
showMainPage(activeChar);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
BuilderUtil.sendSysMessage(activeChar, "Cannot perform requested operation, event in progress");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (command.startsWith("admin_tvt_team_add "))
|
|
||||||
{
|
|
||||||
final String teamName = command.substring(19);
|
|
||||||
TvT.addTeam(teamName);
|
|
||||||
showMainPage(activeChar);
|
|
||||||
}
|
|
||||||
else if (command.startsWith("admin_tvt_team_remove "))
|
|
||||||
{
|
|
||||||
final String teamName = command.substring(22);
|
|
||||||
TvT.removeTeam(teamName);
|
|
||||||
showMainPage(activeChar);
|
|
||||||
}
|
|
||||||
else if (command.startsWith("admin_tvt_team_pos "))
|
|
||||||
{
|
|
||||||
final String teamName = command.substring(19);
|
|
||||||
TvT.setTeamPos(teamName, activeChar);
|
|
||||||
showMainPage(activeChar);
|
|
||||||
}
|
|
||||||
else if (command.startsWith("admin_tvt_team_color "))
|
|
||||||
{
|
|
||||||
String[] params;
|
|
||||||
params = command.split(" ");
|
|
||||||
if (params.length != 3)
|
|
||||||
{
|
|
||||||
BuilderUtil.sendSysMessage(activeChar, "Wrong usege: //tvt_team_color <colorHex> <teamName>");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
TvT.setTeamColor(command.substring(params[0].length() + params[1].length() + 2), Integer.decode("0x" + params[1]));
|
|
||||||
showMainPage(activeChar);
|
|
||||||
}
|
|
||||||
else if (command.equals("admin_tvt_join"))
|
|
||||||
{
|
|
||||||
if (TvT.startJoin())
|
|
||||||
{
|
|
||||||
showMainPage(activeChar);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
BuilderUtil.sendSysMessage(activeChar, "Cannot startJoin, check LOGGER for info..");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (command.equals("admin_tvt_teleport"))
|
|
||||||
{
|
|
||||||
TvT.startTeleport();
|
|
||||||
showMainPage(activeChar);
|
|
||||||
}
|
|
||||||
else if (command.equals("admin_tvt_start"))
|
|
||||||
{
|
|
||||||
if (TvT.startEvent())
|
|
||||||
{
|
|
||||||
showMainPage(activeChar);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
BuilderUtil.sendSysMessage(activeChar, "Cannot startEvent, check LOGGER for info..");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (command.equals("admin_tvt_startevent"))
|
|
||||||
{
|
|
||||||
TvT.eventOnceStart();
|
|
||||||
showMainPage(activeChar);
|
|
||||||
}
|
|
||||||
else if (command.equals("admin_tvt_abort"))
|
|
||||||
{
|
|
||||||
BuilderUtil.sendSysMessage(activeChar, "Aborting event");
|
|
||||||
TvT.abortEvent();
|
|
||||||
showMainPage(activeChar);
|
|
||||||
}
|
|
||||||
else if (command.equals("admin_tvt_finish"))
|
|
||||||
{
|
|
||||||
TvT.finishEvent();
|
|
||||||
showMainPage(activeChar);
|
|
||||||
}
|
|
||||||
else if (command.equals("admin_tvt_sit"))
|
|
||||||
{
|
|
||||||
TvT.sit();
|
|
||||||
showMainPage(activeChar);
|
|
||||||
}
|
|
||||||
else if (command.equals("admin_tvt_load"))
|
|
||||||
{
|
|
||||||
TvT.loadData();
|
|
||||||
showMainPage(activeChar);
|
|
||||||
}
|
|
||||||
else if (command.equals("admin_tvt_autoevent"))
|
|
||||||
{
|
|
||||||
if ((TvT.getJoinTime() > 0) && (TvT.getEventTime() > 0))
|
|
||||||
{
|
|
||||||
TvT.autoEvent();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
BuilderUtil.sendSysMessage(activeChar, "Wrong usege: join time or event time invalid.");
|
|
||||||
}
|
|
||||||
|
|
||||||
showMainPage(activeChar);
|
|
||||||
}
|
|
||||||
else if (command.equals("admin_tvt_save"))
|
|
||||||
{
|
|
||||||
TvT.saveData();
|
|
||||||
showMainPage(activeChar);
|
|
||||||
}
|
|
||||||
else if (command.equals("admin_tvt_dump"))
|
|
||||||
{
|
|
||||||
TvT.dumpData();
|
|
||||||
}
|
|
||||||
else if (command.startsWith("admin_tvtkick"))
|
|
||||||
{
|
|
||||||
final StringTokenizer st = new StringTokenizer(command);
|
|
||||||
if (st.countTokens() > 1)
|
|
||||||
{
|
|
||||||
st.nextToken();
|
|
||||||
final String plyr = st.nextToken();
|
|
||||||
final PlayerInstance playerToKick = World.getInstance().getPlayer(plyr);
|
|
||||||
if (playerToKick != null)
|
|
||||||
{
|
|
||||||
TvT.kickPlayerFromTvt(playerToKick);
|
|
||||||
BuilderUtil.sendSysMessage(activeChar, "You kicked " + playerToKick.getName() + " from the TvT.");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
BuilderUtil.sendSysMessage(activeChar, "Wrong usege: //tvtkick <player>");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String[] getAdminCommandList()
|
|
||||||
{
|
|
||||||
return ADMIN_COMMANDS;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void showMainPage(PlayerInstance activeChar)
|
|
||||||
{
|
|
||||||
final NpcHtmlMessage adminReply = new NpcHtmlMessage(5);
|
|
||||||
final StringBuilder replyMSG = new StringBuilder("<html><title>Team vs Team</title><body>");
|
|
||||||
replyMSG.append("<center><font color=\"LEVEL\">[TvT Engine]</font></center><br><br><br>");
|
|
||||||
replyMSG.append("<table><tr><td><edit var=\"input1\" width=\"125\"></td><td><edit var=\"input2\" width=\"125\"></td></tr></table>");
|
|
||||||
replyMSG.append("<table border=\"0\"><tr>");
|
|
||||||
replyMSG.append("<td width=\"100\"><button value=\"Name\" action=\"bypass -h admin_tvt_name $input1\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
|
|
||||||
replyMSG.append("<td width=\"100\"><button value=\"Description\" action=\"bypass -h admin_tvt_desc $input1\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
|
|
||||||
replyMSG.append("<td width=\"100\"><button value=\"Join Location\" action=\"bypass -h admin_tvt_join_loc $input1\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
|
|
||||||
replyMSG.append("</tr></table><br><table><tr>");
|
|
||||||
replyMSG.append("</tr></table><br><table><tr>");
|
|
||||||
replyMSG.append("<td width=\"100\"><button value=\"Max lvl\" action=\"bypass -h admin_tvt_maxLevel $input1\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
|
|
||||||
replyMSG.append("<td width=\"100\"><button value=\"Min lvl\" action=\"bypass -h admin_tvt_minLevel $input1\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
|
|
||||||
replyMSG.append("</tr></table><br><table><tr>");
|
|
||||||
replyMSG.append("</tr></table><br><table><tr>");
|
|
||||||
replyMSG.append("<td width=\"100\"><button value=\"Max players\" action=\"bypass -h admin_tvt_maxplayers $input1\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
|
|
||||||
replyMSG.append("<td width=\"100\"><button value=\"Min players\" action=\"bypass -h admin_tvt_minplayers $input1\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
|
|
||||||
replyMSG.append("</tr></table><br><table><tr>");
|
|
||||||
replyMSG.append("<td width=\"100\"><button value=\"NPC\" action=\"bypass -h admin_tvt_npc $input1\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
|
|
||||||
replyMSG.append("<td width=\"100\"><button value=\"NPC Pos\" action=\"bypass -h admin_tvt_npc_pos\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
|
|
||||||
replyMSG.append("</tr></table><br><table><tr>");
|
|
||||||
replyMSG.append("<td width=\"100\"><button value=\"Reward\" action=\"bypass -h admin_tvt_reward $input1\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
|
|
||||||
replyMSG.append("<td width=\"100\"><button value=\"Reward Amount\" action=\"bypass -h admin_tvt_reward_amount $input1\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
|
|
||||||
replyMSG.append("</tr></table><br><table><tr>");
|
|
||||||
replyMSG.append("<td width=\"100\"><button value=\"Join Time\" action=\"bypass -h admin_tvt_jointime $input1\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
|
|
||||||
replyMSG.append("<td width=\"100\"><button value=\"Event Time\" action=\"bypass -h admin_tvt_eventtime $input1\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
|
|
||||||
replyMSG.append("<td width=\"100\"><button value=\"Interval Time\" action=\"bypass -h admin_tvt_interval $input1\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
|
|
||||||
replyMSG.append("</tr></table><br><table><tr>");
|
|
||||||
replyMSG.append("<td width=\"100\"><button value=\"Team Add\" action=\"bypass -h admin_tvt_team_add $input1\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
|
|
||||||
replyMSG.append("<td width=\"100\"><button value=\"Team Color\" action=\"bypass -h admin_tvt_team_color $input1 $input2\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
|
|
||||||
replyMSG.append("<td width=\"100\"><button value=\"Team Pos\" action=\"bypass -h admin_tvt_team_pos $input1\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
|
|
||||||
replyMSG.append("</tr></table><table><tr>");
|
|
||||||
replyMSG.append("<td width=\"100\"><button value=\"Team Remove\" action=\"bypass -h admin_tvt_team_remove $input1\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
|
|
||||||
replyMSG.append("</tr></table><br><table><tr>");
|
|
||||||
replyMSG.append("<td width=\"100\"><button value=\"Join\" action=\"bypass -h admin_tvt_join\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
|
|
||||||
replyMSG.append("<td width=\"100\"><button value=\"Teleport\" action=\"bypass -h admin_tvt_teleport\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
|
|
||||||
replyMSG.append("<td width=\"100\"><button value=\"Start\" action=\"bypass -h admin_tvt_start\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
|
|
||||||
replyMSG.append("</tr></table><table><tr>");
|
|
||||||
replyMSG.append("</tr></table><table><tr>");
|
|
||||||
replyMSG.append("<td width=\"100\"><button value=\"StartEventOnceTime\" action=\"bypass -h admin_tvt_startevent\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
|
|
||||||
replyMSG.append("</tr></table><br><table><tr>");
|
|
||||||
replyMSG.append("<td width=\"100\"><button value=\"Abort\" action=\"bypass -h admin_tvt_abort\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
|
|
||||||
replyMSG.append("<td width=\"100\"><button value=\"Finish\" action=\"bypass -h admin_tvt_finish\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
|
|
||||||
replyMSG.append("</tr></table><br><table><tr>");
|
|
||||||
replyMSG.append("<td width=\"100\"><button value=\"Sit Force\" action=\"bypass -h admin_tvt_sit\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
|
|
||||||
replyMSG.append("<td width=\"100\"><button value=\"Dump\" action=\"bypass -h admin_tvt_dump\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
|
|
||||||
replyMSG.append("</tr></table><br><br><table><tr>");
|
|
||||||
replyMSG.append("<td width=\"100\"><button value=\"Save\" action=\"bypass -h admin_tvt_save\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
|
|
||||||
replyMSG.append("<td width=\"100\"><button value=\"Load\" action=\"bypass -h admin_tvt_load\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
|
|
||||||
replyMSG.append("<td width=\"100\"><button value=\"Auto Event\" action=\"bypass -h admin_tvt_autoevent\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
|
|
||||||
replyMSG.append("</tr></table><br><br>");
|
|
||||||
replyMSG.append("Current event:<br1>");
|
|
||||||
replyMSG.append("Name: <font color=\"00FF00\">" + TvT.getEventName() + "</font><br1>");
|
|
||||||
replyMSG.append("Description: <font color=\"00FF00\">" + TvT.getEventDesc() + "</font><br1>");
|
|
||||||
replyMSG.append("Joining location name: <font color=\"00FF00\">" + TvT.getJoiningLocationName() + "</font><br1>");
|
|
||||||
|
|
||||||
final Location npcLoc = TvT.getNpcLocation();
|
|
||||||
replyMSG.append("Joining NPC ID: <font color=\"00FF00\">" + TvT.getNpcId() + " on pos " + npcLoc.getX() + "," + npcLoc.getY() + "," + npcLoc.getZ() + "</font><br1>");
|
|
||||||
replyMSG.append("Reward ID: <font color=\"00FF00\">" + TvT.getRewardId() + "</font><br1>");
|
|
||||||
replyMSG.append("Reward Amount: <font color=\"00FF00\">" + TvT.getRewardAmount() + "</font><br><br>");
|
|
||||||
replyMSG.append("Min lvl: <font color=\"00FF00\">" + TvT.getMinLevel() + "</font><br>");
|
|
||||||
replyMSG.append("Max lvl: <font color=\"00FF00\">" + TvT.getMaxLevel() + "</font><br><br>");
|
|
||||||
replyMSG.append("Min Players: <font color=\"00FF00\">" + TvT.getMinPlayers() + "</font><br>");
|
|
||||||
replyMSG.append("Max Players: <font color=\"00FF00\">" + TvT.getMaxPlayers() + "</font><br><br>");
|
|
||||||
replyMSG.append("Joining Time: <font color=\"00FF00\">" + TvT.getJoinTime() + "</font><br>");
|
|
||||||
replyMSG.append("Event Timer: <font color=\"00FF00\">" + TvT.getEventTime() + "</font><br><br>");
|
|
||||||
replyMSG.append("Interval Time: <font color=\"00FF00\">" + TvT.getIntervalBetweenMatches() + "</font><br><br>");
|
|
||||||
replyMSG.append("Current teams:<br1>");
|
|
||||||
replyMSG.append("<center><table border=\"0\">");
|
|
||||||
for (String team : TvT._teams)
|
|
||||||
{
|
|
||||||
replyMSG.append("<tr><td width=\"100\"><font color=\"LEVEL\">" + team + "</font>");
|
|
||||||
if (Config.TVT_EVEN_TEAMS.equals("NO") || Config.TVT_EVEN_TEAMS.equals("BALANCE"))
|
|
||||||
{
|
|
||||||
replyMSG.append(" (" + TvT.teamPlayersCount(team) + " joined)");
|
|
||||||
}
|
|
||||||
else if (Config.TVT_EVEN_TEAMS.equals("SHUFFLE"))
|
|
||||||
{
|
|
||||||
if (TvT.isTeleport() || TvT.isStarted())
|
|
||||||
{
|
|
||||||
replyMSG.append(" (" + TvT.teamPlayersCount(team) + " in)");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
replyMSG.append("</td></tr><tr><td>");
|
|
||||||
replyMSG.append(TvT._teamColors.get(TvT._teams.indexOf(team)));
|
|
||||||
replyMSG.append("</td></tr><tr><td>");
|
|
||||||
replyMSG.append(TvT._teamsX.get(TvT._teams.indexOf(team)) + ", " + TvT._teamsY.get(TvT._teams.indexOf(team)) + ", " + TvT._teamsZ.get(TvT._teams.indexOf(team)));
|
|
||||||
replyMSG.append("</td></tr><tr><td width=\"60\"><button value=\"Remove\" action=\"bypass -h admin_tvt_team_remove " + team + "\" width=50 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td></tr>");
|
|
||||||
}
|
|
||||||
|
|
||||||
replyMSG.append("</table></center>");
|
|
||||||
|
|
||||||
if (Config.TVT_EVEN_TEAMS.equals("SHUFFLE"))
|
|
||||||
{
|
|
||||||
if (!TvT.isStarted())
|
|
||||||
{
|
|
||||||
replyMSG.append("<br1>");
|
|
||||||
replyMSG.append(TvT._playersShuffle.size() + " players participating. Waiting to shuffle in teams(done on teleport)!");
|
|
||||||
replyMSG.append("<br><br>");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
replyMSG.append("</body></html>");
|
|
||||||
adminReply.setHtml(replyMSG.toString());
|
|
||||||
activeChar.sendPacket(adminReply);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,398 +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 org.l2jmobius.gameserver.handler.admincommandhandlers;
|
|
||||||
|
|
||||||
import org.l2jmobius.gameserver.handler.IAdminCommandHandler;
|
|
||||||
import org.l2jmobius.gameserver.instancemanager.events.VIP;
|
|
||||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
|
|
||||||
import org.l2jmobius.gameserver.util.BuilderUtil;
|
|
||||||
|
|
||||||
public class AdminVIPEngine implements IAdminCommandHandler
|
|
||||||
{
|
|
||||||
private static String[] ADMIN_COMMANDS =
|
|
||||||
{
|
|
||||||
"admin_vip",
|
|
||||||
"admin_vip_setteam",
|
|
||||||
"admin_vip_randomteam",
|
|
||||||
"admin_vip_settime",
|
|
||||||
"admin_vip_endnpc",
|
|
||||||
"admin_vip_setdelay",
|
|
||||||
"admin_vip_joininit",
|
|
||||||
"admin_vip_joinnpc",
|
|
||||||
"admin_vip_joinlocxyz",
|
|
||||||
"admin_vip_setarea",
|
|
||||||
"admin_vip_vipreward",
|
|
||||||
"admin_vip_viprewardamount",
|
|
||||||
"admin_vip_thevipreward",
|
|
||||||
"admin_vip_theviprewardamount",
|
|
||||||
"admin_vip_notvipreward",
|
|
||||||
"admin_vip_notviprewardamount",
|
|
||||||
};
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean useAdminCommand(String command, PlayerInstance activeChar)
|
|
||||||
{
|
|
||||||
if (command.equals("admin_vip"))
|
|
||||||
{
|
|
||||||
showMainPage(activeChar);
|
|
||||||
}
|
|
||||||
else if (command.startsWith("admin_vip_setteam "))
|
|
||||||
{
|
|
||||||
if (VIP._inProgress)
|
|
||||||
{
|
|
||||||
BuilderUtil.sendSysMessage(activeChar, "Cannot change variables when event has already started");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
String[] params;
|
|
||||||
params = command.split(" ");
|
|
||||||
if (params.length != 2)
|
|
||||||
{
|
|
||||||
BuilderUtil.sendSysMessage(activeChar, "Wrong usage: //vip_setteam <team>");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
VIP.setTeam(params[1], activeChar);
|
|
||||||
showMainPage(activeChar);
|
|
||||||
}
|
|
||||||
else if (command.startsWith("admin_vip_randomteam"))
|
|
||||||
{
|
|
||||||
if (VIP._started || VIP._joining)
|
|
||||||
{
|
|
||||||
BuilderUtil.sendSysMessage(activeChar, "Cannot change variables when event has already started");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
VIP.setRandomTeam(activeChar);
|
|
||||||
showMainPage(activeChar);
|
|
||||||
}
|
|
||||||
else if (command.startsWith("admin_vip_settime "))
|
|
||||||
{
|
|
||||||
if (VIP._inProgress)
|
|
||||||
{
|
|
||||||
BuilderUtil.sendSysMessage(activeChar, "Cannot change variables when event has already started");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
String[] params;
|
|
||||||
params = command.split(" ");
|
|
||||||
if (params.length != 2)
|
|
||||||
{
|
|
||||||
BuilderUtil.sendSysMessage(activeChar, "Wrong usage: //vip_settime <time>");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
VIP._time = Integer.parseInt(params[1]) * 60 * 1000;
|
|
||||||
showMainPage(activeChar);
|
|
||||||
}
|
|
||||||
else if (command.startsWith("admin_vip_endnpc "))
|
|
||||||
{
|
|
||||||
if (VIP._inProgress)
|
|
||||||
{
|
|
||||||
BuilderUtil.sendSysMessage(activeChar, "Cannot change variables when event has already started");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
String[] params;
|
|
||||||
params = command.split(" ");
|
|
||||||
if (params.length != 2)
|
|
||||||
{
|
|
||||||
BuilderUtil.sendSysMessage(activeChar, "Wrong usage: //vip_endnpc <npc>");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
VIP.endNPC(Integer.parseInt(params[1]), activeChar);
|
|
||||||
showMainPage(activeChar);
|
|
||||||
}
|
|
||||||
else if (command.startsWith("admin_vip_joinnpc "))
|
|
||||||
{
|
|
||||||
if (VIP._inProgress)
|
|
||||||
{
|
|
||||||
BuilderUtil.sendSysMessage(activeChar, "Cannot change variables when event has already started");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
String[] params;
|
|
||||||
params = command.split(" ");
|
|
||||||
if (params.length != 2)
|
|
||||||
{
|
|
||||||
BuilderUtil.sendSysMessage(activeChar, "Wrong usage: //vip_joinnpc <npc>");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
VIP.joinNPC(Integer.parseInt(params[1]), activeChar);
|
|
||||||
showMainPage(activeChar);
|
|
||||||
}
|
|
||||||
else if (command.startsWith("admin_vip_setdelay "))
|
|
||||||
{
|
|
||||||
if (VIP._inProgress)
|
|
||||||
{
|
|
||||||
BuilderUtil.sendSysMessage(activeChar, "Cannot change variables when event has already started");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
String[] params;
|
|
||||||
params = command.split(" ");
|
|
||||||
if (params.length != 2)
|
|
||||||
{
|
|
||||||
BuilderUtil.sendSysMessage(activeChar, "Wrong usage: //vip_setdelay <time>");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
VIP._delay = Integer.parseInt(params[1]) * 60 * 1000;
|
|
||||||
showMainPage(activeChar);
|
|
||||||
}
|
|
||||||
else if (command.startsWith("admin_vip_joininit"))
|
|
||||||
{
|
|
||||||
VIP.startJoin(activeChar);
|
|
||||||
}
|
|
||||||
else if (command.startsWith("admin_vip_joinlocxyz "))
|
|
||||||
{
|
|
||||||
if (VIP._inProgress)
|
|
||||||
{
|
|
||||||
BuilderUtil.sendSysMessage(activeChar, "Cannot change variables when event has already started");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
String[] params;
|
|
||||||
params = command.split(" ");
|
|
||||||
if (params.length != 4)
|
|
||||||
{
|
|
||||||
BuilderUtil.sendSysMessage(activeChar, "Wrong usage: //vip_joinlocxyz <x> <y> <z>");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
VIP.setJoinLOC(params[1], params[2], params[3]);
|
|
||||||
showMainPage(activeChar);
|
|
||||||
}
|
|
||||||
else if (command.startsWith("admin_vip_joinnpc "))
|
|
||||||
{
|
|
||||||
if (VIP._inProgress)
|
|
||||||
{
|
|
||||||
BuilderUtil.sendSysMessage(activeChar, "Cannot change variables when event has already started");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
String[] params;
|
|
||||||
params = command.split(" ");
|
|
||||||
if (params.length != 2)
|
|
||||||
{
|
|
||||||
BuilderUtil.sendSysMessage(activeChar, "Wrong usage: //vip_joinnpc <npc>");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
VIP.joinNPC(Integer.parseInt(params[1]), activeChar);
|
|
||||||
showMainPage(activeChar);
|
|
||||||
}
|
|
||||||
else if (command.startsWith("admin_vip_setarea "))
|
|
||||||
{
|
|
||||||
if (VIP._inProgress)
|
|
||||||
{
|
|
||||||
BuilderUtil.sendSysMessage(activeChar, "Cannot change variables when event has already started");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
String[] params;
|
|
||||||
params = command.split(" ");
|
|
||||||
if (params.length != 2)
|
|
||||||
{
|
|
||||||
BuilderUtil.sendSysMessage(activeChar, "Wrong usage: //vip_setarea <Area>");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
VIP._joinArea = params[1];
|
|
||||||
showMainPage(activeChar);
|
|
||||||
}
|
|
||||||
else if (command.startsWith("admin_vip_vipreward "))
|
|
||||||
{
|
|
||||||
if (VIP._inProgress)
|
|
||||||
{
|
|
||||||
BuilderUtil.sendSysMessage(activeChar, "Cannot change variables when event has already started");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
String[] params;
|
|
||||||
params = command.split(" ");
|
|
||||||
if (params.length != 2)
|
|
||||||
{
|
|
||||||
BuilderUtil.sendSysMessage(activeChar, "Wrong usage: //vip_vipreward <id>");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
VIP._vipReward = Integer.parseInt(params[1]);
|
|
||||||
showMainPage(activeChar);
|
|
||||||
}
|
|
||||||
else if (command.startsWith("admin_vip_viprewardamount "))
|
|
||||||
{
|
|
||||||
if (VIP._inProgress)
|
|
||||||
{
|
|
||||||
BuilderUtil.sendSysMessage(activeChar, "Cannot change variables when event has already started");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
String[] params;
|
|
||||||
params = command.split(" ");
|
|
||||||
if (params.length != 2)
|
|
||||||
{
|
|
||||||
BuilderUtil.sendSysMessage(activeChar, "Wrong usage: //vip_viprewardamount <amount>");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
VIP._vipRewardAmount = Integer.parseInt(params[1]);
|
|
||||||
showMainPage(activeChar);
|
|
||||||
}
|
|
||||||
else if (command.startsWith("admin_vip_notvipreward "))
|
|
||||||
{
|
|
||||||
if (VIP._inProgress)
|
|
||||||
{
|
|
||||||
BuilderUtil.sendSysMessage(activeChar, "Cannot change variables when event has already started");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
String[] params;
|
|
||||||
params = command.split(" ");
|
|
||||||
if (params.length != 2)
|
|
||||||
{
|
|
||||||
BuilderUtil.sendSysMessage(activeChar, "Wrong usage: //vip_notvipreward <id>");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
VIP._notVipReward = Integer.parseInt(params[1]);
|
|
||||||
showMainPage(activeChar);
|
|
||||||
}
|
|
||||||
else if (command.startsWith("admin_vip_notviprewardamount "))
|
|
||||||
{
|
|
||||||
if (VIP._inProgress)
|
|
||||||
{
|
|
||||||
BuilderUtil.sendSysMessage(activeChar, "Cannot change variables when event has already started");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
String[] params;
|
|
||||||
params = command.split(" ");
|
|
||||||
if (params.length != 2)
|
|
||||||
{
|
|
||||||
BuilderUtil.sendSysMessage(activeChar, "Wrong usage: //vip_notviprewardamount <amount>");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
VIP._notVipRewardAmount = Integer.parseInt(params[1]);
|
|
||||||
showMainPage(activeChar);
|
|
||||||
}
|
|
||||||
else if (command.startsWith("admin_vip_thevipreward "))
|
|
||||||
{
|
|
||||||
if (VIP._inProgress)
|
|
||||||
{
|
|
||||||
BuilderUtil.sendSysMessage(activeChar, "Cannot change variables when event has already started");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
String[] params;
|
|
||||||
params = command.split(" ");
|
|
||||||
if (params.length != 2)
|
|
||||||
{
|
|
||||||
BuilderUtil.sendSysMessage(activeChar, "Wrong usage: //vip_thevipreward <id>");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
VIP._theVipReward = Integer.parseInt(params[1]);
|
|
||||||
showMainPage(activeChar);
|
|
||||||
}
|
|
||||||
else if (command.startsWith("admin_vip_theviprewardamount "))
|
|
||||||
{
|
|
||||||
if (VIP._inProgress)
|
|
||||||
{
|
|
||||||
BuilderUtil.sendSysMessage(activeChar, "Cannot change variables when event has already started");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
String[] params;
|
|
||||||
params = command.split(" ");
|
|
||||||
if (params.length != 2)
|
|
||||||
{
|
|
||||||
BuilderUtil.sendSysMessage(activeChar, "Wrong usage: //vip_theviprewardamount <amount>");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
VIP._theVipRewardAmount = Integer.parseInt(params[1]);
|
|
||||||
showMainPage(activeChar);
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String[] getAdminCommandList()
|
|
||||||
{
|
|
||||||
return ADMIN_COMMANDS;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void showMainPage(PlayerInstance activeChar)
|
|
||||||
{
|
|
||||||
final NpcHtmlMessage adminReply = new NpcHtmlMessage(5);
|
|
||||||
final StringBuilder replyMSG = new StringBuilder("<html><body>");
|
|
||||||
replyMSG.append("<center><font color=\"LEVEL\">[VIP Engine]</font></center><br><br><br>");
|
|
||||||
replyMSG.append("<table><tr><td><edit var=\"input1\" width=\"50\"></td><td><edit var=\"input2\" width=\"50\"></td><td><edit var=\"input3\" width\"50\"></td></tr></table>");
|
|
||||||
replyMSG.append("<table border=\"0\"><tr>");
|
|
||||||
replyMSG.append("<td width=\"100\"><button value=\"Set Team\" action=\"bypass -h admin_vip_setteam $input1\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
|
|
||||||
replyMSG.append("<td width=\"100\"><button value=\"Random Team\" action=\"bypass -h admin_vip_randomteam\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
|
|
||||||
replyMSG.append("</tr><tr>");
|
|
||||||
|
|
||||||
replyMSG.append("</tr></table><br><table><tr>");
|
|
||||||
replyMSG.append("<td width=\"100\"><button value=\"Set Time\" action=\"bypass -h admin_vip_settime $input1\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
|
|
||||||
replyMSG.append("<td width=\"100\"><button value=\"Set Delay\" action=\"bypass -h admin_vip_setdelay $input1\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
|
|
||||||
replyMSG.append("<td width=\"100\"><button value=\"Set Area\" action=\"bypass -h admin_vip_setarea $input1\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
|
|
||||||
replyMSG.append("</tr><tr>");
|
|
||||||
|
|
||||||
replyMSG.append("</tr></table><br><table><tr>");
|
|
||||||
replyMSG.append("<td width=\"100\"><button value=\"End NPC\" action=\"bypass -h admin_vip_endnpc $input1\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
|
|
||||||
replyMSG.append("<td width=\"100\"><button value=\"Join NPC\" action=\"bypass -h admin_vip_joinnpc $input1\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
|
|
||||||
replyMSG.append("<td width=\"100\"><button value=\"Join LOC\" action=\"bypass -h admin_vip_joinlocxyz $input1 $input2 $input3\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
|
|
||||||
replyMSG.append("</tr><tr>");
|
|
||||||
|
|
||||||
replyMSG.append("</tr></table><br><table><tr>");
|
|
||||||
replyMSG.append("<td width=\"100\"><button value=\"VIP Reward\" action=\"bypass -h admin_vip_vipreward $input1\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
|
|
||||||
replyMSG.append("<td width=\"100\"><button value=\"VIP Reward Am\" action=\"bypass -h admin_vip_viprewardamount $input1\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
|
|
||||||
replyMSG.append("</tr></table><br><table><tr>");
|
|
||||||
replyMSG.append("<td width=\"100\"><button value=\"Not VIP Reward\" action=\"bypass -h admin_vip_notvipreward $input1\" width=130 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
|
|
||||||
replyMSG.append("<td width=\"100\"><button value=\"Not VIP Reward Am\" action=\"bypass -h admin_vip_notviprewardamount $input1\" width=130 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
|
|
||||||
replyMSG.append("</tr></table><br><table><tr>");
|
|
||||||
replyMSG.append("<td width=\"100\"><button value=\"The VIP Reward\" action=\"bypass -h admin_vip_thevipreward $input1\" width=130 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
|
|
||||||
replyMSG.append("<td width=\"100\"><button value=\"The VIP Reward Am\" action=\"bypass -h admin_vip_theviprewardamount $input1\" width=130 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
|
|
||||||
replyMSG.append("</tr><tr>");
|
|
||||||
|
|
||||||
replyMSG.append("</tr></table><br><table><tr>");
|
|
||||||
replyMSG.append("<td width=\"100\"><button value=\"Start Join\" action=\"bypass -h admin_vip_joininit\" width=90 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
|
|
||||||
replyMSG.append("</tr></table><br><br>");
|
|
||||||
|
|
||||||
replyMSG.append("<font color=\"LEVEL\">VIP Settings...</font><br1>");
|
|
||||||
replyMSG.append("Team: <font color=\"FFFFFF\">" + VIP._teamName + "</font><br>");
|
|
||||||
replyMSG.append("Delay: <font color=\"FFFFFF\">" + (VIP._delay / 1000 / 60) + "</font><br1>");
|
|
||||||
replyMSG.append("Time: <font color=\"FFFFFF\">" + (VIP._time / 1000 / 60) + "</font><br>");
|
|
||||||
replyMSG.append("End NPC ID: <font color=\"FFFFFF\">" + VIP._endNPC + " (" + VIP.getNPCName(VIP._endNPC, activeChar) + ")</font><br1>");
|
|
||||||
replyMSG.append("Join NPC ID: <font color=\"FFFFFF\">" + VIP._joinNPC + " (" + VIP.getNPCName(VIP._joinNPC, activeChar) + ")</font><br>");
|
|
||||||
replyMSG.append("Start Location: <font color=\"FFFFFF\">" + VIP._startX + "," + VIP._startY + "," + VIP._startZ + "</font><br1>");
|
|
||||||
replyMSG.append("End Location: <font color=\"FFFFFF\">" + VIP._endX + "," + VIP._endY + "," + VIP._endZ + "</font><br1>");
|
|
||||||
replyMSG.append("Join Location: <font color=\"FFFFFF\">" + VIP._joinX + "," + VIP._joinY + "," + VIP._joinZ + "</font><br>");
|
|
||||||
replyMSG.append("VIP Team Reward: <font color=\"FFFFFF\">" + VIP.getItemName(VIP._vipReward, activeChar) + " (" + VIP._vipRewardAmount + ")</font><br1>");
|
|
||||||
replyMSG.append("Not VIP Team Reward: <font color=\"FFFFFF\">" + VIP.getItemName(VIP._notVipReward, activeChar) + " (" + VIP._notVipRewardAmount + ")</font><br1>");
|
|
||||||
replyMSG.append("VIP Reward: <font color=\"FFFFFF\">" + VIP.getItemName(VIP._theVipReward, activeChar) + " (" + VIP._theVipRewardAmount + ")</font><br>");
|
|
||||||
replyMSG.append("</body></html>");
|
|
||||||
adminReply.setHtml(replyMSG.toString());
|
|
||||||
activeChar.sendPacket(adminReply);
|
|
||||||
}
|
|
||||||
}
|
|
@ -28,10 +28,6 @@ import org.l2jmobius.commons.threads.ThreadPool;
|
|||||||
import org.l2jmobius.gameserver.data.ItemTable;
|
import org.l2jmobius.gameserver.data.ItemTable;
|
||||||
import org.l2jmobius.gameserver.data.SkillTable;
|
import org.l2jmobius.gameserver.data.SkillTable;
|
||||||
import org.l2jmobius.gameserver.handler.IItemHandler;
|
import org.l2jmobius.gameserver.handler.IItemHandler;
|
||||||
import org.l2jmobius.gameserver.instancemanager.events.CTF;
|
|
||||||
import org.l2jmobius.gameserver.instancemanager.events.DM;
|
|
||||||
import org.l2jmobius.gameserver.instancemanager.events.TvT;
|
|
||||||
import org.l2jmobius.gameserver.instancemanager.events.VIP;
|
|
||||||
import org.l2jmobius.gameserver.model.Effect;
|
import org.l2jmobius.gameserver.model.Effect;
|
||||||
import org.l2jmobius.gameserver.model.Effect.EffectType;
|
import org.l2jmobius.gameserver.model.Effect.EffectType;
|
||||||
import org.l2jmobius.gameserver.model.Skill;
|
import org.l2jmobius.gameserver.model.Skill;
|
||||||
@ -41,7 +37,6 @@ import org.l2jmobius.gameserver.model.actor.instance.PetInstance;
|
|||||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||||
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
|
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
|
||||||
import org.l2jmobius.gameserver.network.SystemMessageId;
|
import org.l2jmobius.gameserver.network.SystemMessageId;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ActionFailed;
|
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
|
import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
|
||||||
|
|
||||||
public class Potions implements IItemHandler
|
public class Potions implements IItemHandler
|
||||||
@ -49,17 +44,17 @@ public class Potions implements IItemHandler
|
|||||||
protected static final Logger LOGGER = Logger.getLogger(Potions.class.getName());
|
protected static final Logger LOGGER = Logger.getLogger(Potions.class.getName());
|
||||||
private int _herbstask = 0;
|
private int _herbstask = 0;
|
||||||
|
|
||||||
private static final Map<Integer, PotionsSkills> POTIONS = new HashMap<>();
|
private static final Map<Integer, PotionSkill> POTIONS = new HashMap<>();
|
||||||
|
|
||||||
private static void loadPotions()
|
private static void loadPotions()
|
||||||
{
|
{
|
||||||
for (PotionsSkills potionSkill : PotionsSkills.values())
|
for (PotionSkill potionSkill : PotionSkill.values())
|
||||||
{
|
{
|
||||||
POTIONS.put(potionSkill.potionId, potionSkill);
|
POTIONS.put(potionSkill.potionId, potionSkill);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static PotionsSkills getSkillsForPotion(Integer potionId)
|
public static PotionSkill getSkillsForPotion(Integer potionId)
|
||||||
{
|
{
|
||||||
if (POTIONS.isEmpty())
|
if (POTIONS.isEmpty())
|
||||||
{
|
{
|
||||||
@ -76,7 +71,7 @@ public class Potions implements IItemHandler
|
|||||||
}
|
}
|
||||||
|
|
||||||
final List<Integer> outputPotions = new ArrayList<>();
|
final List<Integer> outputPotions = new ArrayList<>();
|
||||||
for (Entry<Integer, PotionsSkills> entry : POTIONS.entrySet())
|
for (Entry<Integer, PotionSkill> entry : POTIONS.entrySet())
|
||||||
{
|
{
|
||||||
Map<Integer, Integer> itemSkills = null;
|
Map<Integer, Integer> itemSkills = null;
|
||||||
if (entry.getValue() != null)
|
if (entry.getValue() != null)
|
||||||
@ -208,30 +203,6 @@ public class Potions implements IItemHandler
|
|||||||
{
|
{
|
||||||
PlayerInstance activeChar;
|
PlayerInstance activeChar;
|
||||||
activeChar = (PlayerInstance) playable;
|
activeChar = (PlayerInstance) playable;
|
||||||
if (activeChar._inEventTvT && TvT.isStarted() && !Config.TVT_ALLOW_POTIONS)
|
|
||||||
{
|
|
||||||
activeChar.sendPacket(ActionFailed.STATIC_PACKET);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (activeChar._inEventDM && DM.hasStarted() && !Config.DM_ALLOW_POTIONS)
|
|
||||||
{
|
|
||||||
activeChar.sendPacket(ActionFailed.STATIC_PACKET);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (activeChar._inEventCTF && CTF.isStarted() && !Config.CTF_ALLOW_POTIONS)
|
|
||||||
{
|
|
||||||
activeChar.sendPacket(ActionFailed.STATIC_PACKET);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (activeChar._inEventVIP && VIP._started)
|
|
||||||
{
|
|
||||||
activeChar.sendPacket(ActionFailed.STATIC_PACKET);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (activeChar.isInOlympiadMode())
|
if (activeChar.isInOlympiadMode())
|
||||||
{
|
{
|
||||||
activeChar.sendPacket(SystemMessageId.YOU_CANNOT_USE_THAT_ITEM_IN_A_GRAND_OLYMPIAD_GAMES_MATCH);
|
activeChar.sendPacket(SystemMessageId.YOU_CANNOT_USE_THAT_ITEM_IN_A_GRAND_OLYMPIAD_GAMES_MATCH);
|
||||||
@ -897,7 +868,7 @@ public class Potions implements IItemHandler
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
enum PotionsSkills
|
enum PotionSkill
|
||||||
{
|
{
|
||||||
mana_drug(726, 2003, 1),
|
mana_drug(726, 2003, 1),
|
||||||
mana_potion(728, 2005, 1),
|
mana_potion(728, 2005, 1),
|
||||||
@ -1003,13 +974,13 @@ public class Potions implements IItemHandler
|
|||||||
public Integer potionId;
|
public Integer potionId;
|
||||||
public Map<Integer, Integer> skills = new HashMap<>();
|
public Map<Integer, Integer> skills = new HashMap<>();
|
||||||
|
|
||||||
private PotionsSkills(int potionItem, int skillIdentifier, int skillLevel)
|
private PotionSkill(int potionItem, int skillIdentifier, int skillLevel)
|
||||||
{
|
{
|
||||||
skills.put(skillIdentifier, skillLevel);
|
skills.put(skillIdentifier, skillLevel);
|
||||||
potionId = potionItem;
|
potionId = potionItem;
|
||||||
}
|
}
|
||||||
|
|
||||||
private PotionsSkills(int potionItem, Integer[] skillIdentifiers, Integer[] skillLevels)
|
private PotionSkill(int potionItem, Integer[] skillIdentifiers, Integer[] skillLevels)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < skillIdentifiers.length; i++)
|
for (int i = 0; i < skillIdentifiers.length; i++)
|
||||||
{
|
{
|
||||||
|
@ -25,10 +25,6 @@ import org.l2jmobius.gameserver.handler.IItemHandler;
|
|||||||
import org.l2jmobius.gameserver.instancemanager.CastleManager;
|
import org.l2jmobius.gameserver.instancemanager.CastleManager;
|
||||||
import org.l2jmobius.gameserver.instancemanager.ClanHallManager;
|
import org.l2jmobius.gameserver.instancemanager.ClanHallManager;
|
||||||
import org.l2jmobius.gameserver.instancemanager.FortManager;
|
import org.l2jmobius.gameserver.instancemanager.FortManager;
|
||||||
import org.l2jmobius.gameserver.instancemanager.events.CTF;
|
|
||||||
import org.l2jmobius.gameserver.instancemanager.events.DM;
|
|
||||||
import org.l2jmobius.gameserver.instancemanager.events.TvT;
|
|
||||||
import org.l2jmobius.gameserver.instancemanager.events.VIP;
|
|
||||||
import org.l2jmobius.gameserver.model.Skill;
|
import org.l2jmobius.gameserver.model.Skill;
|
||||||
import org.l2jmobius.gameserver.model.actor.Playable;
|
import org.l2jmobius.gameserver.model.actor.Playable;
|
||||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||||
@ -101,27 +97,9 @@ public class ScrollOfEscape implements IItemHandler
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (player._inEventTvT && TvT.isStarted())
|
if (player.isOnCustomEvent())
|
||||||
{
|
{
|
||||||
player.sendMessage("You can't use Scroll of Escape in TvT.");
|
player.sendMessage("You can't use Scroll of Escape in an event.");
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (player._inEventDM && DM.hasStarted())
|
|
||||||
{
|
|
||||||
player.sendMessage("You can't use Scroll of Escape in DM.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (player._inEventCTF && CTF.isStarted())
|
|
||||||
{
|
|
||||||
player.sendMessage("You can't use Scroll of Escape in CTF.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (player._inEventVIP && VIP._started)
|
|
||||||
{
|
|
||||||
player.sendMessage("You can't use Scroll of Escape in VIP.");
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -16,16 +16,12 @@
|
|||||||
*/
|
*/
|
||||||
package org.l2jmobius.gameserver.handler.itemhandlers;
|
package org.l2jmobius.gameserver.handler.itemhandlers;
|
||||||
|
|
||||||
import org.l2jmobius.Config;
|
|
||||||
import org.l2jmobius.commons.threads.ThreadPool;
|
import org.l2jmobius.commons.threads.ThreadPool;
|
||||||
import org.l2jmobius.gameserver.data.SkillTable;
|
import org.l2jmobius.gameserver.data.SkillTable;
|
||||||
import org.l2jmobius.gameserver.data.sql.NpcTable;
|
import org.l2jmobius.gameserver.data.sql.NpcTable;
|
||||||
import org.l2jmobius.gameserver.data.xml.SummonItemData;
|
import org.l2jmobius.gameserver.data.xml.SummonItemData;
|
||||||
import org.l2jmobius.gameserver.handler.IItemHandler;
|
import org.l2jmobius.gameserver.handler.IItemHandler;
|
||||||
import org.l2jmobius.gameserver.instancemanager.IdManager;
|
import org.l2jmobius.gameserver.instancemanager.IdManager;
|
||||||
import org.l2jmobius.gameserver.instancemanager.events.CTF;
|
|
||||||
import org.l2jmobius.gameserver.instancemanager.events.DM;
|
|
||||||
import org.l2jmobius.gameserver.instancemanager.events.TvT;
|
|
||||||
import org.l2jmobius.gameserver.model.Skill;
|
import org.l2jmobius.gameserver.model.Skill;
|
||||||
import org.l2jmobius.gameserver.model.SummonItem;
|
import org.l2jmobius.gameserver.model.SummonItem;
|
||||||
import org.l2jmobius.gameserver.model.World;
|
import org.l2jmobius.gameserver.model.World;
|
||||||
@ -61,24 +57,9 @@ public class SummonItems implements IItemHandler
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (player._inEventTvT && TvT.isStarted() && !Config.TVT_ALLOW_SUMMON)
|
if (player.isOnCustomEvent())
|
||||||
{
|
{
|
||||||
final ActionFailed af = ActionFailed.STATIC_PACKET;
|
playable.sendPacket(ActionFailed.STATIC_PACKET);
|
||||||
player.sendPacket(af);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (player._inEventDM && DM.hasStarted() && !Config.DM_ALLOW_SUMMON)
|
|
||||||
{
|
|
||||||
final ActionFailed af = ActionFailed.STATIC_PACKET;
|
|
||||||
player.sendPacket(af);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (player._inEventCTF && CTF.isStarted() && !Config.CTF_ALLOW_SUMMON)
|
|
||||||
{
|
|
||||||
final ActionFailed af = ActionFailed.STATIC_PACKET;
|
|
||||||
player.sendPacket(af);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -53,7 +53,7 @@ public class ClanGate implements ISkillHandler
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (player.isInFunEvent() || player.isInsideZone(ZoneId.NO_LANDING) || player.isInOlympiadMode() || player.isInsideZone(ZoneId.PVP) || (GrandBossManager.getInstance().getZone(player) != null))
|
if (player.isOnCustomEvent() || player.isInsideZone(ZoneId.NO_LANDING) || player.isInOlympiadMode() || player.isInsideZone(ZoneId.PVP) || (GrandBossManager.getInstance().getZone(player) != null))
|
||||||
{
|
{
|
||||||
player.sendMessage("Cannot open the portal here.");
|
player.sendMessage("Cannot open the portal here.");
|
||||||
return;
|
return;
|
||||||
|
@ -21,10 +21,6 @@ import java.util.List;
|
|||||||
import org.l2jmobius.gameserver.enums.TeleportWhereType;
|
import org.l2jmobius.gameserver.enums.TeleportWhereType;
|
||||||
import org.l2jmobius.gameserver.handler.ISkillHandler;
|
import org.l2jmobius.gameserver.handler.ISkillHandler;
|
||||||
import org.l2jmobius.gameserver.instancemanager.GrandBossManager;
|
import org.l2jmobius.gameserver.instancemanager.GrandBossManager;
|
||||||
import org.l2jmobius.gameserver.instancemanager.events.CTF;
|
|
||||||
import org.l2jmobius.gameserver.instancemanager.events.DM;
|
|
||||||
import org.l2jmobius.gameserver.instancemanager.events.TvT;
|
|
||||||
import org.l2jmobius.gameserver.instancemanager.events.VIP;
|
|
||||||
import org.l2jmobius.gameserver.model.Skill;
|
import org.l2jmobius.gameserver.model.Skill;
|
||||||
import org.l2jmobius.gameserver.model.Skill.SkillType;
|
import org.l2jmobius.gameserver.model.Skill.SkillType;
|
||||||
import org.l2jmobius.gameserver.model.WorldObject;
|
import org.l2jmobius.gameserver.model.WorldObject;
|
||||||
@ -92,9 +88,9 @@ public class Recall implements ISkillHandler
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((targetChar._inEventCTF && CTF.isStarted()) || (targetChar._inEventTvT && TvT.isStarted()) || (targetChar._inEventDM && DM.hasStarted()) || (targetChar._inEventVIP && VIP._started))
|
if (targetChar.isOnCustomEvent())
|
||||||
{
|
{
|
||||||
targetChar.sendMessage("You can't use escape skill in Event.");
|
targetChar.sendMessage("You can't use escape skill in an event.");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -20,10 +20,6 @@ import java.util.List;
|
|||||||
|
|
||||||
import org.l2jmobius.gameserver.handler.ISkillHandler;
|
import org.l2jmobius.gameserver.handler.ISkillHandler;
|
||||||
import org.l2jmobius.gameserver.instancemanager.GrandBossManager;
|
import org.l2jmobius.gameserver.instancemanager.GrandBossManager;
|
||||||
import org.l2jmobius.gameserver.instancemanager.events.CTF;
|
|
||||||
import org.l2jmobius.gameserver.instancemanager.events.DM;
|
|
||||||
import org.l2jmobius.gameserver.instancemanager.events.TvT;
|
|
||||||
import org.l2jmobius.gameserver.instancemanager.events.VIP;
|
|
||||||
import org.l2jmobius.gameserver.model.Skill;
|
import org.l2jmobius.gameserver.model.Skill;
|
||||||
import org.l2jmobius.gameserver.model.Skill.SkillType;
|
import org.l2jmobius.gameserver.model.Skill.SkillType;
|
||||||
import org.l2jmobius.gameserver.model.WorldObject;
|
import org.l2jmobius.gameserver.model.WorldObject;
|
||||||
@ -62,31 +58,7 @@ public class SummonFriend implements ISkillHandler
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (activePlayer._inEvent)
|
if (activePlayer.isOnCustomEvent())
|
||||||
{
|
|
||||||
activePlayer.sendMessage("You cannot use this skill in an Event.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (activePlayer._inEventCTF && CTF.isStarted())
|
|
||||||
{
|
|
||||||
activePlayer.sendMessage("You cannot use this skill in an Event.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (activePlayer._inEventDM && DM.hasStarted())
|
|
||||||
{
|
|
||||||
activePlayer.sendMessage("You cannot use this skill in an Event.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (activePlayer._inEventTvT && TvT.isStarted())
|
|
||||||
{
|
|
||||||
activePlayer.sendMessage("You cannot use this skill in an Event.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (activePlayer._inEventVIP && VIP._started)
|
|
||||||
{
|
{
|
||||||
activePlayer.sendMessage("You cannot use this skill in an Event.");
|
activePlayer.sendMessage("You cannot use this skill in an Event.");
|
||||||
return;
|
return;
|
||||||
@ -143,32 +115,6 @@ public class SummonFriend implements ISkillHandler
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (targetPlayer._inEvent)
|
|
||||||
{
|
|
||||||
targetPlayer.sendMessage("You cannot use this skill in an Event.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (targetPlayer._inEventCTF)
|
|
||||||
{
|
|
||||||
targetPlayer.sendMessage("You cannot use this skill in an Event.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (targetPlayer._inEventDM)
|
|
||||||
{
|
|
||||||
targetPlayer.sendMessage("You cannot use this skill in an Event.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (targetPlayer._inEventTvT)
|
|
||||||
{
|
|
||||||
targetPlayer.sendMessage("You cannot use this skill in an Event.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (targetPlayer._inEventVIP)
|
|
||||||
{
|
|
||||||
targetPlayer.sendMessage("You cannot use this skill in an Event.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (targetPlayer.isInStoreMode())
|
if (targetPlayer.isInStoreMode())
|
||||||
{
|
{
|
||||||
final SystemMessage sm = new SystemMessage(SystemMessageId.S1_IS_CURRENTLY_TRADING_OR_OPERATING_A_PRIVATE_STORE_AND_CANNOT_BE_SUMMONED);
|
final SystemMessage sm = new SystemMessage(SystemMessageId.S1_IS_CURRENTLY_TRADING_OR_OPERATING_A_PRIVATE_STORE_AND_CANNOT_BE_SUMMONED);
|
||||||
|
@ -22,10 +22,6 @@ import org.l2jmobius.gameserver.ai.CtrlIntention;
|
|||||||
import org.l2jmobius.gameserver.enums.TeleportWhereType;
|
import org.l2jmobius.gameserver.enums.TeleportWhereType;
|
||||||
import org.l2jmobius.gameserver.handler.IUserCommandHandler;
|
import org.l2jmobius.gameserver.handler.IUserCommandHandler;
|
||||||
import org.l2jmobius.gameserver.instancemanager.GrandBossManager;
|
import org.l2jmobius.gameserver.instancemanager.GrandBossManager;
|
||||||
import org.l2jmobius.gameserver.instancemanager.events.CTF;
|
|
||||||
import org.l2jmobius.gameserver.instancemanager.events.DM;
|
|
||||||
import org.l2jmobius.gameserver.instancemanager.events.TvT;
|
|
||||||
import org.l2jmobius.gameserver.instancemanager.events.VIP;
|
|
||||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.MagicSkillUse;
|
import org.l2jmobius.gameserver.network.serverpackets.MagicSkillUse;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.SetupGauge;
|
import org.l2jmobius.gameserver.network.serverpackets.SetupGauge;
|
||||||
@ -51,31 +47,10 @@ public class Escape implements IUserCommandHandler
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check to see if the current player is in TVT Event.
|
// Check to see if the current player is in an event.
|
||||||
if (player._inEventTvT && TvT.isStarted())
|
if (player.isOnCustomEvent())
|
||||||
{
|
{
|
||||||
player.sendMessage("You may not use an escape skill in TvT.");
|
player.sendMessage("You may not use an escape skill in an event.");
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check to see if the current player is in CTF Event.
|
|
||||||
if (player._inEventCTF && CTF.isStarted())
|
|
||||||
{
|
|
||||||
player.sendMessage("You may not use an escape skill in CTF.");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check to see if the current player is in DM Event.
|
|
||||||
if (player._inEventDM && DM.hasStarted())
|
|
||||||
{
|
|
||||||
player.sendMessage("You may not use an escape skill in DM.");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check to see if the current player is in Vip Event.
|
|
||||||
if (player._inEventVIP && VIP._started)
|
|
||||||
{
|
|
||||||
player.sendMessage("You may not use an escape skill in VIP.");
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -93,13 +68,6 @@ public class Escape implements IUserCommandHandler
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check to see if the current player is in fun event.
|
|
||||||
if (player.isInFunEvent())
|
|
||||||
{
|
|
||||||
player.sendMessage("You may not escape from an event.");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check to see if the current player is in Observer Mode.
|
// Check to see if the current player is in Observer Mode.
|
||||||
if (player.inObserverMode())
|
if (player.inObserverMode())
|
||||||
{
|
{
|
||||||
|
@ -57,9 +57,9 @@ public class OfflineShop implements IUserCommandHandler
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (player.isInFunEvent() && !player.isGM())
|
if (player.isOnCustomEvent())
|
||||||
{
|
{
|
||||||
player.sendMessage("You cannot Logout while in registered in an Event.");
|
player.sendMessage("You cannot logout while registered in an event.");
|
||||||
player.sendPacket(ActionFailed.STATIC_PACKET);
|
player.sendPacket(ActionFailed.STATIC_PACKET);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -105,12 +105,6 @@ public class OfflineShop implements IUserCommandHandler
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (player.atEvent)
|
|
||||||
{
|
|
||||||
player.sendPacket(SystemMessage.sendString("A superior power doesn't allow you to leave the event."));
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (player.isInOlympiadMode() || Olympiad.getInstance().isRegistered(player))
|
if (player.isInOlympiadMode() || Olympiad.getInstance().isRegistered(player))
|
||||||
{
|
{
|
||||||
player.sendMessage("You can't Logout in Olympiad mode.");
|
player.sendMessage("You can't Logout in Olympiad mode.");
|
||||||
|
@ -1,174 +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 org.l2jmobius.gameserver.handler.voicedcommandhandlers;
|
|
||||||
|
|
||||||
import org.l2jmobius.gameserver.data.ItemTable;
|
|
||||||
import org.l2jmobius.gameserver.handler.IVoicedCommandHandler;
|
|
||||||
import org.l2jmobius.gameserver.instancemanager.events.CTF;
|
|
||||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
|
||||||
|
|
||||||
public class CTFCmd implements IVoicedCommandHandler
|
|
||||||
{
|
|
||||||
private static final String[] VOICED_COMMANDS =
|
|
||||||
{
|
|
||||||
"ctfjoin",
|
|
||||||
"ctfleave",
|
|
||||||
"ctfinfo"
|
|
||||||
};
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean useVoicedCommand(String command, PlayerInstance activeChar, String target)
|
|
||||||
{
|
|
||||||
if (command.startsWith("ctfjoin"))
|
|
||||||
{
|
|
||||||
JoinCTF(activeChar);
|
|
||||||
}
|
|
||||||
else if (command.startsWith("ctfleave"))
|
|
||||||
{
|
|
||||||
LeaveCTF(activeChar);
|
|
||||||
}
|
|
||||||
|
|
||||||
else if (command.startsWith("ctfinfo"))
|
|
||||||
{
|
|
||||||
CTFinfo(activeChar);
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String[] getVoicedCommandList()
|
|
||||||
{
|
|
||||||
return VOICED_COMMANDS;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean JoinCTF(PlayerInstance activeChar)
|
|
||||||
{
|
|
||||||
if (activeChar == null)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!CTF.isJoining())
|
|
||||||
{
|
|
||||||
activeChar.sendMessage("There is no CTF Event in progress.");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
else if (CTF.isJoining() && activeChar._inEventCTF)
|
|
||||||
{
|
|
||||||
activeChar.sendMessage("You are already registered.");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
else if (activeChar.isInOlympiadMode())
|
|
||||||
{
|
|
||||||
activeChar.sendMessage("You are not allowed to participate to the event because you are in Olympiad.");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
else if (activeChar.getLevel() < CTF.getMinLevel())
|
|
||||||
{
|
|
||||||
activeChar.sendMessage("You are not allowed to participate to the event because your level is too low.");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
else if (activeChar.getLevel() > CTF.getMaxLevel())
|
|
||||||
{
|
|
||||||
activeChar.sendMessage("You are not allowed to participate to the event because your level is too high.");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
else if (activeChar.getKarma() > 0)
|
|
||||||
{
|
|
||||||
activeChar.sendMessage("You are not allowed to participate to the event because you have Karma.");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
else if (CTF.isTeleport() || CTF.isStarted())
|
|
||||||
{
|
|
||||||
activeChar.sendMessage("CTF Event registration period is over. You can't register now.");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
activeChar.sendMessage("Your participation in the CTF event has been approved.");
|
|
||||||
CTF.addPlayer(activeChar, "");
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean LeaveCTF(PlayerInstance activeChar)
|
|
||||||
{
|
|
||||||
if (activeChar == null)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!CTF.isJoining())
|
|
||||||
{
|
|
||||||
activeChar.sendMessage("There is no CTF Event in progress.");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
else if ((CTF.isTeleport() || CTF.isStarted()) && activeChar._inEventCTF)
|
|
||||||
{
|
|
||||||
activeChar.sendMessage("You can not leave now because CTF event has started.");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
else if (CTF.isJoining() && !activeChar._inEventCTF)
|
|
||||||
{
|
|
||||||
activeChar.sendMessage("You aren't registered in the CTF Event.");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
CTF.removePlayer(activeChar);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean CTFinfo(PlayerInstance activeChar)
|
|
||||||
{
|
|
||||||
if (activeChar == null)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!CTF.isJoining())
|
|
||||||
{
|
|
||||||
activeChar.sendMessage("There is no CTF Event in progress.");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
else if (CTF.isTeleport() || CTF.isStarted())
|
|
||||||
{
|
|
||||||
activeChar.sendMessage("I can't provide you this info. Command available only in joining period.");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (CTF._playersShuffle.size() == 1)
|
|
||||||
{
|
|
||||||
activeChar.sendMessage("There is " + CTF._playersShuffle.size() + " player participating in this event.");
|
|
||||||
activeChar.sendMessage("Reward: " + CTF.getRewardAmount() + " " + ItemTable.getInstance().getTemplate(CTF.getRewardId()).getName() + " !");
|
|
||||||
activeChar.sendMessage("Player Min lvl: " + CTF.getMinLevel() + ".");
|
|
||||||
activeChar.sendMessage("Player Max lvl: " + CTF.getMaxLevel() + ".");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
activeChar.sendMessage("There are " + CTF._playersShuffle.size() + " players participating in this event.");
|
|
||||||
activeChar.sendMessage("Reward: " + CTF.getRewardAmount() + " " + ItemTable.getInstance().getTemplate(CTF.getRewardId()).getName() + " !");
|
|
||||||
activeChar.sendMessage("Player Min lvl: " + CTF.getMinLevel() + ".");
|
|
||||||
activeChar.sendMessage("Player Max lvl: " + CTF.getMaxLevel() + ".");
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,174 +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 org.l2jmobius.gameserver.handler.voicedcommandhandlers;
|
|
||||||
|
|
||||||
import org.l2jmobius.gameserver.data.ItemTable;
|
|
||||||
import org.l2jmobius.gameserver.handler.IVoicedCommandHandler;
|
|
||||||
import org.l2jmobius.gameserver.instancemanager.events.DM;
|
|
||||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
|
||||||
|
|
||||||
public class DMCmd implements IVoicedCommandHandler
|
|
||||||
{
|
|
||||||
private static final String[] VOICED_COMMANDS =
|
|
||||||
{
|
|
||||||
"dmjoin",
|
|
||||||
"dmleave",
|
|
||||||
"dminfo"
|
|
||||||
};
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean useVoicedCommand(String command, PlayerInstance activeChar, String target)
|
|
||||||
{
|
|
||||||
if (command.startsWith("dmjoin"))
|
|
||||||
{
|
|
||||||
JoinDM(activeChar);
|
|
||||||
}
|
|
||||||
else if (command.startsWith("dmleave"))
|
|
||||||
{
|
|
||||||
LeaveDM(activeChar);
|
|
||||||
}
|
|
||||||
|
|
||||||
else if (command.startsWith("dminfo"))
|
|
||||||
{
|
|
||||||
DMinfo(activeChar);
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String[] getVoicedCommandList()
|
|
||||||
{
|
|
||||||
return VOICED_COMMANDS;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean JoinDM(PlayerInstance activeChar)
|
|
||||||
{
|
|
||||||
if (activeChar == null)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!DM.isJoining())
|
|
||||||
{
|
|
||||||
activeChar.sendMessage("There is no DeathMatch Event in progress.");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
else if (DM.isJoining() && activeChar._inEventDM)
|
|
||||||
{
|
|
||||||
activeChar.sendMessage("You are already registered.");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
else if (activeChar.isInOlympiadMode())
|
|
||||||
{
|
|
||||||
activeChar.sendMessage("You are not allowed to participate to the event because you are in Olympiad.");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
else if (activeChar.getLevel() < DM.getMinLevel())
|
|
||||||
{
|
|
||||||
activeChar.sendMessage("You are not allowed to participate to the event because your level is too low.");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
else if (activeChar.getLevel() > DM.getMaxLevel())
|
|
||||||
{
|
|
||||||
activeChar.sendMessage("You are not allowed to participate to the event because your level is too high.");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
else if (activeChar.getKarma() > 0)
|
|
||||||
{
|
|
||||||
activeChar.sendMessage("You are not allowed to participate to the event because you have Karma.");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
else if (DM.isTeleport() || DM.hasStarted())
|
|
||||||
{
|
|
||||||
activeChar.sendMessage("DeathMatch Event registration period is over. You can't register now.");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
activeChar.sendMessage("Your participation in the DeathMatch event has been approved.");
|
|
||||||
DM.addPlayer(activeChar);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean LeaveDM(PlayerInstance activeChar)
|
|
||||||
{
|
|
||||||
if (activeChar == null)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!DM.isJoining())
|
|
||||||
{
|
|
||||||
activeChar.sendMessage("There is no DeathMatch Event in progress.");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
else if ((DM.isTeleport() || DM.hasStarted()) && activeChar._inEventDM)
|
|
||||||
{
|
|
||||||
activeChar.sendMessage("You can not leave now because DeathMatch event has started.");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
else if (DM.isJoining() && !activeChar._inEventDM)
|
|
||||||
{
|
|
||||||
activeChar.sendMessage("You aren't registered in the DeathMatch Event.");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
DM.removePlayer(activeChar);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean DMinfo(PlayerInstance activeChar)
|
|
||||||
{
|
|
||||||
if (activeChar == null)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!DM.isJoining())
|
|
||||||
{
|
|
||||||
activeChar.sendMessage("There is no DeathMatch Event in progress.");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
else if (DM.isTeleport() || DM.hasStarted())
|
|
||||||
{
|
|
||||||
activeChar.sendMessage("I can't provide you this info. Command available only in joining period.");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (DM._players.size() == 1)
|
|
||||||
{
|
|
||||||
activeChar.sendMessage("There is " + DM._players.size() + " player participating in this event.");
|
|
||||||
activeChar.sendMessage("Reward: " + DM.getRewardAmount() + " " + ItemTable.getInstance().getTemplate(DM.getRewardId()).getName() + " !");
|
|
||||||
activeChar.sendMessage("Player Min lvl: " + DM.getMinLevel() + ".");
|
|
||||||
activeChar.sendMessage("Player Max lvl: " + DM.getMaxLevel() + ".");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
activeChar.sendMessage("There are " + DM._players.size() + " players participating in this event.");
|
|
||||||
activeChar.sendMessage("Reward: " + DM.getRewardAmount() + " " + ItemTable.getInstance().getTemplate(DM.getRewardId()).getName() + " !");
|
|
||||||
activeChar.sendMessage("Player Min lvl: " + DM.getMinLevel() + ".");
|
|
||||||
activeChar.sendMessage("Player Max lvl: " + DM.getMaxLevel() + ".");
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,154 +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 org.l2jmobius.gameserver.handler.voicedcommandhandlers;
|
|
||||||
|
|
||||||
import org.l2jmobius.Config;
|
|
||||||
import org.l2jmobius.commons.threads.ThreadPool;
|
|
||||||
import org.l2jmobius.gameserver.handler.IVoicedCommandHandler;
|
|
||||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
|
||||||
import org.l2jmobius.gameserver.model.olympiad.Olympiad;
|
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.SetupGauge;
|
|
||||||
|
|
||||||
public class FarmPvpCmd implements IVoicedCommandHandler
|
|
||||||
{
|
|
||||||
private static final String[] VOICED_COMMANDS =
|
|
||||||
{
|
|
||||||
"farm1",
|
|
||||||
"farm2",
|
|
||||||
"pvp1",
|
|
||||||
"pvp2"
|
|
||||||
};
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean useVoicedCommand(String command, PlayerInstance activeChar, String target)
|
|
||||||
{
|
|
||||||
int placex;
|
|
||||||
int placey;
|
|
||||||
int placez;
|
|
||||||
String message;
|
|
||||||
if (command.equalsIgnoreCase("farm1") && Config.ALLOW_FARM1_COMMAND)
|
|
||||||
{
|
|
||||||
placex = Config.FARM1_X;
|
|
||||||
placey = Config.FARM1_Y;
|
|
||||||
placez = Config.FARM1_Z;
|
|
||||||
message = Config.FARM1_CUSTOM_MESSAGE;
|
|
||||||
}
|
|
||||||
else if (command.equalsIgnoreCase("farm2") && Config.ALLOW_FARM2_COMMAND)
|
|
||||||
{
|
|
||||||
placex = Config.FARM2_X;
|
|
||||||
placey = Config.FARM2_Y;
|
|
||||||
placez = Config.FARM2_Z;
|
|
||||||
message = Config.FARM2_CUSTOM_MESSAGE;
|
|
||||||
}
|
|
||||||
else if (command.equalsIgnoreCase("pvp1") && Config.ALLOW_PVP1_COMMAND)
|
|
||||||
{
|
|
||||||
placex = Config.PVP1_X;
|
|
||||||
placey = Config.PVP1_Y;
|
|
||||||
placez = Config.PVP1_Z;
|
|
||||||
message = Config.PVP1_CUSTOM_MESSAGE;
|
|
||||||
}
|
|
||||||
else if (command.equalsIgnoreCase("pvp2") && Config.ALLOW_PVP2_COMMAND)
|
|
||||||
{
|
|
||||||
placex = Config.PVP2_X;
|
|
||||||
placey = Config.PVP2_Y;
|
|
||||||
placez = Config.PVP2_Z;
|
|
||||||
message = Config.PVP2_CUSTOM_MESSAGE;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (activeChar.isInJail())
|
|
||||||
{
|
|
||||||
activeChar.sendMessage("Sorry, you are in Jail!");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
else if (activeChar.isInOlympiadMode())
|
|
||||||
{
|
|
||||||
activeChar.sendMessage("Sorry, you are in the Olympiad now.");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
else if (activeChar.isInFunEvent())
|
|
||||||
{
|
|
||||||
activeChar.sendMessage("Sorry, you are in an event.");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
else if (activeChar.inObserverMode())
|
|
||||||
{
|
|
||||||
activeChar.sendMessage("Sorry, you are in the observation mode.");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
else if (activeChar.isFestivalParticipant())
|
|
||||||
{
|
|
||||||
activeChar.sendMessage("Sorry, you are in a festival.");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
else if (!Config.ALT_GAME_KARMA_PLAYER_CAN_USE_GK && (activeChar.getKarma() > 0))
|
|
||||||
{
|
|
||||||
activeChar.sendMessage("Sorry, you are PK");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
else if (Olympiad.getInstance().isRegistered(activeChar))
|
|
||||||
{
|
|
||||||
activeChar.sendMessage("Sorry, you can't use this command while registered in Olympiad");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
activeChar.sendPacket(new SetupGauge(SetupGauge.BLUE, 15000));
|
|
||||||
activeChar.setImmobilized(true);
|
|
||||||
|
|
||||||
ThreadPool.schedule(new teleportTask(activeChar, placex, placey, placez, message), 15000);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String[] getVoicedCommandList()
|
|
||||||
{
|
|
||||||
return VOICED_COMMANDS;
|
|
||||||
}
|
|
||||||
|
|
||||||
class teleportTask implements Runnable
|
|
||||||
{
|
|
||||||
private final PlayerInstance _player;
|
|
||||||
private final int _x;
|
|
||||||
private final int _y;
|
|
||||||
private final int _z;
|
|
||||||
private final String _message;
|
|
||||||
|
|
||||||
teleportTask(PlayerInstance activeChar, int x, int y, int z, String message)
|
|
||||||
{
|
|
||||||
_player = activeChar;
|
|
||||||
_x = x;
|
|
||||||
_y = y;
|
|
||||||
_z = z;
|
|
||||||
_message = message;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void run()
|
|
||||||
{
|
|
||||||
if (_player == null)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
_player.teleToLocation(_x, _y, _z);
|
|
||||||
_player.sendMessage(_message);
|
|
||||||
_player.setImmobilized(false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -58,9 +58,9 @@ public class OfflineShop implements IVoicedCommandHandler
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (player.isInFunEvent() && !player.isGM())
|
if (player.isOnCustomEvent())
|
||||||
{
|
{
|
||||||
player.sendMessage("You cannot Logout while in registered in an Event.");
|
player.sendMessage("You cannot Logout while registered in an event.");
|
||||||
player.sendPacket(ActionFailed.STATIC_PACKET);
|
player.sendPacket(ActionFailed.STATIC_PACKET);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -106,12 +106,6 @@ public class OfflineShop implements IVoicedCommandHandler
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (player.atEvent)
|
|
||||||
{
|
|
||||||
player.sendPacket(SystemMessage.sendString("A superior power doesn't allow you to leave the event."));
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (player.isInOlympiadMode() || Olympiad.getInstance().isRegistered(player))
|
if (player.isInOlympiadMode() || Olympiad.getInstance().isRegistered(player))
|
||||||
{
|
{
|
||||||
player.sendMessage("You can't Logout in Olympiad mode.");
|
player.sendMessage("You can't Logout in Olympiad mode.");
|
||||||
|
@ -139,12 +139,10 @@ public class StatsCmd implements IVoicedCommandHandler
|
|||||||
final StringBuilder replyMSG = new StringBuilder("<html><body>");
|
final StringBuilder replyMSG = new StringBuilder("<html><body>");
|
||||||
replyMSG.append("<center><font color=\"LEVEL\">[ L2J EVENT ENGINE ]</font></center><br>");
|
replyMSG.append("<center><font color=\"LEVEL\">[ L2J EVENT ENGINE ]</font></center><br>");
|
||||||
replyMSG.append("<br>Statistics for player <font color=\"LEVEL\">" + targetp.getName() + "</font><br>");
|
replyMSG.append("<br>Statistics for player <font color=\"LEVEL\">" + targetp.getName() + "</font><br>");
|
||||||
replyMSG.append("Total kills <font color=\"FF0000\">" + targetp.kills.size() + "</font><br>");
|
replyMSG.append("Total kills <font color=\"FF0000\">" + (targetp.getPvpKills() + targetp.getPkKills()) + "</font><br>");
|
||||||
replyMSG.append("<br>Detailed list:<br>");
|
replyMSG.append("<br>Detailed list:<br>");
|
||||||
for (String kill : targetp.kills)
|
replyMSG.append("<font color=\"FF0000\">PvP Kills: " + targetp.getPvpKills() + "</font><br>");
|
||||||
{
|
replyMSG.append("<font color=\"FF0000\">PK Kills: " + targetp.getPkKills() + "</font><br>");
|
||||||
replyMSG.append("<font color=\"FF0000\">" + kill + "</font><br>");
|
|
||||||
}
|
|
||||||
replyMSG.append("</body></html>");
|
replyMSG.append("</body></html>");
|
||||||
adminReply.setHtml(replyMSG.toString());
|
adminReply.setHtml(replyMSG.toString());
|
||||||
activeChar.sendPacket(adminReply);
|
activeChar.sendPacket(adminReply);
|
||||||
|
@ -1,174 +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 org.l2jmobius.gameserver.handler.voicedcommandhandlers;
|
|
||||||
|
|
||||||
import org.l2jmobius.gameserver.data.ItemTable;
|
|
||||||
import org.l2jmobius.gameserver.handler.IVoicedCommandHandler;
|
|
||||||
import org.l2jmobius.gameserver.instancemanager.events.TvT;
|
|
||||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
|
||||||
|
|
||||||
public class TvTCmd implements IVoicedCommandHandler
|
|
||||||
{
|
|
||||||
private static final String[] VOICED_COMMANDS =
|
|
||||||
{
|
|
||||||
"tvtjoin",
|
|
||||||
"tvtleave",
|
|
||||||
"tvtinfo"
|
|
||||||
};
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean useVoicedCommand(String command, PlayerInstance activeChar, String target)
|
|
||||||
{
|
|
||||||
if (command.startsWith("tvtjoin"))
|
|
||||||
{
|
|
||||||
JoinTvT(activeChar);
|
|
||||||
}
|
|
||||||
else if (command.startsWith("tvtleave"))
|
|
||||||
{
|
|
||||||
LeaveTvT(activeChar);
|
|
||||||
}
|
|
||||||
|
|
||||||
else if (command.startsWith("tvtinfo"))
|
|
||||||
{
|
|
||||||
TvTinfo(activeChar);
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String[] getVoicedCommandList()
|
|
||||||
{
|
|
||||||
return VOICED_COMMANDS;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean JoinTvT(PlayerInstance activeChar)
|
|
||||||
{
|
|
||||||
if (activeChar == null)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!TvT.isJoining())
|
|
||||||
{
|
|
||||||
activeChar.sendMessage("There is no TvT Event in progress.");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
else if (TvT.isJoining() && activeChar._inEventTvT)
|
|
||||||
{
|
|
||||||
activeChar.sendMessage("You are already registered.");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
else if (activeChar.isInOlympiadMode())
|
|
||||||
{
|
|
||||||
activeChar.sendMessage("You are not allowed to participate to the event because you are in Olympiad.");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
else if (activeChar.getLevel() < TvT.getMinLevel())
|
|
||||||
{
|
|
||||||
activeChar.sendMessage("You are not allowed to participate to the event because your level is too low.");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
else if (activeChar.getLevel() > TvT.getMaxLevel())
|
|
||||||
{
|
|
||||||
activeChar.sendMessage("You are not allowed to participate to the event because your level is too high.");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
else if (activeChar.getKarma() > 0)
|
|
||||||
{
|
|
||||||
activeChar.sendMessage("You are not allowed to participate to the event because you have Karma.");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
else if (TvT.isTeleport() || TvT.isStarted())
|
|
||||||
{
|
|
||||||
activeChar.sendMessage("TvT Event registration period is over. You can't register now.");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
activeChar.sendMessage("Your participation in the TvT event has been approved.");
|
|
||||||
TvT.addPlayer(activeChar, "");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean LeaveTvT(PlayerInstance activeChar)
|
|
||||||
{
|
|
||||||
if (activeChar == null)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!TvT.isJoining())
|
|
||||||
{
|
|
||||||
activeChar.sendMessage("There is no TvT Event in progress.");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
else if ((TvT.isTeleport() || TvT.isStarted()) && activeChar._inEventTvT)
|
|
||||||
{
|
|
||||||
activeChar.sendMessage("You can not leave now because TvT event has started.");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
else if (TvT.isJoining() && !activeChar._inEventTvT)
|
|
||||||
{
|
|
||||||
activeChar.sendMessage("You aren't registered in the TvT Event.");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
TvT.removePlayer(activeChar);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean TvTinfo(PlayerInstance activeChar)
|
|
||||||
{
|
|
||||||
if (activeChar == null)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!TvT.isJoining())
|
|
||||||
{
|
|
||||||
activeChar.sendMessage("There is no TvT Event in progress.");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
else if (TvT.isTeleport() || TvT.isStarted())
|
|
||||||
{
|
|
||||||
activeChar.sendMessage("I can't provide you this info. Command available only in joining period.");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (TvT._playersShuffle.size() == 1)
|
|
||||||
{
|
|
||||||
activeChar.sendMessage("There is " + TvT._playersShuffle.size() + " player participating in this event.");
|
|
||||||
activeChar.sendMessage("Reward: " + TvT.getRewardAmount() + " " + ItemTable.getInstance().getTemplate(TvT.getRewardId()).getName() + " !");
|
|
||||||
activeChar.sendMessage("Player Min lvl: " + TvT.getMinLevel() + ".");
|
|
||||||
activeChar.sendMessage("Player Max lvl: " + TvT.getMaxLevel() + ".");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
activeChar.sendMessage("There are " + TvT._playersShuffle.size() + " players participating in this event.");
|
|
||||||
activeChar.sendMessage("Reward: " + TvT.getRewardAmount() + " " + ItemTable.getInstance().getTemplate(TvT.getRewardId()).getName() + " !");
|
|
||||||
activeChar.sendMessage("Player Min lvl: " + TvT.getMinLevel() + ".");
|
|
||||||
activeChar.sendMessage("Player Max lvl: " + TvT.getMaxLevel() + ".");
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -26,10 +26,6 @@ import org.l2jmobius.gameserver.handler.IVoicedCommandHandler;
|
|||||||
import org.l2jmobius.gameserver.instancemanager.CastleManager;
|
import org.l2jmobius.gameserver.instancemanager.CastleManager;
|
||||||
import org.l2jmobius.gameserver.instancemanager.CoupleManager;
|
import org.l2jmobius.gameserver.instancemanager.CoupleManager;
|
||||||
import org.l2jmobius.gameserver.instancemanager.GrandBossManager;
|
import org.l2jmobius.gameserver.instancemanager.GrandBossManager;
|
||||||
import org.l2jmobius.gameserver.instancemanager.events.CTF;
|
|
||||||
import org.l2jmobius.gameserver.instancemanager.events.DM;
|
|
||||||
import org.l2jmobius.gameserver.instancemanager.events.TvT;
|
|
||||||
import org.l2jmobius.gameserver.instancemanager.events.VIP;
|
|
||||||
import org.l2jmobius.gameserver.model.Skill;
|
import org.l2jmobius.gameserver.model.Skill;
|
||||||
import org.l2jmobius.gameserver.model.World;
|
import org.l2jmobius.gameserver.model.World;
|
||||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||||
@ -56,9 +52,9 @@ public class Wedding implements IVoicedCommandHandler
|
|||||||
@Override
|
@Override
|
||||||
public boolean useVoicedCommand(String command, PlayerInstance activeChar, String target)
|
public boolean useVoicedCommand(String command, PlayerInstance activeChar, String target)
|
||||||
{
|
{
|
||||||
if (activeChar.isInFunEvent() || activeChar.isInOlympiadMode())
|
if (activeChar.isRegisteredOnCustomEvent() || activeChar.isInOlympiadMode())
|
||||||
{
|
{
|
||||||
activeChar.sendMessage("Sorry, you are in an event now.");
|
activeChar.sendMessage("Sorry, you have registered in an event.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -230,10 +226,10 @@ public class Wedding implements IVoicedCommandHandler
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check to see if the current player is in fun event.
|
// Check to see if the current player is in an event.
|
||||||
if (activeChar.isInFunEvent())
|
if (activeChar.isOnCustomEvent())
|
||||||
{
|
{
|
||||||
activeChar.sendMessage("You're partener is in a Fun Event.");
|
activeChar.sendMessage("You are in an event.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -267,7 +263,7 @@ public class Wedding implements IVoicedCommandHandler
|
|||||||
activeChar.sendMessage("Your partner is in the Olympiad now.");
|
activeChar.sendMessage("Your partner is in the Olympiad now.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else if (partner.atEvent)
|
else if (partner.isOnCustomEvent())
|
||||||
{
|
{
|
||||||
activeChar.sendMessage("Your partner is in an event.");
|
activeChar.sendMessage("Your partner is in an event.");
|
||||||
return false;
|
return false;
|
||||||
@ -307,31 +303,6 @@ public class Wedding implements IVoicedCommandHandler
|
|||||||
activeChar.sendMessage("You are in the Olympiad now.");
|
activeChar.sendMessage("You are in the Olympiad now.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else if (activeChar.atEvent)
|
|
||||||
{
|
|
||||||
activeChar.sendMessage("You are in an event.");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (activeChar._inEventTvT && TvT.isStarted())
|
|
||||||
{
|
|
||||||
activeChar.sendMessage("You may not use go to love in TvT.");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (activeChar._inEventCTF && CTF.isStarted())
|
|
||||||
{
|
|
||||||
activeChar.sendMessage("You may not use go to love in CTF.");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (activeChar._inEventDM && DM.hasStarted())
|
|
||||||
{
|
|
||||||
activeChar.sendMessage("You may not use go to love in DM.");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (activeChar._inEventVIP && VIP._started)
|
|
||||||
{
|
|
||||||
activeChar.sendMessage("You may not use go to love in VIP.");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
else if (activeChar.inObserverMode())
|
else if (activeChar.inObserverMode())
|
||||||
{
|
{
|
||||||
activeChar.sendMessage("You are in the observation.");
|
activeChar.sendMessage("You are in the observation.");
|
||||||
|
@ -156,7 +156,7 @@ public class PrecautionaryRestartManager
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (player._inEvent || player.atEvent)
|
if (player.isOnCustomEvent())
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,187 +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 org.l2jmobius.gameserver.instancemanager.events;
|
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.io.FileInputStream;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.InputStream;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Properties;
|
|
||||||
import java.util.logging.Logger;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Shyla
|
|
||||||
*/
|
|
||||||
public class EventManager
|
|
||||||
{
|
|
||||||
protected static final Logger LOGGER = Logger.getLogger(EventManager.class.getName());
|
|
||||||
|
|
||||||
private static final String EVENT_MANAGER_CONFIGURATION_FILE = "./config/events/EventManager.ini";
|
|
||||||
|
|
||||||
public static boolean TVT_EVENT_ENABLED;
|
|
||||||
public static List<String> TVT_TIMES_LIST;
|
|
||||||
|
|
||||||
public static boolean CTF_EVENT_ENABLED;
|
|
||||||
public static List<String> CTF_TIMES_LIST;
|
|
||||||
|
|
||||||
public static boolean DM_EVENT_ENABLED;
|
|
||||||
public static List<String> DM_TIMES_LIST;
|
|
||||||
|
|
||||||
private static EventManager instance = null;
|
|
||||||
|
|
||||||
private EventManager()
|
|
||||||
{
|
|
||||||
loadConfiguration();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static EventManager getInstance()
|
|
||||||
{
|
|
||||||
if (instance == null)
|
|
||||||
{
|
|
||||||
instance = new EventManager();
|
|
||||||
}
|
|
||||||
return instance;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void loadConfiguration()
|
|
||||||
{
|
|
||||||
InputStream is = null;
|
|
||||||
try
|
|
||||||
{
|
|
||||||
final Properties eventSettings = new Properties();
|
|
||||||
is = new FileInputStream(new File(EVENT_MANAGER_CONFIGURATION_FILE));
|
|
||||||
eventSettings.load(is);
|
|
||||||
|
|
||||||
TVT_EVENT_ENABLED = Boolean.parseBoolean(eventSettings.getProperty("TVTEventEnabled", "false"));
|
|
||||||
TVT_TIMES_LIST = new ArrayList<>();
|
|
||||||
String[] propertySplit;
|
|
||||||
propertySplit = eventSettings.getProperty("TVTStartTime", "").split(";");
|
|
||||||
for (String time : propertySplit)
|
|
||||||
{
|
|
||||||
TVT_TIMES_LIST.add(time);
|
|
||||||
}
|
|
||||||
|
|
||||||
CTF_EVENT_ENABLED = Boolean.parseBoolean(eventSettings.getProperty("CTFEventEnabled", "false"));
|
|
||||||
CTF_TIMES_LIST = new ArrayList<>();
|
|
||||||
propertySplit = eventSettings.getProperty("CTFStartTime", "").split(";");
|
|
||||||
for (String time : propertySplit)
|
|
||||||
{
|
|
||||||
CTF_TIMES_LIST.add(time);
|
|
||||||
}
|
|
||||||
|
|
||||||
DM_EVENT_ENABLED = Boolean.parseBoolean(eventSettings.getProperty("DMEventEnabled", "false"));
|
|
||||||
DM_TIMES_LIST = new ArrayList<>();
|
|
||||||
propertySplit = eventSettings.getProperty("DMStartTime", "").split(";");
|
|
||||||
for (String time : propertySplit)
|
|
||||||
{
|
|
||||||
DM_TIMES_LIST.add(time);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
LOGGER.warning(e.toString());
|
|
||||||
}
|
|
||||||
finally
|
|
||||||
{
|
|
||||||
if (is != null)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
is.close();
|
|
||||||
}
|
|
||||||
catch (IOException e)
|
|
||||||
{
|
|
||||||
LOGGER.warning(e.toString());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void startEventRegistration()
|
|
||||||
{
|
|
||||||
if (TVT_EVENT_ENABLED)
|
|
||||||
{
|
|
||||||
registerTvT();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (CTF_EVENT_ENABLED)
|
|
||||||
{
|
|
||||||
registerCTF();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (DM_EVENT_ENABLED)
|
|
||||||
{
|
|
||||||
registerDM();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void registerTvT()
|
|
||||||
{
|
|
||||||
TvT.loadData();
|
|
||||||
if (!TvT.checkStartJoinOk())
|
|
||||||
{
|
|
||||||
LOGGER.warning("registerTvT: TvT Event is not setted Properly");
|
|
||||||
}
|
|
||||||
|
|
||||||
EventsGlobalTask.getInstance().clearEventTasksByEventName(TvT.getEventName());
|
|
||||||
|
|
||||||
for (String time : TVT_TIMES_LIST)
|
|
||||||
{
|
|
||||||
final TvT newInstance = TvT.getNewInstance();
|
|
||||||
newInstance.setEventStartTime(time);
|
|
||||||
EventsGlobalTask.getInstance().registerNewEventTask(newInstance);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void registerCTF()
|
|
||||||
{
|
|
||||||
CTF.loadData();
|
|
||||||
if (!CTF.checkStartJoinOk())
|
|
||||||
{
|
|
||||||
LOGGER.warning("registerCTF: CTF Event is not setted Properly");
|
|
||||||
}
|
|
||||||
|
|
||||||
EventsGlobalTask.getInstance().clearEventTasksByEventName(CTF.getEventName());
|
|
||||||
|
|
||||||
for (String time : CTF_TIMES_LIST)
|
|
||||||
{
|
|
||||||
final CTF newInstance = CTF.getNewInstance();
|
|
||||||
newInstance.setEventStartTime(time);
|
|
||||||
EventsGlobalTask.getInstance().registerNewEventTask(newInstance);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void registerDM()
|
|
||||||
{
|
|
||||||
DM.loadData();
|
|
||||||
if (!DM.checkStartJoinOk())
|
|
||||||
{
|
|
||||||
LOGGER.warning("registerDM: DM Event is not setted Properly");
|
|
||||||
}
|
|
||||||
|
|
||||||
EventsGlobalTask.getInstance().clearEventTasksByEventName(DM.getEventName());
|
|
||||||
|
|
||||||
for (String time : DM_TIMES_LIST)
|
|
||||||
{
|
|
||||||
final DM newInstance = DM.getNewInstance();
|
|
||||||
newInstance.setEventStartTime(time);
|
|
||||||
EventsGlobalTask.getInstance().registerNewEventTask(newInstance);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,358 +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 org.l2jmobius.gameserver.instancemanager.events;
|
|
||||||
|
|
||||||
import java.io.BufferedInputStream;
|
|
||||||
import java.io.BufferedReader;
|
|
||||||
import java.io.DataInputStream;
|
|
||||||
import java.io.FileInputStream;
|
|
||||||
import java.io.InputStreamReader;
|
|
||||||
import java.util.Iterator;
|
|
||||||
import java.util.LinkedList;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
|
||||||
import java.util.logging.Logger;
|
|
||||||
|
|
||||||
import org.l2jmobius.gameserver.data.sql.NpcTable;
|
|
||||||
import org.l2jmobius.gameserver.data.sql.SpawnTable;
|
|
||||||
import org.l2jmobius.gameserver.enums.ChatType;
|
|
||||||
import org.l2jmobius.gameserver.model.World;
|
|
||||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
|
||||||
import org.l2jmobius.gameserver.model.actor.templates.NpcTemplate;
|
|
||||||
import org.l2jmobius.gameserver.model.spawn.Spawn;
|
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.CreatureSay;
|
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.MagicSkillUse;
|
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
|
|
||||||
import org.l2jmobius.gameserver.util.EventData;
|
|
||||||
|
|
||||||
public class GameEvent
|
|
||||||
{
|
|
||||||
protected static final Logger LOGGER = Logger.getLogger(GameEvent.class.getName());
|
|
||||||
|
|
||||||
public static final Map<Integer, LinkedList<String>> players = new ConcurrentHashMap<>();
|
|
||||||
public static final Map<String, EventData> connectionLossData = new ConcurrentHashMap<>();
|
|
||||||
public static final Map<Integer, String> names = new ConcurrentHashMap<>();
|
|
||||||
public static final List<String> participatingPlayers = new LinkedList<>();
|
|
||||||
public static final List<String> npcs = new LinkedList<>();
|
|
||||||
public static String eventName = "";
|
|
||||||
public static int teamsNumber = 0;
|
|
||||||
public static boolean active = false;
|
|
||||||
public static int id = 12760;
|
|
||||||
|
|
||||||
public static int getTeamOfPlayer(String name)
|
|
||||||
{
|
|
||||||
for (int i = 1; i <= players.size(); i++)
|
|
||||||
{
|
|
||||||
final LinkedList<String> temp = players.get(i);
|
|
||||||
final Iterator<String> it = temp.iterator();
|
|
||||||
|
|
||||||
while (it.hasNext())
|
|
||||||
{
|
|
||||||
if (it.next().equals(name))
|
|
||||||
{
|
|
||||||
return i;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static String[] getTopNKillers(int n)
|
|
||||||
{
|
|
||||||
// this will return top N players sorted by kills, first element in the array will be the one with more kills
|
|
||||||
final String[] killers = new String[n];
|
|
||||||
String playerTemp = "";
|
|
||||||
int kills = 0;
|
|
||||||
|
|
||||||
final LinkedList<String> killersTemp = new LinkedList<>();
|
|
||||||
for (int k = 0; k < n; k++)
|
|
||||||
{
|
|
||||||
kills = 0;
|
|
||||||
for (int i = 1; i <= teamsNumber; i++)
|
|
||||||
{
|
|
||||||
final LinkedList<String> temp = players.get(i);
|
|
||||||
final Iterator<String> it = temp.iterator();
|
|
||||||
|
|
||||||
while (it.hasNext())
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
final PlayerInstance player = World.getInstance().getPlayer(it.next());
|
|
||||||
if (!killersTemp.contains(player.getName()) && (player.kills.size() > kills))
|
|
||||||
{
|
|
||||||
kills = player.kills.size();
|
|
||||||
playerTemp = player.getName();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
killersTemp.add(playerTemp);
|
|
||||||
}
|
|
||||||
|
|
||||||
for (int i = 0; i < n; i++)
|
|
||||||
{
|
|
||||||
kills = 0;
|
|
||||||
final Iterator<String> it = killersTemp.iterator();
|
|
||||||
|
|
||||||
while (it.hasNext())
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
final PlayerInstance player = World.getInstance().getPlayer(it.next());
|
|
||||||
if (player.kills.size() > kills)
|
|
||||||
{
|
|
||||||
kills = player.kills.size();
|
|
||||||
playerTemp = player.getName();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
killers[i] = playerTemp;
|
|
||||||
killersTemp.remove(playerTemp);
|
|
||||||
}
|
|
||||||
|
|
||||||
return killers;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void showEventHtml(PlayerInstance player, String objectid)
|
|
||||||
{
|
|
||||||
FileInputStream fis = null;
|
|
||||||
BufferedInputStream buff = null;
|
|
||||||
DataInputStream in = null;
|
|
||||||
InputStreamReader isr = null;
|
|
||||||
BufferedReader inbr = null;
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
final NpcHtmlMessage adminReply = new NpcHtmlMessage(5);
|
|
||||||
fis = new FileInputStream("data/events/" + eventName);
|
|
||||||
buff = new BufferedInputStream(fis);
|
|
||||||
in = new DataInputStream(buff);
|
|
||||||
isr = new InputStreamReader(in);
|
|
||||||
inbr = new BufferedReader(isr);
|
|
||||||
|
|
||||||
final StringBuilder replyMSG = new StringBuilder("<html><body>");
|
|
||||||
replyMSG.append("<center><font color=\"LEVEL\">" + eventName + "</font><font color=\"FF0000\"> bY " + inbr.readLine() + "</font></center><br>");
|
|
||||||
replyMSG.append("<br>" + inbr.readLine());
|
|
||||||
if (participatingPlayers.contains(player.getName()))
|
|
||||||
{
|
|
||||||
replyMSG.append("<br><center>You are already in the event players list !!</center></body></html>");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
replyMSG.append("<br><center><button value=\"Participate !! \" action=\"bypass -h npc_" + objectid + "_event_participate\" width=90 height=15 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></center></body></html>");
|
|
||||||
}
|
|
||||||
|
|
||||||
adminReply.setHtml(replyMSG.toString());
|
|
||||||
player.sendPacket(adminReply);
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
LOGGER.warning(e.getMessage());
|
|
||||||
}
|
|
||||||
finally
|
|
||||||
{
|
|
||||||
if (inbr != null)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
inbr.close();
|
|
||||||
}
|
|
||||||
catch (Exception e1)
|
|
||||||
{
|
|
||||||
LOGGER.warning(e1.toString());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isr != null)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
isr.close();
|
|
||||||
}
|
|
||||||
catch (Exception e1)
|
|
||||||
{
|
|
||||||
LOGGER.warning(e1.toString());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (in != null)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
in.close();
|
|
||||||
}
|
|
||||||
catch (Exception e1)
|
|
||||||
{
|
|
||||||
LOGGER.warning(e1.toString());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (buff != null)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
buff.close();
|
|
||||||
}
|
|
||||||
catch (Exception e1)
|
|
||||||
{
|
|
||||||
LOGGER.warning(e1.toString());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (fis != null)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
fis.close();
|
|
||||||
}
|
|
||||||
catch (Exception e1)
|
|
||||||
{
|
|
||||||
LOGGER.warning(e1.toString());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void spawn(PlayerInstance target, int npcid)
|
|
||||||
{
|
|
||||||
final NpcTemplate template1 = NpcTable.getInstance().getTemplate(npcid);
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
final Spawn spawn = new Spawn(template1);
|
|
||||||
spawn.setX(target.getX() + 50);
|
|
||||||
spawn.setY(target.getY() + 50);
|
|
||||||
spawn.setZ(target.getZ());
|
|
||||||
spawn.setAmount(1);
|
|
||||||
spawn.setHeading(target.getHeading());
|
|
||||||
spawn.setRespawnDelay(1);
|
|
||||||
|
|
||||||
SpawnTable.getInstance().addNewSpawn(spawn, false);
|
|
||||||
spawn.init();
|
|
||||||
spawn.getLastSpawn().getStatus().setCurrentHp(999999999);
|
|
||||||
spawn.getLastSpawn().setName("event inscriptor");
|
|
||||||
spawn.getLastSpawn().setTitle(eventName);
|
|
||||||
spawn.getLastSpawn().isEventMob = true;
|
|
||||||
spawn.getLastSpawn().isAggressive();
|
|
||||||
spawn.getLastSpawn().decayMe();
|
|
||||||
spawn.getLastSpawn().spawnMe(spawn.getLastSpawn().getX(), spawn.getLastSpawn().getY(), spawn.getLastSpawn().getZ());
|
|
||||||
spawn.getLastSpawn().broadcastPacket(new MagicSkillUse(spawn.getLastSpawn(), spawn.getLastSpawn(), 1034, 1, 1, 1));
|
|
||||||
npcs.add(String.valueOf(spawn.getLastSpawn().getObjectId()));
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
LOGGER.warning(e.getMessage());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void announceAllPlayers(String text)
|
|
||||||
{
|
|
||||||
final CreatureSay cs = new CreatureSay(0, ChatType.ANNOUNCEMENT, "", text);
|
|
||||||
for (PlayerInstance player : World.getInstance().getAllPlayers())
|
|
||||||
{
|
|
||||||
player.sendPacket(cs);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static boolean isOnEvent(PlayerInstance player)
|
|
||||||
{
|
|
||||||
for (int k = 0; k < teamsNumber; k++)
|
|
||||||
{
|
|
||||||
final Iterator<String> it = players.get(k + 1).iterator();
|
|
||||||
boolean temp = false;
|
|
||||||
|
|
||||||
while (it.hasNext())
|
|
||||||
{
|
|
||||||
temp = player.getName().equalsIgnoreCase(it.next());
|
|
||||||
if (temp)
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void inscribePlayer(PlayerInstance player)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
participatingPlayers.add(player.getName());
|
|
||||||
player.eventKarma = player.getKarma();
|
|
||||||
player.eventX = player.getX();
|
|
||||||
player.eventY = player.getY();
|
|
||||||
player.eventZ = player.getZ();
|
|
||||||
player.eventPkKills = player.getPkKills();
|
|
||||||
player.eventPvpKills = player.getPvpKills();
|
|
||||||
player.eventTitle = player.getTitle();
|
|
||||||
player.kills.clear();
|
|
||||||
player.atEvent = true;
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
LOGGER.warning("error when signing in the event:" + e.getMessage());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void restoreChar(PlayerInstance player)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
player.eventX = connectionLossData.get(player.getName()).eventX;
|
|
||||||
player.eventY = connectionLossData.get(player.getName()).eventY;
|
|
||||||
player.eventZ = connectionLossData.get(player.getName()).eventZ;
|
|
||||||
player.eventKarma = connectionLossData.get(player.getName()).eventKarma;
|
|
||||||
player.eventPvpKills = connectionLossData.get(player.getName()).eventPvpKills;
|
|
||||||
player.eventPkKills = connectionLossData.get(player.getName()).eventPkKills;
|
|
||||||
player.eventTitle = connectionLossData.get(player.getName()).eventTitle;
|
|
||||||
player.kills = connectionLossData.get(player.getName()).kills;
|
|
||||||
player.eventSitForced = connectionLossData.get(player.getName()).eventSitForced;
|
|
||||||
player.atEvent = true;
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void restoreAndTeleChar(PlayerInstance target)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
restoreChar(target);
|
|
||||||
target.setTitle(target.eventTitle);
|
|
||||||
target.setKarma(target.eventKarma);
|
|
||||||
target.setPvpKills(target.eventPvpKills);
|
|
||||||
target.setPkKills(target.eventPkKills);
|
|
||||||
target.teleToLocation(target.eventX, target.eventY, target.eventZ);
|
|
||||||
target.kills.clear();
|
|
||||||
target.eventSitForced = false;
|
|
||||||
target.atEvent = false;
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
File diff suppressed because it is too large
Load Diff
@ -1,903 +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 org.l2jmobius.gameserver.instancemanager.events;
|
|
||||||
|
|
||||||
import java.sql.Connection;
|
|
||||||
import java.sql.PreparedStatement;
|
|
||||||
import java.sql.ResultSet;
|
|
||||||
import java.sql.SQLException;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.logging.Logger;
|
|
||||||
|
|
||||||
import org.l2jmobius.commons.database.DatabaseFactory;
|
|
||||||
import org.l2jmobius.commons.threads.ThreadPool;
|
|
||||||
import org.l2jmobius.commons.util.Rnd;
|
|
||||||
import org.l2jmobius.gameserver.data.ItemTable;
|
|
||||||
import org.l2jmobius.gameserver.data.sql.AnnouncementsTable;
|
|
||||||
import org.l2jmobius.gameserver.data.sql.NpcTable;
|
|
||||||
import org.l2jmobius.gameserver.data.sql.SpawnTable;
|
|
||||||
import org.l2jmobius.gameserver.enums.Race;
|
|
||||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
|
||||||
import org.l2jmobius.gameserver.model.actor.templates.NpcTemplate;
|
|
||||||
import org.l2jmobius.gameserver.model.itemcontainer.PlayerInventory;
|
|
||||||
import org.l2jmobius.gameserver.model.items.Item;
|
|
||||||
import org.l2jmobius.gameserver.model.spawn.Spawn;
|
|
||||||
import org.l2jmobius.gameserver.network.SystemMessageId;
|
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.MagicSkillUse;
|
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
|
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.StatusUpdate;
|
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
|
|
||||||
|
|
||||||
public class VIP
|
|
||||||
{
|
|
||||||
private static final Logger LOGGER = Logger.getLogger(VIP.class.getName());
|
|
||||||
|
|
||||||
public static String _teamName = "";
|
|
||||||
public static String _joinArea = "";
|
|
||||||
public static int _time = 0;
|
|
||||||
public static int _winners = 0;
|
|
||||||
public static int _vipReward = 0;
|
|
||||||
public static int _vipRewardAmount = 0;
|
|
||||||
public static int _notVipReward = 0;
|
|
||||||
public static int _notVipRewardAmount = 0;
|
|
||||||
public static int _theVipReward = 0;
|
|
||||||
public static int _theVipRewardAmount = 0;
|
|
||||||
public static int _endNPC = 0;
|
|
||||||
public static int _joinNPC = 0;
|
|
||||||
public static int _delay = 0;
|
|
||||||
public static int _endX = 0;
|
|
||||||
public static int _endY = 0;
|
|
||||||
public static int _endZ = 0;
|
|
||||||
public static int _startX = 0;
|
|
||||||
public static int _startY = 0;
|
|
||||||
public static int _startZ = 0;
|
|
||||||
public static int _joinX = 0;
|
|
||||||
public static int _joinY = 0;
|
|
||||||
public static int _joinZ = 0;
|
|
||||||
public static int _team = 0;
|
|
||||||
public static boolean _started = false;
|
|
||||||
public static boolean _joining = false;
|
|
||||||
public static boolean _inProgress = true;
|
|
||||||
public static boolean _sitForced = false;
|
|
||||||
public static Spawn _endSpawn;
|
|
||||||
public static Spawn _joinSpawn;
|
|
||||||
public static List<PlayerInstance> _playersVIP = new ArrayList<>();
|
|
||||||
public static List<PlayerInstance> _playersNotVIP = new ArrayList<>();
|
|
||||||
|
|
||||||
public static void setTeam(String team, PlayerInstance player)
|
|
||||||
{
|
|
||||||
if (team.equalsIgnoreCase("Human"))
|
|
||||||
{
|
|
||||||
_team = 1;
|
|
||||||
_teamName = "Human";
|
|
||||||
}
|
|
||||||
else if (team.equalsIgnoreCase("Elf"))
|
|
||||||
{
|
|
||||||
_team = 2;
|
|
||||||
_teamName = "Elf";
|
|
||||||
}
|
|
||||||
else if (team.equalsIgnoreCase("Dark"))
|
|
||||||
{
|
|
||||||
_team = 3;
|
|
||||||
_teamName = "Dark Elf";
|
|
||||||
}
|
|
||||||
else if (team.equalsIgnoreCase("Orc"))
|
|
||||||
{
|
|
||||||
_team = 4;
|
|
||||||
_teamName = "Orc";
|
|
||||||
}
|
|
||||||
else if (team.equalsIgnoreCase("Dwarf"))
|
|
||||||
{
|
|
||||||
_team = 5;
|
|
||||||
_teamName = "Dwarf";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
player.sendMessage("Invalid Team Name: //vip_setteam <human/elf/dark/orc/dwarf>");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
setLoc();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void setRandomTeam(PlayerInstance player)
|
|
||||||
{
|
|
||||||
final int random = Rnd.get(5) + 1; // (0 - 4) + 1
|
|
||||||
LOGGER.info("Random number generated in setRandomTeam(): " + random);
|
|
||||||
|
|
||||||
switch (random)
|
|
||||||
{
|
|
||||||
case 1:
|
|
||||||
{
|
|
||||||
_team = 1;
|
|
||||||
_teamName = "Human";
|
|
||||||
setLoc();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 2:
|
|
||||||
{
|
|
||||||
_team = 2;
|
|
||||||
_teamName = "Elf";
|
|
||||||
setLoc();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 3:
|
|
||||||
{
|
|
||||||
_team = 3;
|
|
||||||
_teamName = "Dark";
|
|
||||||
setLoc();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 4:
|
|
||||||
{
|
|
||||||
_team = 4;
|
|
||||||
_teamName = "Orc";
|
|
||||||
setLoc();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 5:
|
|
||||||
{
|
|
||||||
_team = 5;
|
|
||||||
_teamName = "Dwarf";
|
|
||||||
setLoc();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
default:
|
|
||||||
{
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void setLoc()
|
|
||||||
{
|
|
||||||
try (Connection con = DatabaseFactory.getConnection())
|
|
||||||
{
|
|
||||||
final PreparedStatement statement = con.prepareStatement("SELECT endx,endy,endz FROM VIPinfo WHERE teamID = " + _team);
|
|
||||||
final ResultSet rset = statement.executeQuery();
|
|
||||||
rset.next();
|
|
||||||
|
|
||||||
_endX = rset.getInt("endx");
|
|
||||||
_endY = rset.getInt("endy");
|
|
||||||
_endZ = rset.getInt("endz");
|
|
||||||
rset.close();
|
|
||||||
statement.close();
|
|
||||||
}
|
|
||||||
catch (SQLException e)
|
|
||||||
{
|
|
||||||
LOGGER.info("Could not check End LOC for team" + _team + " got: " + e.getMessage());
|
|
||||||
}
|
|
||||||
|
|
||||||
try (Connection con = DatabaseFactory.getConnection())
|
|
||||||
{
|
|
||||||
final PreparedStatement statement = con.prepareStatement("SELECT startx,starty,startz FROM VIPinfo WHERE teamID = " + _team);
|
|
||||||
final ResultSet rset = statement.executeQuery();
|
|
||||||
rset.next();
|
|
||||||
|
|
||||||
_startX = rset.getInt("startx");
|
|
||||||
_startY = rset.getInt("starty");
|
|
||||||
_startZ = rset.getInt("startz");
|
|
||||||
rset.close();
|
|
||||||
statement.close();
|
|
||||||
}
|
|
||||||
catch (SQLException e)
|
|
||||||
{
|
|
||||||
LOGGER.info("Could not check Start LOC for team" + _team + " got: " + e.getMessage());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void endNPC(int npcId, PlayerInstance player)
|
|
||||||
{
|
|
||||||
if (_team == 0)
|
|
||||||
{
|
|
||||||
player.sendMessage("Please select a team first");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
final NpcTemplate npctmp = NpcTable.getInstance().getTemplate(npcId);
|
|
||||||
_endNPC = npcId;
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
_endSpawn = new Spawn(npctmp);
|
|
||||||
_endSpawn.setX(_endX);
|
|
||||||
_endSpawn.setY(_endY);
|
|
||||||
_endSpawn.setZ(_endZ);
|
|
||||||
_endSpawn.setAmount(1);
|
|
||||||
_endSpawn.setHeading(player.getHeading());
|
|
||||||
_endSpawn.setRespawnDelay(1);
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
player.sendMessage("VIP Engine[endNPC(" + player.getName() + ")]: exception: " + e.getMessage());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void joinNPC(int npcId, PlayerInstance player)
|
|
||||||
{
|
|
||||||
if (_joinX == 0)
|
|
||||||
{
|
|
||||||
player.sendMessage("Please set a join x,y,z first");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
final NpcTemplate npctmp = NpcTable.getInstance().getTemplate(npcId);
|
|
||||||
_joinNPC = npcId;
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
_joinSpawn = new Spawn(npctmp);
|
|
||||||
_joinSpawn.setX(_joinX);
|
|
||||||
_joinSpawn.setY(_joinY);
|
|
||||||
_joinSpawn.setZ(_joinZ);
|
|
||||||
_joinSpawn.setAmount(1);
|
|
||||||
_joinSpawn.setHeading(player.getHeading());
|
|
||||||
_joinSpawn.setRespawnDelay(1);
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
player.sendMessage("VIP Engine[joinNPC(" + player.getName() + ")]: exception: " + e.getMessage());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void spawnEndNPC()
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
SpawnTable.getInstance().addNewSpawn(_endSpawn, false);
|
|
||||||
_endSpawn.init();
|
|
||||||
_endSpawn.getLastSpawn().setCurrentHp(999999999);
|
|
||||||
_endSpawn.getLastSpawn().setTitle("VIP Event Manager");
|
|
||||||
_endSpawn.getLastSpawn().isAggressive();
|
|
||||||
_endSpawn.getLastSpawn().decayMe();
|
|
||||||
_endSpawn.getLastSpawn().spawnMe(_endSpawn.getLastSpawn().getX(), _endSpawn.getLastSpawn().getY(), _endSpawn.getLastSpawn().getZ());
|
|
||||||
_endSpawn.getLastSpawn().broadcastPacket(new MagicSkillUse(_endSpawn.getLastSpawn(), _endSpawn.getLastSpawn(), 1034, 1, 1, 1));
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
LOGGER.info("VIP Engine[spawnEndNPC()]: exception: " + e.getMessage());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void spawnJoinNPC()
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
SpawnTable.getInstance().addNewSpawn(_joinSpawn, false);
|
|
||||||
_joinSpawn.init();
|
|
||||||
_joinSpawn.getLastSpawn().setCurrentHp(999999999);
|
|
||||||
_joinSpawn.getLastSpawn().setTitle("VIP Event Manager");
|
|
||||||
_joinSpawn.getLastSpawn().isAggressive();
|
|
||||||
_joinSpawn.getLastSpawn().decayMe();
|
|
||||||
_joinSpawn.getLastSpawn().spawnMe(_joinSpawn.getLastSpawn().getX(), _joinSpawn.getLastSpawn().getY(), _joinSpawn.getLastSpawn().getZ());
|
|
||||||
_joinSpawn.getLastSpawn().broadcastPacket(new MagicSkillUse(_joinSpawn.getLastSpawn(), _joinSpawn.getLastSpawn(), 1034, 1, 1, 1));
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
LOGGER.info("VIP Engine[spawnJoinNPC()]: exception: " + e.getMessage());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static String getNPCName(int id, PlayerInstance player)
|
|
||||||
{
|
|
||||||
if (id == 0)
|
|
||||||
{
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
|
|
||||||
final NpcTemplate npctmp = NpcTable.getInstance().getTemplate(id);
|
|
||||||
return npctmp.getName();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static String getItemName(int id, PlayerInstance player)
|
|
||||||
{
|
|
||||||
if (id == 0)
|
|
||||||
{
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
final Item itemtmp = ItemTable.getInstance().getTemplate(id);
|
|
||||||
return itemtmp.getName();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void setJoinLOC(String x, String y, String z)
|
|
||||||
{
|
|
||||||
_joinX = Integer.parseInt(x);
|
|
||||||
_joinY = Integer.parseInt(y);
|
|
||||||
_joinZ = Integer.parseInt(z);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void startJoin(PlayerInstance player)
|
|
||||||
{
|
|
||||||
if ((_time == 0) || (_team == 0) || (_endNPC == 0) || (_delay == 0))
|
|
||||||
{
|
|
||||||
player.sendMessage("Cannot initiate join status of event, not all the values are filled in");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_joining)
|
|
||||||
{
|
|
||||||
player.sendMessage("Players are already allowed to join the event");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_started)
|
|
||||||
{
|
|
||||||
player.sendMessage("Event already started. Please wait for it to finish or finish it manually");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
_inProgress = true;
|
|
||||||
_joining = true;
|
|
||||||
AnnouncementsTable.getInstance().criticalAnnounceToAll("Vip event has started.Use .vipjoin to join or .vipleave to leave.");
|
|
||||||
spawnJoinNPC();
|
|
||||||
|
|
||||||
ThreadPool.schedule(() ->
|
|
||||||
{
|
|
||||||
_joining = false;
|
|
||||||
_started = true;
|
|
||||||
startEvent();
|
|
||||||
}, _delay);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void startEvent()
|
|
||||||
{
|
|
||||||
AnnouncementsTable.getInstance().criticalAnnounceToAll("Registration for the VIP event involving " + _teamName + " has ended.");
|
|
||||||
AnnouncementsTable.getInstance().criticalAnnounceToAll("Players will be teleported to their locations in 20 seconds.");
|
|
||||||
ThreadPool.schedule(() ->
|
|
||||||
{
|
|
||||||
teleportPlayers();
|
|
||||||
chooseVIP();
|
|
||||||
setUserData();
|
|
||||||
AnnouncementsTable.getInstance().criticalAnnounceToAll("Players have been teleported for the VIP event.");
|
|
||||||
AnnouncementsTable.getInstance().criticalAnnounceToAll("VIP event will start in 20 seconds.");
|
|
||||||
spawnEndNPC();
|
|
||||||
|
|
||||||
ThreadPool.schedule(() ->
|
|
||||||
{
|
|
||||||
AnnouncementsTable.getInstance().criticalAnnounceToAll("VIP event has started. " + _teamName + "'s VIP must get to the starter city and talk with " + getNPCName(_endNPC, null) + ". The opposing team must kill the VIP. All players except the VIP will respawn at their current locations.");
|
|
||||||
AnnouncementsTable.getInstance().criticalAnnounceToAll("VIP event will end if the " + _teamName + " team makes it to their town or when " + (_time / 1000 / 60) + " mins have elapsed.");
|
|
||||||
VIP.sit();
|
|
||||||
|
|
||||||
ThreadPool.schedule(VIP::endEventTime, _time);
|
|
||||||
}, 20000);
|
|
||||||
}, 20000);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void vipDied()
|
|
||||||
{
|
|
||||||
if (!_started)
|
|
||||||
{
|
|
||||||
LOGGER.info("Could not finish the event. Event not started or event ended prematurly.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
_started = false;
|
|
||||||
unspawnEventNpcs();
|
|
||||||
AnnouncementsTable.getInstance().criticalAnnounceToAll("The VIP has died. The opposing team has won.");
|
|
||||||
rewardNotVIP();
|
|
||||||
teleportFinish();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void endEventTime()
|
|
||||||
{
|
|
||||||
if (!_started)
|
|
||||||
{
|
|
||||||
LOGGER.info("Could not finish the event. Event not started or event ended prematurly (VIP died)");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
_started = false;
|
|
||||||
unspawnEventNpcs();
|
|
||||||
AnnouncementsTable.getInstance().criticalAnnounceToAll("The time has run out and the " + _teamName + "'s have not made it to their goal. Everybody on the opposing team wins.");
|
|
||||||
rewardNotVIP();
|
|
||||||
teleportFinish();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void unspawnEventNpcs()
|
|
||||||
{
|
|
||||||
if (_endSpawn != null)
|
|
||||||
{
|
|
||||||
_endSpawn.getLastSpawn().deleteMe();
|
|
||||||
_endSpawn.stopRespawn();
|
|
||||||
SpawnTable.getInstance().deleteSpawn(_endSpawn, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_joinSpawn != null)
|
|
||||||
{
|
|
||||||
_joinSpawn.getLastSpawn().deleteMe();
|
|
||||||
_joinSpawn.stopRespawn();
|
|
||||||
SpawnTable.getInstance().deleteSpawn(_joinSpawn, true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void showEndHTML(PlayerInstance eventPlayer, String objectId)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
final NpcHtmlMessage adminReply = new NpcHtmlMessage(5);
|
|
||||||
final StringBuilder replyMSG = new StringBuilder("<html><body>");
|
|
||||||
replyMSG.append("VIP (End NPC)<br><br>");
|
|
||||||
replyMSG.append("Current event...<br1>");
|
|
||||||
replyMSG.append("Team: <font color=\"FFFFFF\">" + _teamName + "</font><br><br>");
|
|
||||||
if (!_started)
|
|
||||||
{
|
|
||||||
replyMSG.append("<center>Please wait until the admin/gm starts the joining period.</center>");
|
|
||||||
}
|
|
||||||
else if (eventPlayer._isTheVIP)
|
|
||||||
{
|
|
||||||
replyMSG.append("You have made it to the end. All you have to do is hit the finish button to reward yourself and your team. Congrats!<br>");
|
|
||||||
replyMSG.append("<center>");
|
|
||||||
replyMSG.append("<button value=\"Finish\" action=\"bypass -h npc_" + objectId + "_vip_finishVIP\" width=50 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\">");
|
|
||||||
replyMSG.append("</center>");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
replyMSG.append("I am the character the VIP has to reach in order to win the event.<br>");
|
|
||||||
}
|
|
||||||
|
|
||||||
replyMSG.append("</body></html>");
|
|
||||||
adminReply.setHtml(replyMSG.toString());
|
|
||||||
eventPlayer.sendPacket(adminReply);
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
LOGGER.info("VIP(showJoinHTML(" + eventPlayer.getName() + ", " + objectId + ")]: exception" + e.getMessage());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void vipWin(PlayerInstance player)
|
|
||||||
{
|
|
||||||
if (!_started)
|
|
||||||
{
|
|
||||||
LOGGER.info("Could not finish the event. Event not started or event ended prematurly");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
_started = false;
|
|
||||||
unspawnEventNpcs();
|
|
||||||
AnnouncementsTable.getInstance().criticalAnnounceToAll("The VIP has made it to the goal. " + _teamName + " has won. Everybody on that team wins.");
|
|
||||||
rewardVIP();
|
|
||||||
teleportFinish();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void rewardNotVIP()
|
|
||||||
{
|
|
||||||
for (PlayerInstance player : _playersNotVIP)
|
|
||||||
{
|
|
||||||
if (player != null)
|
|
||||||
{
|
|
||||||
final PlayerInventory inv = player.getInventory();
|
|
||||||
if (ItemTable.getInstance().createDummyItem(_notVipReward).isStackable())
|
|
||||||
{
|
|
||||||
inv.addItem("VIP Event: ", _notVipReward, _notVipRewardAmount, player, null);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
for (int i = 0; i <= (_notVipRewardAmount - 1); i++)
|
|
||||||
{
|
|
||||||
inv.addItem("VIP Event: ", _notVipReward, 1, player, null);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
SystemMessage sm;
|
|
||||||
if (_notVipRewardAmount > 1)
|
|
||||||
{
|
|
||||||
sm = new SystemMessage(SystemMessageId.YOU_HAVE_EARNED_S2_S1_S);
|
|
||||||
sm.addItemName(_notVipReward);
|
|
||||||
sm.addNumber(_notVipRewardAmount);
|
|
||||||
player.sendPacket(sm);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
sm = new SystemMessage(SystemMessageId.YOU_HAVE_EARNED_S1);
|
|
||||||
sm.addItemName(_notVipReward);
|
|
||||||
player.sendPacket(sm);
|
|
||||||
}
|
|
||||||
|
|
||||||
final StatusUpdate su = new StatusUpdate(player.getObjectId());
|
|
||||||
su.addAttribute(StatusUpdate.CUR_LOAD, player.getCurrentLoad());
|
|
||||||
player.sendPacket(su);
|
|
||||||
|
|
||||||
final NpcHtmlMessage nhm = new NpcHtmlMessage(5);
|
|
||||||
final StringBuilder replyMSG = new StringBuilder("");
|
|
||||||
replyMSG.append("<html><body>Your team has won the event. Your inventory now contains your reward.</body></html>");
|
|
||||||
nhm.setHtml(replyMSG.toString());
|
|
||||||
player.sendPacket(nhm);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void rewardVIP()
|
|
||||||
{
|
|
||||||
for (PlayerInstance player : _playersVIP)
|
|
||||||
{
|
|
||||||
if ((player != null) && !player._isTheVIP)
|
|
||||||
{
|
|
||||||
final PlayerInventory inv = player.getInventory();
|
|
||||||
if (ItemTable.getInstance().createDummyItem(_vipReward).isStackable())
|
|
||||||
{
|
|
||||||
inv.addItem("VIP Event: ", _vipReward, _vipRewardAmount, player, null);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
for (int i = 0; i <= (_vipRewardAmount - 1); i++)
|
|
||||||
{
|
|
||||||
inv.addItem("VIP Event: ", _vipReward, 1, player, null);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
SystemMessage sm;
|
|
||||||
if (_vipRewardAmount > 1)
|
|
||||||
{
|
|
||||||
sm = new SystemMessage(SystemMessageId.YOU_HAVE_EARNED_S2_S1_S);
|
|
||||||
sm.addItemName(_vipReward);
|
|
||||||
sm.addNumber(_vipRewardAmount);
|
|
||||||
player.sendPacket(sm);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
sm = new SystemMessage(SystemMessageId.YOU_HAVE_EARNED_S1);
|
|
||||||
sm.addItemName(_vipReward);
|
|
||||||
player.sendPacket(sm);
|
|
||||||
}
|
|
||||||
|
|
||||||
final StatusUpdate su = new StatusUpdate(player.getObjectId());
|
|
||||||
su.addAttribute(StatusUpdate.CUR_LOAD, player.getCurrentLoad());
|
|
||||||
player.sendPacket(su);
|
|
||||||
|
|
||||||
final NpcHtmlMessage nhm = new NpcHtmlMessage(5);
|
|
||||||
final StringBuilder replyMSG = new StringBuilder("");
|
|
||||||
replyMSG.append("<html><body>Your team has won the event. Your inventory now contains your reward.</body></html>");
|
|
||||||
nhm.setHtml(replyMSG.toString());
|
|
||||||
player.sendPacket(nhm);
|
|
||||||
}
|
|
||||||
else if ((player != null) && player._isTheVIP)
|
|
||||||
{
|
|
||||||
final PlayerInventory inv = player.getInventory();
|
|
||||||
if (ItemTable.getInstance().createDummyItem(_theVipReward).isStackable())
|
|
||||||
{
|
|
||||||
inv.addItem("VIP Event: ", _theVipReward, _theVipRewardAmount, player, null);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
for (int i = 0; i <= (_theVipRewardAmount - 1); i++)
|
|
||||||
{
|
|
||||||
inv.addItem("VIP Event: ", _theVipReward, 1, player, null);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
SystemMessage sm;
|
|
||||||
if (_theVipRewardAmount > 1)
|
|
||||||
{
|
|
||||||
sm = new SystemMessage(SystemMessageId.YOU_HAVE_EARNED_S2_S1_S);
|
|
||||||
sm.addItemName(_theVipReward);
|
|
||||||
sm.addNumber(_theVipRewardAmount);
|
|
||||||
player.sendPacket(sm);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
sm = new SystemMessage(SystemMessageId.YOU_HAVE_EARNED_S1);
|
|
||||||
sm.addItemName(_theVipReward);
|
|
||||||
player.sendPacket(sm);
|
|
||||||
}
|
|
||||||
|
|
||||||
final StatusUpdate su = new StatusUpdate(player.getObjectId());
|
|
||||||
su.addAttribute(StatusUpdate.CUR_LOAD, player.getCurrentLoad());
|
|
||||||
player.sendPacket(su);
|
|
||||||
|
|
||||||
final NpcHtmlMessage nhm = new NpcHtmlMessage(5);
|
|
||||||
final StringBuilder replyMSG = new StringBuilder("");
|
|
||||||
replyMSG.append("<html><body>You team have won the event. Your inventory now contains your reward.</body></html>");
|
|
||||||
nhm.setHtml(replyMSG.toString());
|
|
||||||
player.sendPacket(nhm);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void teleportFinish()
|
|
||||||
{
|
|
||||||
AnnouncementsTable.getInstance().criticalAnnounceToAll("Teleporting VIP players back to the Registration area in 20 seconds.");
|
|
||||||
ThreadPool.schedule(() ->
|
|
||||||
{
|
|
||||||
for (PlayerInstance player1 : _playersVIP)
|
|
||||||
{
|
|
||||||
if (player1 != null)
|
|
||||||
{
|
|
||||||
player1.teleToLocation(_joinX, _joinY, _joinZ);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (PlayerInstance player2 : _playersNotVIP)
|
|
||||||
{
|
|
||||||
if (player2 != null)
|
|
||||||
{
|
|
||||||
player2.teleToLocation(_joinX, _joinY, _joinZ);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
VIP.clean();
|
|
||||||
}, 20000);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void clean()
|
|
||||||
{
|
|
||||||
_time = _winners = _endNPC = _joinNPC = _delay = _endX = _endY = _endZ = _startX = _startY = _startZ = _joinX = _joinY = _joinZ = _team = 0;
|
|
||||||
_vipReward = _vipRewardAmount = _notVipReward = _notVipRewardAmount = _theVipReward = _theVipRewardAmount = 0;
|
|
||||||
_started = _joining = _sitForced = false;
|
|
||||||
_inProgress = false;
|
|
||||||
_teamName = _joinArea = "";
|
|
||||||
for (PlayerInstance player : _playersVIP)
|
|
||||||
{
|
|
||||||
player.getAppearance().setNameColor(player._originalNameColourVIP);
|
|
||||||
player.setKarma(player._originalKarmaVIP);
|
|
||||||
player.broadcastUserInfo();
|
|
||||||
player._inEventVIP = false;
|
|
||||||
player._isTheVIP = false;
|
|
||||||
player._isNotVIP = false;
|
|
||||||
player._isVIP = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (PlayerInstance player : _playersNotVIP)
|
|
||||||
{
|
|
||||||
player.getAppearance().setNameColor(player._originalNameColourVIP);
|
|
||||||
player.setKarma(player._originalKarmaVIP);
|
|
||||||
player.broadcastUserInfo();
|
|
||||||
player._inEventVIP = false;
|
|
||||||
player._isTheVIP = false;
|
|
||||||
player._isNotVIP = false;
|
|
||||||
player._isVIP = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
_playersVIP = new ArrayList<>();
|
|
||||||
_playersNotVIP = new ArrayList<>();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void chooseVIP()
|
|
||||||
{
|
|
||||||
final int size = _playersVIP.size();
|
|
||||||
LOGGER.info("Size of players on VIP: " + size);
|
|
||||||
|
|
||||||
final int random = Rnd.get(size);
|
|
||||||
LOGGER.info("Random number chosen in VIP: " + random);
|
|
||||||
|
|
||||||
final PlayerInstance vip = _playersVIP.get(random);
|
|
||||||
vip._isTheVIP = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void teleportPlayers()
|
|
||||||
{
|
|
||||||
sit();
|
|
||||||
|
|
||||||
for (PlayerInstance player : _playersVIP)
|
|
||||||
{
|
|
||||||
if (player != null)
|
|
||||||
{
|
|
||||||
player.teleToLocation(_startX, _startY, _startZ);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for (PlayerInstance player : _playersNotVIP)
|
|
||||||
{
|
|
||||||
if (player != null)
|
|
||||||
{
|
|
||||||
player.teleToLocation(_endX, _endY, _endZ);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void sit()
|
|
||||||
{
|
|
||||||
if (_sitForced)
|
|
||||||
{
|
|
||||||
_sitForced = false;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
_sitForced = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (PlayerInstance player : _playersVIP)
|
|
||||||
{
|
|
||||||
if (player != null)
|
|
||||||
{
|
|
||||||
if (_sitForced)
|
|
||||||
{
|
|
||||||
player.stopMove(null, false);
|
|
||||||
player.abortAttack();
|
|
||||||
player.abortCast();
|
|
||||||
|
|
||||||
if (!player.isSitting())
|
|
||||||
{
|
|
||||||
player.sitDown();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (player.isSitting())
|
|
||||||
{
|
|
||||||
player.standUp();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (PlayerInstance player : _playersNotVIP)
|
|
||||||
{
|
|
||||||
if (player != null)
|
|
||||||
{
|
|
||||||
if (_sitForced)
|
|
||||||
{
|
|
||||||
player.stopMove(null, false);
|
|
||||||
player.abortAttack();
|
|
||||||
player.abortCast();
|
|
||||||
|
|
||||||
if (!player.isSitting())
|
|
||||||
{
|
|
||||||
player.sitDown();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (player.isSitting())
|
|
||||||
{
|
|
||||||
player.standUp();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void setUserData()
|
|
||||||
{
|
|
||||||
for (PlayerInstance player : _playersVIP)
|
|
||||||
{
|
|
||||||
if (player._isTheVIP)
|
|
||||||
{
|
|
||||||
player.getAppearance().setNameColor(255, 255, 0);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
player.getAppearance().setNameColor(255, 0, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
player.setKarma(0);
|
|
||||||
player.broadcastUserInfo();
|
|
||||||
}
|
|
||||||
for (PlayerInstance player : _playersNotVIP)
|
|
||||||
{
|
|
||||||
player.getAppearance().setNameColor(0, 255, 0);
|
|
||||||
player.setKarma(0);
|
|
||||||
player.broadcastUserInfo();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void showJoinHTML(PlayerInstance eventPlayer, String objectId)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
final NpcHtmlMessage adminReply = new NpcHtmlMessage(5);
|
|
||||||
final StringBuilder replyMSG = new StringBuilder("<html><body>");
|
|
||||||
replyMSG.append("VIP (Join NPC)<br><br>");
|
|
||||||
replyMSG.append("Current event...<br1>");
|
|
||||||
replyMSG.append(" ... Team: <font color=\"FFFFFF\">" + _teamName + "</font><br><br>");
|
|
||||||
if (!_joining && !_started)
|
|
||||||
{
|
|
||||||
replyMSG.append("<center>Please wait until the admin/gm starts the joining period.</center>");
|
|
||||||
}
|
|
||||||
else if (_joining && !_started)
|
|
||||||
{
|
|
||||||
// Joining period
|
|
||||||
if (_playersVIP.contains(eventPlayer) || _playersNotVIP.contains(eventPlayer))
|
|
||||||
{
|
|
||||||
replyMSG.append("You are already on a team<br><br>");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
replyMSG.append("You want to participate in the event?<br><br>");
|
|
||||||
if ((eventPlayer.getRace() == Race.HUMAN) && (_team == 1))
|
|
||||||
{
|
|
||||||
replyMSG.append("It seems you are on the VIP race! Be prepared to protect the VIP when it is decided<br1>");
|
|
||||||
replyMSG.append("The VIP will be decided on when the event starts. It's completely random.<br>");
|
|
||||||
replyMSG.append("<center>");
|
|
||||||
replyMSG.append("<button value=\"Join\" action=\"bypass -h npc_" + objectId + "_vip_joinVIPTeam\" width=50 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\">");
|
|
||||||
replyMSG.append("</center>");
|
|
||||||
}
|
|
||||||
else if ((eventPlayer.getRace() == Race.ELF) && (_team == 2))
|
|
||||||
{
|
|
||||||
replyMSG.append("It seems you are on the VIP race! Be prepared to protect the VIP when it is decided<br1>");
|
|
||||||
replyMSG.append("The VIP will be decided on when the event starts. It's completely random.<br>");
|
|
||||||
replyMSG.append("<center>");
|
|
||||||
replyMSG.append("<button value=\"Join\" action=\"bypass -h npc_" + objectId + "_vip_joinVIPTeam\" width=50 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\">");
|
|
||||||
replyMSG.append("</center>");
|
|
||||||
}
|
|
||||||
else if ((eventPlayer.getRace() == Race.DARK_ELF) && (_team == 3))
|
|
||||||
{
|
|
||||||
replyMSG.append("It seems you are on the VIP race! Be prepared to protect the VIP when it is decided<br1>");
|
|
||||||
replyMSG.append("The VIP will be decided on when the event starts. It's completely random.<br>");
|
|
||||||
replyMSG.append("<center>");
|
|
||||||
replyMSG.append("<button value=\"Join\" action=\"bypass -h npc_" + objectId + "_vip_joinVIPTeam\" width=50 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\">");
|
|
||||||
replyMSG.append("</center>");
|
|
||||||
}
|
|
||||||
else if ((eventPlayer.getRace() == Race.ORC) && (_team == 4))
|
|
||||||
{
|
|
||||||
replyMSG.append("It seems you are on the VIP race! Be prepared to protect the VIP when it is decided<br1>");
|
|
||||||
replyMSG.append("The VIP will be decided on when the event starts. It's completely random.<br>");
|
|
||||||
replyMSG.append("<center>");
|
|
||||||
replyMSG.append("<button value=\"Join\" action=\"bypass -h npc_" + objectId + "_vip_joinVIPTeam\" width=50 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\">");
|
|
||||||
replyMSG.append("</center>");
|
|
||||||
}
|
|
||||||
else if ((eventPlayer.getRace() == Race.DWARF) && (_team == 5))
|
|
||||||
{
|
|
||||||
replyMSG.append("It seems you are on the VIP race! Be prepared to protect the VIP when it is decided<br1>");
|
|
||||||
replyMSG.append("The VIP will be decided on when the event starts. It's completely random.<br>");
|
|
||||||
replyMSG.append("<center>");
|
|
||||||
replyMSG.append("<button value=\"Join\" action=\"bypass -h npc_" + objectId + "_vip_joinVIPTeam\" width=50 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\">");
|
|
||||||
replyMSG.append("</center>");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
replyMSG.append("It seems you are not on the part of the VIP race.<br>");
|
|
||||||
replyMSG.append("When the event starts you will be teleported to the " + _teamName + " town<br1>");
|
|
||||||
replyMSG.append("Be sure to cooperate with your team to destroy the VIP.<br1>");
|
|
||||||
replyMSG.append("The VIP will be announced when the event starts.<br>");
|
|
||||||
replyMSG.append("<center>");
|
|
||||||
replyMSG.append("<button value=\"Join\" action=\"bypass -h npc_" + objectId + "_vip_joinNotVIPTeam\" width=50 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\">");
|
|
||||||
replyMSG.append("</center>");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (_started)
|
|
||||||
{
|
|
||||||
replyMSG.append("<center>The event is already taking place. Please sign up for the next event.</center>");
|
|
||||||
}
|
|
||||||
|
|
||||||
replyMSG.append("</body></html>");
|
|
||||||
adminReply.setHtml(replyMSG.toString());
|
|
||||||
eventPlayer.sendPacket(adminReply);
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
LOGGER.info("VIP(showJoinHTML(" + eventPlayer.getName() + ", " + objectId + ")]: exception" + e.getMessage());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void addPlayerVIP(PlayerInstance player)
|
|
||||||
{
|
|
||||||
player._isVIP = true;
|
|
||||||
_playersVIP.add(player);
|
|
||||||
player._originalNameColourVIP = player.getAppearance().getNameColor();
|
|
||||||
player._originalKarmaVIP = player.getKarma();
|
|
||||||
player._inEventVIP = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void addPlayerNotVIP(PlayerInstance player)
|
|
||||||
{
|
|
||||||
player._isNotVIP = true;
|
|
||||||
_playersNotVIP.add(player);
|
|
||||||
player._originalNameColourVIP = player.getAppearance().getNameColor();
|
|
||||||
player._originalKarmaVIP = player.getKarma();
|
|
||||||
player._inEventVIP = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void onDisconnect(PlayerInstance player)
|
|
||||||
{
|
|
||||||
if (player._inEventTvT)
|
|
||||||
{
|
|
||||||
player.getAppearance().setNameColor(player._originalNameColourVIP);
|
|
||||||
player.setKarma(player._originalKarmaVIP);
|
|
||||||
player.broadcastUserInfo();
|
|
||||||
player._inEventVIP = false;
|
|
||||||
player._isTheVIP = false;
|
|
||||||
player._isNotVIP = false;
|
|
||||||
player._isVIP = false;
|
|
||||||
player.teleToLocation(_startX, _startY, _startZ);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -122,7 +122,7 @@ public class Radar
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
_me.sendPacket(new RadarControl(1, 1, _me.getX(), _me.getY(), _me.getZ()));
|
_me.sendPacket(new RadarControl(1, 1, _me.getX(), _me.getY(), _me.getZ()));
|
||||||
if ((_myTarget == null) || !_myTarget.isOnline() || !_myTarget._haveFlagCTF)
|
if ((_myTarget == null) || !_myTarget.isOnline())
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -24,15 +24,11 @@ import java.util.List;
|
|||||||
import java.util.StringTokenizer;
|
import java.util.StringTokenizer;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
import org.l2jmobius.Config;
|
|
||||||
import org.l2jmobius.gameserver.data.SkillTable;
|
import org.l2jmobius.gameserver.data.SkillTable;
|
||||||
import org.l2jmobius.gameserver.data.sql.SkillTreeTable;
|
import org.l2jmobius.gameserver.data.sql.SkillTreeTable;
|
||||||
import org.l2jmobius.gameserver.enums.ClassId;
|
import org.l2jmobius.gameserver.enums.ClassId;
|
||||||
import org.l2jmobius.gameserver.geoengine.GeoEngine;
|
import org.l2jmobius.gameserver.geoengine.GeoEngine;
|
||||||
import org.l2jmobius.gameserver.instancemanager.SiegeManager;
|
import org.l2jmobius.gameserver.instancemanager.SiegeManager;
|
||||||
import org.l2jmobius.gameserver.instancemanager.events.CTF;
|
|
||||||
import org.l2jmobius.gameserver.instancemanager.events.DM;
|
|
||||||
import org.l2jmobius.gameserver.instancemanager.events.TvT;
|
|
||||||
import org.l2jmobius.gameserver.model.actor.Attackable;
|
import org.l2jmobius.gameserver.model.actor.Attackable;
|
||||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||||
import org.l2jmobius.gameserver.model.actor.Playable;
|
import org.l2jmobius.gameserver.model.actor.Playable;
|
||||||
@ -1767,9 +1763,8 @@ public abstract class Skill
|
|||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
// if src is in event and trg not OR viceversa:
|
// if src is in event and trg not or viceversa
|
||||||
// to be fixed for mixed events status (in TvT joining phase, someone can attack a partecipating CTF player with area attack)
|
if ((src.isOnCustomEvent() && !trg.isOnCustomEvent()) || (trg.isOnCustomEvent() && !src.isOnCustomEvent()))
|
||||||
if (((src._inEvent || src._inEventCTF || src._inEventDM || src._inEventTvT || src._inEventVIP) && (!trg._inEvent && !trg._inEventCTF && !trg._inEventDM && !trg._inEventTvT && !trg._inEventVIP)) || ((trg._inEvent || trg._inEventCTF || trg._inEventDM || trg._inEventTvT || trg._inEventVIP) && (!src._inEvent && !src._inEventCTF && !src._inEventDM && !src._inEventTvT && !src._inEventVIP)))
|
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -1781,9 +1776,8 @@ public abstract class Skill
|
|||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
// if src is in event and trg not OR viceversa:
|
// if src is in event and trg not or viceversa
|
||||||
// to be fixed for mixed events status (in TvT joining phase, someone can attack a partecipating CTF player with area attack)
|
if ((src.isOnCustomEvent() && !trg.isOnCustomEvent()) || (trg.isOnCustomEvent() && !src.isOnCustomEvent()))
|
||||||
if (((src._inEvent || src._inEventCTF || src._inEventDM || src._inEventTvT || src._inEventVIP) && (!trg._inEvent && !trg._inEventCTF && !trg._inEventDM && !trg._inEventTvT && !trg._inEventVIP)) || ((trg._inEvent || trg._inEventCTF || trg._inEventDM || trg._inEventTvT || trg._inEventVIP) && (!src._inEvent && !src._inEventCTF && !src._inEventDM && !src._inEventTvT && !src._inEventVIP)))
|
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -1912,9 +1906,8 @@ public abstract class Skill
|
|||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
// if src is in event and trg not OR viceversa:
|
// if src is in event and trg not or viceversa
|
||||||
// to be fixed for mixed events status (in TvT joining phase, someone can attack a partecipating CTF player with area attack)
|
if ((src.isOnCustomEvent() && !trg.isOnCustomEvent()) || (trg.isOnCustomEvent() && !src.isOnCustomEvent()))
|
||||||
if (((src._inEvent || src._inEventCTF || src._inEventDM || src._inEventTvT || src._inEventVIP) && (!trg._inEvent && !trg._inEventCTF && !trg._inEventDM && !trg._inEventTvT && !trg._inEventVIP)) || ((trg._inEvent || trg._inEventCTF || trg._inEventDM || trg._inEventTvT || trg._inEventVIP) && (!src._inEvent && !src._inEventCTF && !src._inEventDM && !src._inEventTvT && !src._inEventVIP)))
|
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -1926,9 +1919,8 @@ public abstract class Skill
|
|||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
// if src is in event and trg not OR viceversa:
|
// if src is in event and trg not or viceversa
|
||||||
// to be fixed for mixed events status (in TvT joining phase, someone can attack a partecipating CTF player with area attack)
|
if ((src.isOnCustomEvent() && !trg.isOnCustomEvent()) || (trg.isOnCustomEvent() && !src.isOnCustomEvent()))
|
||||||
if (((src._inEvent || src._inEventCTF || src._inEventDM || src._inEventTvT || src._inEventVIP) && (!trg._inEvent && !trg._inEventCTF && !trg._inEventDM && !trg._inEventTvT && !trg._inEventVIP)) || ((trg._inEvent || trg._inEventCTF || trg._inEventDM || trg._inEventTvT || trg._inEventVIP) && (!src._inEvent && !src._inEventCTF && !src._inEventDM && !src._inEventTvT && !src._inEventVIP)))
|
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -1979,30 +1971,11 @@ public abstract class Skill
|
|||||||
final List<PlayerInstance> partyList = creature.getParty().getPartyMembers();
|
final List<PlayerInstance> partyList = creature.getParty().getPartyMembers();
|
||||||
for (PlayerInstance partyMember : partyList)
|
for (PlayerInstance partyMember : partyList)
|
||||||
{
|
{
|
||||||
if (partyMember == null)
|
if ((partyMember == null) || (partyMember == player))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (partyMember == player)
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
// check if allow interference is allowed if player is not on event but target is on event
|
|
||||||
if (((TvT.isStarted() && !Config.TVT_ALLOW_INTERFERENCE) || (CTF.isStarted() && !Config.CTF_ALLOW_INTERFERENCE) || (DM.hasStarted() && !Config.DM_ALLOW_INTERFERENCE))/* && !player.isGM() */)
|
|
||||||
{
|
|
||||||
if ((partyMember._inEventTvT && !player._inEventTvT) || (!partyMember._inEventTvT && player._inEventTvT))
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if ((partyMember._inEventCTF && !player._inEventCTF) || (!partyMember._inEventCTF && player._inEventCTF))
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if ((partyMember._inEventDM && !player._inEventDM) || (!partyMember._inEventDM && player._inEventDM))
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!partyMember.isDead() && Util.checkIfInRange(_skillRadius, creature, partyMember, true))
|
if (!partyMember.isDead() && Util.checkIfInRange(_skillRadius, creature, partyMember, true))
|
||||||
{
|
{
|
||||||
PlayerInstance src = null;
|
PlayerInstance src = null;
|
||||||
@ -2015,12 +1988,12 @@ public abstract class Skill
|
|||||||
src = ((Summon) creature).getOwner();
|
src = ((Summon) creature).getOwner();
|
||||||
}
|
}
|
||||||
final PlayerInstance trg = partyMember;
|
final PlayerInstance trg = partyMember;
|
||||||
// if src is in event and trg not OR viceversa:
|
// if src is in event and trg not or viceversa
|
||||||
// to be fixed for mixed events status (in TvT joining phase, someone can attack a partecipating CTF player with area attack)
|
if ((src != null) && ((src.isOnCustomEvent() && !trg.isOnCustomEvent()) || (trg.isOnCustomEvent() && !src.isOnCustomEvent())))
|
||||||
if ((src != null) && (((src._inEvent || src._inEventCTF || src._inEventDM || src._inEventTvT || src._inEventVIP) && (!trg._inEvent && !trg._inEventCTF && !trg._inEventDM && !trg._inEventTvT && !trg._inEventVIP)) || ((trg._inEvent || trg._inEventCTF || trg._inEventDM || trg._inEventTvT || trg._inEventVIP) && (!src._inEvent && !src._inEventCTF && !src._inEventDM && !src._inEventTvT && !src._inEventVIP))))
|
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
targetList.add(partyMember);
|
targetList.add(partyMember);
|
||||||
if ((partyMember.getPet() != null) && !partyMember.getPet().isDead())
|
if ((partyMember.getPet() != null) && !partyMember.getPet().isDead())
|
||||||
{
|
{
|
||||||
@ -2140,12 +2113,12 @@ public abstract class Skill
|
|||||||
|
|
||||||
final PlayerInstance trg = newTarget;
|
final PlayerInstance trg = newTarget;
|
||||||
final PlayerInstance src = player;
|
final PlayerInstance src = player;
|
||||||
// if src is in event and trg not OR viceversa:
|
// if src is in event and trg not or viceversa
|
||||||
// to be fixed for mixed events status (in TvT joining phase, someone can attack a partecipating CTF player with area attack)
|
if ((src.isOnCustomEvent() && !trg.isOnCustomEvent()) || (trg.isOnCustomEvent() && !src.isOnCustomEvent()))
|
||||||
if (((src._inEvent || src._inEventCTF || src._inEventDM || src._inEventTvT || src._inEventVIP) && (!trg._inEvent && !trg._inEventCTF && !trg._inEventDM && !trg._inEventTvT && !trg._inEventVIP)) || ((trg._inEvent || trg._inEventCTF || trg._inEventDM || trg._inEventTvT || trg._inEventVIP) && (!src._inEvent && !src._inEventCTF && !src._inEventDM && !src._inEventTvT && !src._inEventVIP)))
|
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
final Summon pet = newTarget.getPet();
|
final Summon pet = newTarget.getPet();
|
||||||
if ((pet != null) && Util.checkIfInRange(radius, creature, pet, true) && !onlyFirst && (((_targetType == SkillTargetType.TARGET_CORPSE_CLAN) && pet.isDead()) || ((_targetType == SkillTargetType.TARGET_CLAN) && !pet.isDead())) && player.checkPvpSkill(newTarget, this))
|
if ((pet != null) && Util.checkIfInRange(radius, creature, pet, true) && !onlyFirst && (((_targetType == SkillTargetType.TARGET_CORPSE_CLAN) && pet.isDead()) || ((_targetType == SkillTargetType.TARGET_CLAN) && !pet.isDead())) && player.checkPvpSkill(newTarget, this))
|
||||||
{
|
{
|
||||||
@ -2384,17 +2357,18 @@ public abstract class Skill
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// check for Events
|
|
||||||
if (trg == src)
|
if (trg == src)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
// if src is in event and trg not OR viceversa:
|
|
||||||
// to be fixed for mixed events status (in TvT joining phase, someone can attack a partecipating CTF player with area attack)
|
// if src is in event and trg not or viceversa
|
||||||
if ((src != null) && (trg != null) && (((src._inEvent || src._inEventCTF || src._inEventDM || src._inEventTvT || src._inEventVIP) && (!trg._inEvent && !trg._inEventCTF && !trg._inEventDM && !trg._inEventTvT && !trg._inEventVIP)) || ((trg._inEvent || trg._inEventCTF || trg._inEventDM || trg._inEventTvT || trg._inEventVIP) && (!src._inEvent && !src._inEventCTF && !src._inEventDM && !src._inEventTvT && !src._inEventVIP))))
|
if ((src != null) && (trg != null) && ((src.isOnCustomEvent() && !trg.isOnCustomEvent()) || (trg.isOnCustomEvent() && !src.isOnCustomEvent())))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
targetList.add((Creature) obj);
|
targetList.add((Creature) obj);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2862,24 +2836,24 @@ public abstract class Skill
|
|||||||
}
|
}
|
||||||
|
|
||||||
// if src is in event and trg not OR viceversa, the target must be not attackable
|
// if src is in event and trg not OR viceversa, the target must be not attackable
|
||||||
// to be fixed for mixed events status (in TvT joining phase, someone can attack a partecipating CTF player with area attack)
|
if ((activeCh.isOnCustomEvent() && !targetChar.isOnCustomEvent()) || (targetChar.isOnCustomEvent() && !activeCh.isOnCustomEvent()))
|
||||||
if (((activeCh._inEvent || activeCh._inEventCTF || activeCh._inEventDM || activeCh._inEventTvT || activeCh._inEventVIP) && (!targetChar._inEvent && !targetChar._inEventCTF && !targetChar._inEventDM && !targetChar._inEventTvT && !targetChar._inEventVIP)) || ((targetChar._inEvent || targetChar._inEventCTF || targetChar._inEventDM || targetChar._inEventTvT || targetChar._inEventVIP) && (!activeCh._inEvent && !activeCh._inEventCTF && !activeCh._inEventDM && !activeCh._inEventTvT && !activeCh._inEventVIP)))
|
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((activeCh._inEvent && targetChar._inEvent) || (activeCh._inEventDM && targetChar._inEventDM) || (activeCh._inEventTvT && targetChar._inEventTvT) || (activeCh._inEventCTF && targetChar._inEventCTF) || (activeCh._inEventVIP && targetChar._inEventVIP))
|
if (activeCh.isOnCustomEvent() && targetChar.isOnCustomEvent())
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((activeCh.getParty() != null) && (targetChar.getParty() != null) && // Is in the same party???
|
// Is in the same party?
|
||||||
(activeCh.getParty().getPartyLeaderOID() == targetChar.getParty().getPartyLeaderOID()))
|
if ((activeCh.getParty() != null) && (targetChar.getParty() != null) && (activeCh.getParty().getPartyLeaderOID() == targetChar.getParty().getPartyLeaderOID()))
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if ((activeCh.getClan() != null) && (targetChar.getClan() != null) && // Is in the same clan???
|
|
||||||
(activeCh.getClan().getClanId() == targetChar.getClan().getClanId()))
|
// Is in the same clan?
|
||||||
|
if ((activeCh.getClan() != null) && (targetChar.getClan() != null) && (activeCh.getClan().getClanId() == targetChar.getClan().getClanId()))
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -447,11 +447,6 @@ public class Attackable extends NpcInstance
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isEventMob)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Add damage and hate to the attacker AggroInfo of the Attackable _aggroList
|
// Add damage and hate to the attacker AggroInfo of the Attackable _aggroList
|
||||||
if (attacker != null)
|
if (attacker != null)
|
||||||
{
|
{
|
||||||
|
@ -40,7 +40,6 @@ import org.l2jmobius.gameserver.ai.CtrlIntention;
|
|||||||
import org.l2jmobius.gameserver.data.SkillTable;
|
import org.l2jmobius.gameserver.data.SkillTable;
|
||||||
import org.l2jmobius.gameserver.data.sql.NpcTable;
|
import org.l2jmobius.gameserver.data.sql.NpcTable;
|
||||||
import org.l2jmobius.gameserver.data.xml.MapRegionData;
|
import org.l2jmobius.gameserver.data.xml.MapRegionData;
|
||||||
import org.l2jmobius.gameserver.data.xml.ZoneData;
|
|
||||||
import org.l2jmobius.gameserver.enums.TeleportWhereType;
|
import org.l2jmobius.gameserver.enums.TeleportWhereType;
|
||||||
import org.l2jmobius.gameserver.geoengine.GeoEngine;
|
import org.l2jmobius.gameserver.geoengine.GeoEngine;
|
||||||
import org.l2jmobius.gameserver.handler.ISkillHandler;
|
import org.l2jmobius.gameserver.handler.ISkillHandler;
|
||||||
@ -49,11 +48,6 @@ import org.l2jmobius.gameserver.handler.itemhandlers.Potions;
|
|||||||
import org.l2jmobius.gameserver.instancemanager.DimensionalRiftManager;
|
import org.l2jmobius.gameserver.instancemanager.DimensionalRiftManager;
|
||||||
import org.l2jmobius.gameserver.instancemanager.GrandBossManager;
|
import org.l2jmobius.gameserver.instancemanager.GrandBossManager;
|
||||||
import org.l2jmobius.gameserver.instancemanager.RaidBossSpawnManager;
|
import org.l2jmobius.gameserver.instancemanager.RaidBossSpawnManager;
|
||||||
import org.l2jmobius.gameserver.instancemanager.events.CTF;
|
|
||||||
import org.l2jmobius.gameserver.instancemanager.events.DM;
|
|
||||||
import org.l2jmobius.gameserver.instancemanager.events.GameEvent;
|
|
||||||
import org.l2jmobius.gameserver.instancemanager.events.TvT;
|
|
||||||
import org.l2jmobius.gameserver.instancemanager.events.VIP;
|
|
||||||
import org.l2jmobius.gameserver.model.ChanceSkillList;
|
import org.l2jmobius.gameserver.model.ChanceSkillList;
|
||||||
import org.l2jmobius.gameserver.model.Effect;
|
import org.l2jmobius.gameserver.model.Effect;
|
||||||
import org.l2jmobius.gameserver.model.ForceBuff;
|
import org.l2jmobius.gameserver.model.ForceBuff;
|
||||||
@ -104,7 +98,6 @@ import org.l2jmobius.gameserver.model.skills.funcs.Func;
|
|||||||
import org.l2jmobius.gameserver.model.skills.holders.ISkillsHolder;
|
import org.l2jmobius.gameserver.model.skills.holders.ISkillsHolder;
|
||||||
import org.l2jmobius.gameserver.model.zone.ZoneId;
|
import org.l2jmobius.gameserver.model.zone.ZoneId;
|
||||||
import org.l2jmobius.gameserver.model.zone.type.BossZone;
|
import org.l2jmobius.gameserver.model.zone.type.BossZone;
|
||||||
import org.l2jmobius.gameserver.model.zone.type.TownZone;
|
|
||||||
import org.l2jmobius.gameserver.network.SystemMessageId;
|
import org.l2jmobius.gameserver.network.SystemMessageId;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ActionFailed;
|
import org.l2jmobius.gameserver.network.serverpackets.ActionFailed;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.Attack;
|
import org.l2jmobius.gameserver.network.serverpackets.Attack;
|
||||||
@ -521,27 +514,6 @@ public abstract class Creature extends WorldObject implements ISkillsHolder
|
|||||||
// default implementation
|
// default implementation
|
||||||
}
|
}
|
||||||
|
|
||||||
/** The _in town war. */
|
|
||||||
private boolean _inTownWar;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Checks if is in town war.
|
|
||||||
* @return true, if is in town war
|
|
||||||
*/
|
|
||||||
public boolean isinTownWar()
|
|
||||||
{
|
|
||||||
return _inTownWar;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the in town war.
|
|
||||||
* @param value the new in town war
|
|
||||||
*/
|
|
||||||
public void setInTownWar(boolean value)
|
|
||||||
{
|
|
||||||
_inTownWar = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Teleport a Creature and its pet if necessary.<br>
|
* Teleport a Creature and its pet if necessary.<br>
|
||||||
* <br>
|
* <br>
|
||||||
@ -557,22 +529,6 @@ public abstract class Creature extends WorldObject implements ISkillsHolder
|
|||||||
*/
|
*/
|
||||||
public void teleToLocation(int xValue, int yValue, int zValue, boolean allowRandomOffset)
|
public void teleToLocation(int xValue, int yValue, int zValue, boolean allowRandomOffset)
|
||||||
{
|
{
|
||||||
if (Config.TW_DISABLE_GK)
|
|
||||||
{
|
|
||||||
final TownZone town = ZoneData.getInstance().getZone(getX(), getY(), getZ(), TownZone.class);
|
|
||||||
if ((town != null) && _inTownWar)
|
|
||||||
{
|
|
||||||
if ((town.getTownId() == Config.TW_TOWN_ID) && !Config.TW_ALL_TOWNS)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
else if (Config.TW_ALL_TOWNS)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Abort any client actions, casting and remove target.
|
// Abort any client actions, casting and remove target.
|
||||||
stopMove(null, false);
|
stopMove(null, false);
|
||||||
abortAttack();
|
abortAttack();
|
||||||
@ -1818,31 +1774,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder
|
|||||||
}
|
}
|
||||||
else if (this instanceof PlayerInstance)
|
else if (this instanceof PlayerInstance)
|
||||||
{
|
{
|
||||||
final PlayerInstance player = (PlayerInstance) this;
|
if (Config.LEAVE_BUFFS_ON_DIE)
|
||||||
|
|
||||||
// to avoid Event Remove buffs on die
|
|
||||||
if (player._inEventDM && DM.hasStarted())
|
|
||||||
{
|
|
||||||
if (Config.DM_REMOVE_BUFFS_ON_DIE)
|
|
||||||
{
|
|
||||||
stopAllEffects();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (player._inEventTvT && TvT.isStarted())
|
|
||||||
{
|
|
||||||
if (Config.TVT_REMOVE_BUFFS_ON_DIE)
|
|
||||||
{
|
|
||||||
stopAllEffects();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (player._inEventCTF && CTF.isStarted())
|
|
||||||
{
|
|
||||||
if (Config.CTF_REMOVE_BUFFS_ON_DIE)
|
|
||||||
{
|
|
||||||
stopAllEffects();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (Config.LEAVE_BUFFS_ON_DIE) // this means that the player is not in event
|
|
||||||
{
|
{
|
||||||
stopAllEffects();
|
stopAllEffects();
|
||||||
}
|
}
|
||||||
@ -5283,29 +5215,6 @@ public abstract class Creature extends WorldObject implements ISkillsHolder
|
|||||||
*/
|
*/
|
||||||
protected void moveToLocation(WorldObject target, int xValue, int yValue, int zValue, int offsetValue)
|
protected void moveToLocation(WorldObject target, int xValue, int yValue, int zValue, int offsetValue)
|
||||||
{
|
{
|
||||||
// Block movement during Event start
|
|
||||||
if (isPlayer())
|
|
||||||
{
|
|
||||||
if (GameEvent.active && getActingPlayer().eventSitForced)
|
|
||||||
{
|
|
||||||
getActingPlayer().sendMessage("A dark force beyond your mortal understanding makes your knees to shake when you try to stand up...");
|
|
||||||
getActingPlayer().getClient().sendPacket(ActionFailed.STATIC_PACKET);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
else if ((TvT.isSitForced() && getActingPlayer()._inEventTvT) || (CTF.isSitForced() && getActingPlayer()._inEventCTF) || (DM.isSitForced() && getActingPlayer()._inEventDM))
|
|
||||||
{
|
|
||||||
getActingPlayer().sendMessage("A dark force beyond your mortal understanding makes your knees to shake when you try to stand up...");
|
|
||||||
getActingPlayer().getClient().sendPacket(ActionFailed.STATIC_PACKET);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
else if (VIP._sitForced && getActingPlayer()._inEventVIP)
|
|
||||||
{
|
|
||||||
getActingPlayer().sendMessage("A dark force beyond your mortal understanding makes your knees to shake when you try to stand up...");
|
|
||||||
getActingPlayer().sendPacket(ActionFailed.STATIC_PACKET);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get the Move Speed of the Creature
|
// Get the Move Speed of the Creature
|
||||||
final float speed = getStat().getMoveSpeed();
|
final float speed = getStat().getMoveSpeed();
|
||||||
if ((speed <= 0) || isMovementDisabled())
|
if ((speed <= 0) || isMovementDisabled())
|
||||||
@ -5865,7 +5774,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder
|
|||||||
{
|
{
|
||||||
// If the attacker/target is dead or use fake death, notify the AI with EVT_CANCEL
|
// If the attacker/target is dead or use fake death, notify the AI with EVT_CANCEL
|
||||||
// and send a Server->Client packet ActionFailed (if attacker is a PlayerInstance)
|
// and send a Server->Client packet ActionFailed (if attacker is a PlayerInstance)
|
||||||
if ((target == null) || isAlikeDead() || ((this instanceof NpcInstance) && ((NpcInstance) this).isEventMob))
|
if ((target == null) || isAlikeDead())
|
||||||
{
|
{
|
||||||
getAI().notifyEvent(CtrlEvent.EVT_CANCEL);
|
getAI().notifyEvent(CtrlEvent.EVT_CANCEL);
|
||||||
return;
|
return;
|
||||||
@ -6384,24 +6293,9 @@ public abstract class Creature extends WorldObject implements ISkillsHolder
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dst.isInFunEvent() && src.isInFunEvent())
|
if (dst.isOnCustomEvent() && src.isOnCustomEvent())
|
||||||
{
|
{
|
||||||
if (src.isInStartedTVTEvent() && dst.isInStartedTVTEvent())
|
return false;
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
else if (src.isInStartedDMEvent() && dst.isInStartedDMEvent())
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
else if (src.isInStartedCTFEvent() && dst.isInStartedCTFEvent())
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
else if (src.isInStartedVIPEvent() && dst.isInStartedVIPEvent())
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -445,14 +445,9 @@ public abstract class Playable extends Creature
|
|||||||
_lastCharmOfLuckEffect = null;
|
_lastCharmOfLuckEffect = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public boolean isOnCustomEvent()
|
||||||
* Checks if is in fun event.
|
|
||||||
* @return true, if is in fun event
|
|
||||||
*/
|
|
||||||
public boolean isInFunEvent()
|
|
||||||
{
|
{
|
||||||
final PlayerInstance player = getActingPlayer();
|
return false;
|
||||||
return (player != null) && player.isInFunEvent();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -818,6 +818,12 @@ public abstract class Summon extends Playable
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isOnCustomEvent()
|
||||||
|
{
|
||||||
|
return (_owner != null) && _owner.isOnCustomEvent();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PlayerInstance getActingPlayer()
|
public PlayerInstance getActingPlayer()
|
||||||
{
|
{
|
||||||
|
@ -88,11 +88,7 @@ public class MonsterInstance extends Attackable
|
|||||||
@Override
|
@Override
|
||||||
public boolean isAutoAttackable(Creature attacker)
|
public boolean isAutoAttackable(Creature attacker)
|
||||||
{
|
{
|
||||||
if (attacker instanceof MonsterInstance)
|
return !(attacker instanceof MonsterInstance);
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return !isEventMob;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -102,7 +98,7 @@ public class MonsterInstance extends Attackable
|
|||||||
@Override
|
@Override
|
||||||
public boolean isAggressive()
|
public boolean isAggressive()
|
||||||
{
|
{
|
||||||
return (getTemplate().getAggroRange() > 0) && !isEventMob;
|
return getTemplate().getAggroRange() > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -42,11 +42,6 @@ import org.l2jmobius.gameserver.instancemanager.FortManager;
|
|||||||
import org.l2jmobius.gameserver.instancemanager.IdManager;
|
import org.l2jmobius.gameserver.instancemanager.IdManager;
|
||||||
import org.l2jmobius.gameserver.instancemanager.QuestManager;
|
import org.l2jmobius.gameserver.instancemanager.QuestManager;
|
||||||
import org.l2jmobius.gameserver.instancemanager.RaidBossSpawnManager;
|
import org.l2jmobius.gameserver.instancemanager.RaidBossSpawnManager;
|
||||||
import org.l2jmobius.gameserver.instancemanager.events.CTF;
|
|
||||||
import org.l2jmobius.gameserver.instancemanager.events.DM;
|
|
||||||
import org.l2jmobius.gameserver.instancemanager.events.GameEvent;
|
|
||||||
import org.l2jmobius.gameserver.instancemanager.events.TvT;
|
|
||||||
import org.l2jmobius.gameserver.instancemanager.events.VIP;
|
|
||||||
import org.l2jmobius.gameserver.instancemanager.games.Lottery;
|
import org.l2jmobius.gameserver.instancemanager.games.Lottery;
|
||||||
import org.l2jmobius.gameserver.model.DropCategory;
|
import org.l2jmobius.gameserver.model.DropCategory;
|
||||||
import org.l2jmobius.gameserver.model.DropData;
|
import org.l2jmobius.gameserver.model.DropData;
|
||||||
@ -116,17 +111,8 @@ public class NpcInstance extends Creature
|
|||||||
private boolean _isSpoil = false;
|
private boolean _isSpoil = false;
|
||||||
private int _castleIndex = -2;
|
private int _castleIndex = -2;
|
||||||
private int _fortIndex = -2;
|
private int _fortIndex = -2;
|
||||||
public boolean isEventMob = false;
|
|
||||||
public boolean _isEventMobTvT = false;
|
|
||||||
public boolean _isEventVIPNPC = false;
|
|
||||||
public boolean _isEventVIPNPCEnd = false;
|
|
||||||
public boolean _isEventMobDM = false;
|
|
||||||
public boolean _isEventMobCTF = false;
|
|
||||||
public boolean _isCTF_throneSpawn = false;
|
|
||||||
public boolean _isCTF_Flag = false;
|
|
||||||
private boolean _isInTown = false;
|
private boolean _isInTown = false;
|
||||||
private final boolean _isQuestMonster = getTemplate().isQuestMonster();
|
private final boolean _isQuestMonster = getTemplate().isQuestMonster();
|
||||||
public String _CTF_FlagTeamName;
|
|
||||||
private int _isSpoiledBy = 0;
|
private int _isSpoiledBy = 0;
|
||||||
private long _lastSocialBroadcast = 0;
|
private long _lastSocialBroadcast = 0;
|
||||||
private static final int MINIMUM_SOCIAL_INTERVAL = 6000;
|
private static final int MINIMUM_SOCIAL_INTERVAL = 6000;
|
||||||
@ -704,51 +690,17 @@ public class NpcInstance extends Creature
|
|||||||
|
|
||||||
// Send a Server->Client packet SocialAction to the all PlayerInstance on the _knownPlayer of the NpcInstance to display a social action of the NpcInstance on their client
|
// Send a Server->Client packet SocialAction to the all PlayerInstance on the _knownPlayer of the NpcInstance to display a social action of the NpcInstance on their client
|
||||||
broadcastSocialAction(Rnd.get(8));
|
broadcastSocialAction(Rnd.get(8));
|
||||||
// Open a chat window on client with the text of the NpcInstance
|
|
||||||
if (isEventMob)
|
final List<Quest> questList = getTemplate().getEventQuests(EventType.NPC_FIRST_TALK);
|
||||||
|
if (questList.size() == 1)
|
||||||
{
|
{
|
||||||
GameEvent.showEventHtml(player, String.valueOf(getObjectId()));
|
questList.get(0).notifyFirstTalk(this, player);
|
||||||
}
|
|
||||||
else if (_isEventMobTvT)
|
|
||||||
{
|
|
||||||
TvT.showEventHtml(player, String.valueOf(getObjectId()));
|
|
||||||
}
|
|
||||||
else if (_isEventMobDM)
|
|
||||||
{
|
|
||||||
DM.showEventHtml(player, String.valueOf(getObjectId()));
|
|
||||||
}
|
|
||||||
else if (_isEventMobCTF)
|
|
||||||
{
|
|
||||||
CTF.showEventHtml(player, String.valueOf(getObjectId()));
|
|
||||||
}
|
|
||||||
else if (_isCTF_Flag && player._inEventCTF)
|
|
||||||
{
|
|
||||||
CTF.showFlagHtml(player, String.valueOf(getObjectId()), _CTF_FlagTeamName);
|
|
||||||
}
|
|
||||||
else if (_isCTF_throneSpawn)
|
|
||||||
{
|
|
||||||
CTF.checkRestoreFlags();
|
|
||||||
}
|
|
||||||
else if (_isEventVIPNPC)
|
|
||||||
{
|
|
||||||
VIP.showJoinHTML(player, String.valueOf(getObjectId()));
|
|
||||||
}
|
|
||||||
else if (_isEventVIPNPCEnd)
|
|
||||||
{
|
|
||||||
VIP.showEndHTML(player, String.valueOf(getObjectId()));
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
final List<Quest> questList = getTemplate().getEventQuests(EventType.NPC_FIRST_TALK);
|
showChatWindow(player, 0);
|
||||||
if (questList.size() == 1)
|
|
||||||
{
|
|
||||||
questList.get(0).notifyFirstTalk(this, player);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
showChatWindow(player, 0);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Like L2OFF player must rotate to the Npc
|
// Like L2OFF player must rotate to the Npc
|
||||||
player.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, this);
|
player.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, this);
|
||||||
}
|
}
|
||||||
@ -993,50 +945,15 @@ public class NpcInstance extends Creature
|
|||||||
|
|
||||||
// Send a Server->Client packet SocialAction to the all PlayerInstance on the _knownPlayer of the NpcInstance to display a social action of the NpcInstance on their client
|
// Send a Server->Client packet SocialAction to the all PlayerInstance on the _knownPlayer of the NpcInstance to display a social action of the NpcInstance on their client
|
||||||
broadcastSocialAction(Rnd.get(8));
|
broadcastSocialAction(Rnd.get(8));
|
||||||
// Open a chat window on client with the text of the NpcInstance
|
|
||||||
if (isEventMob)
|
final List<Quest> questList = getTemplate().getEventQuests(EventType.NPC_FIRST_TALK);
|
||||||
|
if (questList.size() == 1)
|
||||||
{
|
{
|
||||||
GameEvent.showEventHtml(player, String.valueOf(getObjectId()));
|
questList.get(0).notifyFirstTalk(this, player);
|
||||||
}
|
|
||||||
else if (_isEventMobTvT)
|
|
||||||
{
|
|
||||||
TvT.showEventHtml(player, String.valueOf(getObjectId()));
|
|
||||||
}
|
|
||||||
else if (_isEventMobDM)
|
|
||||||
{
|
|
||||||
DM.showEventHtml(player, String.valueOf(getObjectId()));
|
|
||||||
}
|
|
||||||
else if (_isEventMobCTF)
|
|
||||||
{
|
|
||||||
CTF.showEventHtml(player, String.valueOf(getObjectId()));
|
|
||||||
}
|
|
||||||
else if (_isCTF_Flag && player._inEventCTF)
|
|
||||||
{
|
|
||||||
CTF.showFlagHtml(player, String.valueOf(getObjectId()), _CTF_FlagTeamName);
|
|
||||||
}
|
|
||||||
else if (_isCTF_throneSpawn)
|
|
||||||
{
|
|
||||||
CTF.checkRestoreFlags();
|
|
||||||
}
|
|
||||||
else if (_isEventVIPNPC)
|
|
||||||
{
|
|
||||||
VIP.showJoinHTML(player, String.valueOf(getObjectId()));
|
|
||||||
}
|
|
||||||
else if (_isEventVIPNPCEnd)
|
|
||||||
{
|
|
||||||
VIP.showEndHTML(player, String.valueOf(getObjectId()));
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
final List<Quest> questList = getTemplate().getEventQuests(EventType.NPC_FIRST_TALK);
|
showChatWindow(player, 0);
|
||||||
if (questList.size() == 1)
|
|
||||||
{
|
|
||||||
questList.get(0).notifyFirstTalk(this, player);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
showChatWindow(player, 0);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -52,9 +52,9 @@ public class ObservationInstance extends FolkInstance
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (player._inEventTvT || player._inEventDM || player._inEventCTF)
|
if (player.isRegisteredOnCustomEvent())
|
||||||
{
|
{
|
||||||
player.sendMessage("You already participated in Event!");
|
player.sendMessage("You already participate in an event!");
|
||||||
player.sendPacket(ActionFailed.STATIC_PACKET);
|
player.sendPacket(ActionFailed.STATIC_PACKET);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -107,9 +107,9 @@ public class OlympiadManagerInstance extends FolkInstance
|
|||||||
}
|
}
|
||||||
case 4:
|
case 4:
|
||||||
{
|
{
|
||||||
if (player.isRegisteredInFunEvent())
|
if (player.isRegisteredOnCustomEvent())
|
||||||
{
|
{
|
||||||
player.sendMessage("You are already registered to another Event");
|
player.sendMessage("You are already registered in an event.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Olympiad.getInstance().registerNoble(player, false);
|
Olympiad.getInstance().registerNoble(player, false);
|
||||||
@ -117,9 +117,9 @@ public class OlympiadManagerInstance extends FolkInstance
|
|||||||
}
|
}
|
||||||
case 5:
|
case 5:
|
||||||
{
|
{
|
||||||
if (player.isRegisteredInFunEvent())
|
if (player.isRegisteredOnCustomEvent())
|
||||||
{
|
{
|
||||||
player.sendMessage("You are already registered to another Event");
|
player.sendMessage("You are already registered in an event.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Olympiad.getInstance().registerNoble(player, true);
|
Olympiad.getInstance().registerNoble(player, true);
|
||||||
|
@ -19,13 +19,11 @@ package org.l2jmobius.gameserver.model.actor.instance;
|
|||||||
import java.sql.Connection;
|
import java.sql.Connection;
|
||||||
import java.sql.PreparedStatement;
|
import java.sql.PreparedStatement;
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.LinkedList;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Map.Entry;
|
import java.util.Map.Entry;
|
||||||
@ -83,11 +81,6 @@ import org.l2jmobius.gameserver.instancemanager.QuestManager;
|
|||||||
import org.l2jmobius.gameserver.instancemanager.RebirthManager;
|
import org.l2jmobius.gameserver.instancemanager.RebirthManager;
|
||||||
import org.l2jmobius.gameserver.instancemanager.RecipeManager;
|
import org.l2jmobius.gameserver.instancemanager.RecipeManager;
|
||||||
import org.l2jmobius.gameserver.instancemanager.SiegeManager;
|
import org.l2jmobius.gameserver.instancemanager.SiegeManager;
|
||||||
import org.l2jmobius.gameserver.instancemanager.events.CTF;
|
|
||||||
import org.l2jmobius.gameserver.instancemanager.events.DM;
|
|
||||||
import org.l2jmobius.gameserver.instancemanager.events.GameEvent;
|
|
||||||
import org.l2jmobius.gameserver.instancemanager.events.TvT;
|
|
||||||
import org.l2jmobius.gameserver.instancemanager.events.VIP;
|
|
||||||
import org.l2jmobius.gameserver.model.AccessLevel;
|
import org.l2jmobius.gameserver.model.AccessLevel;
|
||||||
import org.l2jmobius.gameserver.model.BlockList;
|
import org.l2jmobius.gameserver.model.BlockList;
|
||||||
import org.l2jmobius.gameserver.model.Effect;
|
import org.l2jmobius.gameserver.model.Effect;
|
||||||
@ -164,7 +157,6 @@ import org.l2jmobius.gameserver.model.skills.handlers.SkillSummon;
|
|||||||
import org.l2jmobius.gameserver.model.variables.AccountVariables;
|
import org.l2jmobius.gameserver.model.variables.AccountVariables;
|
||||||
import org.l2jmobius.gameserver.model.variables.PlayerVariables;
|
import org.l2jmobius.gameserver.model.variables.PlayerVariables;
|
||||||
import org.l2jmobius.gameserver.model.zone.ZoneId;
|
import org.l2jmobius.gameserver.model.zone.ZoneId;
|
||||||
import org.l2jmobius.gameserver.model.zone.type.TownZone;
|
|
||||||
import org.l2jmobius.gameserver.model.zone.type.WaterZone;
|
import org.l2jmobius.gameserver.model.zone.type.WaterZone;
|
||||||
import org.l2jmobius.gameserver.network.GameClient;
|
import org.l2jmobius.gameserver.network.GameClient;
|
||||||
import org.l2jmobius.gameserver.network.SystemMessageId;
|
import org.l2jmobius.gameserver.network.SystemMessageId;
|
||||||
@ -193,7 +185,6 @@ import org.l2jmobius.gameserver.network.serverpackets.ObservationMode;
|
|||||||
import org.l2jmobius.gameserver.network.serverpackets.ObservationReturn;
|
import org.l2jmobius.gameserver.network.serverpackets.ObservationReturn;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.PartySmallWindowUpdate;
|
import org.l2jmobius.gameserver.network.serverpackets.PartySmallWindowUpdate;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.PetInventoryUpdate;
|
import org.l2jmobius.gameserver.network.serverpackets.PetInventoryUpdate;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.PlaySound;
|
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.PledgeShowInfoUpdate;
|
import org.l2jmobius.gameserver.network.serverpackets.PledgeShowInfoUpdate;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.PledgeShowMemberListDelete;
|
import org.l2jmobius.gameserver.network.serverpackets.PledgeShowMemberListDelete;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.PledgeShowMemberListUpdate;
|
import org.l2jmobius.gameserver.network.serverpackets.PledgeShowMemberListUpdate;
|
||||||
@ -268,12 +259,6 @@ public class PlayerInstance extends Playable
|
|||||||
public static final int STORE_PRIVATE_MANUFACTURE = 5;
|
public static final int STORE_PRIVATE_MANUFACTURE = 5;
|
||||||
public static final int STORE_PRIVATE_PACKAGE_SELL = 8;
|
public static final int STORE_PRIVATE_PACKAGE_SELL = 8;
|
||||||
|
|
||||||
public boolean _isVIP = false;
|
|
||||||
public boolean _inEventVIP = false;
|
|
||||||
public boolean _isNotVIP = false;
|
|
||||||
public boolean _isTheVIP = false;
|
|
||||||
public int _originalNameColourVIP;
|
|
||||||
public int _originalKarmaVIP;
|
|
||||||
private PlayerStatsHolder savedStatus = null;
|
private PlayerStatsHolder savedStatus = null;
|
||||||
private final long _instanceLoginTime;
|
private final long _instanceLoginTime;
|
||||||
protected long _toggleUse = 0;
|
protected long _toggleUse = 0;
|
||||||
@ -312,43 +297,6 @@ public class PlayerInstance extends Playable
|
|||||||
private boolean _isAio = false;
|
private boolean _isAio = false;
|
||||||
private long _aioEndTime = 0;
|
private long _aioEndTime = 0;
|
||||||
private boolean _expGain = true;
|
private boolean _expGain = true;
|
||||||
|
|
||||||
public int eventX;
|
|
||||||
public int eventY;
|
|
||||||
public int eventZ;
|
|
||||||
public int eventKarma;
|
|
||||||
public int eventPvpKills;
|
|
||||||
public int eventPkKills;
|
|
||||||
public String eventTitle;
|
|
||||||
public List<String> kills = new LinkedList<>();
|
|
||||||
public boolean eventSitForced = false;
|
|
||||||
public boolean atEvent = false;
|
|
||||||
public String _teamNameTvT;
|
|
||||||
public String _originalTitleTvT;
|
|
||||||
public int _originalNameColorTvT = 0;
|
|
||||||
public int _countTvTkills;
|
|
||||||
public int _countTvTdies;
|
|
||||||
public int _originalKarmaTvT;
|
|
||||||
public boolean _inEventTvT = false;
|
|
||||||
public String _teamNameCTF;
|
|
||||||
public String _teamNameHaveFlagCTF;
|
|
||||||
public String _originalTitleCTF;
|
|
||||||
public int _originalNameColorCTF = 0;
|
|
||||||
public int _originalKarmaCTF;
|
|
||||||
public int _countCTFflags;
|
|
||||||
public boolean _inEventCTF = false;
|
|
||||||
public boolean _haveFlagCTF = false;
|
|
||||||
public Future<?> _posCheckerCTF = null;
|
|
||||||
public String _originalTitleDM;
|
|
||||||
public int _originalNameColorDM = 0;
|
|
||||||
public int _countDMkills;
|
|
||||||
public int _originalKarmaDM;
|
|
||||||
public boolean _inEventDM = false;
|
|
||||||
public int _originalNameColor;
|
|
||||||
public int _countKills;
|
|
||||||
public int _originalKarma;
|
|
||||||
public int _eventKills;
|
|
||||||
public boolean _inEvent = false;
|
|
||||||
private boolean _inOlympiadMode = false;
|
private boolean _inOlympiadMode = false;
|
||||||
private boolean _olympiadStart = false;
|
private boolean _olympiadStart = false;
|
||||||
private int[] _olympiadPosition;
|
private int[] _olympiadPosition;
|
||||||
@ -450,6 +398,8 @@ public class PlayerInstance extends Playable
|
|||||||
private final int[] _loto = new int[5];
|
private final int[] _loto = new int[5];
|
||||||
private final int[] _race = new int[2];
|
private final int[] _race = new int[2];
|
||||||
private final BlockList _blockList = new BlockList(this);
|
private final BlockList _blockList = new BlockList(this);
|
||||||
|
private boolean _isRegisteredOnCustomEvent = false;
|
||||||
|
private boolean _isOnCustomEvent = false;
|
||||||
private int _team = 0;
|
private int _team = 0;
|
||||||
private int _alliedVarkaKetra = 0;
|
private int _alliedVarkaKetra = 0;
|
||||||
private int _hasCoupon = 0;
|
private int _hasCoupon = 0;
|
||||||
@ -494,7 +444,6 @@ public class PlayerInstance extends Playable
|
|||||||
private int _engageid = 0;
|
private int _engageid = 0;
|
||||||
private boolean _marryrequest = false;
|
private boolean _marryrequest = false;
|
||||||
private boolean _marryaccepted = false;
|
private boolean _marryaccepted = false;
|
||||||
private int quakeSystem = 0;
|
|
||||||
private boolean _isLocked = false;
|
private boolean _isLocked = false;
|
||||||
private boolean _isStored = false;
|
private boolean _isStored = false;
|
||||||
private int _masteryWeapPenalty = 0;
|
private int _masteryWeapPenalty = 0;
|
||||||
@ -649,13 +598,6 @@ public class PlayerInstance extends Playable
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// during teleport phase, players cant do any attack
|
|
||||||
if ((TvT.isTeleport() && _inEventTvT) || (CTF.isTeleport() && _inEventCTF) || (DM.isTeleport() && _inEventDM))
|
|
||||||
{
|
|
||||||
sendPacket(ActionFailed.STATIC_PACKET);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Pk protection config
|
// Pk protection config
|
||||||
if (Config.ALLOW_CHAR_KILL_PROTECT && !isGM() && target.isPlayer() && (target.getActingPlayer().getPvpFlag() == 0) && (target.getActingPlayer().getKarma() == 0))
|
if (Config.ALLOW_CHAR_KILL_PROTECT && !isGM() && target.isPlayer() && (target.getActingPlayer().getPvpFlag() == 0) && (target.getActingPlayer().getKarma() == 0))
|
||||||
{
|
{
|
||||||
@ -703,13 +645,6 @@ public class PlayerInstance extends Playable
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// during teleport phase, players cant do any attack
|
|
||||||
if ((TvT.isTeleport() && _inEventTvT) || (CTF.isTeleport() && _inEventCTF) || (DM.isTeleport() && _inEventDM))
|
|
||||||
{
|
|
||||||
sendPacket(ActionFailed.STATIC_PACKET);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
super.doCast(skill);
|
super.doCast(skill);
|
||||||
|
|
||||||
if (!skill.isOffensive())
|
if (!skill.isOffensive())
|
||||||
@ -1177,13 +1112,6 @@ public class PlayerInstance extends Playable
|
|||||||
*/
|
*/
|
||||||
public void logout(boolean kicked)
|
public void logout(boolean kicked)
|
||||||
{
|
{
|
||||||
// prevent from player disconnect when in Event
|
|
||||||
if (atEvent)
|
|
||||||
{
|
|
||||||
sendMessage("A superior power doesn't allow you to leave the event.");
|
|
||||||
sendPacket(ActionFailed.STATIC_PACKET);
|
|
||||||
}
|
|
||||||
|
|
||||||
_kicked = kicked;
|
_kicked = kicked;
|
||||||
closeNetConnection();
|
closeNetConnection();
|
||||||
}
|
}
|
||||||
@ -3142,19 +3070,7 @@ public class PlayerInstance extends Playable
|
|||||||
stopFakeDeath(null);
|
stopFakeDeath(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GameEvent.active && eventSitForced)
|
if (_waitTypeSitting && !isInStoreMode() && !isAlikeDead())
|
||||||
{
|
|
||||||
sendMessage("A dark force beyond your mortal understanding makes your knees to shake when you try to stand up ...");
|
|
||||||
}
|
|
||||||
else if ((TvT.isSitForced() && _inEventTvT) || (CTF.isSitForced() && _inEventCTF) || (DM.isSitForced() && _inEventDM))
|
|
||||||
{
|
|
||||||
sendMessage("A dark force beyond your mortal understanding makes your knees to shake when you try to stand up...");
|
|
||||||
}
|
|
||||||
else if (VIP._sitForced && _inEventVIP)
|
|
||||||
{
|
|
||||||
sendMessage("A dark force beyond your mortal understanding makes your knees to shake when you try to stand up...");
|
|
||||||
}
|
|
||||||
else if (_waitTypeSitting && !isInStoreMode() && !isAlikeDead())
|
|
||||||
{
|
{
|
||||||
if (_relax)
|
if (_relax)
|
||||||
{
|
{
|
||||||
@ -4336,25 +4252,6 @@ public class PlayerInstance extends Playable
|
|||||||
@Override
|
@Override
|
||||||
public void onAction(PlayerInstance player)
|
public void onAction(PlayerInstance player)
|
||||||
{
|
{
|
||||||
// no Interaction with not participant to events
|
|
||||||
if (((TvT.isStarted() || TvT.isTeleport()) && !Config.TVT_ALLOW_INTERFERENCE) || ((CTF.isStarted() || CTF.isTeleport()) && !Config.CTF_ALLOW_INTERFERENCE) || ((DM.hasStarted() || DM.isTeleport()) && !Config.DM_ALLOW_INTERFERENCE))
|
|
||||||
{
|
|
||||||
if ((_inEventTvT && !player._inEventTvT) || (!_inEventTvT && player._inEventTvT))
|
|
||||||
{
|
|
||||||
player.sendPacket(ActionFailed.STATIC_PACKET);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
else if ((_inEventCTF && !player._inEventCTF) || (!_inEventCTF && player._inEventCTF))
|
|
||||||
{
|
|
||||||
player.sendPacket(ActionFailed.STATIC_PACKET);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
else if ((_inEventDM && !player._inEventDM) || (!_inEventDM && player._inEventDM))
|
|
||||||
{
|
|
||||||
player.sendPacket(ActionFailed.STATIC_PACKET);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Check if the PlayerInstance is confused
|
// Check if the PlayerInstance is confused
|
||||||
if (player.isOutOfControl())
|
if (player.isOutOfControl())
|
||||||
{
|
{
|
||||||
@ -4448,25 +4345,6 @@ public class PlayerInstance extends Playable
|
|||||||
}
|
}
|
||||||
else // Like L2OFF set the target of the PlayerInstance player
|
else // Like L2OFF set the target of the PlayerInstance player
|
||||||
{
|
{
|
||||||
if (((TvT.isStarted() || TvT.isTeleport()) && !Config.TVT_ALLOW_INTERFERENCE) || ((CTF.isStarted() || CTF.isTeleport()) && !Config.CTF_ALLOW_INTERFERENCE) || ((DM.hasStarted() || DM.isTeleport()) && !Config.DM_ALLOW_INTERFERENCE))
|
|
||||||
{
|
|
||||||
if ((_inEventTvT && !player._inEventTvT) || (!_inEventTvT && player._inEventTvT))
|
|
||||||
{
|
|
||||||
player.sendPacket(ActionFailed.STATIC_PACKET);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
else if ((_inEventCTF && !player._inEventCTF) || (!_inEventCTF && player._inEventCTF))
|
|
||||||
{
|
|
||||||
player.sendPacket(ActionFailed.STATIC_PACKET);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
else if ((_inEventDM && !player._inEventDM) || (!_inEventDM && player._inEventDM))
|
|
||||||
{
|
|
||||||
player.sendPacket(ActionFailed.STATIC_PACKET);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check if the PlayerInstance is confused
|
// Check if the PlayerInstance is confused
|
||||||
if (player.isOutOfControl())
|
if (player.isOutOfControl())
|
||||||
{
|
{
|
||||||
@ -4583,61 +4461,6 @@ public class PlayerInstance extends Playable
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isInFunEvent()
|
|
||||||
{
|
|
||||||
return (atEvent || isInStartedTVTEvent() || isInStartedDMEvent() || isInStartedCTFEvent() || isInStartedVIPEvent());
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isInStartedTVTEvent()
|
|
||||||
{
|
|
||||||
return (TvT.isStarted() && _inEventTvT);
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isRegisteredInTVTEvent()
|
|
||||||
{
|
|
||||||
return _inEventTvT;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isInStartedDMEvent()
|
|
||||||
{
|
|
||||||
return (DM.hasStarted() && _inEventDM);
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isRegisteredInDMEvent()
|
|
||||||
{
|
|
||||||
return _inEventDM;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isInStartedCTFEvent()
|
|
||||||
{
|
|
||||||
return (CTF.isStarted() && _inEventCTF);
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isRegisteredInCTFEvent()
|
|
||||||
{
|
|
||||||
return _inEventCTF;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isInStartedVIPEvent()
|
|
||||||
{
|
|
||||||
return (VIP._started && _inEventVIP);
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isRegisteredInVIPEvent()
|
|
||||||
{
|
|
||||||
return _inEventVIP;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Checks if is registered in fun event.
|
|
||||||
* @return true, if is registered in fun event
|
|
||||||
*/
|
|
||||||
public boolean isRegisteredInFunEvent()
|
|
||||||
{
|
|
||||||
return (atEvent || (_inEventTvT) || (_inEventDM) || (_inEventCTF) || (_inEventVIP) || Olympiad.getInstance().isRegistered(this));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Are player offensive skills locked.
|
* Are player offensive skills locked.
|
||||||
* @return true, if successful
|
* @return true, if successful
|
||||||
@ -5685,21 +5508,6 @@ public class PlayerInstance extends Playable
|
|||||||
@Override
|
@Override
|
||||||
public boolean doDie(Creature killer)
|
public boolean doDie(Creature killer)
|
||||||
{
|
{
|
||||||
if (Config.TW_RESS_ON_DIE)
|
|
||||||
{
|
|
||||||
final TownZone town = ZoneData.getInstance().getZone(getX(), getY(), getZ(), TownZone.class);
|
|
||||||
if ((town != null) && isinTownWar())
|
|
||||||
{
|
|
||||||
if ((town.getTownId() == Config.TW_TOWN_ID) && !Config.TW_ALL_TOWNS)
|
|
||||||
{
|
|
||||||
reviveRequest(this, null, false);
|
|
||||||
}
|
|
||||||
else if (Config.TW_ALL_TOWNS)
|
|
||||||
{
|
|
||||||
reviveRequest(this, null, false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Kill the PlayerInstance
|
// Kill the PlayerInstance
|
||||||
if (!super.doDie(killer))
|
if (!super.doDie(killer))
|
||||||
{
|
{
|
||||||
@ -5719,142 +5527,6 @@ public class PlayerInstance extends Playable
|
|||||||
if (killer != null)
|
if (killer != null)
|
||||||
{
|
{
|
||||||
final PlayerInstance pk = killer.getActingPlayer();
|
final PlayerInstance pk = killer.getActingPlayer();
|
||||||
if (pk != null)
|
|
||||||
{
|
|
||||||
if (Config.ENABLE_PK_INFO)
|
|
||||||
{
|
|
||||||
doPkInfo(pk);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (atEvent)
|
|
||||||
{
|
|
||||||
pk.kills.add(getName());
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_inEventTvT && pk._inEventTvT)
|
|
||||||
{
|
|
||||||
if (TvT.isTeleport() || TvT.isStarted())
|
|
||||||
{
|
|
||||||
if (!(pk._teamNameTvT.equals(_teamNameTvT)))
|
|
||||||
{
|
|
||||||
_countTvTdies++;
|
|
||||||
pk._countTvTkills++;
|
|
||||||
pk.setTitle("Kills: " + pk._countTvTkills);
|
|
||||||
pk.sendPacket(new PlaySound(0, "ItemSound.quest_itemget", this));
|
|
||||||
pk.broadcastUserInfo();
|
|
||||||
TvT.setTeamKillsCount(pk._teamNameTvT, TvT.teamKillsCount(pk._teamNameTvT) + 1);
|
|
||||||
pk.broadcastUserInfo();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
pk.sendMessage("You are a teamkiller !!! Teamkills not counting.");
|
|
||||||
}
|
|
||||||
sendMessage("You will be revived and teleported to team spot in " + (Config.TVT_REVIVE_DELAY / 1000) + " seconds!");
|
|
||||||
ThreadPool.schedule(() ->
|
|
||||||
{
|
|
||||||
teleToLocation((TvT._teamsX.get(TvT._teams.indexOf(_teamNameTvT)) + Rnd.get(201)) - 100, (TvT._teamsY.get(TvT._teams.indexOf(_teamNameTvT)) + Rnd.get(201)) - 100, TvT._teamsZ.get(TvT._teams.indexOf(_teamNameTvT)));
|
|
||||||
doRevive();
|
|
||||||
}, Config.TVT_REVIVE_DELAY);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (_inEventTvT)
|
|
||||||
{
|
|
||||||
if (TvT.isTeleport() || TvT.isStarted())
|
|
||||||
{
|
|
||||||
sendMessage("You will be revived and teleported to team spot in " + (Config.TVT_REVIVE_DELAY / 1000) + " seconds!");
|
|
||||||
ThreadPool.schedule(() ->
|
|
||||||
{
|
|
||||||
teleToLocation(TvT._teamsX.get(TvT._teams.indexOf(_teamNameTvT)), TvT._teamsY.get(TvT._teams.indexOf(_teamNameTvT)), TvT._teamsZ.get(TvT._teams.indexOf(_teamNameTvT)));
|
|
||||||
doRevive();
|
|
||||||
broadcastPacket(new SocialAction(getObjectId(), 15));
|
|
||||||
}, Config.TVT_REVIVE_DELAY);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (_inEventCTF)
|
|
||||||
{
|
|
||||||
if (CTF.isTeleport() || CTF.isStarted())
|
|
||||||
{
|
|
||||||
sendMessage("You will be revived and teleported to team flag in 20 seconds!");
|
|
||||||
if (_haveFlagCTF)
|
|
||||||
{
|
|
||||||
removeCTFFlagOnDie();
|
|
||||||
}
|
|
||||||
ThreadPool.schedule(() ->
|
|
||||||
{
|
|
||||||
teleToLocation(CTF._teamsX.get(CTF._teams.indexOf(_teamNameCTF)), CTF._teamsY.get(CTF._teams.indexOf(_teamNameCTF)), CTF._teamsZ.get(CTF._teams.indexOf(_teamNameCTF)));
|
|
||||||
doRevive();
|
|
||||||
}, 20000);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (_inEventDM && pk._inEventDM)
|
|
||||||
{
|
|
||||||
if (DM.isTeleport() || DM.hasStarted())
|
|
||||||
{
|
|
||||||
pk._countDMkills++;
|
|
||||||
pk.setTitle("Kills: " + pk._countDMkills);
|
|
||||||
pk.sendPacket(new PlaySound(0, "ItemSound.quest_itemget", this));
|
|
||||||
pk.broadcastUserInfo();
|
|
||||||
|
|
||||||
if (Config.DM_ENABLE_KILL_REWARD)
|
|
||||||
{
|
|
||||||
final Item reward = ItemTable.getInstance().getTemplate(Config.DM_KILL_REWARD_ID);
|
|
||||||
pk.getInventory().addItem("DM Kill Reward", Config.DM_KILL_REWARD_ID, Config.DM_KILL_REWARD_AMOUNT, this, null);
|
|
||||||
pk.sendMessage("You have earned " + Config.DM_KILL_REWARD_AMOUNT + " item(s) of ID " + reward.getName() + ".");
|
|
||||||
}
|
|
||||||
|
|
||||||
sendMessage("You will be revived and teleported to spot in 20 seconds!");
|
|
||||||
ThreadPool.schedule(() ->
|
|
||||||
{
|
|
||||||
final Location ploc = DM.getPlayersSpawnLocation();
|
|
||||||
teleToLocation(ploc.getX(), ploc.getY(), ploc.getZ());
|
|
||||||
doRevive();
|
|
||||||
}, Config.DM_REVIVE_DELAY);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (_inEventDM)
|
|
||||||
{
|
|
||||||
if (DM.isTeleport() || DM.hasStarted())
|
|
||||||
{
|
|
||||||
sendMessage("You will be revived and teleported to spot in 20 seconds!");
|
|
||||||
ThreadPool.schedule(() ->
|
|
||||||
{
|
|
||||||
final Location ploc = DM.getPlayersSpawnLocation();
|
|
||||||
teleToLocation(ploc.getX(), ploc.getY(), ploc.getZ());
|
|
||||||
doRevive();
|
|
||||||
}, 20000);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (_inEventVIP && VIP._started)
|
|
||||||
{
|
|
||||||
if (_isTheVIP && !pk._inEventVIP)
|
|
||||||
{
|
|
||||||
AnnouncementsTable.getInstance().announceToAll("VIP Killed by non-event character. VIP going back to initial spawn.");
|
|
||||||
doRevive();
|
|
||||||
teleToLocation(VIP._startX, VIP._startY, VIP._startZ);
|
|
||||||
}
|
|
||||||
else if (_isTheVIP && pk._inEventVIP)
|
|
||||||
{
|
|
||||||
VIP.vipDied();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
sendMessage("You will be revived and teleported to team spot in 20 seconds!");
|
|
||||||
ThreadPool.schedule(() ->
|
|
||||||
{
|
|
||||||
doRevive();
|
|
||||||
if (_isVIP)
|
|
||||||
{
|
|
||||||
teleToLocation(VIP._startX, VIP._startY, VIP._startZ);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
teleToLocation(VIP._endX, VIP._endY, VIP._endZ);
|
|
||||||
}
|
|
||||||
}, 20000);
|
|
||||||
}
|
|
||||||
broadcastUserInfo();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Clear resurrect xp calculation
|
// Clear resurrect xp calculation
|
||||||
setExpBeforeDeath(0);
|
setExpBeforeDeath(0);
|
||||||
@ -5917,39 +5589,25 @@ public class PlayerInstance extends Playable
|
|||||||
|
|
||||||
stopRentPet();
|
stopRentPet();
|
||||||
stopWaterTask();
|
stopWaterTask();
|
||||||
quakeSystem = 0;
|
|
||||||
|
|
||||||
// leave war legend aura if enabled
|
// leave war legend aura if enabled
|
||||||
_heroConsecutiveKillCount = 0;
|
_heroConsecutiveKillCount = 0;
|
||||||
if (Config.WAR_LEGEND_AURA && !_hero && _isPvpHero)
|
if (Config.WAR_LEGEND_AURA && !_hero && _isPvpHero)
|
||||||
{
|
{
|
||||||
setHeroAura(false);
|
setHeroAura(false);
|
||||||
sendMessage("You leaved War Legend State");
|
sendMessage("War Legend state removed.");
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Removes the ctf flag on die.
|
|
||||||
*/
|
|
||||||
public void removeCTFFlagOnDie()
|
|
||||||
{
|
|
||||||
CTF._flagsTaken.set(CTF._teams.indexOf(_teamNameHaveFlagCTF), false);
|
|
||||||
CTF.spawnFlag(_teamNameHaveFlagCTF);
|
|
||||||
CTF.removeFlagFromPlayer(this);
|
|
||||||
broadcastUserInfo();
|
|
||||||
_haveFlagCTF = false;
|
|
||||||
AnnouncementsTable.getInstance().criticalAnnounceToAll(CTF.getEventName() + "(CTF): " + _teamNameHaveFlagCTF + "'s flag returned.");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* On die drop item.
|
* On die drop item.
|
||||||
* @param killer the killer
|
* @param killer the killer
|
||||||
*/
|
*/
|
||||||
private void onDieDropItem(Creature killer)
|
private void onDieDropItem(Creature killer)
|
||||||
{
|
{
|
||||||
if (atEvent || (TvT.isStarted() && _inEventTvT) || (DM.hasStarted() && _inEventDM) || (CTF.isStarted() && _inEventCTF) || (VIP._started && _inEventVIP) || (killer == null))
|
if (isOnCustomEvent())
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -6070,7 +5728,7 @@ public class PlayerInstance extends Playable
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((_inEventCTF && CTF.isStarted()) || (_inEventTvT && TvT.isStarted()) || (_inEventVIP && VIP._started) || (_inEventDM && DM.hasStarted()))
|
if (isOnCustomEvent())
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -6137,7 +5795,7 @@ public class PlayerInstance extends Playable
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 'No war' or 'One way war' -> 'Normal PK'
|
// 'No war' or 'One way war' -> 'Normal PK'
|
||||||
if ((!_inEventTvT || !TvT.isStarted()) || (!_inEventCTF || !CTF.isStarted()) || (!_inEventVIP || !VIP._started) || (!_inEventDM || !DM.hasStarted()))
|
if (!isOnCustomEvent())
|
||||||
{
|
{
|
||||||
if (targetPlayer.getKarma() > 0) // Target player has karma
|
if (targetPlayer.getKarma() > 0) // Target player has karma
|
||||||
{
|
{
|
||||||
@ -6166,7 +5824,7 @@ public class PlayerInstance extends Playable
|
|||||||
AnnouncementsTable.getInstance().announceToAll("Player " + getName() + " killed Player " + target.getName());
|
AnnouncementsTable.getInstance().announceToAll("Player " + getName() + " killed Player " + target.getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_inEventDM && DM.hasStarted())
|
if (isOnCustomEvent())
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -6314,22 +5972,7 @@ public class PlayerInstance extends Playable
|
|||||||
*/
|
*/
|
||||||
public void increasePvpKills()
|
public void increasePvpKills()
|
||||||
{
|
{
|
||||||
final TownZone town = ZoneData.getInstance().getZone(getX(), getY(), getZ(), TownZone.class);
|
if (isOnCustomEvent())
|
||||||
if ((town != null) && isinTownWar())
|
|
||||||
{
|
|
||||||
if ((town.getTownId() == Config.TW_TOWN_ID) && !Config.TW_ALL_TOWNS)
|
|
||||||
{
|
|
||||||
getInventory().addItem("TownWar", Config.TW_ITEM_ID, Config.TW_ITEM_AMOUNT, this, this);
|
|
||||||
sendMessage("You received your prize for a town war kill!");
|
|
||||||
}
|
|
||||||
else if (Config.TW_ALL_TOWNS)
|
|
||||||
{
|
|
||||||
getInventory().addItem("TownWar", Config.TW_ITEM_ID, Config.TW_ITEM_AMOUNT, this, this);
|
|
||||||
sendMessage("You received your prize for a town war kill!");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((TvT.isStarted() && _inEventTvT) || (DM.hasStarted() && _inEventDM) || (CTF.isStarted() && _inEventCTF) || (VIP._started && _inEventVIP))
|
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -6364,230 +6007,17 @@ public class PlayerInstance extends Playable
|
|||||||
updatePvPColor(getPvpKills());
|
updatePvPColor(getPvpKills());
|
||||||
broadcastUserInfo();
|
broadcastUserInfo();
|
||||||
|
|
||||||
if (Config.ALLOW_QUAKE_SYSTEM)
|
|
||||||
{
|
|
||||||
QuakeSystem();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Send a Server->Client UserInfo packet to attacker with its Karma and PK Counter
|
// Send a Server->Client UserInfo packet to attacker with its Karma and PK Counter
|
||||||
sendPacket(new UserInfo(this));
|
sendPacket(new UserInfo(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void QuakeSystem()
|
|
||||||
{
|
|
||||||
quakeSystem++;
|
|
||||||
switch (quakeSystem)
|
|
||||||
{
|
|
||||||
case 5:
|
|
||||||
{
|
|
||||||
if (Config.ENABLE_ANTI_PVP_FARM_MSG)
|
|
||||||
{
|
|
||||||
final CreatureSay cs12 = new CreatureSay(0, ChatType.PARTYROOM_COMMANDER, "", getName() + " 5 consecutive kill! Only Gm."); // 8D
|
|
||||||
for (PlayerInstance player : World.getInstance().getAllPlayers())
|
|
||||||
{
|
|
||||||
if ((player != null) && player.isOnline() && player.isGM())
|
|
||||||
{
|
|
||||||
player.sendPacket(cs12);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 6:
|
|
||||||
{
|
|
||||||
final CreatureSay cs = new CreatureSay(0, ChatType.PARTYROOM_COMMANDER, "", getName() + " is Dominating!"); // 8D
|
|
||||||
for (PlayerInstance player : World.getInstance().getAllPlayers())
|
|
||||||
{
|
|
||||||
if ((player != null) && player.isOnline())
|
|
||||||
{
|
|
||||||
player.sendPacket(cs);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 9:
|
|
||||||
{
|
|
||||||
final CreatureSay cs2 = new CreatureSay(0, ChatType.PARTYROOM_COMMANDER, "", getName() + " is on a Rampage!"); // 8D
|
|
||||||
for (PlayerInstance player : World.getInstance().getAllPlayers())
|
|
||||||
{
|
|
||||||
if ((player != null) && player.isOnline())
|
|
||||||
{
|
|
||||||
player.sendPacket(cs2);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 14:
|
|
||||||
{
|
|
||||||
final CreatureSay cs3 = new CreatureSay(0, ChatType.PARTYROOM_COMMANDER, "", getName() + " is on a Killing Spree!"); // 8D
|
|
||||||
for (PlayerInstance player : World.getInstance().getAllPlayers())
|
|
||||||
{
|
|
||||||
if ((player != null) && player.isOnline())
|
|
||||||
{
|
|
||||||
player.sendPacket(cs3);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 18:
|
|
||||||
{
|
|
||||||
final CreatureSay cs4 = new CreatureSay(0, ChatType.PARTYROOM_COMMANDER, "", getName() + " is on a Monster Kill!"); // 8D
|
|
||||||
for (PlayerInstance player : World.getInstance().getAllPlayers())
|
|
||||||
{
|
|
||||||
if ((player != null) && player.isOnline())
|
|
||||||
{
|
|
||||||
player.sendPacket(cs4);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 22:
|
|
||||||
{
|
|
||||||
final CreatureSay cs5 = new CreatureSay(0, ChatType.PARTYROOM_COMMANDER, "", getName() + " is Unstoppable!"); // 8D
|
|
||||||
for (PlayerInstance player : World.getInstance().getAllPlayers())
|
|
||||||
{
|
|
||||||
if ((player != null) && player.isOnline())
|
|
||||||
{
|
|
||||||
player.sendPacket(cs5);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 25:
|
|
||||||
{
|
|
||||||
final CreatureSay cs6 = new CreatureSay(0, ChatType.PARTYROOM_COMMANDER, "", getName() + " is on an Ultra Kill!"); // 8D
|
|
||||||
for (PlayerInstance player : World.getInstance().getAllPlayers())
|
|
||||||
{
|
|
||||||
if ((player != null) && player.isOnline())
|
|
||||||
{
|
|
||||||
player.sendPacket(cs6);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 28:
|
|
||||||
{
|
|
||||||
final CreatureSay cs7 = new CreatureSay(0, ChatType.PARTYROOM_COMMANDER, "", getName() + " God Blessed!"); // 8D
|
|
||||||
for (PlayerInstance player : World.getInstance().getAllPlayers())
|
|
||||||
{
|
|
||||||
if ((player != null) && player.isOnline())
|
|
||||||
{
|
|
||||||
player.sendPacket(cs7);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 32:
|
|
||||||
{
|
|
||||||
final CreatureSay cs8 = new CreatureSay(0, ChatType.PARTYROOM_COMMANDER, "", getName() + " is Wicked Sick!"); // 8D
|
|
||||||
for (PlayerInstance player : World.getInstance().getAllPlayers())
|
|
||||||
{
|
|
||||||
if ((player != null) && player.isOnline())
|
|
||||||
{
|
|
||||||
player.sendPacket(cs8);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 35:
|
|
||||||
{
|
|
||||||
final CreatureSay cs9 = new CreatureSay(0, ChatType.PARTYROOM_COMMANDER, "", getName() + " is on a Ludricrous Kill!"); // 8D
|
|
||||||
for (PlayerInstance player : World.getInstance().getAllPlayers())
|
|
||||||
{
|
|
||||||
if ((player != null) && player.isOnline())
|
|
||||||
{
|
|
||||||
player.sendPacket(cs9);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 40:
|
|
||||||
{
|
|
||||||
final CreatureSay cs10 = new CreatureSay(0, ChatType.PARTYROOM_COMMANDER, "", getName() + " is GodLike!"); // 8D
|
|
||||||
for (PlayerInstance player : World.getInstance().getAllPlayers())
|
|
||||||
{
|
|
||||||
if ((player != null) && player.isOnline())
|
|
||||||
{
|
|
||||||
player.sendPacket(cs10);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get info on pk's from pk table.
|
|
||||||
* @param playerWhoKilled the player who killed
|
|
||||||
*/
|
|
||||||
public void doPkInfo(PlayerInstance playerWhoKilled)
|
|
||||||
{
|
|
||||||
final String killer = playerWhoKilled.getName();
|
|
||||||
final String killed = getName();
|
|
||||||
int killCount = 0;
|
|
||||||
try (Connection con = DatabaseFactory.getConnection())
|
|
||||||
{
|
|
||||||
final PreparedStatement statement = con.prepareStatement("SELECT kills FROM pkkills WHERE killerId=? AND killedId=?");
|
|
||||||
statement.setString(1, killer);
|
|
||||||
statement.setString(2, killed);
|
|
||||||
final ResultSet rset = statement.executeQuery();
|
|
||||||
if (rset.next())
|
|
||||||
{
|
|
||||||
killCount = rset.getInt("kills");
|
|
||||||
}
|
|
||||||
rset.close();
|
|
||||||
statement.close();
|
|
||||||
}
|
|
||||||
catch (SQLException e)
|
|
||||||
{
|
|
||||||
LOGGER.warning(e.toString());
|
|
||||||
}
|
|
||||||
|
|
||||||
if (killCount >= 1)
|
|
||||||
{
|
|
||||||
killCount++;
|
|
||||||
try (Connection con = DatabaseFactory.getConnection())
|
|
||||||
{
|
|
||||||
final PreparedStatement statement = con.prepareStatement("UPDATE pkkills SET kills=? WHERE killerId=? AND killedId=?");
|
|
||||||
statement.setInt(1, killCount);
|
|
||||||
statement.setString(2, killer);
|
|
||||||
statement.setString(3, killed);
|
|
||||||
statement.execute();
|
|
||||||
statement.close();
|
|
||||||
}
|
|
||||||
catch (SQLException e)
|
|
||||||
{
|
|
||||||
LOGGER.info("Could not update pkKills, got: " + e.getMessage());
|
|
||||||
}
|
|
||||||
sendMessage("You have been killed " + kills + " times by " + playerWhoKilled.getName() + ".");
|
|
||||||
playerWhoKilled.sendMessage("You have killed " + getName() + " " + kills + " times.");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
try (Connection con = DatabaseFactory.getConnection())
|
|
||||||
{
|
|
||||||
final PreparedStatement statement = con.prepareStatement("INSERT INTO pkkills (killerId,killedId,kills) VALUES (?,?,?)");
|
|
||||||
statement.setString(1, killer);
|
|
||||||
statement.setString(2, killed);
|
|
||||||
statement.setInt(3, 1);
|
|
||||||
statement.execute();
|
|
||||||
statement.close();
|
|
||||||
}
|
|
||||||
catch (SQLException e)
|
|
||||||
{
|
|
||||||
LOGGER.info("Could not add pkKills, got: " + e.getMessage());
|
|
||||||
}
|
|
||||||
sendMessage("This is the first time you have been killed by " + playerWhoKilled.getName() + ".");
|
|
||||||
playerWhoKilled.sendMessage("You have killed " + getName() + " for the first time.");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Increase pk count, karma and send the info to the player.
|
* Increase pk count, karma and send the info to the player.
|
||||||
* @param targLVL : level of the killed player
|
* @param targLVL : level of the killed player
|
||||||
*/
|
*/
|
||||||
public void increasePkKillsAndKarma(int targLVL)
|
public void increasePkKillsAndKarma(int targLVL)
|
||||||
{
|
{
|
||||||
if ((TvT.isStarted() && _inEventTvT) || (DM.hasStarted() && _inEventDM) || (CTF.isStarted() && _inEventCTF) || (VIP._started && _inEventVIP))
|
if (isOnCustomEvent())
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -6654,26 +6084,6 @@ public class PlayerInstance extends Playable
|
|||||||
// Add karma to attacker and increase its PK counter
|
// Add karma to attacker and increase its PK counter
|
||||||
setPkKills(getPkKills() + 1);
|
setPkKills(getPkKills() + 1);
|
||||||
|
|
||||||
final TownZone town = ZoneData.getInstance().getZone(getX(), getY(), getZ(), TownZone.class);
|
|
||||||
if ((town == null) || (isinTownWar() && Config.TW_ALLOW_KARMA))
|
|
||||||
{
|
|
||||||
setKarma(getKarma() + newKarma);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((town != null) && isinTownWar())
|
|
||||||
{
|
|
||||||
if ((town.getTownId() == Config.TW_TOWN_ID) && !Config.TW_ALL_TOWNS)
|
|
||||||
{
|
|
||||||
getInventory().addItem("TownWar", Config.TW_ITEM_ID, Config.TW_ITEM_AMOUNT, this, this);
|
|
||||||
sendMessage("You received your prize for a town war kill!");
|
|
||||||
}
|
|
||||||
else if (Config.TW_ALL_TOWNS && (town.getTownId() != 0))
|
|
||||||
{
|
|
||||||
getInventory().addItem("TownWar", Config.TW_ITEM_ID, Config.TW_ITEM_AMOUNT, this, this);
|
|
||||||
sendMessage("You received your prize for a town war kill!");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Config.PVP_PK_TITLE)
|
if (Config.PVP_PK_TITLE)
|
||||||
{
|
{
|
||||||
updateTitle();
|
updateTitle();
|
||||||
@ -6728,7 +6138,7 @@ public class PlayerInstance extends Playable
|
|||||||
*/
|
*/
|
||||||
public void updatePvPStatus()
|
public void updatePvPStatus()
|
||||||
{
|
{
|
||||||
if ((TvT.isStarted() && _inEventTvT) || (CTF.isStarted() && _inEventCTF) || (DM.hasStarted() && _inEventDM) || (VIP._started && _inEventVIP))
|
if (isOnCustomEvent())
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -6766,7 +6176,7 @@ public class PlayerInstance extends Playable
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((TvT.isStarted() && _inEventTvT && targetPlayer._inEventTvT) || (DM.hasStarted() && _inEventDM && targetPlayer._inEventDM) || (CTF.isStarted() && _inEventCTF && targetPlayer._inEventCTF) || (VIP._started && _inEventVIP && targetPlayer._inEventVIP))
|
if (isOnCustomEvent())
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -6848,7 +6258,7 @@ public class PlayerInstance extends Playable
|
|||||||
|
|
||||||
// Calculate the Experience loss
|
// Calculate the Experience loss
|
||||||
long lostExp = 0;
|
long lostExp = 0;
|
||||||
if (!atEvent && (!_inEventTvT || !TvT.isStarted()) && (!_inEventDM || !DM.hasStarted()) && (!_inEventCTF || !CTF.isStarted()) && (!_inEventVIP || !VIP._started))
|
if (!isOnCustomEvent())
|
||||||
{
|
{
|
||||||
final byte maxLevel = ExperienceData.getInstance().getMaxLevel();
|
final byte maxLevel = ExperienceData.getInstance().getMaxLevel();
|
||||||
if (lvl < maxLevel)
|
if (lvl < maxLevel)
|
||||||
@ -6909,7 +6319,6 @@ public class PlayerInstance extends Playable
|
|||||||
stopRentPet();
|
stopRentPet();
|
||||||
stopPvpRegTask();
|
stopPvpRegTask();
|
||||||
stopPunishTask(true);
|
stopPunishTask(true);
|
||||||
quakeSystem = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -9528,7 +8937,7 @@ public class PlayerInstance extends Playable
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((attacker instanceof Playable) && isInFunEvent())
|
if ((attacker instanceof Playable) && isOnCustomEvent())
|
||||||
{
|
{
|
||||||
PlayerInstance player = null;
|
PlayerInstance player = null;
|
||||||
if (attacker instanceof PlayerInstance)
|
if (attacker instanceof PlayerInstance)
|
||||||
@ -9543,9 +8952,9 @@ public class PlayerInstance extends Playable
|
|||||||
if (player != null)
|
if (player != null)
|
||||||
{
|
{
|
||||||
// checks for events
|
// checks for events
|
||||||
if (player.isInFunEvent())
|
if (player.isOnCustomEvent())
|
||||||
{
|
{
|
||||||
return (_inEventTvT && player._inEventTvT && TvT.isStarted() && !_teamNameTvT.equals(player._teamNameTvT)) || (_inEventCTF && player._inEventCTF && CTF.isStarted() && !_teamNameCTF.equals(player._teamNameCTF)) || (_inEventDM && player._inEventDM && DM.hasStarted()) || (_inEventVIP && player._inEventVIP && VIP._started);
|
return (isOnCustomEvent() && player.isOnCustomEvent() && (getTeam() != player.getTeam()));
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -10067,10 +9476,6 @@ public class PlayerInstance extends Playable
|
|||||||
// Check if a Forced ATTACK is in progress on non-attackable target
|
// Check if a Forced ATTACK is in progress on non-attackable target
|
||||||
if (!target.isAutoAttackable(this) //
|
if (!target.isAutoAttackable(this) //
|
||||||
&& (!forceUse && ((skill.getId() != 3260 /* Forgiveness */) && (skill.getId() != 3261 /* Heart Shot */) && (skill.getId() != 3262 /* Double Heart Shot */))) //
|
&& (!forceUse && ((skill.getId() != 3260 /* Forgiveness */) && (skill.getId() != 3261 /* Heart Shot */) && (skill.getId() != 3262 /* Double Heart Shot */))) //
|
||||||
&& (!_inEventTvT || !TvT.isStarted()) //
|
|
||||||
&& (!_inEventDM || !DM.hasStarted()) //
|
|
||||||
&& (!_inEventCTF || !CTF.isStarted()) //
|
|
||||||
&& (!_inEventVIP || !VIP._started) //
|
|
||||||
&& (skillTargetType != SkillTargetType.TARGET_AURA) //
|
&& (skillTargetType != SkillTargetType.TARGET_AURA) //
|
||||||
&& (skillTargetType != SkillTargetType.TARGET_CLAN) //
|
&& (skillTargetType != SkillTargetType.TARGET_CLAN) //
|
||||||
&& (skillTargetType != SkillTargetType.TARGET_ALLY) //
|
&& (skillTargetType != SkillTargetType.TARGET_ALLY) //
|
||||||
@ -10302,16 +9707,9 @@ public class PlayerInstance extends Playable
|
|||||||
WorldObject target = worldObject;
|
WorldObject target = worldObject;
|
||||||
|
|
||||||
// Check if player and target are in events and on the same team.
|
// Check if player and target are in events and on the same team.
|
||||||
if (target instanceof PlayerInstance)
|
if ((target instanceof PlayerInstance) && isOnCustomEvent() && skill.isOffensive())
|
||||||
{
|
{
|
||||||
if ((skill.isOffensive() && (_inEventTvT && target.getActingPlayer()._inEventTvT && TvT.isStarted() && !_teamNameTvT.equals(target.getActingPlayer()._teamNameTvT))) || (_inEventCTF && target.getActingPlayer()._inEventCTF && CTF.isStarted() && !_teamNameCTF.equals(target.getActingPlayer()._teamNameCTF)) || (_inEventDM && target.getActingPlayer()._inEventDM && DM.hasStarted()) || (_inEventVIP && target.getActingPlayer()._inEventVIP && VIP._started))
|
return target.getActingPlayer().isOnCustomEvent() && (getTeam() != target.getActingPlayer().getTeam());
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
else if (isInFunEvent() && skill.isOffensive()) // same team return false
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// check for PC->PC Pvp status
|
// check for PC->PC Pvp status
|
||||||
@ -11596,6 +10994,27 @@ public class PlayerInstance extends Playable
|
|||||||
return _lvlJoinedAcademy > 0;
|
return _lvlJoinedAcademy > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isRegisteredOnCustomEvent()
|
||||||
|
{
|
||||||
|
return _isRegisteredOnCustomEvent || _isOnCustomEvent;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRegisteredOnCustomEvent(boolean value)
|
||||||
|
{
|
||||||
|
_isRegisteredOnCustomEvent = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isOnCustomEvent()
|
||||||
|
{
|
||||||
|
return _isOnCustomEvent;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOnCustomEvent(boolean value)
|
||||||
|
{
|
||||||
|
_isOnCustomEvent = value;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the team.
|
* Sets the team.
|
||||||
* @param team the new team
|
* @param team the new team
|
||||||
@ -12493,7 +11912,7 @@ public class PlayerInstance extends Playable
|
|||||||
getParty().getDimensionalRift().memberRessurected(this);
|
getParty().getDimensionalRift().memberRessurected(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((_inEventTvT && TvT.isStarted() && Config.TVT_REVIVE_RECOVERY) || (_inEventCTF && CTF.isStarted() && Config.CTF_REVIVE_RECOVERY) || (_inEventDM && DM.hasStarted() && Config.DM_REVIVE_RECOVERY))
|
if (isOnCustomEvent())
|
||||||
{
|
{
|
||||||
getStatus().setCurrentHp(getMaxHp());
|
getStatus().setCurrentHp(getMaxHp());
|
||||||
getStatus().setCurrentMp(getMaxMp());
|
getStatus().setCurrentMp(getMaxMp());
|
||||||
@ -14693,26 +14112,6 @@ public class PlayerInstance extends Playable
|
|||||||
_saymode = say;
|
_saymode = say;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Save event stats.
|
|
||||||
*/
|
|
||||||
public void saveEventStats()
|
|
||||||
{
|
|
||||||
_originalNameColor = getAppearance().getNameColor();
|
|
||||||
_originalKarma = getKarma();
|
|
||||||
_eventKills = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Restore event stats.
|
|
||||||
*/
|
|
||||||
public void restoreEventStats()
|
|
||||||
{
|
|
||||||
getAppearance().setNameColor(_originalNameColor);
|
|
||||||
setKarma(_originalKarma);
|
|
||||||
_eventKills = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the current skill world position.
|
* Gets the current skill world position.
|
||||||
* @return the current skill world position
|
* @return the current skill world position
|
||||||
@ -15156,7 +14555,7 @@ public class PlayerInstance extends Playable
|
|||||||
*/
|
*/
|
||||||
public boolean isFalling(int z)
|
public boolean isFalling(int z)
|
||||||
{
|
{
|
||||||
if (isDead() || isFlying() || isInFunEvent() || isInsideZone(ZoneId.WATER))
|
if (isDead() || isFlying() || isInsideZone(ZoneId.WATER))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -15503,22 +14902,6 @@ public class PlayerInstance extends Playable
|
|||||||
sendMessage("You are in jail for " + (delayInMilliseconds / 60000) + " minutes.");
|
sendMessage("You are in jail for " + (delayInMilliseconds / 60000) + " minutes.");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_inEventCTF)
|
|
||||||
{
|
|
||||||
CTF.onDisconnect(this);
|
|
||||||
}
|
|
||||||
else if (_inEventDM)
|
|
||||||
{
|
|
||||||
DM.onDisconnect(this);
|
|
||||||
}
|
|
||||||
else if (_inEventTvT)
|
|
||||||
{
|
|
||||||
TvT.onDisconnect(this);
|
|
||||||
}
|
|
||||||
else if (_inEventVIP)
|
|
||||||
{
|
|
||||||
VIP.onDisconnect(this);
|
|
||||||
}
|
|
||||||
if (Olympiad.getInstance().isRegisteredInComp(this))
|
if (Olympiad.getInstance().isRegisteredInComp(this))
|
||||||
{
|
{
|
||||||
Olympiad.getInstance().removeDisconnectedCompetitor(this);
|
Olympiad.getInstance().removeDisconnectedCompetitor(this);
|
||||||
|
@ -322,8 +322,10 @@ public class VillageMasterInstance extends FolkInstance
|
|||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
player.setLocked(true);
|
player.setLocked(true);
|
||||||
boolean allowAddition = true;
|
boolean allowAddition = true;
|
||||||
|
|
||||||
// Subclass exploit fix during add subclass
|
// Subclass exploit fix during add subclass
|
||||||
if (!player.getFloodProtectors().getSubclass().tryPerformAction("add subclass"))
|
if (!player.getFloodProtectors().getSubclass().tryPerformAction("add subclass"))
|
||||||
{
|
{
|
||||||
@ -331,19 +333,22 @@ public class VillageMasterInstance extends FolkInstance
|
|||||||
player.setLocked(false);
|
player.setLocked(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// You can't add Subclass when you are registered in Events (TVT, CTF, DM)
|
|
||||||
if (player._inEventTvT || player._inEventCTF || player._inEventDM)
|
// You can't add subclass when you are registered in an event.
|
||||||
|
if (player.isRegisteredOnCustomEvent())
|
||||||
{
|
{
|
||||||
player.sendMessage("You can't add a subclass while in an event.");
|
player.sendMessage("You can't add a subclass while in an event.");
|
||||||
player.setLocked(false);
|
player.setLocked(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check player level
|
// Check player level
|
||||||
if (player.getLevel() < 75)
|
if (player.getLevel() < 75)
|
||||||
{
|
{
|
||||||
player.sendMessage("You may not add a new sub class before you are level 75 on your previous class.");
|
player.sendMessage("You may not add a new sub class before you are level 75 on your previous class.");
|
||||||
allowAddition = false;
|
allowAddition = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// You can't add Subclass when you are registered in Olympiad
|
// You can't add Subclass when you are registered in Olympiad
|
||||||
if (Olympiad.getInstance().isRegisteredInComp(player) || (player.getOlympiadGameId() > 0))
|
if (Olympiad.getInstance().isRegisteredInComp(player) || (player.getOlympiadGameId() > 0))
|
||||||
{
|
{
|
||||||
@ -351,6 +356,7 @@ public class VillageMasterInstance extends FolkInstance
|
|||||||
player.setLocked(false);
|
player.setLocked(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (allowAddition && !player.getSubClasses().isEmpty())
|
if (allowAddition && !player.getSubClasses().isEmpty())
|
||||||
{
|
{
|
||||||
for (Iterator<SubClass> subList = iterSubClasses(player); subList.hasNext();)
|
for (Iterator<SubClass> subList = iterSubClasses(player); subList.hasNext();)
|
||||||
@ -364,6 +370,7 @@ public class VillageMasterInstance extends FolkInstance
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// If quest checking is enabled, verify if the character has completed the Mimir's Elixir (Path to Subclass) and Fate's Whisper (A Grade Weapon) quests by checking for instances of their unique reward items.
|
// If quest checking is enabled, verify if the character has completed the Mimir's Elixir (Path to Subclass) and Fate's Whisper (A Grade Weapon) quests by checking for instances of their unique reward items.
|
||||||
// If they both exist, remove both unique items and continue with adding the sub-class.
|
// If they both exist, remove both unique items and continue with adding the sub-class.
|
||||||
if (!Config.ALT_GAME_SUBCLASS_WITHOUT_QUESTS)
|
if (!Config.ALT_GAME_SUBCLASS_WITHOUT_QUESTS)
|
||||||
@ -383,6 +390,7 @@ public class VillageMasterInstance extends FolkInstance
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (allowAddition)
|
if (allowAddition)
|
||||||
{
|
{
|
||||||
final String className = PlayerTemplateData.getInstance().getClassNameById(paramOne);
|
final String className = PlayerTemplateData.getInstance().getClassNameById(paramOne);
|
||||||
@ -416,7 +424,9 @@ public class VillageMasterInstance extends FolkInstance
|
|||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
player.setLocked(true);
|
player.setLocked(true);
|
||||||
|
|
||||||
// Subclass exploit fix during change subclass
|
// Subclass exploit fix during change subclass
|
||||||
if (!player.getFloodProtectors().getSubclass().tryPerformAction("change subclass"))
|
if (!player.getFloodProtectors().getSubclass().tryPerformAction("change subclass"))
|
||||||
{
|
{
|
||||||
@ -424,13 +434,15 @@ public class VillageMasterInstance extends FolkInstance
|
|||||||
player.setLocked(false);
|
player.setLocked(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// You can't change Subclass when you are registered in Events (TVT, CTF, DM)
|
|
||||||
if (player._inEventTvT || player._inEventCTF || player._inEventDM)
|
// You can't change subclass when you are registered in an event.
|
||||||
|
if (player.isRegisteredOnCustomEvent())
|
||||||
{
|
{
|
||||||
player.sendMessage("You can't change subclass while in an event.");
|
player.sendMessage("You can't change subclass while in an event.");
|
||||||
player.setLocked(false);
|
player.setLocked(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// You can't change Subclass when you are registered in Olympiad
|
// You can't change Subclass when you are registered in Olympiad
|
||||||
if (Olympiad.getInstance().isRegisteredInComp(player) || (player.getOlympiadGameId() > 0))
|
if (Olympiad.getInstance().isRegisteredInComp(player) || (player.getOlympiadGameId() > 0))
|
||||||
{
|
{
|
||||||
@ -438,6 +450,7 @@ public class VillageMasterInstance extends FolkInstance
|
|||||||
player.setLocked(false);
|
player.setLocked(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
player.setActiveClass(paramOne);
|
player.setActiveClass(paramOne);
|
||||||
content.append("Change Subclass:<br>Your active sub class is now a <font color=\"LEVEL\">" + PlayerTemplateData.getInstance().getClassNameById(player.getActiveClass()) + "</font>.");
|
content.append("Change Subclass:<br>Your active sub class is now a <font color=\"LEVEL\">" + PlayerTemplateData.getInstance().getClassNameById(player.getActiveClass()) + "</font>.");
|
||||||
player.sendPacket(SystemMessageId.THE_TRANSFER_OF_SUB_CLASS_HAS_BEEN_COMPLETED); // Transfer completed.
|
player.sendPacket(SystemMessageId.THE_TRANSFER_OF_SUB_CLASS_HAS_BEEN_COMPLETED); // Transfer completed.
|
||||||
@ -472,7 +485,9 @@ public class VillageMasterInstance extends FolkInstance
|
|||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
player.setLocked(true);
|
player.setLocked(true);
|
||||||
|
|
||||||
// Subclass exploit fix during delete subclass
|
// Subclass exploit fix during delete subclass
|
||||||
if (!player.getFloodProtectors().getSubclass().tryPerformAction("delete subclass"))
|
if (!player.getFloodProtectors().getSubclass().tryPerformAction("delete subclass"))
|
||||||
{
|
{
|
||||||
@ -480,13 +495,15 @@ public class VillageMasterInstance extends FolkInstance
|
|||||||
player.setLocked(false);
|
player.setLocked(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// You can't delete Subclass when you are registered in Events (TVT, CTF, DM)
|
|
||||||
if (player._inEventTvT || player._inEventCTF || player._inEventDM)
|
// You can't delete subclass when you are registered in an event.
|
||||||
|
if (player.isRegisteredOnCustomEvent())
|
||||||
{
|
{
|
||||||
player.sendMessage("You can't delete a subclass while in an event.");
|
player.sendMessage("You can't delete a subclass while in an event.");
|
||||||
player.setLocked(false);
|
player.setLocked(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// You can't delete Subclass when you are registered in Olympiad
|
// You can't delete Subclass when you are registered in Olympiad
|
||||||
if (Olympiad.getInstance().isRegisteredInComp(player) || (player.getOlympiadGameId() > 0))
|
if (Olympiad.getInstance().isRegisteredInComp(player) || (player.getOlympiadGameId() > 0))
|
||||||
{
|
{
|
||||||
@ -494,6 +511,7 @@ public class VillageMasterInstance extends FolkInstance
|
|||||||
player.setLocked(false);
|
player.setLocked(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (player.modifySubClass(paramOne, paramTwo))
|
if (player.modifySubClass(paramOne, paramTwo))
|
||||||
{
|
{
|
||||||
player.setActiveClass(paramOne);
|
player.setActiveClass(paramOne);
|
||||||
@ -514,6 +532,7 @@ public class VillageMasterInstance extends FolkInstance
|
|||||||
player.setLocked(false);
|
player.setLocked(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
player.setLocked(false);
|
player.setLocked(false);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -20,7 +20,6 @@ import java.util.logging.Logger;
|
|||||||
|
|
||||||
import org.l2jmobius.Config;
|
import org.l2jmobius.Config;
|
||||||
import org.l2jmobius.gameserver.data.xml.ExperienceData;
|
import org.l2jmobius.gameserver.data.xml.ExperienceData;
|
||||||
import org.l2jmobius.gameserver.instancemanager.events.TvT;
|
|
||||||
import org.l2jmobius.gameserver.model.SubClass;
|
import org.l2jmobius.gameserver.model.SubClass;
|
||||||
import org.l2jmobius.gameserver.model.actor.instance.ClassMasterInstance;
|
import org.l2jmobius.gameserver.model.actor.instance.ClassMasterInstance;
|
||||||
import org.l2jmobius.gameserver.model.actor.instance.PetInstance;
|
import org.l2jmobius.gameserver.model.actor.instance.PetInstance;
|
||||||
@ -214,15 +213,6 @@ public class PlayerStat extends PlayableStat
|
|||||||
getActiveChar().sendPacket(SystemMessageId.YOUR_LEVEL_HAS_INCREASED);
|
getActiveChar().sendPacket(SystemMessageId.YOUR_LEVEL_HAS_INCREASED);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getActiveChar().isInFunEvent())
|
|
||||||
{
|
|
||||||
if (getActiveChar()._inEventTvT && (TvT.getMaxLevel() == getLevel()) && !TvT.isStarted())
|
|
||||||
{
|
|
||||||
TvT.removePlayer(getActiveChar());
|
|
||||||
}
|
|
||||||
getActiveChar().sendMessage("Your event sign up was canceled.");
|
|
||||||
}
|
|
||||||
|
|
||||||
getActiveChar().rewardSkills(); // Give Expertise skill of this level
|
getActiveChar().rewardSkills(); // Give Expertise skill of this level
|
||||||
if (getActiveChar().getClan() != null)
|
if (getActiveChar().getClan() != null)
|
||||||
{
|
{
|
||||||
|
@ -1033,9 +1033,10 @@ public class Olympiad
|
|||||||
spectator.sendPacket(SystemMessageId.YOU_MAY_NOT_OBSERVE_A_GRAND_OLYMPIAD_GAMES_MATCH_WHILE_YOU_ARE_ON_THE_WAITING_LIST);
|
spectator.sendPacket(SystemMessageId.YOU_MAY_NOT_OBSERVE_A_GRAND_OLYMPIAD_GAMES_MATCH_WHILE_YOU_ARE_ON_THE_WAITING_LIST);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (spectator.isRegisteredInFunEvent())
|
|
||||||
|
if (spectator.isRegisteredOnCustomEvent())
|
||||||
{
|
{
|
||||||
spectator.sendMessage("You are already registered to an Event");
|
spectator.sendMessage("You are already registered in an event.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -42,11 +42,6 @@ import org.l2jmobius.gameserver.LoginServerThread.SessionKey;
|
|||||||
import org.l2jmobius.gameserver.data.SkillTable;
|
import org.l2jmobius.gameserver.data.SkillTable;
|
||||||
import org.l2jmobius.gameserver.data.sql.ClanTable;
|
import org.l2jmobius.gameserver.data.sql.ClanTable;
|
||||||
import org.l2jmobius.gameserver.data.sql.OfflineTraderTable;
|
import org.l2jmobius.gameserver.data.sql.OfflineTraderTable;
|
||||||
import org.l2jmobius.gameserver.instancemanager.events.CTF;
|
|
||||||
import org.l2jmobius.gameserver.instancemanager.events.DM;
|
|
||||||
import org.l2jmobius.gameserver.instancemanager.events.GameEvent;
|
|
||||||
import org.l2jmobius.gameserver.instancemanager.events.TvT;
|
|
||||||
import org.l2jmobius.gameserver.instancemanager.events.VIP;
|
|
||||||
import org.l2jmobius.gameserver.model.CharSelectInfoPackage;
|
import org.l2jmobius.gameserver.model.CharSelectInfoPackage;
|
||||||
import org.l2jmobius.gameserver.model.World;
|
import org.l2jmobius.gameserver.model.World;
|
||||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||||
@ -57,7 +52,6 @@ import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
|
|||||||
import org.l2jmobius.gameserver.network.serverpackets.LeaveWorld;
|
import org.l2jmobius.gameserver.network.serverpackets.LeaveWorld;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ServerClose;
|
import org.l2jmobius.gameserver.network.serverpackets.ServerClose;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
|
import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
|
||||||
import org.l2jmobius.gameserver.util.EventData;
|
|
||||||
import org.l2jmobius.gameserver.util.FloodProtectors;
|
import org.l2jmobius.gameserver.util.FloodProtectors;
|
||||||
|
|
||||||
import io.netty.channel.Channel;
|
import io.netty.channel.Channel;
|
||||||
@ -596,29 +590,6 @@ public class GameClient extends ChannelInboundHandler<GameClient>
|
|||||||
final PlayerInstance player = _player;
|
final PlayerInstance player = _player;
|
||||||
if (player != null) // this should only happen on connection loss
|
if (player != null) // this should only happen on connection loss
|
||||||
{
|
{
|
||||||
// we store all data from players who are disconnected while in an event in order to restore it in the next login
|
|
||||||
if (player.atEvent)
|
|
||||||
{
|
|
||||||
final EventData data = new EventData(player.eventX, player.eventY, player.eventZ, player.eventKarma, player.eventPvpKills, player.eventPkKills, player.eventTitle, player.kills, player.eventSitForced);
|
|
||||||
GameEvent.connectionLossData.put(player.getName(), data);
|
|
||||||
}
|
|
||||||
else if (player._inEventCTF)
|
|
||||||
{
|
|
||||||
CTF.onDisconnect(player);
|
|
||||||
}
|
|
||||||
else if (player._inEventDM)
|
|
||||||
{
|
|
||||||
DM.onDisconnect(player);
|
|
||||||
}
|
|
||||||
else if (player._inEventTvT)
|
|
||||||
{
|
|
||||||
TvT.onDisconnect(player);
|
|
||||||
}
|
|
||||||
else if (player._inEventVIP)
|
|
||||||
{
|
|
||||||
VIP.onDisconnect(player);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (player.isFlying())
|
if (player.isFlying())
|
||||||
{
|
{
|
||||||
player.removeSkill(SkillTable.getInstance().getSkill(4289, 1));
|
player.removeSkill(SkillTable.getInstance().getSkill(4289, 1));
|
||||||
@ -677,29 +648,6 @@ public class GameClient extends ChannelInboundHandler<GameClient>
|
|||||||
final PlayerInstance player = _player;
|
final PlayerInstance player = _player;
|
||||||
if (player != null) // this should only happen on connection loss
|
if (player != null) // this should only happen on connection loss
|
||||||
{
|
{
|
||||||
// we store all data from players who are disconnected while in an event in order to restore it in the next login
|
|
||||||
if (player.atEvent)
|
|
||||||
{
|
|
||||||
final EventData data = new EventData(player.eventX, player.eventY, player.eventZ, player.eventKarma, player.eventPvpKills, player.eventPkKills, player.eventTitle, player.kills, player.eventSitForced);
|
|
||||||
GameEvent.connectionLossData.put(player.getName(), data);
|
|
||||||
}
|
|
||||||
else if (player._inEventCTF)
|
|
||||||
{
|
|
||||||
CTF.onDisconnect(player);
|
|
||||||
}
|
|
||||||
else if (player._inEventDM)
|
|
||||||
{
|
|
||||||
DM.onDisconnect(player);
|
|
||||||
}
|
|
||||||
else if (player._inEventTvT)
|
|
||||||
{
|
|
||||||
TvT.onDisconnect(player);
|
|
||||||
}
|
|
||||||
else if (player._inEventVIP)
|
|
||||||
{
|
|
||||||
VIP.onDisconnect(player);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (player.isFlying())
|
if (player.isFlying())
|
||||||
{
|
{
|
||||||
player.removeSkill(SkillTable.getInstance().getSkill(4289, 1));
|
player.removeSkill(SkillTable.getInstance().getSkill(4289, 1));
|
||||||
@ -719,7 +667,6 @@ public class GameClient extends ChannelInboundHandler<GameClient>
|
|||||||
if (!player.isKicked() //
|
if (!player.isKicked() //
|
||||||
&& !Olympiad.getInstance().isRegistered(player) //
|
&& !Olympiad.getInstance().isRegistered(player) //
|
||||||
&& !player.isInOlympiadMode() //
|
&& !player.isInOlympiadMode() //
|
||||||
&& !player.isInFunEvent() //
|
|
||||||
&& ((player.isInStoreMode() && Config.OFFLINE_TRADE_ENABLE) //
|
&& ((player.isInStoreMode() && Config.OFFLINE_TRADE_ENABLE) //
|
||||||
|| (player.isCrafting() && Config.OFFLINE_CRAFT_ENABLE)))
|
|| (player.isCrafting() && Config.OFFLINE_CRAFT_ENABLE)))
|
||||||
{
|
{
|
||||||
|
@ -18,9 +18,6 @@ package org.l2jmobius.gameserver.network.clientpackets;
|
|||||||
|
|
||||||
import org.l2jmobius.commons.network.PacketReader;
|
import org.l2jmobius.commons.network.PacketReader;
|
||||||
import org.l2jmobius.commons.util.Chronos;
|
import org.l2jmobius.commons.util.Chronos;
|
||||||
import org.l2jmobius.gameserver.instancemanager.events.CTF;
|
|
||||||
import org.l2jmobius.gameserver.instancemanager.events.DM;
|
|
||||||
import org.l2jmobius.gameserver.instancemanager.events.TvT;
|
|
||||||
import org.l2jmobius.gameserver.model.World;
|
import org.l2jmobius.gameserver.model.World;
|
||||||
import org.l2jmobius.gameserver.model.WorldObject;
|
import org.l2jmobius.gameserver.model.WorldObject;
|
||||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||||
@ -100,19 +97,12 @@ public class AttackRequest implements IClientIncomingPacket
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// During teleport phase, players cant do any attack
|
// No attacks to same team in event
|
||||||
if ((TvT.isTeleport() && player._inEventTvT) || (CTF.isTeleport() && player._inEventCTF) || (DM.isTeleport() && player._inEventDM))
|
if (player.isOnCustomEvent())
|
||||||
{
|
|
||||||
player.sendPacket(ActionFailed.STATIC_PACKET);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// No attacks to same team in Event
|
|
||||||
if (TvT.isStarted())
|
|
||||||
{
|
{
|
||||||
if (target instanceof PlayerInstance)
|
if (target instanceof PlayerInstance)
|
||||||
{
|
{
|
||||||
if ((player._inEventTvT && ((PlayerInstance) target)._inEventTvT) && player._teamNameTvT.equals(((PlayerInstance) target)._teamNameTvT))
|
if (player.getTeam() == ((PlayerInstance) target).getTeam())
|
||||||
{
|
{
|
||||||
player.sendPacket(ActionFailed.STATIC_PACKET);
|
player.sendPacket(ActionFailed.STATIC_PACKET);
|
||||||
return;
|
return;
|
||||||
@ -120,28 +110,7 @@ public class AttackRequest implements IClientIncomingPacket
|
|||||||
}
|
}
|
||||||
else if (target instanceof SummonInstance)
|
else if (target instanceof SummonInstance)
|
||||||
{
|
{
|
||||||
if ((player._inEventTvT && ((SummonInstance) target).getOwner()._inEventTvT) && player._teamNameTvT.equals(((SummonInstance) target).getOwner()._teamNameTvT))
|
if (player.getTeam() == ((SummonInstance) target).getOwner().getTeam())
|
||||||
{
|
|
||||||
player.sendPacket(ActionFailed.STATIC_PACKET);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// No attacks to same team in Event
|
|
||||||
if (CTF.isStarted())
|
|
||||||
{
|
|
||||||
if (target instanceof PlayerInstance)
|
|
||||||
{
|
|
||||||
if ((player._inEventCTF && ((PlayerInstance) target)._inEventCTF) && player._teamNameCTF.equals(((PlayerInstance) target)._teamNameCTF))
|
|
||||||
{
|
|
||||||
player.sendPacket(ActionFailed.STATIC_PACKET);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (target instanceof SummonInstance)
|
|
||||||
{
|
|
||||||
if ((player._inEventCTF && ((SummonInstance) target).getOwner()._inEventCTF) && player._teamNameCTF.equals(((SummonInstance) target).getOwner()._teamNameCTF))
|
|
||||||
{
|
{
|
||||||
player.sendPacket(ActionFailed.STATIC_PACKET);
|
player.sendPacket(ActionFailed.STATIC_PACKET);
|
||||||
return;
|
return;
|
||||||
@ -153,8 +122,7 @@ public class AttackRequest implements IClientIncomingPacket
|
|||||||
{
|
{
|
||||||
target.onAction(player);
|
target.onAction(player);
|
||||||
}
|
}
|
||||||
else if ((target.getObjectId() != player.getObjectId()) && (player.getPrivateStoreType() == 0)
|
else if ((target.getObjectId() != player.getObjectId()) && (player.getPrivateStoreType() == 0) /* && activeChar.getActiveRequester() ==null */)
|
||||||
/* && activeChar.getActiveRequester() ==null */)
|
|
||||||
{
|
{
|
||||||
target.onForcedAttack(player);
|
target.onForcedAttack(player);
|
||||||
}
|
}
|
||||||
|
@ -43,10 +43,6 @@ import org.l2jmobius.gameserver.instancemanager.PetitionManager;
|
|||||||
import org.l2jmobius.gameserver.instancemanager.RebirthManager;
|
import org.l2jmobius.gameserver.instancemanager.RebirthManager;
|
||||||
import org.l2jmobius.gameserver.instancemanager.ServerRestartManager;
|
import org.l2jmobius.gameserver.instancemanager.ServerRestartManager;
|
||||||
import org.l2jmobius.gameserver.instancemanager.SiegeManager;
|
import org.l2jmobius.gameserver.instancemanager.SiegeManager;
|
||||||
import org.l2jmobius.gameserver.instancemanager.events.CTF;
|
|
||||||
import org.l2jmobius.gameserver.instancemanager.events.DM;
|
|
||||||
import org.l2jmobius.gameserver.instancemanager.events.GameEvent;
|
|
||||||
import org.l2jmobius.gameserver.instancemanager.events.TvT;
|
|
||||||
import org.l2jmobius.gameserver.model.Effect;
|
import org.l2jmobius.gameserver.model.Effect;
|
||||||
import org.l2jmobius.gameserver.model.Skill;
|
import org.l2jmobius.gameserver.model.Skill;
|
||||||
import org.l2jmobius.gameserver.model.Wedding;
|
import org.l2jmobius.gameserver.model.Wedding;
|
||||||
@ -208,15 +204,6 @@ public class EnterWorld implements IClientIncomingPacket
|
|||||||
// Apply death penalty
|
// Apply death penalty
|
||||||
player.restoreDeathPenaltyBuffLevel();
|
player.restoreDeathPenaltyBuffLevel();
|
||||||
|
|
||||||
if (GameEvent.active && GameEvent.connectionLossData.containsKey(player.getName()) && GameEvent.isOnEvent(player))
|
|
||||||
{
|
|
||||||
GameEvent.restoreChar(player);
|
|
||||||
}
|
|
||||||
else if (GameEvent.connectionLossData.containsKey(player.getName()))
|
|
||||||
{
|
|
||||||
GameEvent.restoreAndTeleChar(player);
|
|
||||||
}
|
|
||||||
|
|
||||||
// SECURE FIX - Anti Overenchant Cheat!!
|
// SECURE FIX - Anti Overenchant Cheat!!
|
||||||
if (Config.MAX_ITEM_ENCHANT_KICK > 0)
|
if (Config.MAX_ITEM_ENCHANT_KICK > 0)
|
||||||
{
|
{
|
||||||
@ -401,21 +388,6 @@ public class EnterWorld implements IClientIncomingPacket
|
|||||||
RebirthManager.getInstance().grantRebirthSkills(player);
|
RebirthManager.getInstance().grantRebirthSkills(player);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (TvT._savePlayers.contains(player.getName()))
|
|
||||||
{
|
|
||||||
TvT.addDisconnectedPlayer(player);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (CTF._savePlayers.contains(player.getName()))
|
|
||||||
{
|
|
||||||
CTF.addDisconnectedPlayer(player);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (DM._savePlayers.contains(player.getName()))
|
|
||||||
{
|
|
||||||
DM.addDisconnectedPlayer(player);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Means that it's not ok multiBox situation, so logout.
|
// Means that it's not ok multiBox situation, so logout.
|
||||||
if (!player.canMultiBox())
|
if (!player.canMultiBox())
|
||||||
{
|
{
|
||||||
|
@ -50,9 +50,9 @@ public class Logout implements IClientIncomingPacket
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (player.isInFunEvent() && !player.isGM())
|
if (player.isRegisteredOnCustomEvent())
|
||||||
{
|
{
|
||||||
player.sendMessage("You cannot logout while in registered in an event.");
|
player.sendMessage("You cannot logout while registered in an event.");
|
||||||
player.sendPacket(ActionFailed.STATIC_PACKET);
|
player.sendPacket(ActionFailed.STATIC_PACKET);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -87,12 +87,6 @@ public class Logout implements IClientIncomingPacket
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (player.atEvent)
|
|
||||||
{
|
|
||||||
player.sendPacket(SystemMessage.sendString("A superior power doesn't allow you to leave the event."));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (player.isInOlympiadMode() || Olympiad.getInstance().isRegistered(player))
|
if (player.isInOlympiadMode() || Olympiad.getInstance().isRegistered(player))
|
||||||
{
|
{
|
||||||
player.sendMessage("You can't Logout in Olympiad mode.");
|
player.sendMessage("You can't Logout in Olympiad mode.");
|
||||||
|
@ -177,17 +177,20 @@ public class RequestActionUse implements IClientIncomingPacket
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (player.isInOlympiadMode() && !player.isOlympiadStart())
|
if (player.isInOlympiadMode() && !player.isOlympiadStart())
|
||||||
{
|
{
|
||||||
// if PlayerInstance is in Olympia and the match isn't already start, send a Server->Client packet ActionFailed
|
// if PlayerInstance is in Olympia and the match isn't already start, send a Server->Client packet ActionFailed
|
||||||
player.sendPacket(ActionFailed.STATIC_PACKET);
|
player.sendPacket(ActionFailed.STATIC_PACKET);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if ((target instanceof PlayerInstance) && !player.getAccessLevel().allowPeaceAttack() && Creature.isInsidePeaceZone(pet, target) && (!player.isInFunEvent() || !((PlayerInstance) target).isInFunEvent()))
|
|
||||||
|
if ((target instanceof PlayerInstance) && !player.getAccessLevel().allowPeaceAttack() && Creature.isInsidePeaceZone(pet, target) && (!player.isOnCustomEvent() || !((PlayerInstance) target).isOnCustomEvent()))
|
||||||
{
|
{
|
||||||
player.sendPacket(SystemMessageId.YOU_MAY_NOT_ATTACK_THIS_TARGET_IN_A_PEACEFUL_ZONE);
|
player.sendPacket(SystemMessageId.YOU_MAY_NOT_ATTACK_THIS_TARGET_IN_A_PEACEFUL_ZONE);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (target.isAutoAttackable(player) || _ctrlPressed)
|
if (target.isAutoAttackable(player) || _ctrlPressed)
|
||||||
{
|
{
|
||||||
if (target instanceof DoorInstance)
|
if (target instanceof DoorInstance)
|
||||||
@ -274,7 +277,7 @@ public class RequestActionUse implements IClientIncomingPacket
|
|||||||
// A strider cannot be ridden while in battle
|
// A strider cannot be ridden while in battle
|
||||||
player.sendPacket(new SystemMessage(SystemMessageId.A_STRIDER_CANNOT_BE_RIDDEN_WHILE_IN_BATTLE));
|
player.sendPacket(new SystemMessage(SystemMessageId.A_STRIDER_CANNOT_BE_RIDDEN_WHILE_IN_BATTLE));
|
||||||
}
|
}
|
||||||
else if (player.isInFunEvent())
|
else if (player.isOnCustomEvent())
|
||||||
{
|
{
|
||||||
// A strider cannot be ridden while in event
|
// A strider cannot be ridden while in event
|
||||||
player.sendPacket(new SystemMessage(SystemMessageId.A_STRIDER_CANNOT_BE_RIDDEN_WHILE_IN_BATTLE));
|
player.sendPacket(new SystemMessage(SystemMessageId.A_STRIDER_CANNOT_BE_RIDDEN_WHILE_IN_BATTLE));
|
||||||
|
@ -24,11 +24,6 @@ import org.l2jmobius.gameserver.data.xml.AdminData;
|
|||||||
import org.l2jmobius.gameserver.handler.AdminCommandHandler;
|
import org.l2jmobius.gameserver.handler.AdminCommandHandler;
|
||||||
import org.l2jmobius.gameserver.handler.IAdminCommandHandler;
|
import org.l2jmobius.gameserver.handler.IAdminCommandHandler;
|
||||||
import org.l2jmobius.gameserver.instancemanager.RebirthManager;
|
import org.l2jmobius.gameserver.instancemanager.RebirthManager;
|
||||||
import org.l2jmobius.gameserver.instancemanager.events.CTF;
|
|
||||||
import org.l2jmobius.gameserver.instancemanager.events.DM;
|
|
||||||
import org.l2jmobius.gameserver.instancemanager.events.GameEvent;
|
|
||||||
import org.l2jmobius.gameserver.instancemanager.events.TvT;
|
|
||||||
import org.l2jmobius.gameserver.instancemanager.events.VIP;
|
|
||||||
import org.l2jmobius.gameserver.model.Location;
|
import org.l2jmobius.gameserver.model.Location;
|
||||||
import org.l2jmobius.gameserver.model.World;
|
import org.l2jmobius.gameserver.model.World;
|
||||||
import org.l2jmobius.gameserver.model.WorldObject;
|
import org.l2jmobius.gameserver.model.WorldObject;
|
||||||
@ -156,99 +151,6 @@ public class RequestBypassToServer implements IClientIncomingPacket
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (_command.substring(endOfId + 1).startsWith("event_participate"))
|
|
||||||
{
|
|
||||||
GameEvent.inscribePlayer(player);
|
|
||||||
}
|
|
||||||
else if (_command.substring(endOfId + 1).startsWith("tvt_player_join "))
|
|
||||||
{
|
|
||||||
final String teamName = _command.substring(endOfId + 1).substring(16);
|
|
||||||
if (TvT.isJoining())
|
|
||||||
{
|
|
||||||
TvT.addPlayer(player, teamName);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
player.sendMessage("The event is already started. You can not join now!");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (_command.substring(endOfId + 1).startsWith("tvt_player_leave"))
|
|
||||||
{
|
|
||||||
if (TvT.isJoining())
|
|
||||||
{
|
|
||||||
TvT.removePlayer(player);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
player.sendMessage("The event is already started. You can not leave now!");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (_command.substring(endOfId + 1).startsWith("dmevent_player_join"))
|
|
||||||
{
|
|
||||||
if (DM.isJoining())
|
|
||||||
{
|
|
||||||
DM.addPlayer(player);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
player.sendMessage("The event is already started. You can't join now!");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (_command.substring(endOfId + 1).startsWith("dmevent_player_leave"))
|
|
||||||
{
|
|
||||||
if (DM.isJoining())
|
|
||||||
{
|
|
||||||
DM.removePlayer(player);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
player.sendMessage("The event is already started. You can't leave now!");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (_command.substring(endOfId + 1).startsWith("ctf_player_join "))
|
|
||||||
{
|
|
||||||
final String teamName = _command.substring(endOfId + 1).substring(16);
|
|
||||||
if (CTF.isJoining())
|
|
||||||
{
|
|
||||||
CTF.addPlayer(player, teamName);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
player.sendMessage("The event is already started. You can't join now!");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (_command.substring(endOfId + 1).startsWith("ctf_player_leave"))
|
|
||||||
{
|
|
||||||
if (CTF.isJoining())
|
|
||||||
{
|
|
||||||
CTF.removePlayer(player);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
player.sendMessage("The event is already started. You can't leave now!");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_command.substring(endOfId + 1).startsWith("vip_joinVIPTeam"))
|
|
||||||
{
|
|
||||||
VIP.addPlayerVIP(player);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_command.substring(endOfId + 1).startsWith("vip_joinNotVIPTeam"))
|
|
||||||
{
|
|
||||||
VIP.addPlayerNotVIP(player);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_command.substring(endOfId + 1).startsWith("vip_finishVIP"))
|
|
||||||
{
|
|
||||||
VIP.vipWin(player);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_command.substring(endOfId + 1).startsWith("event_participate"))
|
|
||||||
{
|
|
||||||
GameEvent.inscribePlayer(player);
|
|
||||||
}
|
|
||||||
|
|
||||||
final WorldObject object = World.getInstance().findObject(Integer.parseInt(id));
|
final WorldObject object = World.getInstance().findObject(Integer.parseInt(id));
|
||||||
if ((Config.ALLOW_CLASS_MASTERS && Config.ALLOW_REMOTE_CLASS_MASTERS && (object instanceof ClassMasterInstance)) //
|
if ((Config.ALLOW_CLASS_MASTERS && Config.ALLOW_REMOTE_CLASS_MASTERS && (object instanceof ClassMasterInstance)) //
|
||||||
|| ((object instanceof NpcInstance) && (endOfId > 0) && player.isInsideRadius2D(object, NpcInstance.INTERACTION_DISTANCE)))
|
|| ((object instanceof NpcInstance) && (endOfId > 0) && player.isInsideRadius2D(object, NpcInstance.INTERACTION_DISTANCE)))
|
||||||
|
@ -17,9 +17,6 @@
|
|||||||
package org.l2jmobius.gameserver.network.clientpackets;
|
package org.l2jmobius.gameserver.network.clientpackets;
|
||||||
|
|
||||||
import org.l2jmobius.commons.network.PacketReader;
|
import org.l2jmobius.commons.network.PacketReader;
|
||||||
import org.l2jmobius.gameserver.instancemanager.events.CTF;
|
|
||||||
import org.l2jmobius.gameserver.instancemanager.events.DM;
|
|
||||||
import org.l2jmobius.gameserver.instancemanager.events.TvT;
|
|
||||||
import org.l2jmobius.gameserver.model.BlockList;
|
import org.l2jmobius.gameserver.model.BlockList;
|
||||||
import org.l2jmobius.gameserver.model.Party;
|
import org.l2jmobius.gameserver.model.Party;
|
||||||
import org.l2jmobius.gameserver.model.World;
|
import org.l2jmobius.gameserver.model.World;
|
||||||
@ -54,7 +51,7 @@ public class RequestJoinParty implements IClientIncomingPacket
|
|||||||
|
|
||||||
if (!client.getFloodProtectors().getPartyInvitation().tryPerformAction("PartyInvitation"))
|
if (!client.getFloodProtectors().getPartyInvitation().tryPerformAction("PartyInvitation"))
|
||||||
{
|
{
|
||||||
requestor.sendMessage("You Cannot Invite into Party So Fast!");
|
requestor.sendMessage("You cannot invite into party so fast!");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -64,18 +61,6 @@ public class RequestJoinParty implements IClientIncomingPacket
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((requestor._inEventDM && (DM.isTeleport() || DM.hasStarted())) || (target._inEventDM && (DM.isTeleport() || DM.hasStarted())))
|
|
||||||
{
|
|
||||||
requestor.sendMessage("You can't invite that player in party!");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((requestor._inEventTvT && !target._inEventTvT && (TvT.isStarted() || TvT.isTeleport())) || (!requestor._inEventTvT && target._inEventTvT && (TvT.isStarted() || TvT.isTeleport())) || (requestor._inEventCTF && !target._inEventCTF && (CTF.isStarted() || CTF.isTeleport())) || (!requestor._inEventCTF && target._inEventCTF && (CTF.isStarted() || CTF.isTeleport())))
|
|
||||||
{
|
|
||||||
requestor.sendMessage("You can't invite that player in party: you or your target are in Event");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (target.isInParty())
|
if (target.isInParty())
|
||||||
{
|
{
|
||||||
final SystemMessage msg = new SystemMessage(SystemMessageId.S1_IS_A_MEMBER_OF_ANOTHER_PARTY_AND_CANNOT_BE_INVITED);
|
final SystemMessage msg = new SystemMessage(SystemMessageId.S1_IS_A_MEMBER_OF_ANOTHER_PARTY_AND_CANNOT_BE_INVITED);
|
||||||
|
@ -116,10 +116,10 @@ public class RequestRestart implements IClientIncomingPacket
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if player is in Event
|
// Check if player is in an event.
|
||||||
if (player._inEventCTF || player._inEventDM || player._inEventTvT || player._inEventVIP)
|
if (player.isRegisteredOnCustomEvent())
|
||||||
{
|
{
|
||||||
player.sendMessage("You can't restart during Event.");
|
player.sendMessage("You can't restart while registered in an event.");
|
||||||
player.sendPacket(RestartResponse.valueOf(false));
|
player.sendPacket(RestartResponse.valueOf(false));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -24,12 +24,11 @@ import org.l2jmobius.gameserver.enums.TeleportWhereType;
|
|||||||
import org.l2jmobius.gameserver.instancemanager.CastleManager;
|
import org.l2jmobius.gameserver.instancemanager.CastleManager;
|
||||||
import org.l2jmobius.gameserver.instancemanager.ClanHallManager;
|
import org.l2jmobius.gameserver.instancemanager.ClanHallManager;
|
||||||
import org.l2jmobius.gameserver.instancemanager.FortManager;
|
import org.l2jmobius.gameserver.instancemanager.FortManager;
|
||||||
import org.l2jmobius.gameserver.instancemanager.events.CTF;
|
import org.l2jmobius.gameserver.instancemanager.QuestManager;
|
||||||
import org.l2jmobius.gameserver.instancemanager.events.DM;
|
|
||||||
import org.l2jmobius.gameserver.instancemanager.events.TvT;
|
|
||||||
import org.l2jmobius.gameserver.model.Location;
|
import org.l2jmobius.gameserver.model.Location;
|
||||||
import org.l2jmobius.gameserver.model.SiegeClan;
|
import org.l2jmobius.gameserver.model.SiegeClan;
|
||||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||||
|
import org.l2jmobius.gameserver.model.quest.Quest;
|
||||||
import org.l2jmobius.gameserver.model.residences.ClanHall;
|
import org.l2jmobius.gameserver.model.residences.ClanHall;
|
||||||
import org.l2jmobius.gameserver.model.siege.Castle;
|
import org.l2jmobius.gameserver.model.siege.Castle;
|
||||||
import org.l2jmobius.gameserver.model.siege.Fort;
|
import org.l2jmobius.gameserver.model.siege.Fort;
|
||||||
@ -74,6 +73,19 @@ public class RequestRestartPoint implements IClientIncomingPacket
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Custom event resurrection management.
|
||||||
|
if (player.isOnCustomEvent())
|
||||||
|
{
|
||||||
|
// This is an example, replace EventScriptName with proper event script name.
|
||||||
|
final Quest eventScript = QuestManager.getInstance().getQuest("EventScriptName");
|
||||||
|
if (eventScript != null)
|
||||||
|
{
|
||||||
|
// Notify onAdvEvent ResurrectPlayer event.
|
||||||
|
eventScript.notifyEvent("ResurrectPlayer", null, player);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
final Castle castle = CastleManager.getInstance().getCastle(player.getX(), player.getY(), player.getZ());
|
final Castle castle = CastleManager.getInstance().getCastle(player.getX(), player.getY(), player.getZ());
|
||||||
if ((castle != null) && castle.getSiege().isInProgress() && (player.getClan() != null) && castle.getSiege().checkIsAttacker(player.getClan()))
|
if ((castle != null) && castle.getSiege().isInProgress() && (player.getClan() != null) && castle.getSiege().checkIsAttacker(player.getClan()))
|
||||||
{
|
{
|
||||||
@ -99,9 +111,9 @@ public class RequestRestartPoint implements IClientIncomingPacket
|
|||||||
@Override
|
@Override
|
||||||
public void run()
|
public void run()
|
||||||
{
|
{
|
||||||
if ((_player._inEventTvT && TvT.isStarted()) || (_player._inEventDM && DM.hasStarted()) || (_player._inEventCTF && CTF.isStarted()))
|
if (_player.isOnCustomEvent())
|
||||||
{
|
{
|
||||||
_player.sendMessage("You cannot restart while participating in an event!");
|
_player.sendMessage("You cannot do that while participating in an event!");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -52,12 +52,6 @@ public class RequestUnEquipItem implements IClientIncomingPacket
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (player._haveFlagCTF)
|
|
||||||
{
|
|
||||||
player.sendMessage("You can't unequip a CTF flag.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
final ItemInstance item = player.getInventory().getPaperdollItemByItemId(_slot);
|
final ItemInstance item = player.getInventory().getPaperdollItemByItemId(_slot);
|
||||||
if ((item != null) && item.isWear())
|
if ((item != null) && item.isWear())
|
||||||
{
|
{
|
||||||
|
@ -99,13 +99,6 @@ public class TradeRequest implements IClientIncomingPacket
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (partner.isInFunEvent())
|
|
||||||
{
|
|
||||||
player.sendMessage("You can't request a trade when partner in event.");
|
|
||||||
player.sendPacket(ActionFailed.STATIC_PACKET);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (partner.getActiveEnchantItem() != null)
|
if (partner.getActiveEnchantItem() != null)
|
||||||
{
|
{
|
||||||
player.sendMessage("You can't request a trade when partner is enchanting.");
|
player.sendMessage("You can't request a trade when partner is enchanting.");
|
||||||
@ -162,13 +155,6 @@ public class TradeRequest implements IClientIncomingPacket
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (player.isInFunEvent())
|
|
||||||
{
|
|
||||||
player.sendMessage("You can't request a trade when you are in event.");
|
|
||||||
player.sendPacket(ActionFailed.STATIC_PACKET);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (player.getActiveEnchantItem() != null)
|
if (player.getActiveEnchantItem() != null)
|
||||||
{
|
{
|
||||||
player.sendMessage("You can't request a trade when you enchanting.");
|
player.sendMessage("You can't request a trade when you enchanting.");
|
||||||
|
@ -307,16 +307,9 @@ public class UseItem implements IClientIncomingPacket
|
|||||||
int bodyPart = item.getItem().getBodyPart();
|
int bodyPart = item.getItem().getBodyPart();
|
||||||
|
|
||||||
// Like L2OFF you can't use equips while you are casting
|
// Like L2OFF you can't use equips while you are casting
|
||||||
if ((player.isCastingNow() || player.isCastingPotionNow() || player.isMounted() || (player._inEventCTF && player._haveFlagCTF)))
|
if ((player.isCastingNow() || player.isCastingPotionNow() || player.isMounted()))
|
||||||
{
|
{
|
||||||
if (player._inEventCTF && player._haveFlagCTF)
|
player.sendPacket(new SystemMessage(SystemMessageId.YOU_MAY_NOT_EQUIP_ITEMS_WHILE_CASTING_OR_PERFORMING_A_SKILL));
|
||||||
{
|
|
||||||
player.sendMessage("This item can not be equipped when you have the flag.");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
player.sendPacket(new SystemMessage(SystemMessageId.YOU_MAY_NOT_EQUIP_ITEMS_WHILE_CASTING_OR_PERFORMING_A_SKILL));
|
|
||||||
}
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,9 +19,6 @@ package org.l2jmobius.gameserver.network.serverpackets;
|
|||||||
import org.l2jmobius.commons.network.PacketWriter;
|
import org.l2jmobius.commons.network.PacketWriter;
|
||||||
import org.l2jmobius.gameserver.instancemanager.CastleManager;
|
import org.l2jmobius.gameserver.instancemanager.CastleManager;
|
||||||
import org.l2jmobius.gameserver.instancemanager.FortManager;
|
import org.l2jmobius.gameserver.instancemanager.FortManager;
|
||||||
import org.l2jmobius.gameserver.instancemanager.events.CTF;
|
|
||||||
import org.l2jmobius.gameserver.instancemanager.events.DM;
|
|
||||||
import org.l2jmobius.gameserver.instancemanager.events.TvT;
|
|
||||||
import org.l2jmobius.gameserver.model.SiegeClan;
|
import org.l2jmobius.gameserver.model.SiegeClan;
|
||||||
import org.l2jmobius.gameserver.model.actor.Attackable;
|
import org.l2jmobius.gameserver.model.actor.Attackable;
|
||||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||||
@ -49,7 +46,7 @@ public class Die implements IClientOutgoingPacket
|
|||||||
final PlayerInstance player = creature.getActingPlayer();
|
final PlayerInstance player = creature.getActingPlayer();
|
||||||
_allowFixedRes = player.getAccessLevel().allowFixedRes();
|
_allowFixedRes = player.getAccessLevel().allowFixedRes();
|
||||||
_clan = player.getClan();
|
_clan = player.getClan();
|
||||||
_canTeleport = ((!TvT.isStarted() || !player._inEventTvT) && (!DM.hasStarted() || !player._inEventDM) && (!CTF.isStarted() || !player._inEventCTF) && !player.isInFunEvent() && !player.isPendingRevive());
|
_canTeleport = !player.isPendingRevive();
|
||||||
}
|
}
|
||||||
_objectId = creature.getObjectId();
|
_objectId = creature.getObjectId();
|
||||||
_fake = !creature.isDead();
|
_fake = !creature.isDead();
|
||||||
|
@ -1,28 +0,0 @@
|
|||||||
-- --------------------------------
|
|
||||||
-- Table structure for table `ctf`
|
|
||||||
-- Created by SqueezeD & Serpent for l2jfree
|
|
||||||
-- --------------------------------
|
|
||||||
DROP TABLE IF EXISTS `ctf`;
|
|
||||||
CREATE TABLE `ctf` (
|
|
||||||
`eventName` varchar(255) NOT NULL default '',
|
|
||||||
`eventDesc` varchar(255) NOT NULL default '',
|
|
||||||
`joiningLocation` varchar(255) NOT NULL default '',
|
|
||||||
`minLevel` int(4) NOT NULL default '0',
|
|
||||||
`maxLevel` int(4) NOT NULL default '0',
|
|
||||||
`npcId` int(8) NOT NULL default '0',
|
|
||||||
`npcX` int(11) NOT NULL default '0',
|
|
||||||
`npcY` int(11) NOT NULL default '0',
|
|
||||||
`npcZ` int(11) NOT NULL default '0',
|
|
||||||
`npcHeading` int(11) NOT NULL default '0',
|
|
||||||
`rewardId` int(11) NOT NULL default '0',
|
|
||||||
`rewardAmount` int(11) NOT NULL default '0',
|
|
||||||
`teamsCount` int(4) NOT NULL default '0',
|
|
||||||
`joinTime` int(11) NOT NULL default '0',
|
|
||||||
`eventTime` int(11) NOT NULL default '0',
|
|
||||||
`minPlayers` int(4) NOT NULL default '0',
|
|
||||||
`maxPlayers` int(4) NOT NULL default '0',
|
|
||||||
`delayForNextEvent` BIGINT NOT NULL DEFAULT '0'
|
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
||||||
|
|
||||||
INSERT INTO `ctf` (`eventName`, `eventDesc`, `joiningLocation`, `minLevel`, `maxLevel`, `npcId`, `npcX`, `npcY`, `npcZ`, `npcHeading`, `rewardId`, `rewardAmount`, `teamsCount`, `joinTime`, `eventTime`, `minPlayers`, `maxPlayers`, `delayForNextEvent`) VALUES
|
|
||||||
('Capture the flag', 'CTF', 'Giran', 1, 80, 70011, 82580, 148552, -3468, 16972, 8752, 1, 2, 5, 5, 2, 50, 300000);
|
|
@ -1,21 +0,0 @@
|
|||||||
-- --------------------------------
|
|
||||||
-- Table structure for ctf_teams
|
|
||||||
-- Created by SqueezeD & Serpent for l2jfree
|
|
||||||
-- --------------------------------
|
|
||||||
DROP TABLE IF EXISTS `ctf_teams`;
|
|
||||||
CREATE TABLE `ctf_teams` (
|
|
||||||
`teamId` int(4) NOT NULL default '0',
|
|
||||||
`teamName` varchar(255) NOT NULL default '',
|
|
||||||
`teamX` int(11) NOT NULL default '0',
|
|
||||||
`teamY` int(11) NOT NULL default '0',
|
|
||||||
`teamZ` int(11) NOT NULL default '0',
|
|
||||||
`teamColor` int(11) NOT NULL default '0',
|
|
||||||
`flagX` int(11) NOT NULL default '0',
|
|
||||||
`flagY` int(11) NOT NULL default '0',
|
|
||||||
`flagZ` int(11) NOT NULL default '0',
|
|
||||||
PRIMARY KEY (`teamId`)
|
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
||||||
|
|
||||||
INSERT INTO `ctf_teams` (`teamId`, `teamName`, `teamX`, `teamY`, `teamZ`, `teamColor`, `flagX`, `flagY`, `flagZ`) VALUES
|
|
||||||
(0, 'Blue', 87357, -145722, -1288, 16711680, 87358, -145979, -1291),
|
|
||||||
(1, 'Red', 87351, -139984, -1536, 255, 87359, -139584, -1536);
|
|
@ -53,9 +53,4 @@ INSERT ignore INTO custom_npc values
|
|||||||
('50000', '31228', 'Dom the Cat', '1', 'Merchant', '1', 'Monster.cat_the_cat', '9.00', '16.00', '70', 'male', 'Merchant', '40', '3862', '1493', '11.85', '2.78', '40', '43', '30', '21', '20', '10', '490', '10', '1335', '470', '780', '382', '278', '0', '333', '0', '0', '0', '88', '132', null, '0', '0', '0', 'LAST_HIT'),
|
('50000', '31228', 'Dom the Cat', '1', 'Merchant', '1', 'Monster.cat_the_cat', '9.00', '16.00', '70', 'male', 'Merchant', '40', '3862', '1493', '11.85', '2.78', '40', '43', '30', '21', '20', '10', '490', '10', '1335', '470', '780', '382', '278', '0', '333', '0', '0', '0', '88', '132', null, '0', '0', '0', 'LAST_HIT'),
|
||||||
('50007', '31324', 'Andromeda', '1', 'Wedding Manager', '1', 'NPC.a_casino_FDarkElf', '8.00', '23.00', '70', 'female', 'WeddingManager', '40', '3862', '1493', '500', '500', '40', '43', '30', '21', '20', '10', '0', '0', '9999', '9999', '999', '999', '278', '0', '333', '316', '0', '0', '55', '132', null, '0', '1', '0', 'LAST_HIT'),
|
('50007', '31324', 'Andromeda', '1', 'Wedding Manager', '1', 'NPC.a_casino_FDarkElf', '8.00', '23.00', '70', 'female', 'WeddingManager', '40', '3862', '1493', '500', '500', '40', '43', '30', '21', '20', '10', '0', '0', '9999', '9999', '999', '999', '278', '0', '333', '316', '0', '0', '55', '132', null, '0', '1', '0', 'LAST_HIT'),
|
||||||
('50008', '31228', 'Rex the Cat', '1', 'Buffer', '1', 'Monster.cat_the_cat', '9.00', '16.00', '70', 'male', 'SchemeBuffer', '40', '3862', '1493', '11.85', '2.78', '40', '43', '30', '21', '20', '10', '490', '10', '1335', '470', '780', '382', '278', '0', '333', '0', '0', '0', '88', '132', null, '0', '0', '0', 'LAST_HIT'),
|
('50008', '31228', 'Rex the Cat', '1', 'Buffer', '1', 'Monster.cat_the_cat', '9.00', '16.00', '70', 'male', 'SchemeBuffer', '40', '3862', '1493', '11.85', '2.78', '40', '43', '30', '21', '20', '10', '490', '10', '1335', '470', '780', '382', '278', '0', '333', '0', '0', '0', '88', '132', null, '0', '0', '0', 'LAST_HIT'),
|
||||||
('55555', '22124', 'Totor', '1', 'Rebirth Manager', '1', 'NPC.a_fighterguild_master_FHuman', '11.00', '27.00', '83', 'male', 'Merchant', '40', '3862', '1493', '11.85', '2.78', '40', '43', '30', '21', '20', '10', '0', '0', '1314', '470', '780', '382', '278', '0', '333', '0', '0', '0', '88', '132', null, '0', '0', '0', 'LAST_HIT'),
|
('55555', '22124', 'Totor', '1', 'Rebirth Manager', '1', 'NPC.a_fighterguild_master_FHuman', '11.00', '27.00', '83', 'male', 'Merchant', '40', '3862', '1493', '11.85', '2.78', '40', '43', '30', '21', '20', '10', '0', '0', '1314', '470', '780', '382', '278', '0', '333', '0', '0', '0', '88', '132', null, '0', '0', '0', 'LAST_HIT');
|
||||||
('70010', '31606', 'Catrina', '1', 'TvT Event Manager', '1', 'Monster2.queen_of_cat', '8.00', '15.00', '70', 'female', 'Npc', '40', '3862', '1493', '11.85', '2.78', '40', '43', '30', '21', '20', '10', '0', '0', '1314', '470', '780', '382', '278', '0', '333', '0', '0', '0', '28', '132', null, '0', '0', '0', 'LAST_HIT'),
|
|
||||||
('70011', '31606', 'Catretta', '1', 'CTF Event Manager', '1', 'Monster2.queen_of_cat', '8.00', '15.00', '70', 'female', 'Npc', '40', '3862', '1493', '11.85', '2.78', '40', '43', '30', '21', '20', '10', '0', '0', '1314', '470', '780', '382', '278', '0', '333', '0', '0', '0', '28', '132', null, '0', '0', '0', 'LAST_HIT'),
|
|
||||||
('70012', '31606', 'Catrosa', '1', 'VIP Join Manager', '1', 'Monster2.queen_of_cat', '8.00', '15.00', '70', 'female', 'Npc', '40', '3862', '1493', '11.85', '2.78', '40', '43', '30', '21', '20', '10', '0', '0', '1314', '470', '780', '382', '278', '0', '333', '0', '0', '0', '28', '132', null, '0', '0', '0', 'LAST_HIT'),
|
|
||||||
('70013', '31606', 'Catrigna', '1', 'VIP End Manager', '1', 'Monster2.queen_of_cat', '8.00', '15.00', '70', 'female', 'Npc', '40', '3862', '1493', '11.85', '2.78', '40', '43', '30', '21', '20', '10', '0', '0', '1314', '470', '780', '382', '278', '0', '333', '0', '0', '0', '28', '132', null, '0', '0', '0', 'LAST_HIT'),
|
|
||||||
('70014', '31606', 'Catrieta', '1', 'DM Event Manager', '1', 'Monster2.queen_of_cat', '8.00', '15.00', '70', 'female', 'Npc', '40', '3862', '1493', '11.85', '2.78', '40', '43', '30', '21', '20', '10', '0', '0', '1314', '470', '780', '382', '278', '0', '333', '0', '0', '0', '28', '132', null, '0', '0', '0', 'LAST_HIT');
|
|
||||||
|
@ -1,31 +0,0 @@
|
|||||||
-- --------------------------------
|
|
||||||
-- Table structure for table `dm`
|
|
||||||
-- Created by SqueezeD from l2jfree
|
|
||||||
-- --------------------------------
|
|
||||||
DROP TABLE IF EXISTS `dm`;
|
|
||||||
CREATE TABLE `dm` (
|
|
||||||
`eventName` varchar(255) NOT NULL default '',
|
|
||||||
`eventDesc` varchar(255) NOT NULL default '',
|
|
||||||
`joiningLocation` varchar(255) NOT NULL default '',
|
|
||||||
`minLevel` int(4) NOT NULL default '0',
|
|
||||||
`maxLevel` int(4) NOT NULL default '0',
|
|
||||||
`npcId` int(8) NOT NULL default '0',
|
|
||||||
`npcX` int(11) NOT NULL default '0',
|
|
||||||
`npcY` int(11) NOT NULL default '0',
|
|
||||||
`npcZ` int(11) NOT NULL default '0',
|
|
||||||
`npcHeading` int(11) NOT NULL DEFAULT '0',
|
|
||||||
`rewardId` int(11) NOT NULL default '0',
|
|
||||||
`rewardAmount` int(11) NOT NULL default '0',
|
|
||||||
`joinTime` int(11) NOT NULL DEFAULT '0',
|
|
||||||
`eventTime` int(11) NOT NULL DEFAULT '0',
|
|
||||||
`minPlayers` int(11) NOT NULL DEFAULT '0',
|
|
||||||
`maxPlayers` int(11) NOT NULL DEFAULT '0',
|
|
||||||
`color` int(11) NOT NULL default '0',
|
|
||||||
`playerX` int(11) NOT NULL default '0',
|
|
||||||
`playerY` int(11) NOT NULL default '0',
|
|
||||||
`playerZ` int(11) NOT NULL default '0',
|
|
||||||
`delayForNextEvent` BIGINT NOT NULL DEFAULT '0'
|
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
||||||
|
|
||||||
INSERT INTO `dm` values
|
|
||||||
('DM', 'A PvP Event', 'Giran', 1, 81, 70014, 82580, 148552, -3468, 1, 8752, 1, 2, 5, 2, 50, 2552550, 116615, 76200, -2729, 300000);
|
|
@ -1,9 +0,0 @@
|
|||||||
#----------------------------
|
|
||||||
# Table structure for pkkills
|
|
||||||
#----------------------------
|
|
||||||
CREATE TABLE IF NOT EXISTS `pkkills` (
|
|
||||||
`killerId` varchar(45) NOT NULL,
|
|
||||||
`killedId` varchar(45) NOT NULL,
|
|
||||||
`kills` decimal(11,0) NOT NULL,
|
|
||||||
PRIMARY KEY (`killerId` ,`killedId` )
|
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
@ -1,30 +0,0 @@
|
|||||||
-- -----------------------
|
|
||||||
-- Table structure for tvt
|
|
||||||
-- -----------------------
|
|
||||||
DROP TABLE IF EXISTS `tvt`;
|
|
||||||
CREATE TABLE `tvt` (
|
|
||||||
`eventName` varchar(255) NOT NULL DEFAULT '',
|
|
||||||
`eventDesc` varchar(255) NOT NULL DEFAULT '',
|
|
||||||
`joiningLocation` varchar(255) NOT NULL DEFAULT '',
|
|
||||||
`minLevel` int(4) NOT NULL DEFAULT '0',
|
|
||||||
`maxLevel` int(4) NOT NULL DEFAULT '0',
|
|
||||||
`npcId` int(8) NOT NULL DEFAULT '0',
|
|
||||||
`npcX` int(11) NOT NULL DEFAULT '0',
|
|
||||||
`npcY` int(11) NOT NULL DEFAULT '0',
|
|
||||||
`npcZ` int(11) NOT NULL DEFAULT '0',
|
|
||||||
`npcHeading` int(11) NOT NULL DEFAULT '0',
|
|
||||||
`rewardId` int(11) NOT NULL DEFAULT '0',
|
|
||||||
`rewardAmount` int(11) NOT NULL DEFAULT '0',
|
|
||||||
`teamsCount` int(4) NOT NULL DEFAULT '0',
|
|
||||||
`joinTime` int(11) NOT NULL DEFAULT '0',
|
|
||||||
`eventTime` int(11) NOT NULL DEFAULT '0',
|
|
||||||
`minPlayers` int(4) NOT NULL DEFAULT '0',
|
|
||||||
`maxPlayers` int(4) NOT NULL DEFAULT '0',
|
|
||||||
`delayForNextEvent` BIGINT NOT NULL DEFAULT '0'
|
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
||||||
|
|
||||||
-- ---------------------
|
|
||||||
-- Records for table tvt
|
|
||||||
-- ---------------------
|
|
||||||
INSERT INTO `tvt` values
|
|
||||||
('TVT', 'A PvP Event', 'Giran', 1, 81, 70010, 82688, 148677, -3469, 0, 8752, 1, 2, 5, 5, 2, 50, 300000);
|
|
@ -1,21 +0,0 @@
|
|||||||
-- -----------------------------
|
|
||||||
-- Table structure for tvt_teams
|
|
||||||
-- -----------------------------
|
|
||||||
DROP TABLE IF EXISTS `tvt_teams`;
|
|
||||||
CREATE TABLE `tvt_teams` (
|
|
||||||
`teamId` int(4) NOT NULL DEFAULT '0',
|
|
||||||
`teamName` varchar(255) NOT NULL DEFAULT '',
|
|
||||||
`teamX` int(11) NOT NULL DEFAULT '0',
|
|
||||||
`teamY` int(11) NOT NULL DEFAULT '0',
|
|
||||||
`teamZ` int(11) NOT NULL DEFAULT '0',
|
|
||||||
`teamColor` int(11) NOT NULL DEFAULT '0',
|
|
||||||
PRIMARY KEY (`teamId`)
|
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
||||||
|
|
||||||
-- ---------------------------
|
|
||||||
-- Records for table tvt_teams
|
|
||||||
-- ---------------------------
|
|
||||||
INSERT INTO `tvt_teams` VALUES
|
|
||||||
('0', 'Blue', '148179', '45841', '-3413', '16711680'),
|
|
||||||
('1', 'Red', '150787', '45822', '-3413', '255'),
|
|
||||||
('2', 'Green', '149496', '47826', '-3413', '26367');
|
|
@ -1,20 +0,0 @@
|
|||||||
CREATE TABLE `VIPinfo` (
|
|
||||||
`teamID` int(11) NOT NULL,
|
|
||||||
`endx` int(11) NOT NULL,
|
|
||||||
`endy` int(11) NOT NULL,
|
|
||||||
`endz` int(11) NOT NULL,
|
|
||||||
`startx` int(11) NOT NULL,
|
|
||||||
`starty` int(11) NOT NULL,
|
|
||||||
`startz` int(11) NOT NULL,
|
|
||||||
PRIMARY KEY (`teamID`)
|
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;
|
|
||||||
|
|
||||||
--
|
|
||||||
-- Dumping data for table `VIPinfo`
|
|
||||||
--
|
|
||||||
|
|
||||||
INSERT INTO `VIPinfo` VALUES (1, -84583, 242788, -3735, -101319, 213272, -3100);
|
|
||||||
INSERT INTO `VIPinfo` VALUES (2, 45714, 49703, -3065, 55782, 81597, -3610);
|
|
||||||
INSERT INTO `VIPinfo` VALUES (3, 11249, 16890, -4667, -22732, 12586, -2996);
|
|
||||||
INSERT INTO `VIPinfo` VALUES (4, -44737, -113582, -204, 27053, -88454, -3286);
|
|
||||||
INSERT INTO `VIPinfo` VALUES (5, 116047, -179059, -1026, 121145, -215673, -3571);
|
|
@ -67,43 +67,6 @@
|
|||||||
<admin command="admin_create_coin" accessLevel="80" />
|
<admin command="admin_create_coin" accessLevel="80" />
|
||||||
<admin command="admin_mass_create" accessLevel="100" />
|
<admin command="admin_mass_create" accessLevel="100" />
|
||||||
|
|
||||||
<!-- Section: CTF -->
|
|
||||||
<admin command="admin_ctf" accessLevel="80" />
|
|
||||||
<admin command="admin_ctf_name" accessLevel="80" />
|
|
||||||
<admin command="admin_ctf_desc" accessLevel="80" />
|
|
||||||
<admin command="admin_ctf_join_loc" accessLevel="80" />
|
|
||||||
<admin command="admin_ctf_edit" accessLevel="80" />
|
|
||||||
<admin command="admin_ctf_control" accessLevel="80" />
|
|
||||||
<admin command="admin_ctf_minlvl" accessLevel="80" />
|
|
||||||
<admin command="admin_ctf_maxlvl" accessLevel="80" />
|
|
||||||
<admin command="admin_ctf_tele_npc" accessLevel="80" />
|
|
||||||
<admin command="admin_ctf_tele_team" accessLevel="80" />
|
|
||||||
<admin command="admin_ctf_tele_flag" accessLevel="80" />
|
|
||||||
<admin command="admin_ctf_npc" accessLevel="80" />
|
|
||||||
<admin command="admin_ctf_npc_pos" accessLevel="80" />
|
|
||||||
<admin command="admin_ctf_reward" accessLevel="80" />
|
|
||||||
<admin command="admin_ctf_reward_amount" accessLevel="80" />
|
|
||||||
<admin command="admin_ctf_team_add" accessLevel="80" />
|
|
||||||
<admin command="admin_ctf_team_remove" accessLevel="80" />
|
|
||||||
<admin command="admin_ctf_team_pos" accessLevel="80" />
|
|
||||||
<admin command="admin_ctf_team_color" accessLevel="80" />
|
|
||||||
<admin command="admin_ctf_team_flag" accessLevel="80" />
|
|
||||||
<admin command="admin_ctf_join" accessLevel="80" />
|
|
||||||
<admin command="admin_ctf_teleport" accessLevel="80" />
|
|
||||||
<admin command="admin_ctf_start" accessLevel="80" />
|
|
||||||
<admin command="admin_ctf_abort" accessLevel="80" />
|
|
||||||
<admin command="admin_ctf_finish" accessLevel="80" />
|
|
||||||
<admin command="admin_ctf_sit" accessLevel="80" />
|
|
||||||
<admin command="admin_ctf_dump" accessLevel="80" />
|
|
||||||
<admin command="admin_ctf_save" accessLevel="80" />
|
|
||||||
<admin command="admin_ctf_load" accessLevel="80" />
|
|
||||||
<admin command="admin_ctf_jointime" accessLevel="80" />
|
|
||||||
<admin command="admin_ctf_eventtime" accessLevel="80" />
|
|
||||||
<admin command="admin_ctf_autoevent" accessLevel="80" />
|
|
||||||
<admin command="admin_ctf_minplayers" accessLevel="80" />
|
|
||||||
<admin command="admin_ctf_maxplayers" accessLevel="80" />
|
|
||||||
<admin command="admin_ctf_interval" accessLevel="80" />
|
|
||||||
|
|
||||||
<!-- Section: CursedWeapons -->
|
<!-- Section: CursedWeapons -->
|
||||||
<admin command="admin_cw_info" accessLevel="90" />
|
<admin command="admin_cw_info" accessLevel="90" />
|
||||||
<admin command="admin_cw_remove" accessLevel="90" />
|
<admin command="admin_cw_remove" accessLevel="90" />
|
||||||
@ -124,29 +87,6 @@
|
|||||||
<!-- Section: Disconnect -->
|
<!-- Section: Disconnect -->
|
||||||
<admin command="admin_character_disconnect" accessLevel="90" />
|
<admin command="admin_character_disconnect" accessLevel="90" />
|
||||||
|
|
||||||
<!-- Section: DMEngine -->
|
|
||||||
<admin command="admin_dmevent" accessLevel="80" />
|
|
||||||
<admin command="admin_dmevent_name" accessLevel="80" />
|
|
||||||
<admin command="admin_dmevent_desc" accessLevel="80" />
|
|
||||||
<admin command="admin_dmevent_join_loc" accessLevel="80" />
|
|
||||||
<admin command="admin_dmevent_minlvl" accessLevel="80" />
|
|
||||||
<admin command="admin_dmevent_maxlvl" accessLevel="80" />
|
|
||||||
<admin command="admin_dmevent_npc" accessLevel="80" />
|
|
||||||
<admin command="admin_dmevent_npc_pos" accessLevel="80" />
|
|
||||||
<admin command="admin_dmevent_reward" accessLevel="80" />
|
|
||||||
<admin command="admin_dmevent_reward_amount" accessLevel="80" />
|
|
||||||
<admin command="admin_dmevent_spawnpos" accessLevel="80" />
|
|
||||||
<admin command="admin_dmevent_color" accessLevel="80" />
|
|
||||||
<admin command="admin_dmevent_join" accessLevel="80" />
|
|
||||||
<admin command="admin_dmevent_teleport" accessLevel="80" />
|
|
||||||
<admin command="admin_dmevent_start" accessLevel="80" />
|
|
||||||
<admin command="admin_dmevent_abort" accessLevel="80" />
|
|
||||||
<admin command="admin_dmevent_finish" accessLevel="80" />
|
|
||||||
<admin command="admin_dmevent_sit" accessLevel="80" />
|
|
||||||
<admin command="admin_dmevent_dump" accessLevel="80" />
|
|
||||||
<admin command="admin_dmevent_save" accessLevel="80" />
|
|
||||||
<admin command="admin_dmevent_load" accessLevel="80" />
|
|
||||||
|
|
||||||
<!-- Section: Donator -->
|
<!-- Section: Donator -->
|
||||||
<admin command="admin_setdonator" accessLevel="100" />
|
<admin command="admin_setdonator" accessLevel="100" />
|
||||||
|
|
||||||
@ -261,29 +201,6 @@
|
|||||||
<admin command="admin_setba" accessLevel="90" />
|
<admin command="admin_setba" accessLevel="90" />
|
||||||
<admin command="admin_enchant" accessLevel="90" />
|
<admin command="admin_enchant" accessLevel="90" />
|
||||||
|
|
||||||
<!-- Section: EventEngine -->
|
|
||||||
<admin command="admin_event" accessLevel="80" />
|
|
||||||
<admin command="admin_event_new" accessLevel="80" />
|
|
||||||
<admin command="admin_event_choose" accessLevel="80" />
|
|
||||||
<admin command="admin_event_store" accessLevel="80" />
|
|
||||||
<admin command="admin_event_set" accessLevel="80" />
|
|
||||||
<admin command="admin_event_change_teams_number" accessLevel="80" />
|
|
||||||
<admin command="admin_event_announce" accessLevel="80" />
|
|
||||||
<admin command="admin_event_panel" accessLevel="80" />
|
|
||||||
<admin command="admin_event_control_begin" accessLevel="80" />
|
|
||||||
<admin command="admin_event_control_teleport" accessLevel="80" />
|
|
||||||
<admin command="admin_add" accessLevel="80" />
|
|
||||||
<admin command="admin_event_see" accessLevel="80" />
|
|
||||||
<admin command="admin_event_del" accessLevel="80" />
|
|
||||||
<admin command="admin_delete_buffer" accessLevel="80" />
|
|
||||||
<admin command="admin_event_control_sit" accessLevel="80" />
|
|
||||||
<admin command="admin_event_name" accessLevel="80" />
|
|
||||||
<admin command="admin_event_control_kill" accessLevel="80" />
|
|
||||||
<admin command="admin_event_control_res" accessLevel="80" />
|
|
||||||
<admin command="admin_event_control_prize" accessLevel="80" />
|
|
||||||
<admin command="admin_event_control_chatban" accessLevel="80" />
|
|
||||||
<admin command="admin_event_control_finish" accessLevel="80" />
|
|
||||||
|
|
||||||
<!-- Section: ExpSp -->
|
<!-- Section: ExpSp -->
|
||||||
<admin command="admin_add_exp_sp_to_character" accessLevel="90" />
|
<admin command="admin_add_exp_sp_to_character" accessLevel="90" />
|
||||||
<admin command="admin_add_exp_sp" accessLevel="90" />
|
<admin command="admin_add_exp_sp" accessLevel="90" />
|
||||||
@ -543,59 +460,6 @@
|
|||||||
<admin command="admin_st" accessLevel="80" />
|
<admin command="admin_st" accessLevel="80" />
|
||||||
<admin command="admin_mp" accessLevel="80" />
|
<admin command="admin_mp" accessLevel="80" />
|
||||||
|
|
||||||
<!-- Section: TownWar -->
|
|
||||||
<admin command="admin_townwar_start" accessLevel="80" />
|
|
||||||
<admin command="admin_townwar_end" accessLevel="80" />
|
|
||||||
|
|
||||||
<!-- Section: TvTEngine -->
|
|
||||||
<admin command="admin_tvt" accessLevel="80" />
|
|
||||||
<admin command="admin_tvt_name" accessLevel="80" />
|
|
||||||
<admin command="admin_tvt_desc" accessLevel="80" />
|
|
||||||
<admin command="admin_tvt_join_loc" accessLevel="80" />
|
|
||||||
<admin command="admin_tvt_minlvl" accessLevel="80" />
|
|
||||||
<admin command="admin_tvt_maxlvl" accessLevel="80" />
|
|
||||||
<admin command="admin_tvt_npc" accessLevel="80" />
|
|
||||||
<admin command="admin_tvt_npc_pos" accessLevel="80" />
|
|
||||||
<admin command="admin_tvt_reward" accessLevel="80" />
|
|
||||||
<admin command="admin_tvt_reward_amount" accessLevel="80" />
|
|
||||||
<admin command="admin_tvt_team_add" accessLevel="80" />
|
|
||||||
<admin command="admin_tvt_team_remove" accessLevel="80" />
|
|
||||||
<admin command="admin_tvt_team_pos" accessLevel="80" />
|
|
||||||
<admin command="admin_tvt_team_color" accessLevel="80" />
|
|
||||||
<admin command="admin_tvt_join" accessLevel="80" />
|
|
||||||
<admin command="admin_tvt_teleport" accessLevel="80" />
|
|
||||||
<admin command="admin_tvt_start" accessLevel="80" />
|
|
||||||
<admin command="admin_tvt_abort" accessLevel="80" />
|
|
||||||
<admin command="admin_tvt_finish" accessLevel="80" />
|
|
||||||
<admin command="admin_tvt_sit" accessLevel="80" />
|
|
||||||
<admin command="admin_tvt_dump" accessLevel="80" />
|
|
||||||
<admin command="admin_tvt_save" accessLevel="80" />
|
|
||||||
<admin command="admin_tvt_load" accessLevel="80" />
|
|
||||||
<admin command="admin_tvt_jointime" accessLevel="80" />
|
|
||||||
<admin command="admin_tvt_eventtime" accessLevel="80" />
|
|
||||||
<admin command="admin_tvt_autoevent" accessLevel="80" />
|
|
||||||
<admin command="admin_tvt_minplayers" accessLevel="80" />
|
|
||||||
<admin command="admin_tvt_maxplayers" accessLevel="80" />
|
|
||||||
<admin command="admin_tvtkick" accessLevel="80" />
|
|
||||||
|
|
||||||
<!-- Section: VIPEngine -->
|
|
||||||
<admin command="admin_vip" accessLevel="80" />
|
|
||||||
<admin command="admin_vip_setteam" accessLevel="80" />
|
|
||||||
<admin command="admin_vip_randomteam" accessLevel="80" />
|
|
||||||
<admin command="admin_vip_settime" accessLevel="80" />
|
|
||||||
<admin command="admin_vip_endnpc" accessLevel="80" />
|
|
||||||
<admin command="admin_vip_setdelay" accessLevel="80" />
|
|
||||||
<admin command="admin_vip_joininit" accessLevel="80" />
|
|
||||||
<admin command="admin_vip_joinnpc" accessLevel="80" />
|
|
||||||
<admin command="admin_vip_joinlocxyz" accessLevel="80" />
|
|
||||||
<admin command="admin_vip_setarea" accessLevel="80" />
|
|
||||||
<admin command="admin_vip_vipreward" accessLevel="80" />
|
|
||||||
<admin command="admin_vip_viprewardamount" accessLevel="80" />
|
|
||||||
<admin command="admin_vip_thevipreward" accessLevel="80" />
|
|
||||||
<admin command="admin_vip_theviprewardamount" accessLevel="80" />
|
|
||||||
<admin command="admin_vip_notvipreward" accessLevel="80" />
|
|
||||||
<admin command="admin_vip_notviprewardamount" accessLevel="80" />
|
|
||||||
|
|
||||||
<!-- Section: Walker -->
|
<!-- Section: Walker -->
|
||||||
<admin command="admin_walker_setmessage" accessLevel="80" />
|
<admin command="admin_walker_setmessage" accessLevel="80" />
|
||||||
<admin command="admin_walker_menu" accessLevel="80" />
|
<admin command="admin_walker_menu" accessLevel="80" />
|
||||||
|
@ -223,47 +223,6 @@ DonatorDropRate = 1.5
|
|||||||
DonatorSpoilRate = 1.5
|
DonatorSpoilRate = 1.5
|
||||||
|
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------
|
|
||||||
# Commands
|
|
||||||
# ---------------------------------------------------------------------------
|
|
||||||
|
|
||||||
# Allow players to use command .farm1
|
|
||||||
AllowFarm1Command = False
|
|
||||||
# Put your Farm1 Location ( x,y,z )
|
|
||||||
farm1_X = 81304
|
|
||||||
farm1_Y = 14589
|
|
||||||
farm1_Z = -3469
|
|
||||||
# Message after successful TP
|
|
||||||
Farm1CustomMeesage = You have been teleported to Farm Zone 1!
|
|
||||||
|
|
||||||
# Allow players to use command .farm2
|
|
||||||
AllowFarm2Command = False
|
|
||||||
# Put your Farm2 Location ( x,y,z )
|
|
||||||
farm2_X = 81304
|
|
||||||
farm2_Y = 14589
|
|
||||||
farm2_Z = -3469
|
|
||||||
# Message after successful TP
|
|
||||||
Farm2CustomMeesage = You have been teleported to Farm Zone 2!
|
|
||||||
|
|
||||||
# Allow players to use command .pvp1
|
|
||||||
AllowPvP1Command = False
|
|
||||||
# Put your Farm1 Location ( x,y,z )
|
|
||||||
pvp1_X = 81304
|
|
||||||
pvp1_Y = 14589
|
|
||||||
pvp1_Z = -3469
|
|
||||||
# Message after successful TP
|
|
||||||
PvP1CustomMeesage = You have been teleported to PvP Zone 1!
|
|
||||||
|
|
||||||
# Allow players to use command .pvp2
|
|
||||||
AllowPvP2Command = False
|
|
||||||
# Put your Farm2 Location ( x,y,z )
|
|
||||||
pvp2_X = 81304
|
|
||||||
pvp2_Y = 14589
|
|
||||||
pvp2_Z = -3469
|
|
||||||
# Message after successful TP
|
|
||||||
PvP2CustomMeesage = You have been teleported to PvP Zone 2!
|
|
||||||
|
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
# Protector
|
# Protector
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
|
@ -1,54 +0,0 @@
|
|||||||
#============================================================#
|
|
||||||
# CTF Event Engine #
|
|
||||||
#============================================================#
|
|
||||||
# CTF(Capture the flag) Event: Two teams with one flag.
|
|
||||||
|
|
||||||
# Setting for Capture The Flag
|
|
||||||
# CTFEvenTeams = NO|BALANCE|SHUFFLE
|
|
||||||
# NO means: not even teams.
|
|
||||||
# BALANCE means: Players can only join team with lowest player count.
|
|
||||||
# SHUFFLE means: Players can only participate to tzhe event and not
|
|
||||||
# direct to a team. Teams will be schuffeled in teleporting teams.
|
|
||||||
CTFEvenTeams = SHUFFLE
|
|
||||||
|
|
||||||
# Players there not participated in ctf can target ctf participants?
|
|
||||||
CTFAllowInterference = False
|
|
||||||
|
|
||||||
# Ctf participants can use potions?
|
|
||||||
CTFAllowPotions = False
|
|
||||||
|
|
||||||
# Ctf participants can summon by item?
|
|
||||||
CTFAllowSummon = False
|
|
||||||
|
|
||||||
# Remove all effects of ctf participants on event start?
|
|
||||||
CTFOnStartRemoveAllEffects = True
|
|
||||||
|
|
||||||
# Unsummon pet of ctf participants on event start?
|
|
||||||
CTFOnStartUnsummonPet = True
|
|
||||||
|
|
||||||
# On revive participants regain full hp/mp/cp ?
|
|
||||||
CTFReviveRecovery = False
|
|
||||||
|
|
||||||
# Announce all team statistics
|
|
||||||
CTFAnnounceTeamStats = False
|
|
||||||
|
|
||||||
# Announce Reward
|
|
||||||
CTFAnnounceReward = False
|
|
||||||
|
|
||||||
# Players with cursed weapon are allowed to join ?
|
|
||||||
CTFJoinWithCursedWeapon = True
|
|
||||||
|
|
||||||
# Enable voice command to register on tvt/ctf events
|
|
||||||
CTFCommand = True
|
|
||||||
|
|
||||||
# Place an aura on participants team ?
|
|
||||||
CTFAura = False
|
|
||||||
|
|
||||||
# Enable event stats logger
|
|
||||||
CTFStatsLogger = True
|
|
||||||
|
|
||||||
# Spawn Team Offset to distribute players
|
|
||||||
CTFSpawnOffset = 300
|
|
||||||
|
|
||||||
# Remove Buffs on player die
|
|
||||||
CTFRemoveBuffsOnPlayerDie = False
|
|
@ -1,55 +0,0 @@
|
|||||||
#============================================================#
|
|
||||||
# DM Event Engine #
|
|
||||||
#============================================================#
|
|
||||||
# DM(DeathMatch) Event: All vs All.
|
|
||||||
|
|
||||||
# Players there not participated in DM can target DM participants?
|
|
||||||
DMAllowInterference = False
|
|
||||||
|
|
||||||
# DM participants can use potions?
|
|
||||||
DMAllowPotions = False
|
|
||||||
|
|
||||||
# DM participants can summon by item?
|
|
||||||
DMAllowSummon = False
|
|
||||||
|
|
||||||
# Players with cursed weapon are allowed to join ?
|
|
||||||
DMJoinWithCursedWeapon = False
|
|
||||||
|
|
||||||
# Remove all effects of DM participants on event start?
|
|
||||||
DMOnStartRemoveAllEffects = True
|
|
||||||
|
|
||||||
# Unsummon pet of DM participants on event start?
|
|
||||||
DMOnStartUnsummonPet = True
|
|
||||||
|
|
||||||
# Delay on revive when dead, NOTE: 20000 equals to 20 seconds, minimum 1000 (1 second)
|
|
||||||
DMReviveDelay = 20000
|
|
||||||
|
|
||||||
# On revive participants regain full hp/mp/cp ?
|
|
||||||
DMReviveRecovery = False
|
|
||||||
|
|
||||||
# Enable voice command to register on dm events (.dmjoin / .dmleave / .dminfo)
|
|
||||||
DMCommand = True
|
|
||||||
|
|
||||||
# Announce Reward
|
|
||||||
DMAnnounceReward = False
|
|
||||||
|
|
||||||
# Enable Kill Reward?
|
|
||||||
DMEnableKillReward = False
|
|
||||||
|
|
||||||
# Kill Reward ID
|
|
||||||
DMKillRewardID = 6392
|
|
||||||
|
|
||||||
# Kill Reward Amount
|
|
||||||
DMKillRewardAmount = 1
|
|
||||||
|
|
||||||
# Offset from center DM Spawn
|
|
||||||
DMSpawnOffset = 100
|
|
||||||
|
|
||||||
# Enable event stats logger
|
|
||||||
DMStatsLogger = True
|
|
||||||
|
|
||||||
# Enable healer classes into DM
|
|
||||||
DMAllowedHealerClasses = True
|
|
||||||
|
|
||||||
# Remove Buffs on player die
|
|
||||||
DMRemoveBuffsOnPlayerDie = False
|
|
@ -1,19 +0,0 @@
|
|||||||
#============================================================#
|
|
||||||
# Event Manager #
|
|
||||||
#============================================================#
|
|
||||||
# Enable auto events and start time.
|
|
||||||
|
|
||||||
# TvT auto start
|
|
||||||
# Example TVTStartTime = 20:00;21:00;22:00;
|
|
||||||
TVTEventEnabled = False
|
|
||||||
TVTStartTime = 20:00;
|
|
||||||
|
|
||||||
# CTF auto start
|
|
||||||
# Example CTFStartTime = 20:00;21:00;22:00;
|
|
||||||
CTFEventEnabled = False
|
|
||||||
CTFStartTime = 20:30;
|
|
||||||
|
|
||||||
# DM auto start
|
|
||||||
# Example DMStartTime = 20:00;21:00;22:00;
|
|
||||||
DMEventEnabled = False
|
|
||||||
DMStartTime = 21:00;
|
|
@ -1,48 +0,0 @@
|
|||||||
#============================================================#
|
|
||||||
# Town War #
|
|
||||||
#============================================================#
|
|
||||||
# TW (Town War): Town can became PvP Zone.
|
|
||||||
# ATTENTION:
|
|
||||||
# GM char can't be hit during Town war.
|
|
||||||
|
|
||||||
# //townwar_start - Starts town war in Giran
|
|
||||||
# //townwar_end - Ends townwar in Giran
|
|
||||||
# Town id
|
|
||||||
# 2: // Talking Island
|
|
||||||
# 3: // Elven village
|
|
||||||
# 1: // Dark elf village
|
|
||||||
# 4: // Orc village
|
|
||||||
# 6: // Dwarven village
|
|
||||||
# 7: // Gludio
|
|
||||||
# 5: // Gludin
|
|
||||||
# 8: // Dion
|
|
||||||
# 9: // Giran
|
|
||||||
# 10: // Oren
|
|
||||||
# 12: // Aden
|
|
||||||
# 11: // Hunters village
|
|
||||||
# 9: // Giran Harbour
|
|
||||||
# 15: // Heine
|
|
||||||
# 14: // Rune
|
|
||||||
# 13: // Goddard
|
|
||||||
# 17: // Schuttgart
|
|
||||||
# 16: // Floran
|
|
||||||
# 20: //Kamael Village
|
|
||||||
TWTownId = 9
|
|
||||||
|
|
||||||
# Set all towns?
|
|
||||||
TWAllTowns = False
|
|
||||||
|
|
||||||
# Reward for each kill
|
|
||||||
TownWarItemId = 57
|
|
||||||
TownWarItemAmount = 5000
|
|
||||||
|
|
||||||
# Give PKers karma during townwar?
|
|
||||||
AllowKarma = False
|
|
||||||
|
|
||||||
# Disable GK while in event?
|
|
||||||
DisableGK = True
|
|
||||||
|
|
||||||
# If yes it will send a ressurect ask on death.
|
|
||||||
# If no when you die youll be there dead until the event ends.
|
|
||||||
# Set to false if you want KOTH town.
|
|
||||||
SendRessOnDeath = True
|
|
@ -1,74 +0,0 @@
|
|||||||
#====================================#
|
|
||||||
# Team vs Team #
|
|
||||||
#====================================#
|
|
||||||
# TvT(Team vs Team) Event: Blue vs Red.
|
|
||||||
|
|
||||||
# Setting for Team vs. Team pvp
|
|
||||||
# TvTEvenTeams = NO|BALANCE|SHUFFLE
|
|
||||||
# NO means: not even teams.
|
|
||||||
# BALANCE means: Players can only join team with lowest player count.
|
|
||||||
# SHUFFLE means: Players can only participate to tzhe event and not direct to a team. Teams will be schuffeled in teleporting teams.
|
|
||||||
TvTEvenTeams = SHUFFLE
|
|
||||||
|
|
||||||
# players there not participated in tvt can target tvt participants?
|
|
||||||
TvTAllowInterference = False
|
|
||||||
|
|
||||||
# tvt participants can use potions?
|
|
||||||
TvTAllowPotions = True
|
|
||||||
|
|
||||||
# tvt participants can summon by item?
|
|
||||||
TvTAllowSummon = True
|
|
||||||
|
|
||||||
# remove all effects of tvt participants on event start?
|
|
||||||
TvTOnStartRemoveAllEffects = True
|
|
||||||
|
|
||||||
# unsummon pet of tvt participants on event start?
|
|
||||||
TvTOnStartUnsummonPet = True
|
|
||||||
|
|
||||||
# on revive participants regain full hp/mp/cp ?
|
|
||||||
TvTReviveRecovery = True
|
|
||||||
|
|
||||||
# announce all team statistics
|
|
||||||
TvTAnnounceTeamStats = True
|
|
||||||
|
|
||||||
# announce reward
|
|
||||||
TvTAnnounceReward = True
|
|
||||||
|
|
||||||
# give price with 0 kills
|
|
||||||
TvTPriceNoKills = True
|
|
||||||
|
|
||||||
# players with cursed weapon are allowed to join ?
|
|
||||||
TvTJoinWithCursedWeapon = False
|
|
||||||
|
|
||||||
# Enable voice command to register on tvt event
|
|
||||||
TvTCommand = True
|
|
||||||
|
|
||||||
# Delay on revive when dead, NOTE: 20000 equals to 20 seconds, minimum 1000 (1 second)
|
|
||||||
TvTReviveDelay = 10000
|
|
||||||
|
|
||||||
# Open Western Fortress doors on tvt finish
|
|
||||||
TvTOpenFortDoors = False
|
|
||||||
|
|
||||||
# Close Western Fortress doors on tvt start
|
|
||||||
TvTCloseFortDoors = False
|
|
||||||
|
|
||||||
# Open Aden Colosseum doors on tvt finish
|
|
||||||
TvTOpenAdenColosseumDoors = True
|
|
||||||
|
|
||||||
# Close Aden Colosseum doors on tvt start
|
|
||||||
TvTCloseAdenColosseumDoors = True
|
|
||||||
|
|
||||||
# TvT Top Killer reward id
|
|
||||||
TvTTopKillerRewardId = 5575
|
|
||||||
|
|
||||||
# TvT Top Killer reward quantity
|
|
||||||
TvTTopKillerRewardQty = 5000000
|
|
||||||
|
|
||||||
# Place an aura on participants team ?
|
|
||||||
TvTAura = False
|
|
||||||
|
|
||||||
# Enable event stats logger
|
|
||||||
TvTStatsLogger = True
|
|
||||||
|
|
||||||
# Remove Buffs on player die
|
|
||||||
TvTRemoveBuffsOnPlayerDie = False
|
|
@ -374,18 +374,6 @@ TimeOfWarmUp = 2
|
|||||||
NumberOfNecessaryPartyMembers = 4
|
NumberOfNecessaryPartyMembers = 4
|
||||||
|
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------
|
|
||||||
# Quake / Killing Spree System
|
|
||||||
# ---------------------------------------------------------------------------
|
|
||||||
# Enable The Killing Spree System
|
|
||||||
# When a Player Hits an Amount of pvp's an announcement appears
|
|
||||||
AllowQuakeSystem = False
|
|
||||||
|
|
||||||
# Enable Messages to GMs on 4-5 consecutive pvp of a player
|
|
||||||
# Why? to see if a char are farming!
|
|
||||||
EnableAntiPvpFarmMsg = True
|
|
||||||
|
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
# Aio System
|
# Aio System
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
|
@ -126,16 +126,6 @@ TitleForAmount4 = 00FF00
|
|||||||
PkAmount5 = 5000
|
PkAmount5 = 5000
|
||||||
TitleForAmount5 = 00FF00
|
TitleForAmount5 = 00FF00
|
||||||
|
|
||||||
# -----------------------------
|
|
||||||
# PK Info Settings
|
|
||||||
# -----------------------------
|
|
||||||
# If it is enabled then it shows pk info to the players everytime
|
|
||||||
# A pk or pvp is done. Messages are:
|
|
||||||
# "You have killed PlayerX y times".
|
|
||||||
# OR
|
|
||||||
# "You have been killed y times by PlayerX.
|
|
||||||
EnablePkInfo = False
|
|
||||||
|
|
||||||
# ----------------------------
|
# ----------------------------
|
||||||
# Custom Reward
|
# Custom Reward
|
||||||
# ----------------------------
|
# ----------------------------
|
||||||
|
@ -46,19 +46,5 @@
|
|||||||
<td><button value="ItmQty" action="bypass -h admin_set_mod ChampionRewardQty=$menu_command" width=55 height=15 back="sek.cbui94" fore="sek.cbui92"></td>
|
<td><button value="ItmQty" action="bypass -h admin_set_mod ChampionRewardQty=$menu_command" width=55 height=15 back="sek.cbui94" fore="sek.cbui92"></td>
|
||||||
<td><button value="AtkSpd" action="bypass -h admin_set_mod ChampionSpdHp=$menu_command" width=55 height=15 back="sek.cbui94" fore="sek.cbui92"></td>
|
<td><button value="AtkSpd" action="bypass -h admin_set_mod ChampionSpdHp=$menu_command" width=55 height=15 back="sek.cbui94" fore="sek.cbui92"></td>
|
||||||
</tr></table><br>
|
</tr></table><br>
|
||||||
<br><font color="aadd77">Team Vs. Team</font>
|
|
||||||
<font color="LEVEL"><a action="bypass -h admin_help help/l2jmod/tvt.htm">Help</a></font>
|
|
||||||
<table width=240><tr>
|
|
||||||
<td><button value="Enable" action="bypass -h admin_set_mod TvTEventEnabled=true" width=55 height=15 back="sek.cbui94" fore="sek.cbui92"></td>
|
|
||||||
<td><button value="Interval" action="bypass -h admin_set_mod TvTEventInterval=$menu_command" width=55 height=15 back="sek.cbui94" fore="sek.cbui92"></td>
|
|
||||||
<td><button value="PartTime" action="bypass -h admin_set_mod TvTEventParticipationTime=$menu_command" width=55 height=15 back="sek.cbui94" fore="sek.cbui92"></td>
|
|
||||||
<td><button value="RunnTime" action="bypass -h admin_set_mod TvTEventRunningTime=$menu_command" width=55 height=15 back="sek.cbui94" fore="sek.cbui92"></td>
|
|
||||||
</tr><tr>
|
|
||||||
<td><button value="Disable" action="bypass -h admin_set_mod TvTEventEnabled=false" width=55 height=15 back="sek.cbui94" fore="sek.cbui92"></td>
|
|
||||||
<td><button value="EventNpc" action="bypass -h admin_set_mod TvTEventParticipationNpcId=$menu_command" width=55 height=15 back="sek.cbui94" fore="sek.cbui92"></td>
|
|
||||||
<td> </td>
|
|
||||||
<td> </td>
|
|
||||||
</tr></table>
|
|
||||||
<br>
|
|
||||||
</center>
|
</center>
|
||||||
</body></html>
|
</body></html>
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user