Loading...   


sub PlayerDeathProcess {
	my $TextColor = 335;
	my $client = plugin::val('client');
	my $entity_list = plugin::val('entity_list');
	my $name = plugin::val('name');
	my $killer_id = plugin::val('killer_id');
	my $killer_damage = plugin::val('killer_damage');
	my $killer_skill = plugin::val('killer_skill');
	my $killer_spell = plugin::val('killer_spell');
	my $timestamp = localtime(time);
	if($killer_spell == 65535) {
		quest::write("Custom Logs/Player Deaths/" . $name . " (Account ID " . $client->AccountID() . ").txt", "[$timestamp]: $name was killed by " . $entity_list->GetMobByID($killer_id)->GetCleanName() . "  with a " . plugin::commify($killer_damage) . " hit using the skill $killer_skill.");
	}
	else {
		quest::write("Custom Logs/Player Deaths/" . $name . " (Account ID " . $client->AccountID() . ").txt", "[$timestamp]: $name was killed by " . $entity_list->GetMobByID($killer_id)->GetCleanName() . "  with a " . plugin::commify($killer_damage) . " hit used the spell $killer_spell.");
	}
}

sub NPCDeathProcess {
	my $TextColor = 335;
	my $npc = plugin::val('npc');
	my $entity_list = plugin::val('entity_list');
	my $killer_id = plugin::val('killer_id');
	my $killer_damage = plugin::val('killer_damage');
	my $killer_skill = plugin::val('killer_skill');
	my $killer_spell = plugin::val('killer_spell');
	my $timestamp = localtime(time);
	my $mlevel = plugin::val('mlevel');
	my $levelReward = int($mlevel / ($mlevel / 2));
	if($entity_list->GetMobByID($killer_id)->IsClient()) {
		plugin::SetCreditBalance($entity_list->GetClientByID($killer_id), "player_credits", $levelReward);
		$entity_list->GetClientByID($killer_id)->Message(315, "You have earned $levelReward Player Credits for killing this NPC.");
	}
	if($killer_spell == 65535) {
		quest::write("Custom Logs/NPC Deaths/" . $npc->GetCleanName()  . " (NPC Type ID " . $npc->GetNPCTypeID() . ").txt", "[$timestamp]: " . $npc->GetCleanName() . " was killed by " . $entity_list->GetMobByID($killer_id)->GetCleanName() . " with a " . plugin::commify($killer_damage) . " hit using the skill $killer_skill.");
	}
	else {
		quest::write("Custom Logs/NPC Deaths/" . $npc->GetCleanName()  . " (NPC Type ID " . $npc->GetNPCTypeID() . ").txt", "[$timestamp]: " . $npc->GetCleanName() . " was killed by " . $entity_list->GetMobByID($killer_id)->GetCleanName() . " with a " . plugin::commify($killer_damage) . " hit using the spell $killer_spell.");
	}
}

return 1;

Raw Paste Data