How could I be adding ZONE_NOPVP in these two codes too?
basically work the same thing with two zones ZONE_PVP and ZONE_NOPVP
Code 1
Code 2
basically work the same thing with two zones ZONE_PVP and ZONE_NOPVP
Code 1
C++:
bool Player::dropCorpse(Creature* lastHitCreature, Creature* mostDamageCreature, bool lastHitUnjustified, bool mostDamageUnjustified)
{
if (getZone() != ZONE_PVP || !Player::lastHitIsPlayer(lastHitCreature)) {
return Creature::dropCorpse(lastHitCreature, mostDamageCreature, lastHitUnjustified, mostDamageUnjustified);
}
setDropLoot(true);
return false;
}
Code 2
C++:
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->setLossSkill(false);
}