summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
Diffstat (limited to 'src/map')
-rw-r--r--src/map/battle.c4
-rw-r--r--src/map/clif.c6
-rw-r--r--src/map/map.h4
-rw-r--r--src/map/pc.c7
-rw-r--r--src/map/status.c55
5 files changed, 44 insertions, 32 deletions
diff --git a/src/map/battle.c b/src/map/battle.c
index 97aaf1ee3..8a66cbedf 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -210,9 +210,9 @@ int battle_damage(struct block_list *src,struct block_list *target,int damage, i
status_change_end(target, SC_CLOAKING, -1);
if (sc->data[SC_CHASEWALK].timer != -1)
status_change_end(target, SC_CHASEWALK, -1);
- if (sc->data[SC_ENDURE].timer != -1 && sc->data[SC_ENDURE].val1 <= 10) {
+ if (sc->data[SC_ENDURE].timer != -1 && !sc->data[SC_ENDURE].val4) {
//Endure count is only reduced by non-players on non-gvg maps.
- //if val1 is greater than 10, this is infinite endure. [Skotlex]
+ //val4 signals infinite endure. [Skotlex]
if (src && src->type != BL_PC && !map_flag_gvg(target->m)
&& --(sc->data[SC_ENDURE].val2) < 0)
status_change_end(target, SC_ENDURE, -1);
diff --git a/src/map/clif.c b/src/map/clif.c
index 5f17946a9..6c7fe0142 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -8239,12 +8239,6 @@ void clif_parse_LoadEndAck(int fd,struct map_session_data *sd)
npc_event_doall_id(script_config.loadmap_event_name, sd->bl.id), script_config.loadmap_event_name);
}
- if (
- pc_checkskill(sd,SG_SUN_COMFORT) ||
- pc_checkskill(sd,SG_MOON_COMFORT) ||
- pc_checkskill(sd,SG_STAR_COMFORT))
- status_calc_pc(sd,0);
-
if (pc_checkskill(sd, SG_DEVIL) && !pc_nextjobexp(sd))
clif_status_load(&sd->bl, SI_DEVIL, 1); //blindness [Komurka]
diff --git a/src/map/map.h b/src/map/map.h
index 59307c071..1160d2862 100644
--- a/src/map/map.h
+++ b/src/map/map.h
@@ -532,7 +532,6 @@ struct map_session_data {
unsigned no_magic_damage : 1;
unsigned no_weapon_damage : 1;
unsigned no_gemstone : 1;
- unsigned infinite_endure : 1;
unsigned intravision : 1; // Maya Purple Card effect allowing to see Hiding/Cloaking people [DracoRPG]
} special_state;
int char_id, login_id1, login_id2, sex;
@@ -1131,7 +1130,7 @@ enum {
SP_DELAYRATE,SP_HP_DRAIN_RATE_RACE,SP_SP_DRAIN_RATE_RACE, // 1083-1085
SP_RESTART_FULL_RECOVER=2000,SP_NO_CASTCANCEL,SP_NO_SIZEFIX,SP_NO_MAGIC_DAMAGE,SP_NO_WEAPON_DAMAGE,SP_NO_GEMSTONE, // 2000-2005
- SP_NO_CASTCANCEL2,SP_INFINITE_ENDURE,SP_UNBREAKABLE_WEAPON,SP_UNBREAKABLE_ARMOR, SP_UNBREAKABLE_HELM, // 2006-2010
+ SP_NO_CASTCANCEL2,SP_FREE,SP_UNBREAKABLE_WEAPON,SP_UNBREAKABLE_ARMOR, SP_UNBREAKABLE_HELM, // 2006-2010
SP_UNBREAKABLE_SHIELD, SP_LONG_ATK_RATE, // 2011-2012
SP_CRIT_ATK_RATE, SP_CRITICAL_ADDRACE, SP_NO_REGEN, SP_ADDEFF_WHENHIT, SP_AUTOSPELL_WHENHIT, // 2013-2017
@@ -1142,6 +1141,7 @@ enum {
SP_UNSTRIPABLE_WEAPON,SP_UNSTRIPABLE_ARMOR,SP_UNSTRIPABLE_HELM,SP_UNSTRIPABLE_SHIELD, // 2034-2037
SP_INTRAVISION, SP_ADD_MONSTER_DROP_ITEMGROUP, SP_SP_LOSS_RATE, // 2038-2040
SP_ADD_SKILL_BLOW, SP_SP_VANISH_RATE //2041
+ //Before adding another, note that 2007 (SP_FREE, previously Infinite Endure) is available!
};
enum {
diff --git a/src/map/pc.c b/src/map/pc.c
index d2d73acb5..00f606051 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -1479,13 +1479,6 @@ int pc_bonus(struct map_session_data *sd,int type,int val)
if(sd->state.lr_flag != 2)
sd->special_state.no_gemstone = 1;
break;
- case SP_INFINITE_ENDURE:
- if(sd->state.lr_flag != 2) {
- sd->special_state.infinite_endure = 1;
- if (sd->sc.data[SC_ENDURE].timer == -1)
- sc_start(&sd->bl,SC_ENDURE,100,11,600000);
- }
- break;
case SP_INTRAVISION: // Maya Purple Card effect allowing to see Hiding/Cloaking people [DracoRPG]
if(sd->state.lr_flag != 2)
sd->special_state.intravision = 1;
diff --git a/src/map/status.c b/src/map/status.c
index 2dd28505e..be58f7792 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -821,7 +821,15 @@ int status_calc_pc(struct map_session_data* sd,int first)
if(!c)
continue;
data = itemdb_exists(c);
- if (!data || !data->script)
+ if(!data)
+ continue;
+ if(first&1 && data->equip_script)
+ { //Execute equip-script on login
+ run_script(data->equip_script,0,sd->bl.id,0);
+ if (!calculating)
+ return 1;
+ }
+ if(!data->script)
continue;
if(data->flag.no_equip) { //Card restriction checks.
if(map[sd->bl.m].flag.restricted && data->flag.no_equip&map[sd->bl.m].zone)
@@ -868,6 +876,14 @@ int status_calc_pc(struct map_session_data* sd,int first)
continue;
sd->def += sd->inventory_data[index]->def;
+
+ if(first&1 && sd->inventory_data[index]->equip_script)
+ { //Execute equip-script on login
+ run_script(sd->inventory_data[index]->equip_script,0,sd->bl.id,0);
+ if (!calculating)
+ return 1;
+ }
+
if(sd->inventory_data[index]->type == 4) {
int r,wlv = sd->inventory_data[index]->wlv;
struct weapon_data *wd;
@@ -884,12 +900,15 @@ int status_calc_pc(struct map_session_data* sd,int first)
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;
+ if(sd->inventory_data[index]->script) {
+ 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(sd->inventory_data[index]->script)
+ run_script(sd->inventory_data[index]->script,0,sd->bl.id,0);
}
if (!calculating) //Abort, run_script retriggered status_calc_pc. [Skotlex]
return 1;
@@ -908,9 +927,11 @@ int status_calc_pc(struct map_session_data* sd,int first)
}
else if(sd->inventory_data[index]->type == 5) {
refinedef += sd->status.inventory[index].refine*refinebonus[0][0];
- 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->inventory_data[index]->script) {
+ run_script(sd->inventory_data[index]->script,0,sd->bl.id,0);
+ if (!calculating) //Abort, run_script retriggered status_calc_pc. [Skotlex]
+ return 1;
+ }
}
}
@@ -2100,7 +2121,7 @@ int status_calc_mdef(struct block_list *bl, int mdef)
return 90;
if(sc->data[SC_SKA].timer != -1) // [marquis007]
return 90; // should it up mdef too?
- if(sc->data[SC_ENDURE].timer!=-1)
+ if(sc->data[SC_ENDURE].timer!=-1 && sc->data[SC_ENDURE].val4 == 0)
mdef += sc->data[SC_ENDURE].val1;
}
@@ -3938,8 +3959,9 @@ int status_change_start(struct block_list *bl,int type,int rate,int val1,int val
break;
case SC_ENDURE: /* インデュア */
if(tick <= 0) tick = 1000 * 60;
- calc_flag = 1; // for updating mdef
val2 = 7; // [Celest]
+ if (!val4)
+ calc_flag = 1; // for updating mdef
break;
case SC_AUTOBERSERK:
{
@@ -4279,8 +4301,8 @@ int status_change_start(struct block_list *bl,int type,int rate,int val1,int val
break;
case SC_BERSERK: /* バ?サ?ク */
- if (sc->data[SC_ENDURE].timer == -1 || sc->data[SC_ENDURE].val1 <= 10)
- sc_start(bl, SC_ENDURE, 100, 11, tick);
+ if (sc->data[SC_ENDURE].timer == -1 || !sc->data[SC_ENDURE].val4)
+ sc_start4(bl, SC_ENDURE, 100, 1,0,0,1, tick);
if(sd && !(flag&4)){
sd->status.hp = sd->status.max_hp * 3;
sd->status.sp = 0;
@@ -4450,7 +4472,7 @@ int status_change_start(struct block_list *bl,int type,int rate,int val1,int val
break;
}
val2 = 200*val1; //HP heal
- val3 = 5*val2; //SP cost
+ val3 = 5*val1; //SP cost
val4 = -1; //Kaahi Timer.
break;
case SC_BLESSING:
@@ -4876,7 +4898,6 @@ int status_change_end( struct block_list* bl , int type,int tid )
switch(type){ /* 異常の種類ごとの?理 */
case SC_PROVOKE: /* プロボック */
- case SC_ENDURE: // celest
case SC_CONCENTRATE: /* 集中力向上 */
case SC_BLESSING: /* ブレッシング */
case SC_ANGELUS: /* アンゼルス */
@@ -4977,6 +4998,10 @@ int status_change_end( struct block_list* bl , int type,int tid )
calc_flag = 1;
break;
+ case SC_ENDURE: // celest
+ calc_flag = (sc->data[type].val4==0);
+ break;
+
case SC_WEDDING: //結婚用(結婚衣裳になって?くのが?いとか)
{
struct view_data *vd = status_get_viewdata(bl);
@@ -5481,7 +5506,7 @@ int status_change_timer(int tid, unsigned int tick, int id, int data)
break;
case SC_ENDURE: /* インデュア */
- if(sc->data[type].val1 > 10 || (sd && sd->special_state.infinite_endure))
+ if(sc->data[type].val4)
{
sc->data[type].timer=add_timer(1000*60+tick,status_change_timer, bl->id, data);
return 0;