summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-03-04 01:54:56 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-03-04 01:54:56 +0000
commit66ea41fff413837ec15eb47f65474eacf9318e5f (patch)
treecf3c02b8c7ce7734e6a61baa5726036612869771
parent4dfeedcc9d112d1e86b2dac932ee1b6700223427 (diff)
downloadhercules-66ea41fff413837ec15eb47f65474eacf9318e5f.tar.gz
hercules-66ea41fff413837ec15eb47f65474eacf9318e5f.tar.bz2
hercules-66ea41fff413837ec15eb47f65474eacf9318e5f.tar.xz
hercules-66ea41fff413837ec15eb47f65474eacf9318e5f.zip
- The rate passed to status_change_start must now be in 0->10000 range.
- Added macros sc_start and sc_start4 to simplify invocation of status_change_start. - Cleaned the active guild skills, requirements moved to skill_check_require, should now be usable by non-players as well (pets/mobs). - Updated skill_cast_db time info. Magnum's time2 is skill-block time, St. Recovery/ Cure's time2 is the confuse/blind duration, added NPC_POWERUP/NPC_AGIUP durations, Napalm Vulcan's time2 is curse length, and most of Tarot Card's effects last time2 as well. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5454 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r--Changelog-Trunk.txt5
-rw-r--r--db/Changelog.txt7
-rw-r--r--db/skill_cast_db.txt14
-rw-r--r--src/map/atcommand.c4
-rw-r--r--src/map/battle.c8
-rw-r--r--src/map/charsave.c2
-rw-r--r--src/map/chrif.c2
-rw-r--r--src/map/clif.c42
-rw-r--r--src/map/party.c4
-rw-r--r--src/map/pc.c29
-rw-r--r--src/map/script.c6
-rw-r--r--src/map/skill.c663
-rw-r--r--src/map/status.c33
-rw-r--r--src/map/status.h5
14 files changed, 348 insertions, 476 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt
index 2931948b8..97cc23949 100644
--- a/Changelog-Trunk.txt
+++ b/Changelog-Trunk.txt
@@ -5,6 +5,11 @@ IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK. EV
GOES INTO TRUNK AND WILL BE MERGED INTO STABLE BY VALARIS AND WIZPUTER. -- VALARIS
2006/03/03
+ * status_change_start now checks on a 0->10000 scale, should fix sc-cards
+ with very low rates never triggering (eg: some coma-inducing cards).
+ [Skotlex]
+ * Cleaned up the active guild skills. They should be usable now by
+ non-players as well. [Skotlex]
* Fixed crash on the NPC whisper system when the message's size was 1.
[Skotlex]
* Strip status changes are now removed on logout. [Skotlex]
diff --git a/db/Changelog.txt b/db/Changelog.txt
index 7a40318a6..c4387f846 100644
--- a/db/Changelog.txt
+++ b/db/Changelog.txt
@@ -26,6 +26,13 @@
=========================
+03/03
+ * Updated skill_cast_db time info for some skills: [Skotlex]
+ - Magnum's time2 is skill-block time
+ - St. Recovery/ Cure's time2 is the confuse/blind duration
+ - added NPC_POWERUP/NPC_AGIUP durations
+ - Napalm Vulcan's time2 is curse length
+ - Most of Tarot Card's effects last time2
* Adjusted SC durations for Meteor Assault [Skotlex]
03/02
* Temp Plugs for NJ and GS items [Poki#3]
diff --git a/db/skill_cast_db.txt b/db/skill_cast_db.txt
index d3d9bdbfb..e61e3a561 100644
--- a/db/skill_cast_db.txt
+++ b/db/skill_cast_db.txt
@@ -36,7 +36,7 @@
//-- SM_MAGNUM
7,0,0,0,2000,10000
//-- SM_ENDURE
-8,0,0,0,10000:13000:16000:19000:22000:25000:28000:31000:34000:37000,0
+8,0,0,0,10000:13000:16000:19000:22000:25000:28000:31000:34000:37000,10000
//==========================================
@@ -92,7 +92,7 @@
//-- AL_BLESSING
34,0,0,0,60000:80000:100000:120000:140000:160000:180000:200000:220000:240000,0
//-- AL_CURE
-35,0,1000,0,0,0
+35,0,1000,0,0,6000
//==========================================
@@ -149,7 +149,7 @@
//-- PR_SLOWPOISON
71,0,0,0,10000:20000:30000:40000,0
//-- PR_STRECOVERY
-72,0,2000,0,0,0
+72,0,2000,0,0,30000
//-- PR_KYRIE
73,2000,2000,0,120000,0
//-- PR_MAGNIFICAT
@@ -508,6 +508,10 @@
339,2000,1500,0,900,10000:11000:12000:13000:14000:15000:16000:17000:18000:19000
//-- NPC_STOP
340,0,0,0,10000,0
+//-- NPC_POWERUP
+349,0,0,0,60000:120000:180000:240000:300000,0
+//-- NPC_AGIUP
+350,0,0,0,60000:120000:180000:240000:300000,0
//==========================================
@@ -627,7 +631,7 @@
//-- LK_JOINTBEAT
399,0,800:800:800:800:800:1000:1000:1000:1000:1000,0,0,30000
//-- HW_NAPALMVULCAN
-400,1700,1000,0,0,0,0
+400,1700,1000,0,0,0,45000
//-- CH_SOULCOLLECT
401,2000,0,0,600000,0
//-- PF_MINDBREAKER
@@ -779,7 +783,7 @@
//-- CG_HERMODE
488,0,0,0,10000:15000:20000:25000:30000,10000:15000:20000:25000:30000
//-- CG_TAROTCARD
-489,1000,3000,0,0,0
+489,1000,3000,0,0,30000
//-- CR_ACIDDEMONSTRATION
490,1000,1000,0,0,0
//==========================================
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index 95d1efc54..b30438975 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -8383,7 +8383,7 @@ int atcommand_mute(
clif_GM_silence(sd, pl_sd, 0);
pl_sd->status.manner -= manner;
if(pl_sd->status.manner < 0)
- status_change_start(&pl_sd->bl,SC_NOCHAT,100,0,0,0,0,0,0);
+ sc_start(&pl_sd->bl,SC_NOCHAT,100,0,0);
}
else {
clif_displaymessage(fd, msg_table[3]); // Character not found.
@@ -9478,7 +9478,7 @@ static int atcommand_mutearea_sub(struct block_list *bl,va_list ap)
if (id != bl->id && !pc_isGM(pl_sd)) {
pl_sd->status.manner -= time;
if (pl_sd->status.manner < 0)
- status_change_start(&pl_sd->bl,SC_NOCHAT,100,0,0,0,0,0,0);
+ sc_start(&pl_sd->bl,SC_NOCHAT,100,0,0);
}
return 0;
}
diff --git a/src/map/battle.c b/src/map/battle.c
index f1d03c062..d205034d4 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -604,7 +604,7 @@ int battle_calc_damage(struct block_list *src,struct block_list *bl,int damage,i
if (sd && pc_issit(sd)) pc_setstand(sd); //Stand it to dodge.
clif_skill_nodamage(bl,bl,TK_DODGE,1,1);
if (sc->data[SC_COMBO].timer == -1)
- status_change_start(bl, SC_COMBO, 100, TK_JUMPKICK, src->id, 0, 0, 2000, 0);
+ sc_start4(bl, SC_COMBO, 100, TK_JUMPKICK, src->id, 0, 0, 2000);
return 0;
}
@@ -3041,9 +3041,9 @@ int battle_weapon_attack( struct block_list *src,struct block_list *target,
int duration = skill_get_time2(MO_BLADESTOP,skilllv);
status_change_end(target, SC_BLADESTOP_WAIT, -1);
clif_damage(src, target, tick, status_get_amotion(src), 1, 0, 1, 0, 0); //Display MISS.
- status_change_start(target, SC_BLADESTOP, 100, skilllv, 2, (int)target, (int)src, duration, 0);
+ sc_start4(target, SC_BLADESTOP, 100, skilllv, 2, (int)target, (int)src, duration);
skilllv = sd?pc_checkskill(sd, MO_BLADESTOP):1;
- status_change_start(src, SC_BLADESTOP, 100, skilllv, 1, (int)src, (int)target, duration, 0);
+ sc_start4(src, SC_BLADESTOP, 100, skilllv, 1, (int)src, (int)target, duration);
return 0;
}
@@ -3098,7 +3098,7 @@ int battle_weapon_attack( struct block_list *src,struct block_list *target,
if (sd->weapon_coma_race[boss?10:11] > 0)
rate += sd->weapon_coma_race[boss?10:11];
if (rate)
- status_change_start(target, SC_COMA, rate/100, 0, 0, 0, 0, 0, 0);
+ status_change_start(target, SC_COMA, rate, 0, 0, 0, 0, 0, 0);
}
}
diff --git a/src/map/charsave.c b/src/map/charsave.c
index fde1f66ed..aa066d1e6 100644
--- a/src/map/charsave.c
+++ b/src/map/charsave.c
@@ -467,7 +467,7 @@ int charsave_load_scdata(int account_id, int char_id)
continue;
}
- status_change_start(&sd->bl, atoi(sql_row[0]), 100, atoi(sql_row[2]), atoi(sql_row[3]),
+ status_change_start(&sd->bl, atoi(sql_row[0]), 10000, atoi(sql_row[2]), atoi(sql_row[3]),
atoi(sql_row[4]), atoi(sql_row[5]), atoi(sql_row[1]), 15);
}
}
diff --git a/src/map/chrif.c b/src/map/chrif.c
index 122ee42a7..2ba1ede84 100644
--- a/src/map/chrif.c
+++ b/src/map/chrif.c
@@ -1227,7 +1227,7 @@ int chrif_load_scdata(int fd)
ShowWarning("chrif_load_scdata: Received invalid duration (%d ms) for status change %d (character %s)\n", data.tick, data.type, sd->status.name);
continue;
}
- status_change_start(&sd->bl, data.type, 100, data.val1, data.val2, data.val3, data.val4, data.tick, 15);
+ status_change_start(&sd->bl, data.type, 10000, data.val1, data.val2, data.val3, data.val4, data.tick, 15);
}
#endif
return 0;
diff --git a/src/map/clif.c b/src/map/clif.c
index 5f2a53bf1..8042e5743 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -8823,7 +8823,7 @@ void clif_parse_LoadEndAck(int fd,struct map_session_data *sd)
clif_changelook(&sd->bl,LOOK_CLOTHES_COLOR,sd->status.clothes_color);
if(battle_config.muting_players && sd->status.manner < 0 && battle_config.manner_system)
- status_change_start(&sd->bl,SC_NOCHAT,100,0,0,0,0,0,0);
+ sc_start(&sd->bl,SC_NOCHAT,100,0,0);
// Lance
if (script_config.event_script_type == 0) {
@@ -8836,34 +8836,6 @@ void clif_parse_LoadEndAck(int fd,struct map_session_data *sd)
ShowStatus("%d '"CL_WHITE"%s"CL_RESET"' events executed.\n",
npc_event_doall_id(script_config.loadmap_event_name, sd->bl.id), script_config.loadmap_event_name);
}
-/* These should not be needed anymore. [Skotlex]
- * - the option is sent on every player packet, why send it?
- * - There should be no need to do a signum check on map change, it is done on equipment change.
- * - Trick-dead is finished on pc_setpos
- * - Night effect is handled on clif_spawnpc
- // option
- clif_changeoption(&sd->bl);
- if(sd->sc_data[SC_TRICKDEAD].timer != -1)
- status_change_end(&sd->bl,SC_TRICKDEAD,-1);
- if(sd->sc_data[SC_SIGNUMCRUCIS].timer != -1 && !battle_check_undead(7,sd->def_ele))
- status_change_end(&sd->bl,SC_SIGNUMCRUCIS,-1);
- if(sd->special_state.infinite_endure && sd->sc_data[SC_ENDURE].timer == -1)
- status_change_start(&sd->bl,SC_ENDURE,100,10,1,0,0,0,0);
-
- // Required to eliminate glow bugs because it's executed before clif_changeoption [Lance]
- //New 'night' effect by dynamix [Skotlex]
- if (night_flag && map[sd->bl.m].flag.nightenabled)
- { //Display night.
- if (sd->state.night) //It must be resent because otherwise players get this annoying aura...
- clif_status_load(&sd->bl, SI_NIGHT, 0);
- else
- sd->state.night = 1;
- clif_status_load(&sd->bl, SI_NIGHT, 1);
- } else if (sd->state.night) { //Clear night display.
- clif_status_load(&sd->bl, SI_NIGHT, 0);
- sd->state.night = 0;
- }
-*/
if (pc_checkskill(sd,SG_KNOWLEDGE) ||
pc_checkskill(sd,SG_SUN_COMFORT) ||
pc_checkskill(sd,SG_MOON_COMFORT) ||
@@ -9161,8 +9133,8 @@ void clif_parse_GlobalMessage(int fd, struct map_session_data *sd) { // S 008c <
if (skillnotok(MO_EXPLOSIONSPIRITS,sd))
break; //Do not override the noskill mapflag. [Skotlex]
clif_skill_nodamage(&sd->bl,&sd->bl,MO_EXPLOSIONSPIRITS,-1,
- status_change_start(&sd->bl,SkillStatusChangeTable[MO_EXPLOSIONSPIRITS],100,
- 17,0,0,0,skill_get_time(MO_EXPLOSIONSPIRITS,1),0 )); //Lv17-> +50 critical (noted by Poki) [Skotlex]
+ sc_start(&sd->bl,SkillStatusChangeTable[MO_EXPLOSIONSPIRITS],100,
+ 17,skill_get_time(MO_EXPLOSIONSPIRITS,1))); //Lv17-> +50 critical (noted by Poki) [Skotlex]
sd->state.snovice_flag = 0;
break;
}
@@ -11103,7 +11075,7 @@ void clif_parse_GMReqNoChat(int fd,struct map_session_data *sd)
{
dstsd->status.manner -= limit;
if(dstsd->status.manner < 0)
- status_change_start(bl,SC_NOCHAT,100,0,0,0,0,0,0);
+ sc_start(bl,SC_NOCHAT,100,0,0);
else
{
dstsd->status.manner = 0;
@@ -11300,7 +11272,7 @@ void clif_parse_NoviceDoriDori(int fd, struct map_session_data *sd) {
sd->doridori_counter = 1;
if ((sd->class_&MAPID_UPPERMASK) == MAPID_TAEKWON
&& sd->state.rest && (level = pc_checkskill(sd,TK_SPTIME)))
- status_change_start(&sd->bl,SkillStatusChangeTable[TK_SPTIME],100,level,0,0,0,skill_get_time(TK_SPTIME, level),0);
+ sc_start(&sd->bl,SkillStatusChangeTable[TK_SPTIME],100,level,skill_get_time(TK_SPTIME, level));
return;
}
/*==========================================
@@ -11319,8 +11291,8 @@ void clif_parse_NoviceExplosionSpirits(int fd, struct map_session_data *sd)
}
if((sd->class_&MAPID_UPPERMASK) == MAPID_SUPER_NOVICE && sd->status.base_exp > 0 && nextbaseexp > 0 && (int)((double)1000*sd->status.base_exp/nextbaseexp)%100==0){
clif_skill_nodamage(&sd->bl,&sd->bl,MO_EXPLOSIONSPIRITS,5,
- status_change_start(&sd->bl,SkillStatusChangeTable[MO_EXPLOSIONSPIRITS],100,
- 5,0,0,0,skill_get_time(MO_EXPLOSIONSPIRITS,5),0));
+ sc_start(&sd->bl,SkillStatusChangeTable[MO_EXPLOSIONSPIRITS],100,
+ 5,skill_get_time(MO_EXPLOSIONSPIRITS,5)));
}
}
return;
diff --git a/src/map/party.c b/src/map/party.c
index 98f4b80ca..d40aa2852 100644
--- a/src/map/party.c
+++ b/src/map/party.c
@@ -582,7 +582,7 @@ int party_skill_check(struct map_session_data *sd, int party_id, int skillid, in
&& sd->bl.m == p_sd->bl.m
&& pc_checkskill(p_sd,MO_TRIPLEATTACK)) {
int rate = 50 +50*skilllv; //+100/150/200% success rate
- status_change_start(&p_sd->bl,SC_SKILLRATE_UP,100,MO_TRIPLEATTACK,rate,0,0,skill_get_time(SG_FRIEND, 1),0);
+ sc_start4(&p_sd->bl,SC_SKILLRATE_UP,100,MO_TRIPLEATTACK,rate,0,0,skill_get_time(SG_FRIEND, 1));
}
break;
case MO_TRIPLEATTACK: //Increase Counter rate of Star Gladiators
@@ -590,7 +590,7 @@ int party_skill_check(struct map_session_data *sd, int party_id, int skillid, in
&& sd->bl.m == p_sd->bl.m
&& pc_checkskill(p_sd,TK_COUNTER)) {
int rate = 50 +50*pc_checkskill(p_sd,TK_COUNTER); //+100/150/200% success rate
- status_change_start(&p_sd->bl,SC_SKILLRATE_UP,100,TK_COUNTER,rate,0,0,skill_get_time(SG_FRIEND, 1),0);
+ sc_start4(&p_sd->bl,SC_SKILLRATE_UP,100,TK_COUNTER,rate,0,0,skill_get_time(SG_FRIEND, 1));
}
break;
case AM_TWILIGHT2: //Twilight Pharmacy, requires Super Novice
diff --git a/src/map/pc.c b/src/map/pc.c
index ea04ce8a2..04bd8a6d1 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -307,7 +307,7 @@ int pc_setrestartvalue(struct map_session_data *sd,int type) {
sd->status.sp=sd->status.max_sp;
if (sd->state.snovice_flag == 4) {
sd->state.snovice_flag = 0;
- status_change_start(&sd->bl,SkillStatusChangeTable[MO_STEELBODY],100,1,0,0,0,skill_get_time(MO_STEELBODY,1),0 );
+ sc_start(&sd->bl,SkillStatusChangeTable[MO_STEELBODY],100,1,skill_get_time(MO_STEELBODY,1));
}
}
else {
@@ -846,7 +846,7 @@ int pc_authok(struct map_session_data *sd, int login_id2, time_t connect_until_t
}
if(sd->status.manner < 0) //Needed or manner will always be negative.
- status_change_start(&sd->bl,SC_NOCHAT,100,0,0,0,0,0,0);
+ sc_start(&sd->bl,SC_NOCHAT,100,0,0);
return 0;
}
@@ -1113,14 +1113,14 @@ int pc_checkweighticon(struct map_session_data *sd)
if(flag==1){
if(sd->sc.data[SC_WEIGHT50].timer==-1)
- status_change_start(&sd->bl,SC_WEIGHT50,100,0,0,0,0,0,1);
+ sc_start(&sd->bl,SC_WEIGHT50,100,0,0);
}else{
if(sd->sc.data[SC_WEIGHT50].timer!=-1)
status_change_end(&sd->bl,SC_WEIGHT50,-1);
}
if(flag==2){
if(sd->sc.data[SC_WEIGHT90].timer==-1)
- status_change_start(&sd->bl,SC_WEIGHT90,100,0,0,0,0,0,1);
+ sc_start(&sd->bl,SC_WEIGHT90,100,0,0);
}else{
if(sd->sc.data[SC_WEIGHT90].timer!=-1)
status_change_end(&sd->bl,SC_WEIGHT90,-1);
@@ -3609,8 +3609,7 @@ int pc_walktoxy (struct map_session_data *sd, int x, int y)
if (sd->sc.data && sd->sc.data[SC_MIRACLE].timer==-1 && ((sd->status.class_==JOB_STAR_GLADIATOR) || (sd->status.class_==JOB_STAR_GLADIATOR2)) && (rand()%10000 < battle_config.sg_miracle_skill_ratio) )
{
clif_displaymessage(sd->fd,"[Miracle of the Sun, Moon and Stars]");
- status_change_start(&sd->bl,SC_MIRACLE,100,
- 1,0,0,0,battle_config.sg_miracle_skill_duration,0);
+ sc_start(&sd->bl,SC_MIRACLE,100,1,battle_config.sg_miracle_skill_duration);
}
return 0;
@@ -4513,11 +4512,11 @@ int pc_checkbaselevelup(struct map_session_data *sd)
//スパノビはキリエ、イムポ、マニピ、グロ、サフラLv1がかかる
if((sd->class_&MAPID_UPPERMASK) == MAPID_SUPER_NOVICE || (sd->class_&MAPID_UPPERMASK) == MAPID_TAEKWON){
- status_change_start(&sd->bl,SkillStatusChangeTable[PR_KYRIE],100,1,0,0,0,skill_get_time(PR_KYRIE,1),0 );
- status_change_start(&sd->bl,SkillStatusChangeTable[PR_IMPOSITIO],100,1,0,0,0,skill_get_time(PR_IMPOSITIO,1),0 );
- status_change_start(&sd->bl,SkillStatusChangeTable[PR_MAGNIFICAT],100,1,0,0,0,skill_get_time(PR_MAGNIFICAT,1),0 );
- status_change_start(&sd->bl,SkillStatusChangeTable[PR_GLORIA],100,1,0,0,0,skill_get_time(PR_GLORIA,1),0 );
- status_change_start(&sd->bl,SkillStatusChangeTable[PR_SUFFRAGIUM],100,1,0,0,0,skill_get_time(PR_SUFFRAGIUM,1),0 );
+ sc_start(&sd->bl,SkillStatusChangeTable[PR_KYRIE],100,1,skill_get_time(PR_KYRIE,1));
+ sc_start(&sd->bl,SkillStatusChangeTable[PR_IMPOSITIO],100,1,skill_get_time(PR_IMPOSITIO,1));
+ sc_start(&sd->bl,SkillStatusChangeTable[PR_MAGNIFICAT],100,1,skill_get_time(PR_MAGNIFICAT,1));
+ sc_start(&sd->bl,SkillStatusChangeTable[PR_GLORIA],100,1,skill_get_time(PR_GLORIA,1));
+ sc_start(&sd->bl,SkillStatusChangeTable[PR_SUFFRAGIUM],100,1,skill_get_time(PR_SUFFRAGIUM,1));
}
clif_misceffect(&sd->bl,0);
@@ -5270,7 +5269,7 @@ int pc_damage(struct block_list *src,struct map_session_data *sd,int damage)
if(sd->status.hp<sd->status.max_hp>>2 && sd->sc.data[SC_AUTOBERSERK].timer != -1 &&
(sd->sc.data[SC_PROVOKE].timer==-1 || sd->sc.data[SC_PROVOKE].val2==0 ))
// オ?トバ?サ?ク?動
- status_change_start(&sd->bl,SC_PROVOKE,100,10,1,0,0,0,0);
+ sc_start4(&sd->bl,SC_PROVOKE,100,10,1,0,0,0);
sd->canlog_tick = gettick();
@@ -5329,7 +5328,7 @@ int pc_damage(struct block_list *src,struct map_session_data *sd,int damage)
if (battle_config.pk_mode && ssd->status.manner >= 0 && battle_config.manner_system) {
ssd->status.manner -= 5;
if(ssd->status.manner < 0)
- status_change_start(src,SC_NOCHAT,100,0,0,0,0,0,0);
+ sc_start(src,SC_NOCHAT,100,0,0);
// PK/Karma system code (not enabled yet) [celest]
// originally from Kade Online, so i don't know if any of these is correct ^^;
@@ -5585,9 +5584,9 @@ int pc_damage(struct block_list *src,struct map_session_data *sd,int damage)
if(battle_config.pc_invincible_time)
pc_setinvincibletimer(sd, battle_config.pc_invincible_time);
if (resurrect_flag)
- status_change_start(&sd->bl,SkillStatusChangeTable[PR_KYRIE],100,10,0,0,0,skill_get_time2(SL_KAIZEL, resurrect_flag),0);
+ sc_start(&sd->bl,SkillStatusChangeTable[PR_KYRIE],100,10,skill_get_time2(SL_KAIZEL, resurrect_flag));
else
- status_change_start(&sd->bl,SkillStatusChangeTable[MO_STEELBODY],100,1,0,0,0,skill_get_time(MO_STEELBODY,1),0 );
+ sc_start(&sd->bl,SkillStatusChangeTable[MO_STEELBODY],100,1,skill_get_time(MO_STEELBODY,1));
return 0;
}
diff --git a/src/map/script.c b/src/map/script.c
index 1d725335f..89cd5d8de 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -6082,7 +6082,7 @@ int buildin_sc_start(struct script_state *st)
val4 = 1; //Mark that this was a thrown sc_effect
}
if (bl)
- status_change_start(bl,type,100,val1,0,0,val4,tick,0);
+ sc_start4(bl,type,100,val1,0,0,val4,tick);
return 0;
}
@@ -6110,7 +6110,7 @@ int buildin_sc_start2(struct script_state *st)
}
if(bl)
- status_change_start(bl,type,per/100,val1,0,0,val4,tick,0);
+ status_change_start(bl,type,per,val1,0,0,val4,tick,0);
return 0;
}
@@ -6140,7 +6140,7 @@ int buildin_sc_start4(struct script_state *st)
tick/=2;
}
if (bl)
- status_change_start(bl,type,100,val1,val2,val3,val4,tick,0);
+ sc_start4(bl,type,100,val1,val2,val3,val4,tick);
return 0;
}
diff --git a/src/map/skill.c b/src/map/skill.c
index b966fd5d7..217d9d3ec 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -864,14 +864,14 @@ int skill_additional_effect (struct block_list* src, struct block_list *bl, int
// Chance to trigger Taekwon kicks [Dralnu]
if(sd->sc.count) {
if(sd->sc.data[SC_READYSTORM].timer != -1)
- status_change_start(src,SC_COMBO, 15, TK_STORMKICK,0,0,0,
- (2000 - 4 * status_get_agi(src) - 2 * status_get_dex(src)),0);
+ sc_start4(src,SC_COMBO, 15, TK_STORMKICK,0,0,0,
+ (2000 - 4 * status_get_agi(src) - 2 * status_get_dex(src)));
else if(sd->sc.data[SC_READYDOWN].timer != -1)
- status_change_start(src,SC_COMBO, 15, TK_DOWNKICK,0,0,0,
- (2000 - 4 * status_get_agi(src) - 2 * status_get_dex(src)),0);
+ sc_start4(src,SC_COMBO, 15, TK_DOWNKICK,0,0,0,
+ (2000 - 4 * status_get_agi(src) - 2 * status_get_dex(src)));
else if(sd->sc.data[SC_READYTURN].timer != -1 && sd->sc.data[SC_COMBO].timer == -1)
- status_change_start(src,SC_COMBO, 15, TK_TURNKICK,0,0,0,
- (2000 - 4 * status_get_agi(src) - 2 * status_get_dex(src)),0);
+ sc_start4(src,SC_COMBO, 15, TK_TURNKICK,0,0,0,
+ (2000 - 4 * status_get_agi(src) - 2 * status_get_dex(src)));
else if(sd->sc.data[SC_READYCOUNTER].timer != -1 && sd->sc.data[SC_COMBO].timer == -1) //additional chance from SG_FRIEND [Komurka]
{
rate = 20;
@@ -879,8 +879,8 @@ int skill_additional_effect (struct block_list* src, struct block_list *bl, int
rate += rate*sd->sc.data[SC_SKILLRATE_UP].val2/100;
status_change_end(src,SC_SKILLRATE_UP,-1);
}
- status_change_start(src,SC_COMBO, rate, TK_COUNTER, bl->id,0,0,
- (2000 - 4 * status_get_agi(src) - 2 * status_get_dex(src)),0);
+ sc_start4(src,SC_COMBO, rate, TK_COUNTER, bl->id,0,0,
+ (2000 - 4 * status_get_agi(src) - 2 * status_get_dex(src)));
}
}
}
@@ -888,18 +888,18 @@ int skill_additional_effect (struct block_list* src, struct block_list *bl, int
if (sc && sc->count) {
// Enchant Poison gives a chance to poison attacked enemies
if(sc->data[SC_ENCPOISON].timer != -1)
- status_change_start(bl,SC_POISON,sc->data[SC_ENCPOISON].val1,
- sc->data[SC_ENCPOISON].val1,0,0,0,skill_get_time2(AS_ENCHANTPOISON,sc->data[SC_ENCPOISON].val1),0);
+ sc_start4(bl,SC_POISON,sc->data[SC_ENCPOISON].val1,
+ sc->data[SC_ENCPOISON].val1,0,0,0,skill_get_time2(AS_ENCHANTPOISON,sc->data[SC_ENCPOISON].val1));
// Enchant Deadly Poison gives a chance to deadly poison attacked enemies
if(sc->data[SC_EDP].timer != -1)
- status_change_start(bl,SC_DPOISON,sc->data[SC_EDP].val2,
- sc->data[SC_EDP].val1,0,0,0,skill_get_time2(ASC_EDP,sc->data[SC_EDP].val1),0);
+ sc_start4(bl,SC_DPOISON,sc->data[SC_EDP].val2,
+ sc->data[SC_EDP].val1,0,0,0,skill_get_time2(ASC_EDP,sc->data[SC_EDP].val1));
}
if (tsc->count) {
if (tsc->data[SC_SPLASHER].timer != -1)
- status_change_start(bl,SC_POISON,2*tsc->data[SC_SPLASHER].val1+10,
+ sc_start4(bl,SC_POISON,2*tsc->data[SC_SPLASHER].val1+10,
tsc->data[SC_SPLASHER].val1,0,0,0,
- skill_get_time2(tsc->data[SC_SPLASHER].val2,tsc->data[SC_SPLASHER].val1),0);
+ skill_get_time2(tsc->data[SC_SPLASHER].val2,tsc->data[SC_SPLASHER].val1));
if(tsc->data[SC_KAAHI].timer != -1) {
if (dstsd && dstsd->status.sp < 5*tsc->data[SC_KAAHI].val1)
; //Not enough SP to cast
@@ -916,8 +916,8 @@ int skill_additional_effect (struct block_list* src, struct block_list *bl, int
case SM_BASH: /* バッシュ?i急??U??j */
if( sd && skilllv > 5 && pc_checkskill(sd,SM_FATALBLOW)>0 ){
//TODO: How much % per base level it actually is?
- status_change_start(bl,SC_STUN,(5*(skilllv-5)+(int)sd->status.base_level/10),
- skilllv,0,0,0,skill_get_time2(SM_FATALBLOW,skilllv),0);
+ sc_start(bl,SC_STUN,(5*(skilllv-5)+(int)sd->status.base_level/10),
+ skilllv,skill_get_time2(SM_FATALBLOW,skilllv));
}
break;
@@ -926,23 +926,21 @@ int skill_additional_effect (struct block_list* src, struct block_list *bl, int
skilllv = pc_checkskill(sd, TF_POISON);
case TF_POISON: /* インベナム */
case AS_SPLASHER: /* ベナムスプラッシャ? */
- if(!status_change_start(bl,SC_POISON,(2*skilllv+10),
- skilllv,0,0,0,skill_get_time2(skillid,skilllv),0)
+ if(!sc_start(bl,SC_POISON,(2*skilllv+10),skilllv,skill_get_time2(skillid,skilllv))
&& sd && skillid==TF_POISON
)
clif_skill_fail(sd,skillid,0,0);
break;
case AS_SONICBLOW: /* ソニックブ?? */
- status_change_start(bl,SC_STUN,(2*skilllv+10),
- skilllv,0,0,0,skill_get_time2(skillid,skilllv),0);
+ sc_start(bl,SC_STUN,(2*skilllv+10),skilllv,skill_get_time2(skillid,skilllv));
break;
case AS_GRIMTOOTH:
{
int type = sd?SC_SLOWDOWN:SC_STOP;
if (tsc->data[type].timer == -1)
- status_change_start(bl,type,100,skilllv,0,0,0,skill_get_time2(skillid, skilllv),0);
+ sc_start(bl,type,100,skilllv,skill_get_time2(skillid, skilllv));
break;
}
case MG_FROSTDIVER: /* フ?ストダイバ? */
@@ -951,40 +949,35 @@ int skill_additional_effect (struct block_list* src, struct block_list *bl, int
rate = (skilllv*3+35)-(status_get_int(bl)+status_get_luk(bl))/15;
if (rate <= 5)
rate = 5;
- status_change_start(bl,SC_FREEZE,rate,
- skilllv,0,0,0,skill_get_time2(skillid,skilllv),0);
+ sc_start(bl,SC_FREEZE,rate,skilllv,skill_get_time2(skillid,skilllv));
}
break;
case WZ_STORMGUST: /* スト?ムガスト */
tsc->data[SC_FREEZE].val3++;
if(tsc->data[SC_FREEZE].val3 >= 3)
- status_change_start(bl,SC_FREEZE,100,
+ status_change_start(bl,SC_FREEZE,10000,
skilllv,0,0,0,skill_get_time2(skillid,skilllv),8);
break;
case WZ_METEOR:
- status_change_start(bl,SC_STUN,3*skilllv,skilllv,0,0,0,skill_get_time2(skillid,skilllv),0);
+ sc_start(bl,SC_STUN,3*skilllv,skilllv,skill_get_time2(skillid,skilllv));
break;
case WZ_VERMILION:
- status_change_start(bl,SC_BLIND,4*skilllv,
- skilllv,0,0,0,skill_get_time2(skillid,skilllv),0);
+ sc_start(bl,SC_BLIND,4*skilllv,skilllv,skill_get_time2(skillid,skilllv));
break;
case HT_FREEZINGTRAP: /* フリ?ジングトラップ */
- status_change_start(bl,SC_FREEZE,(3*skilllv+35),
- skilllv,0,0,0,skill_get_time2(skillid,skilllv),0);
+ sc_start(bl,SC_FREEZE,(3*skilllv+35),skilllv,skill_get_time2(skillid,skilllv));
break;
case HT_FLASHER: /* Flasher */
- status_change_start(bl,SC_BLIND,(10*skilllv+30),
- skilllv,0,0,0,skill_get_time2(skillid,skilllv),0);
+ sc_start(bl,SC_BLIND,(10*skilllv+30),skilllv,skill_get_time2(skillid,skilllv));
break;
case HT_LANDMINE: /* ランドマイン */
- status_change_start(bl,SC_STUN,(5*skilllv+30),
- skilllv,0,0,0,skill_get_time2(skillid,skilllv),0);
+ sc_start(bl,SC_STUN,(5*skilllv+30),skilllv,skill_get_time2(skillid,skilllv));
break;
case HT_SHOCKWAVE: //it can't affect mobs, because they have no SP...
@@ -993,23 +986,21 @@ int skill_additional_effect (struct block_list* src, struct block_list *bl, int
break;
case HT_SANDMAN: /* サンドマン */
- status_change_start(bl,SC_SLEEP,(10*skilllv+40),
- skilllv,0,0,0,skill_get_time2(skillid,skilllv),0);
+ sc_start(bl,SC_SLEEP,(10*skilllv+40),skilllv,skill_get_time2(skillid,skilllv));
break;
case TF_SPRINKLESAND: /* ?サまき */
- status_change_start(bl,SC_BLIND,20,skilllv,0,0,0,skill_get_time2(skillid,skilllv),0);
+ sc_start(bl,SC_BLIND,20,skilllv,skill_get_time2(skillid,skilllv));
break;
case TF_THROWSTONE: /* ?ホ投げ */
- status_change_start(bl,SC_STUN,3,skilllv,0,0,0,skill_get_time2(skillid,skilllv),0);
- status_change_start(bl,SC_BLIND,3,skilllv,0,0,0,skill_get_time2(skillid,skilllv),0);
+ sc_start(bl,SC_STUN,3,skilllv,skill_get_time2(skillid,skilllv));
+ sc_start(bl,SC_BLIND,3,skilllv,skill_get_time2(skillid,skilllv));
break;
case NPC_DARKCROSS:
case CR_HOLYCROSS: /* ホ?リ?クロス */
- status_change_start(bl,SC_BLIND,3*skilllv,
- skilllv,0,0,0,skill_get_time2(skillid,skilllv),0);
+ sc_start(bl,SC_BLIND,3*skilllv,skilllv,skill_get_time2(skillid,skilllv));
break;
case CR_GRANDCROSS: /* グランドク?ス */
@@ -1017,12 +1008,12 @@ int skill_additional_effect (struct block_list* src, struct block_list *bl, int
{
int race = status_get_race(bl);
if(battle_check_undead(race,status_get_elem_type(bl)) || race == 6)
- status_change_start(bl,SC_BLIND,100,skilllv,0,0,0,skill_get_time2(skillid,skilllv),0);
+ sc_start(bl,SC_BLIND,100,skilllv,skill_get_time2(skillid,skilllv));
}
break;
case AM_ACIDTERROR:
- status_change_start(bl,SC_BLEEDING,(skilllv*3),skilllv,0,0,0,skill_get_time2(skillid,skilllv),0);
+ sc_start(bl,SC_BLEEDING,(skilllv*3),skilllv,skill_get_time2(skillid,skilllv));
if (skill_break_equip(bl, EQP_ARMOR, 100*skill_get_time(skillid,skilllv), BCT_ENEMY))
clif_emotion(bl,23);
break;
@@ -1032,8 +1023,7 @@ int skill_additional_effect (struct block_list* src, struct block_list *bl, int
break;
case CR_SHIELDCHARGE: /* シ?ルドチャ?ジ */
- status_change_start(bl,SC_STUN,(15+skilllv*5),
- skilllv,0,0,0,skill_get_time2(skillid,skilllv),0);
+ sc_start(bl,SC_STUN,(15+skilllv*5),skilllv,skill_get_time2(skillid,skilllv));
break;
case PA_PRESSURE: /* プレッシャ? */
@@ -1042,24 +1032,20 @@ int skill_additional_effect (struct block_list* src, struct block_list *bl, int
break;
case RG_RAID: /* サプライズアタック */
- status_change_start(bl,SC_STUN,(10+3*skilllv),
- skilllv,0,0,0,skill_get_time2(skillid,skilllv),0);
- status_change_start(bl,SC_BLIND,(10+3*skilllv),
- skilllv,0,0,0,skill_get_time2(skillid,skilllv),0);
+ sc_start(bl,SC_STUN,(10+3*skilllv),skilllv,skill_get_time2(skillid,skilllv));
+ sc_start(bl,SC_BLIND,(10+3*skilllv),skilllv,skill_get_time2(skillid,skilllv));
break;
case BA_FROSTJOKE:
- status_change_start(bl,SC_FREEZE,(15+5*skilllv),
- skilllv,0,0,0,skill_get_time2(skillid,skilllv),0);
+ sc_start(bl,SC_FREEZE,(15+5*skilllv),skilllv,skill_get_time2(skillid,skilllv));
break;
case DC_SCREAM:
- status_change_start(bl,SC_STUN,(25+5*skilllv),
- skilllv,0,0,0,skill_get_time2(skillid,skilllv),0);
+ sc_start(bl,SC_STUN,(25+5*skilllv),skilllv,skill_get_time2(skillid,skilllv));
break;
case BD_LULLABY: /* 子守唄 */
- status_change_start(bl,SC_SLEEP,15,skilllv,0,0,0,skill_get_time2(skillid,skilllv),0);
+ sc_start(bl,SC_SLEEP,15,skilllv,skill_get_time2(skillid,skilllv));
break;
case DC_UGLYDANCE:
@@ -1072,7 +1058,7 @@ int skill_additional_effect (struct block_list* src, struct block_list *bl, int
break;
case SL_STUN:
if (status_get_size(bl)==1) //Only stuns mid-sized mobs.
- status_change_start(bl,SC_STUN,(30+10*skilllv),skilllv,0,0,0,skill_get_time(skillid,skilllv),0);
+ sc_start(bl,SC_STUN,(30+10*skilllv),skilllv,skill_get_time(skillid,skilllv));
break;
/* MOBの追加?果付きスキル */
@@ -1083,8 +1069,7 @@ int skill_additional_effect (struct block_list* src, struct block_list *bl, int
case NPC_POISON:
case NPC_SILENCEATTACK:
case NPC_STUNATTACK:
- status_change_start(bl,SkillStatusChangeTable[skillid],100,skilllv,0,0,0,
- src->type==BL_PET?skilllv*1000:skill_get_time2(skillid,skilllv),0);
+ sc_start(bl,SkillStatusChangeTable[skillid],100,skilllv,src->type==BL_PET?skilllv*1000:skill_get_time2(skillid,skilllv));
break;
case NPC_MENTALBREAKER:
@@ -1109,20 +1094,20 @@ int skill_additional_effect (struct block_list* src, struct block_list *bl, int
break;
case CH_TIGERFIST:
- status_change_start(bl,SC_STOP,(10+skilllv*10),0,0,0,0,skill_get_time2(skillid,skilllv),0);
+ sc_start(bl,SC_STOP,(10+skilllv*10),0,skill_get_time2(skillid,skilllv));
break;
case LK_SPIRALPIERCE:
- status_change_start(bl,SC_STOP,(15+skilllv*5),0,0,0,0,skill_get_time2(skillid,skilllv),0);
+ sc_start(bl,SC_STOP,(15+skilllv*5),0,skill_get_time2(skillid,skilllv));
break;
case ST_REJECTSWORD: /* フリ?ジングトラップ */
- status_change_start(bl,SC_AUTOCOUNTER,(skilllv*15),skilllv,0,0,0,skill_get_time2(skillid,skilllv),0);
+ sc_start(bl,SC_AUTOCOUNTER,(skilllv*15),skilllv,skill_get_time2(skillid,skilllv));
break;
case PF_FOGWALL: /* ホ?リ?ク?ス */
if (src != bl && tsc->data[SC_DELUGE].timer == -1)
- status_change_start(bl,SC_BLIND,100,skilllv,0,0,0,skill_get_time2(skillid,skilllv),8);
+ status_change_start(bl,SC_BLIND,10000,skilllv,0,0,0,skill_get_time2(skillid,skilllv),8);
break;
case LK_HEADCRUSH: /* ヘッドクラッシュ */
@@ -1130,37 +1115,36 @@ int skill_additional_effect (struct block_list* src, struct block_list *bl, int
//??が良く分からないので適?に
int race = status_get_race(bl);
if (!(battle_check_undead(race, status_get_elem_type(bl)) || race == 6))
- status_change_start(bl, SC_BLEEDING,50, skilllv, 0, 0, 0, skill_get_time2(skillid,skilllv), 0);
+ sc_start(bl, SC_BLEEDING,50, skilllv, skill_get_time2(skillid,skilllv));
}
break;
case LK_JOINTBEAT: /* ジョイントビ?ト */
//??が良く分からないので適?に
- status_change_start(bl,SkillStatusChangeTable[skillid],(5*skilllv+5),
- skilllv,0,0,0,skill_get_time2(skillid,skilllv),0);
+ sc_start(bl,SkillStatusChangeTable[skillid],(5*skilllv+5),skilllv,skill_get_time2(skillid,skilllv));
break;
case ASC_METEORASSAULT: /* ?テオアサルト */
//Any enemies hit by this skill will receive Stun, Darkness, or external bleeding status ailment with a 5%+5*SkillLV% chance.
switch(rand()%3) {
case 0:
- status_change_start(bl,SC_BLIND,(5+skilllv*5),skilllv,0,0,0,skill_get_time2(skillid,1),0);
+ sc_start(bl,SC_BLIND,(5+skilllv*5),skilllv,skill_get_time2(skillid,1));
break;
case 1:
- status_change_start(bl,SC_STUN,(5+skilllv*5),skilllv,0,0,0,skill_get_time2(skillid,2),0);
+ sc_start(bl,SC_STUN,(5+skilllv*5),skilllv,skill_get_time2(skillid,2));
break;
default:
- status_change_start(bl,SC_BLEEDING,(5+skilllv*5),skilllv,0,0,0,skill_get_time2(skillid,3),0);
+ sc_start(bl,SC_BLEEDING,(5+skilllv*5),skilllv,skill_get_time2(skillid,3));
}
break;
case HW_NAPALMVULCAN: /* ナパ?ムバルカン */
// skilllv*5%の確率で呪い
- status_change_start(bl,SC_CURSE,5*skilllv,7,0,0,0,skill_get_time2(NPC_CURSEATTACK,7),0);
+ sc_start(bl,SC_CURSE,5*skilllv,skilllv,skill_get_time2(skillid,skilllv));
break;
case WS_CARTTERMINATION: // Cart termination
- status_change_start(bl,SC_STUN,5*skilllv,skilllv,0,0,0,skill_get_time2(skillid,skilllv),0);
+ sc_start(bl,SC_STUN,5*skilllv,skilllv,skill_get_time2(skillid,skilllv));
break;
case CR_ACIDDEMONSTRATION:
@@ -1168,7 +1152,7 @@ int skill_additional_effect (struct block_list* src, struct block_list *bl, int
break;
case TK_DOWNKICK:
- status_change_start(bl,SC_STUN,100,skilllv,0,0,0,skill_get_time(skillid,skilllv),0);
+ sc_start(bl,SC_STUN,100,skilllv,skill_get_time(skillid,skilllv));
break;
case TK_JUMPKICK:
@@ -1195,7 +1179,7 @@ int skill_additional_effect (struct block_list* src, struct block_list *bl, int
break;
case MO_BALKYOUNG: //Note: attack_type is passed as BF_WEAPON for the actual target, BF_MISC for the splash-affected mobs.
if(attack_type == BF_MISC) //70% base stun chance...
- status_change_start(bl,SC_STUN,70,skilllv,0,0,0,skill_get_time2(skillid,skilllv),0);
+ sc_start(bl,SC_STUN,70,skilllv,skill_get_time2(skillid,skilllv));
break;
}
@@ -1211,8 +1195,6 @@ int skill_additional_effect (struct block_list* src, struct block_list *bl, int
rate = sd->addeff[type]+(sd->state.arrow_atk?sd->arrow_addeff[type]:0);
if (!rate)
continue; //Code Speedup.
- rate/=100; //For some reason user effects are on a 10000 scale...
-
status_change_start(bl,i,rate,7,0,0,0,skill_get_time2(StatusSkillChangeTable[type],7),0);
}
}
@@ -1319,7 +1301,7 @@ int skill_counter_additional_effect (struct block_list* src, struct block_list *
break;
case MO_EXTREMITYFIST: /* 阿?C羅覇凰? */
//阿?C羅を使うと5分間自然回復しないようになる
- status_change_start(src,SkillStatusChangeTable[skillid],100,skilllv,0,0,0,skill_get_time2(skillid,skilllv),0 );
+ sc_start(src,SkillStatusChangeTable[skillid],100,skilllv,skill_get_time2(skillid,skilllv));
break;
}
@@ -1332,11 +1314,11 @@ int skill_counter_additional_effect (struct block_list* src, struct block_list *
rate = sd?(sd->addeff2[type]+(sd->state.arrow_atk?sd->arrow_addeff2[type]:0)):0;
if (rate) //Self infliced status from attacking.
- status_change_start(src,i,rate/100,7,0,0,0,skill_get_time2(StatusSkillChangeTable[type],7),0);
+ status_change_start(src,i,rate,7,0,0,0,skill_get_time2(StatusSkillChangeTable[type],7),0);
rate = dstsd?dstsd->addeff3[type]:0;
if (rate && (dstsd->addeff3_type[type] == 1 || ((sd && sd->state.arrow_atk) || (status_get_range(src)>2))))
- status_change_start(src,i,rate/100,7,0,0,0,skill_get_time2(StatusSkillChangeTable[type],7),0);
+ status_change_start(src,i,rate,7,0,0,0,skill_get_time2(StatusSkillChangeTable[type],7),0);
}
}
@@ -1428,8 +1410,7 @@ int skill_break_equip(struct block_list *bl, unsigned short where, int rate, int
else if (rand()%10000 >= rate)
where&=~where_list[i];
else if (!sd) //Cause Strip effect.
- status_change_start(bl,scatk[i],100,0,0,0,0,
- skill_get_time(StatusSkillChangeTable[scatk[i]],1),0);
+ sc_start(bl,scatk[i],100,0,skill_get_time(StatusSkillChangeTable[scatk[i]],1));
}
}
if (!where) //Nothing to break.
@@ -1706,7 +1687,7 @@ int skill_attack( int attack_type, struct block_list* src, struct block_list *ds
if (damage < status_get_hp(bl) &&
pc_checkskill(sd, MO_CHAINCOMBO) > 0)
delay += 300 * battle_config.combo_delay_rate / 100;
- status_change_start(src,SC_COMBO,100,MO_TRIPLEATTACK,skilllv,0,0,delay,0);
+ sc_start4(src,SC_COMBO,100,MO_TRIPLEATTACK,skilllv,0,0,delay);
sd->attackabletime = sd->canmove_tick = tick + delay;
clif_combo_delay(src, delay);
@@ -1720,7 +1701,7 @@ int skill_attack( int attack_type, struct block_list* src, struct block_list *ds
if(damage < status_get_hp(bl) &&
(pc_checkskill(sd, MO_COMBOFINISH) > 0 && sd->spiritball > 0))
delay += 300 * battle_config.combo_delay_rate /100;
- status_change_start(src,SC_COMBO,100,MO_CHAINCOMBO,skilllv,0,0,delay,0);
+ sc_start4(src,SC_COMBO,100,MO_CHAINCOMBO,skilllv,0,0,delay);
sd->attackabletime = sd->canmove_tick = tick + delay;
clif_combo_delay(src,delay);
break;
@@ -1735,7 +1716,7 @@ int skill_attack( int attack_type, struct block_list* src, struct block_list *ds
(pc_checkskill(sd, CH_CHAINCRUSH) > 0 && sd->spiritball > 1)
))
delay += 300 * battle_config.combo_delay_rate /100;
- status_change_start(src,SC_COMBO,100,MO_COMBOFINISH,skilllv,0,0,delay,0);
+ sc_start4(src,SC_COMBO,100,MO_COMBOFINISH,skilllv,0,0,delay);
sd->attackabletime = sd->canmove_tick = tick + delay;
clif_combo_delay(src,delay);
break;
@@ -1749,7 +1730,7 @@ int skill_attack( int attack_type, struct block_list* src, struct block_list *ds
(pc_checkskill(sd, CH_CHAINCRUSH) > 0)
))
delay += 300 * battle_config.combo_delay_rate /100;
- status_change_start(src,SC_COMBO,100,CH_TIGERFIST,skilllv,0,0,delay,0);
+ sc_start4(src,SC_COMBO,100,CH_TIGERFIST,skilllv,0,0,delay);
sd->attackabletime = sd->canmove_tick = tick + delay;
clif_combo_delay(src,delay);
break;
@@ -1759,7 +1740,7 @@ int skill_attack( int attack_type, struct block_list* src, struct block_list *ds
int delay = 1000 - 4 * status_get_agi(src) - 2 * status_get_dex(src);
if(damage < status_get_hp(bl))
delay += 300 * battle_config.combo_delay_rate /100;
- status_change_start(src,SC_COMBO,100,CH_CHAINCRUSH,skilllv,0,0,delay,0);
+ sc_start4(src,SC_COMBO,100,CH_CHAINCRUSH,skilllv,0,0,delay);
sd->attackabletime = sd->canmove_tick = tick + delay;
clif_combo_delay(src,delay);
break;
@@ -1769,7 +1750,7 @@ int skill_attack( int attack_type, struct block_list* src, struct block_list *ds
int race = status_get_race(bl);
if((race == 2 || race == 4) && damage < status_get_hp(bl) && pc_checkskill(sd, HT_POWER)) {
//TODO: This code was taken from Triple Blows,is this even how it should be? [Skotlex]
- status_change_start(src,SC_COMBO,100,HT_POWER,bl->id,0,0,2000,0);
+ sc_start4(src,SC_COMBO,100,HT_POWER,bl->id,0,0,2000);
clif_combo_delay(src,2000);
}
break;
@@ -1789,7 +1770,7 @@ int skill_attack( int attack_type, struct block_list* src, struct block_list *ds
case SL_STIN:
case SL_STUN:
if (skilllv >= 7 && sd->sc.data[SC_COMBO].timer == -1)
- status_change_start(src,SC_COMBO,100,SL_SMA,skilllv,0,0,skill_get_time2(skillid, skilllv),0);
+ sc_start4(src,SC_COMBO,100,SL_SMA,skilllv,0,0,skill_get_time2(skillid, skilllv));
break;
} //Switch End
}
@@ -2141,7 +2122,7 @@ int skill_guildaura_sub (struct block_list *bl,va_list ap)
}
return 0;
}
- status_change_start(&sd->bl, SC_GUILDAURA,100, 1, id, 0, *flag, 0, 0);
+ sc_start4(&sd->bl, SC_GUILDAURA,100, 1, id, 0, *flag, 0);
}
return 0;
@@ -2763,8 +2744,8 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl,int s
skill_castend_damage_id);
//Initiate 10% of your damage becomes fire element.
clif_skill_nodamage (src,bl,skillid,skilllv,
- status_change_start (src,SC_WATK_ELEMENT,100,
- 3,20,0,0,skill_get_time2(skillid, skilllv),0));
+ sc_start4(src,SC_WATK_ELEMENT,100,
+ 3,20,0,0,skill_get_time2(skillid, skilllv)));
if (sd) pc_blockskill_start (sd, skillid, skill_get_time(skillid, skilllv));
}
break;
@@ -2948,7 +2929,7 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl,int s
case SL_STUN:
case SL_SMA:
if (sd && !battle_config.allow_es_magic_pc && bl->type != BL_MOB) {
- status_change_start(src,SC_STUN,100,skilllv,0,0,0,3000,8);
+ status_change_start(src,SC_STUN,10000,skilllv,0,0,0,3000,8);
clif_skill_fail(sd,skillid,0,0);
break;
}
@@ -3265,17 +3246,17 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
case AL_DECAGI: /* 速度減?ュ */
clif_skill_nodamage (src, bl, skillid, skilllv,
- status_change_start (bl, type,
+ sc_start(bl, type,
(40 + skilllv * 2 + (status_get_lv(src) + status_get_int(src))/5),
- skilllv, 0, 0, 0, skill_get_time(skillid,skilllv),0));
+ skilllv, skill_get_time(skillid,skilllv)));
break;
case AL_CRUCIS:
if (flag & 1) {
if (battle_check_target (src, bl, BCT_ENEMY))
- status_change_start(bl,type,
+ sc_start(bl,type,
23+skilllv*4 +status_get_lv(src) -status_get_lv(bl),
- skilllv,0,0,0,0,0);
+ skilllv,0);
} else {
map_foreachinrange(skill_area_sub, src,
skill_get_splash(skillid, skilllv), BL_CHAR,
@@ -3291,8 +3272,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
clif_skill_nodamage (src, bl, skillid, skilllv, 1);
} else
clif_skill_nodamage (src, bl, skillid, skilllv,
- status_change_start(bl,type,
- 100,skilllv,0,0,0,skill_get_time(skillid,skilllv),0));
+ sc_start(bl,type,100,skilllv,skill_get_time(skillid,skilllv)));
break;
case SA_ABRACADABRA:
@@ -3339,8 +3319,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
case SA_COMA:
clif_skill_nodamage(src,bl,skillid,skilllv,
- status_change_start(bl,type,100,
- skilllv,0,0,0,skill_get_time2(skillid,skilllv),0 ));
+ sc_start(bl,type,100,skilllv,skill_get_time2(skillid,skilllv)));
break;
case SA_FULLRECOVERY:
clif_skill_nodamage(src,bl,skillid,skilllv,1);
@@ -3389,8 +3368,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
break;
case SA_REVERSEORCISH:
clif_skill_nodamage(src,bl,skillid,skilllv,
- status_change_start(bl,type,100,
- skilllv,0,0,0,skill_get_time(skillid, skilllv),0));
+ sc_start(bl,type,100,skilllv,skill_get_time(skillid, skilllv)));
break;
case SA_FORTUNE:
clif_skill_nodamage(src,bl,skillid,skilllv,1);
@@ -3416,8 +3394,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
case PR_SUFFRAGIUM: /* サフラギウム */
case PR_BENEDICTIO: /* ?ケ??~福 */
clif_skill_nodamage(src,bl,skillid,skilllv,
- status_change_start(bl,type,100,
- skilllv,0,0,0,skill_get_time(skillid,skilllv),0));
+ sc_start(bl,type,100,skilllv,skill_get_time(skillid,skilllv)));
break;
case CR_PROVIDENCE: /* プ?ヴィデンス */
@@ -3429,8 +3406,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
}
}
clif_skill_nodamage(src,bl,skillid,skilllv,
- status_change_start(bl,type,
- 100,skilllv,0,0,0,skill_get_time(skillid,skilllv),0));
+ sc_start(bl,type,100,skilllv,skill_get_time(skillid,skilllv)));
break;
case CG_MARIONETTE: /* マリオネットコント??ル */
@@ -3440,8 +3416,8 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
if(sc && tsc){
if (sc->data[type].timer == -1 && tsc->data[type2].timer == -1) {
- status_change_start (src,type,100,skilllv,0,bl->id,0,skill_get_time(skillid,skilllv),0);
- status_change_start (bl,type2,100,skilllv,0,src->id,0,skill_get_time(skillid,skilllv),0);
+ sc_start4(src,type,100,skilllv,0,bl->id,0,skill_get_time(skillid,skilllv));
+ sc_start4(bl,type2,100,skilllv,0,src->id,0,skill_get_time(skillid,skilllv));
clif_marionette(src, bl);
}
else if (sc->data[type].timer != -1 && tsc->data[type2].timer != -1 &&
@@ -3462,8 +3438,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
case RG_CLOSECONFINE:
clif_skill_nodamage(src,bl,skillid,skilllv,
- status_change_start (bl,type,100,
- skilllv,src->id,0,0,skill_get_time(skillid,skilllv),0));
+ sc_start4(bl,type,100,skilllv,src->id,0,0,skill_get_time(skillid,skilllv)));
break;
case SA_FLAMELAUNCHER: // added failure chance and chance to break weapon if turned on [Valaris]
case SA_FROSTWEAPON:
@@ -3497,8 +3472,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
}
// 100% success rate at lv4 & 5, but lasts longer at lv5
i = skilllv <4?(60+skilllv*10):100;
- i = status_change_start(bl,type,100,
- skilllv,0,0,0,skill_get_time(skillid,skilllv),0);
+ i = sc_start(bl,type,100,skilllv,skill_get_time(skillid,skilllv));
if(!i) {
if (sd) clif_skill_fail(sd,skillid,0,0);
if (skill_break_equip(bl, EQP_WEAPON, 10000, BCT_PARTY) &&
@@ -3514,8 +3488,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
break;
}
clif_skill_nodamage(src,bl,skillid,skilllv,
- status_change_start(bl,type,100,
- skilllv,0,0,0,skill_get_time(skillid,skilllv),0));
+ sc_start(bl,type,100,skilllv,skill_get_time(skillid,skilllv)));
break;
case TK_SEVENWIND:
@@ -3543,13 +3516,12 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
break;
}
clif_skill_nodamage(src,bl,skillid,skilllv,
- status_change_start(bl,type,100,skilllv,0,0,0,skill_get_time(skillid,skilllv),0));
+ sc_start(bl,type,100,skilllv,skill_get_time(skillid,skilllv)));
break;
case PR_KYRIE: /* キリエエレイソン */
clif_skill_nodamage(bl,bl,skillid,skilllv,
- status_change_start(bl,type,100,
- skilllv,0,0,0,skill_get_time(skillid,skilllv),0));
+ sc_start(bl,type,100,skilllv,skill_get_time(skillid,skilllv)));
break;
//Passive Magnum, should had been casted on yourself.
case SM_MAGNUM:
@@ -3559,8 +3531,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
skill_castend_damage_id);
//Initiate 10% of your damage becomes fire element.
clif_skill_nodamage (src,src,skillid,skilllv,
- status_change_start (src,SC_WATK_ELEMENT,100,
- 3,20,0,0,skill_get_time2(skillid, skilllv),0));
+ sc_start4(src,SC_WATK_ELEMENT,100,3,20,0,0,skill_get_time2(skillid, skilllv)));
if (sd) pc_blockskill_start (sd, skillid, skill_get_time(skillid, skilllv));
break;
case LK_BERSERK: /* バ?サ?ク */
@@ -3576,6 +3547,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
case AL_RUWACH: /* ルアフ */
case MO_EXPLOSIONSPIRITS: // 爆裂波動
case MO_STEELBODY: // 金?
+ case MO_BLADESTOP: // 白?n取り
case LK_AURABLADE: /* オ?ラブレ?ド */
case LK_PARRYING: /* パリイング */
case LK_CONCENTRATION: /* コンセントレ?ション */
@@ -3593,17 +3565,17 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
case SG_SUN_COMFORT:
case SG_MOON_COMFORT:
case SG_STAR_COMFORT:
+ case NPC_HALLUCINATION:
clif_skill_nodamage(src,bl,skillid,skilllv,
- status_change_start(bl,type,100,
- skilllv,0,0,0,skill_get_time(skillid,skilllv),0));
+ sc_start(bl,type,100,skilllv,skill_get_time(skillid,skilllv)));
break;
case SG_SUN_WARM:
case SG_MOON_WARM:
case SG_STAR_WARM:
clif_skill_nodamage(src,bl,skillid,skilllv,
- status_change_start(bl,type,100,
- skilllv,0,skillid,skill_get_splash(skillid,skilllv),skill_get_time(skillid,skilllv),0));
+ sc_start4(bl,type,100,skilllv,0,skillid,
+ skill_get_splash(skillid,skilllv),skill_get_time(skillid,skilllv)));
break;
case CG_MOONLIT: /* 月明りの泉に落ちる花びら */
@@ -3617,7 +3589,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
case HP_ASSUMPTIO:
if (flag&1)
- status_change_start(bl,type,100,skilllv,0,0,0,skill_get_time(skillid,skilllv),0 );
+ sc_start(bl,type,100,skilllv,skill_get_time(skillid,skilllv));
else
{
map_foreachinrange(skill_area_sub, bl,
@@ -3630,10 +3602,9 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
case SM_ENDURE: /* インデュア */
clif_skill_nodamage(src,bl,skillid,skilllv,
- status_change_start(bl,type,100,
- skilllv,0,0,0,skill_get_time(skillid,skilllv),0));
+ sc_start(bl,type,100,skilllv,skill_get_time(skillid,skilllv)));
if (sd)
- pc_blockskill_start (sd, skillid, 10000);
+ pc_blockskill_start (sd, skillid, skill_get_time2(skillid,skilllv));
break;
case AS_ENCHANTPOISON: // Prevent spamming [Valaris]
@@ -3652,8 +3623,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
}
}
clif_skill_nodamage(src,bl,skillid,skilllv,
- status_change_start(bl,type,100,
- skilllv,0,0,0,skill_get_time(skillid,skilllv),0));
+ sc_start(bl,type,100,skilllv,skill_get_time(skillid,skilllv)));
break;
case LK_TENSIONRELAX: /* テンションリラックス */
@@ -3662,8 +3632,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
clif_sitting(sd);
}
clif_skill_nodamage(src,bl,skillid,skilllv,
- status_change_start(bl,type,100,
- skilllv,0,0,0,skill_get_time(skillid,skilllv),0));
+ sc_start(bl,type,100,skilllv,skill_get_time(skillid,skilllv)));
break;
case MC_CHANGECART:
@@ -3694,8 +3663,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
case AC_CONCENTRATION: /* ?W中力向? */
{
clif_skill_nodamage(src,bl,skillid,skilllv,
- status_change_start(bl,type,100,
- skilllv,0,0,0,skill_get_time(skillid,skilllv),0));
+ sc_start(bl,type,100,skilllv,skill_get_time(skillid,skilllv)));
map_foreachinrange( status_change_timer_sub, src,
skill_get_splash(skillid, skilllv), BL_CHAR,
src,status_get_sc(src),type,tick);
@@ -3710,9 +3678,9 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
}
//TODO: How much does base level affects? Dummy value of 1% per level difference used. [Skotlex]
clif_skill_nodamage(src,bl,skillid,skilllv,
- (i=status_change_start(bl,type,
+ (i=sc_start(bl,type,
50 +3*skilllv +status_get_lv(src) -status_get_lv(bl),
- skilllv,0,0,0,skill_get_time(skillid,skilllv),0)));
+ skilllv,skill_get_time(skillid,skilllv))));
if (!i)
{
if (sd)
@@ -3765,8 +3733,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
}
sd->devotion[i] = bl->id;
clif_skill_nodamage(src,bl,skillid,skilllv,
- status_change_start(bl,type,100,
- src->id,i,skill_get_range2(src,skillid,skilllv),skill_get_time2(skillid, skilllv),1000,0));
+ sc_start4(bl,type,100,src->id,i,skill_get_range2(src,skillid,skilllv),skill_get_time2(skillid, skilllv),1000));
clif_devotion(sd);
}
else
@@ -3803,12 +3770,6 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
}
break;
- case MO_BLADESTOP: // 白?n取り
- clif_skill_nodamage(src,bl,skillid,skilllv,
- status_change_start(src,type,100,
- skilllv,0,0,0,skill_get_time(skillid,skilllv),0));
- break;
-
case MO_ABSORBSPIRITS: // ?奪
i = 0;
if (dstsd && dstsd->spiritball > 0 &&
@@ -3866,8 +3827,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
break; //Land Protector blocks Hammer Fall [Skotlex]
clif_skill_nodamage(src,bl,skillid,skilllv,
- status_change_start(bl,SC_STUN,(20 + 10 * skilllv),
- skilllv,0,0,0,skill_get_time2(skillid,skilllv),0));
+ sc_start(bl,SC_STUN,(20 + 10 * skilllv),skilllv,skill_get_time2(skillid,skilllv)));
break;
case RG_RAID: /* サプライズアタック */
clif_skill_nodamage(src,bl,skillid,skilllv,1);
@@ -3968,8 +3928,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
case SN_WINDWALK: /* ウインドウォ?ク */
if (sd == NULL || sd->status.party_id == 0 || (flag & 1)) {
clif_skill_nodamage(bl,bl,skillid,skilllv,
- status_change_start(bl,type,100,
- skilllv,0,0,0,skill_get_time(skillid,skilllv),0));
+ sc_start(bl,type,100,skilllv,skill_get_time(skillid,skilllv)));
} else if (sd) {
/* パ?ティ全?への?? */
party_foreachsamemap (skill_area_sub,
@@ -3986,8 +3945,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
if (sd == NULL || sd->status.party_id == 0 || (flag & 1)) {
/* 個別の?? */
clif_skill_nodamage(bl,bl,skillid,skilllv,
- status_change_start(bl,type,100,
- skilllv,(src == bl)? 1:0,0,0,skill_get_time(skillid,skilllv),0));
+ sc_start4(bl,type,100,skilllv,(src == bl)? 1:0,0,0,skill_get_time(skillid,skilllv)));
} else if (sd) {
/* パ?ティ全?への?? */
party_foreachsamemap(skill_area_sub,
@@ -4012,7 +3970,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
if (tsc && tsc->data[type].timer != -1)
i = status_change_end(bl, type, -1);
else
- i = status_change_start(bl,type,100,skilllv,0,0,0,skill_get_time(skillid,skilllv),0);
+ i = sc_start(bl,type,100,skilllv,skill_get_time(skillid,skilllv));
clif_skill_nodamage(src,bl,skillid,skilllv,i);
break;
case SL_KAITE:
@@ -4026,20 +3984,19 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
dstsd->char_id == sd->status.partner_id ||
dstsd->char_id == sd->status.child
)) {
- status_change_start(src,SC_STUN,100,skilllv,0,0,0,3000,8);
+ status_change_start(src,SC_STUN,10000,skilllv,0,0,0,3000,8);
clif_skill_fail(sd,skillid,0,0);
break;
}
}
clif_skill_nodamage(src,bl,skillid,skilllv,
- status_change_start(bl,type,100,
- skilllv,0,0,0,skill_get_time(skillid, skilllv),0));
+ sc_start(bl,type,100,skilllv,skill_get_time(skillid, skilllv)));
break;
case SM_AUTOBERSERK: // Celest
if (tsc && tsc->data[type].timer != -1)
i = status_change_end(bl, type, -1);
else
- i = status_change_start(bl,type,100,skilllv,0,0,0,0,0);
+ i = sc_start(bl,type,100,skilllv,0);
clif_skill_nodamage(src,bl,skillid,skilllv,i);
break;
case TF_HIDING: /* ハイディング */
@@ -4047,14 +4004,14 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
if (tsc && tsc->data[type].timer != -1)
i = status_change_end(bl, type, -1);
else
- i = status_change_start(bl,type,100,skilllv,0,0,0,skill_get_time(skillid,skilllv),0);
+ i = sc_start(bl,type,100,skilllv,skill_get_time(skillid,skilllv));
clif_skill_nodamage(src,bl,skillid,-1,i); // Don't display the skill name as it is a hiding skill
break;
case TK_RUN:
if (tsc && tsc->data[type].timer != -1)
i = status_change_end(bl, type, -1);
else
- i = status_change_start(bl,type,100,skilllv,status_get_dir(bl),0,0,0,0);
+ i = sc_start4(bl,type,100,skilllv,status_get_dir(bl),0,0,0);
clif_skill_nodamage(src,bl,skillid,skilllv,i);
break;
case AS_CLOAKING: /* ク??キング */
@@ -4062,7 +4019,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
/* 解?怩キる */
i = status_change_end(bl, type, -1);
else
- i = status_change_start(bl,type,100,skilllv,0,0,0,skill_get_time(skillid,skilllv),0);
+ i = sc_start(bl,type,100,skilllv,skill_get_time(skillid,skilllv));
clif_skill_nodamage(src,bl,skillid,-1,i);
if (!i && sd)
clif_skill_fail(sd,skillid,0,0);
@@ -4099,12 +4056,12 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
skill_clear_unitgroup(src);
sg = skill_unitsetting(src,skillid,skilllv,src->x,src->y,0);
if(skillid == CG_HERMODE)
- i = status_change_start(src,SC_DANCING,100,
- skillid,0,0,sg->group_id,skill_get_time(skillid,skilllv),0);
+ i = sc_start4(src,SC_DANCING,100,
+ skillid,0,0,sg->group_id,skill_get_time(skillid,skilllv));
else
- i = status_change_start(src,type,100,
+ i = sc_start4(src,type,100,
skilllv,0,BCT_SELF,sg->group_id,
- skill_get_time(skillid,skilllv),0);
+ skill_get_time(skillid,skilllv));
clif_skill_nodamage(src,bl,skillid,skilllv,i);
}
break;
@@ -4117,7 +4074,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
struct skill_unit_group *sg = skill_unitsetting(src,skillid,skilllv,src->x,src->y,0);
if (tsc->data[type].timer != -1)
status_change_end(bl,type,-1); //Was under someone else's Gospel. [Skotlex]
- i = status_change_start(bl,type,100,skilllv,0,(int)sg,BCT_SELF,skill_get_time(skillid,skilllv),0);
+ i = sc_start4(bl,type,100,skilllv,0,(int)sg,BCT_SELF,skill_get_time(skillid,skilllv));
}
clif_skill_nodamage(src,bl,skillid,skilllv,i);
break;
@@ -4145,23 +4102,20 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
case BA_PANGVOICE://パンボイス
clif_skill_nodamage(src,bl,skillid,skilllv,
- status_change_start(bl,SC_CONFUSION,50,
- 7,0,0,0,skill_get_time(skillid,skilllv),0));
+ sc_start(bl,SC_CONFUSION,50,7,skill_get_time(skillid,skilllv)));
break;
case DC_WINKCHARM://魅惑のウィンク
if(dstsd){
clif_skill_nodamage(src,bl,skillid,skilllv,
- status_change_start(bl,SC_CONFUSION,30,
- 7,0,0,0,skill_get_time2(skillid,skilllv),0));
+ sc_start(bl,SC_CONFUSION,30,7,skill_get_time2(skillid,skilllv)));
}else if(dstmd)
{
int race = status_get_race(bl);
if(status_get_lv(src)>status_get_lv(bl) && (race == 6 || race == 7 || race == 8)) {
clif_skill_nodamage(src,bl,skillid,skilllv,
- status_change_start(bl,type,70,
- skilllv,0,0,0,skill_get_time(skillid,skilllv),0));
- } else{
+ sc_start(bl,type,70,skilllv,skill_get_time(skillid,skilllv)));
+ } else{
clif_skill_nodamage(src,bl,skillid,skilllv,0);
if(sd)
clif_skill_fail(sd,skillid,0,0);
@@ -4205,8 +4159,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
if (sd) clif_skill_fail(sd,skillid,0,0);
break;
}
- if (status_change_start(bl,SC_STONE,
- (skilllv*4+20),skilllv,0,0,0,skill_get_time2(skillid,skilllv),0))
+ if (sc_start(bl,SC_STONE,(skilllv*4+20),skilllv,skill_get_time2(skillid,skilllv)))
clif_skill_nodamage(src,bl,skillid,skilllv,1);
else if(sd) {
clif_skill_fail(sd,skillid,0,0);
@@ -4235,9 +4188,8 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
status_change_end(bl, SC_SILENCE , -1 );
status_change_end(bl, SC_BLIND , -1 );
status_change_end(bl, SC_CONFUSION, -1 );
- if( battle_check_undead(status_get_race(bl),status_get_elem_type(bl)) ){//アンデッドなら暗闇?果
- status_change_start(bl, SC_CONFUSION,100,1,0,0,0,6000,0);
- }
+ if( battle_check_undead(status_get_race(bl),status_get_elem_type(bl)))
+ sc_start(bl, SC_CONFUSION,100,1,skill_get_time2(skillid, skilllv));
clif_skill_nodamage(src,bl,skillid,skilllv,1);
break;
@@ -4259,9 +4211,9 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
//Is this equation really right? It looks so... special.
if( battle_check_undead(status_get_race(bl),status_get_elem_type(bl)) ){//アンデッドなら暗闇?果
status_change_start(bl, SC_BLIND,
- (100-(status_get_int(bl)/2+status_get_vit(bl)/3+status_get_luk(bl)/10)),
+ 100*(100-(status_get_int(bl)/2+status_get_vit(bl)/3+status_get_luk(bl)/10)),
1,0,0,0,
- 1000 * 30 * (100-(status_get_int(bl)+status_get_vit(bl))/2)/100,10);
+ skill_get_time2(skillid, skilllv) * (100-(status_get_int(bl)+status_get_vit(bl))/2)/100,10);
}
clif_skill_nodamage(src,bl,skillid,skilllv,1);
if(dstmd){
@@ -4431,7 +4383,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
for (i=0;i<4;i++) {
if (sclist[i] != 0) // Start the SC only if an equipment was stripped from this location
- status_change_start(bl,sclist[i],100,skilllv,0,0,0,skill_get_time(skillid,skilllv)+strip_fix/2,0);
+ sc_start(bl,sclist[i],100,skilllv,skill_get_time(skillid,skilllv)+strip_fix/2);
}
break;
@@ -4521,8 +4473,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
if(tsc && tsc->data[scid].timer != -1)
status_change_end(bl, scid, -1 );
clif_skill_nodamage(src,bl,skillid,skilllv,
- status_change_start(bl,type,100,
- skilllv,0,0,0,skill_get_time(skillid,skilllv),0));
+ sc_start(bl,type,100,skilllv,skill_get_time(skillid,skilllv)));
}
break;
case AM_TWILIGHT1:
@@ -4711,7 +4662,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
}
break;
case SA_MAGICROD:
- status_change_start(bl,type,100,skilllv,0,0,0,skill_get_time(skillid,skilllv),0 );
+ sc_start(bl,type,100,skilllv,skill_get_time(skillid,skilllv));
break;
case SA_AUTOSPELL: /* オ?トスペル */
clif_skill_nodamage(src,bl,skillid,skilllv,1);
@@ -4745,8 +4696,8 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
maxlv = 3;
}
if(spellid > 0)
- status_change_start(src,SC_AUTOSPELL,100,skilllv,spellid,maxlv,0,
- skill_get_time(SA_AUTOSPELL,skilllv),0);
+ sc_start4(src,SC_AUTOSPELL,100,skilllv,spellid,maxlv,0,
+ skill_get_time(SA_AUTOSPELL,skilllv));
}
break;
@@ -4796,19 +4747,12 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
clif_pet_performance(src,md->db->skill[md->skillidx].val[0]);
break;
- case NPC_HALLUCINATION:
- clif_skill_nodamage(src,bl,skillid,skilllv,
- status_change_start(bl,type,100,
- skilllv,0,0,0,skill_get_time(skillid,skilllv),0));
- break;
-
case NPC_KEEPING:
case NPC_BARRIER:
{
int skill_time = skill_get_time(skillid,skilllv);
clif_skill_nodamage(src,bl,skillid,skilllv,
- status_change_start(bl,type,100,
- skilllv,0,0,0,skill_time,0));
+ sc_start(bl,type,100,skilllv,skill_time));
if (md)
mob_changestate(md,MS_DELAY,skill_time);
else if (sd)
@@ -4818,13 +4762,12 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
case NPC_REBIRTH:
//New rebirth System uses Kaizel lv1. [Skotlex]
- status_change_start(bl,type,100,1,0,0,0,skill_get_time(SL_KAIZEL,skilllv),0);
+ sc_start(bl,type,100,1,skill_get_time(SL_KAIZEL,skilllv));
break;
case NPC_DARKBLESSING:
clif_skill_nodamage(src,bl,skillid,skilllv,
- status_change_start(bl,type,
- (50+skilllv*5),skilllv,0,0,0,skill_get_time2(skillid,skilllv),0));
+ sc_start(bl,type,(50+skilllv*5),skilllv,skill_get_time2(skillid,skilllv)));
break;
case NPC_LICK:
@@ -4836,8 +4779,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
pc_heal(dstsd,0,-100);
}
clif_skill_nodamage(src,bl,skillid,skilllv,
- status_change_start(bl,type,
- (skilllv*5),skilllv,0,0,0,skill_get_time2(skillid,skilllv),0));
+ sc_start(bl,type,(skilllv*5),skilllv,skill_get_time2(skillid,skilllv)));
break;
case NPC_SUICIDE: /* 自決 */
@@ -4869,7 +4811,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
if (i > SC_ASPDPOTION3)
i = SC_ASPDPOTION3;
clif_skill_nodamage(src,bl,skillid,skilllv,
- status_change_start(bl,i,100,skilllv,0,0,0,skilllv * 60000,0));
+ sc_start(bl,i,100,skilllv,skilllv * 60000));
}
break;
@@ -4951,18 +4893,15 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
break;
case NPC_POWERUP:
- // +20% attack per skill level? It's a guess... [Skotlex]
- status_change_start(bl,SC_INCATKRATE,100,40*skilllv,0,0,0,skilllv * 60000,0);
+ sc_start(bl,SC_INCATKRATE,100,40*skilllv,skill_get_time(skillid, skilllv));
// another random guess xP
clif_skill_nodamage(src,bl,skillid,skilllv,
- status_change_start(bl,SC_INCALLSTATUS,100,
- skilllv * 5,0,0,0,skilllv * 60000,0));
+ sc_start(bl,SC_INCALLSTATUS,100,skilllv*5,skill_get_time(skillid, skilllv)));
break;
case NPC_AGIUP:
clif_skill_nodamage(src,bl,skillid,skilllv,
- status_change_start(bl,SC_INCAGI,100,
- skilllv * 10,0,0,0,skilllv * 60000,0));
+ sc_start(bl,SC_INCAGI,100,skilllv*10,skill_get_time(skillid, skilllv)));
break;
case NPC_SIEGEMODE:
@@ -5016,9 +4955,9 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
map_freeblock_unlock();
return 0;
}
- status_change_start(bl,SC_STUN,100,skilllv,0,0,0,skill_get_time2(skillid,skilllv),8);
- if (f_sd) status_change_start(&f_sd->bl,type,100,skilllv,0,0,0,skill_get_time(skillid,skilllv),0 );
- if (m_sd) status_change_start(&m_sd->bl,type,100,skilllv,0,0,0,skill_get_time(skillid,skilllv),0 );
+ status_change_start(bl,SC_STUN,10000,skilllv,0,0,0,skill_get_time2(skillid,skilllv),8);
+ if (f_sd) sc_start(&f_sd->bl,type,100,skilllv,skill_get_time(skillid,skilllv));
+ if (m_sd) sc_start(&m_sd->bl,type,100,skilllv,skill_get_time(skillid,skilllv));
}
break;
@@ -5166,8 +5105,8 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
return 1;
}
clif_skill_nodamage(src,bl,skillid,skilllv,
- status_change_start(bl,type,100,
- skilllv,skillid,src->id,skill_get_time(skillid,skilllv),1000,0));
+ sc_start4(bl,type,100,
+ skilllv,skillid,src->id,skill_get_time(skillid,skilllv),1000));
break;
case PF_MINDBREAKER: /* プ?ボック */
@@ -5181,8 +5120,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
//Has a 55% + skilllv*5% success chance.
if (!clif_skill_nodamage(src,bl,skillid,skilllv,
- status_change_start(bl,type,55 +5*skilllv,
- skilllv,0,0,0,skill_get_time(skillid,skilllv),0)))
+ sc_start(bl,type,55+5*skilllv,skilllv,skill_get_time(skillid,skilllv))))
{
if (sd) clif_skill_fail(sd,skillid,0,0);
map_freeblock_unlock();
@@ -5270,7 +5208,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
for (i=0; i<4; i++) {
if(tsc->data[SC_STRIPWEAPON + i].timer != -1)
status_change_end(bl, SC_STRIPWEAPON + i, -1 );
- status_change_start(bl,SC_CP_WEAPON + i,100,skilllv,0,0,0,skilltime,0 );
+ sc_start(bl,SC_CP_WEAPON + i,100,skilllv,skilltime);
}
clif_skill_nodamage(src,bl,skillid,skilllv,1);
}
@@ -5283,8 +5221,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
case PF_DOUBLECASTING:
if (!clif_skill_nodamage(src,bl,skillid,skilllv,
- status_change_start(bl,type,
- 30+ 10*skilllv,skilllv,0,0,0,skill_get_time(skillid,skilllv),0)))
+ sc_start(bl,type,30+ 10*skilllv,skilllv,skill_get_time(skillid,skilllv))))
if (sd) clif_skill_fail(sd,skillid,0,0);
break;
@@ -5294,8 +5231,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
&& tsc->data[SC_DANCING].val1 != CG_MOONLIT) //Can't use Longing for Freedom while under Moonlight Petals. [Skotlex]
{
clif_skill_nodamage(src,bl,skillid,skilllv,
- status_change_start(bl,type,100,
- skilllv,0,0,0,skill_get_time(skillid,skilllv),0));
+ sc_start(bl,type,100,skilllv,skill_get_time(skillid,skilllv)));
}
}
break;
@@ -5317,7 +5253,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
if (dstsd) pc_heal(dstsd,0,-dstsd->status.sp);
break;
case 1: // matk halved
- status_change_start(bl,SC_INCMATKRATE,100,-50,0,0,0,30000,0);
+ sc_start(bl,SC_INCMATKRATE,100,-50,skill_get_time(skillid,skilllv));
break;
case 2: // all buffs removed
status_change_clear_buffs(bl);
@@ -5331,7 +5267,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
}
break;
case 4: // atk halved
- status_change_start(bl,SC_INCATKRATE,100,-50,0,0,0,30000,0);
+ sc_start(bl,SC_INCATKRATE,100,-50,skill_get_time(skillid,skilllv));
break;
case 5: // 2000HP heal, random teleported
battle_heal(src, src, 2000, 0, 0);
@@ -5347,37 +5283,37 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
case 7: // stop freeze or stoned
{
int sc[] = { SC_STOP, SC_FREEZE, SC_STONE };
- status_change_start(bl,sc[rand()%3],100,skilllv,0,0,0,30000,0);
+ sc_start(bl,sc[rand()%3],100,skilllv,skill_get_time(skillid,skilllv));
}
break;
case 8: // curse coma and poison
- status_change_start(bl,SC_COMA,100,skilllv,0,0,0,30000,0);
- status_change_start(bl,SC_CURSE,100,skilllv,0,0,0,30000,0);
- status_change_start(bl,SC_POISON,100,skilllv,0,0,0,30000,0);
+ sc_start(bl,SC_COMA,100,skilllv,skill_get_time(skillid,skilllv));
+ sc_start(bl,SC_CURSE,100,skilllv,skill_get_time(skillid,skilllv));
+ sc_start(bl,SC_POISON,100,skilllv,skill_get_time(skillid,skilllv));
break;
case 9: // chaos
- status_change_start(bl,SC_CONFUSION,100,skilllv,0,0,0,30000,0);
+ sc_start(bl,SC_CONFUSION,100,skilllv,skill_get_time(skillid,skilllv));
break;
case 10: // 6666 damage, atk matk halved, cursed
battle_damage(src, bl, 6666, 0);
clif_damage(src,bl,tick,0,0,6666,0,0,0);
- status_change_start(bl,SC_INCATKRATE,100,-50,0,0,0,30000,0);
- status_change_start(bl,SC_INCMATKRATE,100,-50,0,0,0,30000,0);
- status_change_start(bl,SC_CURSE,skilllv,100,0,0,0,30000,0);
+ sc_start(bl,SC_INCATKRATE,100,-50,skill_get_time(skillid,skilllv));
+ sc_start(bl,SC_INCMATKRATE,100,-50,skill_get_time(skillid,skilllv));
+ sc_start(bl,SC_CURSE,skilllv,100,skill_get_time(skillid,skilllv));
break;
case 11: // 4444 damage
battle_damage(src, bl, 4444, 0);
clif_damage(src,bl,tick,0,0,4444,0,0,0);
break;
case 12: // stun
- status_change_start(bl,SC_STUN,100,skilllv,0,0,0,5000,0);
+ sc_start(bl,SC_STUN,100,skilllv,5000);
break;
case 13: // atk,matk,hit,flee,def reduced
- status_change_start(bl,SC_INCATKRATE,100,-20,0,0,0,30000,0);
- status_change_start(bl,SC_INCMATKRATE,100,-20,0,0,0,30000,0);
- status_change_start(bl,SC_INCHITRATE,100,-20,0,0,0,30000,0);
- status_change_start(bl,SC_INCFLEERATE,100,-20,0,0,0,30000,0);
- status_change_start(bl,SC_INCDEFRATE,100,-20,0,0,0,30000,0);
+ sc_start(bl,SC_INCATKRATE,100,-20,skill_get_time(skillid,skilllv));
+ sc_start(bl,SC_INCMATKRATE,100,-20,skill_get_time(skillid,skilllv));
+ sc_start(bl,SC_INCHITRATE,100,-20,skill_get_time(skillid,skilllv));
+ sc_start(bl,SC_INCFLEERATE,100,-20,skill_get_time(skillid,skilllv));
+ sc_start(bl,SC_INCDEFRATE,100,-20,skill_get_time(skillid,skilllv));
break;
default:
break;
@@ -5407,9 +5343,8 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
break;
}
clif_skill_nodamage(src,bl,skillid,skilllv,
- status_change_start(bl,SC_SPIRIT,100,
- skilllv,skillid,0,0,skill_get_time(skillid,skilllv),0));
- status_change_start(src,SC_COMBO,100,SL_SMA,skilllv,0,0,skill_get_time2(skillid,skilllv),0);
+ sc_start4(bl,SC_SPIRIT,100,skilllv,skillid,0,0,skill_get_time(skillid,skilllv)));
+ sc_start4(src,SC_COMBO,100,SL_SMA,skilllv,0,0,skill_get_time2(skillid,skilllv));
break;
case SL_HIGH:
if (sd && !(dstsd && (dstsd->class_&JOBL_UPPER) && !(dstsd->class_&JOBL_2) && dstsd->status.base_level < 70)) {
@@ -5417,14 +5352,13 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
break;
}
clif_skill_nodamage(src,bl,skillid,skilllv,
- status_change_start(bl,type,100,
- skilllv,skillid,0,0,skill_get_time(skillid,skilllv),0));
- status_change_start(src,SC_COMBO,100,SL_SMA,skilllv,0,0,skill_get_time2(skillid,skilllv),0);
+ sc_start4(bl,type,100,skilllv,skillid,0,0,skill_get_time(skillid,skilllv)));
+ sc_start4(src,SC_COMBO,100,SL_SMA,skilllv,0,0,skill_get_time2(skillid,skilllv));
break;
case SL_SKA: // [marquis007]
if (sd && !battle_config.allow_es_magic_pc && bl->type != BL_MOB) {
- status_change_start(src,SC_STUN,100,skilllv,0,0,0,3000,8);
+ status_change_start(src,SC_STUN,10000,skilllv,0,0,0,3000,8);
clif_skill_fail(sd,skillid,0,0);
break;
}
@@ -5433,112 +5367,76 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
else
{
clif_skill_nodamage(src,bl,skillid,skilllv,
- status_change_start(bl,type,100,
- skilllv,0,0,0,skill_get_time(skillid,skilllv),0));
+ sc_start(bl,type,100,skilllv,skill_get_time(skillid,skilllv)));
}
break;
case SL_SWOO:
if (sd && !battle_config.allow_es_magic_pc && bl->type != BL_MOB) {
- status_change_start(src,SC_STUN,100,skilllv,0,0,0,3000,8);
+ status_change_start(src,SC_STUN,10000,skilllv,0,0,0,3000,8);
clif_skill_fail(sd,skillid,0,0);
break;
}
clif_skill_nodamage(src,bl,skillid,skilllv,
- status_change_start(bl,type,100,
- skilllv,0,0,0,skill_get_time(skillid,skilllv),0));
+ sc_start(bl,type,100,skilllv,skill_get_time(skillid,skilllv)));
break;
case SL_SKE:
if (sd && !battle_config.allow_es_magic_pc && bl->type != BL_MOB) {
- status_change_start(src,SC_STUN,100,skilllv,0,0,0,3000,8);
+ status_change_start(src,SC_STUN,10000,skilllv,0,0,0,3000,8);
clif_skill_fail(sd,skillid,0,0);
break;
}
clif_skill_nodamage(src,bl,skillid,skilllv,
- status_change_start(bl,type,100,
- skilllv,skillid,0,0,skill_get_time(skillid,skilllv),0));
- status_change_start(src,SC_COMBO,100,SL_SMA,skilllv,0,0,skill_get_time2(skillid,skilllv),0);
+ sc_start(bl,type,100,skilllv,skill_get_time(skillid,skilllv)));
+ sc_start4(src,SC_COMBO,100,SL_SMA,skilllv,0,0,skill_get_time2(skillid,skilllv));
break;
// New guild skills [Celest]
case GD_BATTLEORDER:
- {
- struct guild *g = NULL;
- // Only usable during WoE
- if (!agit_flag) {
- clif_skill_fail(sd,skillid,0,0);
- map_freeblock_unlock();
- return 0;
- }
- if(flag&1) {
- if (dstsd && dstsd->status.guild_id == sd->status.guild_id) {
- status_change_start(&dstsd->bl,SC_BATTLEORDERS,100,skilllv,0,0,0,0,0 );
- }
- }
- else if (sd && sd->status.guild_id > 0 && (g = guild_search(sd->status.guild_id)) &&
- strcmp(sd->status.name,g->master)==0) {
- clif_skill_nodamage(src,bl,skillid,skilllv,1);
- map_foreachinrange(skill_area_sub, src,
- skill_get_splash(skillid, skilllv), BL_CHAR,
- src,skillid,skilllv,tick, flag|BCT_GUILD|1,
- skill_castend_nodamage_id);
+ if(flag&1) {
+ if (status_get_guild_id(src) == status_get_guild_id(bl))
+ sc_start(bl,SC_BATTLEORDERS,100,skilllv,skill_get_time(skillid, skilllv));
+ } else if (status_get_guild_id(src)) {
+ clif_skill_nodamage(src,bl,skillid,skilllv,1);
+ map_foreachinrange(skill_area_sub, src,
+ skill_get_splash(skillid, skilllv), BL_CHAR,
+ src,skillid,skilllv,tick, flag|BCT_GUILD|1,
+ skill_castend_nodamage_id);
+ if (sd)
guild_block_skill(sd,skill_get_time2(skillid,skilllv));
- }
}
break;
case GD_REGENERATION:
- {
- struct guild *g = NULL;
- // Only usable during WoE
- if (!agit_flag) {
- clif_skill_fail(sd,skillid,0,0);
- map_freeblock_unlock();
- return 0;
- }
- if(flag&1) {
- if (dstsd && dstsd->status.guild_id == sd->status.guild_id) {
- status_change_start(&dstsd->bl,SC_REGENERATION,100,skilllv,0,0,0,0,0 );
- }
- }
- else if (sd && sd->status.guild_id > 0 && (g = guild_search(sd->status.guild_id)) &&
- strcmp(sd->status.name,g->master)==0) {
- clif_skill_nodamage(src,bl,skillid,skilllv,1);
- map_foreachinrange(skill_area_sub, src,
- skill_get_splash(skillid, skilllv), BL_CHAR,
- src,skillid,skilllv,tick, flag|BCT_GUILD|1,
- skill_castend_nodamage_id);
+ if(flag&1) {
+ if (status_get_guild_id(src) == status_get_guild_id(bl))
+ sc_start(bl,SC_REGENERATION,100,skilllv,skill_get_time(skillid, skilllv));
+ } else if (status_get_guild_id(src)) {
+ clif_skill_nodamage(src,bl,skillid,skilllv,1);
+ map_foreachinrange(skill_area_sub, src,
+ skill_get_splash(skillid, skilllv), BL_CHAR,
+ src,skillid,skilllv,tick, flag|BCT_GUILD|1,
+ skill_castend_nodamage_id);
+ if (sd)
guild_block_skill(sd,skill_get_time2(skillid,skilllv));
- }
}
break;
case GD_RESTORE:
- {
- struct guild *g = NULL;
- // Only usable during WoE
- if (!agit_flag) {
- clif_skill_fail(sd,skillid,0,0);
- map_freeblock_unlock();
- return 0;
- }
- if(flag&1) {
- if (dstsd && dstsd->status.guild_id == sd->status.guild_id) {
- int hp, sp;
- hp = dstsd->status.max_hp*9/10;
- sp = dstsd->status.max_sp*9/10;
- sp = dstsd->status.sp + sp <= dstsd->status.max_sp ? sp : dstsd->status.max_sp - dstsd->status.sp;
- clif_skill_nodamage(src,bl,AL_HEAL,hp,1);
- battle_heal(NULL,bl,hp,sp,0);
- }
- }
- else if (sd && sd->status.guild_id > 0 && (g = guild_search(sd->status.guild_id)) &&
- strcmp(sd->status.name,g->master)==0) {
- clif_skill_nodamage(src,bl,skillid,skilllv,1);
- map_foreachinrange(skill_area_sub, src,
- skill_get_splash(skillid, skilllv), BL_CHAR,
- src,skillid,skilllv,tick, flag|BCT_GUILD|1,
- skill_castend_nodamage_id);
+ if(flag&1) {
+ if (status_get_guild_id(src) == status_get_guild_id(bl)) {
+ int hp, sp;
+ hp = status_get_max_hp(bl)*9/10;
+ sp = dstsd?dstsd->status.max_sp*9/10:0;
+ clif_skill_nodamage(src,bl,AL_HEAL,hp,1);
+ battle_heal(NULL,bl,hp,sp,0);
+ }
+ } else if (status_get_guild_id(src)) {
+ clif_skill_nodamage(src,bl,skillid,skilllv,1);
+ map_foreachinrange(skill_area_sub, src,
+ skill_get_splash(skillid, skilllv), BL_CHAR,
+ src,skillid,skilllv,tick, flag|BCT_GUILD|1,
+ skill_castend_nodamage_id);
+ if (sd)
guild_block_skill(sd,skill_get_time2(skillid,skilllv));
- }
}
break;
case GD_EMERGENCYCALL:
@@ -5547,30 +5445,23 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
int dy[9]={ 0, 0, 1,-1, 1,-1,-1, 1, 0};
int j = 0;
struct guild *g = NULL;
- if (!sd || !sd->state.gmaster_flag)
- break;
- //Reports say this particular skill is usable anywhere! o.o [Skotlex]
- //And now people say that's not true... MEH. Will they EVER make up their mind?
- if (/*map[sd->bl.m].flag.nowarpto &&*/ !map_flag_gvg(sd->bl.m))
- { //if not allowed to warp to the map (castles are always allowed)
- clif_skill_fail(sd,skillid,0,0);
- map_freeblock_unlock();
- return 0;
- }
// i don't know if it actually summons in a circle, but oh well. ;P
- g = sd->state.gmaster_flag;
+ g = sd?sd->state.gmaster_flag:guild_search(status_get_guild_id(src));
+ if (!g)
+ break;
for(i = 0; i < g->max_member; i++, j++) {
if (j>8) j=0;
if ((dstsd = g->member[i].sd) != NULL && sd != dstsd) {
if (map[dstsd->bl.m].flag.nowarp && !map_flag_gvg(dstsd->bl.m))
continue;
clif_skill_nodamage(src,bl,skillid,skilllv,1);
- if(map_getcell(sd->bl.m,sd->bl.x+dx[j],sd->bl.y+dy[j],CELL_CHKNOPASS))
+ if(map_getcell(src->m,src->x+dx[j],src->y+dy[j],CELL_CHKNOREACH))
dx[j] = dy[j] = 0;
- pc_setpos(dstsd, sd->mapindex, sd->bl.x+dx[j], sd->bl.y+dy[j], 2);
+ pc_setpos(dstsd, map[src->m].index, src->x+dx[j], src->y+dy[j], 2);
}
}
- guild_block_skill(sd,skill_get_time2(skillid,skilllv));
+ if (sd)
+ guild_block_skill(sd,skill_get_time2(skillid,skilllv));
}
break;
@@ -6146,8 +6037,8 @@ int skill_castend_pos2( struct block_list *src, int x,int y,int skillid,int skil
struct skill_unit_group *sg;
clif_skill_poseffect(src,skillid,skilllv,x,y,tick);
sg = skill_unitsetting(src,skillid,skilllv,x,y,0);
- status_change_start(src,SkillStatusChangeTable[skillid],100,
- skilllv,0,BCT_SELF,(int)sg,skill_get_time(skillid,skilllv),0);
+ sc_start4(src,SkillStatusChangeTable[skillid],100,
+ skilllv,0,BCT_SELF,(int)sg,skill_get_time(skillid,skilllv));
}
break;
@@ -6651,12 +6542,7 @@ int skill_unit_onplace(struct skill_unit *src,struct block_list *bl,unsigned int
case UNT_SAFETYWALL:
//TODO: Find a more reliable way to handle the link to sg, this could cause dangling pointers. [Skotlex]
if (sc && sc->data[type].timer == -1)
- status_change_start(bl,type,100,sg->skill_lv,sg->group_id,(int)sg,0,sg->limit,0);
- break;
-
- case UNT_PNEUMA:
- if (sc && sc->data[type].timer == -1)
- status_change_start(bl,type,100,sg->skill_lv,sg->group_id,0,0,sg->limit,0);
+ sc_start4(bl,type,100,sg->skill_lv,sg->group_id,(int)sg,0,sg->limit);
break;
case UNT_WARP_WAITING:
@@ -6677,15 +6563,15 @@ int skill_unit_onplace(struct skill_unit *src,struct block_list *bl,unsigned int
case UNT_QUAGMIRE:
if(sc && sc->data[type].timer==-1)
- status_change_start(bl,type,100,sg->skill_lv,sg->group_id,0,0,sg->limit,0);
+ sc_start4(bl,type,100,sg->skill_lv,sg->group_id,0,0,sg->limit);
break;
case UNT_VOLCANO:
case UNT_DELUGE:
case UNT_VIOLENTGALE:
if(sc && sc->data[type].timer==-1)
- status_change_start(bl,type,100,sg->skill_lv,sg->group_id,0,0,
- skill_get_time2(sg->skill_id,sg->skill_lv),0);
+ sc_start4(bl,type,100,sg->skill_lv,sg->group_id,0,0,
+ skill_get_time2(sg->skill_id,sg->skill_lv));
break;
case UNT_RICHMANKIM:
@@ -6699,7 +6585,7 @@ int skill_unit_onplace(struct skill_unit *src,struct block_list *bl,unsigned int
if (sg->src_id==bl->id && (!sc || sc->data[SC_SPIRIT].timer == -1 || sc->data[SC_SPIRIT].val2 != SL_BARDDANCER))
return sg->skill_id;
if (sc && sc->data[type].timer==-1)
- status_change_start(bl,type,100,sg->skill_lv,sg->val1,sg->val2,0,sg->limit,0);
+ sc_start4(bl,type,100,sg->skill_lv,sg->val1,sg->val2,0,sg->limit);
break;
case UNT_WHISTLE:
@@ -6714,7 +6600,7 @@ int skill_unit_onplace(struct skill_unit *src,struct block_list *bl,unsigned int
if (sg->src_id==bl->id && (!sc || sc->data[SC_SPIRIT].timer == -1 || sc->data[SC_SPIRIT].val2 != SL_BARDDANCER))
return 0;
if (sc && sc->data[type].timer==-1)
- status_change_start(bl,type,100,sg->skill_lv,sg->val1,sg->val2,0,sg->limit,0);
+ sc_start4(bl,type,100,sg->skill_lv,sg->val1,sg->val2,0,sg->limit);
break;
case UNT_BASILICA:
@@ -6725,7 +6611,7 @@ int skill_unit_onplace(struct skill_unit *src,struct block_list *bl,unsigned int
case UNT_FOGWALL:
if (sc && sc->data[type].timer==-1)
{
- status_change_start (bl, type, 100, sg->skill_lv, sg->val1, sg->val2, sg->group_id, sg->limit, 0);
+ sc_start4(bl, type, 100, sg->skill_lv, sg->val1, sg->val2, sg->group_id, sg->limit);
if (battle_check_target(&src->bl,bl,BCT_ENEMY)>0)
skill_additional_effect (ss, bl, sg->skill_id, sg->skill_lv, BF_MISC, tick);
}
@@ -6733,7 +6619,7 @@ int skill_unit_onplace(struct skill_unit *src,struct block_list *bl,unsigned int
case UNT_GRAVITATION:
if (sc && sc->data[type].timer==-1)
- status_change_start(bl,type,100,sg->skill_lv,5*sg->skill_lv,BCT_ENEMY,sg->group_id,sg->limit,0);
+ sc_start4(bl,type,100,sg->skill_lv,5*sg->skill_lv,BCT_ENEMY,sg->group_id,sg->limit);
break;
case UNT_ICEWALL: //Destroy the cell. [Skotlex]
@@ -6741,14 +6627,6 @@ int skill_unit_onplace(struct skill_unit *src,struct block_list *bl,unsigned int
if(src->limit + sg->tick > tick + 700)
src->limit = DIFF_TICK(tick+700,sg->tick);
break;
-/* Removed. Gospel does not blocks item usage for others. [Skotlex]
- case UNT_GOSPEL:
- if (sg->src_id != bl->id && sc && sc->data[type].timer==-1
- && battle_check_target(ss,bl,BCT_PARTY)>0)
- //Start Gospel Effect to prevent item usage affects party only. [Skotlex]
- status_change_start(bl,type,100,sg->skill_lv,0,0,BCT_ALL,sg->limit,0);
- break;
-*/
}
return sg->skill_id;
@@ -6900,7 +6778,7 @@ int skill_unit_onplace_timer(struct skill_unit *src,struct block_list *bl,unsign
case UNT_ANKLESNARE:
if(sg->val2==0 && (!tsc || tsc->data[type].timer==-1 )){
int sec = skill_get_time2(sg->skill_id,sg->skill_lv);
- if (status_change_start(bl,type,100,sg->skill_lv,0,0,0,sec,0))
+ if (sc_start(bl,type,100,sg->skill_lv,sec))
{
map_moveblock(bl, src->bl.x, src->bl.y, tick);
clif_fixpos(bl);
@@ -6918,7 +6796,7 @@ int skill_unit_onplace_timer(struct skill_unit *src,struct block_list *bl,unsign
case UNT_VENOMDUST:
if(tsc && tsc->data[type].timer==-1 )
- status_change_start(bl,type,100,sg->skill_lv,sg->group_id,0,0,skill_get_time2(sg->skill_id,sg->skill_lv),8);
+ status_change_start(bl,type,10000,sg->skill_lv,sg->group_id,0,0,skill_get_time2(sg->skill_id,sg->skill_lv),8);
break;
case UNT_LANDMINE:
@@ -7010,38 +6888,38 @@ int skill_unit_onplace_timer(struct skill_unit *src,struct block_list *bl,unsign
status_change_clear_debuffs (bl);
break;
case 2: // Level 10 Blessing
- status_change_start(bl,SC_BLESSING,100,10,0,0,0,skill_get_time2(sg->skill_id, sg->skill_lv),0);
+ sc_start(bl,SC_BLESSING,100,10,skill_get_time2(sg->skill_id, sg->skill_lv));
break;
case 3: // Level 10 Increase AGI
- status_change_start(bl,SC_INCREASEAGI,100,10,0,0,0,skill_get_time2(sg->skill_id, sg->skill_lv),0);
+ sc_start(bl,SC_INCREASEAGI,100,10,skill_get_time2(sg->skill_id, sg->skill_lv));
break;
case 4: // Enchant weapon with Holy element
- status_change_start(bl,SC_ASPERSIO,100,1,0,0,0,skill_get_time2(sg->skill_id, sg->skill_lv),0);
+ sc_start(bl,SC_ASPERSIO,100,1,skill_get_time2(sg->skill_id, sg->skill_lv));
break;
case 5: // Enchant armor with Holy element
- status_change_start(bl,SC_BENEDICTIO,100,1,0,0,0,skill_get_time2(sg->skill_id, sg->skill_lv),0);
+ sc_start(bl,SC_BENEDICTIO,100,1,skill_get_time2(sg->skill_id, sg->skill_lv));
break;
case 6: // MaxHP +100%
- status_change_start(bl,SC_INCMHPRATE,100,100,0,0,0,skill_get_time2(sg->skill_id, sg->skill_lv),0);
+ sc_start(bl,SC_INCMHPRATE,100,100,skill_get_time2(sg->skill_id, sg->skill_lv));
break;
case 7: // MaxSP +100%
- status_change_start(bl,SC_INCMSPRATE,100,100,0,0,0,skill_get_time2(sg->skill_id, sg->skill_lv),0);
+ sc_start(bl,SC_INCMSPRATE,100,100,skill_get_time2(sg->skill_id, sg->skill_lv));
break;
case 8: // All stats +20
- status_change_start(bl,SC_INCALLSTATUS,100,20,0,0,0,skill_get_time2(sg->skill_id, sg->skill_lv),0);
+ sc_start(bl,SC_INCALLSTATUS,100,20,skill_get_time2(sg->skill_id, sg->skill_lv));
break;
case 9: // DEF +25%
- status_change_start(bl,SC_INCDEFRATE,100,25,0,0,0,skill_get_time2(sg->skill_id, sg->skill_lv),0);
+ sc_start(bl,SC_INCDEFRATE,100,25,skill_get_time2(sg->skill_id, sg->skill_lv));
break;
case 10: // ATK +100%
- status_change_start(bl,SC_INCATKRATE,100,100,0,0,0,skill_get_time2(sg->skill_id, sg->skill_lv),0);
+ sc_start(bl,SC_INCATKRATE,100,100,skill_get_time2(sg->skill_id, sg->skill_lv));
break;
case 11: // HIT/Flee +50
- status_change_start(bl,SC_INCHIT,100,50,0,0,0,skill_get_time2(sg->skill_id, sg->skill_lv),0);
- status_change_start(bl,SC_INCFLEE,100,50,0,0,0,skill_get_time2(sg->skill_id, sg->skill_lv),0);
+ sc_start(bl,SC_INCHIT,100,50,skill_get_time2(sg->skill_id, sg->skill_lv));
+ sc_start(bl,SC_INCFLEE,100,50,skill_get_time2(sg->skill_id, sg->skill_lv));
break;
case 12: // Immunity to all status
- status_change_start(bl,SC_SCRESIST,100,100,0,0,0,skill_get_time2(sg->skill_id, sg->skill_lv),0);
+ sc_start(bl,SC_SCRESIST,100,100,skill_get_time2(sg->skill_id, sg->skill_lv));
break;
}
}
@@ -7053,28 +6931,28 @@ int skill_unit_onplace_timer(struct skill_unit *src,struct block_list *bl,unsign
skill_attack(BF_MISC,ss,&src->bl,bl,sg->skill_id,sg->skill_lv,tick,0);
break;
case 1: // Curse
- status_change_start(bl,SC_CURSE,100,1,0,0,0,skill_get_time2(sg->skill_id, sg->skill_lv),0);
+ sc_start(bl,SC_CURSE,100,1,skill_get_time2(sg->skill_id, sg->skill_lv));
break;
case 2: // Blind
- status_change_start(bl,SC_BLIND,100,1,0,0,0,skill_get_time2(sg->skill_id, sg->skill_lv),0);
+ sc_start(bl,SC_BLIND,100,1,skill_get_time2(sg->skill_id, sg->skill_lv));
break;
case 3: // Poison
- status_change_start(bl,SC_POISON,100,1,0,0,0,skill_get_time2(sg->skill_id, sg->skill_lv),0);
+ sc_start(bl,SC_POISON,100,1,skill_get_time2(sg->skill_id, sg->skill_lv));
break;
case 4: // Level 10 Provoke
- status_change_start(bl,SC_PROVOKE,100,10,0,0,0,skill_get_time2(sg->skill_id, sg->skill_lv),0);
+ sc_start(bl,SC_PROVOKE,100,10,skill_get_time2(sg->skill_id, sg->skill_lv));
break;
case 5: // DEF -100%
- status_change_start(bl,SC_INCDEFRATE,100,-100,0,0,0,skill_get_time2(sg->skill_id, sg->skill_lv),0);
+ sc_start(bl,SC_INCDEFRATE,100,-100,skill_get_time2(sg->skill_id, sg->skill_lv));
break;
- case 6: // ATK -100%
- status_change_start(bl,SC_INCATKRATE,100,-100,0,0,0,skill_get_time2(sg->skill_id, sg->skill_lv),0);
+ case 6: // ATK -100%
+ sc_start(bl,SC_INCATKRATE,100,-100,skill_get_time2(sg->skill_id, sg->skill_lv));
break;
- case 7: // Flee -100%
- status_change_start(bl,SC_INCFLEERATE,100,-100,0,0,0,skill_get_time2(sg->skill_id, sg->skill_lv),0);
+ case 7: // Flee -100%
+ sc_start(bl,SC_INCFLEERATE,100,-100,skill_get_time2(sg->skill_id, sg->skill_lv));
break;
case 8: // Speed/ASPD -25%
- status_change_start(bl,SC_GOSPEL,100,1,0,0,BCT_ENEMY,skill_get_time2(sg->skill_id, sg->skill_lv),0);
+ sc_start4(bl,SC_GOSPEL,100,1,0,0,BCT_ENEMY,skill_get_time2(sg->skill_id, sg->skill_lv));
break;
}
}
@@ -7390,12 +7268,12 @@ static void skill_moonlit(struct block_list* src, struct block_list* partner, in
skill_get_splash(CG_MOONLIT, skilllv),
BL_CHAR,src,partner,blowcount);
- status_change_start(src,SC_DANCING,100,CG_MOONLIT,0,0,partner?partner->id:BCT_SELF,time+1000,0);
- status_change_start(src,SkillStatusChangeTable[CG_MOONLIT],100,skilllv,0,0,0,time,0);
+ sc_start4(src,SC_DANCING,100,CG_MOONLIT,0,0,partner?partner->id:BCT_SELF,time+1000);
+ sc_start4(src,SkillStatusChangeTable[CG_MOONLIT],100,skilllv,0,0,0,time);
if (partner) {
- status_change_start(partner,SC_DANCING,100,CG_MOONLIT,0,0,src->id,time+1000,0);
- status_change_start(partner,SkillStatusChangeTable[CG_MOONLIT],100,skilllv,0,0,0,time,0);
+ sc_start4(partner,SC_DANCING,100,CG_MOONLIT,0,0,src->id,time+1000);
+ sc_start4(partner,SkillStatusChangeTable[CG_MOONLIT],100,skilllv,0,0,0,time);
}
}
@@ -7504,7 +7382,7 @@ static int skill_check_pc_partner(struct map_session_data *sd, int skill_id, int
if (c > 0 && (tsd = map_id2sd(p_sd[0])) != NULL)
{
sd->sc.data[SC_DANCING].val4= tsd->bl.id;
- status_change_start(&tsd->bl,SC_DANCING,100,skill_id,sd->sc.data[SC_DANCING].val2,0,sd->bl.id,skill_get_time(skill_id,*skill_lv)+1000,0);
+ sc_start4(&tsd->bl,SC_DANCING,100,skill_id,sd->sc.data[SC_DANCING].val2,0,sd->bl.id,skill_get_time(skill_id,*skill_lv)+1000);
clif_skill_nodamage(&tsd->bl, &sd->bl, skill_id, *skill_lv, 1);
tsd->skillid_dance = tsd->skillid = skill_id;
tsd->skilllv_dance = tsd->skilllv = *skill_lv;
@@ -8067,6 +7945,26 @@ int skill_check_condition(struct map_session_data *sd,int type)
if (sd->sc.data[SC_SPIRIT].timer != -1 && sd->sc.data[SC_SPIRIT].val2 == SL_STAR)
break;
return 0;
+ case GD_BATTLEORDER:
+ case GD_REGENERATION:
+ case GD_RESTORE:
+ case GD_EMERGENCYCALL:
+ if (!sd->status.guild_id || !sd->state.gmaster_flag)
+ return 0;
+ if (lv <= 0)
+ return 0;
+
+ if (skill == GD_EMERGENCYCALL) {
+ if (!map_flag_gvg(sd->bl.m))
+ { //if not allowed to warp to the map (castles are always allowed)
+ clif_skill_fail(sd,skill,0,0);
+ return 0;
+ }
+ } else if (!agit_flag) {
+ clif_skill_fail(sd,skill,0,0);
+ return 0;
+ }
+ break;
}
if(!(type&2)){
@@ -8503,14 +8401,9 @@ int skill_use_id (struct map_session_data *sd, int target_id, int skill_num, int
case GD_REGENERATION:
case GD_RESTORE:
case GD_EMERGENCYCALL:
- {
- if (!sd->status.guild_id || !sd->state.gmaster_flag)
- return 0;
+ if (sd->state.gmaster_flag)
skill_lv = guild_checkskill(sd->state.gmaster_flag, skill_num);
- if (skill_lv <= 0) return 0;
- }
break;
-
case BD_LULLABY: /* 子守歌 */
case BD_RICHMANKIM: /* ニヨルドの宴 */
case BD_ETERNALCHAOS: /* 永遠の?ャ沌 */
@@ -9173,8 +9066,8 @@ int skill_autospell(struct map_session_data *sd,int skillid)
if(maxlv > (lv=pc_checkskill(sd,skillid)))
maxlv = lv;
- status_change_start(&sd->bl,SC_AUTOSPELL,100,skilllv,skillid,maxlv,0, // val1:スキルID val2:使用?ナ大Lv
- skill_get_time(SA_AUTOSPELL,skilllv),0);// にしてみたけどbscriptが?曹ォ易い????H
+ sc_start4(&sd->bl,SC_AUTOSPELL,100,skilllv,skillid,maxlv,0, // val1:スキルID val2:使用?ナ大Lv
+ skill_get_time(SA_AUTOSPELL,skilllv));// にしてみたけどbscriptが?曹ォ易い????H
return 0;
}
@@ -9935,7 +9828,7 @@ struct skill_unit_group *skill_initunitgroup(struct block_list *src,
sd->skillid_dance=skillid;
sd->skilllv_dance=skilllv;
}
- status_change_start(src,SC_DANCING,100,skillid,(int)group,0,(i&UF_ENSEMBLE?BCT_SELF:0),skill_get_time(skillid,skilllv)+1000,0);
+ sc_start4(src,SC_DANCING,100,skillid,(int)group,0,(i&UF_ENSEMBLE?BCT_SELF:0),skill_get_time(skillid,skilllv)+1000);
//?奏スキルは相方をダンス?態にする
if (sd && i&UF_ENSEMBLE &&
battle_config.player_skill_partner_check) {
diff --git a/src/map/status.c b/src/map/status.c
index 48c699087..831b18eb5 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -1630,11 +1630,6 @@ int status_calc_pc(struct map_session_data* sd,int first)
if(b_sp != sd->status.sp)
clif_updatestatus(sd,SP_SP);
- /* I don't think there's a need for this here. It should be handled in pc_damage and pc_heal. [Skotlex]
- if(sd->status.hp<sd->status.max_hp>>2 && sd->sc.data[SC_AUTOBERSERK].timer!=-1 &&
- (sd->sc.data[SC_PROVOKE].timer==-1 || sd->sc.data[SC_PROVOKE].val2==0) && !pc_isdead(sd))
- status_change_start(&sd->bl,SC_PROVOKE,100,10,1,0,0,0,0);
- */
calculating = 0;
return 0;
}
@@ -3435,7 +3430,7 @@ int status_get_sc_tick(struct block_list *bl, int type, int tick)
/*==========================================
* Starts a status change.
* type = type, val1~4 depend on the type.
- * rate = base success rate. 100 = 100%
+ * rate = base success rate. 10000 = 100%
* Tick is base duration
* flag:
* &1: Cannot be avoided (it has to start)
@@ -3475,7 +3470,6 @@ int status_change_start(struct block_list *bl,int type,int rate,int val1,int val
//Check rate
if (!(flag&(4|1))) {
- rate*=100; //Pass to 10000 = 100%
if (rate > 10000) //Shouldn't let this go above 100%
rate = 10000;
race = flag&8?0:status_get_sc_def(bl, type); //recycling race to store the sc_def value.
@@ -3657,7 +3651,7 @@ int status_change_start(struct block_list *bl,int type,int rate,int val1,int val
tick = 60*1000;
if (sd && sd->status.hp<sd->status.max_hp>>2 &&
(sc->data[SC_PROVOKE].timer==-1 || sc->data[SC_PROVOKE].val2==0))
- status_change_start(bl,SC_PROVOKE,10,100,1,0,0,0,0);
+ sc_start4(bl,SC_PROVOKE,100,10,1,0,0,0);
}
break;
@@ -4036,7 +4030,7 @@ 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,100,val1,val2,0,0,tick,1);
+ status_change_start(&tsd->bl,SC_AUTOGUARD,10000,val1,val2,0,0,tick,1);
}
}
break;
@@ -4052,7 +4046,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,100,val1,val2,0,0,tick,1);
+ status_change_start(&tsd->bl,SC_DEFENDER,10000,val1,val2,0,0,tick,1);
}
}
break;
@@ -4077,7 +4071,7 @@ int status_change_start(struct block_list *bl,int type,int rate,int val1,int val
case SC_JOINTBEAT: // Random break [DracoRPG]
calc_flag = 1;
val2 = rand()%6;
- if (val2 == 5) status_change_start(bl,SC_BLEEDING,100,val1,0,0,0,skill_get_time2(StatusSkillChangeTable[type],val1),0);
+ if (val2 == 5) sc_start(bl,SC_BLEEDING,100,val1,skill_get_time2(StatusSkillChangeTable[type],val1));
break;
case SC_BERSERK: /* バ?サ?ク */
@@ -4186,14 +4180,10 @@ int status_change_start(struct block_list *bl,int type,int rate,int val1,int val
//once the Crusader's status changes, it will reflect on the others.
int type2 = SC_AUTOGUARD;
if (src->sc.data[type2].timer != -1)
- status_change_start(bl,type2,100,
- src->sc.data[type2].val1,0,0,0,
- skill_get_time(StatusSkillChangeTable[type2],src->sc.data[type2].val1),0);
+ 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)
- status_change_start(bl,type2,100,
- src->sc.data[type2].val1,0,0,0,
- skill_get_time(StatusSkillChangeTable[type2],src->sc.data[type2].val1),0);
+ sc_start(bl,type2,100,src->sc.data[type2].val1,skill_get_time(StatusSkillChangeTable[type2],src->sc.data[type2].val1));
}
break;
}
@@ -4217,7 +4207,7 @@ int status_change_start(struct block_list *bl,int type,int rate,int val1,int val
struct status_change *sc2 = src?status_get_sc(src):NULL;
if (src && sc2 && sc2->count) {
if (sc2->data[SC_CLOSECONFINE].timer == -1) //Start lock on caster.
- status_change_start(src,SC_CLOSECONFINE,100,sc->data[type].val1,1,0,0,tick+1000,0);
+ sc_start4(src,SC_CLOSECONFINE,100,sc->data[type].val1,1,0,0,tick+1000);
else { //Increase count of locked enemies and refresh time.
sc2->data[SC_CLOSECONFINE].val2++;
delete_timer(sc2->data[SC_CLOSECONFINE].timer, status_change_timer);
@@ -4784,7 +4774,7 @@ int status_change_end( struct block_list* bl , int type,int tid )
DIFF_TICK(gettick(), sc->data[type].val4) <= 1000 &&
(!sd || (sd->weapontype1 == 0 && sd->weapontype2 == 0))
)
- status_change_start(bl,SC_SPURT,100,sc->data[type].val1,0,0,0,skill_get_time2(StatusSkillChangeTable[type], sc->data[type].val1),0);
+ sc_start(bl,SC_SPURT,100,sc->data[type].val1,skill_get_time2(StatusSkillChangeTable[type], sc->data[type].val1));
calc_flag = 1;
break;
case SC_AUTOBERSERK:
@@ -5134,10 +5124,9 @@ int status_change_timer(int tid, unsigned int tick, int id, int data)
if (map_flag_gvg(sd->bl.m)) sp *= 5;
if (pc_damage_sp(sd, sp, 0) > 0) {
if ((++sc->data[type].val4) == 1) {
- status_change_start(bl, SC_INCSTR,100,
- 1<<(sc->data[type].val1-1), 0, 0, 0,
+ sc_start(bl, SC_INCSTR,100,1<<(sc->data[type].val1-1),
(sc->data[SC_SPIRIT].timer != -1 && sc->data[SC_SPIRIT].val2 == SL_ROGUE?10:1) //SL bonus -> x10 duration
- *skill_get_time2(StatusSkillChangeTable[type],sc->data[type].val1), 0);
+ *skill_get_time2(StatusSkillChangeTable[type],sc->data[type].val1));
}
sc->data[type].timer = add_timer( /* タイマ?再設定 */
sc->data[type].val2+tick, status_change_timer, bl->id, data);
diff --git a/src/map/status.h b/src/map/status.h
index a104b5a9d..d1315b394 100644
--- a/src/map/status.h
+++ b/src/map/status.h
@@ -481,7 +481,10 @@ int status_get_sc_def(struct block_list *bl, int type);
#define status_get_sc_def_int(bl) (status_get_sc_def(bl, SP_MDEF2))
#define status_get_sc_def_luk(bl) (status_get_sc_def(bl, SP_LUK))
-// 状態異常関連 skill.c より移動
+//Short version, receives rate in 1->100 range, and does not uses a flag setting.
+#define sc_start(bl, type, rate, val1, tick) status_change_start(bl,type,100*(rate),val1,0,0,0,tick,0)
+#define sc_start4(bl, type, rate, val1, val2, val3, val4, tick) status_change_start(bl,type,100*(rate),val1,val2,val3,val4,tick,0)
+
int status_change_start(struct block_list *bl,int type,int rate,int val1,int val2,int val3,int val4,int tick,int flag);
int status_change_end( struct block_list* bl , int type,int tid );
int status_change_timer(int tid, unsigned int tick, int id, int data);