mobAngles

Post Reply
daiiawn
Posts: 20
Joined: Tue Mar 12, 2013 7:56 am

mobAngles

Post by daiiawn » Mon Mar 25, 2013 8:00 am

Attached is a patch to make mob turning a little more like retail.
I have added two columns in to the MOB_FAMILY_SYSTEM table. FRONT_ANGLE and REAR_ANGLE (put in for wyrms etc to enable tail tanking). These columns allow you to enter a tolerace of 0-254. The mob will then only turn to you if you are outside its front_angle tolerance (or behind it and outside its rear_angle tolerance). Column values default to 0 which means no tolerance, so mob will always turn to face you (as they do at the moment).

Example of use:
In HYDRAS MOB_FAMILY_SYSTEM entry, put in 30 for front_angle and 35 for rear angle. Hydra will now only turn to face you if you are more than +-30 rotation units from their head or +-35 rotation units from their tail.

I've tested this on 2 servers, the only issue I had was if I was behind the mob (inside its rear tolerance) but out of melee range, it would move forward trying to get to me (acually moving away from me) without turning to face me first,this has been fixed.

There is also a change to were OnMobDespawn is called, so that it is called just after the mob despawns, allowing you to make the mob respawn (for NMs). *Not sure if moving this was right or if I should have made a new LUA event, but from what I can see, OnMobDespawn wouldnt work for what it was designed for where it was (because monster status wouldnt allow for ordering repops, neither did onMobDeath).

If anything needs changing please let me know (even if you've changed it yourself as it will help me learn! Never really used C++ before).
Attachments
mobAnglesSQL.txt
Adds in the two new columns and defaults values to 0.
(167 Bytes) Downloaded 231 times
monsterAngles.patch
Changes to how moveIntoRange works. + Change to when onMobDespawn is called.
(8.9 KiB) Downloaded 240 times

Post Reply