Changeset 269
- Timestamp:
- 11/21/08 22:20:21 (17 years ago)
- 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 7 7 * This program is distributed in the hope that it will be useful, 8 8 * but WITHOUT ANY WARRANTY; without even the implied warranty of 9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 10 * GNU General Public License for more details. 11 11 * 12 12 * You should have received a copy of the GNU General Public License 13 13 * along with this program; if not, write to the Free Software 14 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307USA14 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 15 15 */ 16 16 … … 965 965 DoZoneInCombat(); 966 966 } 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)); 967 978 break; 968 979 } … … 1193 1204 } 1194 1205 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); 1213 1212 } 1214 1213 … … 1293 1292 if (!((*i).Event.event_inverse_phase_mask & (1 << Phase))) 1294 1293 (*i).Time -= EventDiff; 1294 1295 1295 //Skip processing of events that have time remaining 1296 1296 continue; … … 1329 1329 if (Combat && MeleeEnabled) 1330 1330 DoMeleeAttackIfReady(); 1331 1331 1332 } 1332 1333 }; -
trunk/src/bindings/scripts/scripts/creature/mob_event_ai.h
r206 r269 1 1 /* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> 2 * This program is free software licensed under GPL version 23 * 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 */ 4 4 5 5 #ifndef SC_EVENTAI_H … … 77 77 ACTION_T_ZONE_COMBAT_PULSE = 38, //No Params 78 78 79 ACTION_T_SET_ACTIVE = 101, //Apply 80 ACTION_T_SET_AGGRESSIVE = 102, //Apply 81 ACTION_T_ATTACK_START_PULSE = 103, //Distance 82 79 83 ACTION_T_END, 80 84 };