mirror of
https://github.com/ErikasKontenis/SabrehavenServer.git
synced 2025-04-30 17:49:20 +02:00
introduce CORPSE_OWNER_ENABLED config option
This commit is contained in:
parent
bf80fa8919
commit
32e076647c
@ -5,6 +5,7 @@ paladinRangeAttackDamageIncreasePercent = 15
|
||||
-- Min/Max rate spawn is a multiplication of the map spawntime in spawns.xml Regular monster spawn time is 600. The formula would be randomValue = random(600*100, 600*200) which varies between 60s and 120s
|
||||
minRateSpawn = 100
|
||||
maxRateSpawn = 200
|
||||
corpseOwnerEnabled = false
|
||||
|
||||
-- Combat settings
|
||||
-- NOTE: valid values for worldType are: "pvp", "no-pvp" and "pvp-enforced"
|
||||
|
@ -277,9 +277,11 @@ ReturnValue Actions::internalUseItem(Player* player, const Position& pos, uint8_
|
||||
openContainer = container;
|
||||
}
|
||||
|
||||
uint32_t corpseOwner = container->getCorpseOwner();
|
||||
if (corpseOwner != 0 && !player->canOpenCorpse(corpseOwner)) {
|
||||
return RETURNVALUE_YOUARENOTTHEOWNER;
|
||||
if (g_config.getBoolean(ConfigManager::CORPSE_OWNER_ENABLED)) {
|
||||
uint32_t corpseOwner = container->getCorpseOwner();
|
||||
if (corpseOwner != 0 && !player->canOpenCorpse(corpseOwner)) {
|
||||
return RETURNVALUE_YOUARENOTTHEOWNER;
|
||||
}
|
||||
}
|
||||
|
||||
//open/close container
|
||||
|
@ -112,6 +112,7 @@ bool ConfigManager::load()
|
||||
integer[DEATH_LOSE_PERCENT] = getGlobalNumber(L, "deathLosePercent", -1);
|
||||
integer[KNIGHT_CLOSE_ATTACK_DAMAGE_INCREASE_PERCENT] = getGlobalNumber(L, "knightCloseAttackDamageIncreasePercent", -1);
|
||||
integer[PALADIN_RANGE_ATTACK_DAMAGE_INCREASE_PERCENT] = getGlobalNumber(L, "paladinRangeAttackDamageIncreasePercent", -1);
|
||||
integer[CORPSE_OWNER_ENABLED] = getGlobalBoolean(L, "corpseOwnerEnabled", true);
|
||||
integer[STATUSQUERY_TIMEOUT] = getGlobalNumber(L, "statusTimeout", 5000);
|
||||
integer[WHITE_SKULL_TIME] = getGlobalNumber(L, "whiteSkullTime", 15 * 60);
|
||||
integer[RED_SKULL_TIME] = getGlobalNumber(L, "redSkullTime", 30 * 24 * 60 * 60);
|
||||
|
@ -49,6 +49,7 @@ class ConfigManager
|
||||
BLOCK_HEIGHT,
|
||||
DROP_ITEMS,
|
||||
DISTANCE_WEAPONS_DROP_ON_GROUND,
|
||||
CORPSE_OWNER_ENABLED,
|
||||
|
||||
LAST_BOOLEAN_CONFIG /* this must be the last one */
|
||||
};
|
||||
|
@ -22,12 +22,15 @@
|
||||
|
||||
#include "tile.h"
|
||||
#include "monsters.h"
|
||||
#include "configmanager.h"
|
||||
|
||||
class Creature;
|
||||
class Game;
|
||||
class Spawn;
|
||||
class Combat;
|
||||
|
||||
extern ConfigManager g_config;
|
||||
|
||||
typedef std::unordered_set<Creature*> CreatureHashSet;
|
||||
typedef std::list<Creature*> CreatureList;
|
||||
|
||||
@ -257,6 +260,13 @@ class Monster final : public Creature
|
||||
return skillLoss ? mType->info.experience : 0;
|
||||
}
|
||||
uint16_t getLookCorpse() const final {
|
||||
if (!g_config.getBoolean(ConfigManager::CORPSE_OWNER_ENABLED)) {
|
||||
const ItemType& itemtype = Item::items[mType->info.lookcorpse];
|
||||
if (itemtype.decayTo != 0) {
|
||||
return itemtype.decayTo;
|
||||
}
|
||||
}
|
||||
|
||||
return mType->info.lookcorpse;
|
||||
}
|
||||
void dropLoot(Container* corpse, Creature* lastHitCreature) final;
|
||||
|
Loading…
x
Reference in New Issue
Block a user