Lua:
bool Player::onKilledCreature(Creature* target, bool lastHit/* = true*/)
{
bool unjustified = false;
if (hasFlag(PlayerFlag_NotGenerateLoot)) {
target->setDropLoot(false);
}
Creature::onKilledCreature(target, lastHit);
if (Player* targetPlayer = target->getPlayer()) {
if (targetPlayer && targetPlayer->getZone() == ZONE_PVP) {
targetPlayer->setDropLoot(false);
targetPlayer->setSkillLoss(true);
} else if (!hasFlag(PlayerFlag_NotGainInFight) && !isPartner(targetPlayer)) {
bool canGainUnjust = hasAttacked(targetPlayer);
if (!canGainUnjust && g_game.getWorldType() == WORLD_TYPE_RETRO_PVP) {
canGainUnjust = lastHit;
}
if (!Combat::isInPvpZone(this, targetPlayer) && canGainUnjust && !targetPlayer->hasAttacked(this) && !isGuildMate(targetPlayer) && targetPlayer != this) {
if (targetPlayer->hasKilled(this) && hasAttacked(targetPlayer)) {
for (auto& kill : targetPlayer->unjustifiedKills) {
if (kill.target == getGUID() && kill.unavenged) {
auto it = attackedSet.find(targetPlayer->guid);
if (it != attackedSet.end()) {
kill.unavenged = false;
attackedSet.erase(it);
break;
}
}
}
} else 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), 0);
addCondition(condition);
}
}
}
}
return unjustified;
}
I have a problem when I kill the player who is in a pvp zone he is taking a teleport to the temple without dropping his exp. when I activate to drop your xp everything works normal but the player is not sent to the temple