diff options
author | Jesusaves <cpntb1@ymail.com> | 2020-05-22 11:32:45 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2020-05-22 11:32:45 -0300 |
commit | 70a351a62fd5ef8ef144964b1aafcb6a0b23b89f (patch) | |
tree | 1fa080653dcd2df1df1d5433525607d5f1ad45d3 /src | |
parent | 94d1a9342e80e311eb8b1fe7b49cb40a103055ff (diff) | |
download | evol-hercules-70a351a62fd5ef8ef144964b1aafcb6a0b23b89f.tar.gz evol-hercules-70a351a62fd5ef8ef144964b1aafcb6a0b23b89f.tar.bz2 evol-hercules-70a351a62fd5ef8ef144964b1aafcb6a0b23b89f.tar.xz evol-hercules-70a351a62fd5ef8ef144964b1aafcb6a0b23b89f.zip |
Improve harm() logic, to allow "true/false" usage
Diffstat (limited to 'src')
-rw-r--r-- | src/emap/script_buildins.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/emap/script_buildins.c b/src/emap/script_buildins.c index 3e53dfe..6de1af0 100644 --- a/src/emap/script_buildins.c +++ b/src/emap/script_buildins.c @@ -3089,8 +3089,9 @@ BUILDIN(aggravate) } // Like heal() but works against anything (casts battle funcs) -// types: 1- physical; 2- magic; 4 - misc, default -// harm(guid, rawdmg, type) +// types: 1- physical; 2- magic. +// Any other number: misc (no calculation) +// harm(guid, raw_damage, type) BUILDIN(harm) { struct block_list *bl; @@ -3129,10 +3130,8 @@ BUILDIN(harm) switch(attack_type) { case BF_WEAPON: d = battle->calc_weapon_attack(src, bl, 0,0,0); break; case BF_MAGIC: d = battle->calc_magic_attack(src, bl, 0,0,0); break; - case BF_MISC: d.damage=d.damage2=dmg; d.flag=BF_MISC; break; default: - ShowError("harm: unknown attack type! %d\n",attack_type); - memset(&d,0,sizeof(d)); + d.damage=d.damage2=dmg; break; } |