diff options
author | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-11-07 20:56:28 +0000 |
---|---|---|
committer | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-11-07 20:56:28 +0000 |
commit | f0fef787616b240f4d4dece0973ec20b3464a0e7 (patch) | |
tree | cf8ee0ca6d5890b35f07ac0421ae93153695f728 /src/map | |
parent | 4e7bd03012431ebb2f308e3667db41a883b1041e (diff) | |
download | hercules-f0fef787616b240f4d4dece0973ec20b3464a0e7.tar.gz hercules-f0fef787616b240f4d4dece0973ec20b3464a0e7.tar.bz2 hercules-f0fef787616b240f4d4dece0973ec20b3464a0e7.tar.xz hercules-f0fef787616b240f4d4dece0973ec20b3464a0e7.zip |
- Applied FlavioJs's patch which enables colored console output for Windows systems. It also includes a config setting called "stdout_with_ansisequence" with which you can turn off the color codes (in case you are logging all output)
- Added error reporting when the max number of ground unit cells has been reached (this may be the reason why sometimes it fails to recognize when you step out of a song/dance/encore)
- Added passing the Endure effect to other devoted people. Note that the "hit count" is individual for each character, and only when it ends on the Crusader himself will that force it to end on everyone else. It also will not transfer on gvg grounds, but it does transfer in pvp.
- Fixed Reflect-Shield triggering Auto-Guard instead on devoted chars.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9168 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map')
-rw-r--r-- | src/map/map.c | 14 | ||||
-rw-r--r-- | src/map/skill.c | 17 | ||||
-rw-r--r-- | src/map/status.c | 47 |
3 files changed, 57 insertions, 21 deletions
diff --git a/src/map/map.c b/src/map/map.c index 52035d3bd..f55a85170 100644 --- a/src/map/map.c +++ b/src/map/map.c @@ -3292,6 +3292,18 @@ int parse_console(char *buf) { return 0; } +//------------------------------------------------- +// Return numerical value of a switch configuration +// on/off, english, franais, deutsch, espaol +//------------------------------------------------- +int config_switch(const char *str) { + if (strcmpi(str, "on") == 0 || strcmpi(str, "yes") == 0 || strcmpi(str, "oui") == 0 || strcmpi(str, "ja") == 0 || strcmpi(str, "si") == 0) + return 1; + if (strcmpi(str, "off") == 0 || strcmpi(str, "no") == 0 || strcmpi(str, "non") == 0 || strcmpi(str, "nein") == 0) + return 0; + return atoi(str); +} + /*========================================== * ݒt@C?? *------------------------------------------ @@ -3321,6 +3333,8 @@ int map_config_read(char *cfgName) { if(strcmpi(w1,"timestamp_format")==0){ strncpy(timestamp_format, w2, 20); + } else if(strcmpi(w1,"stdout_with_ansisequence")==0){ + stdout_with_ansisequence = config_switch(w2); } else if(strcmpi(w1,"console_silent")==0){ msg_silent = 0; //To always allow the next line to show up. ShowInfo("Console Silent Setting: %d\n", atoi(w2)); diff --git a/src/map/skill.c b/src/map/skill.c index ea9f44c4f..02c5e1e03 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -10087,8 +10087,13 @@ int skill_unit_move_sub (struct block_list *bl, va_list ap) } else { - if (flag&2 && skill_unit_index < 7) //Store this unit id. - skill_unit_temp[skill_unit_index++] = skill_id; + if (flag&2) { //Store this unit id. + if (skill_unit_index < 7) + skill_unit_temp[skill_unit_index++] = skill_id; + else if (battle_config.error_log) + ShowError("skill_unit_move_sub: Reached limit of unit objects per cell!\n"); + } + } if (flag&4) skill_unit_onleft(skill_id,target,tick); @@ -10112,8 +10117,12 @@ int skill_unit_move_sub (struct block_list *bl, va_list ap) else { result = skill_unit_onout(unit,target,tick); - if (flag&2 && skill_unit_index < 7 && result) //Store this unit id. - skill_unit_temp[skill_unit_index++] = result; + if (flag&2 && result) { //Store this unit id. + if (skill_unit_index < 7) + skill_unit_temp[skill_unit_index++] = result; + else if (battle_config.error_log) + ShowError("skill_unit_move_sub: Reached limit of unit objects per cell!\n"); + } } //TODO: Normally, this is dangerous since the unit and group could be freed diff --git a/src/map/status.c b/src/map/status.c index 6426eced3..f0b16afed 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -4825,6 +4825,16 @@ int status_change_start(struct block_list *bl,int type,int rate,int val1,int val break;
case SC_ENDURE:
val2 = 7; // Hit-count [Celest]
+ if (!(flag&1) && sd && !map_flag_gvg(bl->m))
+ {
+ struct map_session_data *tsd;
+ int i;
+ for (i = 0; i < 5; i++)
+ { //See if there are devoted characters, and pass the status to them. [Skotlex]
+ if (sd->devotion[i] && (tsd = map_id2sd(sd->devotion[i])))
+ status_change_start(&tsd->bl,type,10000,val1,val2,val3,val4,tick,1);
+ }
+ }
break;
case SC_AUTOBERSERK:
if (status->hp < status->max_hp>>2 &&
@@ -4884,14 +4894,14 @@ int status_change_start(struct block_list *bl,int type,int rate,int val1,int val break;
case SC_REFLECTSHIELD:
val2=10+val1*3; //% Dmg reflected
- if (sd)
+ if (sd && !(flag&1))
{ //Pass it to devoted chars.
struct map_session_data *tsd;
int i;
for (i = 0; i < 5; i++)
{ //Pass the status to the other affected chars. [Skotlex]
if (sd->devotion[i] && (tsd = map_id2sd(sd->devotion[i])))
- status_change_start(&tsd->bl,SC_AUTOGUARD,10000,val1,val2,0,0,tick,1);
+ status_change_start(&tsd->bl,type,10000,val1,val2,0,0,tick,1);
}
}
break;
@@ -5103,7 +5113,7 @@ int status_change_start(struct block_list *bl,int type,int rate,int val1,int val break;
case SC_AUTOGUARD:
- if (!flag)
+ if (!(flag&1))
{
struct map_session_data *tsd;
int i,t;
@@ -5115,13 +5125,13 @@ int status_change_start(struct block_list *bl,int type,int rate,int val1,int val for (i = 0; i < 5; i++)
{ //Pass the status to the other affected chars. [Skotlex]
if (sd->devotion[i] && (tsd = map_id2sd(sd->devotion[i])))
- status_change_start(&tsd->bl,SC_AUTOGUARD,10000,val1,val2,0,0,tick,1);
+ status_change_start(&tsd->bl,type,10000,val1,val2,0,0,tick,1);
}
}
break;
case SC_DEFENDER:
- if (!flag)
+ if (!(flag&1))
{
struct map_session_data *tsd;
int i;
@@ -5133,7 +5143,7 @@ int status_change_start(struct block_list *bl,int type,int rate,int val1,int val for (i = 0; i < 5; i++)
{ //See if there are devoted characters, and pass the status to them. [Skotlex]
if (sd->devotion[i] && (tsd = map_id2sd(sd->devotion[i])))
- status_change_start(&tsd->bl,SC_DEFENDER,10000,val1,5+val1*5,val3,val4,tick,1);
+ status_change_start(&tsd->bl,type,10000,val1,5+val1*5,val3,val4,tick,1);
}
}
break;
@@ -5361,16 +5371,16 @@ int status_change_start(struct block_list *bl,int type,int rate,int val1,int val { //Try to inherit the status from the Crusader [Skotlex]
//Ideally, we should calculate the remaining time and use that, but we'll trust that
//once the Crusader's status changes, it will reflect on the others.
- int type2 = SC_AUTOGUARD;
- if (src->sc.data[type2].timer != -1)
- sc_start(bl,type2,100,src->sc.data[type2].val1,skill_get_time(StatusSkillChangeTable[type2],src->sc.data[type2].val1));
- type2 = SC_DEFENDER;
- if (src->sc.data[type2].timer != -1)
- sc_start(bl,type2,100,src->sc.data[type2].val1,skill_get_time(StatusSkillChangeTable[type2],src->sc.data[type2].val1));
- type2 = SC_REFLECTSHIELD;
- if (src->sc.data[type2].timer != -1)
- sc_start(bl,type2,100,src->sc.data[type2].val1,skill_get_time(StatusSkillChangeTable[type2],src->sc.data[type2].val1));
-
+ const int types[] = { SC_AUTOGUARD, SC_DEFENDER, SC_REFLECTSHIELD, SC_ENDURE };
+ int type2;
+ int i = map_flag_gvg(bl->m)?2:3;
+ while (i >= 0) {
+ type2 = types[i];
+ if (src->sc.data[type2].timer != -1)
+ sc_start(bl,type2,100,src->sc.data[type2].val1,
+ skill_get_time(StatusSkillChangeTable[type2],src->sc.data[type2].val1));
+ i--;
+ }
}
break;
}
@@ -5992,6 +6002,7 @@ int status_change_end( struct block_list* bl , int type,int tid ) case SC_DEFENDER:
case SC_REFLECTSHIELD:
case SC_AUTOGUARD:
+ case SC_ENDURE:
if (sd) {
struct map_session_data *tsd;
int i;
@@ -6011,13 +6022,15 @@ int status_change_end( struct block_list* bl , int type,int tid ) md->devotion[sc->data[type].val2] = 0;
clif_devotion(md);
}
- //Remove AutoGuard and Defender [Skotlex]
+ //Remove inherited status [Skotlex]
if (sc->data[SC_AUTOGUARD].timer != -1)
status_change_end(bl,SC_AUTOGUARD,-1);
if (sc->data[SC_DEFENDER].timer != -1)
status_change_end(bl,SC_DEFENDER,-1);
if (sc->data[SC_REFLECTSHIELD].timer != -1)
status_change_end(bl,SC_REFLECTSHIELD,-1);
+ if (sc->data[SC_ENDURE].timer != -1)
+ status_change_end(bl,SC_ENDURE,-1);
break;
}
case SC_BLADESTOP:
|