summaryrefslogtreecommitdiff
path: root/src/map/mob.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-10-20 14:30:28 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-10-20 14:30:28 +0000
commitaea859ec676e23f32f7dee151b2db91c92680afd (patch)
tree513e3972de57acb6c7ac91463618ae7118fa0d71 /src/map/mob.c
parent5173b7e5d42654313a52c8980f84cf424417bd50 (diff)
downloadhercules-aea859ec676e23f32f7dee151b2db91c92680afd.tar.gz
hercules-aea859ec676e23f32f7dee151b2db91c92680afd.tar.bz2
hercules-aea859ec676e23f32f7dee151b2db91c92680afd.tar.xz
hercules-aea859ec676e23f32f7dee151b2db91c92680afd.zip
- Added config setting "summon_flora_setting", which it you can decide now two things: a. Whether or not players can harm your floras outside versus grounds, and b. Whether or not you can summon out and mix different types of plants at the same time.
- Likely fixed pc_steal_item always failing to steal (it was attempting to steal random item IDs...) - Cleaned up a bit the mob on-death event so that when the killer is a homunculus, it's master will be taken. Also, the variable killerrid will be set before running the script to specify who delivered the final blow. If the killerrid matches with the script attached player, you can be sure your player did the final blow to the mob, otherwise, the attached player is who did the most damage to the mob. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9026 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/mob.c')
-rw-r--r--src/map/mob.c23
1 files changed, 16 insertions, 7 deletions
diff --git a/src/map/mob.c b/src/map/mob.c
index fa0d0f135..e8d2a5b81 100644
--- a/src/map/mob.c
+++ b/src/map/mob.c
@@ -2134,17 +2134,26 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type)
mob_script_callback(md, src, CALLBACK_DEAD);
else if(md->npc_event[0]){
md->status.hp = 0; //So that npc_event invoked functions KNOW that I am dead.
- if(src && src->type == BL_PET)
- sd = ((struct pet_data *)src)->msd;
- if(sd && battle_config.mob_npc_event_type)
+ if(src)
+ switch (src->type) {
+ case BL_PET:
+ sd = ((TBL_PET*)src)->msd;
+ break;
+ case BL_HOM:
+ sd = ((TBL_HOM*)src)->master;
+ break;
+ }
+ if(sd && battle_config.mob_npc_event_type) {
+ pc_setglobalreg(sd,"killerrid",sd->bl.id);
npc_event(sd,md->npc_event,0);
- else if(mvp_sd)
+ } else if(mvp_sd) {
+ pc_setglobalreg(mvp_sd,"killerrid",sd?sd->bl.id:0);
npc_event(mvp_sd,md->npc_event,0);
+ }
md->status.hp = 1;
- } else if (mvp_sd) { //lordalfa
+ } else if (mvp_sd && mvp_sd->state.event_kill_mob) { //lordalfa
pc_setglobalreg(mvp_sd,"killedrid",md->class_);
- if(mvp_sd->state.event_kill_mob)
- npc_script_event(mvp_sd, NPCE_KILLNPC); // PCKillNPC [Lance]
+ npc_script_event(mvp_sd, NPCE_KILLNPC); // PCKillNPC [Lance]
}
if(md->deletetimer!=-1) {