Skip to content

Commit

Permalink
Merge pull request #1718 from Murilo-BiO/clan_system
Browse files Browse the repository at this point in the history
Implementation of Official Clan System
  • Loading branch information
MishimaHaruna committed Feb 6, 2018
2 parents a928f00 + 587dd19 commit 19c9401
Show file tree
Hide file tree
Showing 79 changed files with 5,730 additions and 107 deletions.
48 changes: 48 additions & 0 deletions conf/clans.conf
@@ -0,0 +1,48 @@
//================= Hercules Configuration ================================
//= _ _ _
//= | | | | | |
//= | |_| | ___ _ __ ___ _ _| | ___ ___
//= | _ |/ _ \ '__/ __| | | | |/ _ \/ __|
//= | | | | __/ | | (__| |_| | | __/\__ \
//= \_| |_/\___|_| \___|\__,_|_|\___||___/
//================= License ===============================================
//= This file is part of Hercules.
//= http://herc.ws - http://github.com/HerculesWS/Hercules
//=
//= Copyright (C) 2017 Hercules Dev Team
//=
//= Hercules 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/>.
//=========================================================================
//= Clan System local configuration file.
//=========================================================================

clan_configuration: {

// Maximum players for each clan
MaxMembers: 500

// Maximum alliances/oppositions for each clan
MaxRelations: 6

// how many hours player must be inactive to be kicked?
// Disabled: 0
// Official: 336 (2 weeks)
InactivityKickTime: 336

// Checks each clan member every 'InactivityCheckTime' hour(s) (default 24h, minimum value of 1h)
InactivityCheckTime: 24

// Clan Database
@include "db/clans.conf"
}
5 changes: 3 additions & 2 deletions conf/map/logs.conf
Expand Up @@ -164,13 +164,14 @@ map_log: {
// 0x04 - Log Party messages
// 0x08 - Log Guild messages
// 0x10 - Log Main chat messages
// 0x20 - Log Clan messages
// Example:
// log_chat: 0x5 = logs both Whisper & Party messages
// log_chat: 0x8 = logs only Guild messages
// log_chat: 0x1f = logs everything
// log_chat: 0x2f = logs everything
// FIXME: This isn't fully functional, as of now it's only checking
// if the log is active or not [Panikon]
log_chat: 0x1f
log_chat: 0x2f

// Disable chat logging when WoE is running? (Note 1)
log_chat_woe_disable: false
Expand Down
6 changes: 5 additions & 1 deletion conf/messages.conf
Expand Up @@ -151,7 +151,11 @@
131: Unable to spawn clone.
132: Slave clone spawned.
133: Unable to spawn slave clone.
//134-142 FREE (possibly for other clone types)
//134-138 FREE (possibly for other clone types)
139: CvC ON |
140: You can't join in a clan if you're in a guild.
141: CvC is already Off.
142: CvC is already On.
143: Commands are disabled in this map.
144: Invalid e-mail. If your email hasn't been set, use a@a.com.
145: Invalid new e-mail. Please enter a real e-mail address.
Expand Down
141 changes: 141 additions & 0 deletions db/clans.conf
@@ -0,0 +1,141 @@
//================= Hercules Database =====================================
//= _ _ _
//= | | | | | |
//= | |_| | ___ _ __ ___ _ _| | ___ ___
//= | _ |/ _ \ '__/ __| | | | |/ _ \/ __|
//= | | | | __/ | | (__| |_| | | __/\__ \
//= \_| |_/\___|_| \___|\__,_|_|\___||___/
//================= License ===============================================
//= This file is part of Hercules.
//= http://herc.ws - http://github.com/HerculesWS/Hercules
//=
//= Copyright (C) 2017 Hercules Dev Team
//=
//= Hercules 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/>.
//=========================================================================
//= Clan System Database File.
//=========================================================================

clans: (
/**************************************************************************
************* Entry structure ********************************************
**************************************************************************
{
Id: ID (int)
Const: "Const Name" (string)
Name: "Clan Name" (string)
Leader: "Leader Name" (string)
Map: "Map Name" (string)
MaxMembers: Max (int, optional, overrides MaxMembers on conf/clans.conf)
KickTime: Hours (int, optional, overrides InactivityKickTime)
CheckTime: Hours (int, optional, overrides InactivityCheckTime)
Buff: {
Icon: State Icon ID/Constant (int, you can find all ids on your lua folder: stateicon/efstids.lub or /src/map/constants.inc.h)
Script: <" (optional)
Script (it can be multi-line)
">
}
Allies: [
"CLAN_NAME_CONSTANT", (string)
]
Antagonists: [
"CLAN_NAME_CONSTANT", (string)
]
},
**************************************************************************/
{
Id: 1
Const: "SWORDCLAN"
Name: "Sword Clan"
Leader: "Raffam Oranpere"
Map: "prontera"
Buff: {
Icon: "SI_SWORDCLAN"
Script: <"
bonus(bStr, 1);
bonus(bVit, 1);
bonus(bMaxHP, 30);
bonus(bMaxSP, 10);
">
}
Allies: [
"GOLDENMACECLAN",
]
},
{
Id: 2
Const: "ARCWANDCLAN"
Name: "Arc Wand Clan"
Leader: "Devon Aire"
Map: "geffen"
Buff: {
Icon: "SI_ARCWANDCLAN"
Script: <"
bonus(bInt, 1);
bonus(bDex, 1);
bonus(bMaxHP, 30);
bonus(bMaxSP, 10);
">
}
Allies: [
"GOLDENMACECLAN",
]
Antagonists: [
"CROSSBOWCLAN",
]
},
{
Id: 3
Const: "GOLDENMACECLAN"
Name: "Golden Mace Clan"
Leader: "Berman Aire"
Map: "prontera"
Buff: {
Icon: "SI_GOLDENMACECLAN"
Script: <"
bonus(bInt, 1);
bonus(bLuk, 1);
bonus(bMaxHP, 30);
bonus(bMaxSP, 10);
">
}
Allies: [
"SWORDCLAN",
"ARCWANDCLAN",
"CROSSBOWCLAN",
]
},
{
Id: 4
Const: "CROSSBOWCLAN"
Name: "Crossbow Clan"
Leader: "Shaam Rumi"
Map: "payon"
Buff: {
Icon: "SI_CROSSBOWCLAN"
Script: <"
bonus(bDex, 1);
bonus(bAgi, 1);
bonus(bMaxHP, 30);
bonus(bMaxSP, 10);
">
}
Allies: [
"GOLDENMACECLAN",
]
Antagonists: [
"ARCWANDCLAN",
]
},
)
5 changes: 5 additions & 0 deletions db/constants.conf
Expand Up @@ -1401,6 +1401,9 @@ constants_db: {
// Summer 2 Costume
SC_DRESS_UP: 652

// Clan System
SC_CLAN_INFO: 654

comment__: "Emotes"
e_gasp: 0
e_what: 1
Expand Down Expand Up @@ -3720,6 +3723,7 @@ constants_db: {
PC_PARTY: 1
PC_GUILD: 2
PC_MAP: 3
PC_CLAN: 4

comment__: "strnpcinfo"
NPC_NAME: 0
Expand All @@ -3734,6 +3738,7 @@ constants_db: {
CHAR_ID_GUILD: 2
CHAR_ID_ACCOUNT: 3
CHAR_ID_BG: 4
CHAR_ID_CLAN: 5

comment__: "sc_start"
SCFLAG_NONE: 0x00
Expand Down
19 changes: 19 additions & 0 deletions db/re/map_zone_db.conf
Expand Up @@ -176,6 +176,25 @@ zones: (
"nocashshop",
)
},
{
/* CvC zone is applied to all maps with a cvc mapflag */
name: "CvC" /* changing this name requires MAP_ZONE_CVC_NAME to also be changed in src/map/map.h file */

disabled_skills: {
BS_GREED: "PLAYER"
CG_HERMODE: "PLAYER"
}

disabled_items: {
Greed_Scroll: true
C_Beginner_Cap: true
}

/* cashshop disabled in cvc maps */
mapflags: (
"nocashshop",
)
},
{
/* PK Mode zone is only used when server is on pk_mode (battle.conf),
it applies to all pvp maps that don't have their own zone */
Expand Down
3 changes: 3 additions & 0 deletions db/sc_config.txt
Expand Up @@ -496,6 +496,9 @@ SC_BLOSSOM_FLUTTERING, 463
SC_SPRITEMABLE, 205
SC_BITESCAR, 4

// Clan System
SC_CLAN_INFO, 463

// Cant Clear
SC_ALL_RIDING, 397

Expand Down
37 changes: 37 additions & 0 deletions doc/atcommands.txt
Expand Up @@ -1455,3 +1455,40 @@ Sets the intimacy level of your homunculus, with 1000 being "Loyal".
Sets the hunger level of your homunculus, with 100 being "Stuffed".

---------------------------------------

@cvcon

Set the mapflag cvc on the map (Turn on Clans vs Clans mode)

---------------------------------------

@cvcoff

Unset the mapflag cvc on the map (Turn off Clans vs Clans mode)

---------------------------------------

@claninfo

Lists all informations of all clans

---------------------------------------

@joinclan <ClanID>

Joins the Clan with the given ID if it exists.

---------------------------------------

@leaveclan

Leaves the Clan if any.

---------------------------------------

@reloadclans

Reloads the 'conf/clans.conf' file.
Obs: it will reload 'db/clans.conf' too since it's included inside 'conf/clans.conf'

---------------------------------------
36 changes: 36 additions & 0 deletions doc/script_commands.txt
Expand Up @@ -2381,6 +2381,7 @@ the invoking character. Whatever it returns is determined by type.
(1) PC_PARTY - The name of the party they're in if any.
(2) PC_GUILD - The name of the guild they're in if any.
(3) PC_MAP - The name of the map the character is in.
(4) PC_CLAN - The name of the clan they're in if any.

If <GID> is passed, it will return the value of the specified player instead
the attached player. If the player is not found, it will return
Expand Down Expand Up @@ -2522,6 +2523,7 @@ Type is the kind of associated ID number required:
(2) CHAR_ID_GUILD - Guild ID number.
(3) CHAR_ID_ACCOUNT - Account ID number.
(4) CHAR_ID_BG - Battle ground ID
(5) CHAR_ID_CLAN - Clan ID number.

For most purposes other than printing it, a number is better to have than
a name (people do horrifying things to their character names).
Expand Down Expand Up @@ -9952,3 +9954,37 @@ Changes the name of a unit.
Supported Types - [ MOB | HOM | PET ].

returns 1 on success, 0 on failure.

---------------------------------------
//=====================================
13 - Clan System Related Commands
//=====================================
---------------------------------------

*join_clan(<ClanID>{,<RID>})

Joins a player into the given clan.
If no RID is given, will run with the current attached player.

returns true on success, false on failure.

---------------------------------------

*clan_leave({<RID>})

Removes a player from its clan.
If no RID is given, will run with the current attached player.

returns true on success, false on failure.

---------------------------------------

*clan_master(<ClanID>)

Enables the Emblem of the given Clan to the current NPC

---------------------------------------
//=====================================
13 - End of Clan System Related Commands
//=====================================
---------------------------------------

2 comments on commit 19c9401

@sinju92
Copy link

@sinju92 sinju92 commented on 19c9401 Feb 7, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

finally thx haru and murilo bio

@bWolfie
Copy link
Contributor

@bWolfie bWolfie commented on 19c9401 Feb 7, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wow, after all this time it's finally here. kinda strange to see it. great stuff.

Please sign in to comment.