Nostalrius 7.7

pinata

New Member
Joined
Apr 12, 2019
Messages
8
Reaction score
4
I got those values after dozen hours of tests on real tibia live servers (from @e.e and @Kungenn). e.e even helped setup custom monsters with 100 cast chance. Also some annihilator tibia cams helped to figure out weird stuff (like how monsters spam spells when traped at not ideal range, as demons in annihilator, or any stuff from the other side of a river with no path available). The 4 seconds value I was not sure though, and might be something in the range of 3 to 5 seconds. You guys that have more experience with the 7.7 decompiled code might get the acurate values now that you know what to look for.

I'm amazed how a "perfect replica" totally ignored that aspect and garbage OTHire is being used as resource to fix all those broken features. I would actually advise against that though, it's better to test in the real thing, maybe check OTHire for ideas, but some implementations are estimatives and the code is poorly implemented (because I sux, sorry).

Regarding the video, I would guess it was some weird interaction of fast changing target and changing range. I tested with dragons/hunters for hours and never saw something like that.
I'm sorry if I'm going about things the wrong way. I just started looking at the OT stuff about a month ago and so I have very little understanding of the culture here on the boards clearly.
 

pink_panther

Member
Joined
Sep 10, 2016
Messages
72
Reaction score
14
Yeah uniform random is very simillar in behaviour to rand(), just more convinent to use. And decompiled binary of Cip's files is using normal rand for spell attack chance.
Code:
if ( !(rand() % spellData->Delay) && (this->Master ||
TSkill::Get(this->tNonPlayer.tCreature.tSkillBase.Skills[HP]) > *(&unk_81C479C + 84 * this->baseclass_0.baseclass_0.Race) // runaway health
|| random(1, 3) == 1) )
I am not sure if there is anything actually using normalized, would have to dig around, been a while since I've looked into these.

But yeah, with normal_rand looking for 0 to proc. It made any spell in your distro do attack roughly 3-4 times less frequent.

Also you should also perhaps change the 1/3 chance to attack on flee to uniform version as well. As that's also making it way less frequent for additional chance to attack during flee.
Code:
normalized_random(1, 3)
1 = 135932 13%
2 = 728048 72%
3 = 136020 13%
and random(int, int) is just a regular rand() with option to min - max
Code:
int __cdecl random(int a3, int a4)
{
  signed int v4; // [email protected]
  int result; // [email protected]

  v4 = a4 - a3 + 1;
  result = a3;
  if ( v4 > 0 )
    result = rand() % v4 + a3;
  return result;
}
So hypothetically if an monster had chance 3. Which should be in fact 25% roughly.
Your monster had around 6% chance to attack with that spell. If it was fleeing, then that chance would be 0.78%.
What should look more like: 25% to attack & when fleeing 8,25%.
Where did you get the code from that decompiled binary of Cip's files to be able see the attack formula?

And if you can see more, is there a cooldown or anything on spell casting.
 
OP
Ezzz

Ezzz

Developer
Joined
Feb 26, 2010
Messages
1,669
Reaction score
386
Location
Quito, Ecuador
Where did you get the code from that decompiled binary of Cip's files to be able see the attack formula?

And if you can see more, is there a cooldown or anything on spell casting.
There is no cooldown or anything whatsoever, there is nothing like that on any code generated by any reverse engineering software, there are only 1000 ms interval waits from here and there, but nothing like a spell cast cooldown, with this being said it can be presumed that there's a global cooldown of 1000 ms when a certain action happens because those 1000ms wait calls happen on very specific circumstances, however, I can recall one happening every time the idle stimulus function was called, and at the very end as well.
 

Kliz

New Member
Joined
Apr 1, 2019
Messages
6
Reaction score
0
So are the monsteres changed in github download version right now?
Ty Ezzz for developing.

Edit: Yeah, Its all updated.
 
Last edited:

pink_panther

Member
Joined
Sep 10, 2016
Messages
72
Reaction score
14
There is no cooldown or anything whatsoever, there is nothing like that on any code generated by any reverse engineering software, there are only 1000 ms interval waits from here and there, but nothing like a spell cast cooldown, with this being said it can be presumed that there's a global cooldown of 1000 ms when a certain action happens because those 1000ms wait calls happen on very specific circumstances, however, I can recall one happening every time the idle stimulus function was called, and at the very end as well.
Well it seems with the current method. it's possible for monstesr with more than 1 spell to cast 2 or more at once, if they're lucky. Is that right?
 

tarantonio

Old School Player
Joined
Jun 21, 2009
Messages
683
Reaction score
157
I'm still testing last fixes, now I cannot use runes on monsters with fields under them, it returns 'there is not enough room'
 
OP
Ezzz

Ezzz

Developer
Joined
Feb 26, 2010
Messages
1,669
Reaction score
386
Location
Quito, Ecuador
I'm still testing last fixes, now I cannot use runes on monsters with fields under them, it returns 'there is not enough room'
Thank you for your report, will be fixed now. The issue is caused by the last bug fix of effects appearing on stairs.
 

tarantonio

Old School Player
Joined
Jun 21, 2009
Messages
683
Reaction score
157
Thank you for your report, will be fixed now. The issue is caused by the last bug fix of effects appearing on stairs.
I can confirm that visual bug too:


And your summon doesn't follow you when you have attack on it, it should follow you.
 

Peonso

Godly Member
Joined
Jan 14, 2008
Messages
1,493
Reaction score
982
Well it seems with the current method. it's possible for monstesr with more than 1 spell to cast 2 or more at once, if they're lucky. Is that right?
They are rolled separetedely, it's easy to spot in Warlock hunt cams 2 or 3 spells combo.
 

LooSik

Excellent OT User
Joined
Oct 12, 2007
Messages
196
Reaction score
22
There is no cooldown or anything whatsoever, there is nothing like that on any code generated by any reverse engineering software, there are only 1000 ms interval waits from here and there, but nothing like a spell cast cooldown, with this being said it can be presumed that there's a global cooldown of 1000 ms when a certain action happens because those 1000ms wait calls happen on very specific circumstances, however, I can recall one happening every time the idle stimulus function was called, and at the very end as well.
Yeah that's what I've seen as well. Certain stuff trigers additional 1000ms pause
Code:
TCreature::ToDoWait(&this->tNonPlayer.tCreature, (int)v34, (TCreature *)v33, (TConnection *)this, 1000);
called in around 6 or so places of IdleStimulus func there is bunch of state switching as well which might also be connected to additional delays of attacks.

I'll re-setup my local 7.72 "official" server to see if I can link remote debugger it up ( wanted to do that long time ago anyway )
But won't be able to check anything until tomorrow.
 

pink_panther

Member
Joined
Sep 10, 2016
Messages
72
Reaction score
14
Yeah that's what I've seen as well. Certain stuff trigers additional 1000ms pause
Code:
TCreature::ToDoWait(&this->tNonPlayer.tCreature, (int)v34, (TCreature *)v33, (TConnection *)this, 1000);
called in around 6 or so places of IdleStimulus func there is bunch of state switching as well which might also be connected to additional delays of attacks.

I'll re-setup my local 7.72 "official" server to see if I can link remote debugger it up ( wanted to do that long time ago anyway )
But won't be able to check anything until tomorrow.
For testing monster casting? I'd like to see a comparison.

What "official" server is it?

Thank you for your report, will be fixed now. The issue is caused by the last bug fix of effects appearing on stairs.
Will that be commited?
 
Last edited:

Peonso

Godly Member
Joined
Jan 14, 2008
Messages
1,493
Reaction score
982
What "official" server is it?
 

tarantonio

Old School Player
Joined
Jun 21, 2009
Messages
683
Reaction score
157
@Ezzz Do those functions use of normal_random need to be changed aswell? :


Now the chance to break a spear or a distance weapon is almost imposible if we use the same logic as the monster attacks.
 

pink_panther

Member
Joined
Sep 10, 2016
Messages
72
Reaction score
14
how do you see the formulas though?
 
OP
Ezzz

Ezzz

Developer
Joined
Feb 26, 2010
Messages
1,669
Reaction score
386
Location
Quito, Ecuador
@Ezzz Do those functions use of normal_random need to be changed aswell? :


Now the chance to break a spear or a distance weapon is almost imposible if we use the same logic as the monster attacks.
Most likely, if the statements are correct concerning % within normal_random, should replace normal_random with uniform_random in the sources and test from there, it won't do any harm.

how do you see the formulas though?
Using IDA Pro and Hex-Rays.
 

LooSik

Excellent OT User
Joined
Oct 12, 2007
Messages
196
Reaction score
22
Initial testing of real files. Melee range for sure the interval is 2000ms.
If monster can't reach the target its 1000ms ( as if no pathing found )
If monster is far away but can reach the target its still 2000ms

( The dragon is set to 100% chance for aoe, frontal and self healing )

1st video showing 1000ms spam when it can't reach target

2nd vid showing a far away dragon that found a path to summon and even tho range is pretty high, it stops casting every second and changes to 2s interval.

Not sure what else would trigger the 1000ms cooldown, perhaps target swap too? Would explain the demon video going ape spam. Need more testing and perhaps try to run a debugger now that I've set the files again.

Edit:

Seems like when something gets in path of the monster it also goes 1000ms?
 
Last edited:
Top