diff options
author | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-05-22 14:38:18 +0000 |
---|---|---|
committer | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-05-22 14:38:18 +0000 |
commit | 56e909438c6cf5011eb8ccdbcf0052d79de9d620 (patch) | |
tree | 0b2387a0c981877535b4989dd5d98b1b4298a51d /src | |
parent | a4a17c165ecc718ca8f0ac0a25a4a39ee471c72d (diff) | |
download | hercules-56e909438c6cf5011eb8ccdbcf0052d79de9d620.tar.gz hercules-56e909438c6cf5011eb8ccdbcf0052d79de9d620.tar.bz2 hercules-56e909438c6cf5011eb8ccdbcf0052d79de9d620.tar.xz hercules-56e909438c6cf5011eb8ccdbcf0052d79de9d620.zip |
- Fixed a possible null pointer in script command misc_effect
- Modified Investigate to take into consideration final def/vit-def rather than base values for damage adjustment.
- Added missing include unit.h in pet.c
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6695 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r-- | src/map/battle.c | 19 | ||||
-rw-r--r-- | src/map/pet.c | 1 | ||||
-rw-r--r-- | src/map/script.c | 8 |
3 files changed, 18 insertions, 10 deletions
diff --git a/src/map/battle.c b/src/map/battle.c index 4d856966e..a8f892aa0 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -1606,8 +1606,6 @@ static struct Damage battle_calc_weapon_attack( break;
case MO_INVESTIGATE:
skillratio += 75*skill_lv;
- ATK_RATE(2*(def1 + def2));
- flag.idef= flag.idef2= 1;
break;
case MO_EXTREMITYFIST:
if (sd)
@@ -1903,15 +1901,22 @@ static struct Damage battle_calc_weapon_attack( vit_def = def2 + (vit_def>0?rand()%vit_def:0);
}
- if (sd && battle_config.player_defense_type)
+ if (sd && battle_config.player_defense_type) {
vit_def += def1*battle_config.player_defense_type;
- else if (md && battle_config.monster_defense_type)
+ def1 = 0;
+ } else if (md && battle_config.monster_defense_type) {
vit_def += def1*battle_config.monster_defense_type;
- else if(pd && battle_config.pet_defense_type)
+ def1 = 0;
+ } else if(pd && battle_config.pet_defense_type) {
vit_def += def1*battle_config.pet_defense_type;
- else
+ def1 = 0;
+ }
+ if(skill_num == MO_INVESTIGATE) { //Must use adjusted defense
+ ATK_RATE(2*(def1 + vit_def));
+ } else {
ATK_RATE2(flag.idef?100:100-def1, flag.idef2?100:100-def1);
- ATK_ADD2(flag.idef?0:-vit_def, flag.idef2?0:-vit_def);
+ ATK_ADD2(flag.idef?0:-vit_def, flag.idef2?0:-vit_def);
+ }
}
//Post skill/vit reduction damage increases
diff --git a/src/map/pet.c b/src/map/pet.c index 94d652aa5..43c95df86 100644 --- a/src/map/pet.c +++ b/src/map/pet.c @@ -25,6 +25,7 @@ #include "npc.h"
#include "script.h"
#include "skill.h"
+#include "unit.h"
#define MIN_PETTHINKTIME 100
diff --git a/src/map/script.c b/src/map/script.c index 777714a84..319fc5d14 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -8327,9 +8327,11 @@ int buildin_misceffect(struct script_state *st) int type;
type=conv_num(st,& (st->stack->stack_data[st->start+2]));
- if(st->oid)
- clif_misceffect2(map_id2bl(st->oid),type);
- else{
+ if(st->oid) {
+ struct block_list *bl = map_id2bl(st->oid);
+ if (bl)
+ clif_misceffect2(bl,type);
+ } else{
struct map_session_data *sd=script_rid2sd(st);
if(sd)
clif_misceffect2(&sd->bl,type);
|