Credits to Hkarta[]
[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.
What is it?
- 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)creature (spaws)And new tables - in world dbC++ partEdit: ScriptMgr.cpp
- Download this: [Only registered and activated users can see links. ]
- Add it into core (location is same as in rar file) - into ScriptLoader add only files in scripts/custom.
- If you dont know how to add cpp / h files into your solution, read there: [Only registered and activated users can see links. ]
(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);New DB tablesCode: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");
city_capture_citiescity_capture_bosses
- 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_creatures
- 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_progress (when setting up new city, leave that table alone)
- 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_ports
- 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)
- not much to say, side: 0 defenders, 1 attackers



LinkBack URL
About LinkBacks




Reply With Quote



Bookmarks