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

Monsters ignoring the player like in UTANA VID

lordazzi

New Member
Joined
Apr 6, 2012
Messages
24
Reaction score
1
Hi everyone!
I'm looking around all forums in all internet from all countries how to do that....
but no one know D:

I wanna make the monster ignore the player and become hostile just if the player attack the monster first!
I'm making a server that there are a friend indian tribal, I found just four options:
[HOSTILE=0, RunOnHelth[B]==[/B]HelthMax] - this make the indians people run away from the player like he is the demon
[HOSTILE=0, RunOnHelth[B]!=[/B]HelthMax] - this make all the indians follow the player like retards
[HOSTILE=1, RunOnHelth[B]==[/B]HelthMax] - this make the indians run away from the player and attack the player when he is next
[HOSTILE=1, RunOnHelth[B]!=[/B]HelthMax] - this make the FRIEND INDIANS attack the player WITHOUT a reason

I see this behavior (of ignore the player) in the monsters from Open Tibia Pokemon Online, they had hostile pokemons, pokemons running away with low life and pokemons ignoring the player like if he is using UTANA VID or in a different Z position (the floor).

Some one said to me that is impossible to do that with out to edit the CPP, so, I had any idea: edit the server for it read a new node in XML from the monster in the flags, something like: <flags ignorePlayer="boolean value">, in server will be a boolean ignorePlayer

And the IF from the invisibility could be something like this in the code:

Code:
IF (IsPlayerInvisible == true) {
       monster_make_random_movement();
}

and I could change for:

Code:
IF (IsPlayerInvisible == true[B] || (ignorePlayer == true && MonsterIsUnderAttack == false)[/B]) {
       monster_make_random_movement();
}

or

Code:
IF (monster.position.z != player.position.z) {
       monster_make_random_movement();
}

and I could change for:

Code:
IF (monster.position.z != player.position.z[B] || (ignorePlayer == true && MonsterIsUnderAttack == false)[/B]) {
       monster_make_random_movement();
}

But is too hard to find the IF that combine with this logical int the forgotten sources,
I tried monster.h, monster.cpp, monsters.h, monsters.cpp, spell.cpp, spell.h
I change using the Z position ideia, but it does not work (maybe I've worked with the wrong IF)
D:

I have not find any pokemon sources to compare the how they have did that. D:
 
Back
Top