Nerevr back
Member
- Joined
- Nov 7, 2014
- Messages
- 269
- Reaction score
- 7
i found this in other forum and compile done but when open exe get this error
i think the problem here
im use 0.4
monsters.h
Procure por:
Replace For:
find:
Replace for:
monsters.cpp
Find:
Replace for:
find:
find:
find this from same fuction:
under this add:
find:
under it add:
monster.h
find:
and then find that:
public:
under it add :
find:
Replace for:
monster.cpp
find:
under this add:
Find:
replace all function for:
find:
replace for:
find:
Replace for:
map.cpp
find:
under this add:
find:
under this add:
find:
and after this { add:
configmanager.h
find:
under this add:
configmanager.cpp
find:
ander this add:
config.lua
how to fix this?? anyone can help me?
i think the problem here
Code:
void Monster::onCreatureAppear(const Creature* creature)
im use 0.4
monsters.h
Procure por:
Code:
bool isSummonable, isIllusionable, isConvinceable, isAttackable, isHostile, isLureable,
isWalkable, canPushItems, canPushCreatures, pushable, hideName, hideHealth;
Replace For:
Code:
bool isSummonable, isIllusionable, isConvinceable, isAttackable, isHostile, isLureable,
isWalkable, canPushItems, canPushCreatures, pushable, hideName, hideHealth, hideLevel;
find:
Code:
int32_t defense, armor, health, healthMax, baseSpeed, lookCorpse, corpseUnique, corpseAction,
maxSummons, targetDistance, runAwayHealth, conditionImmunities, damageImmunities,
lightLevel, lightColor, changeTargetSpeed, changeTargetChance;
Replace for:
Code:
int32_t defense, armor, health, healthMax, baseSpeed, lookCorpse, corpseUnique, corpseAction,
maxSummons, targetDistance, runAwayHealth, conditionImmunities, damageImmunities,
lightLevel, lightColor, changeTargetSpeed, changeTargetChance, levelMin, levelMax;
monsters.cpp
Find:
Code:
canPushItems = canPushCreatures = isSummonable = isIllusionable = isConvinceable = isLureable = isWalkable = hideName = hideHealth = false;
Replace for:
Code:
canPushItems = canPushCreatures = isSummonable = isIllusionable = isConvinceable = isLureable = isWalkable = hideName = hideHealth = hideLevel = false;
find:
Code:
baseSpeed = 200;
Under it add:
levelMin = levelMax = 1;
find:
Code:
bool Monsters::loadMonster
find this from same fuction:
Code:
for(xmlNodePtr p = root->children; p; p = p->next)
{
if(p->type != XML_ELEMENT_NODE)
continue;
if(!xmlStrcmp(p->name, (const xmlChar*)"health"))
{
if(!readXMLInteger(p, "max", intValue))
{
SHOW_XML_ERROR("Missing health.max");
monsterLoad = false;
break;
}
mType->healthMax = intValue;
if(!readXMLInteger(p, "now", intValue))
mType->health = mType->healthMax;
else
mType->health = intValue;
}
under this add:
Code:
else if(!xmlStrcmp(p->name, (const xmlChar*)"level"))
{
if(!readXMLInteger(p, "max", intValue))
mType->levelMax = 1;
else
mType->levelMax = intValue;
if(!readXMLInteger(p, "min", intValue))
mType->levelMin = mType->levelMax;
else
mType->levelMin = intValue;
}
find:
Code:
if(readXMLString(tmpNode, "emblem", strValue))
mType->guildEmblem = getEmblems(strValue);
under it add:
Code:
if(readXMLString(tmpNode, "hidelevel", strValue))
mType->hideLevel = booleanString(strValue);
monster.h
find:
Code:
class Monster : public Creature
{
and then find that:
public:
Code:
#ifdef __ENABLE_SERVER_DIAGNOSTIC__
static uint32_t monsterCount;
#endif
virtual ~Monster();
under it add :
Code:
std::string name, nameDescription;
int32_t level;
double bonusAttack, bonusDefense;
find:
Code:
virtual const std::string& getName() const {return mType->name;}
virtual const std::string& getNameDescription() const {return mType->nameDescription;}
virtual std::string getDescription(int32_t) const {return mType->nameDescription + ".";}
Replace for:
Code:
virtual const std::string& getName() const {return name;}
virtual const std::string& getNameDescription() const {return nameDescription;}
virtual std::string getDescription(int32_t) const {return nameDescription + ".";}
monster.cpp
find:
Code:
isIdle = true;
under this add:
Code:
name = _mType->name;
nameDescription = _mType->nameDescription;
level = (int32_t)random_range(_mType->levelMin, _mType->levelMax, DISTRO_NORMAL);
bonusAttack = 1.0;
bonusDefense = 1.0;
Find:
Code:
Monster::onCreatureAppear
replace all function for:
Code:
void Monster::onCreatureAppear(const Creature* creature)
{
Creature::onCreatureAppear(creature);
if(creature == this)
{
//We just spawned lets look around to see who is there.
if(isSummon())
{
std::string value;
this->master->getStorage((std::string)"monster_level", value);
uint8_t intValue = atoi(value.c_str());
if(intValue || value == "0")
level = intValue;
else
level = 1;
isMasterInRange = canSee(master->getPosition());
}
if(g_config.getBool(ConfigManager::MONSTER_HAS_LEVEL))
{
this->healthMax = std::floor(this->getMaxHealth() * (1. + (0.1 * (level - 1))));
this->health = this->healthMax;
this->bonusAttack += (0.01 * (level - 1));
this->bonusDefense += (0.005 * (level - 1));
}
updateTargetList();
updateIdleStatus();
}
else
onCreatureEnter(const_cast<Creature*>(creature));
}
find:
Code:
g_config.getDouble(ConfigManager::RATE_MONSTER_DEFENSE)
replace for:
Code:
g_config.getDouble(ConfigManager::RATE_MONSTER_DEFENSE) * bonusDefense
find:
Code:
g_config.getDouble(ConfigManager::RATE_MONSTER_ATTACK)
Replace for:
Code:
g_config.getDouble(ConfigManager::RATE_MONSTER_ATTACK) * bonusAttack
map.cpp
find:
Code:
#include "game.h"
under this add:
Code:
#include "configmanager.h"
find:
Code:
extern Game g_game;
under this add:
Code:
extern ConfigManager g_config;
find:
Code:
bool Map::placeCreature
and after this { add:
Code:
Monster* monster = creature->getMonster();
if(monster && g_config.getBool(ConfigManager::MONSTER_HAS_LEVEL))
{
uint8_t level;
if(!monster->getMonsterType()->hideLevel)
{
if(monster->isSummon())
{
std::string value;
monster->getMaster()->getStorage((std::string)"monster_level", value);
uint8_t intValue = atoi(value.c_str());
if(intValue || value == "0")
level = intValue;
else
level = 1;
}
else
level = monster->level;
char buffer [10];
monster->name = monster->getName() + " [" + itoa(level, buffer, 10) + "]";
}
}
configmanager.h
find:
Code:
MONSTER_SPAWN_WALKBACK,
under this add:
Code:
MONSTER_HAS_LEVEL,
configmanager.cpp
find:
Code:
m_loaded = true;
ander this add:
Code:
m_confBool[MONSTER_HAS_LEVEL] = getGlobalBool("monsterHasLevel", true);
config.lua
Code:
monsterHasLevel = true
how to fix this?? anyone can help me?
Last edited by a moderator: