|
|
@ -7,7 +7,14 @@ trigger_name = path.basename(path.abspath(__file__))[:-3] |
|
|
|
|
|
|
|
def main_function(origin_module, module, regex_result): |
|
|
|
player_name = regex_result.group("player_name") |
|
|
|
valid_reasons_for_dying = [ |
|
|
|
'died', 'killed by \'{}\''.format(player_name) |
|
|
|
] |
|
|
|
command = regex_result.group("command") |
|
|
|
if command not in valid_reasons_for_dying: |
|
|
|
return |
|
|
|
|
|
|
|
is_suicide = True if command == 'killed by \'{}\''.format(player_name) else False |
|
|
|
|
|
|
|
active_dataset = chrani_bot.module_dom.get_active_dataset_identifier() |
|
|
|
all_players_dict = ( |
|
|
@ -28,17 +35,23 @@ def main_function(origin_module, module, regex_result): |
|
|
|
if steamid is None: |
|
|
|
return |
|
|
|
|
|
|
|
if command == 'died': |
|
|
|
if command in valid_reasons_for_dying: |
|
|
|
event_data = ['edit_location', { |
|
|
|
'coordinates': { |
|
|
|
"x": player_dict["pos"]["x"], |
|
|
|
"y": player_dict["pos"]["y"], |
|
|
|
"z": player_dict["pos"]["z"] |
|
|
|
}, |
|
|
|
'location_teleport_entry': { |
|
|
|
"x": player_dict["pos"]["x"], |
|
|
|
"y": player_dict["pos"]["y"], |
|
|
|
"z": player_dict["pos"]["z"] |
|
|
|
}, |
|
|
|
'location_name': "Place of Death", |
|
|
|
'action': 'edit', |
|
|
|
'location_enabled': True, |
|
|
|
'last_changed': servertime_player_died |
|
|
|
'last_changed': servertime_player_died, |
|
|
|
'was_suicide': is_suicide |
|
|
|
}] |
|
|
|
module.trigger_action_hook(origin_module, event_data=event_data, dispatchers_steamid=steamid) |
|
|
|
|
|
|
|