From 29374416111dbf014bfe87fdae35ce1e734a4a5c Mon Sep 17 00:00:00 2001 From: MobiusDevelopment <8391001+MobiusDevelopment@users.noreply.github.com> Date: Sat, 19 Mar 2022 22:06:45 +0000 Subject: [PATCH] Addition of faction system (Good vs Evil). --- .../dist/db_installer/sql/game/characters.sql | 1 + .../dist/db_installer/sql/game/custom_npc.sql | 11 +- .../dist/game/config/custom/FactionSystem.ini | 64 +++++++ .../dist/game/data/html/guard/501.htm | 4 + .../dist/game/data/html/guard/502.htm | 3 + .../html/mods/Faction/ExceededOnlineLimit.htm | 3 + .../custom/FactionSystem/FactionSystem.java | 164 ++++++++++++++++++ .../scripts/custom/FactionSystem/manager.html | 6 + .../custom/FactionSystem/onlinelimit.html | 5 + .../java/org/l2jmobius/Config.java | 45 +++++ .../l2jmobius/gameserver/ai/AttackableAI.java | 19 +- .../gameserver/data/xml/MapRegionData.java | 13 ++ .../handler/itemhandlers/ScrollOfEscape.java | 6 + .../handler/usercommandhandlers/Escape.java | 6 + .../l2jmobius/gameserver/model/BlockList.java | 5 + .../org/l2jmobius/gameserver/model/World.java | 45 ++++- .../gameserver/model/actor/Playable.java | 12 ++ .../gameserver/model/actor/Player.java | 142 +++++++++++---- .../model/actor/instance/Guard.java | 3 +- .../model/actor/knownlist/GuardKnownList.java | 22 ++- .../l2jmobius/gameserver/model/clan/Clan.java | 28 +++ .../clientpackets/CharacterCreate.java | 4 + .../clientpackets/CharacterSelected.java | 25 +++ .../network/clientpackets/EnterWorld.java | 21 +++ .../dist/db_installer/sql/game/characters.sql | 1 + .../dist/db_installer/sql/game/custom_npc.sql | 3 + .../dist/game/config/custom/FactionSystem.ini | 64 +++++++ .../dist/game/data/html/guard/501.htm | 4 + .../dist/game/data/html/guard/502.htm | 3 + .../html/mods/Faction/ExceededOnlineLimit.htm | 3 + .../custom/FactionSystem/FactionSystem.java | 164 ++++++++++++++++++ .../scripts/custom/FactionSystem/manager.html | 6 + .../custom/FactionSystem/onlinelimit.html | 5 + .../java/org/l2jmobius/Config.java | 45 +++++ .../l2jmobius/gameserver/ai/AttackableAI.java | 19 +- .../gameserver/data/xml/MapRegionData.java | 13 ++ .../handler/itemhandlers/ScrollOfEscape.java | 6 + .../handler/usercommandhandlers/Escape.java | 6 + .../l2jmobius/gameserver/model/BlockList.java | 5 + .../org/l2jmobius/gameserver/model/World.java | 45 ++++- .../gameserver/model/actor/Playable.java | 12 ++ .../gameserver/model/actor/Player.java | 143 +++++++++++---- .../model/actor/instance/Guard.java | 3 +- .../model/actor/knownlist/GuardKnownList.java | 22 ++- .../l2jmobius/gameserver/model/clan/Clan.java | 28 +++ .../clientpackets/CharacterCreate.java | 4 + .../clientpackets/CharacterSelected.java | 25 +++ .../network/clientpackets/EnterWorld.java | 21 +++ 48 files changed, 1193 insertions(+), 114 deletions(-) create mode 100644 L2J_Mobius_C4_ScionsOfDestiny/dist/game/config/custom/FactionSystem.ini create mode 100644 L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/html/guard/501.htm create mode 100644 L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/html/guard/502.htm create mode 100644 L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/html/mods/Faction/ExceededOnlineLimit.htm create mode 100644 L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/custom/FactionSystem/FactionSystem.java create mode 100644 L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/custom/FactionSystem/manager.html create mode 100644 L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/custom/FactionSystem/onlinelimit.html create mode 100644 L2J_Mobius_C6_Interlude/dist/game/config/custom/FactionSystem.ini create mode 100644 L2J_Mobius_C6_Interlude/dist/game/data/html/guard/501.htm create mode 100644 L2J_Mobius_C6_Interlude/dist/game/data/html/guard/502.htm create mode 100644 L2J_Mobius_C6_Interlude/dist/game/data/html/mods/Faction/ExceededOnlineLimit.htm create mode 100644 L2J_Mobius_C6_Interlude/dist/game/data/scripts/custom/FactionSystem/FactionSystem.java create mode 100644 L2J_Mobius_C6_Interlude/dist/game/data/scripts/custom/FactionSystem/manager.html create mode 100644 L2J_Mobius_C6_Interlude/dist/game/data/scripts/custom/FactionSystem/onlinelimit.html diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/db_installer/sql/game/characters.sql b/L2J_Mobius_C4_ScionsOfDestiny/dist/db_installer/sql/game/characters.sql index 9a357de631..34817f15e2 100644 --- a/L2J_Mobius_C4_ScionsOfDestiny/dist/db_installer/sql/game/characters.sql +++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/db_installer/sql/game/characters.sql @@ -71,6 +71,7 @@ CREATE TABLE IF NOT EXISTS characters ( power_grade decimal(11,0) DEFAULT NULL, nobless decimal(1,0) NOT NULL DEFAULT 0, subpledge int(1) NOT NULL DEFAULT 0, + faction int(1) NOT NULL DEFAULT 0, last_recom_date decimal(20,0) NOT NULL DEFAULT 0, lvl_joined_academy int(1) NOT NULL DEFAULT 0, apprentice int(1) NOT NULL DEFAULT 0, diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/db_installer/sql/game/custom_npc.sql b/L2J_Mobius_C4_ScionsOfDestiny/dist/db_installer/sql/game/custom_npc.sql index 54a354432b..1354f12c67 100644 --- a/L2J_Mobius_C4_ScionsOfDestiny/dist/db_installer/sql/game/custom_npc.sql +++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/db_installer/sql/game/custom_npc.sql @@ -49,8 +49,11 @@ CREATE TABLE `custom_npc`( ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; INSERT ignore INTO custom_npc values -('31288', '31228', 'Roy the Cat', '1', 'Class Master', '1', 'Monster.cat_the_cat', '9.00', '16.00', '70', 'male', 'ClassMaster', '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'), -('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'), +('500', '7115', 'Jurek', '1', 'Faction Manager', '1', 'NPC.a_mageguild_master_MHuman', '8.00', '24.00', '70', 'male', 'Folk', '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', '55', '132', null, '0', '1', '0', 'LAST_HIT'), +('501', '8033', 'Sentinel', '1', ' ', '1', 'NPC.a_guard_MElf', '8.00', '23.50', '80', 'male', 'Guard', '1100', '4551', '1859', '13.43', '3.09', '40', '43', '30', '21', '20', '10', '0', '0', '4031', '576', '1144', '468', '249', '1000', '333', '276', '0', '0', '55', '176', 'Good', '500', '1', '0', 'LAST_HIT'), +('502', '8036', 'Centurion', '1', ' ', '1', 'NPC.e_guard_MOrc', '8.00', '27.00', '80', 'male', 'Guard', '1100', '4551', '1859', '13.43', '3.09', '40', '43', '30', '21', '20', '10', '0', '0', '4031', '576', '1144', '468', '249', '1000', '333', '273', '0', '0', '55', '176', 'Evil', '500', '1', '0', 'LAST_HIT'), +('31288', '8228', 'Roy the Cat', '1', 'Class Master', '1', 'Monster.cat_the_cat', '9.00', '16.00', '70', 'male', 'ClassMaster', '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', '8228', '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', '8324', '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', '8228', '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'); diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/config/custom/FactionSystem.ini b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/config/custom/FactionSystem.ini new file mode 100644 index 0000000000..ca1de8904b --- /dev/null +++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/config/custom/FactionSystem.ini @@ -0,0 +1,64 @@ +# --------------------------------------------------------------------------- +# Faction System (Good vs Evil) +# --------------------------------------------------------------------------- + +# Enable faction system. +# Default: False +EnableFactionSystem = False + +# Starting location for all players. +# Default: 85332,16199,-1252 +StartingLocation = 85332,16199,-1252 + +# Spawn location for faction manager NPC. +# Default: 85712,15974,-1260,26808 +ManagerSpawnLocation = 85712,15974,-1260,26808 + +# Good base location. +# Default: 45306,48878,-3058 +GoodBaseLocation = 45306,48878,-3058 + +# Evil base location. +# Default: -44037,-113283,-237 +EvilBaseLocation = -44037,-113283,-237 + +# Good team name. +# Default: Good +GoodTeamName = Good + +# Evil team name. +# Default: Evil +EvilTeamName = Evil + +# Good name color. +# Default: 00FF00 +GoodNameColor = 00FF00 + +# Evil name color. +# Default: 0000FF +EvilNameColor = 0000FF + +# Enable faction guards. +# The NPC template must have faction as clan. +# Default: True +EnableFactionGuards = True + +# Upon death, respawn at faction base. +# Default: True +RespawnAtFactionBase = True + +# Upon selecting faction, players become nobless. +# Default: False +FactionAutoNobless = False + +# Disallow chat between factions. +# Default: True +EnableFactionChat = True + +# Prohibit login when faction has more online players. +# Default: True +BalanceOnlinePlayers = True + +# Online player exceed limit (used by setting above). +# Default: 20 +BalancePlayerExceedLimit = 20 diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/html/guard/501.htm b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/html/guard/501.htm new file mode 100644 index 0000000000..ae4b343c3e --- /dev/null +++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/html/guard/501.htm @@ -0,0 +1,4 @@ +
Sentinel: