summaryrefslogtreecommitdiff
path: root/src/map/mob.c
diff options
context:
space:
mode:
authorLance <Lance@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-03-16 15:39:49 +0000
committerLance <Lance@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-03-16 15:39:49 +0000
commitd5155d42388cf3540fdf415512c2bfad0c8d5f8e (patch)
treeb7072b6cbe41a2520075d5d8761a6deed4b39d6b /src/map/mob.c
parent31e195ae1d7b165be2f2a404ece5d90f1d6a4785 (diff)
downloadhercules-d5155d42388cf3540fdf415512c2bfad0c8d5f8e.tar.gz
hercules-d5155d42388cf3540fdf415512c2bfad0c8d5f8e.tar.bz2
hercules-d5155d42388cf3540fdf415512c2bfad0c8d5f8e.tar.xz
hercules-d5155d42388cf3540fdf415512c2bfad0c8d5f8e.zip
* BL_PC and BL_MOB control script commands (experimental).
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5627 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/mob.c')
-rw-r--r--src/map/mob.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/map/mob.c b/src/map/mob.c
index b469ab12e..e239ce836 100644
--- a/src/map/mob.c
+++ b/src/map/mob.c
@@ -2281,15 +2281,27 @@ int mob_damage(struct block_list *src,struct mob_data *md,int damage,int type)
int drop_rate;
int base_drop_delay;
int race;
+ char buffer[64];
nullpo_retr(0, md); //srcはNULLで呼ばれる場合もあるので、他でチェック
max_hp = status_get_max_hp(&md->bl);
race = status_get_race(&md->bl);
- if(src && src->type == BL_PC) {
- sd = (struct map_session_data *)src;
- mvp_sd = sd;
+ if(src){
+ if(md->nd){
+ sprintf(buffer, "$@%d_attacker", md->bl.id);
+ set_var(NULL, buffer, src->id);
+ sprintf(buffer, "$@%d_attacktype", md->bl.id);
+ set_var(NULL, buffer, src->type);
+ sprintf(buffer, "%s::OnDamage", md->nd->exname);
+ npc_event_do(buffer);
+ return 0;
+ }
+ if(src->type == BL_PC) {
+ sd = (struct map_session_data *)src;
+ mvp_sd = sd;
+ }
}
if(md->bl.prev==NULL){