Hello, could someone help me change this script or something else so that everyone who attacked a player who death gets a kill, and not as it is currently that the player who dealt damage last gets the kill.
I am using tfs 1.5.
I am using tfs 1.5.
C++:
bool Player::onKilledCreature(Creature* target, bool lastHit/* = true*/)
{
bool unjustified = false;
if (hasFlag(PlayerFlag_NotGenerateLoot)) {
target->setDropLoot(false);
}
Creature::onKilledCreature(target, lastHit);
Player* targetPlayer = target->getPlayer();
if (!targetPlayer) {
return false;
}
if (targetPlayer->getZone() == ZONE_PVP) {
targetPlayer->setDropLoot(false);
targetPlayer->setSkillLoss(false);
} else if (!hasFlag(PlayerFlag_NotGainInFight) && !isPartner(targetPlayer)) {
if (!Combat::isInPvpZone(this, targetPlayer) && hasAttacked(targetPlayer) && !targetPlayer->hasAttacked(this) && !isGuildMate(targetPlayer) && targetPlayer != this) {
if (targetPlayer->getSkull() == SKULL_NONE && !isInWar(targetPlayer)) {
unjustified = true;
addUnjustifiedDead(targetPlayer);
}
if (lastHit && hasCondition(CONDITION_INFIGHT)) {
pzLocked = true;
Condition* condition = Condition::createCondition(CONDITIONID_DEFAULT, CONDITION_INFIGHT, g_config.getNumber(ConfigManager::WHITE_SKULL_TIME) * 1000, 0);
addCondition(condition);
}
}
}
return unjustified;
}