diff options
| author | n0n4m3 <none@none> | 2009-12-20 06:00:39 +0100 |
|---|---|---|
| committer | n0n4m3 <none@none> | 2009-12-20 06:00:39 +0100 |
| commit | 18d5940f5cdc50bd9138a8f2b9393a91582587cc (patch) | |
| tree | d0ba4b195286da22b8e4cac779b60ad1525ef05c /src/bindings | |
| parent | 5c9bd7ecd90b04f563dc8cea23b89a8d333e56b8 (diff) | |
| parent | a21f0da24fe99becc06eb2a08016d7acb4d82027 (diff) | |
merge
--HG--
branch : trunk
Diffstat (limited to 'src/bindings')
| -rw-r--r-- | src/bindings/scripts/scripts/northrend/utgarde_keep/utgarde_pinnacle/boss_palehoof.cpp | 2 | ||||
| -rw-r--r-- | src/bindings/scripts/scripts/northrend/zuldrak.cpp | 49 |
2 files changed, 25 insertions, 26 deletions
diff --git a/src/bindings/scripts/scripts/northrend/utgarde_keep/utgarde_pinnacle/boss_palehoof.cpp b/src/bindings/scripts/scripts/northrend/utgarde_keep/utgarde_pinnacle/boss_palehoof.cpp index 64759d62b94..49dc134eb51 100644 --- a/src/bindings/scripts/scripts/northrend/utgarde_keep/utgarde_pinnacle/boss_palehoof.cpp +++ b/src/bindings/scripts/scripts/northrend/utgarde_keep/utgarde_pinnacle/boss_palehoof.cpp @@ -737,7 +737,7 @@ struct TRINITY_DLL_DECL mob_palehoof_orbAI : public ScriptedAI { if (type != POINT_MOTION_TYPE) return; - if(id<0&&id>4) + if(id<0 || id>4) return; Creature *pNext; switch(id) diff --git a/src/bindings/scripts/scripts/northrend/zuldrak.cpp b/src/bindings/scripts/scripts/northrend/zuldrak.cpp index 00129033b56..1b099152397 100644 --- a/src/bindings/scripts/scripts/northrend/zuldrak.cpp +++ b/src/bindings/scripts/scripts/northrend/zuldrak.cpp @@ -40,39 +40,37 @@ struct TRINITY_DLL_DECL npc_drakuru_shacklesAI : public ScriptedAI void Reset() { + Rageclaw = NULL; m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + float x, y, z; - Rageclaw = NULL; - m_creature->GetClosePoint(x, y, z, m_creature->GetObjectSize()/3,0.1); - if (Unit* summon = m_creature->SummonCreature(NPC_RAGECLAW,x,y,z,0,TEMPSUMMON_DEAD_DESPAWN,1000)) - DoActionOnRageclaw(true,summon); + m_creature->GetClosePoint(x, y, z, m_creature->GetObjectSize() / 3, 0.1f); + + if (Unit* summon = m_creature->SummonCreature(NPC_RAGECLAW, x, y, z, + 0, TEMPSUMMON_DEAD_DESPAWN, 1000)) + { + Rageclaw = summon; + LockRageclaw(); + } + } + + void LockRageclaw() + { + m_creature->SetInFront(Rageclaw); + Rageclaw->SetInFront(m_creature); + + DoCast(Rageclaw, SPELL_LEFT_CHAIN, true); + DoCast(Rageclaw, SPELL_RIGHT_CHAIN, true); } - void DoActionOnRageclaw(bool bLocking, Unit* pWho) + void UnlockRageclaw(Unit* pWho) { if (!pWho) return; - Rageclaw = pWho; + DoCast(Rageclaw, SPELL_FREE_RAGECLAW, true); - if (bLocking) - { - if (pWho) - { - m_creature->SetInFront(Rageclaw); - Rageclaw->SetInFront(m_creature); - - DoCast(Rageclaw, SPELL_LEFT_CHAIN, true); - DoCast(Rageclaw, SPELL_RIGHT_CHAIN, true); - } - } - else - { - DoCast(Rageclaw, SPELL_FREE_RAGECLAW, true); - if (pWho->GetTypeId() == TYPEID_PLAYER) - CAST_PLR(pWho)->CastSpell(Rageclaw, SPELL_UNLOCK_SHACKLE, true); - m_creature->setDeathState(DEAD); - } + m_creature->setDeathState(DEAD); } void SpellHit(Unit* pCaster, const SpellEntry* pSpell) @@ -80,13 +78,14 @@ struct TRINITY_DLL_DECL npc_drakuru_shacklesAI : public ScriptedAI if (pSpell->Id == SPELL_UNLOCK_SHACKLE) { if (Rageclaw) - DoActionOnRageclaw(false, pCaster); + UnlockRageclaw(pCaster); else m_creature->setDeathState(JUST_DIED); } } }; + CreatureAI* GetAI_npc_drakuru_shackles(Creature* pCreature) { return new npc_drakuru_shacklesAI (pCreature); |
