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
|
-- 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
|
minRateSpawn = 100
|
||||||
maxRateSpawn = 200
|
maxRateSpawn = 200
|
||||||
|
corpseOwnerEnabled = false
|
||||||
|
|
||||||
-- Combat settings
|
-- Combat settings
|
||||||
-- NOTE: valid values for worldType are: "pvp", "no-pvp" and "pvp-enforced"
|
-- NOTE: valid values for worldType are: "pvp", "no-pvp" and "pvp-enforced"
|
||||||
|
@ -277,10 +277,12 @@ ReturnValue Actions::internalUseItem(Player* player, const Position& pos, uint8_
|
|||||||
openContainer = container;
|
openContainer = container;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (g_config.getBoolean(ConfigManager::CORPSE_OWNER_ENABLED)) {
|
||||||
uint32_t corpseOwner = container->getCorpseOwner();
|
uint32_t corpseOwner = container->getCorpseOwner();
|
||||||
if (corpseOwner != 0 && !player->canOpenCorpse(corpseOwner)) {
|
if (corpseOwner != 0 && !player->canOpenCorpse(corpseOwner)) {
|
||||||
return RETURNVALUE_YOUARENOTTHEOWNER;
|
return RETURNVALUE_YOUARENOTTHEOWNER;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//open/close container
|
//open/close container
|
||||||
int32_t oldContainerId = player->getContainerID(openContainer);
|
int32_t oldContainerId = player->getContainerID(openContainer);
|
||||||
|
@ -112,6 +112,7 @@ bool ConfigManager::load()
|
|||||||
integer[DEATH_LOSE_PERCENT] = getGlobalNumber(L, "deathLosePercent", -1);
|
integer[DEATH_LOSE_PERCENT] = getGlobalNumber(L, "deathLosePercent", -1);
|
||||||
integer[KNIGHT_CLOSE_ATTACK_DAMAGE_INCREASE_PERCENT] = getGlobalNumber(L, "knightCloseAttackDamageIncreasePercent", -1);
|
integer[KNIGHT_CLOSE_ATTACK_DAMAGE_INCREASE_PERCENT] = getGlobalNumber(L, "knightCloseAttackDamageIncreasePercent", -1);
|
||||||
integer[PALADIN_RANGE_ATTACK_DAMAGE_INCREASE_PERCENT] = getGlobalNumber(L, "paladinRangeAttackDamageIncreasePercent", -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[STATUSQUERY_TIMEOUT] = getGlobalNumber(L, "statusTimeout", 5000);
|
||||||
integer[WHITE_SKULL_TIME] = getGlobalNumber(L, "whiteSkullTime", 15 * 60);
|
integer[WHITE_SKULL_TIME] = getGlobalNumber(L, "whiteSkullTime", 15 * 60);
|
||||||
integer[RED_SKULL_TIME] = getGlobalNumber(L, "redSkullTime", 30 * 24 * 60 * 60);
|
integer[RED_SKULL_TIME] = getGlobalNumber(L, "redSkullTime", 30 * 24 * 60 * 60);
|
||||||
|
@ -49,6 +49,7 @@ class ConfigManager
|
|||||||
BLOCK_HEIGHT,
|
BLOCK_HEIGHT,
|
||||||
DROP_ITEMS,
|
DROP_ITEMS,
|
||||||
DISTANCE_WEAPONS_DROP_ON_GROUND,
|
DISTANCE_WEAPONS_DROP_ON_GROUND,
|
||||||
|
CORPSE_OWNER_ENABLED,
|
||||||
|
|
||||||
LAST_BOOLEAN_CONFIG /* this must be the last one */
|
LAST_BOOLEAN_CONFIG /* this must be the last one */
|
||||||
};
|
};
|
||||||
|
@ -22,12 +22,15 @@
|
|||||||
|
|
||||||
#include "tile.h"
|
#include "tile.h"
|
||||||
#include "monsters.h"
|
#include "monsters.h"
|
||||||
|
#include "configmanager.h"
|
||||||
|
|
||||||
class Creature;
|
class Creature;
|
||||||
class Game;
|
class Game;
|
||||||
class Spawn;
|
class Spawn;
|
||||||
class Combat;
|
class Combat;
|
||||||
|
|
||||||
|
extern ConfigManager g_config;
|
||||||
|
|
||||||
typedef std::unordered_set<Creature*> CreatureHashSet;
|
typedef std::unordered_set<Creature*> CreatureHashSet;
|
||||||
typedef std::list<Creature*> CreatureList;
|
typedef std::list<Creature*> CreatureList;
|
||||||
|
|
||||||
@ -257,6 +260,13 @@ class Monster final : public Creature
|
|||||||
return skillLoss ? mType->info.experience : 0;
|
return skillLoss ? mType->info.experience : 0;
|
||||||
}
|
}
|
||||||
uint16_t getLookCorpse() const final {
|
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;
|
return mType->info.lookcorpse;
|
||||||
}
|
}
|
||||||
void dropLoot(Container* corpse, Creature* lastHitCreature) final;
|
void dropLoot(Container* corpse, Creature* lastHitCreature) final;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user