[TrinityCore] City Conquest
Tested on older 7986 trinity revision (3.3.3a), but it should work on newer as well
Writen by Me, originaly for wowresource.eu. You may edit this script in anyway, as long as you mention me as an author of this part.

Co to je?
  • This C++ script allows you to conquer cities
  • You can edit everything in database, after aplying script, you dont have to edit anything else in core (maybe bosses, read below)




How does it work?
  • Talk to City Conquest portal (special npc) to begin siege
  • Once you begin your attack, there are tow possibilities. Either there is spawning npc loaded in core, which spawns boss - city captain, who disappears and ends conquest after hes been out of combat for 30 min. If spawning npc isnt loaded yet, you have 30 min to load him (which means get to creature visibility distance with him) - may you do this in 30 min, it spawns boss and first sentence applies.
  • Once conquest begins, its announced ingame, and City Conquest portal will allow deffenders and attackers to port to the city to aid their factions in battle. Each side ports to its own coords.
  • If attackers manage to slain captain, all npc in city change their faction and new conquest can begin in 1 hour.


Disadvantages
  • First public version, might be buggy
  • You cannot script bosses using event ai, because they have assigned their own city_conquest_boss script. If you want to script them, you might do it globaly by editing city_conquest_boss, or copy this script, rename, and assign it to given npc
  • YOU HAVE TO TURN OFF >>GRID UNLOAD<< IN CONFIG, OR IT >>WILL<< CRASH.


Installation
Db part (contains example script in gmislandu - .tele gmisland - city is owned by horde by default)

creature_template (150005 is controlling npc - portal)
Code:
INSERT INTO `creature_template` (`entry`, `difficulty_entry_1`, `difficulty_entry_2`, `difficulty_entry_3`, `KillCredit1`, `KillCredit2`, `modelid1`, `modelid2`, `modelid3`, `modelid4`, `name`, `subname`, `IconName`, `gossip_menu_id`, `minlevel`, `maxlevel`, `exp`, `faction_A`, `faction_H`, `npcflag`, `speed_walk`, `speed_run`, `scale`, `rank`, `mindmg`, `maxdmg`, `dmgschool`, `attackpower`, `dmg_multiplier`, `baseattacktime`, `rangeattacktime`, `unit_class`, `unit_flags`, `dynamicflags`, `family`, `trainer_type`, `trainer_spell`, `trainer_class`, `trainer_race`, `minrangedmg`, `maxrangedmg`, `rangedattackpower`, `type`, `type_flags`, `lootid`, `pickpocketloot`, `skinloot`, `resistance1`, `resistance2`, `resistance3`, `resistance4`, `resistance5`, `resistance6`, `spell1`, `spell2`, `spell3`, `spell4`, `spell5`, `spell6`, `spell7`, `spell8`, `PetSpellDataId`, `VehicleId`, `mingold`, `maxgold`, `AIName`, `MovementType`, `InhabitType`, `Health_mod`, `Mana_mod`, `Armor_mod`, `RacialLeader`, `questItem1`, `questItem2`, `questItem3`, `questItem4`, `questItem5`, `questItem6`, `movementId`, `RegenHealth`, `equipment_id`, `mechanic_immune_mask`, `flags_extra`, `ScriptName`, `WDBVerified`) VALUES (150000, 0, 0, 0, 0, 0, 328, 0, 328, 0, 'CQ: Boss Spawning Bunny GM ISLAND', '', '', 0, 82, 82, 0, 35, 35, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 2000, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '', 0, 3, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 43, 1, 0, 0, 130, 'city_conquest_spawner', 0);
INSERT INTO `creature_template` (`entry`, `difficulty_entry_1`, `difficulty_entry_2`, `difficulty_entry_3`, `KillCredit1`, `KillCredit2`, `modelid1`, `modelid2`, `modelid3`, `modelid4`, `name`, `subname`, `IconName`, `gossip_menu_id`, `minlevel`, `maxlevel`, `exp`, `faction_A`, `faction_H`, `npcflag`, `speed_walk`, `speed_run`, `scale`, `rank`, `mindmg`, `maxdmg`, `dmgschool`, `attackpower`, `dmg_multiplier`, `baseattacktime`, `rangeattacktime`, `unit_class`, `unit_flags`, `dynamicflags`, `family`, `trainer_type`, `trainer_spell`, `trainer_class`, `trainer_race`, `minrangedmg`, `maxrangedmg`, `rangedattackpower`, `type`, `type_flags`, `lootid`, `pickpocketloot`, `skinloot`, `resistance1`, `resistance2`, `resistance3`, `resistance4`, `resistance5`, `resistance6`, `spell1`, `spell2`, `spell3`, `spell4`, `spell5`, `spell6`, `spell7`, `spell8`, `PetSpellDataId`, `VehicleId`, `mingold`, `maxgold`, `AIName`, `MovementType`, `InhabitType`, `Health_mod`, `Mana_mod`, `Armor_mod`, `RacialLeader`, `questItem1`, `questItem2`, `questItem3`, `questItem4`, `questItem5`, `questItem6`, `movementId`, `RegenHealth`, `equipment_id`, `mechanic_immune_mask`, `flags_extra`, `ScriptName`, `WDBVerified`) VALUES (150001, 0, 0, 0, 0, 0, 19543, 0, 19543, 0, 'Alliance Commander', NULL, NULL, 0, 52, 52, 0, 210, 210, 0, 1.125, 1.14286, 1, 0, 571, 571, 0, 137, 1, 1400, 1900, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '', 1, 3, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 'city_conquest_boss', 0);
INSERT INTO `creature_template` (`entry`, `difficulty_entry_1`, `difficulty_entry_2`, `difficulty_entry_3`, `KillCredit1`, `KillCredit2`, `modelid1`, `modelid2`, `modelid3`, `modelid4`, `name`, `subname`, `IconName`, `gossip_menu_id`, `minlevel`, `maxlevel`, `exp`, `faction_A`, `faction_H`, `npcflag`, `speed_walk`, `speed_run`, `scale`, `rank`, `mindmg`, `maxdmg`, `dmgschool`, `attackpower`, `dmg_multiplier`, `baseattacktime`, `rangeattacktime`, `unit_class`, `unit_flags`, `dynamicflags`, `family`, `trainer_type`, `trainer_spell`, `trainer_class`, `trainer_race`, `minrangedmg`, `maxrangedmg`, `rangedattackpower`, `type`, `type_flags`, `lootid`, `pickpocketloot`, `skinloot`, `resistance1`, `resistance2`, `resistance3`, `resistance4`, `resistance5`, `resistance6`, `spell1`, `spell2`, `spell3`, `spell4`, `spell5`, `spell6`, `spell7`, `spell8`, `PetSpellDataId`, `VehicleId`, `mingold`, `maxgold`, `AIName`, `MovementType`, `InhabitType`, `Health_mod`, `Mana_mod`, `Armor_mod`, `RacialLeader`, `questItem1`, `questItem2`, `questItem3`, `questItem4`, `questItem5`, `questItem6`, `movementId`, `RegenHealth`, `equipment_id`, `mechanic_immune_mask`, `flags_extra`, `ScriptName`, `WDBVerified`) VALUES (150002, 0, 0, 0, 0, 0, 1735, 0, 1735, 0, 'Horde Commander', NULL, NULL, 0, 80, 80, 0, 29, 29, 2, 1.1, 1.14286, 1, 1, 953, 1089, 0, 245, 1, 2000, 0, 2, 4608, 0, 0, 0, 0, 0, 0, 58.872, 80.949, 100, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'EventAI', 0, 3, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1115, 0, 0, 'city_conquest_boss', 0);
INSERT INTO `creature_template` (`entry`, `difficulty_entry_1`, `difficulty_entry_2`, `difficulty_entry_3`, `KillCredit1`, `KillCredit2`, `modelid1`, `modelid2`, `modelid3`, `modelid4`, `name`, `subname`, `IconName`, `gossip_menu_id`, `minlevel`, `maxlevel`, `exp`, `faction_A`, `faction_H`, `npcflag`, `speed_walk`, `speed_run`, `scale`, `rank`, `mindmg`, `maxdmg`, `dmgschool`, `attackpower`, `dmg_multiplier`, `baseattacktime`, `rangeattacktime`, `unit_class`, `unit_flags`, `dynamicflags`, `family`, `trainer_type`, `trainer_spell`, `trainer_class`, `trainer_race`, `minrangedmg`, `maxrangedmg`, `rangedattackpower`, `type`, `type_flags`, `lootid`, `pickpocketloot`, `skinloot`, `resistance1`, `resistance2`, `resistance3`, `resistance4`, `resistance5`, `resistance6`, `spell1`, `spell2`, `spell3`, `spell4`, `spell5`, `spell6`, `spell7`, `spell8`, `PetSpellDataId`, `VehicleId`, `mingold`, `maxgold`, `AIName`, `MovementType`, `InhabitType`, `Health_mod`, `Mana_mod`, `Armor_mod`, `RacialLeader`, `questItem1`, `questItem2`, `questItem3`, `questItem4`, `questItem5`, `questItem6`, `movementId`, `RegenHealth`, `equipment_id`, `mechanic_immune_mask`, `flags_extra`, `ScriptName`, `WDBVerified`) VALUES (150003, 0, 0, 0, 0, 0, 103, 0, 103, 0, 'GM Island Creature 1', NULL, NULL, 0, 40, 50, 0, 83, 83, 0, 1.125, 1.14286, 1, 0, 19, 23, 0, 5, 1, 1400, 1900, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '', 1, 3, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 2, 'city_conquest_generic', 0);
INSERT INTO `creature_template` (`entry`, `difficulty_entry_1`, `difficulty_entry_2`, `difficulty_entry_3`, `KillCredit1`, `KillCredit2`, `modelid1`, `modelid2`, `modelid3`, `modelid4`, `name`, `subname`, `IconName`, `gossip_menu_id`, `minlevel`, `maxlevel`, `exp`, `faction_A`, `faction_H`, `npcflag`, `speed_walk`, `speed_run`, `scale`, `rank`, `mindmg`, `maxdmg`, `dmgschool`, `attackpower`, `dmg_multiplier`, `baseattacktime`, `rangeattacktime`, `unit_class`, `unit_flags`, `dynamicflags`, `family`, `trainer_type`, `trainer_spell`, `trainer_class`, `trainer_race`, `minrangedmg`, `maxrangedmg`, `rangedattackpower`, `type`, `type_flags`, `lootid`, `pickpocketloot`, `skinloot`, `resistance1`, `resistance2`, `resistance3`, `resistance4`, `resistance5`, `resistance6`, `spell1`, `spell2`, `spell3`, `spell4`, `spell5`, `spell6`, `spell7`, `spell8`, `PetSpellDataId`, `VehicleId`, `mingold`, `maxgold`, `AIName`, `MovementType`, `InhabitType`, `Health_mod`, `Mana_mod`, `Armor_mod`, `RacialLeader`, `questItem1`, `questItem2`, `questItem3`, `questItem4`, `questItem5`, `questItem6`, `movementId`, `RegenHealth`, `equipment_id`, `mechanic_immune_mask`, `flags_extra`, `ScriptName`, `WDBVerified`) VALUES (150004, 0, 0, 0, 0, 0, 146, 0, 146, 0, 'GM Island Ghost 1', NULL, NULL, 0, 15, 15, 0, 83, 83, 0, 0.99, 1.14286, 1, 0, 35, 40, 0, 9, 1, 1860, 2046, 2, 0, 0, 0, 0, 0, 0, 0, 24.552, 33.759, 100, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 40, 57, '', 0, 3, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 8388624, 2, 'city_conquest_generic', 0);
INSERT INTO `creature_template` (`entry`, `difficulty_entry_1`, `difficulty_entry_2`, `difficulty_entry_3`, `KillCredit1`, `KillCredit2`, `modelid1`, `modelid2`, `modelid3`, `modelid4`, `name`, `subname`, `IconName`, `gossip_menu_id`, `minlevel`, `maxlevel`, `exp`, `faction_A`, `faction_H`, `npcflag`, `speed_walk`, `speed_run`, `scale`, `rank`, `mindmg`, `maxdmg`, `dmgschool`, `attackpower`, `dmg_multiplier`, `baseattacktime`, `rangeattacktime`, `unit_class`, `unit_flags`, `dynamicflags`, `family`, `trainer_type`, `trainer_spell`, `trainer_class`, `trainer_race`, `minrangedmg`, `maxrangedmg`, `rangedattackpower`, `type`, `type_flags`, `lootid`, `pickpocketloot`, `skinloot`, `resistance1`, `resistance2`, `resistance3`, `resistance4`, `resistance5`, `resistance6`, `spell1`, `spell2`, `spell3`, `spell4`, `spell5`, `spell6`, `spell7`, `spell8`, `PetSpellDataId`, `VehicleId`, `mingold`, `maxgold`, `AIName`, `MovementType`, `InhabitType`, `Health_mod`, `Mana_mod`, `Armor_mod`, `RacialLeader`, `questItem1`, `questItem2`, `questItem3`, `questItem4`, `questItem5`, `questItem6`, `movementId`, `RegenHealth`, `equipment_id`, `mechanic_immune_mask`, `flags_extra`, `ScriptName`, `WDBVerified`) VALUES (150005, 0, 0, 0, 0, 0, 26501, 0, 26501, 0, 'City Conquest', 'Portal & Manager', 'Interact', 0, 1, 1, 0, 35, 35, 1, 1, 1.14286, 1, 0, 0, 0, 0, 0, 1, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '', 0, 3, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 2, 'city_conquest_portal', 0);
creature (spawns)
Code:
INSERT INTO `creature` (`id`, `map`, `spawnMask`, `phaseMask`, `modelid`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `currentwaypoint`, `curhealth`, `curmana`, `DeathState`, `MovementType`) VALUES (150000, 1, 1, 1, 0, 0, 16224.1, 16279.3, 20.885, 4.52855, 300, 0, 0, 4518, 4169, 0, 0);
INSERT INTO `creature` (`id`, `map`, `spawnMask`, `phaseMask`, `modelid`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `currentwaypoint`, `curhealth`, `curmana`, `DeathState`, `MovementType`) VALUES (150003, 1, 1, 1, 0, 0, 16225.4, 16271.1, 12.9997, 4.54034, 300, 0, 0, 1226, 1283, 0, 0);
INSERT INTO `creature` (`id`, `map`, `spawnMask`, `phaseMask`, `modelid`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `currentwaypoint`, `curhealth`, `curmana`, `DeathState`, `MovementType`) VALUES (150003, 1, 1, 1, 0, 0, 16230.3, 16295.1, 13.1757, 2.63968, 300, 0, 0, 1321, 1381, 0, 0);
INSERT INTO `creature` (`id`, `map`, `spawnMask`, `phaseMask`, `modelid`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `currentwaypoint`, `curhealth`, `curmana`, `DeathState`, `MovementType`) VALUES (150003, 1, 1, 1, 0, 0, 16235.2, 16301.1, 13.1757, 5.10582, 300, 0, 0, 1226, 1283, 0, 0);
INSERT INTO `creature` (`id`, `map`, `spawnMask`, `phaseMask`, `modelid`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `currentwaypoint`, `curhealth`, `curmana`, `DeathState`, `MovementType`) VALUES (150003, 1, 1, 1, 0, 0, 16226.1, 16317.2, 20.8459, 4.85056, 300, 0, 0, 1772, 1807, 0, 0);
INSERT INTO `creature` (`id`, `map`, `spawnMask`, `phaseMask`, `modelid`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `currentwaypoint`, `curhealth`, `curmana`, `DeathState`, `MovementType`) VALUES (150004, 1, 1, 1, 0, 0, 16220.7, 16271.6, 12.9754, 4.63851, 300, 0, 0, 301, 326, 0, 0);
INSERT INTO `creature` (`id`, `map`, `spawnMask`, `phaseMask`, `modelid`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `currentwaypoint`, `curhealth`, `curmana`, `DeathState`, `MovementType`) VALUES (150004, 1, 1, 1, 0, 0, 16224.1, 16284.6, 13.1756, 4.58746, 300, 0, 0, 301, 326, 0, 0);
INSERT INTO `creature` (`id`, `map`, `spawnMask`, `phaseMask`, `modelid`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `currentwaypoint`, `curhealth`, `curmana`, `DeathState`, `MovementType`) VALUES (150004, 1, 1, 1, 0, 0, 16221.3, 16298.9, 13.1756, 5.14117, 300, 0, 0, 301, 326, 0, 0);
INSERT INTO `creature` (`id`, `map`, `spawnMask`, `phaseMask`, `modelid`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `currentwaypoint`, `curhealth`, `curmana`, `DeathState`, `MovementType`) VALUES (150004, 1, 1, 1, 0, 0, 16234.9, 16299.6, 20.8456, 1.4812, 300, 0, 0, 301, 326, 0, 0);
INSERT INTO `creature` (`id`, `map`, `spawnMask`, `phaseMask`, `modelid`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `currentwaypoint`, `curhealth`, `curmana`, `DeathState`, `MovementType`) VALUES (150004, 1, 1, 1, 0, 0, 16217.7, 16284.2, 20.8895, 4.45001, 300, 0, 0, 301, 326, 0, 0);
INSERT INTO `creature` (`id`, `map`, `spawnMask`, `phaseMask`, `modelid`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `currentwaypoint`, `curhealth`, `curmana`, `DeathState`, `MovementType`) VALUES (150005, 1, 1, 1, 0, 0, 16228.4, 16244.6, 12.2895, 2.02771, 300, 0, 0, 41, 60, 0, 0);
INSERT INTO `creature` (`id`, `map`, `spawnMask`, `phaseMask`, `modelid`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `currentwaypoint`, `curhealth`, `curmana`, `DeathState`, `MovementType`) VALUES (150005, 530, 1, 1, 0, 0, -2047.61, 6658.8, 13.0538, 0.698243, 300, 0, 0, 41, 60, 0, 0);
And new tables - in world db
Code:
-- ----------------------------
-- Table structure for `city_capture_bosses`
-- ----------------------------
DROP TABLE IF EXISTS `city_capture_bosses`;
CREATE TABLE `city_capture_bosses` (
  `city_id` int(11) NOT NULL default '0',
  `boss_entry_A` int(11) default NULL,
  `boss_entry_H` int(11) default NULL,
  `spawner_entry` int(11) default NULL,
  `spawn_timer` int(11) default NULL,
  PRIMARY KEY  (`city_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

-- ----------------------------
-- Records of city_capture_bosses
-- ----------------------------
INSERT INTO `city_capture_bosses` VALUES ('1', '150001', '150002', '150000', '1');

-- ----------------------------
-- Table structure for `city_capture_cities`
-- ----------------------------
DROP TABLE IF EXISTS `city_capture_cities`;
CREATE TABLE `city_capture_cities` (
  `id` int(11) NOT NULL default '0',
  `minlevel` int(11) default NULL,
  `maxlevel` int(11) default NULL,
  `name` text,
  `controlled` tinyint(4) default NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

-- ----------------------------
-- Records of city_capture_cities
-- ----------------------------
INSERT INTO `city_capture_cities` VALUES ('1', '1', '80', 'GM Island', '1');

-- ----------------------------
-- Table structure for `city_capture_creatures`
-- ----------------------------
DROP TABLE IF EXISTS `city_capture_creatures`;
CREATE TABLE `city_capture_creatures` (
  `city_id` int(11) default NULL,
  `entry` int(11) NOT NULL default '0',
  `faction_A` int(11) default NULL,
  `faction_H` int(11) default NULL,
  PRIMARY KEY  (`entry`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

-- ----------------------------
-- Records of city_capture_creatures
-- ----------------------------
INSERT INTO `city_capture_creatures` VALUES ('1', '150003', '210', '83');
INSERT INTO `city_capture_creatures` VALUES ('1', '150004', '210', '83');

-- ----------------------------
-- Table structure for `city_capture_ports`
-- ----------------------------
DROP TABLE IF EXISTS `city_capture_ports`;
CREATE TABLE `city_capture_ports` (
  `city_id` int(11) NOT NULL default '0',
  `side` int(11) NOT NULL default '0',
  `x` float default NULL,
  `y` float default NULL,
  `z` float default NULL,
  `o` float default NULL,
  `map` int(11) default NULL,
  PRIMARY KEY  (`city_id`,`side`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

-- ----------------------------
-- Records of city_capture_ports
-- ----------------------------
INSERT INTO `city_capture_ports` VALUES ('1', '0', '16255.1', '16289.2', '21', '3.26', '1');
INSERT INTO `city_capture_ports` VALUES ('1', '1', '16221.3', '16246.5', '12', '1.47', '1');

-- ----------------------------
-- Table structure for `city_capture_progress`
-- ----------------------------
DROP TABLE IF EXISTS `city_capture_progress`;
CREATE TABLE `city_capture_progress` (
  `city_id` int(11) NOT NULL default '0',
  `time` int(11) default NULL,
  PRIMARY KEY  (`city_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

-- ----------------------------
-- Records of city_capture_progress
-- ----------------------------
INSERT INTO `city_capture_progress` VALUES ('1', '1274630992');
INSERT INTO `city_capture_progress` VALUES ('5', '1274628002');
INSERT INTO `city_capture_progress` VALUES ('10', '1274628031');
INSERT INTO `city_capture_progress` VALUES ('7', '1274628034');
INSERT INTO `city_capture_progress` VALUES ('12', '1274628356');
INSERT INTO `city_capture_progress` VALUES ('4', '1274628349');
INSERT INTO `city_capture_progress` VALUES ('9', '1274628352');
INSERT INTO `city_capture_progress` VALUES ('2', '1274628366');
C++ part

Edit: ScriptMgr.cpp
(lines with + means you are supposed to add them. Without that +, ofc)
Code:
#include "ScriptSystem.h"
#include "Policies/SingletonImp.h"
+ #include "CityConquestMgr.h"

INSTANTIATE_SINGLETON_1(ScriptMgr);
Code:
outstring_log("                         |___/                  |_|        ");
outstring_log("");
outstring_log("");

//Load database (must be called after SD2Config.SetSource).
LoadDatabase();

+ outstring_log("Initializing City Conquest Engine (c) Hkarta");
+ CityConquest.LoadCities();

outstring_log("TSCR: Loading C++ scripts");
New DB tables
city_capture_cities
Code:
id - exactly what you would expect, have to be unique
minlevel - min level to teleport players
maxlevel - same as minlevel
name - port name, used in gossip/announce
controlled - side that controlls the city atm - 0 aliance, 1 horde
city_capture_bosses
Code:
city_id - city_capture_cities.id
boss_entry_A - name says it all (npc have to have city_conquest_boss script asigned)
boss_entry_H - same as boss_entry_A
spawner_entry - id of invisible npc (npc have to have city_conquest_spawner script asigned). Each city have to have its unique ids of bosses and spawner
spawn_timer - its used, when spawner isnt loaded when attack is started. Leave it 0
city_capture_creatures
Code:
city_id - city_capture_cities.id
entry - npc entry (npc npc have to have city_conquest_generic script asigned + there have to be his entry. Each city should have its own unique entries)
faction_A - faction of that npc, if city is controlled by aliance
faction_H - faction of that npc, if city is controlled by horde
city_capture_progress
Code:
city_id - city_capture_cities.id
time - time, its used to check if city can be attacked (1 hr timer after it was conquered passed)
city_capture_ports
Code:
not much to say, side: 0 defenders, 1 attackers



all credits goes to _Hkarta for the script


› See More: Script City Conquest