- Trick dead now ends on logout

- Added mapflag nocommand which blocks @/# commands unless your gm level is above gm_skill_unconditional's level.
- Fixed weapon scripts not being executed unless the weapon was forged.
- gm_skill_unconditional is now a no/gm-level setting instead of yes/no


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@5446 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
skotlex 2006-03-03 14:38:13 +00:00
parent c8af6f6973
commit d770421a9d
12 changed files with 58 additions and 16 deletions

View File

@ -4,6 +4,14 @@ AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO
IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK. EVERYTHING ELSE IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK. EVERYTHING ELSE
GOES INTO TRUNK AND WILL BE MERGED INTO STABLE BY VALARIS AND WIZPUTER. -- VALARIS GOES INTO TRUNK AND WILL BE MERGED INTO STABLE BY VALARIS AND WIZPUTER. -- VALARIS
2006/03/03
* Trick dead now ends on logout [Skotlex]
* Added mapflag nocommand which blocks @/# commands unless your gm level is
above gm_skill_unconditional's level. [Skotlex]
* Fixed weapon scripts not being executed unless the weapon was forged.
[Skotlex]
* gm_skill_unconditional is now a no/gm-level setting instead of yes/no
[Skotlex]
2006/03/02 2006/03/02
* Slaves inherit speed will now only work if the master can move. [Skotlex] * Slaves inherit speed will now only work if the master can move. [Skotlex]
* Some cleanup and reorganization on the way pet-skill variables are * Some cleanup and reorganization on the way pet-skill variables are

View File

@ -43,7 +43,7 @@ gm_all_skill_add_abra: no
gm_all_equipment: no gm_all_equipment: no
// [GM] Can use skills without meeting the required conditions (no // [GM] Can use skills without meeting the required conditions (no
// blue gems? no problem // blue gems? no or minimum GM level to bypass requirements.
gm_skill_unconditional: no gm_skill_unconditional: no
// [GM] Can join a password protected chat? (No or mimimum GM level) // [GM] Can join a password protected chat? (No or mimimum GM level)

View File

@ -149,7 +149,7 @@
140: Character's disguise applied. 140: Character's disguise applied.
141: Character's undisguise applied. 141: Character's undisguise applied.
142: Character is not disguised. 142: Character is not disguised.
//143 Free 143: Commands are disabled on this map.
144: Invalid actual E-mail. If you have default E-mail, type a@a.com. 144: Invalid actual E-mail. If you have default E-mail, type a@a.com.
145: Invalid new E-mail. Please enter a real E-mail. 145: Invalid new E-mail. Please enter a real E-mail.
146: New E-mail must be a real E-mail. 146: New E-mail must be a real E-mail.

View File

@ -122,6 +122,8 @@ mf_nomvploot 31
mf_noreturn 32 mf_noreturn 32
mf_nowarpto 33 mf_nowarpto 33
mf_nonightmaredrop 34 mf_nonightmaredrop 34
mf_restricted 35
mf_nocommand 36
cell_wall 1 cell_wall 1
cell_water 3 cell_water 3

View File

@ -767,6 +767,13 @@ is_atcommand(const int fd, struct map_session_data* sd, const char* message, int
if (!*str) if (!*str)
return AtCommand_None; return AtCommand_None;
if (map[sd->bl.m].flag.nocommand &&
(gmlvl > 0? gmlvl:pc_isGM(sd)) < battle_config.gm_skilluncond)
{ //Command not allowed on this map.
sprintf(atcmd_output, msg_table[143]);
clif_displaymessage(fd, atcmd_output);
return AtCommand_None;
}
type = atcommand(sd, gmlvl > 0 ? gmlvl : pc_isGM(sd), str, &info); type = atcommand(sd, gmlvl > 0 ? gmlvl : pc_isGM(sd), str, &info);
if (type != AtCommand_None) { if (type != AtCommand_None) {
char command[100]; char command[100];
@ -5675,6 +5682,9 @@ int atcommand_mapinfo(
strcat(atcmd_output, "NoSkill | "); strcat(atcmd_output, "NoSkill | ");
if (map[m_id].flag.noicewall) if (map[m_id].flag.noicewall)
strcat(atcmd_output, "NoIcewall | "); strcat(atcmd_output, "NoIcewall | ");
if (map[m_id].flag.nocommand)
strcat(atcmd_output, "NoCommand | ");
clif_displaymessage(fd, atcmd_output); clif_displaymessage(fd, atcmd_output);
strcpy(atcmd_output,"Other Flags: "); strcpy(atcmd_output,"Other Flags: ");

View File

@ -147,6 +147,15 @@ is_charcommand(const int fd, struct map_session_data* sd, const char* message, i
if (!*str) if (!*str)
return CharCommand_None; return CharCommand_None;
if (map[sd->bl.m].flag.nocommand &&
(gmlvl > 0? gmlvl:pc_isGM(sd)) < battle_config.gm_skilluncond)
{ //Command not allowed on this map.
char output[200];
sprintf(output, msg_table[143]);
clif_displaymessage(fd, output);
return AtCommand_None;
}
type = charcommand(sd, gmlvl > 0 ? gmlvl : pc_isGM(sd), str, &info); type = charcommand(sd, gmlvl > 0 ? gmlvl : pc_isGM(sd), str, &info);
if (type != CharCommand_None) { if (type != CharCommand_None) {
char command[100]; char command[100];

View File

@ -1573,6 +1573,8 @@ int map_quit(struct map_session_data *sd) {
status_change_end(&sd->bl,SC_SPURT,-1); status_change_end(&sd->bl,SC_SPURT,-1);
if(sd->sc.data[SC_BERSERK].timer!=-1) if(sd->sc.data[SC_BERSERK].timer!=-1)
status_change_end(&sd->bl,SC_BERSERK,-1); status_change_end(&sd->bl,SC_BERSERK,-1);
if(sd->sc.data[SC_TRICKDEAD].timer!=-1)
status_change_end(&sd->bl,SC_TRICKDEAD,-1);
} }
skill_clear_unitgroup(&sd->bl); // スキルユニットグル?プの削除 skill_clear_unitgroup(&sd->bl); // スキルユニットグル?プの削除

View File

@ -1033,6 +1033,7 @@ struct map_data {
unsigned nomvploot : 1; // [Lorky] unsigned nomvploot : 1; // [Lorky]
unsigned nightenabled :1; //For night display. [Skotlex] unsigned nightenabled :1; //For night display. [Skotlex]
unsigned restricted : 1; // [Komurka] unsigned restricted : 1; // [Komurka]
unsigned nocommand : 1; //Blocks @/# commands for non-gms. [Skotlex]
} flag; } flag;
struct point save; struct point save;
struct npc_data *npc[MAX_NPC_PER_MAP]; struct npc_data *npc[MAX_NPC_PER_MAP];

View File

@ -2611,6 +2611,9 @@ static int npc_parse_mapflag (char *w1, char *w2, char *w3, char *w4)
else if (strcmpi(w3,"nomvploot")==0) { // Lorky else if (strcmpi(w3,"nomvploot")==0) { // Lorky
map[m].flag.nomvploot=1; map[m].flag.nomvploot=1;
} }
else if (strcmpi(w3,"nocommand")==0) { // Skotlex
map[m].flag.nocommand=1;
}
else if (strcmpi(w3,"restricted")==0) { // Komurka else if (strcmpi(w3,"restricted")==0) { // Komurka
map[m].flag.restricted=1; map[m].flag.restricted=1;
sscanf(w4, "%d", &map[m].zone); sscanf(w4, "%d", &map[m].zone);

View File

@ -6575,7 +6575,7 @@ enum { MF_NOMEMO,MF_NOTELEPORT,MF_NOSAVE,MF_NOBRANCH,MF_NOPENALTY,MF_NOZENYPENA
MF_NOWARP,MF_NOPVP,MF_NOICEWALL,MF_SNOW,MF_FOG,MF_SAKURA,MF_LEAVES,MF_RAIN, MF_NOWARP,MF_NOPVP,MF_NOICEWALL,MF_SNOW,MF_FOG,MF_SAKURA,MF_LEAVES,MF_RAIN,
MF_INDOORS,MF_NOGO,MF_CLOUDS,MF_CLOUDS2,MF_FIREWORKS,MF_GVG_CASTLE,MF_GVG_DUNGEON,MF_NIGHTENABLED, MF_INDOORS,MF_NOGO,MF_CLOUDS,MF_CLOUDS2,MF_FIREWORKS,MF_GVG_CASTLE,MF_GVG_DUNGEON,MF_NIGHTENABLED,
MF_NOBASEEXP, MF_NOJOBEXP, MF_NOMOBLOOT, MF_NOMVPLOOT, MF_NORETURN, MF_NOWARPTO, MF_NIGHTMAREDROP, MF_NOBASEEXP, MF_NOJOBEXP, MF_NOMOBLOOT, MF_NOMVPLOOT, MF_NORETURN, MF_NOWARPTO, MF_NIGHTMAREDROP,
MF_RESTRICTED }; MF_RESTRICTED, MF_NOCOMMAND };
int buildin_setmapflagnosave(struct script_state *st) int buildin_setmapflagnosave(struct script_state *st)
{ {
@ -6718,6 +6718,9 @@ int buildin_setmapflag(struct script_state *st)
case MF_RESTRICTED: case MF_RESTRICTED:
map[m].flag.restricted=1; map[m].flag.restricted=1;
break; break;
case MF_NOCOMMAND:
map[m].flag.nocommand=1;
break;
} }
} }
@ -6842,6 +6845,9 @@ int buildin_removemapflag(struct script_state *st)
case MF_RESTRICTED: case MF_RESTRICTED:
map[m].flag.restricted=0; map[m].flag.restricted=0;
break; break;
case MF_NOCOMMAND:
map[m].flag.nocommand=0;
break;
} }
} }

View File

@ -725,7 +725,7 @@ int skillnotok(int skillid, struct map_session_data *sd)
return 1; return 1;
} }
if (pc_isGM(sd) >= 20 && battle_config.gm_skilluncond) if (battle_config.gm_skilluncond && pc_isGM(sd) >= battle_config.gm_skilluncond)
return 0; // gm's can do anything damn thing they want return 0; // gm's can do anything damn thing they want
// Check skill restrictions [Celest] // Check skill restrictions [Celest]
@ -7574,7 +7574,7 @@ int skill_check_condition(struct map_session_data *sd,int type)
nullpo_retr(0, sd); nullpo_retr(0, sd);
if( battle_config.gm_skilluncond>0 && if( battle_config.gm_skilluncond &&
pc_isGM(sd)>= battle_config.gm_skilluncond && pc_isGM(sd)>= battle_config.gm_skilluncond &&
sd->skillitem != sd->skillid) sd->skillitem != sd->skillid)
{ //GMs don't override the skillItem check, otherwise they can use items without them being consumed! [Skotlex] { //GMs don't override the skillItem check, otherwise they can use items without them being consumed! [Skotlex]

View File

@ -855,6 +855,18 @@ int status_calc_pc(struct map_session_data* sd,int first)
if((r-=refinebonus[wlv][2])>0) //Overrefine bonus. if((r-=refinebonus[wlv][2])>0) //Overrefine bonus.
wd->overrefine = r*refinebonus[wlv][1]; wd->overrefine = r*refinebonus[wlv][1];
if (wd == &sd->left_weapon) {
sd->attackrange_ += sd->inventory_data[index]->range;
sd->state.lr_flag = 1;
run_script(sd->inventory_data[index]->script,0,sd->bl.id,0);
sd->state.lr_flag = 0;
} else {
sd->attackrange += sd->inventory_data[index]->range;
run_script(sd->inventory_data[index]->script,0,sd->bl.id,0);
}
if (!calculating) //Abort, run_script retriggered status_calc_pc. [Skotlex]
return 1;
if(sd->status.inventory[index].card[0]==0x00ff) if(sd->status.inventory[index].card[0]==0x00ff)
{ // Forged weapon { // Forged weapon
wd->star += (sd->status.inventory[index].card[1]>>8); wd->star += (sd->status.inventory[index].card[1]>>8);
@ -865,17 +877,6 @@ int status_calc_pc(struct map_session_data* sd,int first)
if (!wd->atk_ele) //Do not overwrite element from previous bonuses. if (!wd->atk_ele) //Do not overwrite element from previous bonuses.
wd->atk_ele = (sd->status.inventory[index].card[1]&0x0f); wd->atk_ele = (sd->status.inventory[index].card[1]&0x0f);
if (wd == &sd->left_weapon) {
sd->attackrange_ += sd->inventory_data[index]->range;
sd->state.lr_flag = 1;
run_script(sd->inventory_data[index]->script,0,sd->bl.id,0);
sd->state.lr_flag = 0;
} else {
sd->attackrange += sd->inventory_data[index]->range;
run_script(sd->inventory_data[index]->script,0,sd->bl.id,0);
}
if (!calculating) //Abort, run_script retriggered status_calc_pc. [Skotlex]
return 1;
} }
} }
else if(sd->inventory_data[index]->type == 5) { else if(sd->inventory_data[index]->type == 5) {