Removed unnecessary database queries in some command handlers.
Replaced them with access to cached data or queries for only the needed data.
Move database access in gossip select code to less often called place.
Command must now ignore implicit self-targeted player as target.
And allow respawn all near creatures/go in this case.
Signed-off-by: VladimirMangos <vladimir@getmangos.com>
Works for all classes, not only hunter. Pet also saved in DB.
Signed-off-by: dythzer <micke223@gmail.com>
Command renamed to .npc tame and code updated to use common function with spell effect.
Targeted creature not killed and tamed pet show up before player.
Signed-off-by: VladimirMangos <vladimir@getmangos.com>
As it may cause bigger latency due to large amount of I/O.
Signed-off-by: freghar <compmancz@gmail.com>
(cherry picked from commit 87c210e5ccd4ee853b8f9e37100988d9e4bc4525)
Signed-off-by: VladimirMangos <vladimir@getmangos.com>
* Rename 2 creature_template fields to more clean names and related code update also.
* Use enum values instead raw values for type_flags, use halper functions instead code repeating.
* Move tamed pet creating code to new function.
Signed-off-by: dythzer <micke223@gmail.com>
* Also implement .npc unfollow for cancel following.
* Help and mangos strings.
* Unrelated small fixes in mangos.sql.
Signed-off-by: VladimirMangos <vladimir@getmangos.com>
for selected player
Signed-off-by: dythzer <micke223@gmail.com>
Add help text and mangos strings.
Signed-off-by: VladimirMangos <vladimir@getmangos.com>
Added checking global cooldown for pet spell casting triggered by master.
Optimized PetAI::UpdateAI:
- Removed obsolete victim_guid as combat check.
- Stop pet combat when pet die in JustDied(Unit*) method.
- Optimized autospells selection and casting.
Signed-off-by: ApoC <apoc@nymfe.net>
Optimized free subgroup in raid finding.
Optimized method calls, now using const uint64& instead of value passing.
Signed-off-by: ApoC <apoc@nymfe.net>
If no creature is selected, old behavior is used (respawn everything).
Thanks Seline for the diff.
Signed-off-by: freghar <compmancz@gmail.com>
(cherry picked from commit 6bbdffac9acb9c02a74be632b35a90f0bda3ccb0)
Signed-off-by: VladimirMangos <vladimir@getmangos.com>
Some changes in creature targeting and work in case alive target. Help data updated.
Signed-off-by: VladimirMangos <vladimir@getmangos.com>