Hello, I got a question. How to change the radius of monster's view? For example. Monster attack player when he is 4 squares front of him,and I want change it for 10 squares (it's an example ofc.) I think so it should be in c++. But how?
<flag targetdistance="[COLOR="Blue"]1[/COLOR]"/>
It's not what I wanted (anyway rep++) ,I made a wrong sentence. Uhm. I wanted to edit the radius of entering into combat with monster.You can change it in your file with monster (OTS/data/monsters/your monster.xml) then find it:
Blue: here you can change your distance monster to playerCode:<flag targetdistance="[COLOR="Blue"]1[/COLOR]"/>
const SpectatorVec& Map::getSpectators(const Position& centerPos)
{
if(centerPos.z >= MAP_MAX_LAYERS)
{
boost::shared_ptr<SpectatorVec> p(new SpectatorVec());
SpectatorVec& list = *p;
return list;
}
SpectatorCache::iterator it = spectatorCache.find(centerPos);
if(it != spectatorCache.end())
return *it->second;
boost::shared_ptr<SpectatorVec> p(new SpectatorVec());
spectatorCache[centerPos] = p;
SpectatorVec& list = *p;
int32_t [B][COLOR="Red"]minRangeX = -maxViewportX, maxRangeX = maxViewportX, minRangeY = -maxViewportY,
maxRangeY = maxViewportY[/COLOR][/B], minRangeZ, maxRangeZ;
if(centerPos.z > 7)
{
//underground, 8->15
minRangeZ = std::max(centerPos.z - 2, 0);
maxRangeZ = std::min(centerPos.z + 2, MAP_MAX_LAYERS - 1);
}
//above ground
else if(centerPos.z == 6)
{
minRangeZ = 0;
maxRangeZ = 8;
}
else if(centerPos.z == 7)
{
minRangeZ = 0;
maxRangeZ = 9;
}
else
{
minRangeZ = 0;
maxRangeZ = 7;
}
getSpectatorsInternal(list, centerPos, false, minRangeX, maxRangeX, minRangeY, maxRangeY, minRangeZ, maxRangeZ);
return list;
}