summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-02-26 02:31:18 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-02-26 02:31:18 +0000
commit7c4b730c6d8a0201512148fcb795c0f666bfe8c8 (patch)
treed18286ab4e0a11d3c3384c85b84f34b775872235 /src
parentf8636b8d7c4d3e1e43ea5e0f7c399316651931c9 (diff)
downloadhercules-7c4b730c6d8a0201512148fcb795c0f666bfe8c8.tar.gz
hercules-7c4b730c6d8a0201512148fcb795c0f666bfe8c8.tar.bz2
hercules-7c4b730c6d8a0201512148fcb795c0f666bfe8c8.tar.xz
hercules-7c4b730c6d8a0201512148fcb795c0f666bfe8c8.zip
- NPC_AGIUP now boosts flee by 100% and duration is 5+5*lv secs, as stated on the Ragnarok Bible.
- Fixed Soul Breaker's misc part not ignoring flee. - Fixed misc attack's flee check being backwards (the less hit%, the more chance you had to connect) - Corrected the range check in vending.c (TRADE_DISTANCE -> AREA_SIZE) - Added define DEFAULT_ENEMY_TYPE in mob.c to simplify the enemy bl check (for easier reading/customization) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9922 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r--src/map/battle.c3
-rw-r--r--src/map/mob.c11
-rw-r--r--src/map/skill.c2
-rw-r--r--src/map/status.c2
-rw-r--r--src/map/vending.c2
5 files changed, 12 insertions, 8 deletions
diff --git a/src/map/battle.c b/src/map/battle.c
index 5060dfe28..1fe5004f3 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -2571,6 +2571,7 @@ struct Damage battle_calc_misc_attack(
break ;
case ASC_BREAKER:
md.damage = 500+rand()%500 + 5*skill_lv * sstatus->int_;
+ nk|=NK_IGNORE_FLEE; //Only Breaker's Misc part always hits.
break;
}
@@ -2609,7 +2610,7 @@ struct Damage battle_calc_misc_attack(
else if (hitrate < battle_config.min_hitrate)
hitrate = battle_config.min_hitrate;
- if(rand()%100 >= hitrate)
+ if(rand()%100 < hitrate)
i = 1;
}
if (!i) {
diff --git a/src/map/mob.c b/src/map/mob.c
index ddc26254d..da4696620 100644
--- a/src/map/mob.c
+++ b/src/map/mob.c
@@ -46,6 +46,9 @@
#define RUDE_ATTACKED_COUNT 2 //After how many rude-attacks should the skill be used?
+//Used to determine default enemy type of mobs (for use in eachinrange calls)
+#define DEFAULT_ENEMY_TYPE(md) (md->special_state.ai?BL_CHAR:BL_PC|BL_HOM)
+
//Dynamic mob database, allows saving of memory when there's big gaps in the mob_db [Skotlex]
struct mob_db *mob_db_data[MAX_MOB_DB+1];
struct mob_db *mob_dummy = NULL; //Dummy mob to be returned when a non-existant one is requested.
@@ -1199,13 +1202,13 @@ static int mob_ai_sub_hard(struct block_list *bl,va_list ap)
if ((!tbl && mode&MD_AGGRESSIVE) || md->state.skillstate == MSS_FOLLOW)
{
map_foreachinrange (mob_ai_sub_hard_activesearch, &md->bl,
- view_range, md->special_state.ai?BL_CHAR:BL_PC|BL_HOM, md, &tbl);
+ view_range, DEFAULT_ENEMY_TYPE(md), md, &tbl);
} else
if (mode&MD_CHANGECHASE && (md->state.skillstate == MSS_RUSH || md->state.skillstate == MSS_FOLLOW))
{
search_size = view_range<md->status.rhw.range ? view_range:md->status.rhw.range;
map_foreachinrange (mob_ai_sub_hard_changechase, &md->bl,
- search_size, (md->special_state.ai?BL_CHAR:BL_PC|BL_HOM), md, &tbl);
+ search_size, DEFAULT_ENEMY_TYPE(md), md, &tbl);
}
if (!tbl) { //No targets available.
@@ -2779,7 +2782,7 @@ int mobskill_use(struct mob_data *md, unsigned int tick, int event)
if (ms[i].target <= MST_AROUND) {
switch (ms[i].target) {
case MST_RANDOM: //Pick a random enemy within skill range.
- bl = battle_getenemy(&md->bl, md->special_state.ai?BL_CHAR:BL_PC|BL_HOM,
+ bl = battle_getenemy(&md->bl, DEFAULT_ENEMY_TYPE(md),
skill_get_range2(&md->bl, ms[i].skill_id, ms[i].skill_lv));
break;
case MST_TARGET:
@@ -2831,7 +2834,7 @@ int mobskill_use(struct mob_data *md, unsigned int tick, int event)
struct block_list *bl;
switch (ms[i].target) {
case MST_RANDOM: //Pick a random enemy within skill range.
- bl = battle_getenemy(&md->bl, md->special_state.ai?BL_CHAR:BL_PC|BL_HOM,
+ bl = battle_getenemy(&md->bl, DEFAULT_ENEMY_TYPE(md),
skill_get_range2(&md->bl, ms[i].skill_id, ms[i].skill_lv));
break;
case MST_TARGET:
diff --git a/src/map/skill.c b/src/map/skill.c
index ac1187126..a1e7a3e01 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -4923,7 +4923,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
case NPC_AGIUP:
sc_start(bl,SC_SPEEDUP1,100,skilllv,skill_get_time(skillid, skilllv));
clif_skill_nodamage(src,bl,skillid,skilllv,
- sc_start(bl,type,100,40*skilllv,skill_get_time(skillid, skilllv)));
+ sc_start(bl,type,100,100,skill_get_time(skillid, skilllv)));
break;
case NPC_INVISIBLE:
diff --git a/src/map/status.c b/src/map/status.c
index 5beaf06f2..dfa0ab424 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -280,7 +280,7 @@ void initChangeTables(void) {
set_sc(NPC_BREAKARMOR, SC_BROKENARMOR, SI_BROKENARMOR, SCB_NONE);
add_sc(NPC_CHANGEUNDEAD, SC_ELEMENTALCHANGE);
set_sc(NPC_POWERUP, SC_INCDEXRATE, SI_BLANK, SCB_DEX);
- set_sc(NPC_AGIUP, SC_INCAGIRATE, SI_BLANK, SCB_AGI);
+ set_sc(NPC_AGIUP, SC_INCFLEERATE, SI_BLANK, SCB_AGI);
add_sc(NPC_INVISIBLE, SC_CLOAKING);
set_sc(LK_AURABLADE, SC_AURABLADE, SI_AURABLADE, SCB_NONE);
set_sc(LK_PARRYING, SC_PARRYING, SI_PARRYING, SCB_NONE);
diff --git a/src/map/vending.c b/src/map/vending.c
index f5d46e25d..c12948de0 100644
--- a/src/map/vending.c
+++ b/src/map/vending.c
@@ -70,7 +70,7 @@ void vending_purchasereq(struct map_session_data *sd,int len,int id,unsigned cha
return;
if (vsd->vender_id == sd->bl.id)
return;
- if (sd->bl.m != vsd->bl.m || !check_distance_bl(&sd->bl, &vsd->bl, TRADE_DISTANCE)
+ if (sd->bl.m != vsd->bl.m || !check_distance_bl(&sd->bl, &vsd->bl, AREA_SIZE)
) {
clif_buyvending(sd, 0, 32767, 4); // too far [Lupus]
//probably... we should add either a hack log / or a proper message. But normal player won't see ie anyway