- Timestamp:
- 11/19/08 13:41:20 (17 years ago)
- Location:
- trunk/src/bindings/scripts/scripts/zone/zulaman
- Files:
-
- 2 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bindings/scripts/scripts/zone/zulaman/boss_akilzon.cpp
r90 r154 29 29 #include "Weather.h" 30 30 31 #define SPELL_STATIC_DISRUPTION 32 #define SPELL_STATIC_VISUAL 33 #define SPELL_CALL_LIGHTNING 34 #define SPELL_GUST_OF_WIND 35 #define SPELL_ELECTRICAL_STORM 36 #define SPELL_BERSERK 37 38 #define SPELL_EAGLE_SWOOP 31 #define SPELL_STATIC_DISRUPTION 43622 32 #define SPELL_STATIC_VISUAL 45265 33 #define SPELL_CALL_LIGHTNING 43661 //Missing timer 34 #define SPELL_GUST_OF_WIND 43621 35 #define SPELL_ELECTRICAL_STORM 43648 36 #define SPELL_BERSERK 45078 37 #define SPELL_ELECTRICAL_OVERLOAD 43658 38 #define SPELL_EAGLE_SWOOP 44732 39 39 40 40 //"Your death gonna be quick, strangers. You shoulda never have come to this place..." … … 64 64 boss_akilzonAI(Creature *c) : ScriptedAI(c) 65 65 { 66 SpellEntry *TempSpell = (SpellEntry*)GetSpellStore()->LookupEntry(SPELL_ELECTRICAL_STORM); 67 if(TempSpell) 68 TempSpell->Effect[1] = 0;//disable bugged lightning until fixed in core 66 69 pInstance = ((ScriptedInstance*)c->GetInstanceData()); 67 70 Reset(); … … 69 72 ScriptedInstance *pInstance; 70 73 74 uint64 BirdGUIDs[8]; 71 75 uint64 TargetGUID; 72 76 uint64 CycloneGUID; … … 77 81 uint32 CallLighting_Timer; 78 82 uint32 ElectricalStorm_Timer; 79 uint32 SDisruptAOEVisual_Timer;80 83 uint32 SummonEagles_Timer; 81 84 uint32 Enrage_Timer; … … 96 99 ElectricalStorm_Timer = 60*1000; //60 seconds(bosskillers) 97 100 Enrage_Timer = 10*60*1000; //10 minutes till enrage(bosskillers) 98 SDisruptAOEVisual_Timer = 99999;99 101 SummonEagles_Timer = 99999; 100 102 … … 102 104 CloudGUID = 0; 103 105 CycloneGUID = 0; 106 DespawnSummons(); 107 for(uint8 i = 0; i < 8; i++) 108 BirdGUIDs[i] = 0; 104 109 105 110 StormCount = 0; … … 107 112 108 113 isRaining = false; 109 110 DespawnSummons(MOB_SOARING_EAGLE); 114 111 115 SetWeather(WEATHER_STATE_FINE, 0.0f); 112 116 } … … 116 120 DoYell(SAY_ONAGGRO, LANG_UNIVERSAL, NULL); 117 121 DoPlaySoundToSet(m_creature, SOUND_ONAGGRO); 118 DoZoneInCombat();122 //DoZoneInCombat(); 119 123 if(pInstance) 120 124 pInstance->SetData(DATA_AKILZONEVENT, IN_PROGRESS); … … 127 131 if(pInstance) 128 132 pInstance->SetData(DATA_AKILZONEVENT, DONE); 129 DespawnSummons( MOB_SOARING_EAGLE);133 DespawnSummons(); 130 134 } 131 135 … … 145 149 } 146 150 147 void DespawnSummons(uint32 entry) 148 { 149 std::list<Creature*> templist; 150 float x, y, z; 151 m_creature->GetPosition(x, y, z); 152 153 { 154 CellPair pair(Trinity::ComputeCellPair(x, y)); 155 Cell cell(pair); 156 cell.data.Part.reserved = ALL_DISTRICT; 157 cell.SetNoCreate(); 158 159 Trinity::AllCreaturesOfEntryInRange check(m_creature, entry, 100); 160 Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange> searcher(templist, check); 161 162 TypeContainerVisitor<Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange>, GridTypeMapContainer> cSearcher(searcher); 163 164 CellLock<GridReadGuard> cell_lock(cell, pair); 165 cell_lock->Visit(cell_lock, cSearcher, *(m_creature->GetMap())); 166 } 167 168 for(std::list<Creature*>::iterator i = templist.begin(); i != templist.end(); ++i) 169 { 170 (*i)->SetVisibility(VISIBILITY_OFF); 171 (*i)->setDeathState(JUST_DIED); 172 } 173 } 174 175 Player* SelectRandomPlayer(float range = 0.0f, bool alive = true) 176 { 177 Map *map = m_creature->GetMap(); 178 if (!map->IsDungeon()) return NULL; 179 180 InstanceMap::PlayerList PlayerList = ((InstanceMap*)map)->GetPlayers(); 181 InstanceMap::PlayerList::iterator i; 182 while(PlayerList.size()) 183 { 184 i = PlayerList.begin(); 185 advance(i, rand()%PlayerList.size()); 186 if((range == 0.0f || m_creature->IsWithinDistInMap(*i, range)) 187 && (!alive || (*i)->isTargetableForAttack())) 188 return *i; 189 else 190 PlayerList.erase(i); 191 } 192 return NULL; 151 void DespawnSummons() 152 { 153 for (uint8 i = 0; i < 8; i++) 154 { 155 Unit* bird = Unit::GetUnit(*m_creature,BirdGUIDs[i]); 156 if(bird && bird->isAlive()) 157 { 158 bird->SetVisibility(VISIBILITY_OFF); 159 bird->setDeathState(JUST_DIED); 160 } 161 } 193 162 } 194 163 … … 231 200 cell_lock->Visit(cell_lock, grid_unit_searcher, *(m_creature->GetMap())); 232 201 } 233 234 235 { 236 if(!Cloud->IsWithinDistInMap(*i, 15))202 //dealdamege 203 for(std::list<Unit*>::iterator i = tempUnitMap.begin(); i != tempUnitMap.end(); ++i) 204 { 205 if(Cloud->GetDistance2d(*i)>= 6) 237 206 { 238 float x, y, z; 239 (*i)->GetPosition(x, y, z); 240 x = rand()%2 ? x + rand()%5 : x - rand()%5; 241 y = rand()%2 ? y + rand()%5 : y - rand()%5; 242 z = Cloud->GetPositionZ() + 2 - rand()%4; 243 if(Unit *trigger = m_creature->SummonCreature(MOB_TEMP_TRIGGER, x, y, z, 0, TEMPSUMMON_TIMED_DESPAWN, 2000)) 244 { 245 trigger->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING); 246 trigger->StopMoving(); 247 trigger->CastSpell(trigger, 37248, true); 248 trigger->CastCustomSpell(*i, 43137, &bp0, NULL, NULL, true, 0, 0, m_creature->GetGUID()); 249 } 207 Cloud->CastCustomSpell(*i, 43137, &bp0, NULL, NULL, true, 0, 0, m_creature->GetGUID()); 250 208 } 251 } 252 209 } 253 210 // visual 254 float x, y, z; 255 for(uint8 i = 0; i < StormCount; ++i) 256 { 257 Cloud->GetPosition(x, y, z); 258 x = rand()%2 ? x + rand()%10 : x - rand()%10; 259 y = rand()%2 ? y + rand()%10 : y - rand()%10; 260 z = z + 2 - rand()%4; 211 float x,y,z; 212 z = m_creature->GetPositionZ(); 213 for(uint8 i = 0; i < 5+rand()%5; ++i) 214 { 215 x = 343+rand()%60; 216 y = 1380+rand()%60; 261 217 if(Unit *trigger = m_creature->SummonCreature(MOB_TEMP_TRIGGER, x, y, z, 0, TEMPSUMMON_TIMED_DESPAWN, 2000)) 262 218 { 263 trigger->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING); 264 trigger->StopMoving(); 265 trigger->CastSpell(trigger, 37248, true); 219 trigger->setFaction(35); 220 trigger->SetMaxHealth(100000); 221 trigger->SetHealth(100000); 222 trigger->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); 223 if (Cloud) 224 Cloud->CastCustomSpell(trigger, /*43661*/43137, &bp0, NULL, NULL,true, 0, 0, Cloud->GetGUID()); 266 225 } 267 Cloud->GetPosition(x, y, z); 268 x = rand()%2 ? x + 10 + rand()%10 : x - 10 - rand()%10; 269 y = rand()%2 ? y + 10 + rand()%10 : y - 10 - rand()%10; 270 if(Unit *trigger = m_creature->SummonCreature(MOB_TEMP_TRIGGER, x, y, m_creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 2000)) 271 { 272 trigger->SetMaxHealth(9999999); 273 trigger->SetHealth(9999999); 274 trigger->CastSpell(trigger, 43661, true); 275 } 276 } 277 } 278 226 } 227 } 279 228 StormCount++; 280 229 if(StormCount > 10) … … 283 232 SummonEagles_Timer = 5000; 284 233 m_creature->InterruptNonMeleeSpells(false); 285 Cloud->RemoveAurasDueToSpell(45213);286 234 CloudGUID = 0; 287 if(Unit* Cyclone = Unit::GetUnit(*m_creature, CycloneGUID))288 Cyclone->RemoveAurasDueToSpell(25160); 235 if (Cloud) 236 Cloud->DealDamage(Cloud, Cloud->GetHealth(),NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); 289 237 SetWeather(WEATHER_STATE_FINE, 0.0f); 290 238 isRaining = false; 291 239 } 292 293 240 StormSequenceTimer = 1000; 294 241 } … … 331 278 StaticDisruption_Timer = (10+rand()%8)*1000; // < 20s 332 279 333 float dist = m_creature->GetDistance(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ());280 /*float dist = m_creature->GetDistance(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ()); 334 281 if (dist < 5.0f) dist = 5.0f; 335 SDisruptAOEVisual_Timer = 1000 + floor(dist / 30 * 1000.0f); 282 SDisruptAOEVisual_Timer = 1000 + floor(dist / 30 * 1000.0f);*/ 336 283 }else StaticDisruption_Timer -= diff; 337 338 if (SDisruptAOEVisual_Timer < diff) {339 Unit* SDVictim = Unit::GetUnit((*m_creature), TargetGUID);340 if(SDVictim && SDVictim->isAlive())341 SDVictim->CastSpell(SDVictim, SPELL_STATIC_VISUAL, true);342 SDisruptAOEVisual_Timer = 99999;343 TargetGUID = 0;344 }else SDisruptAOEVisual_Timer -= diff;345 284 346 285 if (GustOfWind_Timer < diff) { … … 362 301 363 302 if (ElectricalStorm_Timer < diff) { 364 Unit* target = SelectRandomPlayer(50); 365 if(!target) target = m_creature->getVictim(); 366 float x, y, z; 367 target->GetPosition(x, y, z); 368 Unit *Cloud = m_creature->SummonCreature(MOB_TEMP_TRIGGER, x, y, m_creature->GetPositionZ() + 10, 0, TEMPSUMMON_TIMED_DESPAWN, 15000); 303 Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0, 50, true); 304 if(!target) 305 { 306 EnterEvadeMode(); 307 return; 308 } 309 target->CastSpell(target, 44007, true);//cloud visual 310 m_creature->CastSpell(target, SPELL_ELECTRICAL_STORM, false);//storm cyclon + visual 311 float x,y,z; 312 target->GetPosition(x,y,z); 313 if (target) 314 { 315 target->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING); 316 target->SendMonsterMove(x,y,m_creature->GetPositionZ()+15,0,0,0); 317 } 318 Unit *Cloud = m_creature->SummonCreature(MOB_TEMP_TRIGGER, x, y, m_creature->GetPositionZ()+16, 0, TEMPSUMMON_TIMED_DESPAWN, 15000); 369 319 if(Cloud) 370 320 { 371 372 321 CloudGUID = Cloud->GetGUID(); 322 Cloud->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING); 373 323 Cloud->StopMoving(); 374 Cloud->SetFloatValue(OBJECT_FIELD_SCALE_X, 3.0f);375 324 Cloud->SetFloatValue(OBJECT_FIELD_SCALE_X, 1.0f); 325 Cloud->setFaction(35); 376 326 Cloud->SetMaxHealth(9999999); 377 327 Cloud->SetHealth(9999999); 378 Cloud->CastSpell(Cloud, 45213, true); // cloud visual379 m_creature->StopMoving();380 328 Cloud->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); 381 m_creature->CastSpell(Cloud, 43501, false); // siphon soul382 }383 Unit *Cyclone = m_creature->SummonCreature(MOB_TEMP_TRIGGER, x, y, z, 0, TEMPSUMMON_TIMED_DESPAWN, 15000);384 if(Cyclone)385 {386 Cyclone->CastSpell(Cyclone, 25160, true); // wind visual387 CycloneGUID = Cyclone->GetGUID();388 329 } 389 330 ElectricalStorm_Timer = 60000; //60 seconds(bosskillers) … … 399 340 float x, y, z; 400 341 m_creature->GetPosition(x, y, z); 401 for (uint8 i = 0; i < 6 + rand()%3; i++) 402 { 403 if(Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) 404 { 405 x = target->GetPositionX() + 10 - rand()%20; 406 y = target->GetPositionY() + 10 - rand()%20; 407 z = target->GetPositionZ() + 6 + rand()%5 + 10; 408 if(z > 95) z = 95 - rand()%5; 409 } 410 411 Creature *pCreature = m_creature->SummonCreature(MOB_SOARING_EAGLE, x, y, z, 0, TEMPSUMMON_CORPSE_DESPAWN, 0); 412 if (pCreature) 413 { 414 pCreature->AddThreat(m_creature->getVictim(), 1.0f); 415 pCreature->AI()->AttackStart(m_creature->getVictim()); 416 } 417 } 342 343 for (uint8 i = 0; i < 8; i++) 344 { 345 Unit* bird = Unit::GetUnit(*m_creature,BirdGUIDs[i]); 346 if(!bird)//they despawned on die 347 { 348 if(Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) 349 { 350 x = target->GetPositionX() + 10 - rand()%20; 351 y = target->GetPositionY() + 10 - rand()%20; 352 z = target->GetPositionZ() + 6 + rand()%5 + 10; 353 if(z > 95) z = 95 - rand()%5; 354 } 355 Creature *pCreature = m_creature->SummonCreature(MOB_SOARING_EAGLE, x, y, z, 0, TEMPSUMMON_CORPSE_DESPAWN, 0); 356 if (pCreature) 357 { 358 pCreature->AddThreat(m_creature->getVictim(), 1.0f); 359 pCreature->AI()->AttackStart(m_creature->getVictim()); 360 BirdGUIDs[i] = pCreature->GetGUID(); 361 } 362 } 363 } 418 364 SummonEagles_Timer = 999999; 419 365 } else SummonEagles_Timer -= diff; -
trunk/src/bindings/scripts/scripts/zone/zulaman/boss_halazzi.cpp
r117 r154 19 19 SD%Complete: 80 20 20 SDComment: 21 SDCategory: Zul ¡äAman21 SDCategory: Zul'Aman 22 22 EndScriptData */ 23 23 … … 180 180 case PHASE_HUMAN: 181 181 //DoCast(m_creature, SPELL_SUMMON_LYNX, true); 182 DoSpawnCreature(MOB_SPIRIT_LYNX, 0,0,0,0, TEMPSUMMON_CORPSE_DESPAWN, 0);182 DoSpawnCreature(MOB_SPIRIT_LYNX, 5,5,0,0, TEMPSUMMON_CORPSE_DESPAWN, 0); 183 183 m_creature->SetMaxHealth(400000); 184 184 m_creature->SetHealth(400000); … … 266 266 if(CheckTimer < diff) 267 267 { 268 if( m_creature->GetHealth() * 10 < m_creature->GetMaxHealth())268 if( ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() <= 20)/*m_creature->GetHealth() * 10 < m_creature->GetMaxHealth()*/) 269 269 EnterPhase(PHASE_MERGE); 270 270 else 271 271 { 272 272 Unit *Lynx = Unit::GetUnit(*m_creature, LynxGUID); 273 if(Lynx && Lynx->GetHealth() * 10 < Lynx->GetMaxHealth())273 if(Lynx && ((Lynx->GetHealth()*100) / Lynx->GetMaxHealth() <= 20)/*Lynx->GetHealth() * 10 < Lynx->GetMaxHealth()*/) 274 274 EnterPhase(PHASE_MERGE); 275 275 } … … 283 283 { 284 284 Unit *Lynx = Unit::GetUnit(*m_creature, LynxGUID); 285 if(Lynx && m_creature->IsWithinDistInMap(Lynx, 6.0f)) 286 { 287 if(TransformCount < 3) 288 EnterPhase(PHASE_LYNX); 289 else 290 EnterPhase(PHASE_ENRAGE); 291 } 285 if(Lynx) 286 { 287 Lynx->GetMotionMaster()->MoveFollow(m_creature, 0, 0); 288 m_creature->GetMotionMaster()->MoveFollow(Lynx, 0, 0); 289 if(m_creature->IsWithinDistInMap(Lynx, 6.0f)) 290 { 291 if(TransformCount < 3) 292 EnterPhase(PHASE_LYNX); 293 else 294 EnterPhase(PHASE_ENRAGE); 295 } 296 } 292 297 CheckTimer = 1000; 293 298 }else CheckTimer -= diff; … … 350 355 } 351 356 352 void Aggro(Unit *who) { DoZoneInCombat();}357 void Aggro(Unit *who) {/*DoZoneInCombat();*/} 353 358 354 359 void UpdateAI(const uint32 diff)