summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-09-01 14:12:51 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-09-01 14:12:51 +0000
commitd3adab9f6f417979f9f7a5915930604d0add5c64 (patch)
tree2d9b1b661dd4a9323d8036bfbd379cb0b7cda32a /src
parent116eb2b7f492f871e0348c05fbe075191d14c4d6 (diff)
downloadhercules-d3adab9f6f417979f9f7a5915930604d0add5c64.tar.gz
hercules-d3adab9f6f417979f9f7a5915930604d0add5c64.tar.bz2
hercules-d3adab9f6f417979f9f7a5915930604d0add5c64.tar.xz
hercules-d3adab9f6f417979f9f7a5915930604d0add5c64.zip
- Soul Breaker will now be affected by Lex Aeterna on both parts of the attack.
- Some minor code cleanups - Cleaned Adaptation's code to not require to check the Skill Unit group structure to extract the skill lv info. - Status changes with no skill and no SCB* data will now go through if they have an SI* icon. This should fix SC_MIRACLE - Reverted switching a mob's adelay/amotion when the later is longer than the former, now both get updated to amotion. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@8574 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r--src/map/battle.c4
-rw-r--r--src/map/mob.c18
-rw-r--r--src/map/pc.c3
-rw-r--r--src/map/skill.c36
-rw-r--r--src/map/status.c4
5 files changed, 25 insertions, 40 deletions
diff --git a/src/map/battle.c b/src/map/battle.c
index 7e724b0d0..5265dd270 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -330,7 +330,9 @@ int battle_calc_damage(struct block_list *src,struct block_list *bl,int damage,i
//Now damage increasing effects
if(sc->data[SC_AETERNA].timer!=-1 && skill_num != PF_SOULBURN){
damage<<=1;
- status_change_end( bl,SC_AETERNA,-1 );
+ //Shouldn't end until Breaker's non-weapon part connects.
+ if (skill_num != ASC_BREAKER || flag&BF_WEAPON)
+ status_change_end( bl,SC_AETERNA,-1 );
}
if(sc->data[SC_SPIDERWEB].timer!=-1) // [Celest]
diff --git a/src/map/mob.c b/src/map/mob.c
index f8cd38851..5be35b97f 100644
--- a/src/map/mob.c
+++ b/src/map/mob.c
@@ -2304,7 +2304,8 @@ int mob_class_change (struct mob_data *md, int class_)
if(md->lootitem == NULL && md->db->status.mode&MD_LOOTER)
md->lootitem=(struct item *)aCalloc(LOOTITEM_SIZE,sizeof(struct item));
- clif_charnameack(0, &md->bl);
+ if (battle_config.show_mob_hp)
+ clif_charnameack(0, &md->bl);
return 0;
}
@@ -3250,13 +3251,8 @@ static int mob_readdb(void)
status->amotion=atoi(str[28]);
status->dmotion=atoi(str[29]);
//If the attack animation is longer than the delay, the client crops the attack animation!
- if (status->adelay < status->amotion) {
- //Let's try switching them to see what happens.
-// status->adelay = status->amotion;
- i = status->adelay;
+ if (status->adelay < status->amotion)
status->adelay = status->amotion;
- status->amotion = i;
- }
if(battle_config.monster_damage_delay_rate != 100)
status->dmotion = status->dmotion*battle_config.monster_damage_delay_rate/100;
@@ -3932,14 +3928,8 @@ static int mob_read_sqldb(void)
status->amotion = TO_INT(28);
status->dmotion = TO_INT(29);
//If the attack animation is longer than the delay, the client crops the attack animation!
- if (status->adelay < status->amotion) {
- //Let's try switching them to see what happens.
- // status->adelay = status->amotion;
- i = status->adelay;
+ if (status->adelay < status->amotion)
status->adelay = status->amotion;
- status->amotion = i;
- }
-
if(battle_config.monster_damage_delay_rate != 100)
status->dmotion = status->dmotion*battle_config.monster_damage_delay_rate/100;
diff --git a/src/map/pc.c b/src/map/pc.c
index 25f79b3a9..af0603086 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -2939,7 +2939,6 @@ int pc_useitem(struct map_session_data *sd,int n)
}
sd->canuseitem_tick= tick + battle_config.item_use_interval; //Update item use time.
- //sd->npc_id = fake_nd->bl.id;
run_script(script,0,sd->bl.id,fake_nd->bl.id);
potion_flag = 0;
return 1;
@@ -4032,7 +4031,7 @@ int pc_checkbaselevelup(struct map_session_data *sd)
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));
} else
- if((sd->class_&MAPID_UPPERMASK) == MAPID_TAEKWON || (sd->class_&MAPID_UPPERMASK) == MAPID_STAR_GLADIATOR)
+ if((sd->class_&MAPID_UPPERMASK) == MAPID_TAEKWON || (sd->class_&MAPID_UPPERMASK) == MAPID_STAR_GLADIATOR)
{
sc_start(&sd->bl,SkillStatusChangeTable(AL_INCAGI),100,10,600000);
sc_start(&sd->bl,SkillStatusChangeTable(AL_BLESSING),100,10,600000);
diff --git a/src/map/skill.c b/src/map/skill.c
index 0fd01aac1..8853dffbf 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -1864,7 +1864,6 @@ int skill_attack (int attack_type, struct block_list* src, struct block_list *ds
}
if(sc && sc->data[SC_MAGICROD].timer != -1 && src == dsrc) {
- //struct unit_data *ud;
int sp = skill_get_sp(skillid,skilllv);
dmg.damage = dmg.damage2 = 0;
dmg.dmg_lv = ATK_FLEE; //This will prevent skill additional effect from taking effect. [Skotlex]
@@ -1873,11 +1872,6 @@ int skill_attack (int attack_type, struct block_list* src, struct block_list *ds
sp = sp/((skilllv|1)*(skilllv|1)); //Estimate SP cost of a single water-ball
status_heal(bl, 0, sp, 2);
clif_skill_nodamage(bl,bl,SA_MAGICROD,sc->data[SC_MAGICROD].val1,1);
- /* It was reported you don't get an act delay once it triggers.
- ud = unit_bl2ud(bl);
- if (ud) ud->canact_tick = tick
- + skill_delayfix(bl, SA_MAGICROD, sc->data[SC_MAGICROD].val1);
- */
}
}
@@ -3055,7 +3049,6 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, int
if (skilllv>1) {
int range = skilllv/2;
int cnt;
-
if (sd)
cnt = skill_count_water(src,range);
else {
@@ -5475,7 +5468,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
clif_skill_nodamage(src,bl,skillid,skilllv,1);
sc_start(bl,SC_STUN,(rate>100)?100:rate,skilllv,skill_get_time2(skillid,skilllv)); //New temp stun rate (by RockmanEXE)
}
- else
+ else if (sd)
clif_skill_fail(sd,skillid,0,0);
break;
case AM_REST:
@@ -5673,6 +5666,7 @@ int skill_castend_id (int tid, unsigned int tick, int id, int data)
break;
}
}
+
//Avoid doing double checks for instant-cast skills.
if (tid != -1 && !status_check_skilluse(src, target, ud->skillid, 1))
break;
@@ -5764,19 +5758,17 @@ int skill_castend_id (int tid, unsigned int tick, int id, int data)
clif_slide(src,src->x,src->y);
clif_skill_damage(src,target,tick,sd->battle_status.amotion,0,0,1,ud->skillid, ud->skilllv, 5);
}
+ clif_skill_fail(sd,ud->skillid,0,0);
}
}
ud->skillid = ud->skilllv = ud->skilltarget = 0;
ud->canact_tick = tick;
- if(sd)
- {
- sd->skillitem = sd->skillitemlv = -1;
- clif_skill_fail(sd, ud->skillid, 0, 0);
- }
- else if (hd)
- clif_skill_fail(hd->master, ud->skillid, 0, 0);
- else if(md)
- md->skillidx = -1;
+ //You can't place a skill failed packet here because it would be
+ //sent in ALL cases, even cases where skill_check_condition fails
+ //which would lead to double 'skill failed' messages u.u [Skotlex]
+ if(sd) sd->skillitem = sd->skillitemlv = -1;
+ else
+ if(md) md->skillidx = -1;
return 0;
}
@@ -5891,7 +5883,7 @@ int skill_castend_pos (int tid, unsigned int tick, int id, int data)
clif_skill_fail(sd,ud->skillid,0,0);
sd->skillitem = sd->skillitemlv = -1;
}
- else if (hd)
+ else if (hd && hd->master)
clif_skill_fail(hd->master, ud->skillid, 0, 0);
else if(md)
md->skillidx = -1;
@@ -8098,17 +8090,17 @@ int skill_check_condition (struct map_session_data *sd, int skill, int lv, int t
return 0;
case BD_ADAPTATION: /* アドリブ */
{
- struct skill_unit_group *group=NULL;
int time;
if(!sc || sc->data[SC_DANCING].timer==-1)
{
clif_skill_fail(sd,skill,0,0);
return 0;
}
- group=(struct skill_unit_group*)sc->data[SC_DANCING].val2;
time = 1000*(sc->data[SC_DANCING].val3>>16);
- if (!group ||
- (skill_get_time(group->skill_id,group->skill_lv) - time <= skill_get_time2(skill,lv)))
+ if (skill_get_time(
+ (sc->data[SC_DANCING].val1&0xFFFF), //Dance Skill ID
+ (sc->data[SC_DANCING].val1>>16)) //Dance Skill LV
+ - time <= skill_get_time2(skill,lv))
{
clif_skill_fail(sd,skill,0,0);
return 0;
diff --git a/src/map/status.c b/src/map/status.c
index adb27c245..e4747fa12 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -5598,7 +5598,9 @@ int status_change_start(struct block_list *bl,int type,int rate,int val1,int val
break; // It just change the armor element of the player (used by battle_attr_fix)
// So it has no SCB and no skill associated (used by potion scripts)
default:
- if (calc_flag == SCB_NONE && StatusSkillChangeTable[type]==0)
+ if (calc_flag == SCB_NONE &&
+ StatusSkillChangeTable[type]==0 &&
+ StatusIconChangeTable[type]==0)
{ //Status change with no calc, and no skill associated...? unknown?
if(battle_config.error_log)
ShowError("UnknownStatusChange [%d]\n", type);