summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-12-11 16:04:24 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-12-11 16:04:24 +0000
commitebf34f01ebc8d2c1e3af90c58c6be5b240efc01c (patch)
treef773155526ba89186626de09faf7f2dcbe2bb1c9 /src
parent1ce32a605550e2e3418d2ba23948ecc832d7c76c (diff)
downloadhercules-ebf34f01ebc8d2c1e3af90c58c6be5b240efc01c.tar.gz
hercules-ebf34f01ebc8d2c1e3af90c58c6be5b240efc01c.tar.bz2
hercules-ebf34f01ebc8d2c1e3af90c58c6be5b240efc01c.tar.xz
hercules-ebf34f01ebc8d2c1e3af90c58c6be5b240efc01c.zip
- Spirit of Sin and Enchant Deadly Poison now stack.
- Fixed skill damage card bonuses not working on magic skills. - Moved the setting of sd->npc_id = 0 in npc_dequeue to the beginning, since this function is called when a script is cancelled (TODO: but when this happens, shouldn't the previously ongoing script also be free'd?) - Made homunc's speed be recalculated when you respawn it from rest state. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9453 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r--src/map/battle.c21
-rw-r--r--src/map/mercenary.c2
-rw-r--r--src/map/npc.c2
-rw-r--r--src/map/pc.c14
4 files changed, 20 insertions, 19 deletions
diff --git a/src/map/battle.c b/src/map/battle.c
index dea2f9056..db526dda8 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -1644,8 +1644,8 @@ static struct Damage battle_calc_weapon_attack(
skillratio += sc->data[SC_EDP].val3;
}
switch (skill_num) {
- case AS_SONICBLOW: //EDP will not stack with Soul Link bonus.
- if (sc && sc->data[SC_EDP].timer == -1 && sc->data[SC_SPIRIT].timer != -1 && sc->data[SC_SPIRIT].val2 == SL_ASSASIN)
+ case AS_SONICBLOW:
+ if (sc && sc->data[SC_SPIRIT].timer != -1 && sc->data[SC_SPIRIT].val2 == SL_ASSASIN)
skillratio += (map_flag_gvg(src->m))?25:100; //+25% dmg on woe/+100% dmg on nonwoe
if(sd && pc_checkskill(sd,AS_SONICACCEL)>0)
skillratio += 10;
@@ -2378,15 +2378,6 @@ struct Damage battle_calc_magic_attack(
break;
}
- if (sd && sd->skillatk[0].id != 0)
- {
- for (i = 0; i < MAX_PC_BONUS && sd->skillatk[i].id != 0 && sd->skillatk[i].id != skill_num; i++)
- if (i < MAX_PC_BONUS && sd->skillatk[i].id == skill_num)
- //If we apply skillatk[] as ATK_RATE, it will also affect other skills,
- //unfortunately this way ignores a skill's constant modifiers...
- skillratio += sd->skillatk[i].val;
- }
-
MATK_RATE(skillratio);
//Constant/misc additions from skills
@@ -2396,6 +2387,14 @@ struct Damage battle_calc_magic_attack(
}
if(sd) {
+ //Damage bonuses
+ if (sd->skillatk[0].id)
+ {
+ for (i = 0; i < MAX_PC_BONUS && sd->skillatk[i].id && sd->skillatk[i].id != skill_num; i++);
+ if (i < MAX_PC_BONUS && sd->skillatk[i].id == skill_num)
+ ad.damage += ad.damage*sd->skillatk[i].val/100;
+ }
+
//Ignore Defense?
if (!flag.imdef && (
sd->ignore_mdef_ele & (1<<tstatus->def_ele) ||
diff --git a/src/map/mercenary.c b/src/map/mercenary.c
index 3ae9f8ffb..0ae731fd3 100644
--- a/src/map/mercenary.c
+++ b/src/map/mercenary.c
@@ -606,6 +606,8 @@ int merc_call_homunculus(struct map_session_data *sd)
clif_hominfo(sd,hd,1);
clif_hominfo(sd,hd,0); // send this x2. dunno why, but kRO does that [blackhole89]
clif_homskillinfoblock(sd);
+ if (battle_config.slaves_inherit_speed&1)
+ status_calc_bl(&hd->bl, SCB_SPEED);
merc_save(hd);
} else
//Warp him to master.
diff --git a/src/map/npc.c b/src/map/npc.c
index 46fd4c4ab..d322fc530 100644
--- a/src/map/npc.c
+++ b/src/map/npc.c
@@ -162,6 +162,7 @@ int npc_event_dequeue(struct map_session_data *sd)
{
nullpo_retr(0, sd);
+ sd->npc_id=0;
if (!sd->eventqueue[0][0])
return 0; //Nothing to dequeue
@@ -171,7 +172,6 @@ int npc_event_dequeue(struct map_session_data *sd)
return 0;
}
//Event dequeued successfully, shift other elements.
- sd->npc_id=0; //FIXME: Shouldn't dequeueing fail when you have an npc_id set?
memmove(sd->eventqueue[0], sd->eventqueue[1], (MAX_EVENTQUEUE-1)*sizeof(sd->eventqueue[0]));
sd->eventqueue[MAX_EVENTQUEUE-1][0]=0;
return 1;
diff --git a/src/map/pc.c b/src/map/pc.c
index c5128bd79..e6ae6c8af 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -2136,19 +2136,19 @@ int pc_bonus2(struct map_session_data *sd,int type,int type2,int val)
ATF_SHORT|ATF_TARGET);
break;
case SP_SKILL_ATK:
+ if(sd->state.lr_flag == 2)
+ break;
for (i = 0; i < MAX_PC_BONUS && sd->skillatk[i].id != 0 && sd->skillatk[i].id != type2; i++);
if (i == MAX_PC_BONUS)
{ //Better mention this so the array length can be updated. [Skotlex]
ShowDebug("run_script: bonus2 bSkillAtk reached it's limit (%d skills per character), bonus skill %d (+%d%%) lost.\n", MAX_PC_BONUS, type2, val);
break;
}
- if(sd->state.lr_flag != 2) {
- if (sd->skillatk[i].id == type2)
- sd->skillatk[i].val += val;
- else {
- sd->skillatk[i].id = type2;
- sd->skillatk[i].val = val;
- }
+ if (sd->skillatk[i].id == type2)
+ sd->skillatk[i].val += val;
+ else {
+ sd->skillatk[i].id = type2;
+ sd->skillatk[i].val = val;
}
break;
case SP_ADD_SKILL_BLOW: