Implemented event type "EVENT_ENVIRONMENTAL_DAMAGE"

- This event triggers when taking any sort of environmental damage. Example use:
	sub EVENT_ENVIRONMENTAL_DAMAGE{
		quest::debug("EVENT_ENVIRONMENTAL_DAMAGE");
		quest::debug("env_damage is " . $env_damage);
		quest::debug("env_damage_type is " . $env_damage_type);
		quest::debug("env_final_damage is " . $env_final_damage);
	}
	Result: (Test falling in Velks): http://i.imgur.com/tPRL7yL.png
This commit is contained in:
Akkadius 2015-01-30 23:01:31 -06:00
parent 62197d7d33
commit 8229a578ee
4 changed files with 26 additions and 0 deletions

View File

@ -1,5 +1,16 @@
EQEMu Changelog (Started on Sept 24, 2003 15:50)
-------------------------------------------------------
== 01/30/2015 ==
Akkadius: Implemented event type "EVENT_ENVIRONMENTAL_DAMAGE"
- This event triggers when taking any sort of environmental damage. Example use:
sub EVENT_ENVIRONMENTAL_DAMAGE{
quest::debug("EVENT_ENVIRONMENTAL_DAMAGE");
quest::debug("env_damage is " . $env_damage);
quest::debug("env_damage_type is " . $env_damage_type);
quest::debug("env_final_damage is " . $env_final_damage);
}
Result: (Test falling in Velks): http://i.imgur.com/tPRL7yL.png
== 01/29/2015 ==
Trevius: Added more information to Mercenary Logging.
Trevius: Added potential fix for Mercenaries that fail to unsuspend.

View File

@ -5541,6 +5541,12 @@ void Client::Handle_OP_EnvDamage(const EQApplicationPacket *app)
}
else{
SetHP(GetHP() - (damage * RuleR(Character, EnvironmentDamageMulipliter)));
/* EVENT_ENVIRONMENTAL_DAMAGE */
int final_damage = (damage * RuleR(Character, EnvironmentDamageMulipliter));
char buf[24];
snprintf(buf, 23, "%u %u %i", ed->damage, ed->dmgtype, final_damage);
parse->EventPlayer(EVENT_ENVIRONMENTAL_DAMAGE, this, buf, 0);
}
if (GetHP() <= 0) {

View File

@ -65,6 +65,7 @@ const char *QuestEventSubroutines[_LargestEventID] = {
"EVENT_AGGRO_SAY",
"EVENT_PLAYER_PICKUP",
"EVENT_POPUPRESPONSE",
"EVENT_ENVIRONMENTAL_DAMAGE",
"EVENT_PROXIMITY_SAY",
"EVENT_CAST",
"EVENT_CAST_BEGIN",
@ -1290,6 +1291,13 @@ void PerlembParser::ExportEventVariables(std::string &package_name, QuestEventID
ExportVar(package_name.c_str(), "popupid", data);
break;
}
case EVENT_ENVIRONMENTAL_DAMAGE:{
Seperator sep(data);
ExportVar(package_name.c_str(), "env_damage", sep.arg[0]);
ExportVar(package_name.c_str(), "env_damage_type", sep.arg[1]);
ExportVar(package_name.c_str(), "env_final_damage", sep.arg[2]);
break;
}
case EVENT_PROXIMITY_SAY: {
ExportVar(package_name.c_str(), "data", objid);

View File

@ -33,6 +33,7 @@ typedef enum {
EVENT_AGGRO_SAY,
EVENT_PLAYER_PICKUP,
EVENT_POPUP_RESPONSE,
EVENT_ENVIRONMENTAL_DAMAGE,
EVENT_PROXIMITY_SAY,
EVENT_CAST,
EVENT_CAST_BEGIN,