diff options
author | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-11-14 14:21:47 +0000 |
---|---|---|
committer | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-11-14 14:21:47 +0000 |
commit | c9d4051012392245ec08e1ee25395bd22555e638 (patch) | |
tree | 772d7b672d421ed0e07df450d7904d9174f2eb56 /src | |
parent | af5a9674dc39e941466fe92502d77f1a6861d0c0 (diff) | |
download | hercules-c9d4051012392245ec08e1ee25395bd22555e638.tar.gz hercules-c9d4051012392245ec08e1ee25395bd22555e638.tar.bz2 hercules-c9d4051012392245ec08e1ee25395bd22555e638.tar.xz hercules-c9d4051012392245ec08e1ee25395bd22555e638.zip |
- Characters with Karma may fight amongst them anywhere.
- Added mapflags partylock and guildlock, which lock the state of the parties/guilds on said maps. partylock blocks user party requests to create/invite/leave/kick, while guildlock blocks user guild requests to create/invite/leave/expel/make alliance/make opposition/delete alliance/delete opposition/break
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9216 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r-- | src/map/atcommand.c | 4 | ||||
-rw-r--r-- | src/map/battle.c | 3 | ||||
-rw-r--r-- | src/map/clif.c | 72 | ||||
-rw-r--r-- | src/map/guild.c | 23 | ||||
-rw-r--r-- | src/map/map.h | 2 | ||||
-rw-r--r-- | src/map/npc.c | 6 | ||||
-rw-r--r-- | src/map/script.c | 19 |
7 files changed, 117 insertions, 12 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c index 1f31c6303..3f0a3c475 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -5652,6 +5652,10 @@ int atcommand_mapinfo( strcat(atcmd_output, "NoMobLoot | ");
if (map[m_id].flag.nomvploot)
strcat(atcmd_output, "NoMVPLoot | ");
+ if (map[m_id].flag.partylock)
+ strcat(atcmd_output, "PartyLock | ");
+ if (map[m_id].flag.guildlock)
+ strcat(atcmd_output, "GuildLock | ");
clif_displaymessage(fd, atcmd_output);
diff --git a/src/map/battle.c b/src/map/battle.c index 0a7dee67c..ffc39c595 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -3230,6 +3230,9 @@ int battle_check_target( struct block_list *src, struct block_list *target,int f case BL_PC: { TBL_PC *sd = (TBL_PC*)t_bl; + if (sd->status.karma && t_bl != s_bl && s_bl->type == BL_PC && + ((TBL_PC*)s_bl)->status.karma) + state |= BCT_ENEMY; //Characters with bad karma may fight amongst them. if (sd->state.monster_ignore && t_bl != s_bl && flag&BCT_ENEMY) return 0; //Global inmunity to attacks. if (sd->state.killable && t_bl != s_bl) diff --git a/src/map/clif.c b/src/map/clif.c index 01032a535..bc3f1e2e7 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -10308,6 +10308,11 @@ void clif_parse_CloseKafra(int fd, struct map_session_data *sd) { */
void clif_parse_CreateParty(int fd, struct map_session_data *sd) {
RFIFOHEAD(fd);
+ if(map[sd->bl.m].flag.partylock)
+ { //Guild locked.
+ clif_displaymessage(fd, msg_txt(227));
+ return;
+ }
if (battle_config.basic_skill_check == 0 || pc_checkskill(sd,NV_BASIC) >= 7) {
party_create(sd,(char*)RFIFOP(fd,2),0,0);
} else
@@ -10319,6 +10324,11 @@ void clif_parse_CreateParty(int fd, struct map_session_data *sd) { *------------------------------------------
*/
void clif_parse_CreateParty2(int fd, struct map_session_data *sd) {
+ if(map[sd->bl.m].flag.partylock)
+ { //Guild locked.
+ clif_displaymessage(fd, msg_txt(227));
+ return;
+ }
if (battle_config.basic_skill_check == 0 || pc_checkskill(sd,NV_BASIC) >= 7){
RFIFOHEAD(fd);
party_create(sd,(char*)RFIFOP(fd,2),RFIFOB(fd,26),RFIFOB(fd,27));
@@ -10335,6 +10345,12 @@ void clif_parse_PartyInvite(int fd, struct map_session_data *sd) { struct map_session_data *t_sd;
RFIFOHEAD(fd);
+ if(map[sd->bl.m].flag.partylock)
+ { //Guild locked.
+ clif_displaymessage(fd, msg_txt(227));
+ return;
+ }
+
t_sd = map_id2sd(RFIFOL(sd->fd,2));
// @noask [LuzZza]
@@ -10365,6 +10381,11 @@ void clif_parse_ReplyPartyInvite(int fd,struct map_session_data *sd) { *------------------------------------------
*/
void clif_parse_LeaveParty(int fd, struct map_session_data *sd) {
+ if(map[sd->bl.m].flag.partylock)
+ { //Guild locked.
+ clif_displaymessage(fd, msg_txt(227));
+ return;
+ }
party_leave(sd);
}
@@ -10374,6 +10395,11 @@ void clif_parse_LeaveParty(int fd, struct map_session_data *sd) { */
void clif_parse_RemovePartyMember(int fd, struct map_session_data *sd) {
RFIFOHEAD(fd);
+ if(map[sd->bl.m].flag.partylock)
+ { //Guild locked.
+ clif_displaymessage(fd, msg_txt(227));
+ return;
+ }
party_removemember(sd,RFIFOL(fd,2),(char*)RFIFOP(fd,6));
}
@@ -10471,6 +10497,11 @@ void clif_parse_OpenVending(int fd,struct map_session_data *sd) { */
void clif_parse_CreateGuild(int fd,struct map_session_data *sd) {
RFIFOHEAD(fd);
+ if(map[sd->bl.m].flag.guildlock)
+ { //Guild locked.
+ clif_displaymessage(fd, msg_txt(228));
+ return;
+ }
guild_create(sd, (char*)RFIFOP(fd,6));
}
@@ -10580,6 +10611,13 @@ void clif_parse_GuildInvite(int fd,struct map_session_data *sd) { struct map_session_data *t_sd;
RFIFOHEAD(fd);
+
+ if(map[sd->bl.m].flag.guildlock)
+ { //Guild locked.
+ clif_displaymessage(fd, msg_txt(228));
+ return;
+ }
+
t_sd = map_id2sd(RFIFOL(sd->fd,2));
// @noask [LuzZza]
@@ -10606,6 +10644,11 @@ void clif_parse_GuildReplyInvite(int fd,struct map_session_data *sd) { */
void clif_parse_GuildLeave(int fd,struct map_session_data *sd) {
RFIFOHEAD(fd);
+ if(map[sd->bl.m].flag.guildlock)
+ { //Guild locked.
+ clif_displaymessage(fd, msg_txt(228));
+ return;
+ }
guild_leave(sd,RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10),(char*)RFIFOP(fd,14));
}
@@ -10615,6 +10658,11 @@ void clif_parse_GuildLeave(int fd,struct map_session_data *sd) { */
void clif_parse_GuildExpulsion(int fd,struct map_session_data *sd) {
RFIFOHEAD(fd);
+ if(map[sd->bl.m].flag.guildlock)
+ { //Guild locked.
+ clif_displaymessage(fd, msg_txt(228));
+ return;
+ }
guild_expulsion(sd,RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10),(char*)RFIFOP(fd,14));
}
@@ -10654,6 +10702,13 @@ void clif_parse_GuildRequestAlliance(int fd, struct map_session_data *sd) { struct map_session_data *t_sd;
RFIFOHEAD(fd);
+
+ if(map[sd->bl.m].flag.guildlock)
+ { //Guild locked.
+ clif_displaymessage(fd, msg_txt(228));
+ return;
+ }
+
t_sd = map_id2sd(RFIFOL(sd->fd,2));
// @noask [LuzZza]
@@ -10680,6 +10735,11 @@ void clif_parse_GuildReplyAlliance(int fd, struct map_session_data *sd) { */
void clif_parse_GuildDelAlliance(int fd, struct map_session_data *sd) {
RFIFOHEAD(fd);
+ if(map[sd->bl.m].flag.guildlock)
+ { //Guild locked.
+ clif_displaymessage(fd, msg_txt(228));
+ return;
+ }
guild_delalliance(sd,RFIFOL(fd,2),RFIFOL(fd,6));
}
@@ -10692,6 +10752,13 @@ void clif_parse_GuildOpposition(int fd, struct map_session_data *sd) { struct map_session_data *t_sd;
RFIFOHEAD(fd);
+
+ if(map[sd->bl.m].flag.guildlock)
+ { //Guild locked.
+ clif_displaymessage(fd, msg_txt(228));
+ return;
+ }
+
t_sd = map_id2sd(RFIFOL(sd->fd,2));
// @noask [LuzZza]
@@ -10709,6 +10776,11 @@ void clif_parse_GuildOpposition(int fd, struct map_session_data *sd) { */
void clif_parse_GuildBreak(int fd, struct map_session_data *sd) {
RFIFOHEAD(fd);
+ if(map[sd->bl.m].flag.guildlock)
+ { //Guild locked.
+ clif_displaymessage(fd, msg_txt(228));
+ return;
+ }
guild_break(sd,(char*)RFIFOP(fd,2));
}
diff --git a/src/map/guild.c b/src/map/guild.c index 428951a22..609e84700 100644 --- a/src/map/guild.c +++ b/src/map/guild.c @@ -427,17 +427,19 @@ int guild_create(struct map_session_data *sd,char *name) {
nullpo_retr(0, sd);
- if(sd->status.guild_id==0){
- if(!battle_config.guild_emperium_check || pc_search_inventory(sd,714) >= 0) {
- struct guild_member m;
- guild_makemember(&m,sd);
- m.position=0;
- intif_guild_create(name,&m);
- } else
- clif_guild_created(sd,3); // エンペリウムがいない
- }else
+ if(sd->status.guild_id)
+ {
clif_guild_created(sd,1); // すでに所属している
-
+ return 0;
+ }
+ if(!battle_config.guild_emperium_check || pc_search_inventory(sd,714) >= 0) {
+ struct guild_member m;
+ guild_makemember(&m,sd);
+ m.position=0;
+ intif_guild_create(name,&m);
+ return 1;
+ }
+ clif_guild_created(sd,3); // エンペリウムがいない
return 0;
}
@@ -635,6 +637,7 @@ int guild_invite(struct map_session_data *sd,struct map_session_data *tsd) if(tsd==NULL || g==NULL)
return 0;
+
if(!battle_config.invite_request_check) {
if (tsd->party_invite>0 || tsd->trade_partner) { // 相手が取引中かどうか
clif_guild_inviteack(sd,0);
diff --git a/src/map/map.h b/src/map/map.h index b9a21036f..882a91882 100644 --- a/src/map/map.h +++ b/src/map/map.h @@ -1118,6 +1118,8 @@ struct map_data { unsigned novending : 1;
unsigned loadevent : 1;
unsigned nochat :1;
+ unsigned partylock :1;
+ unsigned guildlock :1;
} flag;
struct point save;
struct npc_data *npc[MAX_NPC_PER_MAP];
diff --git a/src/map/npc.c b/src/map/npc.c index 075cc2fe1..44b73d8f5 100644 --- a/src/map/npc.c +++ b/src/map/npc.c @@ -2567,6 +2567,12 @@ static int npc_parse_mapflag (char *w1, char *w2, char *w3, char *w4) else if (strcmpi(w3,"nochat")==0) { // Skotlex
map[m].flag.nochat=state;
}
+ else if (strcmpi(w3,"partylock")==0) { // Skotlex
+ map[m].flag.partylock=state;
+ }
+ else if (strcmpi(w3,"guildlock")==0) { // Skotlex
+ map[m].flag.guildlock=state;
+ }
return 0;
}
diff --git a/src/map/script.c b/src/map/script.c index a995b12bb..551e286f1 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -176,7 +176,7 @@ enum { MF_NOTRADE, MF_NOSKILL, MF_NOWARP, - MF_FREE, + MF_PARTYLOCK, MF_NOICEWALL, MF_SNOW, MF_FOG, @@ -206,7 +206,8 @@ enum { MF_NOVENDING, MF_LOADEVENT, MF_NOCHAT, - MF_NOEXPPENALTY + MF_NOEXPPENALTY, + MF_GUILDLOCK }; //Reports on the console the src of an script error. @@ -8378,6 +8379,13 @@ int buildin_setmapflag(struct script_state *st) break; case MF_NOCHAT: map[m].flag.nochat=1; + break; + case MF_PARTYLOCK: + map[m].flag.partylock=1; + break; + case MF_GUILDLOCK: + map[m].flag.guildlock=1; + break; } } @@ -8523,6 +8531,13 @@ int buildin_removemapflag(struct script_state *st) break; case MF_NOCHAT: map[m].flag.nochat=0; + break; + case MF_PARTYLOCK: + map[m].flag.partylock=0; + break; + case MF_GUILDLOCK: + map[m].flag.guildlock=0; + break; } } |