[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 <nofantasy@nf.no>
This commit is contained in:
NoFantasy 2010-03-09 01:28:13 +01:00
parent 583e37e5c9
commit 3d3348e485
2 changed files with 3 additions and 5 deletions

View file

@ -115,7 +115,7 @@ Creature::Creature(CreatureSubtype subtype) :
Unit(), i_AI(NULL), Unit(), i_AI(NULL),
lootForPickPocketed(false), lootForBody(false), m_groupLootTimer(0), m_groupLootId(0), lootForPickPocketed(false), lootForBody(false), m_groupLootTimer(0), m_groupLootId(0),
m_lootMoney(0), m_lootRecipient(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_subtype(subtype), m_defaultMovementType(IDLE_MOTION_TYPE), m_DBTableGuid(0), m_equipmentId(0),
m_AlreadyCallAssistance(false), m_AlreadySearchedAssistance(false), m_AlreadyCallAssistance(false), m_AlreadySearchedAssistance(false),
m_regenHealth(true), m_AI_locked(false), m_isDeadByDefault(false), m_needNotify(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 // checked at loading
m_defaultMovementType = MovementGeneratorType(cinfo->MovementType); m_defaultMovementType = MovementGeneratorType(cinfo->MovementType);
if(!m_respawnradius && m_defaultMovementType == RANDOM_MOTION_TYPE)
m_defaultMovementType = IDLE_MOTION_TYPE;
return true; return true;
} }
@ -1889,7 +1887,7 @@ void Creature::GetRespawnCoord( float &x, float &y, float &z, float* ori, float*
if (ori) if (ori)
*ori = data->orientation; *ori = data->orientation;
if (dist) if (dist)
*dist = data->spawndist; *dist = GetRespawnRadius();
return; return;
} }

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__ #ifndef __REVISION_NR_H__
#define __REVISION_NR_H__ #define __REVISION_NR_H__
#define REVISION_NR "9555" #define REVISION_NR "9556"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__