• 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!

Solved [TFS 1.2], [TFS 0.4], [OTHire] Monster cast beam and wave through wall (Critical bug)

LuisPro

World War <3
Joined
May 10, 2009
Messages
425
Solutions
1
Reaction score
53
Screens from OTHire:

If monster stay 1 sqm from wall and monster cast beam or wave, everything is right, here screen:
lWD6Mqg.png



But when monster is in front to wall (anything, any wall, magic wall, or closed doors) and he is blocked by player, monster cast beam and wave through wall!
leLPiCw.png


xj7iXWA.png


Screens from TFS 1.2:

63nsVoh.png


Al3TYJo.png


Screens from TFS 0.4:

Ymc2iiv.png


RwiUCcm.png


If monster is full traped for example by walls or magic walls (also in front to any wall) and have no blocker, monster are not cast spells through wall.

Issue exist in every distro! included:
TFS 1.2
https://github.com/otland/forgottenserver/issues/1690
OTHire
https://github.com/TwistedScorpio/OTHire/issues/53
TFS 0.4
etc...

Any help are welcome.
Greetings.
 
Last edited:
From the picture i assumed you use TFS 0.3.6 something
But you link to sources what link to TFS 1.2
Which is it? Next time just say your TFS version in title. Whenever I do browse trough support, I usually ignore threads what don't mention the TFS version in name or opening post.
 
From the picture i assumed you use TFS 0.3.6 something
But you link to sources what link to TFS 1.2
Which is it? Next time just say your TFS version in title. Whenever I do browse trough support, I usually ignore threads what don't mention the TFS version in name or opening post.

Screens are from OTHire, and i test it also on TFS 1.2 same problem is there also.
Title and 1st post are more clear now. Ty.
 
Last edited:
I use TFS 1.1.x
on my server I created this function: blockArea(startPos, area, object, blockDir) it returns new table of positions where damage is made
startPos - will the position where the area starts unfolding. (usually the creature position)
area - the table where the damage positions are indexed.
object - obstacle (or obstacles in table) which will deny the positions where it the area cant go trough. (you don't need it if you want it to be default, and simply set statically that wave cant pass solid objects, etc)
blockDir - the direction which way the wave is being shot.

All you have to do is creat similar function and use it where you want areas not to pass objects.

basically what you need to do is, preset a formula which "locks" positions behind the obstacle.
Then loop trough all the area positions and record locked positions.
Then loop trough all the area positions again and create new area table where the positions were not locked.

On the left side the cactus blocks the wave and expands the block are the further it reaches.
On right side the wave goes smoothly
 
Did you try to make one? If you did and didn't work I will help you more.
If it did work. change thread to solved.
 
Did you try to make one? If you did and didn't work I will help you more.
If it did work. change thread to solved.
Unfortunately i dont know how to create function which you described. My lua scripting is not at this level yet.
 
Lastest news:
I checking random distro to find one without this bug.
Alredy tested:
- [10.90 + Cast] Tfs 1.2 (custom modifications) + Reward Chest BUG
- [7.72] OTHire 0.0.1b - Based in OTServ Trunk (Latest) BUG
- [8.60] The Forgotten Server 1.2 BUG
- [7.8x] Solidus 1.0 (Beta) - Based in OTServ Trunk (Latest) BUG
and
YourOTS 0.9.4d STF Edition by @Danger II WORKS WELL
V0AGEZH.png

But now i need help to find where this is coded in this engine and how to implement it to newest engine.


Meantime, if you guys know any other distro where this bug does not exist let me know.

--- edit.
damn @Danger II why everything you touch is working?! -.- :D
 
Lastest news:
I checking random distro to find one without this bug.
Alredy tested:
- [10.90 + Cast] Tfs 1.2 (custom modifications) + Reward Chest BUG
- [7.72] OTHire 0.0.1b - Based in OTServ Trunk (Latest) BUG
- [8.60] The Forgotten Server 1.2 BUG
- [7.8x] Solidus 1.0 (Beta) - Based in OTServ Trunk (Latest) BUG
and
YourOTS 0.9.4d STF Edition by @Danger II WORKS WELL
V0AGEZH.png

But now i need help to find where this is coded in this engine and how to implement it to newest engine.


Meantime, if you guys know any other distro where this bug does not exist let me know.

--- edit.
damn @Danger II why everything you touch is working?! -.- :D

I guess its more like a engine issue since I cannot remember that I have every fixed that thing.
I have fixed alot of pvp issues there, maybe a pvp issue that has been fixed did fix this part, not sure tho :)
 
The code would be, "if tile infront of monster is not walkable" = 'do not cast spell'
ie: monster walks infront of a magic wall/brick wall/etc it will stop casting the spell.

As for the spells going through walls, now; I may be wrong - but I think that could be solved with an .otb edit? <-- question mark, because I'm unsure; its been awhile since I looked at the .otb editor.

But yeah, so if you want to copy the script from wherever you found it working. Find the monster spells area in source, and navigate to the onCast part of it - then find the section which dictates when to cast spell attacks. Copy this section out, and best bet - post it in the support forum and someone should be able to help you convert to whichever distro you need.

Edit:
Didn't even read past the first post - but now I saw @MatheusMkalo already posted your fix to convert to your distro if it doesn't already have it.
Code:
if(blockingSolid && tile->hasProperty(BLOCKSOLID)){
player->sendCancelMessage(RET_NOTENOUGHROOM);
g_game.addMagicEffect(player->getPosition(), NM_ME_PUFF);
return false;
}

Cheers!
 
Last edited:
The code would be, "if tile infront of monster is not walkable" = 'do not cast spell'
ie: monster walks infront of a magic wall/brick wall/etc it will stop casting the spell.

As for the spells going through walls, now; I may be wrong - but I think that could be solved with an .otb edit? <-- question mark, because I'm unsure; its been awhile since I looked at the .otb editor.

But yeah, so if you want to copy the script from wherever you found it working. Find the monster spells area in source, and navigate to the onCast part of it - then find the section which dictates when to cast spell attacks. Copy this section out, and best bet - post it in the support forum and someone should be able to help you convert to whichever distro you need.

Edit:
Didn't even read past the first post - but now I saw @MatheusMkalo already posted your fix to convert to your distro if it doesn't already have it.
Code:
if(blockingSolid && tile->hasProperty(BLOCKSOLID)){
player->sendCancelMessage(RET_NOTENOUGHROOM);
g_game.addMagicEffect(player->getPosition(), NM_ME_PUFF);
return false;
}

Cheers!

To get clear. We dont want fix "if tile infront of monster is not walkable" = 'do not cast spell'!
We want to monsters cast spells for example: dragon - waves and GFBs just not through wall!
That what you suggest is: if dragon is in front of any wall he cant use even GFB... this method is accetable only if this is only for waves and beams.

I even cant test it. becouse i dont know how to convert this:
https://github.com/TwistedScorpio/OTHire/blob/master/source/spells.cpp#L805-L809
and put here:
https://github.com/TwistedScorpio/OTHire/blob/master/source/spells.cpp#L399-L426
 
Back
Top