diff options
author | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-08-21 16:07:50 +0000 |
---|---|---|
committer | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-08-21 16:07:50 +0000 |
commit | 41f1a34c8593a40b4c5dc4178d7138e7e166eea0 (patch) | |
tree | f033ae8a8fe52be55838a5050ae01cbec32d5ba0 /src/map | |
parent | 74aac1368dae2d2a8ed5e3897a3cafb0fc5a8984 (diff) | |
download | hercules-41f1a34c8593a40b4c5dc4178d7138e7e166eea0.tar.gz hercules-41f1a34c8593a40b4c5dc4178d7138e7e166eea0.tar.bz2 hercules-41f1a34c8593a40b4c5dc4178d7138e7e166eea0.tar.xz hercules-41f1a34c8593a40b4c5dc4178d7138e7e166eea0.zip |
- Removed config setting "muting_players", and expanded the manner_system config to specify how having negative manner (mute) affects a player (see battle/misc.conf).
- Expanded the pk_mode setting from no/yes to 0/1/2. 1 is normal pk_mode, if 2 is used, it makes killing players give you a loss of 5 manner points.
- Fixed WS_WEAPONREFINE always failing when at less than job 50.
- Fixed a compilation warning in char-txt/int_homun.c
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@8402 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map')
-rw-r--r-- | src/map/atcommand.c | 27 | ||||
-rw-r--r-- | src/map/battle.c | 1 | ||||
-rw-r--r-- | src/map/battle.h | 1 | ||||
-rw-r--r-- | src/map/clif.c | 40 | ||||
-rw-r--r-- | src/map/mercenary.c | 4 | ||||
-rw-r--r-- | src/map/pc.c | 7 | ||||
-rw-r--r-- | src/map/skill.c | 11 | ||||
-rw-r--r-- | src/map/status.c | 17 | ||||
-rw-r--r-- | src/map/status.h | 7 |
9 files changed, 49 insertions, 66 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c index c18a94425..4e372d633 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -788,8 +788,7 @@ is_atcommand(const int fd, struct map_session_data* sd, const char* message, int nullpo_retr(AtCommand_None, sd);
- if (!battle_config.allow_atcommand_when_mute &&
- sd->sc.count && sd->sc.data[SC_NOCHAT].timer != -1) {
+ if (sd->sc.count && sd->sc.data[SC_NOCHAT].timer != -1 && sd->sc.data[SC_NOCHAT].val1&MANNER_NOCOMMAND) {
return AtCommand_Unknown;
}
@@ -8473,7 +8472,8 @@ atcommand_pettalk( return -1;
if (sd->sc.count && //no "chatting" while muted.
- (sd->sc.data[SC_BERSERK].timer!=-1 || sd->sc.data[SC_NOCHAT].timer != -1))
+ (sd->sc.data[SC_BERSERK].timer!=-1 ||
+ (sd->sc.data[SC_NOCHAT].timer != -1 && sd->sc.data[SC_NOCHAT].val1&MANNER_NOCHAT)))
return -1;
if (sscanf(message, "%99[^\n]", mes) < 1)
@@ -8718,17 +8718,11 @@ int atcommand_unmute( struct map_session_data *pl_sd = NULL;
nullpo_retr(-1, sd);
- if(!battle_config.muting_players) {
- clif_displaymessage(fd, "Please enable the muting system before using it.");
- return 0;
- }
-
if (!message || !*message)
return -1;
if((pl_sd=map_nick2sd((char *) message)) != NULL) {
if(pl_sd->sc.data[SC_NOCHAT].timer!=-1) {
- pl_sd->status.manner = 0; // have to set to 0 first [celest]
status_change_end(&pl_sd->bl,SC_NOCHAT,-1);
clif_displaymessage(sd->fd,"Player unmuted");
}
@@ -8794,11 +8788,6 @@ int atcommand_mute( int manner;
nullpo_retr(-1, sd);
- if(!battle_config.muting_players) {
- clif_displaymessage(fd, "Please enable the muting system before using it.");
- return 0;
- }
-
if (!message || !*message || sscanf(message, "%d %23[^\n]", &manner, atcmd_player_name) < 1) {
clif_displaymessage(fd, "Usage: @mute <time> <character name>.");
return -1;
@@ -10173,11 +10162,6 @@ int atcommand_mutearea( int time;
nullpo_retr(0, sd);
- if(!battle_config.muting_players) {
- clif_displaymessage(fd, "Please enable the muting system before using it.");
- return 0;
- }
-
time = atoi(message);
if (!time)
time = 15; // 15 minutes default
@@ -10262,7 +10246,8 @@ int atcommand_me( memset(atcmd_output, '\0', sizeof(atcmd_output));
if (sd->sc.count && //no "chatting" while muted.
- (sd->sc.data[SC_BERSERK].timer!=-1 || sd->sc.data[SC_NOCHAT].timer != -1))
+ (sd->sc.data[SC_BERSERK].timer!=-1 ||
+ (sd->sc.data[SC_NOCHAT].timer != -1 && sd->sc.data[SC_NOCHAT].val1&MANNER_NOCHAT)))
return -1;
if (!message || !*message) {
@@ -10725,7 +10710,7 @@ int atcommand_main( sd->state.mainchat = 1;
clif_displaymessage(fd, msg_txt(380)); // Main chat has been activated.
}
- if (sd->sc.data[SC_NOCHAT].timer != -1) {
+ if (sd->sc.data[SC_NOCHAT].timer != -1 && sd->sc.data[SC_NOCHAT].val1&MANNER_NOCHAT) {
clif_displaymessage(fd, msg_txt(387));
return -1;
}
diff --git a/src/map/battle.c b/src/map/battle.c index fff1dbe81..f1d51bb15 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -3681,7 +3681,6 @@ static const struct battle_data_short { { "pet_hair_style", &battle_config.pet_hair_style }, // added by [Skotlex] { "castrate_dex_scale", &battle_config.castrate_dex_scale }, // added by [MouseJstr] { "area_size", &battle_config.area_size }, // added by [MouseJstr] - { "muting_players", &battle_config.muting_players}, // added by [Apple] { "zeny_from_mobs", &battle_config.zeny_from_mobs}, // [Valaris] { "mobs_level_up", &battle_config.mobs_level_up}, // [Valaris] { "mobs_level_up_exp_rate", &battle_config.mobs_level_up_exp_rate}, // [Valaris] diff --git a/src/map/battle.h b/src/map/battle.h index 588317f2a..7b2bc0600 100644 --- a/src/map/battle.h +++ b/src/map/battle.h @@ -334,7 +334,6 @@ extern struct Battle_Config { unsigned short hack_info_GM_level; // added by [Yor]
unsigned short any_warp_GM_min_level; // added by [Yor]
unsigned short packet_ver_flag; // added by [Yor]
- unsigned short muting_players; // added by [PoW]
unsigned short min_hair_style; // added by [MouseJstr]
unsigned short max_hair_style; // added by [MouseJstr]
diff --git a/src/map/clif.c b/src/map/clif.c index 64411d5bf..8673a3ab8 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -3862,7 +3862,7 @@ void clif_getareachar_pc(struct map_session_data* sd,struct map_session_data* ds )
clif_hpmeter_single(sd->fd, dstsd);
- if(dstsd->status.manner < 0 && battle_config.manner_system)
+ if(dstsd->status.manner < 0)
clif_changestatus(&dstsd->bl,SP_MANNER,dstsd->status.manner);
// pvp circle for duel [LuzZza]
@@ -8358,7 +8358,7 @@ void clif_parse_LoadEndAck(int fd,struct map_session_data *sd) if(sd->vd.cloth_color)
clif_refreshlook(&sd->bl,sd->bl.id,LOOK_CLOTHES_COLOR,sd->vd.cloth_color,SELF);
- if(battle_config.muting_players && sd->status.manner < 0 && battle_config.manner_system)
+ if(sd->status.manner < 0)
sc_start(&sd->bl,SC_NOCHAT,100,0,0);
// Lance
@@ -8664,7 +8664,8 @@ void clif_parse_GlobalMessage(int fd, struct map_session_data *sd) { // S 008c < (is_charcommand(fd, sd, message,0) != CharCommand_None))
return;
if (sd->sc.count &&
- (sd->sc.data[SC_BERSERK].timer != -1 || sd->sc.data[SC_NOCHAT].timer != -1 ))
+ (sd->sc.data[SC_BERSERK].timer != -1 ||
+ (sd->sc.data[SC_NOCHAT].timer != -1 && sd->sc.data[SC_NOCHAT].val1&MANNER_NOCHAT)))
return;
if (battle_config.min_chat_delay)
@@ -9033,7 +9034,8 @@ void clif_parse_Wis(int fd, struct map_session_data *sd) { // S 0096 <len>.w <ni }
if(gm_command) aFree(gm_command);
if (sd->sc.count &&
- (sd->sc.data[SC_BERSERK].timer!=-1 || sd->sc.data[SC_NOCHAT].timer != -1))
+ (sd->sc.data[SC_BERSERK].timer!=-1 ||
+ (sd->sc.data[SC_NOCHAT].timer != -1 && sd->sc.data[SC_NOCHAT].val1&MANNER_NOCHAT)))
return;
if (battle_config.min_chat_delay)
@@ -9104,10 +9106,6 @@ void clif_parse_Wis(int fd, struct map_session_data *sd) { // S 0096 <len>.w <ni clif_displaymessage(fd, msg_txt(388)); // You should enable main chat with "@main on" command.
return;
}
- if (sd->sc.data[SC_NOCHAT].timer != -1) {
- clif_displaymessage(fd, msg_txt(387));
- return;
- }
sprintf(output, msg_txt(386), sd->status.name, (char *)RFIFOP(fd,28));
intif_announce(output, strlen(output) + 1, 0xFE000000, 0);
return;
@@ -9213,7 +9211,7 @@ void clif_parse_TakeItem(int fd, struct map_session_data *sd) { if(sd->sc.count && (
sd->sc.data[SC_TRICKDEAD].timer != -1 ||
sd->sc.data[SC_BLADESTOP].timer != -1 ||
- sd->sc.data[SC_NOCHAT].timer!=-1 )
+ (sd->sc.data[SC_NOCHAT].timer!=-1 && sd->sc.data[SC_NOCHAT].val1&MANNER_NOITEM))
)
break;
@@ -9242,8 +9240,9 @@ void clif_parse_DropItem(int fd, struct map_session_data *sd) { return;
if (sd->sc.count && (
- sd->sc.data[SC_AUTOCOUNTER].timer != -1 || //オートカウンター
- sd->sc.data[SC_BLADESTOP].timer != -1//白刃取り
+ sd->sc.data[SC_AUTOCOUNTER].timer != -1 ||
+ sd->sc.data[SC_BLADESTOP].timer != -1 ||
+ (sd->sc.data[SC_NOCHAT].timer!=-1 && sd->sc.data[SC_NOCHAT].val1&MANNER_NOITEM)
))
return;
@@ -9283,7 +9282,7 @@ void clif_parse_UseItem(int fd, struct map_session_data *sd) { sd->sc.data[SC_TRICKDEAD].timer != -1 || //死んだふり
sd->sc.data[SC_BLADESTOP].timer != -1 || //白刃取り
sd->sc.data[SC_BERSERK].timer!=-1 || //バーサーク
- sd->sc.data[SC_NOCHAT].timer!=-1 ||
+ (sd->sc.data[SC_NOCHAT].timer!=-1 && sd->sc.data[SC_NOCHAT].val1&MANNER_NOITEM) ||
sd->sc.data[SC_GRAVITATION].timer!=-1 //会話禁止
))
return;
@@ -9488,6 +9487,8 @@ void clif_parse_NpcSellListSend(int fd,struct map_session_data *sd) void clif_parse_CreateChatRoom(int fd,struct map_session_data *sd)
{
RFIFOHEAD(fd);
+ if (sd->sc.data[SC_NOCHAT].timer!=-1 && sd->sc.data[SC_NOCHAT].val1&MANNER_NOROOM)
+ return;
if(battle_config.basic_skill_check == 0 || pc_checkskill(sd,NV_BASIC) >= 4){
chat_createchat(sd,RFIFOW(fd,4),RFIFOB(fd,6),(char*)RFIFOP(fd,7),(char*)RFIFOP(fd,15),RFIFOW(fd,2)-15);
} else
@@ -10407,8 +10408,8 @@ void clif_parse_PartyMessage(int fd, struct map_session_data *sd) { is_atcommand(fd, sd, (char*)RFIFOP(fd,4), 0) != AtCommand_None)
return;
if (sd->sc.count && (
- sd->sc.data[SC_BERSERK].timer!=-1 || //バーサーク時は会話も不可
- sd->sc.data[SC_NOCHAT].timer!=-1 //チャット禁止
+ sd->sc.data[SC_BERSERK].timer!=-1 ||
+ (sd->sc.data[SC_NOCHAT].timer!=-1 && sd->sc.data[SC_NOCHAT].val1&MANNER_NOCHAT)
))
return;
@@ -10459,6 +10460,8 @@ void clif_parse_OpenVending(int fd,struct map_session_data *sd) { RFIFOHEAD(fd);
if (clif_trading(sd))
return;
+ if (sd->sc.data[SC_NOCHAT].timer!=-1 && sd->sc.data[SC_NOCHAT].val1&MANNER_NOROOM)
+ return;
vending_openvending(sd, RFIFOW(fd,2), (char*)RFIFOP(fd,4), RFIFOB(fd,84), RFIFOP(fd,85));
}
@@ -10626,8 +10629,8 @@ void clif_parse_GuildMessage(int fd,struct map_session_data *sd) { is_atcommand(fd, sd, (char*)RFIFOP(fd, 4), 0) != AtCommand_None)
return;
if (sd->sc.count && (
- sd->sc.data[SC_BERSERK].timer!=-1 || //バーサーク時は会話も不可
- sd->sc.data[SC_NOCHAT].timer!=-1 //チャット禁止
+ sd->sc.data[SC_BERSERK].timer!=-1 ||
+ (sd->sc.data[SC_NOCHAT].timer!=-1 && sd->sc.data[SC_NOCHAT].val1&MANNER_NOCHAT)
))
return;
@@ -10872,11 +10875,6 @@ void clif_parse_GMReqNoChat(int fd,struct map_session_data *sd) struct block_list *bl;
struct map_session_data *dstsd;
- if(!battle_config.muting_players) {
- clif_displaymessage(fd, "Muting is disabled.");
- return;
- }
-
RFIFOHEAD(fd);
bl = map_id2bl(RFIFOL(fd,2));
if (!bl || bl->type != BL_PC)
diff --git a/src/map/mercenary.c b/src/map/mercenary.c index 7cc58dc7d..6b508429f 100644 --- a/src/map/mercenary.c +++ b/src/map/mercenary.c @@ -113,8 +113,8 @@ int merc_hom_dead(struct homun_data *hd, struct block_list *src) struct map_session_data *sd = hd->master;
clif_emotion(&hd->bl, 16) ; //wah
- if (!sd)
- return 7;
+ if (!sd) //unit remove map will invoke unit free
+ return 3;
//Delete timers when dead.
merc_hom_hungry_timer_delete(hd);
diff --git a/src/map/pc.c b/src/map/pc.c index 50e97249e..efc621333 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -4847,11 +4847,11 @@ int pc_dead(struct map_session_data *sd,struct block_list *src) pc_setglobalreg(ssd, "killedrid", sd->bl.id); npc_script_event(ssd, NPCE_KILLPC); } - if (battle_config.pk_mode && ssd->status.manner >= 0 && battle_config.manner_system) { + if (battle_config.pk_mode&2) { ssd->status.manner -= 5; if(ssd->status.manner < 0) sc_start(src,SC_NOCHAT,100,0,0); - + // PK/Karma system code (not enabled yet) [celest] // originally from Kade Online, so i don't know if any of these is correct ^^; // note: karma is measured REVERSE, so more karma = more 'evil' / less honourable, @@ -5486,9 +5486,8 @@ int pc_jobchange(struct map_session_data *sd,int job, int upper) if(sd->vd.cloth_color) clif_changelook(&sd->bl,LOOK_CLOTHES_COLOR,sd->vd.cloth_color); - if(battle_config.muting_players && sd->status.manner < 0 && battle_config.manner_system) + if(sd->status.manner < 0) clif_changestatus(&sd->bl,SP_MANNER,sd->status.manner); - if(pc_isriding(sd)) //Remove Peco Status to prevent display <> class problems. pc_setoption(sd,sd->sc.option&~OPTION_RIDING); diff --git a/src/map/skill.c b/src/map/skill.c index 8e2c9e44a..218e8ae53 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -8921,11 +8921,11 @@ void skill_weaponrefine (struct map_session_data *sd, int idx) } per = percentrefinery [ditem->wlv][(int)item->refine]; - per += (sd->status.job_level-50)/2; //Updated per the new kro descriptions. [Skotlex] + per += (((signed int)sd->status.job_level)-50)/2; //Updated per the new kro descriptions. [Skotlex] + pc_delitem(sd, i, 1, 0); if (per > rand() % 100) { item->refine++; - pc_delitem(sd, i, 1, 0); if(item->equip) { ep = item->equip; pc_unequipitem(sd,idx,3); @@ -8936,8 +8936,10 @@ void skill_weaponrefine (struct map_session_data *sd, int idx) if (ep) pc_equipitem(sd,idx,ep); clif_misceffect(&sd->bl,3); - if(item->refine == MAX_REFINE && item->card[0] == CARD0_FORGE && - MakeDWord(item->card[2],item->card[3]) == sd->char_id){ // Fame point system [DracoRPG] + if(item->refine == MAX_REFINE && + item->card[0] == CARD0_FORGE && + MakeDWord(item->card[2],item->card[3]) == sd->char_id) + { // Fame point system [DracoRPG] switch(ditem->wlv){ case 1: pc_addfame(sd,1); // Success to refine to +10 a lv1 weapon you forged = +1 fame point @@ -8951,7 +8953,6 @@ void skill_weaponrefine (struct map_session_data *sd, int idx) } } } else { - pc_delitem(sd, i, 1, 0); item->refine = 0; if(item->equip) pc_unequipitem(sd,idx,3); diff --git a/src/map/status.c b/src/map/status.c index aea2a91dd..ec18d8569 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -1002,7 +1002,7 @@ int status_check_skilluse(struct block_list *src, struct block_list *target, int (sc->data[SC_VOLCANO].timer != -1 && skill_num == WZ_ICEWALL) || (sc->data[SC_ROKISWEIL].timer != -1 && skill_num != BD_ADAPTATION && !(status->mode&MD_BOSS)) || (sc->data[SC_HERMODE].timer != -1 && skill_get_inf(skill_num) & INF_SUPPORT_SKILL) || - sc->data[SC_NOCHAT].timer != -1 + (sc->data[SC_NOCHAT].timer != -1 && sc->data[SC_NOCHAT].val1&MANNER_NOSKILL) ) return 0; @@ -4709,6 +4709,7 @@ int status_change_start(struct block_list *bl,int type,int rate,int val1,int val case SC_CLOSECONFINE2: //Can't be re-closed in. case SC_MARIONETTE: case SC_MARIONETTE2: + case SC_NOCHAT: return 0; case SC_DANCING: case SC_DEVOTION: @@ -4941,11 +4942,8 @@ int status_change_start(struct block_list *bl,int type,int rate,int val1,int val clif_changelook(bl,LOOK_CLOTHES_COLOR,vd->cloth_color); break; case SC_NOCHAT: - if(!battle_config.muting_players) { - sd->status.manner = 0; //Zido - return 0; - } tick = 60000; + val1 = battle_config.manner_system; //Mute filters. if (sd) clif_updatestatus(sd,SP_MANNER); break; @@ -5965,11 +5963,8 @@ int status_change_end( struct block_list* bl , int type,int tid ) status_change_end(bl,SC_LONGING,-1); break; case SC_NOCHAT: - if (sd && battle_config.manner_system) - { - //Why set it to 0? Can't we use good manners for something? [Skotlex] -// if (sd->status.manner >= 0) // weeee ^^ [celest] -// sd->status.manner = 0; + if (sd) { + if (sd->status.manner < 0) sd->status.manner = 0; clif_updatestatus(sd,SP_MANNER); } break; @@ -6555,7 +6550,7 @@ int status_change_timer(int tid, unsigned int tick, int id, int data) } break; case SC_NOCHAT: - if(sd && battle_config.manner_system){ + if(sd){ sd->status.manner++; clif_updatestatus(sd,SP_MANNER); if (sd->status.manner < 0) diff --git a/src/map/status.h b/src/map/status.h index 71dbc21c7..4f1fc9dad 100644 --- a/src/map/status.h +++ b/src/map/status.h @@ -483,6 +483,13 @@ enum { #define OPTION_CART (OPTION_CART1|OPTION_CART2|OPTION_CART3|OPTION_CART4|OPTION_CART5)
+//Defines for the manner system [Skotlex]
+#define MANNER_NOCHAT 0x01
+#define MANNER_NOSKILL 0x02
+#define MANNER_NOCOMMAND 0x04
+#define MANNER_NOITEM 0x08
+#define MANNER_NOROOM 0x10
+
//Define flags for the status_calc_bl function. [Skotlex]
#define SCB_NONE 0x00000000
#define SCB_BASE 0x00000001
|