Show
Ignore:
Timestamp:
11/21/08 08:48:46 (17 years ago)
Author:
yumileroy
Message:

*Add m_isAggressive. Only aggressive creatures will call AttackStart? and MoveInLineOfSight?.
*Set melee dmg school for summoned creatures.
*Fix some compiling errors.

Original author: megamage
Date: 2008-11-20 18:54:50-06:00

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/game/Creature.cpp

    r260 r265  
    123123m_lootMoney(0), m_lootRecipient(0), 
    124124m_deathTimer(0), m_respawnTime(0), m_respawnDelay(25), m_corpseDelay(60), m_respawnradius(0.0f), 
    125 m_gossipOptionLoaded(false), m_emoteState(0), m_isPet(false), m_isTotem(false), 
     125m_gossipOptionLoaded(false), m_emoteState(0), m_isPet(false), m_isTotem(false), m_isAggressive(true), 
    126126m_regenTimer(2000), m_defaultMovementType(IDLE_MOTION_TYPE), m_equipmentId(0), 
    127127m_AlreadyCallAssistence(false), m_regenHealth(true), m_AI_locked(false), m_isDeadByDefault(false), 
     
    294294    SetUInt32Value(UNIT_DYNAMIC_FLAGS,GetCreatureInfo()->dynamicflags); 
    295295 
     296    SetMeleeDamageSchool(SpellSchools(GetCreatureInfo()->dmgschool)); 
    296297    SetModifierValue(UNIT_MOD_ARMOR,             BASE_VALUE, float(GetCreatureInfo()->armor)); 
    297298    SetModifierValue(UNIT_MOD_RESISTANCE_HOLY,   BASE_VALUE, float(GetCreatureInfo()->resistance1)); 
     
    323324    if(GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_TRIGGER) 
    324325        SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); 
     326 
     327    if(isTotem() || isCivilian() || GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_TRIGGER 
     328        || GetCreatureType() == CREATURE_TYPE_CRITTER) 
     329        m_isAggressive = false; 
     330    else 
     331        m_isAggressive = true; 
    325332 
    326333    return true; 
     
    14111418    SetPower(POWER_MANA,data->curmana); 
    14121419 
    1413     SetMeleeDamageSchool(SpellSchools(GetCreatureInfo()->dmgschool)); 
    1414  
    14151420    // checked at creature_template loading 
    14161421    m_defaultMovementType = MovementGeneratorType(data->movementType);