summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-03-03 14:38:13 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-03-03 14:38:13 +0000
commitd214e16b4875f2be40c817f609d940a6ff5ef088 (patch)
tree52cd02c0d0d6c90dd74d26db0755223f3dc818c9
parentecfd2c2ae5e714347dd86eba90d2ad051d84e447 (diff)
downloadhercules-d214e16b4875f2be40c817f609d940a6ff5ef088.tar.gz
hercules-d214e16b4875f2be40c817f609d940a6ff5ef088.tar.bz2
hercules-d214e16b4875f2be40c817f609d940a6ff5ef088.tar.xz
hercules-d214e16b4875f2be40c817f609d940a6ff5ef088.zip
- 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://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5446 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r--Changelog-Trunk.txt8
-rw-r--r--conf-tmpl/battle/gm.conf2
-rw-r--r--conf-tmpl/msg_athena.conf2
-rw-r--r--db/const.txt2
-rw-r--r--src/map/atcommand.c10
-rw-r--r--src/map/charcommand.c9
-rw-r--r--src/map/map.c2
-rw-r--r--src/map/map.h1
-rw-r--r--src/map/npc.c3
-rw-r--r--src/map/script.c8
-rw-r--r--src/map/skill.c4
-rw-r--r--src/map/status.c23
12 files changed, 58 insertions, 16 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt
index 96b023c4f..927e40c26 100644
--- a/Changelog-Trunk.txt
+++ b/Changelog-Trunk.txt
@@ -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
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
* Slaves inherit speed will now only work if the master can move. [Skotlex]
* Some cleanup and reorganization on the way pet-skill variables are
diff --git a/conf-tmpl/battle/gm.conf b/conf-tmpl/battle/gm.conf
index 2a7ef55f2..34630da1b 100644
--- a/conf-tmpl/battle/gm.conf
+++ b/conf-tmpl/battle/gm.conf
@@ -43,7 +43,7 @@ gm_all_skill_add_abra: no
gm_all_equipment: 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] Can join a password protected chat? (No or mimimum GM level)
diff --git a/conf-tmpl/msg_athena.conf b/conf-tmpl/msg_athena.conf
index 6099df769..af87144c1 100644
--- a/conf-tmpl/msg_athena.conf
+++ b/conf-tmpl/msg_athena.conf
@@ -149,7 +149,7 @@
140: Character's disguise applied.
141: Character's undisguise applied.
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.
145: Invalid new E-mail. Please enter a real E-mail.
146: New E-mail must be a real E-mail.
diff --git a/db/const.txt b/db/const.txt
index 7257783f8..8678f7823 100644
--- a/db/const.txt
+++ b/db/const.txt
@@ -122,6 +122,8 @@ mf_nomvploot 31
mf_noreturn 32
mf_nowarpto 33
mf_nonightmaredrop 34
+mf_restricted 35
+mf_nocommand 36
cell_wall 1
cell_water 3
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index 782c822ad..95d1efc54 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -767,6 +767,13 @@ is_atcommand(const int fd, struct map_session_data* sd, const char* message, int
if (!*str)
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);
if (type != AtCommand_None) {
char command[100];
@@ -5675,6 +5682,9 @@ int atcommand_mapinfo(
strcat(atcmd_output, "NoSkill | ");
if (map[m_id].flag.noicewall)
strcat(atcmd_output, "NoIcewall | ");
+ if (map[m_id].flag.nocommand)
+ strcat(atcmd_output, "NoCommand | ");
+
clif_displaymessage(fd, atcmd_output);
strcpy(atcmd_output,"Other Flags: ");
diff --git a/src/map/charcommand.c b/src/map/charcommand.c
index 4e2f3f2c3..51f6a7106 100644
--- a/src/map/charcommand.c
+++ b/src/map/charcommand.c
@@ -147,6 +147,15 @@ is_charcommand(const int fd, struct map_session_data* sd, const char* message, i
if (!*str)
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);
if (type != CharCommand_None) {
char command[100];
diff --git a/src/map/map.c b/src/map/map.c
index 3f2db8662..6d0adb509 100644
--- a/src/map/map.c
+++ b/src/map/map.c
@@ -1573,6 +1573,8 @@ int map_quit(struct map_session_data *sd) {
status_change_end(&sd->bl,SC_SPURT,-1);
if(sd->sc.data[SC_BERSERK].timer!=-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); // スキルユニットグル?プの削除
diff --git a/src/map/map.h b/src/map/map.h
index 9c227a2c9..7dba6ac6e 100644
--- a/src/map/map.h
+++ b/src/map/map.h
@@ -1033,6 +1033,7 @@ struct map_data {
unsigned nomvploot : 1; // [Lorky]
unsigned nightenabled :1; //For night display. [Skotlex]
unsigned restricted : 1; // [Komurka]
+ unsigned nocommand : 1; //Blocks @/# commands for non-gms. [Skotlex]
} 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 4a7562b18..c511c8de4 100644
--- a/src/map/npc.c
+++ b/src/map/npc.c
@@ -2611,6 +2611,9 @@ static int npc_parse_mapflag (char *w1, char *w2, char *w3, char *w4)
else if (strcmpi(w3,"nomvploot")==0) { // Lorky
map[m].flag.nomvploot=1;
}
+ else if (strcmpi(w3,"nocommand")==0) { // Skotlex
+ map[m].flag.nocommand=1;
+ }
else if (strcmpi(w3,"restricted")==0) { // Komurka
map[m].flag.restricted=1;
sscanf(w4, "%d", &map[m].zone);
diff --git a/src/map/script.c b/src/map/script.c
index 49b289186..1d725335f 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -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_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_RESTRICTED };
+ MF_RESTRICTED, MF_NOCOMMAND };
int buildin_setmapflagnosave(struct script_state *st)
{
@@ -6718,6 +6718,9 @@ int buildin_setmapflag(struct script_state *st)
case MF_RESTRICTED:
map[m].flag.restricted=1;
break;
+ case MF_NOCOMMAND:
+ map[m].flag.nocommand=1;
+ break;
}
}
@@ -6842,6 +6845,9 @@ int buildin_removemapflag(struct script_state *st)
case MF_RESTRICTED:
map[m].flag.restricted=0;
break;
+ case MF_NOCOMMAND:
+ map[m].flag.nocommand=0;
+ break;
}
}
diff --git a/src/map/skill.c b/src/map/skill.c
index 6d74de30b..e552eb657 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -725,7 +725,7 @@ int skillnotok(int skillid, struct map_session_data *sd)
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
// Check skill restrictions [Celest]
@@ -7574,7 +7574,7 @@ int skill_check_condition(struct map_session_data *sd,int type)
nullpo_retr(0, sd);
- if( battle_config.gm_skilluncond>0 &&
+ if( battle_config.gm_skilluncond &&
pc_isGM(sd)>= battle_config.gm_skilluncond &&
sd->skillitem != sd->skillid)
{ //GMs don't override the skillItem check, otherwise they can use items without them being consumed! [Skotlex]
diff --git a/src/map/status.c b/src/map/status.c
index 12c832063..48c699087 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -855,6 +855,18 @@ int status_calc_pc(struct map_session_data* sd,int first)
if((r-=refinebonus[wlv][2])>0) //Overrefine bonus.
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)
{ // Forged weapon
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.
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) {