silveralol
Advanced OT User
- Joined
- Mar 16, 2010
- Messages
- 1,484
- Solutions
- 9
- Reaction score
- 217
Hello everyone!
then, I'm trying make a functions to check if the monster have the flag "isCannotBlock"...
I've made some modifications in tfs 1.2 to try make it work
I already do the part of the monster.cpp and monsters.cpp about the flag
then in spawn.cpp
I've made it:
I use "Monster* monster" in the function to "try" use check the flag
in line:
but when I try compile get a error:
the function checkSpawn(Monster* monster) is already changed in spawn.h with this:
then, I don't know what I do to resolve the error and make the functions work, what I want is like the tibia global system, that you can't block the spawn of some monsters, then my idea to do it easily is using flags, here one exemple of the use of the flags that is nice...
https://otland.net/threads/passive-monsters-attack-when-attacked.232475/
then, I'm trying make a functions to check if the monster have the flag "isCannotBlock"...
I've made some modifications in tfs 1.2 to try make it work
I already do the part of the monster.cpp and monsters.cpp about the flag
then in spawn.cpp
I've made it:
Code:
void Spawn::checkSpawn(Monster* monster)
{
checkSpawnEvent = 0;
cleanup();
uint32_t spawnCount = 0;
for (auto& it : spawnMap) {
uint32_t spawnId = it.first;
if (spawnedMap.find(spawnId) != spawnedMap.end()) {
continue;
}
spawnBlock_t& sb = it.second;
if (OTSYS_TIME() >= sb.lastSpawn + sb.interval) {
if (findPlayer(sb.pos) || !monster->isCannotBlock()) {
sb.lastSpawn = OTSYS_TIME();
continue;
}
spawnMonster(spawnId, sb.mType, sb.pos, sb.direction);
if (++spawnCount >= static_cast<uint32_t>(g_config.getNumber(ConfigManager::RATE_SPAWN))) {
break;
}
}
}
if (spawnedMap.size() < spawnMap.size()) {
checkSpawnEvent = g_scheduler.addEvent(createSchedulerTask(getInterval(), std::bind(&Spawn::checkSpawn, this)));
}
}
in line:
Code:
if (findPlayer(sb.pos) || !monster->isCannotBlock()) {
Code:
Error 1 error C2064: term does not evaluate to a function taking 1 arguments (..\src\spawn.cpp) C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\functional 1149 1 theforgottenserver
Code:
void checkSpawn(Monster* monster);
https://otland.net/threads/passive-monsters-attack-when-attacked.232475/