summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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,