Changeset 202
- Timestamp:
- 11/19/08 13:45:54 (17 years ago)
- Location:
- trunk/src/bindings/scripts
- Files:
-
- 3 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bindings/scripts/include/sc_creature.h
r174 r202 26 26 struct TRINITY_DLL_DECL ScriptedAI : public CreatureAI 27 27 { 28 ScriptedAI(Creature* creature) : m_creature(creature), InCombat(false) {}28 ScriptedAI(Creature* creature) : m_creature(creature), InCombat(false), IsFleeing(false) {} 29 29 ~ScriptedAI() {} 30 30 -
trunk/src/bindings/scripts/scripts/creature/mob_event_ai.cpp
r186 r202 1241 1241 return; 1242 1242 1243 if ((TimetoFleeLeft < diff || (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() != POINT_MOTION_TYPE && m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() != FLEEING_MOTION_TYPE)) && IsFleeing) 1244 { 1245 m_creature->GetMotionMaster()->Clear(false); 1246 m_creature->SetNoCallAssistence(false); 1247 m_creature->CallAssistence(); 1248 m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim()); 1249 IsFleeing = false; 1250 } 1251 else 1252 TimetoFleeLeft -= diff; 1253 1254 if(IsFleeing) 1243 if (IsFleeing) 1244 { 1245 if(TimetoFleeLeft < diff 1246 || m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() != POINT_MOTION_TYPE 1247 && m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() != FLEEING_MOTION_TYPE) 1248 { 1249 m_creature->GetMotionMaster()->Clear(false); 1250 m_creature->SetNoCallAssistence(false); 1251 m_creature->CallAssistence(); 1252 if(m_creature->getVictim()) 1253 m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim()); 1254 IsFleeing = false; 1255 } 1256 else 1257 TimetoFleeLeft -= diff; 1258 1255 1259 return; 1260 } 1256 1261 1257 1262 //Events are only updated once every EVENT_UPDATE_TIME ms to prevent lag with large amount of events … … 1275 1280 } 1276 1281 } 1277 1282 } 1278 1283 1279 1284 //Check for time based events … … 1282 1287 //Decrement Timers 1283 1288 if ((*i).Time) 1284 1285 1289 { 1286 1290 if ((*i).Time > EventDiff) 1287 1291 { 1288 1292 //Do not decrement timers if event cannot trigger in this phase 1289 1293 if (!((*i).Event.event_inverse_phase_mask & (1 << Phase))) 1290 1294 (*i).Time -= EventDiff; … … 1308 1312 case EVENT_T_FRIENDLY_HP: 1309 1313 if( Combat ) 1310 1314 ProcessEvent(*i); 1311 1315 break; 1312 1316 } 1313 1317 } 1314 1318 1315 1319 EventDiff = 0; 1316 1320 EventUpdateTime = EVENT_UPDATE_TIME; 1317 }else 1321 } 1322 else 1318 1323 { 1319 1324 EventDiff += diff; … … 1324 1329 if (Combat && MeleeEnabled) 1325 1330 DoMeleeAttackIfReady(); 1326 1327 1331 } 1328 1332 }; -
trunk/src/bindings/scripts/scripts/zone/zulaman/boss_hexlord.cpp
r90 r202 482 482 return; 483 483 484 boss_hexlord_addAI::UpdateAI(diff);485 486 484 if(bloodlust_timer < diff) 487 485 { … … 500 498 cleave_timer = 12000; //3 sec cast 501 499 }else cleave_timer -= diff; 500 501 boss_hexlord_addAI::UpdateAI(diff); 502 502 } 503 503 }; … … 549 549 if(!m_creature->SelectHostilTarget() || !m_creature->getVictim() ) 550 550 return; 551 552 boss_hexlord_addAI::UpdateAI(diff);553 554 551 555 552 if(flashheal_timer < diff) … … 593 590 dispelmagic_timer = 12000; 594 591 }else dispelmagic_timer -= diff;*/ 592 593 boss_hexlord_addAI::UpdateAI(diff); 595 594 } 596 595 }; … … 635 634 if(!m_creature->SelectHostilTarget() || !m_creature->getVictim() ) 636 635 return; 637 638 boss_hexlord_addAI::UpdateAI(diff);639 636 640 637 if(firebolt_timer < diff) … … 643 640 firebolt_timer = 700; 644 641 }else firebolt_timer -= diff; 642 643 boss_hexlord_addAI::UpdateAI(diff); 645 644 } 646 645 }; … … 668 667 if(!m_creature->SelectHostilTarget() || !m_creature->getVictim() ) 669 668 return; 670 671 boss_hexlord_addAI::UpdateAI(diff);672 669 673 670 if (thunderclap_timer < diff) … … 682 679 flamebreath_timer = 12000; 683 680 }else flamebreath_timer -= diff; 681 682 boss_hexlord_addAI::UpdateAI(diff); 684 683 } 685 684 }; … … 704 703 if(!m_creature->SelectHostilTarget() || !m_creature->getVictim() ) 705 704 return; 706 707 boss_hexlord_addAI::UpdateAI(diff);708 705 709 706 if (psychicwail_timer < diff) … … 712 709 psychicwail_timer = 12000; 713 710 }else psychicwail_timer -= diff; 711 712 boss_hexlord_addAI::UpdateAI(diff); 714 713 } 715 714 }; … … 755 754 if(!m_creature->SelectHostilTarget() || !m_creature->getVictim() ) 756 755 return; 757 boss_hexlord_addAI::UpdateAI(diff);758 756 759 757 if (venomspit_timer < diff) … … 763 761 venomspit_timer = 2500; 764 762 }else venomspit_timer -= diff; 763 764 boss_hexlord_addAI::UpdateAI(diff); 765 765 } 766 766 }; … … 786 786 if(!m_creature->SelectHostilTarget() || !m_creature->getVictim() ) 787 787 return; 788 789 boss_hexlord_addAI::UpdateAI(diff);790 788 791 789 if (volatileinf_timer < diff) … … 795 793 volatileinf_timer = 12000; 796 794 }else volatileinf_timer -= diff; 795 796 boss_hexlord_addAI::UpdateAI(diff); 797 797 } 798 798 }; … … 822 822 if(!m_creature->SelectHostilTarget() || !m_creature->getVictim() ) 823 823 return; 824 825 boss_hexlord_addAI::UpdateAI(diff);826 824 827 825 if (mightyblow_timer < diff) … … 836 834 coldstare_timer = 12000; 837 835 } 836 837 boss_hexlord_addAI::UpdateAI(diff); 838 838 } 839 839 };