event_death_complete

This commit is contained in:
KimLS 2013-06-27 15:07:28 -07:00
parent 945cc2117f
commit f46f7bd528
5 changed files with 23 additions and 3 deletions

View File

@ -1697,6 +1697,7 @@ bool Client::Death(Mob* killerMob, int32 damage, uint16 spell, SkillType attack_
GoToDeath();
}
parse->EventPlayer(EVENT_DEATH_COMPLETE, this, buffer, 0);
return true;
}
@ -2037,6 +2038,16 @@ bool NPC::Death(Mob* killerMob, int32 damage, uint16 spell, SkillType attack_ski
entity_list.MessageClose_StringID(this, false, 100, MT_NonMelee, HIT_NON_MELEE,
killerMob->GetCleanName(), GetCleanName(), ConvertArray(damage, val1));
}
} else {
char buffer[32] = { 0 };
snprintf(buffer, 31, "%d %d %d", damage, spell, static_cast<int>(attack_skill));
if(parse->EventNPC(EVENT_DEATH, this, nullptr, buffer, 0) != 0)
{
if(GetHP() < 0) {
SetHP(0);
}
return false;
}
}
if (IsEngaged())
@ -2371,6 +2382,9 @@ bool NPC::Death(Mob* killerMob, int32 damage, uint16 spell, SkillType attack_ski
entity_list.UpdateFindableNPCState(this, true);
char buffer[32] = { 0 };
snprintf(buffer, 31, "%d %d %d", damage, spell, static_cast<int>(attack_skill));
parse->EventNPC(EVENT_DEATH_COMPLETE, this, oos, buffer, 0);
return true;
}

View File

@ -110,7 +110,8 @@ const char *QuestEventSubroutines[_LargestEventID] = {
"EVENT_AUGMENT_REMOVE",
"EVENT_ENTER_AREA",
"EVENT_LEAVE_AREA",
"EVENT_RESPAWN"
"EVENT_RESPAWN",
"EVENT_DEATH_COMPLETE"
};
PerlembParser::PerlembParser() : perl(nullptr), event_queue_in_use_(false) {

View File

@ -79,6 +79,7 @@ typedef enum {
EVENT_ENTER_AREA,
EVENT_LEAVE_AREA,
EVENT_RESPAWN,
EVENT_DEATH_COMPLETE,
_LargestEventID
} QuestEventID;

View File

@ -1195,7 +1195,8 @@ luabind::scope lua_register_events() {
luabind::value("augment_insert", static_cast<int>(EVENT_AUGMENT_INSERT)),
luabind::value("augment_remove", static_cast<int>(EVENT_AUGMENT_REMOVE)),
luabind::value("enter_area", static_cast<int>(EVENT_ENTER_AREA)),
luabind::value("leave_area", static_cast<int>(EVENT_LEAVE_AREA))
luabind::value("leave_area", static_cast<int>(EVENT_LEAVE_AREA)),
luabind::value("death_complete", static_cast<int>(EVENT_DEATH_COMPLETE))
];
}

View File

@ -111,7 +111,8 @@ const char *LuaEvents[_LargestEventID] = {
"event_augment_remove",
"event_enter_area",
"event_leave_area",
"event_respawn"
"event_respawn",
"event_death_complete"
};
extern Zone *zone;
@ -152,6 +153,7 @@ LuaParser::LuaParser() {
NPCArgumentDispatch[EVENT_SIGNAL] = handle_npc_signal;
NPCArgumentDispatch[EVENT_TIMER] = handle_npc_timer;
NPCArgumentDispatch[EVENT_DEATH] = handle_npc_death;
NPCArgumentDispatch[EVENT_DEATH_COMPLETE] = handle_npc_death;
NPCArgumentDispatch[EVENT_CAST] = handle_npc_cast;
NPCArgumentDispatch[EVENT_CAST_BEGIN] = handle_npc_cast;
NPCArgumentDispatch[EVENT_FEIGN_DEATH] = handle_npc_single_client;
@ -160,6 +162,7 @@ LuaParser::LuaParser() {
PlayerArgumentDispatch[EVENT_SAY] = handle_player_say;
PlayerArgumentDispatch[EVENT_DEATH] = handle_player_death;
PlayerArgumentDispatch[EVENT_DEATH_COMPLETE] = handle_player_death;
PlayerArgumentDispatch[EVENT_TIMER] = handle_player_timer;
PlayerArgumentDispatch[EVENT_DISCOVER_ITEM] = handle_player_discover_item;
PlayerArgumentDispatch[EVENT_FISH_SUCCESS] = handle_player_fish_forage_success;