diff options
| author | QAston <none@none> | 2009-07-18 23:41:42 +0200 |
|---|---|---|
| committer | QAston <none@none> | 2009-07-18 23:41:42 +0200 |
| commit | 53c62aceadc4d4359437a8bccbbe7993bda4e510 (patch) | |
| tree | 8cded2a08b84e1aeb6a5762018148109e93bbac9 /src/bindings | |
| parent | 5f3f62222670f70a0c278b76ce91601814da1f3f (diff) | |
| parent | c8342ca8ce3f49d1c53fa3bfb69f26197e032cc0 (diff) | |
*Merge.
--HG--
branch : trunk
Diffstat (limited to 'src/bindings')
6 files changed, 112 insertions, 12 deletions
diff --git a/src/bindings/scripts/scripts/npc/npcs_special.cpp b/src/bindings/scripts/scripts/npc/npcs_special.cpp index ac1cb635d31..67105b192f4 100644 --- a/src/bindings/scripts/scripts/npc/npcs_special.cpp +++ b/src/bindings/scripts/scripts/npc/npcs_special.cpp @@ -1566,6 +1566,76 @@ CreatureAI* GetAI_npc_snake_trap_serpents(Creature *_Creature) return new npc_snake_trap_serpentsAI(_Creature); } +struct TRINITY_DLL_DECL mob_mojoAI : public ScriptedAI +{ + mob_mojoAI(Creature *c) : ScriptedAI(c) {Reset();} + uint32 hearts; + uint64 victimGUID; + void Reset() + { + victimGUID = 0; + hearts = 15000; + Unit* own = m_creature->GetOwner(); + if (own) + m_creature->GetMotionMaster()->MoveFollow(own,0,0); + } + void Aggro(Unit *who){} + void UpdateAI(const uint32 diff) + { + if(m_creature->HasAura(20372,0)) + { + if(hearts<diff) + { + m_creature->RemoveAurasDueToSpell(20372); + hearts = 15000; + }hearts-=diff; + } + } + void ReceiveEmote(Player *player, uint32 emote) + { + m_creature->HandleEmoteCommand(emote); + Unit* own = m_creature->GetOwner(); + if (own && ((Player*)own)->GetTeam() != player->GetTeam()) + return; + if (emote == TEXTEMOTE_KISS) + { + std::string whisp = ""; + switch (rand()%8) + { + case 0:whisp.append("Now that's what I call froggy-style!");break; + case 1:whisp.append("Your lily pad or mine?");break; + case 2:whisp.append("This won't take long, did it?");break; + case 3:whisp.append("I thought you'd never ask!");break; + case 4:whisp.append("I promise not to give you warts...");break; + case 5:whisp.append("Feelin' a little froggy, are ya?");break; + case 6: + whisp.append("Listen, "); + whisp.append(player->GetName()); + whisp.append(", I know of a little swamp not too far from here...."); + break; + case 7:whisp.append("There's just never enough Mojo to go around...");break; + } + m_creature->MonsterWhisper(whisp.c_str(),player->GetGUID()); + if(victimGUID) + { + Player* victim = Unit::GetPlayer(victimGUID); + if(victim) + victim->RemoveAura(43906);//remove polymorph frog thing + } + m_creature->AddAura(43906,player);//add polymorph frog thing + victimGUID = player->GetGUID(); + m_creature->CastSpell(m_creature,20372,true);//tag.hearts + m_creature->GetMotionMaster()->MoveFollow(player,0,0); + hearts = 15000; + } + } +}; + +CreatureAI* GetAI_mob_mojo(Creature *_Creature) +{ + return new mob_mojoAI (_Creature); +} + void AddSC_npcs_special() { Script *newscript; @@ -1656,5 +1726,10 @@ void AddSC_npcs_special() newscript->Name="npc_snake_trap_serpents"; newscript->GetAI = &GetAI_npc_snake_trap_serpents; newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_mojo"; + newscript->GetAI = &GetAI_mob_mojo; + newscript->RegisterSelf(); } diff --git a/src/bindings/scripts/scripts/zone/black_temple/boss_supremus.cpp b/src/bindings/scripts/scripts/zone/black_temple/boss_supremus.cpp index 6fc202f2105..2c64c7657e4 100644 --- a/src/bindings/scripts/scripts/zone/black_temple/boss_supremus.cpp +++ b/src/bindings/scripts/scripts/zone/black_temple/boss_supremus.cpp @@ -58,8 +58,10 @@ struct TRINITY_DLL_DECL molten_flameAI : public NullCreatureAI void InitializeAI() { float x, y, z; - me->GetNearPoint(me, x, y, z, 1, 50, M_PI*2*rand_norm()); + me->GetNearPoint(me, x, y, z, 1, 100, M_PI*2*rand_norm()); me->GetMotionMaster()->MovePoint(0, x, y, z); + me->SetVisibility(VISIBILITY_OFF); + me->CastSpell(me,SPELL_MOLTEN_FLAME,true); } }; @@ -205,7 +207,8 @@ struct TRINITY_DLL_DECL boss_supremusAI : public ScriptedAI if(!target) target = m_creature->getVictim(); if(target) { - DoCast(target, SPELL_VOLCANIC_SUMMON); + //DoCast(target, SPELL_VOLCANIC_SUMMON);//movement bugged + m_creature->SummonCreature(CREATURE_VOLCANO,target->GetPositionX(),target->GetPositionY(),target->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN,30000); DoScriptText(EMOTE_GROUND_CRACK, m_creature); events.DelayEvents(1500, GCD_CAST); } @@ -222,17 +225,19 @@ struct TRINITY_DLL_DECL boss_supremusAI : public ScriptedAI } }; -struct TRINITY_DLL_DECL npc_volcanoAI : public ScriptedAI +struct TRINITY_DLL_DECL npc_volcanoAI : public Scripted_NoMovementAI { - npc_volcanoAI(Creature *c) : ScriptedAI(c) {} + npc_volcanoAI(Creature *c) : Scripted_NoMovementAI(c) {} void Reset() { m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - DoCast(m_creature, SPELL_VOLCANIC_ERUPTION); + //DoCast(m_creature, SPELL_VOLCANIC_ERUPTION); me->SetReactState(REACT_PASSIVE); + wait = 3000; } + uint32 wait; void EnterCombat(Unit *who) {} @@ -243,7 +248,15 @@ struct TRINITY_DLL_DECL npc_volcanoAI : public ScriptedAI m_creature->RemoveAura(SPELL_VOLCANIC_ERUPTION); } - void UpdateAI(const uint32 diff) {} + void UpdateAI(const uint32 diff) + { + if(wait<=diff)//wait 3secs before casting + { + DoCast(m_creature, SPELL_VOLCANIC_ERUPTION); + wait = 60000; + } + else wait -= diff; + } }; diff --git a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_hydross_the_unstable.cpp b/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_hydross_the_unstable.cpp index e34dd9cf807..bd7f786defe 100644 --- a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_hydross_the_unstable.cpp +++ b/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_hydross_the_unstable.cpp @@ -56,7 +56,7 @@ EndScriptData */ #define SPELL_ENRAGE 27680 //this spell need verification #define SPELL_SUMMON_WATER_ELEMENT 36459 //not in use yet(in use ever?) #define SPELL_ELEMENTAL_SPAWNIN 25035 -#define SPELL_BLUE_BEAM /*40227*/40227 //channeled Hydross Beam Helper (not in use yet) +#define SPELL_BLUE_BEAM 40227 //channeled Hydross Beam Helper (not in use yet) #define ENTRY_PURE_SPAWN 22035 #define ENTRY_TAINTED_SPAWN 22036 @@ -324,7 +324,7 @@ struct TRINITY_DLL_DECL boss_hydross_the_unstableAI : public ScriptedAI //WaterTomb_Timer if (WaterTomb_Timer < diff) { - Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0); + Unit *target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true); if (target) DoCast(target, SPELL_WATER_TOMB); diff --git a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_lady_vashj.cpp b/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_lady_vashj.cpp index 8c183685815..28e8a4d5e6e 100644 --- a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_lady_vashj.cpp +++ b/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_lady_vashj.cpp @@ -365,7 +365,7 @@ struct TRINITY_DLL_DECL boss_lady_vashjAI : public ScriptedAI //Static Charge //Used on random people (only 1 person at any given time) in Phases 1 and 3, it's a debuff doing 2775 to 3225 Nature damage to the target and everybody in about 5 yards around it, every 1 seconds for 30 seconds. It can be removed by Cloak of Shadows, Iceblock, Divine Shield, etc, but not by Cleanse or Dispel Magic. Unit *target = NULL; - target = SelectUnit(SELECT_TARGET_RANDOM, 0); + target = SelectTarget(SELECT_TARGET_RANDOM, 0, 200, true); if(target && !target->HasAura(SPELL_STATIC_CHARGE_TRIGGER)) //cast Static Charge every 2 seconds for 20 seconds diff --git a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_leotheras_the_blind.cpp b/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_leotheras_the_blind.cpp index d0abd5edbd6..3b6316412a5 100644 --- a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_leotheras_the_blind.cpp +++ b/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_leotheras_the_blind.cpp @@ -111,10 +111,19 @@ struct TRINITY_DLL_DECL mob_inner_demonAI : public ScriptedAI if (m_creature->getVictim()->GetGUID() != victimGUID) { + DoModifyThreatPercent(m_creature->getVictim(), -100); Unit* owner = Unit::GetUnit((*m_creature),victimGUID); - if (owner) - AttackStart(owner); + if (owner && owner->isAlive()) + { + m_creature->AddThreat(owner,999999); + AttackStart(owner); + }else if(owner && owner->isDead()) + { + m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + return; + } } + if(Link_Timer < diff) { DoCast(m_creature->getVictim(), SPELL_SOUL_LINK, true); @@ -433,6 +442,7 @@ struct TRINITY_DLL_DECL boss_leotheras_the_blindAI : public ScriptedAI //Enrage_Timer ( 10 min ) if(Berserk_Timer < diff && !EnrageUsed) { + m_creature->InterruptNonMeleeSpells(false); DoCast(m_creature, SPELL_BERSERK); EnrageUsed = true; }else Berserk_Timer -= diff; @@ -550,6 +560,8 @@ struct TRINITY_DLL_DECL boss_leotheras_the_blindAI : public ScriptedAI if (!IsFinalForm && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 15) { //at this point he divides himself in two parts + CastConsumingMadness(); + DespawnDemon(); Creature *Copy = NULL; Copy = DoSpawnCreature(DEMON_FORM, 0, 0, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 6000); if(Copy) diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_void_reaver.cpp b/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_void_reaver.cpp index 61286347b83..137e7270dc0 100644 --- a/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_void_reaver.cpp +++ b/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_void_reaver.cpp @@ -128,7 +128,7 @@ struct TRINITY_DLL_DECL boss_void_reaverAI : public ScriptedAI target = *(target_list.begin()+rand()%target_list.size()); if (target) - m_creature->CastSpell(target->GetPositionX(),target->GetPositionY(),target->GetPositionZ(), SPELL_ARCANE_ORB, false); + m_creature->CastSpell(target->GetPositionX(),target->GetPositionY(),target->GetPositionZ(), SPELL_ARCANE_ORB, false, NULL, NULL, NULL, target); ArcaneOrb_Timer = 3000; }else ArcaneOrb_Timer -= diff; |
