summaryrefslogtreecommitdiff
path: root/src/map/skill.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-09-17 19:13:58 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-09-17 19:13:58 +0000
commita0a05f00e2177f52903b7f9a55c8852a9e56d3d5 (patch)
tree2b0409dc827996af1e61a1b7461e662413e96642 /src/map/skill.c
parentd5766e3e2601c290e71fab04aa12756af36f3954 (diff)
downloadhercules-a0a05f00e2177f52903b7f9a55c8852a9e56d3d5.tar.gz
hercules-a0a05f00e2177f52903b7f9a55c8852a9e56d3d5.tar.bz2
hercules-a0a05f00e2177f52903b7f9a55c8852a9e56d3d5.tar.xz
hercules-a0a05f00e2177f52903b7f9a55c8852a9e56d3d5.zip
- Applied various crash-protections to script commands that deal with the equip-position array.
- Corrected and simplified the skill_magic_reflect function. Fixed damage reflection being based on the caster rather than the target. - Potions are now usable inside Gospel by the casting Paladin (as per Aegis tests done by AuronX) - The unequip script command now takes a position from 1 to 10 rather than 0 to 9 (to make it consistant with all the other equip position related script commands) - Added the EQI_* constants to db/const.txt in a format usable by the equip-position related script commands. - Updated some items to use the new EQI constants. - Also updated doc/script_commands.txt to refer to the EQI list. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11230 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/skill.c')
-rw-r--r--src/map/skill.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/map/skill.c b/src/map/skill.c
index c81aa3aaf..f3464be83 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -1890,13 +1890,13 @@ int skill_blown(struct block_list* src, struct block_list* target, int count, in
}
-//Checks if there should be magic reflection.
+//Checks if bl should reflect back a spell.
//type is the type of magic attack: 0: indirect (aoe), 1: direct (targetted)
-static int skill_magic_reflect(struct block_list *src, struct block_list *target, int type)
+static int skill_magic_reflect(struct block_list *bl, int type)
{
- struct status_change *sc = status_get_sc(target);
+ struct status_change *sc = status_get_sc(bl);
struct map_session_data *sd;
- BL_CAST(BL_PC, src, sd);
+ BL_CAST(BL_PC, bl, sd);
if(sd && sd->magic_damage_return && type && rand()%100 < sd->magic_damage_return)
return 1;
@@ -1906,11 +1906,11 @@ static int skill_magic_reflect(struct block_list *src, struct block_list *target
if(sc->data[SC_MAGICMIRROR].timer != -1 && rand()%100 < sc->data[SC_MAGICMIRROR].val2)
return 1;
- if(sc->data[SC_KAITE].timer != -1 && (sd || status_get_lv(src) <= 80))
+ if(sc->data[SC_KAITE].timer != -1 && (sd || status_get_lv(bl) <= 80))
{ //Works on players or mobs with level under 80.
- clif_specialeffect(target, 438, AREA);
+ clif_specialeffect(bl, 438, AREA);
if (--sc->data[SC_KAITE].val2 <= 0)
- status_change_end(target, SC_KAITE, -1);
+ status_change_end(bl, SC_KAITE, -1);
return 1;
}
}
@@ -1994,7 +1994,7 @@ int skill_attack (int attack_type, struct block_list* src, struct block_list *ds
if (attack_type&BF_MAGIC) {
if (!(sstatus->mode&MD_BOSS) && (dmg.damage || dmg.damage2) &&
- skill_magic_reflect(src, bl, src==dsrc))
+ skill_magic_reflect(bl, src==dsrc))
{ //Magic reflection, switch caster/target
struct block_list *tbl = bl;
bl = src;