summaryrefslogtreecommitdiff
path: root/src/map/mob.cpp
diff options
context:
space:
mode:
authormekolat <mekolat@users.noreply.github.com>2016-04-19 09:41:31 -0400
committermekolat <mekolat@users.noreply.github.com>2016-04-19 09:41:31 -0400
commit1ba24673e7064e39406e6faf11d790c2dcc2ac00 (patch)
tree7e2645f6fdec1dcc63ae56366371246f62865dcd /src/map/mob.cpp
parentc3e06ffe6437d27a2a7c6ddb2dc487ff2f007adf (diff)
parentc786a93e91adaf68780a5fd7585f51d0528f92ed (diff)
downloadtmwa-1ba24673e7064e39406e6faf11d790c2dcc2ac00.tar.gz
tmwa-1ba24673e7064e39406e6faf11d790c2dcc2ac00.tar.bz2
tmwa-1ba24673e7064e39406e6faf11d790c2dcc2ac00.tar.xz
tmwa-1ba24673e7064e39406e6faf11d790c2dcc2ac00.zip
Merge self-fork from mekolat/magic-v3
Magic v3
Diffstat (limited to 'src/map/mob.cpp')
-rw-r--r--src/map/mob.cpp23
1 files changed, 21 insertions, 2 deletions
diff --git a/src/map/mob.cpp b/src/map/mob.cpp
index 7566e03..0da946a 100644
--- a/src/map/mob.cpp
+++ b/src/map/mob.cpp
@@ -1396,6 +1396,16 @@ int mob_target(dumb_ptr<mob_data> md, dumb_ptr<block_list> bl, int dist)
return 0;
}
+int mob_aggravate(dumb_ptr<mob_data> md, dumb_ptr<block_list> bl)
+{
+ if (md->bl_type != BL::MOB)
+ return 0;
+ mob_target(md, bl, battle_get_range(bl));
+ md->target_id = bl->bl_id;
+ md->attacked_id = bl->bl_id;
+ return 1;
+}
+
/*==========================================
* The ?? routine of an active monster
*------------------------------------------
@@ -2691,7 +2701,6 @@ int mob_damage(dumb_ptr<block_list> src, dumb_ptr<mob_data> md, int damage,
} // [MouseJstr]
// SCRIPT実行
- if (md->npc_event)
{
if (sd == nullptr)
{
@@ -2701,7 +2710,17 @@ int mob_damage(dumb_ptr<block_list> src, dumb_ptr<mob_data> md, int damage,
}
}
if (sd)
- npc_event(sd, md->npc_event, 0);
+ {
+ if (md->npc_event)
+ npc_event(sd, md->npc_event, 0);
+
+ // TODO: in the future, OnPCKillEvent, OnMobKillEvent and OnPCDieEvent should be combined
+ argrec_t arg[1] =
+ {
+ {"@mobID"_s, static_cast<int32_t>(unwrap<Species>(md->mob_class))},
+ };
+ npc_event_doall_l(stringish<ScriptLabel>("OnMobKillEvent"_s), sd->bl_id, arg);
+ }
}
clif_clearchar(md, BeingRemoveWhy::DEAD);