summaryrefslogtreecommitdiff
path: root/src/map
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 /src/map
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
Diffstat (limited to 'src/map')
-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
8 files changed, 46 insertions, 14 deletions
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) {