matthew4321
Mapper
- Joined
- Jan 19, 2011
- Messages
- 91
- Reaction score
- 4
how can i add no spawn blocking like in real tibia? thanks in advance tfs 1.2
because in the source it would apply to every monster not just a few that would need to be defined in luaWhy not use LUA?
but players in the area will block the spawnhow about randomly spawned monster by just giving the area perimeters and the maxCreatureCount for area?
yes but the problem is how to change it to not let players block respawnsi 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.
It wont be a problem on LUA, because it doesn't care if its spawned on top of free or monster. (unless you don't allow it to do so)but players in the area will block the spawn
hmmm that may work let me recompile and test itTry 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