From 7661fe98398107a968c68d1a346002a70db772b1 Mon Sep 17 00:00:00 2001 From: NoFantasy Date: Tue, 9 Mar 2010 01:28:13 +0100 Subject: [PATCH] [9556] Allow summoned creatures use MovementType == RANDOM_MOTION_TYPE Using creature_template.MovementType as default. For normal spawned creatures, data from creature table will still apply and override _template. Radius is 5.0 as default, but may be changed in real-time from ai scripts using function. Signed-off-by: NoFantasy --- src/game/Creature.cpp | 6 ++---- src/shared/revision_nr.h | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/game/Creature.cpp b/src/game/Creature.cpp index 9963129c9c0..85208612520 100644 --- a/src/game/Creature.cpp +++ b/src/game/Creature.cpp @@ -115,7 +115,7 @@ Creature::Creature(CreatureSubtype subtype) : Unit(), i_AI(NULL), lootForPickPocketed(false), lootForBody(false), m_groupLootTimer(0), m_groupLootId(0), m_lootMoney(0), m_lootRecipient(0), -m_deathTimer(0), m_respawnTime(0), m_respawnDelay(25), m_corpseDelay(60), m_respawnradius(0.0f), +m_deathTimer(0), m_respawnTime(0), m_respawnDelay(25), m_corpseDelay(60), m_respawnradius(5.0f), m_subtype(subtype), m_defaultMovementType(IDLE_MOTION_TYPE), m_DBTableGuid(0), m_equipmentId(0), m_AlreadyCallAssistance(false), m_AlreadySearchedAssistance(false), m_regenHealth(true), m_AI_locked(false), m_isDeadByDefault(false), m_needNotify(false), @@ -271,8 +271,6 @@ bool Creature::InitEntry(uint32 Entry, uint32 team, const CreatureData *data ) // checked at loading m_defaultMovementType = MovementGeneratorType(cinfo->MovementType); - if(!m_respawnradius && m_defaultMovementType == RANDOM_MOTION_TYPE) - m_defaultMovementType = IDLE_MOTION_TYPE; return true; } @@ -1889,7 +1887,7 @@ void Creature::GetRespawnCoord( float &x, float &y, float &z, float* ori, float* if (ori) *ori = data->orientation; if (dist) - *dist = data->spawndist; + *dist = GetRespawnRadius(); return; } diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index e8ac529d397..c39f57de736 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "9555" + #define REVISION_NR "9556" #endif // __REVISION_NR_H__