summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-04-12 15:19:49 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-04-12 15:19:49 +0000
commitd3446b8051e0f084721198b85c067597f26c5dfd (patch)
treecf3b13227a8de1a1c7c8b131c6b3bd96e94bdc7f
parent55ba4be17e2abefa0fdaa25c387bf30bdaf49332 (diff)
downloadhercules-d3446b8051e0f084721198b85c067597f26c5dfd.tar.gz
hercules-d3446b8051e0f084721198b85c067597f26c5dfd.tar.bz2
hercules-d3446b8051e0f084721198b85c067597f26c5dfd.tar.xz
hercules-d3446b8051e0f084721198b85c067597f26c5dfd.zip
- Changed the meaning of inf2=0x1000. Now it is used to "disable usage on enemies", which only works for non-aggressive (inf!=1) skills.
- If a skill is party/guild only (inf2 0x400/0x800) it will also be castable on enemies if the skill's inf is 1 (offensive target) - Corrected the mob behaviour when it locks into an enemy it can't chase. Previously it would get stuck on a lock->unlock->lock loop, with each unlock resetting the "random walk" timer, causing the mob to just idle in place. Now they will attempt idle skills and no longer reset the "random walk" timer, so they behave as if they were in Idle state properly. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@10234 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r--Changelog-Trunk.txt9
-rw-r--r--db/Changelog.txt2
-rw-r--r--db/skill_db.txt12
-rw-r--r--src/map/mob.c14
-rw-r--r--src/map/skill.c11
-rw-r--r--src/map/skill.h25
6 files changed, 48 insertions, 25 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt
index 8197c3ef1..d12af705f 100644
--- a/Changelog-Trunk.txt
+++ b/Changelog-Trunk.txt
@@ -4,6 +4,15 @@ AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO
IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
2007/04/13
+ * Changed the meaning of inf2=0x1000. Now it is used to "disable usage on
+ enemies", which only works for non-aggressive (inf!=1) skills.
+ * If a skill is party/guild only (inf2 0x400/0x800) it will also be
+ castable on enemies if the skill's inf is 1 (offensive target)
+ * Corrected the mob behaviour when it locks into an enemy it can't chase.
+ Previously it would get stuck on a lock->unlock->lock loop, with each
+ unlock resetting the "random walk" timer, causing the mob to just idle in
+ place. Now they will attempt idle skills and no longer reset the "random
+ walk" timer, so they behave as if they were in Idle state properly.
* Now the bonus bAtkEle will be transferred directly to the weapon when the
script is in the ammunition, and you are wielding a weapon that consumes
ammo per atttack.
diff --git a/db/Changelog.txt b/db/Changelog.txt
index 93e94557b..7bc68c118 100644
--- a/db/Changelog.txt
+++ b/db/Changelog.txt
@@ -20,6 +20,8 @@
========================
04/13
+ * Corrected the inf2 of some skills considering the changes to the inf2
+ party/guild only and 'allow enemy' meanings. [Skotlex]
* Thanatos, Kiel and Randgris now use Ganbantein [Playtester]
* Added Magmaring mob [Playtester]
04/12
diff --git a/db/skill_db.txt b/db/skill_db.txt
index 868a11d58..ad169ee85 100644
--- a/db/skill_db.txt
+++ b/db/skill_db.txt
@@ -32,9 +32,9 @@
// 0x0080- trap
// 0x0100- skill that damages/targets yourself
// 0x0200- cannot be casted on self (if inf = 4, auto-select target skill)
-// 0x0400- usable only on party-members
-// 0x0800- usable only on guild-mates
-// 0x1000- allow usage on enemies too (use with 0x0400/0x0800)
+// 0x0400- usable only on party-members (and enemies if skill is offensive)
+// 0x0800- usable only on guild-mates (and enemies if skill is offensive)
+// 0x1000- disable usage on enemies (for non-offensive skills).
// 13 maxcount: max amount of skill instances to place on the ground when
// player_land_skill_limit/monster_land_skill_limit is enabled.
// 14 attack type (none, weapon, magic, misc)
@@ -327,7 +327,7 @@
286,2,6,2,1,0x1,0,5,1,yes,0,0,0,magic,0 //SA_DELUGE#Deluge#
287,2,6,2,4,0x1,0,5,1,yes,0,0,0,magic,0 //SA_VIOLENTGALE#Whirlwind#
288,3,6,2,0,0x1,0,5,1,yes,0,0,0,magic,0 //SA_LANDPROTECTOR#Magnetic Earth#
-289,9,6,1,0,0x1,0,5,1,yes,0,0x1E00,0,magic,0 //SA_DISPELL#Dispel#
+289,9,6,1,0,0x1,0,5,1,yes,0,0xE00,0,magic,0 //SA_DISPELL#Dispel#
290,0,6,4,0,0x1,0,10,1,yes,0,0,0,magic,0 //SA_ABRACADABRA#Hocus-pocus#
291,9,6,1,0,0x1,0,1,1,yes,0,0x2,0,magic,0 //SA_MONOCELL#Monocell#
292,9,6,1,0,0x1,0,1,1,yes,0,0x2,0,magic,0 //SA_CLASSCHANGE#Class Change#
@@ -412,7 +412,7 @@
371,-2,8,4,-1,0,0,5,1,no,0,0x200,0,weapon,0 //CH_TIGERFIST#Glacier Fist#
372,-2,8,4,-1,0,0,10,-1:-1:-2:-2:-3:-3:-4:-4:-5:-5,no,0,0x200,0,weapon,0 //CH_CHAINCRUSH#Chain Crush Combo#
373,0,6,4,0,0x1,0,5,1,no,0,0,0,magic,0 //PF_HPCONVERSION#Health Conversion#
-374,9,6,16,0,0x1,0,1,1,yes,0,0x1E00,0,none,0 //PF_SOULCHANGE#Soul Exhale#
+374,9,6,1,0,0x1,0,1,1,yes,0,0xE00,0,none,0 //PF_SOULCHANGE#Soul Exhale#
375,9,6,1,0,0x98,0,5,1,yes,0,0,0,magic,0 //PF_SOULBURN#Soul Siphon#
376,0,0,0,0,0x1,0,5,1,no,0,0,0,weapon,0 //ASC_KATAR#Advanced Katar Mastery#
//377,0,0,4,0,0x1,0,10,1,no,0,0,0,misc,0 //ASC_HALLUCINATION#Hallucination Walk#
@@ -434,7 +434,7 @@
393,0,0,4,0,0x1,0,1,1,yes,0,0,0,none,0 //CR_SYNTHESISPOTION#Potion Synthesis#
394,9,8,1,-1,0,0,10,-9,yes,0,0,0,weapon,0 //CG_ARROWVULCAN#Vulcan Arrow#
395,0,0,4,0,0x1,3,1,1,yes,0,0x40,0,misc,2 //CG_MOONLIT#Sheltering Bliss#
-396,-1,6,16,0,0x1,0,1,1,yes,0,0x600,0,none,0 //CG_MARIONETTE#Marionette Control#
+396,1,6,16,0,0x1,0,1,1,yes,0,0x600,0,none,0 //CG_MARIONETTE#Marionette Control#
397,5,8,1,-1,0x20,0,5,5,no,0,0,0,weapon,0 //LK_SPIRALPIERCE#Spiral Pierce#
398,4,6,1,-1,0,0,5,1,no,0,0,0,weapon,0 //LK_HEADCRUSH#Traumatic Blow#
399,4,6,1,-1,0,0,10,1,no,0,0,0,weapon,0 //LK_JOINTBEAT#Vital Strike#
diff --git a/src/map/mob.c b/src/map/mob.c
index f4e30e51f..43597979e 100644
--- a/src/map/mob.c
+++ b/src/map/mob.c
@@ -1316,8 +1316,18 @@ static int mob_ai_sub_hard(struct block_list *bl,va_list ap)
return 0;
//Follow up if possible.
- if (!mob_can_reach(md, tbl, md->min_chase, MSS_RUSH) ||
- !unit_walktobl(&md->bl, tbl, md->status.rhw.range, 2))
+ if (mob_can_reach(md, tbl, md->min_chase, MSS_RUSH) &&
+ unit_walktobl(&md->bl, tbl, md->status.rhw.range, 2))
+ return 0; //Chasing.
+
+ //Can't chase locked target. Return to IDLE.
+ if(md->state.skillstate == MSS_IDLE ||
+ md->state.skillstate == MSS_WALK)
+ { //Mob is already idle, try a idle skill before giving up.
+ if (!(++md->ud.walk_count%IDLE_SKILL_INTERVAL))
+ mobskill_use(md, tick, -1);
+ md->target_id=0;
+ } else
mob_unlocktarget(md,tick);
return 0;
}
diff --git a/src/map/skill.c b/src/map/skill.c
index d7334a079..b2dfd3abd 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -5676,14 +5676,17 @@ int skill_castend_id (int tid, unsigned int tick, int id, int data)
if(inf&INF_ATTACK_SKILL ||
(inf&INF_SELF_SKILL && inf2&INF2_NO_TARGET_SELF)) //Combo skills
inf = BCT_ENEMY; //Offensive skill.
- else
- inf = 0;
+ else if(inf2&INF2_NO_ENEMY)
+ inf = BCT_NOENEMY;
if(inf2 & (INF2_PARTY_ONLY|INF2_GUILD_ONLY) && src != target)
+ {
inf |=
(inf2&INF2_PARTY_ONLY?BCT_PARTY:0)|
- (inf2&INF2_GUILD_ONLY?BCT_GUILD:0)|
- (inf2&INF2_ALLOW_ENEMY?BCT_ENEMY:0);
+ (inf2&INF2_GUILD_ONLY?BCT_GUILD:0);
+ //Remove neutral targets (but allow enemy if skill is designed to be so)
+ inf &= ~BCT_NEUTRAL;
+ }
if (inf && battle_check_target(src, target, inf) <= 0)
break;
diff --git a/src/map/skill.h b/src/map/skill.h
index 55233f3c3..9d61a8f54 100644
--- a/src/map/skill.h
+++ b/src/map/skill.h
@@ -36,20 +36,19 @@
//Constants to identify a skill's inf2 value.
#define INF2_QUEST_SKILL 1
//NPC skills are those that players can't have in their skill tree.
-#define INF2_NPC_SKILL 2
-#define INF2_WEDDING_SKILL 4
-#define INF2_SPIRIT_SKILL 8
-#define INF2_GUILD_SKILL 16
-#define INF2_SONG_DANCE 32
-#define INF2_ENSEMBLE_SKILL 64
-#define INF2_TRAP 128
+#define INF2_NPC_SKILL 0x2
+#define INF2_WEDDING_SKILL 0x4
+#define INF2_SPIRIT_SKILL 0x8
+#define INF2_GUILD_SKILL 0x10
+#define INF2_SONG_DANCE 0x20
+#define INF2_ENSEMBLE_SKILL 0x40
+#define INF2_TRAP 0x80
//Refers to ground placed skills that will target the caster as well (like Grandcross)
-#define INF2_TARGET_SELF 256
-#define INF2_NO_TARGET_SELF 512
-#define INF2_PARTY_ONLY 1024
-#define INF2_GUILD_ONLY 2048
-//For Party/Guild only skills that can ALSO be used on enemies.
-#define INF2_ALLOW_ENEMY 4096
+#define INF2_TARGET_SELF 0x100
+#define INF2_NO_TARGET_SELF 0x200
+#define INF2_PARTY_ONLY 0x400
+#define INF2_GUILD_ONLY 0x800
+#define INF2_NO_ENEMY 0x1000
//Walk intervals at which chase-skills are attempted to be triggered.
#define WALK_SKILL_INTERVAL 5