Changeset 269 for trunk

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

*EventAI update:

ACTION_T_SET_ACTIVE = 101, //Apply
ACTION_T_SET_AGGRESSIVE = 102, //Apply
ACTION_T_ATTACK_START_PULSE = 103, //Distance

Original author: megamage
Date: 2008-11-21 16:17:51-06:00

Location:
trunk/src/bindings/scripts/scripts/creature
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/bindings/scripts/scripts/creature/mob_event_ai.cpp

    r260 r269  
    77 * This program is distributed in the hope that it will be useful, 
    88 * but WITHOUT ANY WARRANTY; without even the implied warranty of 
    9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
     9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
    1010 * GNU General Public License for more details. 
    1111 * 
    1212 * You should have received a copy of the GNU General Public License 
    1313 * along with this program; if not, write to the Free Software 
    14  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 
     14 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
    1515 */ 
    1616 
     
    965965                DoZoneInCombat(); 
    966966            } 
     967            break; 
     968 
     969        // TRINITY ONLY 
     970        case ACTION_T_SET_ACTIVE: 
     971            m_creature->setActive(param1 ? true : false); 
     972            break; 
     973        case ACTION_T_SET_AGGRESSIVE: 
     974            m_creature->SetAggressive(param1 ? true : false); 
     975            break; 
     976        case ACTION_T_ATTACK_START_PULSE: 
     977            AttackStart(m_creature->SelectNearestTarget((float)param1)); 
    967978            break; 
    968979        } 
     
    11931204        } 
    11941205 
    1195         if (m_creature->isCivilian() && m_creature->IsNeutralToAll()) 
    1196             return; 
    1197  
    1198         if (m_creature->canAttack(who) && who->isInAccessiblePlaceFor(m_creature) && m_creature->IsHostileTo(who)) 
    1199         { 
    1200             if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE) 
    1201                 return; 
    1202  
    1203             float attackRadius = m_creature->GetAttackDistance(who); 
    1204             if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who)) 
    1205             { 
    1206                 //if(who->HasStealthAura()) 
    1207                 //    who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH); 
    1208  
    1209                 //Begin melee attack if we are within range 
    1210                 AttackStart(who); 
    1211             } 
    1212         } 
     1206        // do we need this? 
     1207        //if (m_creature->isCivilian() && m_creature->IsNeutralToAll()) 
     1208        //    return; 
     1209 
     1210        if(m_creature->canStartAttack(who)) 
     1211            AttackStart(who); 
    12131212    } 
    12141213 
     
    12931292                        if (!((*i).Event.event_inverse_phase_mask & (1 << Phase))) 
    12941293                            (*i).Time -= EventDiff; 
     1294 
    12951295                        //Skip processing of events that have time remaining 
    12961296                        continue; 
     
    13291329        if (Combat && MeleeEnabled) 
    13301330            DoMeleeAttackIfReady(); 
     1331 
    13311332    } 
    13321333}; 
  • trunk/src/bindings/scripts/scripts/creature/mob_event_ai.h

    r206 r269  
    11/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> 
    2 * This program is free software licensed under GPL version 2 
    3 * Please see the included DOCS/LICENSE.TXT for more information */ 
     2 * This program is free software licensed under GPL version 2 
     3 * Please see the included DOCS/LICENSE.TXT for more information */ 
    44 
    55#ifndef SC_EVENTAI_H 
     
    7777    ACTION_T_ZONE_COMBAT_PULSE      = 38,   //No Params 
    7878 
     79    ACTION_T_SET_ACTIVE             = 101,  //Apply 
     80    ACTION_T_SET_AGGRESSIVE         = 102,  //Apply 
     81    ACTION_T_ATTACK_START_PULSE     = 103,  //Distance 
     82 
    7983    ACTION_T_END, 
    8084};