summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
authorMadCamel <madcamel@gmail.com>2010-10-10 05:20:28 -0400
committerMadCamel <madcamel@gmail.com>2010-10-10 05:20:28 -0400
commit31c0e0663052977cece542a44fd89cc721461ad7 (patch)
tree8dde6753286e92721c8b051882546403e6526db8 /src/map
parent7bfe4fe66e6549f309e0f6f0b04856aa84aebb6d (diff)
parent1a6e929124104a93175b36185d2eb66b1f285279 (diff)
downloadtmwa-31c0e0663052977cece542a44fd89cc721461ad7.tar.gz
tmwa-31c0e0663052977cece542a44fd89cc721461ad7.tar.bz2
tmwa-31c0e0663052977cece542a44fd89cc721461ad7.tar.xz
tmwa-31c0e0663052977cece542a44fd89cc721461ad7.zip
Merge branch 'master' of git://gitorious.org/tmw-eathena/mainline
Diffstat (limited to 'src/map')
-rw-r--r--src/map/mob.c35
-rw-r--r--src/map/mob.h21
2 files changed, 39 insertions, 17 deletions
diff --git a/src/map/mob.c b/src/map/mob.c
index d8e6ef8..de691c1 100644
--- a/src/map/mob.c
+++ b/src/map/mob.c
@@ -4289,13 +4289,23 @@ int mobskill_use (struct mob_data *md, unsigned int tick, int event)
int x = 0, y = 0;
if (ms[i].target <= MST_AROUND)
{
- bl = ((ms[i].target == MST_TARGET
- || ms[i].target ==
- MST_AROUND5) ? map_id2bl (md->
- target_id)
- : (ms[i].target ==
- MST_FRIEND) ? &fmd->bl : &md->bl);
- if (bl != NULL)
+ if (ms[i].target == MST_MASTER)
+ {
+ bl = &md->bl;
+ if (md->master_id)
+ bl = map_id2bl (md->master_id);
+ }
+ else
+ {
+ bl = ((ms[i].target == MST_TARGET
+ || ms[i].target ==
+ MST_AROUND5) ? map_id2bl (md->
+ target_id)
+ : (ms[i].target ==
+ MST_FRIEND) ? &fmd->bl : &md->bl);
+ }
+
+ if (bl)
{
x = bl->x;
y = bl->y;
@@ -4349,6 +4359,15 @@ int mobskill_use (struct mob_data *md, unsigned int tick, int event)
}
else
{
+ if (ms[i].target == MST_MASTER)
+ {
+ struct block_list *bl = &md->bl;
+ if (md->master_id)
+ bl = map_id2bl (md->master_id);
+
+ if (bl && !mobskill_use_id (md, bl, i))
+ return 0;
+ }
// IDŽw’è
if (ms[i].target <= MST_FRIEND)
{
@@ -4904,6 +4923,8 @@ static int mob_readskilldb (void)
{
"friend", MST_FRIEND},
{
+ "master", MST_MASTER},
+ {
"around5", MST_AROUND5},
{
"around6", MST_AROUND6},
diff --git a/src/map/mob.h b/src/map/mob.h
index 7351f2e..ec0352e 100644
--- a/src/map/mob.h
+++ b/src/map/mob.h
@@ -51,16 +51,17 @@ extern struct mob_db mob_db[];
enum
{
MST_TARGET = 0,
- MST_SELF = 1,
- MST_FRIEND = 2,
- MST_AROUND5 = 3,
- MST_AROUND6 = 4,
- MST_AROUND7 = 5,
- MST_AROUND8 = 6,
- MST_AROUND1 = 7,
- MST_AROUND2 = 8,
- MST_AROUND3 = 9,
- MST_AROUND4 = 10,
+ MST_SELF,
+ MST_FRIEND,
+ MST_MASTER,
+ MST_AROUND5,
+ MST_AROUND6,
+ MST_AROUND7,
+ MST_AROUND8,
+ MST_AROUND1,
+ MST_AROUND2,
+ MST_AROUND3,
+ MST_AROUND4,
MST_AROUND = MST_AROUND4,
MSC_ALWAYS = 0x0000,