Hi, I would like to ask about the invisibility system on tibia 7.7.
I suppose that the line below in the monster file is responsible for invisibility. Example for Warlock:
Actor (13) -> Outfit ((0, 0), 20) : 10,
Does this mean that Warlock had a 20% chance to disappear every 10 seconds? What was the duration of invisibility?
Actually it is a chance of 1 in (X+1). Here's CIP's code:
Captured with Lightshot
prnt.sc
The interesting part is "
if (!(rand() % SpellData->Delay))". Curious that they've used a plain rand() and not their more elaborated random(int,int), which they used everywhere else.
Now, In Tibia every single spell that monsters (not players) can cast must have an associated
TImpact struct.
TOutfitImpact is the one you're looking for.
Captured with Lightshot
prnt.sc
Here you can see that it sets a timer on the #16 skill (there are 25). It is
TSkillIllusion.
And here the server performs the actual change and notifies all the surrounding creatures.
Since the spell you showed says "
Actor (13) ->..." and not "
Victim (13) -> ..." you know that it's casted on the monster itself and there's no need to have an actual target.
"
Outfit ((0, 0), 20)" is even simpler. TOutfit struct looks like this:
C++:
struct TOutfit {
int OutfitID;
union {
int ObjectID;
unsigned char Color[4];
};
};
"
(0,0)" means that the first number denotes OutfitID, and the second is each of the 4 colors packed into one integer. You can make it work with Item IDs by setting OutfitID to zero and the colors to a TypeID, just like the Serpent Spawn turns you into a worm:
Code:
# serpentspawn.mon
Victim (7, 0, 13) -> Outfit ((0, 3492), 4) : 120,
Code:
# objects.srv
TypeID = 3492
Name = "a worm"
Flags = {Cumulative,Take}
Attributes = {Weight=20}
edit: st*pid typos