summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2021-04-10 17:54:47 -0300
committerJesusaves <cpntb1@ymail.com>2021-04-10 17:54:47 -0300
commit64f5b4f481768e661b26002de4d763981de129dc (patch)
treeecae944071d87aa6b8f05c74a37b1905cc8fc264
parentc2db4a2100de4c92ecd1201df505bc42f5b3b15a (diff)
downloadevol-hercules-64f5b4f481768e661b26002de4d763981de129dc.tar.gz
evol-hercules-64f5b4f481768e661b26002de4d763981de129dc.tar.bz2
evol-hercules-64f5b4f481768e661b26002de4d763981de129dc.tar.xz
evol-hercules-64f5b4f481768e661b26002de4d763981de129dc.zip
Remove calcdmg(); There's a risk of a loop and I don't wanna hear of it.
This is pre-renewal with much less overhead, we can use Atk/Matk without mods. Means no criticals; But with no evasion and no defense it is like "always crit".
-rw-r--r--src/emap/init.c1
-rw-r--r--src/emap/script_buildins.c74
-rw-r--r--src/emap/script_buildins.h1
3 files changed, 0 insertions, 76 deletions
diff --git a/src/emap/init.c b/src/emap/init.c
index 8cad8aa..eafb828 100644
--- a/src/emap/init.c
+++ b/src/emap/init.c
@@ -225,7 +225,6 @@ HPExport void plugin_init (void)
// From Moubootaur Legends
addScriptCommand("aggravate", "i", aggravate);
- addScriptCommand("calcdmg", "iii", calcdmg);
addScriptCommand("harm", "ii??", harm);
// Overrides
diff --git a/src/emap/script_buildins.c b/src/emap/script_buildins.c
index c534de6..4053158 100644
--- a/src/emap/script_buildins.c
+++ b/src/emap/script_buildins.c
@@ -2748,80 +2748,6 @@ BUILDIN(aggravate)
return true;
}
-// Returns the estimated damage (ATK or MATK)
-// Advantage over getunitdata is: Takes crit and etc. in account
-// types: 1- physical; 2- magic.
-// calcdmg(source, target, type)
-BUILDIN(calcdmg)
-{
- struct block_list *src;
- struct block_list *bl;
- int attack_type, range, damage;
- struct map_session_data *sd;
-
- // Fill data from scripts
- src = map->id2bl(script_getnum(st, 2));
- bl = map->id2bl(script_getnum(st, 3));
- attack_type = script_getnum(st,4);
-
- // Nullity check for source
- if (src == NULL) {
- ShowWarning("buildin_calcdmg: Error in finding object with given GID %d!\n", script_getnum(st, 2));
- script_pushint(st, 0);
- return false;
- }
-
- // Maybe we don't want a target?
- if (script_getnum(st, 3) <= 0) {
- sd = BL_CAST(BL_PC, src);
- switch(attack_type) {
- case BF_WEAPON:
- range = sd->battle_status.rhw.atk2-sd->battle_status.rhw.atk;
- if (range <= 1)
- damage = sd->battle_status.rhw.atk;
- else
- damage = rnd()%range + sd->battle_status.rhw.atk;
- damage = damage + rnd()%sd->battle_status.batk;
- script_pushint(st, damage);
- break;
- case BF_MAGIC:
- range = sd->battle_status.matk_max-sd->battle_status.matk_min;
- if (range <= 1)
- script_pushint(st, sd->battle_status.matk_min);
- else
- script_pushint(st, rnd()%range + sd->battle_status.matk_min);
- break;
- default:
- ShowWarning("buildin_calcdmg: Invalid attack type %d!\n", attack_type);
- script_pushint(st, 0);
- return false;
- }
-
- return true;
- }
-
- // Nullity check for target
- if (bl == NULL) {
- ShowWarning("buildin_calcdmg: Error in finding object with given GID %d!\n", script_getnum(st, 3));
- script_pushint(st, 0);
- return false;
- }
-
- // Get ATK or MATK
- struct Damage d;
- 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;
- default:
- ShowWarning("buildin_calcdmg: Invalid attack type %d!\n", attack_type);
- script_pushint(st, 0);
- return false;
- break;
- }
-
- script_pushint(st, d.damage);
- return true;
-}
// Like heal() but works against anything (casts battle funcs)
// types: 1- physical; 2- magic.
diff --git a/src/emap/script_buildins.h b/src/emap/script_buildins.h
index bdc79d2..13d818a 100644
--- a/src/emap/script_buildins.h
+++ b/src/emap/script_buildins.h
@@ -110,7 +110,6 @@ BUILDIN(getskillname);
// Imported from Moubootaur Legends
BUILDIN(aggravate);
-BUILDIN(calcdmg);
BUILDIN(harm);
// Overrides