Jump to content
  • 0

[Help] Faction Map change every 45 min!


Question

Posted

Hello MXC, i have code for faction server which change map every 45 mins.

But i need to make this code to pvp server, but problem is occupation crystals and teleporter set to faction ids Faction ID 1 = Blue faction Faction ID 2 = Red faction.

I need to make what you can teleport to crystal but you can't occupate crystal and can't see it and all players teleport to all crystals, who can help me, i send java code and I and good dev who help to me, have this super code:D

Sorry for bad english!

+			L2TpFlagInstance kristalas = (L2TpFlagInstance) object;
+			if (plajer.getFactionId() == kristalas.getFlagFactionId())
+				plajer.teleToLocation(kristalas.getX() + 50,kristalas.getY(),kristalas.getZ() + 50);

+	public static FastSet<L2TpFlagInstance> _tpBlueFlags = new FastSet<L2TpFlagInstance>();
+	public static FastSet<L2TpFlagInstance> _tpRedFlags = new FastSet<L2TpFlagInstance>();

CREATE TABLE `faction_crystals` (
  `mapId` int(3) DEFAULT '0',
  `flagName` varchar(20) NOT NULL DEFAULT 'Test',
  `factionId` int(1) DEFAULT '0',
  `unoccupayable` int(1) DEFAULT '0',
  `x` int(7) NOT NULL DEFAULT '0',
  `y` int(7) DEFAULT '0',
  `z` int(7) DEFAULT '0',
  PRIMARY KEY (`x`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- ----------------------------
-- Table structure for faction_maps
-- ----------------------------
CREATE TABLE `faction_maps` (
  `mapId` int(3) DEFAULT '0',
  `map_name` varchar(50) NOT NULL DEFAULT '',
  `current` int(1) DEFAULT '0',
  PRIMARY KEY (`map_name`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

ALTER TABLE `characters` ADD `factionId` INT(1) DEFAULT '0' NOT NULL;
UPDATE `npc` SET type = 'L2Faction' WHERE id = '31214'
UPDATE `npc` SET type = 'L2TpFlag' WHERE id = '31217'
UPDATE `npc` SET type = 'L2FactTeleporter' WHERE id = '31218'

-- ----------------------------
-- Records 
-- ----------------------------
INSERT INTO `faction_crystals` VALUES ('2', 'Red Crystal', '1', '1', '-54438', '146565', '-2878');
INSERT INTO `faction_crystals` VALUES ('2', 'Crystal 2', '0', '1', '-54257', '142692', '-2877');
INSERT INTO `faction_crystals` VALUES ('2', 'Blue Crystal', '1', '1', '-51479', '138993', '-2937');
INSERT INTO `faction_crystals` VALUES ('2', 'Crystal 1', '0', '1', '-50155', '142310', '-2893');
INSERT INTO `faction_crystals` VALUES ('1', 'Hot Springs 2', '0', '0', '140656', '-105488', '-3632');
INSERT INTO `faction_crystals` VALUES ('1', 'Hot Springs 1', '0', '0', '141632', '-109424', '-3591');
INSERT INTO `faction_crystals` VALUES ('1', 'Blue Crystal', '1', '1', '143972', '-111932', '-3447');
INSERT INTO `faction_crystals` VALUES ('1', 'Red Crystal', '2', '1', '144755', '-100687', '-3277');
INSERT INTO `faction_crystals` VALUES ('1', 'Hot Springs 3', '0', '0', '145232', '-104736', '-3681');
INSERT INTO `faction_crystals` VALUES ('0', 'Cemetery steps', '1', '1', '185352', '20300', '-3270');
INSERT INTO `faction_crystals` VALUES ('0', 'Cemetery Crystal 2', '0', '0', '188409', '22493', '-3688');
INSERT INTO `faction_crystals` VALUES ('0', 'Cemetery Crystal 1', '0', '0', '189616', '17336', '-3762');
INSERT INTO `faction_crystals` VALUES ('0', 'Cemetery Crystal 3', '0', '0', '190408', '21396', '-3670');
INSERT INTO `faction_crystals` VALUES ('0', 'Cemetery doors', '2', '1', '194072', '22928', '-3614');
INSERT INTO `faction_maps` VALUES ('2', 'Abandoned Camp', '0');
INSERT INTO `faction_maps` VALUES ('0', 'Cemetery', '1');
INSERT INTO `faction_maps` VALUES ('1', 'Hot Springs', '0');

3 answers to this question

Recommended Posts

  • 0
Posted

yup, whatever have to be done in the future, need to be done with the sheduler(thread)

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock