-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add monsters walking back to spawn #3604
Conversation
src/game.cpp
Outdated
bool result = g_config.reload(); | ||
|
||
Monster::despawnRange = g_config.getNumber(ConfigManager::DEFAULT_DESPAWNRANGE); | ||
Monster::despawnRadius = g_config.getNumber(ConfigManager::DEFAULT_DESPAWNRADIUS); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tiny fix as a bonus 💩
6366398
to
9d75a0f
Compare
@@ -725,14 +738,13 @@ void Monster::onThink(uint32_t interval) | |||
} | |||
|
|||
if (!isInSpawnRange(position)) { | |||
g_game.addMagicEffect(this->getPosition(), CONST_ME_POFF); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Effect has been displayed at the new position (after teleport) 🙄
src/game.cpp
Outdated
case RELOAD_TYPE_CONFIG: { | ||
bool result = g_config.reload(); | ||
|
||
Monster::despawnRange = g_config.getNumber(ConfigManager::DEFAULT_DESPAWNRANGE); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This part looks weird, a reload by overwriting variables directly in the reload event
I do not like it!
But the idea of the monsters returning to their position is nice, although no one is going to see the monsters return, so they would be something unnecessary, for that grace, let's make them immediately return to their respawn position.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
10000 monsters doing a ghost walk that no one will ever see, use of unnecessary processor, it seems useless to me, I hope you can have a better idea.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- If you do not want features, maintain your issues.
- There is already a despawn teleport.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just hope you don't bother, they are just my opinions.
the fact that you are actively contributing to the repository is great.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you dont want to accidentally run into walking monsters, just disable the feature - its possible with 0
as value.
9d75a0f
to
6ded505
Compare
|
@@ -258,8 +259,9 @@ bool ConfigManager::load() | |||
|
|||
integer[MAX_PLAYERS] = getGlobalNumber(L, "maxPlayers"); | |||
integer[PZ_LOCKED] = getGlobalNumber(L, "pzLocked", 60000); | |||
integer[DEFAULT_DESPAWNRANGE] = getGlobalNumber(L, "deSpawnRange", 2); | |||
integer[DEFAULT_DESPAWNRADIUS] = getGlobalNumber(L, "deSpawnRadius", 50); | |||
integer[DEFAULT_DESPAWNRANGE] = Monster::despawnRange = getGlobalNumber(L, "deSpawnRange", 2); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here it looks much better ;), now I like it.
I heard that this feature is from Tibia RL, so after all, I will be happy to see this change, I have no more things to say, I hope others can try and give their opinions.
I still have some doubts about what would happen if someone tried to make them walk very long distances? any definite behavior or just monsters walking crazy all over the place?
the code compiled just fine here, you either did something wrong or you are not using tfs-master but other engine |
The PR does not work at all well, only movements of 6 or 7 SQM maximum are allowed due to the getPathTo function So the PR itself is useless and does not work in 99% of cases Please change the mechanism to the onThink event and have the monster update getPathTo until it reaches its destination |
Pull Request Prelude
Changes Proposed
Monsters will now walk back to their spawn position when lured away and no targets are around. See the attached videos for more details. When the path gets blocked, monster will just stop.
spawnwalk.mp4
- monster does not walk back when in allowed range, and walk backs when goes outside of it.spawnwalk_block.mp4
- monster cancels walk to spawn when target appears | stop when walking back and path gets blocked.spawnwalk.mp4
spawnwalk_block.mp4
Issues addressed: Part of #922, #3600