summaryrefslogtreecommitdiff
path: root/src/map/battle.c
diff options
context:
space:
mode:
authorshennetsind <ind@henn.et>2013-02-18 00:30:28 -0300
committershennetsind <ind@henn.et>2013-02-18 00:30:28 -0300
commit7e72f0cee8867837be53cb2119b610b00e9bd587 (patch)
tree22ab404109fb2def22cf0085fcec2bf174210970 /src/map/battle.c
parent237d76e7c409251b5fdb9f3eee40ef3fe5dc2b25 (diff)
downloadhercules-7e72f0cee8867837be53cb2119b610b00e9bd587.tar.gz
hercules-7e72f0cee8867837be53cb2119b610b00e9bd587.tar.bz2
hercules-7e72f0cee8867837be53cb2119b610b00e9bd587.tar.xz
hercules-7e72f0cee8867837be53cb2119b610b00e9bd587.zip
Improvements all over the place
Committing on the behalf of mkbu95 who is unable to do it himself, he coded it all and sent me the diff. Thanks mkbu95! Signed-off-by: shennetsind <ind@henn.et>
Diffstat (limited to 'src/map/battle.c')
-rw-r--r--src/map/battle.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/map/battle.c b/src/map/battle.c
index cfb3df52e..3140fbc18 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -338,13 +338,13 @@ int battle_attr_fix(struct block_list *src, struct block_list *target, int damag
struct skill_unit *su = (struct skill_unit*)target;
struct skill_unit_group *sg;
struct block_list *src;
- int x,y;
if( !su || !su->alive || (sg = su->group) == NULL || !sg || sg->val3 == -1 ||
(src = map_id2bl(sg->src_id)) == NULL || status_isdead(src) )
return 0;
if( sg->unit_id != UNT_FIREWALL ) {
+ int x,y;
x = sg->val3 >> 16;
y = sg->val3 & 0xffff;
skill_unitsetting(src,su->group->skill_id,su->group->skill_lv,x,y,1);
@@ -4560,7 +4560,7 @@ struct Damage battle_calc_attack(int attack_type,struct block_list *bl,struct bl
//Calculates BF_WEAPON returned damage.
int battle_calc_return_damage(struct block_list* bl, struct block_list *src, int *dmg, int flag, uint16 skill_id){
- struct map_session_data* sd = NULL;
+ struct map_session_data* sd;
int rdamage = 0, damage = *dmg;
struct status_change* sc;
@@ -4596,9 +4596,9 @@ int battle_calc_return_damage(struct block_list* bl, struct block_list *src, int
if(sc->data[SC_DEATHBOUND] && skill_id != WS_CARTTERMINATION && !(src->type == BL_MOB && is_boss(src)) ) {
uint8 dir = map_calc_dir(bl,src->x,src->y),
t_dir = unit_getdir(bl);
- int rd1 = 0;
if( distance_bl(src,bl) <= 0 || !map_check_dir(dir,t_dir) ) {
+ int rd1 = 0;
rd1 = min(damage,status_get_max_hp(bl)) * sc->data[SC_DEATHBOUND]->val2 / 100; // Amplify damage.
*dmg = rd1 * 30 / 100; // Received damage = 30% of amplifly damage.
clif_skill_damage(src,bl,gettick(), status_get_amotion(src), 0, -30000, 1, RK_DEATHBOUND, sc->data[SC_DEATHBOUND]->val1,6);
@@ -4993,9 +4993,10 @@ enum damage_lv battle_weapon_attack(struct block_list* src, struct block_list* t
sd->status.skill[sc->data[SC__AUTOSHADOWSPELL]->val1].id != 0 && sd->status.skill[sc->data[SC__AUTOSHADOWSPELL]->val1].flag == SKILL_FLAG_PLAGIARIZED )
{
int r_skill = sd->status.skill[sc->data[SC__AUTOSHADOWSPELL]->val1].id,
- r_lv = sc->data[SC__AUTOSHADOWSPELL]->val2, type;
+ r_lv = sc->data[SC__AUTOSHADOWSPELL]->val2;
if (r_skill != AL_HOLYLIGHT && r_skill != PR_MAGNUS) {
+ int type;
if( (type = skill_get_casttype(r_skill)) == CAST_GROUND ) {
int maxcount = 0;
@@ -6109,7 +6110,6 @@ void battle_adjust_conf()
int battle_config_read(const char* cfgName)
{
- char line[1024], w1[1024], w2[1024];
FILE* fp;
static int count = 0;
@@ -6123,6 +6123,7 @@ int battle_config_read(const char* cfgName)
ShowError("File not found: %s\n", cfgName);
else
{
+ char line[1024], w1[1024], w2[1024];
while(fgets(line, sizeof(line), fp))
{
if (line[0] == '/' && line[1] == '/')