Hi, I want to do 'monster level', but something I did not quit. Here is the screen:
Please help me.
Here is code
I do not know why this is happening.
Sorry for bad english, use translate.
Please help me.
Here is code
C++:
bool Spawn::addMonster(const std::string& _name, const Position& _pos, Direction _dir, uint32_t _interval)
{
if(!g_game.getTile(_pos))
{
std::cout << "[Spawn::addMonster] NULL tile at spawn position (" << _pos << ")" << std::endl;
return false;
}
MonsterType* mType = g_monsters.getMonsterType(_name);
if(!mType)
{
std::cout << "[Spawn::addMonster] Cannot find \"" << _name << "\"" << std::endl;
return false;
}
if(_interval < interval)
interval = _interval;
spawnBlock_t sb;
sb.mType = mType;
sb.pos = _pos;
sb.direction = _dir;
sb.interval = _interval;
sb.lastSpawn = 0;
int32_t r = random_range(1,7);
std::stringstream Msg;
Msg << r;
mType->name = mType->name + " [" + Msg.str().c_str() + "]";;
mType->nameDescription = "a " + mType->name;
mType->experience = mType->experience + (mType->experience/10 * r);
mType->health = mType->health + (mType->health/10 * r);
mType->healthMax = mType->healthMax + (mType->healthMax/10 * r);
uint32_t spawnId = (int32_t)spawnMap.size() + 1;
spawnMap[spawnId] = sb;
return true;
}
I do not know why this is happening.
Sorry for bad english, use translate.
Last edited by a moderator: