• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

request c++ code

how about randomly spawned monster by just giving the area perimeters and the maxCreatureCount for area?
 
ya the goal is too make it like real tibia is today,
where u see an animation on the sqm the monster will spawn on,
and then it spawns, even if you are on the screen.

This makes hunting more hardcore, and allows for a faster gameplay experience.
You dont spend anytime waiting for your respawn too come back.

It happens while u hunt.
 
i found it in the source,

I think its here..

spawn.cpp line 187 -

bool Spawn::findPlayer(const Position& pos)

SpectatorVec list;
g_game.map.getSpectators(list, pos, false, true);
for (Creature* spectator : list) {
if (!spectator->getPlayer()->hasFlag(PlayerFlag_IgnoredByMonsters)) {
return true;
}

spawn.cpp line 252 -

spawnBlock_t& sb = it.second;
if (OTSYS_TIME() >= sb.lastSpawn + sb.interval) {
if (findPlayer(sb.pos)) {
sb.lastSpawn = OTSYS_TIME();
continue;
}

But i wouldnt have any idea what too do with it.
 
i found it in the source,

I think its here..

spawn.cpp line 187 -

bool Spawn::findPlayer(const Position& pos)

SpectatorVec list;
g_game.map.getSpectators(list, pos, false, true);
for (Creature* spectator : list) {
if (!spectator->getPlayer()->hasFlag(PlayerFlag_IgnoredByMonsters)) {
return true;
}

spawn.cpp line 252 -

spawnBlock_t& sb = it.second;
if (OTSYS_TIME() >= sb.lastSpawn + sb.interval) {
if (findPlayer(sb.pos)) {
sb.lastSpawn = OTSYS_TIME();
continue;
}

But i wouldnt have any idea what too do with it.
yes but the problem is how to change it to not let players block respawns
 
Try removing -
if (findPlayer(sb.pos)) {

and recompile your tfs?

I really don't know, I'm speculating...

-- EDIT --

I think there is another way too do this! In the findplayer part on line 189 -

You can add another line to the spectator vec list

if (!spectator->getPlayer()->hasFlag(SOME FLAG EVERY PLAYER HAS?)) {

that way the spawnblock should ignore players with that flag? >_>' (idk)

Or... just delete the whole spawnblock on line 252


-Martin
 
Last edited:
Try removing -
if (findPlayer(sb.pos)) {

and recompile your tfs?

I really don't know, I'm speculating...

-- EDIT --

I think there is another way too do this! In the findplayer part on line 189 -

You can add another line to the spectator vec list

if (!spectator->getPlayer()->hasFlag(SOME FLAG EVERY PLAYER HAS?)) {

that way the spawnblock should ignore players with that flag? >_>' (idk)

Or... just delete the whole spawnblock on line 252


-Martin
hmmm that may work let me recompile and test it
 
Back
Top