From 9ddfd5bf22269f8622f72ee3797a56b0dcc37422 Mon Sep 17 00:00:00 2001 From: Kudlaty Date: Sun, 16 Aug 2009 17:54:31 +0200 Subject: Merge [SD2] r1307 Add gossip for npc_tracy_proudwell. Patch by hoshie r1308 Fixed one not initialized array. r1309 Correct typo in folder name. - skip r1310 Enable faction change and remove unitState at attackStart for script related to quest 1560 --HG-- branch : trunk --- sql/FULL/world_scripts_full.sql | 1 + sql/updates/5092_world_scripts.sql | 1 + 2 files changed, 2 insertions(+) create mode 100644 sql/updates/5092_world_scripts.sql (limited to 'sql') diff --git a/sql/FULL/world_scripts_full.sql b/sql/FULL/world_scripts_full.sql index 81350d1cd44..af5e9af4800 100644 --- a/sql/FULL/world_scripts_full.sql +++ b/sql/FULL/world_scripts_full.sql @@ -550,6 +550,7 @@ UPDATE `creature_template` SET `ScriptName`='npc_wounded_blood_elf' WHERE `entry UPDATE `creature_template` SET `ScriptName`='npc_aeranas' WHERE `entry`=17085; UPDATE `gameobject_template` SET `ScriptName`='go_haaleshi_altar' WHERE `entry`=181606; UPDATE `creature_template` SET `ScriptName`='npc_naladu' WHERE `entry`=19361; +UPDATE `creature_template` SET `ScriptName`='npc_tracy_proudwell' WHERE `entry`=18266; /* HILLSBRAD FOOTHILLS */ diff --git a/sql/updates/5092_world_scripts.sql b/sql/updates/5092_world_scripts.sql new file mode 100644 index 00000000000..bd9535181af --- /dev/null +++ b/sql/updates/5092_world_scripts.sql @@ -0,0 +1 @@ +UPDATE creature_template SET ScriptName='npc_tracy_proudwell' WHERE entry=18266; -- cgit v1.2.3 From ec5515ee49eb10074521812f7f58d9baf4611ce3 Mon Sep 17 00:00:00 2001 From: QAston Date: Sun, 16 Aug 2009 19:13:02 +0200 Subject: *Remove hack in Brain Freeze code. *Update Improved Mend Pet to 3.1.3. --HG-- branch : trunk --- sql/FULL/world_spell_full.sql | 6 +- sql/updates/5093_world_spell_proc_event.sql | 5 + src/game/Item.cpp | 2 + src/game/SharedDefines.h | 8 +- src/game/Unit.cpp | 460 +++++++++++----------------- 5 files changed, 191 insertions(+), 290 deletions(-) create mode 100644 sql/updates/5093_world_spell_proc_event.sql (limited to 'sql') diff --git a/sql/FULL/world_spell_full.sql b/sql/FULL/world_spell_full.sql index 7c760a8df2f..3b3f5a6e672 100644 --- a/sql/FULL/world_spell_full.sql +++ b/sql/FULL/world_spell_full.sql @@ -1066,9 +1066,9 @@ INSERT INTO `spell_proc_event` (`entry`, `SchoolMask`, `SpellFamilyName`, `Spell ( 44472, 0x00, 3, 0x20E21277, 0x00019048, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Burnout (Rank 5) ( 44543, 0x00, 3, 0x00100220, 0x00001000, 0x00000000, 0x00010000, 0x00000000, 0, 7, 0), -- Fingers of Frost (Rank 1) ( 44545, 0x00, 3, 0x00100220, 0x00001000, 0x00000000, 0x00010000, 0x00000000, 0, 15, 0), -- Fingers of Frost (Rank 2) -( 44546, 0x00, 3, 0x020002A0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Brain Freeze (Rank 1) -( 44548, 0x00, 3, 0x020002A0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Brain Freeze (Rank 2) -( 44549, 0x00, 3, 0x020002A0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Brain Freeze (Rank 3) +( 44546, 0x00, 3, 0x00100220, 0x00001000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Brain Freeze (Rank 1) +( 44548, 0x00, 3, 0x00100220, 0x00001000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Brain Freeze (Rank 2) +( 44549, 0x00, 3, 0x00100220, 0x00001000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Brain Freeze (Rank 3) ( 44745, 0x00, 3, 0x00000000, 0x00000001, 0x00000000, 0x00004000, 0x00002000, 0, 0, 0), -- Shattered Barrier (Rank 1) ( 44835, 0x00, 7, 0x00000000, 0x00000080, 0x00000000, 0x00000010, 0x00000000, 0, 0, 0), -- Maim Interrupt ( 45054, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 15), -- Augment Pain diff --git a/sql/updates/5093_world_spell_proc_event.sql b/sql/updates/5093_world_spell_proc_event.sql new file mode 100644 index 00000000000..8bda907de25 --- /dev/null +++ b/sql/updates/5093_world_spell_proc_event.sql @@ -0,0 +1,5 @@ +DELETE FROM `spell_proc_event` WHERE `entry`IN(44546, 44548, 44549); +INSERT INTO `spell_proc_event` (`entry`, `SchoolMask`, `SpellFamilyName`, `SpellFamilyMask0`, `SpellFamilyMask1`, `SpellFamilyMask2`, `procFlags`, `procEx`, `ppmRate`, `CustomChance`, `Cooldown`) VALUES +( 44546, 0x00, 3, 0x00100220, 0x00001000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Brain Freeze (Rank 1) +( 44548, 0x00, 3, 0x00100220, 0x00001000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Brain Freeze (Rank 2) +( 44549, 0x00, 3, 0x00100220, 0x00001000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0); -- Brain Freeze (Rank 3) \ No newline at end of file diff --git a/src/game/Item.cpp b/src/game/Item.cpp index dac3ca8b0c8..9e07dbfaa16 100644 --- a/src/game/Item.cpp +++ b/src/game/Item.cpp @@ -970,6 +970,8 @@ Item* Item::CreateItem( uint32 item, uint32 count, Player const* player ) else delete pItem; } + else + assert(false); return NULL; } diff --git a/src/game/SharedDefines.h b/src/game/SharedDefines.h index ad94bf4e6f2..24d9a7be213 100644 --- a/src/game/SharedDefines.h +++ b/src/game/SharedDefines.h @@ -2308,11 +2308,11 @@ enum CorpseDynFlags #define SPELL_ID_FROST_PRESENCE 48263 // Frost Presence #define SPELL_ID_UNHOLY_PRESENCE 48265 // Unholy Presence #define SPELL_ID_NE_GHOST 20584 // Night Elf Ghost Aura -#define SPELL_ID_GHOST 8326 // Ghost +#define SPELL_ID_GHOST 8326 // Ghost #define SPELL_ID_DESERTER 26013 // Deserter -#define SPELL_ID_LOGINEFFECT 836 // LOGINEFFECT -#define SPELL_ID_HONORLESS_TARGET 2479 // Honorless target -#define SPELL_ID_DUEL_BEG 7267 // Beg +#define SPELL_ID_LOGINEFFECT 836 // LOGINEFFECT +#define SPELL_ID_HONORLESS_TARGET 2479 // Honorless target +#define SPELL_ID_DUEL_BEG 7267 // Beg enum WeatherType { diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 179b1104ac3..80ee7bd359b 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -5981,6 +5981,16 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger target = this; break; } + // Improved Mend Pet + if ( dummySpell->SpellIconID == 267 ) + { + int32 chance = triggeredByAura->GetSpellProto()->EffectBasePoints[triggeredByAura->GetEffIndex()]; + if(!roll_chance_i(chance)) + return false; + + triggered_spell_id = 24406; + break; + } // Lock and Load if ( dummySpell->SpellIconID == 3579 ) { @@ -7013,43 +7023,48 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, AuraEffect* trig ? ((Player*)this)->GetItemByGuid(triggeredByAura->GetParentAura()->GetCastItemGUID()) : NULL; // Try handle unknown trigger spells - if (sSpellStore.LookupEntry(trigger_spell_id)==NULL) + if (sSpellStore.LookupEntry(trigger_spell_id) == NULL) { switch (auraSpellInfo->SpellFamilyName) { case SPELLFAMILY_GENERIC: - if (auraSpellInfo->Id == 23780) // Aegis of Preservation (Aegis of Preservation trinket) - trigger_spell_id = 23781; - else if (auraSpellInfo->Id==43820) // Charm of the Witch Doctor (Amani Charm of the Witch Doctor trinket) + switch (auraSpellInfo->Id) { - // Pct value stored in dummy - basepoints0 = pVictim->GetCreateHealth() * auraSpellInfo->EffectBasePoints[1] / 100; - target = pVictim; - break; - } - else if (auraSpellInfo->Id==57345) // Darkmoon Card: Greatness - { - float stat = 0.0f; - // strength - if (GetStat(STAT_STRENGTH) > stat) { trigger_spell_id = 60229;stat = GetStat(STAT_STRENGTH); } - // agility - if (GetStat(STAT_AGILITY) > stat) { trigger_spell_id = 60233;stat = GetStat(STAT_AGILITY); } - // intellect - if (GetStat(STAT_INTELLECT)> stat) { trigger_spell_id = 60234;stat = GetStat(STAT_INTELLECT);} - // spirit - if (GetStat(STAT_SPIRIT) > stat) { trigger_spell_id = 60235;stat = GetStat(STAT_SPIRIT); } - } - else if (auraSpellInfo->Id == 33896) // Desperate Defense (Stonescythe Whelp, Stonescythe Alpha, Stonescythe Ambusher) - trigger_spell_id = 33898; - else if (auraSpellInfo->Id==27522 || auraSpellInfo->Id==40336) - // Mana Drain Trigger - { - // On successful melee or ranged attack gain $29471s1 mana and if possible drain $27526s1 mana from the target. - if (this && this->isAlive()) - CastSpell(this, 29471, true, castItem, triggeredByAura); - if (pVictim && pVictim->isAlive()) - CastSpell(pVictim, 27526, true, castItem, triggeredByAura); - return true; + case 23780: // Aegis of Preservation (Aegis of Preservation trinket) + trigger_spell_id = 23781; + break; + case 33896: // Desperate Defense (Stonescythe Whelp, Stonescythe Alpha, Stonescythe Ambusher) + trigger_spell_id = 33898; + break; + case 43820: // Charm of the Witch Doctor (Amani Charm of the Witch Doctor trinket) + // Pct value stored in dummy + basepoints0 = pVictim->GetCreateHealth() * auraSpellInfo->EffectBasePoints[1] / 100; + target = pVictim; + break; + case 57345: // Darkmoon Card: Greatness + { + float stat = 0.0f; + // strength + if (GetStat(STAT_STRENGTH) > stat) { trigger_spell_id = 60229;stat = GetStat(STAT_STRENGTH); } + // agility + if (GetStat(STAT_AGILITY) > stat) { trigger_spell_id = 60233;stat = GetStat(STAT_AGILITY); } + // intellect + if (GetStat(STAT_INTELLECT)> stat) { trigger_spell_id = 60234;stat = GetStat(STAT_INTELLECT);} + // spirit + if (GetStat(STAT_SPIRIT) > stat) { trigger_spell_id = 60235;stat = GetStat(STAT_SPIRIT); } + break; + } + // Mana Drain Trigger + case 27522: + case 40336: + { + // On successful melee or ranged attack gain $29471s1 mana and if possible drain $27526s1 mana from the target. + if (this && this->isAlive()) + CastSpell(this, 29471, true, castItem, triggeredByAura); + if (pVictim && pVictim->isAlive()) + CastSpell(pVictim, 27526, true, castItem, triggeredByAura); + return true; + } } break; case SPELLFAMILY_MAGE: @@ -7073,9 +7088,10 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, AuraEffect* trig break; case SPELLFAMILY_WARLOCK: { - // Improved Drain Soul + // Drain Soul if (auraSpellInfo->SpellFamilyFlags[0] & 0x4000) { + // Improved Drain Soul Unit::AuraEffectList const& mAddFlatModifier = GetAurasByType(SPELL_AURA_DUMMY); for(Unit::AuraEffectList::const_iterator i = mAddFlatModifier.begin(); i != mAddFlatModifier.end(); ++i) { @@ -7174,161 +7190,154 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, AuraEffect* trig return false; basepoints0 = int32(damage * triggerAmount / 100 / (GetSpellMaxDuration(TriggerPS) / TriggerPS->EffectAmplitude[0])); target = pVictim; - } + } break; } case SPELLFAMILY_PALADIN: { - // Healing Discount - if (auraSpellInfo->Id==37705) - { - trigger_spell_id = 37706; - target = this; - } - // Soul Preserver - if (auraSpellInfo->Id==60510) + switch (auraSpellInfo->Id) { - trigger_spell_id = 60515; - target = this; - } - // Illumination - else if (auraSpellInfo->SpellIconID==241) - { - if(!procSpell) - return false; - // procspell is triggered spell but we need mana cost of original casted spell - uint32 originalSpellId = procSpell->Id; - // Holy Shock heal - if(procSpell->SpellFamilyFlags[1] & 0x00010000) + // Healing Discount + case 37705: { - switch(procSpell->Id) - { - case 25914: originalSpellId = 20473; break; - case 25913: originalSpellId = 20929; break; - case 25903: originalSpellId = 20930; break; - case 27175: originalSpellId = 27174; break; - case 33074: originalSpellId = 33072; break; - case 48820: originalSpellId = 48824; break; - case 48821: originalSpellId = 48825; break; - default: - sLog.outError("Unit::HandleProcTriggerSpell: Spell %u not handled in HShock",procSpell->Id); - return false; - } + trigger_spell_id = 37706; + target = this; + break; } - SpellEntry const *originalSpell = sSpellStore.LookupEntry(originalSpellId); - if(!originalSpell) + // Soul Preserver + case 60510: { - sLog.outError("Unit::HandleProcTriggerSpell: Spell %u unknown but selected as original in Illu",originalSpellId); - return false; + trigger_spell_id = 60515; + target = this; + break; } - // percent stored in effect 1 (class scripts) base points - int32 cost = originalSpell->manaCost + originalSpell->ManaCostPercentage * GetCreateMana() / 100; - basepoints0 = cost*auraSpellInfo->CalculateSimpleValue(1)/100; - trigger_spell_id = 20272; - target = this; - } - // Lightning Capacitor - else if (auraSpellInfo->Id==37657) - { - if(!pVictim || !pVictim->isAlive()) - return false; - // stacking - CastSpell(this, 37658, true, NULL, triggeredByAura); + // Lightning Capacitor + case 37657: + { + if(!pVictim || !pVictim->isAlive()) + return false; + // stacking + CastSpell(this, 37658, true, NULL, triggeredByAura); - Aura * dummy = GetAura(37658); - // release at 3 aura in stack (cont contain in basepoint of trigger aura) - if(!dummy || dummy->GetStackAmount() < triggerAmount) - return false; + Aura * dummy = GetAura(37658); + // release at 3 aura in stack (cont contain in basepoint of trigger aura) + if(!dummy || dummy->GetStackAmount() < triggerAmount) + return false; - RemoveAurasDueToSpell(37658); - trigger_spell_id = 37661; - target = pVictim; - } - // Thunder Capacitor - else if (auraSpellInfo->Id == 54841) - { - if(!pVictim || !pVictim->isAlive()) - return false; - // stacking - CastSpell(this, 54842, true, NULL, triggeredByAura); + RemoveAurasDueToSpell(37658); + trigger_spell_id = 37661; + target = pVictim; + break; + } + // Thunder Capacitor + case 54841: + { + if(!pVictim || !pVictim->isAlive()) + return false; + // stacking + CastSpell(this, 54842, true, NULL, triggeredByAura); - // counting - Aura * dummy = GetAura(54842); - // release at 3 aura in stack (cont contain in basepoint of trigger aura) - if(!dummy || dummy->GetStackAmount() < triggerAmount) - return false; + // counting + Aura * dummy = GetAura(54842); + // release at 3 aura in stack (cont contain in basepoint of trigger aura) + if(!dummy || dummy->GetStackAmount() < triggerAmount) + return false; - RemoveAurasDueToSpell(54842); - trigger_spell_id = 54843; - target = pVictim; + RemoveAurasDueToSpell(54842); + trigger_spell_id = 54843; + target = pVictim; + break; + } + default: + // Illumination + if (auraSpellInfo->SpellIconID==241) + { + if(!procSpell) + return false; + // procspell is triggered spell but we need mana cost of original casted spell + uint32 originalSpellId = procSpell->Id; + // Holy Shock heal + if(procSpell->SpellFamilyFlags[1] & 0x00010000) + { + switch(procSpell->Id) + { + case 25914: originalSpellId = 20473; break; + case 25913: originalSpellId = 20929; break; + case 25903: originalSpellId = 20930; break; + case 27175: originalSpellId = 27174; break; + case 33074: originalSpellId = 33072; break; + case 48820: originalSpellId = 48824; break; + case 48821: originalSpellId = 48825; break; + default: + sLog.outError("Unit::HandleProcTriggerSpell: Spell %u not handled in HShock",procSpell->Id); + return false; + } + } + SpellEntry const *originalSpell = sSpellStore.LookupEntry(originalSpellId); + if(!originalSpell) + { + sLog.outError("Unit::HandleProcTriggerSpell: Spell %u unknown but selected as original in Illu",originalSpellId); + return false; + } + // percent stored in effect 1 (class scripts) base points + int32 cost = originalSpell->manaCost + originalSpell->ManaCostPercentage * GetCreateMana() / 100; + basepoints0 = cost*auraSpellInfo->CalculateSimpleValue(1)/100; + trigger_spell_id = 20272; + target = this; + } + break; } break; } case SPELLFAMILY_SHAMAN: { - // Lightning Shield (overwrite non existing triggered spell call in spell.dbc - if(auraSpellInfo->SpellFamilyFlags[0] & 0x400) + switch (auraSpellInfo->Id) { - switch(auraSpellInfo->Id) + // Lightning Shield (The Ten Storms set) + case 23551: { - case 324: // Rank 1 - trigger_spell_id = 26364; break; - case 325: // Rank 2 - trigger_spell_id = 26365; break; - case 905: // Rank 3 - trigger_spell_id = 26366; break; - case 945: // Rank 4 - trigger_spell_id = 26367; break; - case 8134: // Rank 5 - trigger_spell_id = 26369; break; - case 10431: // Rank 6 - trigger_spell_id = 26370; break; - case 10432: // Rank 7 - trigger_spell_id = 26363; break; - case 25469: // Rank 8 - trigger_spell_id = 26371; break; - case 25472: // Rank 9 - trigger_spell_id = 26372; break; - case 49280: // Rank 10 - trigger_spell_id = 49278; break; - case 49281: // Rank 11 - trigger_spell_id = 49279; break; - default: - sLog.outError("Unit::HandleProcTriggerSpell: Spell %u not handled in LShield", auraSpellInfo->Id); - return false; + trigger_spell_id = 23552; + target = pVictim; + break; } - } - // Lightning Shield (The Ten Storms set) - else if (auraSpellInfo->Id == 23551) - { - trigger_spell_id = 23552; - target = pVictim; - } - // Damage from Lightning Shield (The Ten Storms set) - else if (auraSpellInfo->Id == 23552) - trigger_spell_id = 27635; - // Mana Surge (The Earthfury set) - else if (auraSpellInfo->Id == 23572) - { - if(!procSpell) - return false; - basepoints0 = procSpell->manaCost * 35 / 100; - trigger_spell_id = 23571; - target = this; - } - // Nature's Guardian - else if (auraSpellInfo->SpellIconID == 2013) - { - // Check health condition - should drop to less 30% (damage deal after this!) - if (!(10*(int32(GetHealth() - damage)) < 3 * GetMaxHealth())) - return false; + // Damage from Lightning Shield (The Ten Storms set) + case 23552: + { + trigger_spell_id = 27635; + break; + } + // Mana Surge (The Earthfury set) + case 23572: + { + if(!procSpell) + return false; + basepoints0 = procSpell->manaCost * 35 / 100; + trigger_spell_id = 23571; + target = this; + break; + } + default: + { + // Lightning Shield (overwrite non existing triggered spell call in spell.dbc + if(auraSpellInfo->SpellFamilyFlags[0] & 0x400) + { + trigger_spell_id = spellmgr.GetSpellWithRank(26364, spellmgr.GetSpellRank(auraSpellInfo->Id)); + } + // Nature's Guardian + else if (auraSpellInfo->SpellIconID == 2013) + { + // Check health condition - should drop to less 30% (damage deal after this!) + if (!(10*(int32(GetHealth() - damage)) < 3 * GetMaxHealth())) + return false; - if(pVictim && pVictim->isAlive()) - pVictim->getThreatManager().modifyThreatPercent(this,-10); + if(pVictim && pVictim->isAlive()) + pVictim->getThreatManager().modifyThreatPercent(this,-10); - basepoints0 = triggerAmount * GetMaxHealth() / 100; - trigger_spell_id = 31616; - target = this; + basepoints0 = triggerAmount * GetMaxHealth() / 100; + trigger_spell_id = 31616; + target = this; + } + } } break; } @@ -7399,7 +7408,7 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, AuraEffect* trig // Cheat Death case 28845: { - // When your health drops below 20% .... + // When your health drops below 20% if (GetHealth() - damage > GetMaxHealth() / 5 || GetHealth() < GetMaxHealth() / 5) return false; break; @@ -7572,30 +7581,6 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, AuraEffect* trig return false; break; } - // Brain Freeze - case 57761: - { - if(!procSpell) - return false; - // For trigger from Blizzard need exist Improved Blizzard - if (procSpell->SpellFamilyName==SPELLFAMILY_MAGE && procSpell->SpellFamilyFlags[0] & 0x80) - { - bool found = false; - AuraEffectList const& mOverrideClassScript = GetAurasByType(SPELL_AURA_OVERRIDE_CLASS_SCRIPTS); - for(AuraEffectList::const_iterator i = mOverrideClassScript.begin(); i != mOverrideClassScript.end(); ++i) - { - int32 script = (*i)->GetMiscValue(); - if(script==836 || script==988 || script==989) - { - found=true; - break; - } - } - if(!found) - return false; - } - break; - } // Astral Shift case 52179: { @@ -7706,16 +7691,6 @@ bool Unit::HandleOverrideClassScriptAuraProc(Unit *pVictim, uint32 damage, AuraE triggered_spell_id = 12486; break; } - case 4086: // Improved Mend Pet (Rank 1) - case 4087: // Improved Mend Pet (Rank 2) - { - int32 chance = triggeredByAura->GetSpellProto()->EffectBasePoints[triggeredByAura->GetEffIndex()]; - if(!roll_chance_i(chance)) - return false; - - triggered_spell_id = 24406; - break; - } case 4533: // Dreamwalker Raiment 2 pieces bonus { // Chance 50% @@ -7735,19 +7710,9 @@ bool Unit::HandleOverrideClassScriptAuraProc(Unit *pVictim, uint32 damage, AuraE case 4537: // Dreamwalker Raiment 6 pieces bonus triggered_spell_id = 28750; // Blessing of the Claw break; - case 5497: // Improved Mana Gems (Serpent-Coil Braid) + case 5497: // Improved Mana Gems triggered_spell_id = 37445; // Mana Surge break; - case 8152: // Serendipity - { - // if heal your target over maximum health - if (pVictim->GetHealth() + damage < pVictim->GetMaxHealth()) - return false; - int32 cost = procSpell->manaCost + procSpell->ManaCostPercentage * GetCreateMana() / 100; - int32 basepoints0 = cost * triggeredByAura->GetAmount()/100; - CastCustomSpell(this, 47762, &basepoints0, 0, 0, true, 0, triggeredByAura); - return true; - } case 7010: // Revitalize - can proc on full hp target case 7011: case 7012: @@ -12852,77 +12817,6 @@ void Unit::SendMovementFlagUpdate() SendMessageToSet(&data, false); } -/* -void Unit::SetFeared(bool apply, uint64 casterGUID, uint32 spellID, uint32 time) -{ - if( apply ) - { - if(HasAuraType(SPELL_AURA_PREVENTS_FLEEING)) - return; - - SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_FLEEING); - - GetMotionMaster()->MovementExpired(false); - CastStop(GetGUID()==casterGUID ? spellID : 0); - - Unit* caster = ObjectAccessor::GetUnit(*this,casterGUID); - - GetMotionMaster()->MoveFleeing(caster, time); // caster==NULL processed in MoveFleeing - } - else - { - RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_FLEEING); - - GetMotionMaster()->MovementExpired(false); - - if( GetTypeId() != TYPEID_PLAYER && isAlive() ) - { - // restore appropriate movement generator - if(getVictim()) - GetMotionMaster()->MoveChase(getVictim()); - else - GetMotionMaster()->Initialize(); - - // attack caster if can - Unit* caster = ObjectAccessor::GetObjectInWorld(casterGUID, (Unit*)NULL); - if(caster && ((Creature*)this)->AI()) - ((Creature*)this)->AI()->AttackedBy(caster); - } - } - - if (GetTypeId() == TYPEID_PLAYER) - ((Player*)this)->SetClientControl(this, !apply); -} - -void Unit::SetConfused(bool apply, uint64 casterGUID, uint32 spellID) -{ - if( apply ) - { - SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_CONFUSED); - - CastStop(GetGUID()==casterGUID ? spellID : 0); - - GetMotionMaster()->MoveConfused(); - } - else - { - RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_CONFUSED); - - GetMotionMaster()->MovementExpired(false); - - if (GetTypeId() == TYPEID_UNIT) - { - // if in combat restore movement generator - if(getVictim()) - GetMotionMaster()->MoveChase(getVictim()); - } - } - - if(GetTypeId() == TYPEID_PLAYER) - ((Player*)this)->SetClientControl(this, !apply); -} -*/ - bool Unit::IsSitState() const { uint8 s = getStandState(); @@ -13847,7 +13741,7 @@ void Unit::SetRooted(bool apply) { if(apply) { - AddUnitMovementFlag(MOVEMENTFLAG_ROOT); + AddUnitMovementFlag(MOVEMENTFLAG_ROOT); WorldPacket data(SMSG_FORCE_MOVE_ROOT, 10); data.append(GetPackGUID()); -- cgit v1.2.3 From 91f3d69edf754c4e62d973cf1ae81e9a2e36d7bc Mon Sep 17 00:00:00 2001 From: Kudlaty Date: Sun, 16 Aug 2009 21:46:31 +0200 Subject: Merge [SD2] r1314 Correct some spellId's and apply SD2 code style r1315 Correct more spells and apply SD2 code style r1316 Replace magic number with enum type name UNIT_DYNFLAG_DEAD r1317 Add support for quest 1249. Patch by jotapdiez r1318 Move AI's implementation from headers. Original patch/idea by DasBlub r1319 Convert script related to quest 938 to use followerAI r1320 Add new virtual function WaypointStart() to escortAI. --HG-- branch : trunk --- sql/FULL/world_script_waypoints.sql | 10 ++ sql/FULL/world_scripts_full.sql | 2 + sql/updates/5096_world_scripts.sql | 12 ++ src/bindings/scripts/CMakeLists.txt | 1 + src/bindings/scripts/VC80/80ScriptDev2.vcproj | 4 + src/bindings/scripts/VC90/90ScriptDev2.vcproj | 4 + src/bindings/scripts/base/escort_ai.cpp | 24 ++- src/bindings/scripts/base/escort_ai.h | 6 +- src/bindings/scripts/base/guard_ai.cpp | 5 + src/bindings/scripts/base/guard_ai.h | 4 +- src/bindings/scripts/include/sc_creature.cpp | 6 +- src/bindings/scripts/include/sc_creature.h | 2 +- .../scripts/eastern_kingdoms/dun_morogh.cpp | 2 +- .../scripts/eastern_kingdoms/elwynn_forest.cpp | 2 +- .../scholomance/boss_doctor_theolen_krastinov.cpp | 64 ++++---- .../eastern_kingdoms/scholomance/boss_vectus.cpp | 59 ++++---- .../scripts/scripts/eastern_kingdoms/wetlands.cpp | 167 +++++++++++++++++++++ .../scripts/scripts/kalimdor/teldrassil.cpp | 107 +++---------- src/bindings/scripts/scripts/outland/nagrand.cpp | 2 +- src/bindings/scripts/system/ScriptLoader.cpp | 2 + 20 files changed, 332 insertions(+), 153 deletions(-) create mode 100644 sql/updates/5096_world_scripts.sql create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/wetlands.cpp (limited to 'sql') diff --git a/sql/FULL/world_script_waypoints.sql b/sql/FULL/world_script_waypoints.sql index e6884155154..9dfa805c30f 100644 --- a/sql/FULL/world_script_waypoints.sql +++ b/sql/FULL/world_script_waypoints.sql @@ -13,6 +13,16 @@ CREATE TABLE script_waypoint ( PRIMARY KEY (entry, pointid) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Script Creature waypoints'; +DELETE FROM script_waypoint WHERE entry=4962; +INSERT INTO script_waypoint VALUES +(4962, 0, -3804.438965, -828.048035, 10.093068, 0, ''), +(4962, 1, -3803.934326, -835.772400, 10.077722, 0, ''), +(4962, 2, -3792.629150, -835.670898, 9.655657, 0, ''), +(4962, 3, -3772.433838, -835.345947, 10.868981, 0, ''), +(4962, 4, -3765.937256, -840.128601, 10.885593, 0, ''), +(4962, 5, -3738.633789, -830.997498, 11.057384, 0, ''), +(4962, 6, -3690.224121, -862.261597, 9.960449, 0, ''); + DELETE FROM script_waypoint WHERE entry=10638; INSERT INTO script_waypoint VALUES (10638, 0, -4903.521973, -1368.339844, -52.611, 5000, 'SAY_KAN_START'), diff --git a/sql/FULL/world_scripts_full.sql b/sql/FULL/world_scripts_full.sql index af5e9af4800..88f51044f53 100644 --- a/sql/FULL/world_scripts_full.sql +++ b/sql/FULL/world_scripts_full.sql @@ -1086,6 +1086,8 @@ UPDATE `creature_template` SET `ScriptName`='npc_defias_traitor' WHERE `entry`=4 UPDATE `creature_template` SET `ScriptName`='npc_daphne_stilwell' WHERE `entry`=6182; /* WETLANDS */ +UPDATE creature_template SET ScriptName='npc_tapoke_slim_jahn' WHERE entry=4962; +UPDATE creature_template SET ScriptName='npc_mikhail' WHERE entry=4963; /* WINTERSPRING */ UPDATE `creature_template` SET `ScriptName`='npc_lorax' WHERE `entry`=10918; diff --git a/sql/updates/5096_world_scripts.sql b/sql/updates/5096_world_scripts.sql new file mode 100644 index 00000000000..37bf49f3d7d --- /dev/null +++ b/sql/updates/5096_world_scripts.sql @@ -0,0 +1,12 @@ +UPDATE creature_template SET ScriptName='npc_tapoke_slim_jahn' WHERE entry=4962; +UPDATE creature_template SET ScriptName='npc_mikhail' WHERE entry=4963; + +DELETE FROM script_waypoint WHERE entry=4962; +INSERT INTO script_waypoint VALUES +(4962, 0, -3804.438965, -828.048035, 10.093068, 0, ''), +(4962, 1, -3803.934326, -835.772400, 10.077722, 0, ''), +(4962, 2, -3792.629150, -835.670898, 9.655657, 0, ''), +(4962, 3, -3772.433838, -835.345947, 10.868981, 0, ''), +(4962, 4, -3765.937256, -840.128601, 10.885593, 0, ''), +(4962, 5, -3738.633789, -830.997498, 11.057384, 0, ''), +(4962, 6, -3690.224121, -862.261597, 9.960449, 0, ''); diff --git a/src/bindings/scripts/CMakeLists.txt b/src/bindings/scripts/CMakeLists.txt index 571dbc1b2a9..285fb004c59 100644 --- a/src/bindings/scripts/CMakeLists.txt +++ b/src/bindings/scripts/CMakeLists.txt @@ -192,6 +192,7 @@ SET(trinityscript_LIB_SRCS scripts/eastern_kingdoms/undercity.cpp scripts/eastern_kingdoms/western_plaguelands.cpp scripts/eastern_kingdoms/westfall.cpp + scripts/eastern_kingdoms/wetlands.cpp scripts/examples/example_creature.cpp scripts/examples/example_escort.cpp scripts/examples/example_gossip_codebox.cpp diff --git a/src/bindings/scripts/VC80/80ScriptDev2.vcproj b/src/bindings/scripts/VC80/80ScriptDev2.vcproj index ee1a8c87592..635f9356908 100644 --- a/src/bindings/scripts/VC80/80ScriptDev2.vcproj +++ b/src/bindings/scripts/VC80/80ScriptDev2.vcproj @@ -1162,6 +1162,10 @@ RelativePath="..\scripts\eastern_kingdoms\westfall.cpp" > + + + + GetMotionMaster()->MovePoint(CurrentWP->id, CurrentWP->x, CurrentWP->y, CurrentWP->z); - debug_log("TSCR: EscortAI Next WP is: %u, %f, %f, %f", CurrentWP->id, CurrentWP->x, CurrentWP->y, CurrentWP->z); + debug_log("TSCR: EscortAI start waypoint %u (%f, %f, %f).", CurrentWP->id, CurrentWP->x, CurrentWP->y, CurrentWP->z); + + WaypointStart(CurrentWP->id); + m_uiWPWaitTimer = 0; } } diff --git a/src/bindings/scripts/base/escort_ai.h b/src/bindings/scripts/base/escort_ai.h index 5d27aebfec6..663e11d79f6 100644 --- a/src/bindings/scripts/base/escort_ai.h +++ b/src/bindings/scripts/base/escort_ai.h @@ -28,12 +28,12 @@ struct Escort_Waypoint struct TRINITY_DLL_DECL npc_escortAI : public ScriptedAI { public: - explicit npc_escortAI(Creature* pCreature) : ScriptedAI(pCreature), - IsBeingEscorted(false), IsOnHold(false), PlayerGUID(0), MaxPlayerDistance(DEFAULT_MAX_PLAYER_DISTANCE), CanMelee(true), m_uiPlayerCheckTimer(1000), m_uiWPWaitTimer(2500), m_bIsReturning(false), m_bIsActiveAttacker(true), m_bIsRunning(false), DespawnAtEnd(true), DespawnAtFar(true), m_pQuestForEscort(NULL), m_bCanInstantRespawn(false), m_bCanReturnToStart(false), ScriptWP(false) {} + explicit npc_escortAI(Creature* pCreature); ~npc_escortAI() {} // Pure Virtual Functions - virtual void WaypointReached(uint32) = 0; + virtual void WaypointReached(uint32 uiPointId) = 0; + virtual void WaypointStart(uint32 uiPointId) {} // CreatureAI functions void AttackStart(Unit* who); diff --git a/src/bindings/scripts/base/guard_ai.cpp b/src/bindings/scripts/base/guard_ai.cpp index 7f1daa1e2df..b55eae2dbad 100644 --- a/src/bindings/scripts/base/guard_ai.cpp +++ b/src/bindings/scripts/base/guard_ai.cpp @@ -32,6 +32,11 @@ EndScriptData */ #define SAY_GUARD_SIL_AGGRO2 -1070002 #define SAY_GUARD_SIL_AGGRO3 -1070003 +guardAI::guardAI(Creature* pCreature) : ScriptedAI(pCreature), + GlobalCooldown(0), + BuffTimer(0) +{} + void guardAI::Reset() { GlobalCooldown = 0; diff --git a/src/bindings/scripts/base/guard_ai.h b/src/bindings/scripts/base/guard_ai.h index 85baa30fb9d..a7fff32e3ab 100644 --- a/src/bindings/scripts/base/guard_ai.h +++ b/src/bindings/scripts/base/guard_ai.h @@ -9,7 +9,9 @@ struct TRINITY_DLL_DECL guardAI : public ScriptedAI { - guardAI(Creature *c) : ScriptedAI(c) {} + public: + explicit guardAI(Creature* pCreature); + ~guardAI() {} uint32 GlobalCooldown; //This variable acts like the global cooldown that players have (1.5 seconds) uint32 BuffTimer; //This variable keeps track of buffs diff --git a/src/bindings/scripts/include/sc_creature.cpp b/src/bindings/scripts/include/sc_creature.cpp index 1d423574f42..aa64a6fcbf1 100644 --- a/src/bindings/scripts/include/sc_creature.cpp +++ b/src/bindings/scripts/include/sc_creature.cpp @@ -80,7 +80,11 @@ void SummonList::DespawnAll() } } -ScriptedAI::ScriptedAI(Creature* creature) : CreatureAI(creature), m_creature(creature), IsFleeing(false), m_bCombatMovement(true), m_uiEvadeCheckCooldown(2500) +ScriptedAI::ScriptedAI(Creature* pCreature) : CreatureAI(pCreature), + m_creature(pCreature), + IsFleeing(false), + m_bCombatMovement(true), + m_uiEvadeCheckCooldown(2500) { HeroicMode = m_creature->GetMap()->IsHeroic(); } diff --git a/src/bindings/scripts/include/sc_creature.h b/src/bindings/scripts/include/sc_creature.h index 6baac76a8dd..74eea9ad599 100644 --- a/src/bindings/scripts/include/sc_creature.h +++ b/src/bindings/scripts/include/sc_creature.h @@ -43,7 +43,7 @@ class SummonList : private std::list struct TRINITY_DLL_DECL ScriptedAI : public CreatureAI { - explicit ScriptedAI(Creature* creature); + explicit ScriptedAI(Creature* pCreature); ~ScriptedAI() {} //************* diff --git a/src/bindings/scripts/scripts/eastern_kingdoms/dun_morogh.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/dun_morogh.cpp index 7e61df13575..29731ca83e3 100644 --- a/src/bindings/scripts/scripts/eastern_kingdoms/dun_morogh.cpp +++ b/src/bindings/scripts/scripts/eastern_kingdoms/dun_morogh.cpp @@ -43,7 +43,7 @@ struct TRINITY_DLL_DECL npc_narm_faulkAI : public ScriptedAI void Reset() { lifeTimer = 120000; - m_creature->SetUInt32Value(UNIT_DYNAMIC_FLAGS, 32); + m_creature->SetUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD); m_creature->SetStandState(UNIT_STAND_STATE_DEAD); spellHit = false; } diff --git a/src/bindings/scripts/scripts/eastern_kingdoms/elwynn_forest.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/elwynn_forest.cpp index 67456755cd2..e44081d72ba 100644 --- a/src/bindings/scripts/scripts/eastern_kingdoms/elwynn_forest.cpp +++ b/src/bindings/scripts/scripts/eastern_kingdoms/elwynn_forest.cpp @@ -43,7 +43,7 @@ struct TRINITY_DLL_DECL npc_henze_faulkAI : public ScriptedAI void Reset() { lifeTimer = 120000; - m_creature->SetUInt32Value(UNIT_DYNAMIC_FLAGS, 32); + m_creature->SetUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD); m_creature->SetStandState(UNIT_STAND_STATE_DEAD); // lay down spellHit = false; } diff --git a/src/bindings/scripts/scripts/eastern_kingdoms/scholomance/boss_doctor_theolen_krastinov.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/scholomance/boss_doctor_theolen_krastinov.cpp index badea0761e4..c4590243571 100644 --- a/src/bindings/scripts/scripts/eastern_kingdoms/scholomance/boss_doctor_theolen_krastinov.cpp +++ b/src/bindings/scripts/scripts/eastern_kingdoms/scholomance/boss_doctor_theolen_krastinov.cpp @@ -24,30 +24,33 @@ EndScriptData */ #include "precompiled.h" #include "def_scholomance.h" -#define EMOTE_GENERIC_FRENZY_KILL -1000001 +enum +{ + EMOTE_GENERIC_FRENZY_KILL = -1000001, -#define SPELL_REND 18106 -#define SPELL_CLEAVE 15584 -#define SPELL_FRENZY 28371 + SPELL_REND = 16509, + SPELL_BACKHAND = 18103, + SPELL_FRENZY = 8269 +}; struct TRINITY_DLL_DECL boss_theolenkrastinovAI : public ScriptedAI { boss_theolenkrastinovAI(Creature *c) : ScriptedAI(c) {} - uint32 Rend_Timer; - uint32 Cleave_Timer; - uint32 Frenzy_Timer; + uint32 m_uiRend_Timer; + uint32 m_uiBackhand_Timer; + uint32 m_uiFrenzy_Timer; void Reset() { - Rend_Timer = 8000; - Cleave_Timer = 9000; - Frenzy_Timer =0; + m_uiRend_Timer = 8000; + m_uiBackhand_Timer = 9000; + m_uiFrenzy_Timer = 1000; } - void JustDied(Unit *killer) + void JustDied(Unit* pKiller) { - ScriptedInstance *pInstance = (m_creature->GetInstanceData()) ? (m_creature->GetInstanceData()) : NULL; + ScriptedInstance* pInstance = (m_creature->GetInstanceData()) ? (m_creature->GetInstanceData()) : NULL; if (pInstance) { pInstance->SetData(DATA_DOCTORTHEOLENKRASTINOV_DEATH, 0); @@ -57,44 +60,47 @@ struct TRINITY_DLL_DECL boss_theolenkrastinovAI : public ScriptedAI } } - void EnterCombat(Unit *who) - { - } - - void UpdateAI(const uint32 diff) + void UpdateAI(const uint32 uiDiff) { if (!UpdateVictim()) return; //Rend_Timer - if (Rend_Timer < diff) + if (m_uiRend_Timer < uiDiff) { - DoCast(m_creature->getVictim(),SPELL_REND); - Rend_Timer = 10000; - }else Rend_Timer -= diff; + DoCast(m_creature->getVictim(), SPELL_REND); + m_uiRend_Timer = 10000; + } + else + m_uiRend_Timer -= uiDiff; - //Cleave_Timer - if (Cleave_Timer < diff) + //Backhand_Timer + if (m_uiBackhand_Timer < uiDiff) { - DoCast(m_creature->getVictim(),SPELL_CLEAVE); - Cleave_Timer = 10000; - }else Cleave_Timer -= diff; + DoCast(m_creature->getVictim(), SPELL_BACKHAND); + m_uiBackhand_Timer = 10000; + } + else + m_uiBackhand_Timer -= uiDiff; //Frenzy_Timer if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 26) { - if (Frenzy_Timer < diff) + if (m_uiFrenzy_Timer < uiDiff) { DoCast(m_creature,SPELL_FRENZY); DoScriptText(EMOTE_GENERIC_FRENZY_KILL, m_creature); - Frenzy_Timer = 8000; - }else Frenzy_Timer -= diff; + m_uiFrenzy_Timer = 120000; + } + else + m_uiFrenzy_Timer -= uiDiff; } DoMeleeAttackIfReady(); } }; + CreatureAI* GetAI_boss_theolenkrastinov(Creature* pCreature) { return new boss_theolenkrastinovAI (pCreature); diff --git a/src/bindings/scripts/scripts/eastern_kingdoms/scholomance/boss_vectus.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/scholomance/boss_vectus.cpp index 9d343d26a7e..f12b5473abf 100644 --- a/src/bindings/scripts/scripts/eastern_kingdoms/scholomance/boss_vectus.cpp +++ b/src/bindings/scripts/scripts/eastern_kingdoms/scholomance/boss_vectus.cpp @@ -23,65 +23,72 @@ EndScriptData */ #include "precompiled.h" -#define EMOTE_GENERIC_FRENZY_KILL -1000001 +enum +{ + EMOTE_GENERIC_FRENZY_KILL = -1000001, -#define SPELL_FIRESHIELD 19626 -#define SPELL_BLASTWAVE 13021 -#define SPELL_FRENZY 28371 + SPELL_FLAMESTRIKE = 18399, + SPELL_BLAST_WAVE = 16046, + SPELL_FIRESHIELD = 19626, + SPELL_FRENZY = 8269 //28371, +}; struct TRINITY_DLL_DECL boss_vectusAI : public ScriptedAI { boss_vectusAI(Creature *c) : ScriptedAI(c) {} - uint32 FireShield_Timer; - uint32 BlastWave_Timer; - uint32 Frenzy_Timer; + uint32 m_uiFireShield_Timer; + uint32 m_uiBlastWave_Timer; + uint32 m_uiFrenzy_Timer; void Reset() { - FireShield_Timer = 2000; - BlastWave_Timer = 14000; - Frenzy_Timer = 0; - } - - void EnterCombat(Unit *who) - { + m_uiFireShield_Timer = 2000; + m_uiBlastWave_Timer = 14000; + m_uiFrenzy_Timer = 0; } - void UpdateAI(const uint32 diff) + void UpdateAI(const uint32 uiDiff) { if (!UpdateVictim()) return; //FireShield_Timer - if (FireShield_Timer < diff) + if (m_uiFireShield_Timer < uiDiff) { DoCast(m_creature, SPELL_FIRESHIELD); - FireShield_Timer = 90000; - }else FireShield_Timer -= diff; + m_uiFireShield_Timer = 90000; + } + else + m_uiFireShield_Timer -= uiDiff; //BlastWave_Timer - if (BlastWave_Timer < diff) + if (m_uiBlastWave_Timer < uiDiff) { - DoCast(m_creature->getVictim(),SPELL_BLASTWAVE); - BlastWave_Timer = 12000; - }else BlastWave_Timer -= diff; + DoCast(m_creature->getVictim(), SPELL_BLAST_WAVE); + m_uiBlastWave_Timer = 12000; + } + else + m_uiBlastWave_Timer -= uiDiff; //Frenzy_Timer if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 25) { - if (Frenzy_Timer < diff) + if (m_uiFrenzy_Timer < uiDiff) { - DoCast(m_creature,SPELL_FRENZY); + DoCast(m_creature, SPELL_FRENZY); DoScriptText(EMOTE_GENERIC_FRENZY_KILL, m_creature); - Frenzy_Timer = 24000; - }else Frenzy_Timer -= diff; + m_uiFrenzy_Timer = 24000; + } + else + m_uiFrenzy_Timer -= uiDiff; } DoMeleeAttackIfReady(); } }; + CreatureAI* GetAI_boss_vectus(Creature* pCreature) { return new boss_vectusAI (pCreature); diff --git a/src/bindings/scripts/scripts/eastern_kingdoms/wetlands.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/wetlands.cpp new file mode 100644 index 00000000000..4a9d944cb3e --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/wetlands.cpp @@ -0,0 +1,167 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Wetlands +SD%Complete: 80 +SDComment: Quest support: 1249 +SDCategory: Wetlands +EndScriptData */ + +/* ContentData +npc_mikhail +npc_tapoke_slim_jahn +EndContentData */ + +#include "precompiled.h" +#include "escort_ai.h" + +/*###### +## npc_tapoke_slim_jahn +######*/ + +enum +{ + QUEST_MISSING_DIPLO_PT11 = 1249, + FACTION_ENEMY = 168, + SPELL_STEALTH = 1785, + NPC_SLIMS_FRIEND = 4971, + NPC_TAPOKE_SLIM_JAHN = 4962 +}; + +struct TRINITY_DLL_DECL npc_tapoke_slim_jahnAI : public npc_escortAI +{ + npc_tapoke_slim_jahnAI(Creature* pCreature) : npc_escortAI(pCreature) { } + + bool m_bFriendSummoned; + + void Reset() + { + if (!IsBeingEscorted) + m_bFriendSummoned = false; + } + + void WaypointReached(uint32 uiPointId) + { + switch(uiPointId) + { + case 2: + if (m_creature->HasStealthAura()) + m_creature->RemoveAurasDueToSpell(SPELL_AURA_MOD_STEALTH); + + SetRun(); + m_creature->setFaction(FACTION_ENEMY); + break; + } + } + + void Aggro(Unit* pWho) + { + Unit* pPlayer = Unit::GetUnit(*m_creature, PlayerGUID); + + if (IsBeingEscorted && !m_bFriendSummoned && pPlayer) + { + m_creature->SummonCreature(NPC_SLIMS_FRIEND, 0.0f, 0.0f, 0.0f, 3.10f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 30000); + m_creature->SummonCreature(NPC_SLIMS_FRIEND, 0.0f, 0.0f, 0.0f, 2.35f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 30000); + m_creature->SummonCreature(NPC_SLIMS_FRIEND, 0.0f, 0.0f, 0.0f, 2.02f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 30000); + m_bFriendSummoned = true; + } + } + + void JustSummoned(Creature* pSummoned) + { + if (Unit* pPlayer = Unit::GetPlayer(PlayerGUID)) + pSummoned->AI()->AttackStart(pPlayer); + } + + void AttackedBy(Unit* pAttacker) + { + if (m_creature->getVictim()) + return; + + if (m_creature->IsFriendlyTo(pAttacker)) + return; + + AttackStart(pAttacker); + } + + void DamageTaken(Unit* pDoneBy, uint32& uiDamage) + { + if (m_creature->GetHealth()*100 < m_creature->GetMaxHealth()*20) + { + if (Unit* pPlayer = Unit::GetUnit(*m_creature, PlayerGUID)) + { + if (pPlayer->GetTypeId() == TYPEID_PLAYER) + CAST_PLR(pPlayer)->GroupEventHappens(QUEST_MISSING_DIPLO_PT11, m_creature); + + uiDamage = 0; + + me->RestoreFaction(); + m_creature->RemoveAllAuras(); + m_creature->DeleteThreatList(); + m_creature->CombatStop(true); + + SetRun(false); + } + } + } +}; + +CreatureAI* GetAI_npc_tapoke_slim_jahn(Creature* pCreature) +{ + return new npc_tapoke_slim_jahnAI(pCreature); +} + +/*###### +## npc_mikhail +######*/ + +bool QuestAccept_npc_mikhail(Player* pPlayer, Creature* pCreature, const Quest* pQuest) +{ + if (pQuest->GetQuestId() == QUEST_MISSING_DIPLO_PT11) + { + Creature* pSlim = pCreature->FindNearestCreature(NPC_TAPOKE_SLIM_JAHN, 25.0f); + + if (!pSlim) + return false; + + if (!pSlim->HasStealthAura()) + pSlim->CastSpell(pSlim, SPELL_STEALTH, true); + + if (npc_tapoke_slim_jahnAI* pEscortAI = CAST_AI(npc_tapoke_slim_jahnAI, pSlim->AI())) + pEscortAI->Start(false, false, pPlayer->GetGUID(), pQuest); + } + return false; +} + +/*###### +## AddSC +######*/ + +void AddSC_wetlands() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "npc_tapoke_slim_jahn"; + newscript->GetAI = &GetAI_npc_tapoke_slim_jahn; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_mikhail"; + newscript->pQuestAccept = &QuestAccept_npc_mikhail; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/kalimdor/teldrassil.cpp b/src/bindings/scripts/scripts/kalimdor/teldrassil.cpp index 58cb2a55b2f..40e849fbbe6 100644 --- a/src/bindings/scripts/scripts/kalimdor/teldrassil.cpp +++ b/src/bindings/scripts/scripts/kalimdor/teldrassil.cpp @@ -26,6 +26,7 @@ npc_mist EndContentData */ #include "precompiled.h" +#include "follower_ai.h" /*#### # npc_mist @@ -37,31 +38,20 @@ enum EMOTE_AT_HOME = -1000412, QUEST_MIST = 938, NPC_ARYNIA = 3519, + FACTION_DARNASSUS = 79 }; -struct TRINITY_DLL_DECL npc_mistAI : public ScriptedAI +struct TRINITY_DLL_DECL npc_mistAI : public FollowerAI { - npc_mistAI(Creature *c) : ScriptedAI(c) - { - uiNpcFlags = c->GetUInt32Value(UNIT_NPC_FLAGS); - uiPlayerGUID = 0; - } - - uint64 uiPlayerGUID; - uint32 uiNpcFlags; - uint32 uiCheckPlayerTimer; - - void Reset() - { - uiCheckPlayerTimer = 2500; + npc_mistAI(Creature* pCreature) : FollowerAI(pCreature) { } - if (!uiPlayerGUID) - m_creature->SetUInt32Value(UNIT_NPC_FLAGS, uiNpcFlags); - } + void Reset() { } void MoveInLineOfSight(Unit *pWho) { - if (pWho->GetEntry() == NPC_ARYNIA) + FollowerAI::MoveInLineOfSight(pWho); + + if (!m_creature->getVictim() && !IsFollowComplete() && pWho->GetEntry() == NPC_ARYNIA) { if (m_creature->IsWithinDistInMap(pWho, 10.0f)) { @@ -71,43 +61,11 @@ struct TRINITY_DLL_DECL npc_mistAI : public ScriptedAI } } - void EnterEvadeMode() - { - m_creature->RemoveAllAuras(); - m_creature->DeleteThreatList(); - m_creature->CombatStop(true); - m_creature->LoadCreaturesAddon(); - - if (m_creature->isAlive()) - { - if (Player* pPlayer = Unit::GetPlayer(uiPlayerGUID)) - m_creature->GetMotionMaster()->MoveFollow(pPlayer, PET_FOLLOW_DIST, m_creature->GetFollowAngle()); - else - { - m_creature->GetMotionMaster()->MovementExpired(); - m_creature->GetMotionMaster()->MoveTargetedHome(); - } - } - - m_creature->SetLootRecipient(NULL); - - Reset(); - } - - void DoStart(uint64 uiPlayer) - { - uiPlayerGUID = uiPlayer; - m_creature->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE); - - if (Player* pPlayer = Unit::GetPlayer(uiPlayer)) - m_creature->GetMotionMaster()->MoveFollow(pPlayer, PET_FOLLOW_DIST, m_creature->GetFollowAngle()); - } - void DoComplete() { DoScriptText(EMOTE_AT_HOME, m_creature); - if (Player* pPlayer = Unit::GetPlayer(uiPlayerGUID)) + if (Player* pPlayer = GetLeaderForFollower()) { if (pPlayer->GetQuestStatus(QUEST_MIST) == QUEST_STATUS_INCOMPLETE) { @@ -115,55 +73,25 @@ struct TRINITY_DLL_DECL npc_mistAI : public ScriptedAI if (uiQuestLogSlot < MAX_QUEST_LOG_SIZE) { + //This will be wrong, need to check all group members (if any) for state before event if (pPlayer->GetQuestSlotState(uiQuestLogSlot) != QUEST_STATE_FAIL) pPlayer->AreaExploredOrEventHappens(QUEST_MIST); } } } - uiPlayerGUID = 0; - EnterEvadeMode(); - } - - void EnterCombat(Unit* who) { } - - void JustDied(Unit* pKiller) - { - if (Player* pPlayer = Unit::GetPlayer(uiPlayerGUID)) - pPlayer->FailQuest(QUEST_MIST); - - uiPlayerGUID = 0; - m_creature->GetMotionMaster()->MovementExpired(); + //The follow is over (and for later development to indicate a post event can now run) + SetFollowComplete(); } - void UpdateAI(const uint32 diff) + //call not needed here, no known abilities + /*void UpdateFollowerAI(const uint32 uiDiff) { - if (uiPlayerGUID) - { - if (!m_creature->isInCombat()) - { - if (uiCheckPlayerTimer < diff) - { - uiCheckPlayerTimer = 5000; - - Player* pPlayer = Unit::GetPlayer(uiPlayerGUID); - - if (pPlayer && !pPlayer->isAlive()) - { - uiPlayerGUID = 0; - EnterEvadeMode(); - } - } - else - uiCheckPlayerTimer -= diff; - } - } - if (!UpdateVictim()) return; DoMeleeAttackIfReady(); - } + }*/ }; CreatureAI* GetAI_npc_mist(Creature* pCreature) @@ -174,7 +102,10 @@ CreatureAI* GetAI_npc_mist(Creature* pCreature) bool QuestAccept_npc_mist(Player* pPlayer, Creature* pCreature, Quest const* pQuest) { if (pQuest->GetQuestId() == QUEST_MIST) - CAST_AI(npc_mistAI, (pCreature->AI()))->DoStart(pPlayer->GetGUID()); + { + if (npc_mistAI* pMistAI = CAST_AI(npc_mistAI, pCreature->AI())) + pMistAI->StartFollow(pPlayer, FACTION_DARNASSUS, pQuest); + } return true; } diff --git a/src/bindings/scripts/scripts/outland/nagrand.cpp b/src/bindings/scripts/scripts/outland/nagrand.cpp index 09435b91efe..865fc24f922 100644 --- a/src/bindings/scripts/scripts/outland/nagrand.cpp +++ b/src/bindings/scripts/scripts/outland/nagrand.cpp @@ -237,7 +237,7 @@ struct TRINITY_DLL_DECL mob_sunspring_villagerAI : public ScriptedAI void Reset() { - m_creature->SetUInt32Value(UNIT_DYNAMIC_FLAGS, 32); + m_creature->SetUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD); m_creature->SetStandState(UNIT_STAND_STATE_DEAD); } diff --git a/src/bindings/scripts/system/ScriptLoader.cpp b/src/bindings/scripts/system/ScriptLoader.cpp index 85221f5cb7e..024fbe7b7a1 100644 --- a/src/bindings/scripts/system/ScriptLoader.cpp +++ b/src/bindings/scripts/system/ScriptLoader.cpp @@ -188,6 +188,7 @@ extern void AddSC_tirisfal_glades(); extern void AddSC_undercity(); extern void AddSC_western_plaguelands(); extern void AddSC_westfall(); +extern void AddSC_wetlands(); //kalimdor extern void AddSC_instance_blackfathom_deeps(); //Blackfathom Depths @@ -573,6 +574,7 @@ void AddScripts() AddSC_undercity(); AddSC_western_plaguelands(); AddSC_westfall(); + AddSC_wetlands(); //kalimdor AddSC_instance_blackfathom_deeps(); //Blackfathom Depths -- cgit v1.2.3 From 5d2d8d8074eb7f845627fcc97645c8d0081be2ba Mon Sep 17 00:00:00 2001 From: Kudlaty Date: Sun, 16 Aug 2009 22:21:57 +0200 Subject: Merge [SD2] r1321 Add support for quest 863. Some cleanup in existing script. r1322 Correct database info for current supported Mangos revision (8273+) (Windows may use from 8190+) - skip r1323 Make escortAI function IsPlayerOrGroupInRange and move existing code to this. r1324 Fixed IsEncounterInProgress for Arcatraz, The Eye and Shadow Labyrinth r1325 Renamed aunchindoun to auchindoun. Fixed comment typos. --HG-- branch : trunk --- sql/FULL/world_script_waypoints.sql | 68 ++++ sql/FULL/world_scripts_full.sql | 1 + sql/updates/5097_world_scripts.sql | 69 ++++ src/bindings/scripts/CMakeLists.txt | 28 +- src/bindings/scripts/VC80/80ScriptDev2.vcproj | 28 +- src/bindings/scripts/VC90/90ScriptDev2.vcproj | 28 +- src/bindings/scripts/base/escort_ai.cpp | 52 +-- src/bindings/scripts/base/escort_ai.h | 2 + .../scripts/eastern_kingdoms/hinterlands.cpp | 168 ++++++-- .../auchenai_crypts/boss_exarch_maladaar.cpp | 358 +++++++++++++++++ .../boss_shirrak_the_dead_watcher.cpp | 212 ++++++++++ .../mana_tombs/boss_nexusprince_shaffar.cpp | 369 +++++++++++++++++ .../auchindoun/mana_tombs/boss_pandemonius.cpp | 138 +++++++ .../sethekk_halls/boss_darkweaver_syth.cpp | 438 +++++++++++++++++++++ .../sethekk_halls/boss_tailonking_ikiss.cpp | 221 +++++++++++ .../auchindoun/sethekk_halls/def_sethekk_halls.h | 14 + .../sethekk_halls/instance_sethekk_halls.cpp | 91 +++++ .../shadow_labyrinth/boss_ambassador_hellmaw.cpp | 217 ++++++++++ .../boss_blackheart_the_inciter.cpp | 177 +++++++++ .../shadow_labyrinth/boss_grandmaster_vorpil.cpp | 321 +++++++++++++++ .../auchindoun/shadow_labyrinth/boss_murmur.cpp | 207 ++++++++++ .../shadow_labyrinth/def_shadow_labyrinth.h | 15 + .../shadow_labyrinth/instance_shadow_labyrinth.cpp | 227 +++++++++++ .../auchenai_crypts/boss_exarch_maladaar.cpp | 358 ----------------- .../boss_shirrak_the_dead_watcher.cpp | 212 ---------- .../mana_tombs/boss_nexusprince_shaffar.cpp | 369 ----------------- .../aunchindoun/mana_tombs/boss_pandemonius.cpp | 138 ------- .../sethekk_halls/boss_darkweaver_syth.cpp | 438 --------------------- .../sethekk_halls/boss_tailonking_ikiss.cpp | 221 ----------- .../aunchindoun/sethekk_halls/def_sethekk_halls.h | 14 - .../sethekk_halls/instance_sethekk_halls.cpp | 91 ----- .../shadow_labyrinth/boss_ambassador_hellmaw.cpp | 217 ---------- .../boss_blackheart_the_inciter.cpp | 177 --------- .../shadow_labyrinth/boss_grandmaster_vorpil.cpp | 321 --------------- .../aunchindoun/shadow_labyrinth/boss_murmur.cpp | 207 ---------- .../shadow_labyrinth/def_shadow_labyrinth.h | 15 - .../shadow_labyrinth/instance_shadow_labyrinth.cpp | 227 ----------- .../tempest_keep/arcatraz/instance_arcatraz.cpp | 3 +- src/bindings/scripts/system/ScriptLoader.cpp | 16 +- 39 files changed, 3367 insertions(+), 3106 deletions(-) create mode 100644 sql/updates/5097_world_scripts.sql create mode 100644 src/bindings/scripts/scripts/outland/auchindoun/auchenai_crypts/boss_exarch_maladaar.cpp create mode 100644 src/bindings/scripts/scripts/outland/auchindoun/auchenai_crypts/boss_shirrak_the_dead_watcher.cpp create mode 100644 src/bindings/scripts/scripts/outland/auchindoun/mana_tombs/boss_nexusprince_shaffar.cpp create mode 100644 src/bindings/scripts/scripts/outland/auchindoun/mana_tombs/boss_pandemonius.cpp create mode 100644 src/bindings/scripts/scripts/outland/auchindoun/sethekk_halls/boss_darkweaver_syth.cpp create mode 100644 src/bindings/scripts/scripts/outland/auchindoun/sethekk_halls/boss_tailonking_ikiss.cpp create mode 100644 src/bindings/scripts/scripts/outland/auchindoun/sethekk_halls/def_sethekk_halls.h create mode 100644 src/bindings/scripts/scripts/outland/auchindoun/sethekk_halls/instance_sethekk_halls.cpp create mode 100644 src/bindings/scripts/scripts/outland/auchindoun/shadow_labyrinth/boss_ambassador_hellmaw.cpp create mode 100644 src/bindings/scripts/scripts/outland/auchindoun/shadow_labyrinth/boss_blackheart_the_inciter.cpp create mode 100644 src/bindings/scripts/scripts/outland/auchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp create mode 100644 src/bindings/scripts/scripts/outland/auchindoun/shadow_labyrinth/boss_murmur.cpp create mode 100644 src/bindings/scripts/scripts/outland/auchindoun/shadow_labyrinth/def_shadow_labyrinth.h create mode 100644 src/bindings/scripts/scripts/outland/auchindoun/shadow_labyrinth/instance_shadow_labyrinth.cpp delete mode 100644 src/bindings/scripts/scripts/outland/aunchindoun/auchenai_crypts/boss_exarch_maladaar.cpp delete mode 100644 src/bindings/scripts/scripts/outland/aunchindoun/auchenai_crypts/boss_shirrak_the_dead_watcher.cpp delete mode 100644 src/bindings/scripts/scripts/outland/aunchindoun/mana_tombs/boss_nexusprince_shaffar.cpp delete mode 100644 src/bindings/scripts/scripts/outland/aunchindoun/mana_tombs/boss_pandemonius.cpp delete mode 100644 src/bindings/scripts/scripts/outland/aunchindoun/sethekk_halls/boss_darkweaver_syth.cpp delete mode 100644 src/bindings/scripts/scripts/outland/aunchindoun/sethekk_halls/boss_tailonking_ikiss.cpp delete mode 100644 src/bindings/scripts/scripts/outland/aunchindoun/sethekk_halls/def_sethekk_halls.h delete mode 100644 src/bindings/scripts/scripts/outland/aunchindoun/sethekk_halls/instance_sethekk_halls.cpp delete mode 100644 src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/boss_ambassador_hellmaw.cpp delete mode 100644 src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/boss_blackheart_the_inciter.cpp delete mode 100644 src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp delete mode 100644 src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/boss_murmur.cpp delete mode 100644 src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/def_shadow_labyrinth.h delete mode 100644 src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/instance_shadow_labyrinth.cpp (limited to 'sql') diff --git a/sql/FULL/world_script_waypoints.sql b/sql/FULL/world_script_waypoints.sql index 9dfa805c30f..86aee4a71ac 100644 --- a/sql/FULL/world_script_waypoints.sql +++ b/sql/FULL/world_script_waypoints.sql @@ -13,6 +13,74 @@ CREATE TABLE script_waypoint ( PRIMARY KEY (entry, pointid) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Script Creature waypoints'; +DELETE FROM script_waypoint WHERE entry=7806; +INSERT INTO script_waypoint VALUES +(7806, 0, 495.404358, -3478.350830, 114.837, 0, ''), +(7806, 1, 492.704742, -3486.112549, 108.627, 0, ''), +(7806, 2, 487.249756, -3485.764404, 107.890, 0, ''), +(7806, 3, 476.851959, -3489.875977, 99.985, 0, ''), +(7806, 4, 467.212402, -3493.355469, 99.819, 0, ''), +(7806, 5, 460.017029, -3496.984375, 104.481, 0, ''), +(7806, 6, 439.619446, -3500.730225, 110.534, 0, ''), +(7806, 7, 428.326385, -3495.874756, 118.662, 0, ''), +(7806, 8, 424.664032, -3489.381592, 121.999, 0, ''), +(7806, 9, 424.137299, -3470.952637, 124.333, 0, ''), +(7806, 10, 421.791107, -3449.242676, 119.126, 0, ''), +(7806, 11, 404.247070, -3429.376953, 117.644, 0, ''), +(7806, 12, 335.465271, -3430.717773, 116.456, 0, ''), +(7806, 13, 317.160126, -3426.708984, 116.226, 0, ''), +(7806, 14, 331.180115, -3464.002197, 117.143, 0, ''), +(7806, 15, 336.393616, -3501.877441, 118.201, 0, ''), +(7806, 16, 337.251312, -3544.764648, 117.284, 0, ''), +(7806, 17, 337.748932, -3565.415527, 116.797, 0, ''), +(7806, 18, 336.010925, -3597.363037, 118.225, 0, ''), +(7806, 19, 324.619141, -3622.884033, 119.811, 0, ''), +(7806, 20, 308.027466, -3648.600098, 123.047, 0, ''), +(7806, 21, 276.325409, -3685.738525, 128.356, 0, ''), +(7806, 22, 239.981064, -3717.330811, 131.874, 0, ''), +(7806, 23, 224.950974, -3730.169678, 132.125, 0, ''), +(7806, 24, 198.707870, -3768.292725, 129.420, 0, ''), +(7806, 25, 183.758316, -3791.068848, 128.045, 0, ''), +(7806, 26, 178.110657, -3801.575439, 128.370, 3000, 'SAY_OOX_DANGER'), +(7806, 27, 162.215225, -3827.014160, 129.424, 0, ''), +(7806, 28, 141.664734, -3864.519287, 131.419, 0, ''), +(7806, 29, 135.301697, -3880.089111, 132.120, 0, ''), +(7806, 30, 122.461151, -3910.071533, 135.605, 0, ''), +(7806, 31, 103.376175, -3937.725098, 137.342, 0, ''), +(7806, 32, 81.414474, -3958.614258, 138.469, 0, ''), +(7806, 33, 55.378139, -3982.004639, 136.520, 0, ''), +(7806, 34, 13.983131, -4013.952881, 126.903, 0, ''), +(7806, 35, -21.658007, -4048.713623, 118.068, 0, ''), +(7806, 36, -52.443058, -4081.209717, 117.477, 0, ''), +(7806, 37, -102.710854, -4116.760742, 118.666, 0, ''), +(7806, 38, -92.996193, -4135.847168, 119.310, 0, ''), +(7806, 39, -86.391273, -4153.331055, 122.502, 0, ''), +(7806, 40, -85.746086, -4163.600586, 121.892, 0, ''), +(7806, 41, -90.544006, -4183.577637, 117.587, 0, ''), +(7806, 42, -110.223564, -4205.861328, 121.878, 0, ''), +(7806, 43, -115.257607, -4211.962402, 121.878, 3000, 'SAY_OOX_DANGER'), +(7806, 44, -128.594650, -4233.343750, 117.766, 0, ''), +(7806, 45, -135.358917, -4258.120117, 117.562, 0, ''), +(7806, 46, -156.832428, -4258.961914, 120.059, 0, ''), +(7806, 47, -167.119873, -4274.102539, 117.062, 0, ''), +(7806, 48, -176.291016, -4287.594727, 118.721, 0, ''), +(7806, 49, -196.992981, -4315.815430, 117.588, 0, ''), +(7806, 50, -209.329300, -4331.671387, 115.142, 0, ''), +(7806, 51, -232.292236, -4356.015625, 108.543, 0, ''), +(7806, 52, -232.159683, -4370.904297, 102.815, 0, ''), +(7806, 53, -210.271133, -4389.896973, 84.167, 0, ''), +(7806, 54, -187.940186, -4407.532715, 70.987, 0, ''), +(7806, 55, -181.353577, -4418.771973, 64.778, 0, ''), +(7806, 56, -170.529861, -4440.438965, 58.943, 0, ''), +(7806, 57, -141.428543, -4465.323242, 45.963, 0, ''), +(7806, 58, -120.993629, -4487.088379, 32.075, 0, ''), +(7806, 59, -104.134621, -4501.837402, 25.051, 0, ''), +(7806, 60, -84.154663, -4529.436523, 11.952, 0, ''), +(7806, 61, -88.698898, -4544.626465, 9.055, 0, ''), +(7806, 62, -100.603447, -4575.034180, 11.388, 0, ''), +(7806, 63, -106.908669, -4600.407715, 11.046, 0, ''), +(7806, 64, -106.831703, -4620.503418, 11.057, 3000, 'SAY_OOX_COMPLETE'); + DELETE FROM script_waypoint WHERE entry=4962; INSERT INTO script_waypoint VALUES (4962, 0, -3804.438965, -828.048035, 10.093068, 0, ''), diff --git a/sql/FULL/world_scripts_full.sql b/sql/FULL/world_scripts_full.sql index 88f51044f53..ae503cd4e47 100644 --- a/sql/FULL/world_scripts_full.sql +++ b/sql/FULL/world_scripts_full.sql @@ -555,6 +555,7 @@ UPDATE `creature_template` SET `ScriptName`='npc_tracy_proudwell' WHERE `entry`= /* HILLSBRAD FOOTHILLS */ /* HINTERLANDS */ +UPDATE `creature_template` SET `ScriptName`='npc_00x09hl' WHERE `entry`=7806; UPDATE `creature_template` SET `ScriptName`='npc_rinji' WHERE `entry`=7780; /* ICECROWN */ diff --git a/sql/updates/5097_world_scripts.sql b/sql/updates/5097_world_scripts.sql new file mode 100644 index 00000000000..6a4f6f8cd61 --- /dev/null +++ b/sql/updates/5097_world_scripts.sql @@ -0,0 +1,69 @@ +UPDATE creature_template SET ScriptName='npc_00x09hl' WHERE entry=7806; + +DELETE FROM script_waypoint WHERE entry=7806; +INSERT INTO script_waypoint VALUES +(7806, 0, 495.404358, -3478.350830, 114.837, 0, ''), +(7806, 1, 492.704742, -3486.112549, 108.627, 0, ''), +(7806, 2, 487.249756, -3485.764404, 107.890, 0, ''), +(7806, 3, 476.851959, -3489.875977, 99.985, 0, ''), +(7806, 4, 467.212402, -3493.355469, 99.819, 0, ''), +(7806, 5, 460.017029, -3496.984375, 104.481, 0, ''), +(7806, 6, 439.619446, -3500.730225, 110.534, 0, ''), +(7806, 7, 428.326385, -3495.874756, 118.662, 0, ''), +(7806, 8, 424.664032, -3489.381592, 121.999, 0, ''), +(7806, 9, 424.137299, -3470.952637, 124.333, 0, ''), +(7806, 10, 421.791107, -3449.242676, 119.126, 0, ''), +(7806, 11, 404.247070, -3429.376953, 117.644, 0, ''), +(7806, 12, 335.465271, -3430.717773, 116.456, 0, ''), +(7806, 13, 317.160126, -3426.708984, 116.226, 0, ''), +(7806, 14, 331.180115, -3464.002197, 117.143, 0, ''), +(7806, 15, 336.393616, -3501.877441, 118.201, 0, ''), +(7806, 16, 337.251312, -3544.764648, 117.284, 0, ''), +(7806, 17, 337.748932, -3565.415527, 116.797, 0, ''), +(7806, 18, 336.010925, -3597.363037, 118.225, 0, ''), +(7806, 19, 324.619141, -3622.884033, 119.811, 0, ''), +(7806, 20, 308.027466, -3648.600098, 123.047, 0, ''), +(7806, 21, 276.325409, -3685.738525, 128.356, 0, ''), +(7806, 22, 239.981064, -3717.330811, 131.874, 0, ''), +(7806, 23, 224.950974, -3730.169678, 132.125, 0, ''), +(7806, 24, 198.707870, -3768.292725, 129.420, 0, ''), +(7806, 25, 183.758316, -3791.068848, 128.045, 0, ''), +(7806, 26, 178.110657, -3801.575439, 128.370, 3000, 'SAY_OOX_DANGER'), +(7806, 27, 162.215225, -3827.014160, 129.424, 0, ''), +(7806, 28, 141.664734, -3864.519287, 131.419, 0, ''), +(7806, 29, 135.301697, -3880.089111, 132.120, 0, ''), +(7806, 30, 122.461151, -3910.071533, 135.605, 0, ''), +(7806, 31, 103.376175, -3937.725098, 137.342, 0, ''), +(7806, 32, 81.414474, -3958.614258, 138.469, 0, ''), +(7806, 33, 55.378139, -3982.004639, 136.520, 0, ''), +(7806, 34, 13.983131, -4013.952881, 126.903, 0, ''), +(7806, 35, -21.658007, -4048.713623, 118.068, 0, ''), +(7806, 36, -52.443058, -4081.209717, 117.477, 0, ''), +(7806, 37, -102.710854, -4116.760742, 118.666, 0, ''), +(7806, 38, -92.996193, -4135.847168, 119.310, 0, ''), +(7806, 39, -86.391273, -4153.331055, 122.502, 0, ''), +(7806, 40, -85.746086, -4163.600586, 121.892, 0, ''), +(7806, 41, -90.544006, -4183.577637, 117.587, 0, ''), +(7806, 42, -110.223564, -4205.861328, 121.878, 0, ''), +(7806, 43, -115.257607, -4211.962402, 121.878, 3000, 'SAY_OOX_DANGER'), +(7806, 44, -128.594650, -4233.343750, 117.766, 0, ''), +(7806, 45, -135.358917, -4258.120117, 117.562, 0, ''), +(7806, 46, -156.832428, -4258.961914, 120.059, 0, ''), +(7806, 47, -167.119873, -4274.102539, 117.062, 0, ''), +(7806, 48, -176.291016, -4287.594727, 118.721, 0, ''), +(7806, 49, -196.992981, -4315.815430, 117.588, 0, ''), +(7806, 50, -209.329300, -4331.671387, 115.142, 0, ''), +(7806, 51, -232.292236, -4356.015625, 108.543, 0, ''), +(7806, 52, -232.159683, -4370.904297, 102.815, 0, ''), +(7806, 53, -210.271133, -4389.896973, 84.167, 0, ''), +(7806, 54, -187.940186, -4407.532715, 70.987, 0, ''), +(7806, 55, -181.353577, -4418.771973, 64.778, 0, ''), +(7806, 56, -170.529861, -4440.438965, 58.943, 0, ''), +(7806, 57, -141.428543, -4465.323242, 45.963, 0, ''), +(7806, 58, -120.993629, -4487.088379, 32.075, 0, ''), +(7806, 59, -104.134621, -4501.837402, 25.051, 0, ''), +(7806, 60, -84.154663, -4529.436523, 11.952, 0, ''), +(7806, 61, -88.698898, -4544.626465, 9.055, 0, ''), +(7806, 62, -100.603447, -4575.034180, 11.388, 0, ''), +(7806, 63, -106.908669, -4600.407715, 11.046, 0, ''), +(7806, 64, -106.831703, -4620.503418, 11.057, 3000, 'SAY_OOX_COMPLETE'); diff --git a/src/bindings/scripts/CMakeLists.txt b/src/bindings/scripts/CMakeLists.txt index 285fb004c59..58b91096c18 100644 --- a/src/bindings/scripts/CMakeLists.txt +++ b/src/bindings/scripts/CMakeLists.txt @@ -405,20 +405,20 @@ SET(trinityscript_LIB_SRCS scripts/northrend/sholazar_basin.cpp scripts/northrend/wintergrasp.cpp scripts/northrend/zuldrak.cpp - scripts/outland/aunchindoun/auchenai_crypts/boss_exarch_maladaar.cpp - scripts/outland/aunchindoun/auchenai_crypts/boss_shirrak_the_dead_watcher.cpp - scripts/outland/aunchindoun/mana_tombs/boss_nexusprince_shaffar.cpp - scripts/outland/aunchindoun/mana_tombs/boss_pandemonius.cpp - scripts/outland/aunchindoun/sethekk_halls/boss_darkweaver_syth.cpp - scripts/outland/aunchindoun/sethekk_halls/boss_tailonking_ikiss.cpp - scripts/outland/aunchindoun/sethekk_halls/def_sethekk_halls.h - scripts/outland/aunchindoun/sethekk_halls/instance_sethekk_halls.cpp - scripts/outland/aunchindoun/shadow_labyrinth/boss_ambassador_hellmaw.cpp - scripts/outland/aunchindoun/shadow_labyrinth/boss_blackheart_the_inciter.cpp - scripts/outland/aunchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp - scripts/outland/aunchindoun/shadow_labyrinth/boss_murmur.cpp - scripts/outland/aunchindoun/shadow_labyrinth/def_shadow_labyrinth.h - scripts/outland/aunchindoun/shadow_labyrinth/instance_shadow_labyrinth.cpp + scripts/outland/auchindoun/auchenai_crypts/boss_exarch_maladaar.cpp + scripts/outland/auchindoun/auchenai_crypts/boss_shirrak_the_dead_watcher.cpp + scripts/outland/auchindoun/mana_tombs/boss_nexusprince_shaffar.cpp + scripts/outland/auchindoun/mana_tombs/boss_pandemonius.cpp + scripts/outland/auchindoun/sethekk_halls/boss_darkweaver_syth.cpp + scripts/outland/auchindoun/sethekk_halls/boss_tailonking_ikiss.cpp + scripts/outland/auchindoun/sethekk_halls/def_sethekk_halls.h + scripts/outland/auchindoun/sethekk_halls/instance_sethekk_halls.cpp + scripts/outland/auchindoun/shadow_labyrinth/boss_ambassador_hellmaw.cpp + scripts/outland/auchindoun/shadow_labyrinth/boss_blackheart_the_inciter.cpp + scripts/outland/auchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp + scripts/outland/auchindoun/shadow_labyrinth/boss_murmur.cpp + scripts/outland/auchindoun/shadow_labyrinth/def_shadow_labyrinth.h + scripts/outland/auchindoun/shadow_labyrinth/instance_shadow_labyrinth.cpp scripts/outland/black_temple/black_temple.cpp scripts/outland/black_temple/boss_bloodboil.cpp scripts/outland/black_temple/boss_illidan.cpp diff --git a/src/bindings/scripts/VC80/80ScriptDev2.vcproj b/src/bindings/scripts/VC80/80ScriptDev2.vcproj index 635f9356908..4c98db9abb2 100644 --- a/src/bindings/scripts/VC80/80ScriptDev2.vcproj +++ b/src/bindings/scripts/VC80/80ScriptDev2.vcproj @@ -2172,11 +2172,11 @@ Name="Auchenai Crypts" > @@ -2184,11 +2184,11 @@ Name="Mana Tombs" > @@ -2196,19 +2196,19 @@ Name="Sethekk Halls" > @@ -2216,27 +2216,27 @@ Name="Shadow Labyrinth" > diff --git a/src/bindings/scripts/VC90/90ScriptDev2.vcproj b/src/bindings/scripts/VC90/90ScriptDev2.vcproj index c6f403470cb..ee30f353115 100644 --- a/src/bindings/scripts/VC90/90ScriptDev2.vcproj +++ b/src/bindings/scripts/VC90/90ScriptDev2.vcproj @@ -2169,11 +2169,11 @@ Name="Auchenai Crypts" > @@ -2181,11 +2181,11 @@ Name="Mana Tombs" > @@ -2193,19 +2193,19 @@ Name="Sethekk Halls" > @@ -2213,27 +2213,27 @@ Name="Shadow Labyrinth" > diff --git a/src/bindings/scripts/base/escort_ai.cpp b/src/bindings/scripts/base/escort_ai.cpp index 2c28aa6b9a6..37c8c31981b 100644 --- a/src/bindings/scripts/base/escort_ai.cpp +++ b/src/bindings/scripts/base/escort_ai.cpp @@ -130,6 +130,32 @@ void npc_escortAI::EnterEvadeMode() Reset(); } +bool npc_escortAI::IsPlayerOrGroupInRange() +{ + if (Player* pPlayer = Unit::GetPlayer(PlayerGUID)) + { + if (Group* pGroup = pPlayer->GetGroup()) + { + for(GroupReference* pRef = pGroup->GetFirstMember(); pRef != NULL; pRef = pRef->next()) + { + Player* pMember = pRef->getSource(); + + if (pMember && m_creature->IsWithinDistInMap(pMember, GetMaxPlayerDistance())) + { + return true; + break; + } + } + } + else + { + if (m_creature->IsWithinDistInMap(pPlayer, GetMaxPlayerDistance())) + return true; + } + } + return false; +} + void npc_escortAI::UpdateAI(const uint32 uiDiff) { //Waypoint Updating @@ -194,31 +220,7 @@ void npc_escortAI::UpdateAI(const uint32 uiDiff) { if (m_uiPlayerCheckTimer < uiDiff) { - bool bIsMaxRangeExceeded = true; - - if (Player* pPlayer = Unit::GetPlayer(PlayerGUID)) - { - if (Group* pGroup = pPlayer->GetGroup()) - { - for(GroupReference* pRef = pGroup->GetFirstMember(); pRef != NULL; pRef = pRef->next()) - { - Player* pMember = pRef->getSource(); - - if (pMember && m_creature->IsWithinDistInMap(pMember, GetMaxPlayerDistance())) - { - bIsMaxRangeExceeded = false; - break; - } - } - } - else - { - if (m_creature->IsWithinDistInMap(pPlayer, GetMaxPlayerDistance())) - bIsMaxRangeExceeded = false; - } - } - - if (DespawnAtFar && bIsMaxRangeExceeded) + if (DespawnAtFar && !IsPlayerOrGroupInRange()) { debug_log("TSCR: EscortAI failed because player/group was to far away or not found"); diff --git a/src/bindings/scripts/base/escort_ai.h b/src/bindings/scripts/base/escort_ai.h index 663e11d79f6..243e64d6d21 100644 --- a/src/bindings/scripts/base/escort_ai.h +++ b/src/bindings/scripts/base/escort_ai.h @@ -56,6 +56,8 @@ struct TRINITY_DLL_DECL npc_escortAI : public ScriptedAI // EscortAI functions void AddWaypoint(uint32 id, float x, float y, float z, uint32 WaitTimeMs = 0); + bool IsPlayerOrGroupInRange(); + void FillPointMovementListForCreature(); void Start(bool bIsActiveAttacker = true, bool bRun = false, uint64 uiPlayerGUID = 0, const Quest* pQuest = NULL, bool bInstantRespawn = false, bool bCanLoopPath = false); diff --git a/src/bindings/scripts/scripts/eastern_kingdoms/hinterlands.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/hinterlands.cpp index b02d3fb918b..6b661dad5ef 100644 --- a/src/bindings/scripts/scripts/eastern_kingdoms/hinterlands.cpp +++ b/src/bindings/scripts/scripts/eastern_kingdoms/hinterlands.cpp @@ -17,17 +17,125 @@ /* ScriptData SDName: Hinterlands SD%Complete: 100 -SDComment: Quest support: 2742 +SDComment: Quest support: 863, 2742 SDCategory: The Hinterlands EndScriptData */ /* ContentData +npc_00x09hl npc_rinji EndContentData */ #include "precompiled.h" #include "escort_ai.h" +/*###### +## npc_00x09hl +######*/ + +enum +{ + SAY_OOX_START = -1000416, + SAY_OOX_AGGRO = -1000417, + SAY_OOX_DANGER = -1000418, + SAY_OOX_COMPLETE = -1000419, + + QUEST_RESQUE_OOX_09 = 836, + + NPC_MARAUDING_OWL = 7808, + NPC_VILE_AMBUSHER = 7809, + + FACTION_ESCORTEE_A = 774, + FACTION_ESCORTEE_H = 775 +}; + +struct MANGOS_DLL_DECL npc_00x09hlAI : public npc_escortAI +{ + npc_00x09hlAI(Creature* pCreature) : npc_escortAI(pCreature) { } + + void Reset() { } + + void WaypointReached(uint32 uiPointId) + { + switch(uiPointId) + { + case 26: + DoScriptText(SAY_OOX_DANGER, m_creature); + break; + case 43: + DoScriptText(SAY_OOX_DANGER, m_creature); + break; + case 64: + DoScriptText(SAY_OOX_COMPLETE, m_creature); + if (Player* pPlayer = Unit::GetPlayer(PlayerGUID)) + pPlayer->GroupEventHappens(QUEST_RESQUE_OOX_09, m_creature); + break; + } + } + + void WaypointStart(uint32 uiPointId) + { + switch(uiPointId) + { + case 27: + for(int i = 0; i < 3; ++i) + { + float fX, fY, fZ; + m_creature->GetRandomPoint(147.927444, -3851.513428, 130.893, 7.0f, fX, fY, fZ); + + m_creature->SummonCreature(NPC_MARAUDING_OWL, fX, fY, fZ, 0.0f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 25000); + } + break; + case 44: + for(int i = 0; i < 3; ++i) + { + float fX, fY, fZ; + m_creature->GetRandomPoint(-141.151581, -4291.213867, 120.130, 7.0f, fX, fY, fZ); + + m_creature->SummonCreature(NPC_VILE_AMBUSHER, fX, fY, fZ, 0.0f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 25000); + } + break; + } + } + + void Aggro(Unit* pWho) + { + if (pWho->GetEntry() == NPC_MARAUDING_OWL || pWho->GetEntry() == NPC_VILE_AMBUSHER) + return; + + DoScriptText(SAY_OOX_AGGRO, m_creature); + } + + void JustSummoned(Creature* pSummoned) + { + pSummoned->GetMotionMaster()->MovePoint(0, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ()); + } +}; + +bool QuestAccept_npc_00x09hl(Player* pPlayer, Creature* pCreature, const Quest* pQuest) +{ + if (pQuest->GetQuestId() == QUEST_RESQUE_OOX_09) + { + pCreature->SetStandState(UNIT_STAND_STATE_STAND); + + if (pPlayer->GetTeam() == ALLIANCE) + pCreature->setFaction(FACTION_ESCORTEE_A); + else if (pPlayer->GetTeam() == HORDE) + pCreature->setFaction(FACTION_ESCORTEE_H); + + DoScriptText(SAY_OOX_START, pCreature, pPlayer); + + if (npc_00x09hlAI* pEscortAI = CAST_AI(npc_00x09hlAI, pCreature->AI())) + pEscortAI->Start(false, false, pPlayer->GetGUID(), pQuest); + } + return true; +} + +CreatureAI* GetAI_npc_00x09hl(Creature* pCreature) +{ + return new npc_00x09hlAI(pCreature); +} + /*###### ## npc_rinji ######*/ @@ -164,39 +272,45 @@ struct TRINITY_DLL_DECL npc_rinjiAI : public npc_escortAI } } - void UpdateAI(const uint32 uiDiff) + void UpdateEscortAI(const uint32 uiDiff) { - npc_escortAI::UpdateAI(uiDiff); - - if (IsBeingEscorted && m_uiPostEventCount && !m_creature->getVictim()) + //Check if we have a current target + if (!UpdateVictim()) { - if (m_uiPostEventTimer < uiDiff) + if (IsBeingEscorted && m_uiPostEventCount) { - m_uiPostEventTimer = 3000; - - if (Unit* pPlayer = Unit::GetUnit(*m_creature, PlayerGUID)) + if (m_uiPostEventTimer < uiDiff) { - switch(m_uiPostEventCount) + m_uiPostEventTimer = 3000; + + if (Unit* pPlayer = Unit::GetUnit(*m_creature, PlayerGUID)) + { + switch(m_uiPostEventCount) + { + case 1: + DoScriptText(SAY_RIN_PROGRESS_1, m_creature, pPlayer); + ++m_uiPostEventCount; + break; + case 2: + DoScriptText(SAY_RIN_PROGRESS_2, m_creature, pPlayer); + m_uiPostEventCount = 0; + break; + } + } + else { - case 1: - DoScriptText(SAY_RIN_PROGRESS_1, m_creature, pPlayer); - ++m_uiPostEventCount; - break; - case 2: - DoScriptText(SAY_RIN_PROGRESS_2, m_creature, pPlayer); - m_uiPostEventCount = 0; - break; + m_creature->ForcedDespawn(); + return; } } else - { - m_creature->ForcedDespawn(); - return; - } + m_uiPostEventTimer -= uiDiff; } - else - m_uiPostEventTimer -= uiDiff; + + return; } + + DoMeleeAttackIfReady(); } }; @@ -222,6 +336,12 @@ void AddSC_hinterlands() { Script* newscript; + newscript = new Script; + newscript->Name = "npc_00x09hl"; + newscript->GetAI = &GetAI_npc_00x09hl; + newscript->pQuestAccept = &QuestAccept_npc_00x09hl; + newscript->RegisterSelf(); + newscript = new Script; newscript->Name = "npc_rinji"; newscript->GetAI = &GetAI_npc_rinji; diff --git a/src/bindings/scripts/scripts/outland/auchindoun/auchenai_crypts/boss_exarch_maladaar.cpp b/src/bindings/scripts/scripts/outland/auchindoun/auchenai_crypts/boss_exarch_maladaar.cpp new file mode 100644 index 00000000000..414804a6576 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/auchindoun/auchenai_crypts/boss_exarch_maladaar.cpp @@ -0,0 +1,358 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Exarch_Maladaar +SD%Complete: 95 +SDComment: Most of event implemented, some adjustments to timers remain and possibly make some better code for switching his dark side in to better "images" of player. +SDCategory: Auchindoun, Auchenai Crypts +EndScriptData */ + +/* ContentData +mob_stolen_soul +boss_exarch_maladaar +mob_avatar_of_martyred +EndContentData */ + +#include "precompiled.h" + +#define SPELL_MOONFIRE 37328 +#define SPELL_FIREBALL 37329 +#define SPELL_MIND_FLAY 37330 +#define SPELL_HEMORRHAGE 37331 +#define SPELL_FROSTSHOCK 37332 +#define SPELL_CURSE_OF_AGONY 37334 +#define SPELL_MORTAL_STRIKE 37335 +#define SPELL_FREEZING_TRAP 37368 +#define SPELL_HAMMER_OF_JUSTICE 37369 + +struct TRINITY_DLL_DECL mob_stolen_soulAI : public ScriptedAI +{ + mob_stolen_soulAI(Creature *c) : ScriptedAI(c) {} + + uint8 myClass; + uint32 Class_Timer; + + void Reset() + { + Class_Timer = 1000; + } + + void EnterCombat(Unit *who) + { } + + void SetMyClass(uint8 myclass) + { + myClass = myclass; + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (Class_Timer < diff) + { + switch (myClass) + { + case CLASS_WARRIOR: + DoCast(m_creature->getVictim(), SPELL_MORTAL_STRIKE); + Class_Timer = 6000; + break; + case CLASS_PALADIN: + DoCast(m_creature->getVictim(), SPELL_HAMMER_OF_JUSTICE); + Class_Timer = 6000; + break; + case CLASS_HUNTER: + DoCast(m_creature->getVictim(), SPELL_FREEZING_TRAP); + Class_Timer = 20000; + break; + case CLASS_ROGUE: + DoCast(m_creature->getVictim(), SPELL_HEMORRHAGE); + Class_Timer = 10000; + break; + case CLASS_PRIEST: + DoCast(m_creature->getVictim(), SPELL_MIND_FLAY); + Class_Timer = 5000; + break; + case CLASS_SHAMAN: + DoCast(m_creature->getVictim(), SPELL_FROSTSHOCK); + Class_Timer = 8000; + break; + case CLASS_MAGE: + DoCast(m_creature->getVictim(), SPELL_FIREBALL); + Class_Timer = 5000; + break; + case CLASS_WARLOCK: + DoCast(m_creature->getVictim(), SPELL_CURSE_OF_AGONY); + Class_Timer = 20000; + break; + case CLASS_DRUID: + DoCast(m_creature->getVictim(), SPELL_MOONFIRE); + Class_Timer = 10000; + break; + } + } else Class_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_stolen_soul(Creature* pCreature) +{ + return new mob_stolen_soulAI (pCreature); +} + +#define SAY_INTRO -1558000 +#define SAY_SUMMON -1558001 + +#define SAY_AGGRO_1 -1558002 +#define SAY_AGGRO_2 -1558003 +#define SAY_AGGRO_3 -1558004 + +#define SAY_ROAR -1558005 +#define SAY_SOUL_CLEAVE -1558006 + +#define SAY_SLAY_1 -1558007 +#define SAY_SLAY_2 -1558008 + +#define SAY_DEATH -1558009 + +#define SPELL_RIBBON_OF_SOULS 32422 +#define SPELL_SOUL_SCREAM 32421 + +#define SPELL_STOLEN_SOUL 32346 +#define SPELL_STOLEN_SOUL_VISUAL 32395 + +#define SPELL_SUMMON_AVATAR 32424 + +#define ENTRY_STOLEN_SOUL 18441 + +struct TRINITY_DLL_DECL boss_exarch_maladaarAI : public ScriptedAI +{ + boss_exarch_maladaarAI(Creature *c) : ScriptedAI(c) + { + HasTaunted = false; + } + + uint32 soulmodel; + uint64 soulholder; + uint8 soulclass; + + uint32 Fear_timer; + uint32 Ribbon_of_Souls_timer; + uint32 StolenSoul_Timer; + + bool HasTaunted; + bool Avatar_summoned; + + void Reset() + { + soulmodel = 0; + soulholder = 0; + soulclass = 0; + + Fear_timer = 15000 + rand()% 5000; + Ribbon_of_Souls_timer = 5000; + StolenSoul_Timer = 25000 + rand()% 10000; + + Avatar_summoned = false; + } + + void MoveInLineOfSight(Unit *who) + { + if (!HasTaunted && m_creature->IsWithinDistInMap(who, 150.0)) + { + DoScriptText(SAY_INTRO, m_creature); + HasTaunted = true; + } + + ScriptedAI::MoveInLineOfSight(who); + } + + + void EnterCombat(Unit *who) + { + switch (rand()%3) + { + case 0: DoScriptText(SAY_AGGRO_1, m_creature); break; + case 1: DoScriptText(SAY_AGGRO_2, m_creature); break; + case 2: DoScriptText(SAY_AGGRO_3, m_creature); break; + } + } + + void JustSummoned(Creature *summoned) + { + if (summoned->GetEntry() == ENTRY_STOLEN_SOUL) + { + //SPELL_STOLEN_SOUL_VISUAL has shapeshift effect, but not implemented feature in Trinity for this spell. + summoned->CastSpell(summoned,SPELL_STOLEN_SOUL_VISUAL,false); + summoned->SetDisplayId(soulmodel); + summoned->setFaction(m_creature->getFaction()); + + if (Unit *target = Unit::GetUnit(*m_creature,soulholder)) + { + + CAST_AI(mob_stolen_soulAI, summoned->AI())->SetMyClass(soulclass); + summoned->AI()->AttackStart(target); + } + } + } + + void KilledUnit(Unit* victim) + { + if (rand()%2) + return; + + switch (rand()%2) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature); break; + case 1: DoScriptText(SAY_SLAY_2, m_creature); break; + } + } + + void JustDied(Unit* Killer) + { + DoScriptText(SAY_DEATH, m_creature); + //When Exarch Maladar is defeated D'ore appear. + m_creature->SummonCreature(19412, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 600000); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (!Avatar_summoned && ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() < 25)) + { + if (m_creature->IsNonMeleeSpellCasted(false)) + m_creature->InterruptNonMeleeSpells(true); + + DoScriptText(SAY_SUMMON, m_creature); + + DoCast(m_creature, SPELL_SUMMON_AVATAR); + Avatar_summoned = true; + StolenSoul_Timer = 15000 + rand()% 15000; + } + + if (StolenSoul_Timer < diff) + { + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) + { + if (target->GetTypeId() == TYPEID_PLAYER) + { + if (m_creature->IsNonMeleeSpellCasted(false)) + m_creature->InterruptNonMeleeSpells(true); + + uint32 i = urand(1,2); + if (i == 1) + DoScriptText(SAY_ROAR, m_creature); + else + DoScriptText(SAY_SOUL_CLEAVE, m_creature); + + soulmodel = target->GetDisplayId(); + soulholder = target->GetGUID(); + soulclass = target->getClass(); + + DoCast(target,SPELL_STOLEN_SOUL); + m_creature->SummonCreature(ENTRY_STOLEN_SOUL, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000); + + StolenSoul_Timer = 20000 + rand()% 10000; + } else StolenSoul_Timer = 1000; + } + }else StolenSoul_Timer -= diff; + + if (Ribbon_of_Souls_timer < diff) + { + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target,SPELL_RIBBON_OF_SOULS); + + Ribbon_of_Souls_timer = 5000 + (rand()%20 * 1000); + }else Ribbon_of_Souls_timer -= diff; + + if (Fear_timer < diff) + { + DoCast(m_creature,SPELL_SOUL_SCREAM); + Fear_timer = 15000 + rand()% 15000; + }else Fear_timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_exarch_maladaar(Creature* pCreature) +{ + return new boss_exarch_maladaarAI (pCreature); +} + +#define SPELL_AV_MORTAL_STRIKE 16856 +#define SPELL_AV_SUNDER_ARMOR 16145 + +struct TRINITY_DLL_DECL mob_avatar_of_martyredAI : public ScriptedAI +{ + mob_avatar_of_martyredAI(Creature *c) : ScriptedAI(c) {} + + uint32 Mortal_Strike_timer; + + void Reset() + { + Mortal_Strike_timer = 10000; + } + + void EnterCombat(Unit *who) + { + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (Mortal_Strike_timer < diff) + { + DoCast(m_creature->getVictim(), SPELL_AV_MORTAL_STRIKE); + Mortal_Strike_timer = 10000 + rand()%20 * 1000; + } else Mortal_Strike_timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_avatar_of_martyred(Creature* pCreature) +{ + return new mob_avatar_of_martyredAI (pCreature); +} + +void AddSC_boss_exarch_maladaar() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_exarch_maladaar"; + newscript->GetAI = &GetAI_boss_exarch_maladaar; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_avatar_of_martyred"; + newscript->GetAI = &GetAI_mob_avatar_of_martyred; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_stolen_soul"; + newscript->GetAI = &GetAI_mob_stolen_soul; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/auchindoun/auchenai_crypts/boss_shirrak_the_dead_watcher.cpp b/src/bindings/scripts/scripts/outland/auchindoun/auchenai_crypts/boss_shirrak_the_dead_watcher.cpp new file mode 100644 index 00000000000..4dfdd407731 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/auchindoun/auchenai_crypts/boss_shirrak_the_dead_watcher.cpp @@ -0,0 +1,212 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +Name: Boss_Shirrak_the_dead_watcher +%Complete: 80 +Comment: InhibitMagic should stack slower far from the boss, proper Visual for Focus Fire, heroic implemented +Category: Auchindoun, Auchenai Crypts +EndScriptData */ + +#include "precompiled.h" + +#define SPELL_INHIBITMAGIC 32264 +#define SPELL_ATTRACTMAGIC 32265 +#define N_SPELL_CARNIVOROUSBITE 36383 +#define H_SPELL_CARNIVOROUSBITE 39382 +#define SPELL_CARNIVOROUSBITE (HeroicMode?H_SPELL_CARNIVOROUSBITE:N_SPELL_CARNIVOROUSBITE) + +#define ENTRY_FOCUS_FIRE 18374 + +#define N_SPELL_FIERY_BLAST 32302 +#define H_SPELL_FIERY_BLAST 38382 +#define SPELL_FIERY_BLAST (HeroicMode?H_SPELL_FIERY_BLAST:N_SPELL_FIERY_BLAST) +#define SPELL_FOCUS_FIRE_VISUAL 42075 //need to find better visual + +struct TRINITY_DLL_DECL boss_shirrak_the_dead_watcherAI : public ScriptedAI +{ + boss_shirrak_the_dead_watcherAI(Creature *c) : ScriptedAI(c) + { + HeroicMode = m_creature->GetMap()->IsHeroic(); + } + + uint32 Inhibitmagic_Timer; + uint32 Attractmagic_Timer; + uint32 Carnivorousbite_Timer; + uint32 FocusFire_Timer; + bool HeroicMode; + Unit *focusedTarget; + + void Reset() + { + Inhibitmagic_Timer = 0; + Attractmagic_Timer = 28000; + Carnivorousbite_Timer = 10000; + FocusFire_Timer = 17000; + focusedTarget = NULL; + } + + void EnterCombat(Unit *who) + { } + + void JustSummoned(Creature *summoned) + { + if (summoned && summoned->GetEntry() == ENTRY_FOCUS_FIRE) + { + summoned->CastSpell(summoned,SPELL_FOCUS_FIRE_VISUAL,false); + summoned->setFaction(m_creature->getFaction()); + summoned->SetLevel(m_creature->getLevel()); + summoned->addUnitState(UNIT_STAT_ROOT); + + if (focusedTarget) + summoned->AI()->AttackStart(focusedTarget); + } + } + + void UpdateAI(const uint32 diff) + { + //Inhibitmagic_Timer + if (Inhibitmagic_Timer < diff) + { + float dist; + Map* pMap = m_creature->GetMap(); + Map::PlayerList const &PlayerList = pMap->GetPlayers(); + for(Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) + if (Player* i_pl = i->getSource()) + if (i_pl->isAlive() && (dist = i_pl->IsWithinDist(m_creature, 45))) + { + i_pl->RemoveAurasDueToSpell(SPELL_INHIBITMAGIC); + m_creature->AddAura(SPELL_INHIBITMAGIC, i_pl); + if (dist < 35) + m_creature->AddAura(SPELL_INHIBITMAGIC, i_pl); + if (dist < 25) + m_creature->AddAura(SPELL_INHIBITMAGIC, i_pl); + if (dist < 15) + m_creature->AddAura(SPELL_INHIBITMAGIC, i_pl); + } + Inhibitmagic_Timer = 3000+(rand()%1000); + }else Inhibitmagic_Timer -= diff; + + //Return since we have no target + if (!UpdateVictim()) + return; + + //Attractmagic_Timer + if (Attractmagic_Timer < diff) + { + DoCast(m_creature,SPELL_ATTRACTMAGIC); + Attractmagic_Timer = 30000; + Carnivorousbite_Timer = 1500; + }else Attractmagic_Timer -= diff; + + //Carnivorousbite_Timer + if (Carnivorousbite_Timer < diff) + { + DoCast(m_creature,SPELL_CARNIVOROUSBITE); + Carnivorousbite_Timer = 10000; + }else Carnivorousbite_Timer -= diff; + + //FocusFire_Timer + if (FocusFire_Timer < diff) + { + // Summon Focus Fire & Emote + Unit *target = SelectUnit(SELECT_TARGET_RANDOM,1); + if (target && target->GetTypeId() == TYPEID_PLAYER && target->isAlive()) + { + focusedTarget = target; + m_creature->SummonCreature(ENTRY_FOCUS_FIRE,target->GetPositionX(),target->GetPositionY(),target->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN,5500); + + // TODO: Find better way to handle emote + // Emote + std::string *emote = new std::string("focuses on "); + emote->append(target->GetName()); + emote->append("!"); + const char* text = emote->c_str(); + m_creature->MonsterTextEmote(text, 0, true); + delete emote; + } + FocusFire_Timer = 15000+(rand()%5000); + }else FocusFire_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_shirrak_the_dead_watcher(Creature* pCreature) +{ + return new boss_shirrak_the_dead_watcherAI (pCreature); +} + +struct TRINITY_DLL_DECL mob_focus_fireAI : public ScriptedAI +{ + mob_focus_fireAI(Creature *c) : ScriptedAI(c) + { + HeroicMode = m_creature->GetMap()->IsHeroic(); + } + + bool HeroicMode; + uint32 FieryBlast_Timer; + bool fiery1, fiery2; + + void Reset() + { + FieryBlast_Timer = 3000+(rand()%1000); + fiery1 = fiery2 = true; + } + + void EnterCombat(Unit *who) + { } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + //FieryBlast_Timer + if (fiery2 && FieryBlast_Timer < diff) + { + DoCast(m_creature,SPELL_FIERY_BLAST); + + if (fiery1) fiery1 = false; + else if (fiery2) fiery2 = false; + + FieryBlast_Timer = 1000; + }else FieryBlast_Timer -= diff; + + //DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_focus_fire(Creature* pCreature) +{ + return new mob_focus_fireAI (pCreature); +} + +void AddSC_boss_shirrak_the_dead_watcher() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_shirrak_the_dead_watcher"; + newscript->GetAI = &GetAI_boss_shirrak_the_dead_watcher; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_focus_fire"; + newscript->GetAI = &GetAI_mob_focus_fire; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/auchindoun/mana_tombs/boss_nexusprince_shaffar.cpp b/src/bindings/scripts/scripts/outland/auchindoun/mana_tombs/boss_nexusprince_shaffar.cpp new file mode 100644 index 00000000000..dcaaefee8c2 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/auchindoun/mana_tombs/boss_nexusprince_shaffar.cpp @@ -0,0 +1,369 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_NexusPrince_Shaffar +SD%Complete: 80 +SDComment: Need more tuning of spell timers, it should not be as linear fight as current. Also should possibly find a better way to deal with his three initial beacons to make sure all aggro. +SDCategory: Auchindoun, Mana Tombs +EndScriptData */ + +/* ContentData +boss_nexusprince_shaffar +mob_ethereal_beacon +EndContentData */ + +#include "precompiled.h" + +enum +{ + SAY_INTRO = -1557000, + SAY_AGGRO_1 = -1557001, + SAY_AGGRO_2 = -1557002, + SAY_AGGRO_3 = -1557003, + SAY_SLAY_1 = -1557004, + SAY_SLAY_2 = -1557005, + SAY_SUMMON = -1557006, + SAY_DEAD = -1557007, + + SPELL_BLINK = 34605, + SPELL_FROSTBOLT = 32364, + SPELL_FIREBALL = 32363, + SPELL_FROSTNOVA = 32365, + + SPELL_ETHEREAL_BEACON = 32371, // Summons NPC_BEACON + SPELL_ETHEREAL_BEACON_VISUAL = 32368, + + NPC_BEACON = 18431, + NPC_SHAFFAR = 18344, + + NR_INITIAL_BEACONS = 3 +}; + +struct TRINITY_DLL_DECL boss_nexusprince_shaffarAI : public ScriptedAI +{ + boss_nexusprince_shaffarAI(Creature *c) : ScriptedAI(c), summons(me) { HasTaunted = false; } + + uint32 Blink_Timer; + uint32 Beacon_Timer; + uint32 FireBall_Timer; + uint32 Frostbolt_Timer; + uint32 FrostNova_Timer; + + SummonList summons; + + bool HasTaunted; + bool CanBlink; + + void Reset() + { + Blink_Timer = 1500; + Beacon_Timer = 10000; + FireBall_Timer = 8000; + Frostbolt_Timer = 4000; + FrostNova_Timer = 15000; + + CanBlink = false; + + float dist = 8.0f; + float posX, posY, posZ, angle; + m_creature->GetHomePosition(posX, posY, posZ, angle); + + m_creature->SummonCreature(NPC_BEACON, posX - dist, posY - dist, posZ, angle, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 7200000); + m_creature->SummonCreature(NPC_BEACON, posX - dist, posY + dist, posZ, angle, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 7200000); + m_creature->SummonCreature(NPC_BEACON, posX + dist, posY, posZ, angle, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 7200000); + } + + void EnterEvadeMode() + { + summons.DespawnAll(); + ScriptedAI::EnterEvadeMode(); + } + + void MoveInLineOfSight(Unit *who) + { + if (!HasTaunted && who->GetTypeId() == TYPEID_PLAYER && m_creature->IsWithinDistInMap(who, 100.0f)) + { + DoScriptText(SAY_INTRO, m_creature); + HasTaunted = true; + } + } + + void EnterCombat(Unit *who) + { + switch(rand()%3) + { + case 0: DoScriptText(SAY_AGGRO_1, m_creature); break; + case 1: DoScriptText(SAY_AGGRO_2, m_creature); break; + case 2: DoScriptText(SAY_AGGRO_3, m_creature); break; + } + + DoZoneInCombat(); + summons.DoZoneInCombat(); + } + + void JustSummoned(Creature *summoned) + { + if (summoned->GetEntry() == NPC_BEACON) + { + summoned->CastSpell(summoned,SPELL_ETHEREAL_BEACON_VISUAL,false); + + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) + summoned->AI()->AttackStart(target); + } + + summons.Summon(summoned); + } + + void SummonedCreatureDespawn(Creature *summon) + { + summons.Despawn(summon); + } + + void KilledUnit(Unit* victim) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature); break; + case 1: DoScriptText(SAY_SLAY_2, m_creature); break; + } + } + + void JustDied(Unit* Killer) + { + DoScriptText(SAY_DEAD, m_creature); + summons.DespawnAll(); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (FrostNova_Timer < diff) + { + if (m_creature->IsNonMeleeSpellCasted(false)) + m_creature->InterruptNonMeleeSpells(true); + + DoCast(m_creature,SPELL_FROSTNOVA); + FrostNova_Timer = 17500 + rand()%7500; + CanBlink = true; + }else FrostNova_Timer -= diff; + + if (Frostbolt_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_FROSTBOLT); + Frostbolt_Timer = 4500 + rand()%1500; + }else Frostbolt_Timer -= diff; + + if (FireBall_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_FIREBALL); + FireBall_Timer = 4500 + rand()%1500; + }else FireBall_Timer -= diff; + + if (CanBlink) + { + if (Blink_Timer < diff) + { + if (m_creature->IsNonMeleeSpellCasted(false)) + m_creature->InterruptNonMeleeSpells(true); + + //expire movement, will prevent from running right back to victim after cast + //(but should MoveChase be used again at a certain time or should he not move?) + if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == TARGETED_MOTION_TYPE) + m_creature->GetMotionMaster()->MovementExpired(); + + DoCast(m_creature,SPELL_BLINK); + Blink_Timer = 1000 + rand()%1500; + CanBlink = false; + }else Blink_Timer -= diff; + } + + if (Beacon_Timer < diff) + { + if (m_creature->IsNonMeleeSpellCasted(false)) + m_creature->InterruptNonMeleeSpells(true); + + if (!urand(0,3)) + DoScriptText(SAY_SUMMON, m_creature); + + DoCast(m_creature,SPELL_ETHEREAL_BEACON, true); + + Beacon_Timer = 10000; + }else Beacon_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_nexusprince_shaffar(Creature* pCreature) +{ + return new boss_nexusprince_shaffarAI (pCreature); +} + +enum +{ + SPELL_ARCANE_BOLT = 15254, + SPELL_ETHEREAL_APPRENTICE = 32372 // Summon 18430 +}; + +struct TRINITY_DLL_DECL mob_ethereal_beaconAI : public ScriptedAI +{ + mob_ethereal_beaconAI(Creature *c) : ScriptedAI(c) + { + HeroicMode = m_creature->GetMap()->IsHeroic(); + } + + bool HeroicMode; + uint32 Apprentice_Timer; + uint32 ArcaneBolt_Timer; + uint32 Check_Timer; + + void KillSelf() + { + m_creature->Kill(m_creature); + } + + void Reset() + { + Apprentice_Timer = (HeroicMode ? 10000 : 20000); + ArcaneBolt_Timer = 1000; + Check_Timer = 1000; + } + + void EnterCombat(Unit *who) + { + // Send Shaffar to fight + Creature* Shaffar = me->FindNearestCreature(NPC_SHAFFAR, 100); + if (!Shaffar || Shaffar->isDead()) + { + KillSelf(); + return; + } + if (!Shaffar->isInCombat()) + Shaffar->AI()->AttackStart(who); + } + + void JustSummoned(Creature *summoned) + { + summoned->AI()->AttackStart(m_creature->getVictim()); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (Check_Timer < diff) + { + Creature *Shaffar = me->FindNearestCreature(NPC_SHAFFAR, 100); + if (!Shaffar || Shaffar->isDead() || !Shaffar->isInCombat()) + { + KillSelf(); + return; + } + Check_Timer = 1000; + }else Check_Timer -= diff; + + if (ArcaneBolt_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_ARCANE_BOLT); + ArcaneBolt_Timer = 2000 + rand()%2500; + }else ArcaneBolt_Timer -= diff; + + if (Apprentice_Timer < diff) + { + if (m_creature->IsNonMeleeSpellCasted(false)) + m_creature->InterruptNonMeleeSpells(true); + + m_creature->CastSpell(m_creature,SPELL_ETHEREAL_APPRENTICE,true); + m_creature->ForcedDespawn(); + return; + }else Apprentice_Timer -= diff; + } +}; + +CreatureAI* GetAI_mob_ethereal_beacon(Creature* pCreature) +{ + return new mob_ethereal_beaconAI (pCreature); +} + +enum +{ + SPELL_ETHEREAL_APPRENTICE_FIREBOLT = 32369, + SPELL_ETHEREAL_APPRENTICE_FROSTBOLT = 32370 +}; + +struct TRINITY_DLL_DECL mob_ethereal_apprenticeAI : public ScriptedAI +{ + mob_ethereal_apprenticeAI(Creature *c) : ScriptedAI(c) {} + + uint32 Cast_Timer; + + bool isFireboltTurn; + + void Reset() + { + Cast_Timer = 3000; + isFireboltTurn = true; + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (Cast_Timer < diff) + { + if (isFireboltTurn) + { + m_creature->CastSpell(m_creature->getVictim(), SPELL_ETHEREAL_APPRENTICE_FIREBOLT, true); + isFireboltTurn = false; + }else{ + m_creature->CastSpell(m_creature->getVictim(), SPELL_ETHEREAL_APPRENTICE_FROSTBOLT, true); + isFireboltTurn = true; + } + Cast_Timer = 3000; + }else Cast_Timer -= diff; + } +}; + +CreatureAI* GetAI_mob_ethereal_apprentice(Creature* pCreature) +{ + return new mob_ethereal_apprenticeAI (pCreature); +} + +void AddSC_boss_nexusprince_shaffar() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_nexusprince_shaffar"; + newscript->GetAI = &GetAI_boss_nexusprince_shaffar; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_ethereal_beacon"; + newscript->GetAI = &GetAI_mob_ethereal_beacon; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_ethereal_apprentice"; + newscript->GetAI = &GetAI_mob_ethereal_apprentice; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/auchindoun/mana_tombs/boss_pandemonius.cpp b/src/bindings/scripts/scripts/outland/auchindoun/mana_tombs/boss_pandemonius.cpp new file mode 100644 index 00000000000..77e1c535340 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/auchindoun/mana_tombs/boss_pandemonius.cpp @@ -0,0 +1,138 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Pandemonius +SD%Complete: 75 +SDComment: Not known how void blast is done (amount of rapid cast seems to be related to players in party). All mobs remaining in surrounding area should aggro when engaged. +SDCategory: Auchindoun, Mana Tombs +EndScriptData */ + +#include "precompiled.h" + +#define SAY_AGGRO_1 -1557008 +#define SAY_AGGRO_2 -1557009 +#define SAY_AGGRO_3 -1557010 + +#define SAY_KILL_1 -1557011 +#define SAY_KILL_2 -1557012 + +#define SAY_DEATH -1557013 + +#define EMOTE_DARK_SHELL -1557014 + +#define SPELL_VOID_BLAST 32325 +#define H_SPELL_VOID_BLAST 38760 +#define SPELL_DARK_SHELL 32358 +#define H_SPELL_DARK_SHELL 38759 + +struct TRINITY_DLL_DECL boss_pandemoniusAI : public ScriptedAI +{ + boss_pandemoniusAI(Creature *c) : ScriptedAI(c) + { + HeroicMode = m_creature->GetMap()->IsHeroic(); + } + + bool HeroicMode; + uint32 VoidBlast_Timer; + uint32 DarkShell_Timer; + uint32 VoidBlast_Counter; + + void Reset() + { + VoidBlast_Timer = 8000+rand()%15000; + DarkShell_Timer = 20000; + VoidBlast_Counter = 0; + } + + void JustDied(Unit* Killer) + { + DoScriptText(SAY_DEATH, m_creature); + } + + void KilledUnit(Unit* victim) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_KILL_1, m_creature); break; + case 1: DoScriptText(SAY_KILL_2, m_creature); break; + } + } + + void EnterCombat(Unit *who) + { + switch(rand()%3) + { + case 0: DoScriptText(SAY_AGGRO_1, m_creature); break; + case 1: DoScriptText(SAY_AGGRO_2, m_creature); break; + case 2: DoScriptText(SAY_AGGRO_3, m_creature); break; + } + + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (VoidBlast_Timer < diff) + { + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + { + DoCast(target,HeroicMode ? H_SPELL_VOID_BLAST : SPELL_VOID_BLAST); + VoidBlast_Timer = 500; + ++VoidBlast_Counter; + } + + if (VoidBlast_Counter == 5) + { + VoidBlast_Timer = 15000+rand()%10000; + VoidBlast_Counter = 0; + } + }else VoidBlast_Timer -= diff; + + if (!VoidBlast_Counter) + { + if (DarkShell_Timer < diff) + { + if (m_creature->IsNonMeleeSpellCasted(false)) + m_creature->InterruptNonMeleeSpells(true); + + DoScriptText(EMOTE_DARK_SHELL, m_creature); + + DoCast(m_creature,HeroicMode ? H_SPELL_DARK_SHELL : SPELL_DARK_SHELL); + DarkShell_Timer = 20000; + }else DarkShell_Timer -= diff; + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_pandemonius(Creature* pCreature) +{ + return new boss_pandemoniusAI (pCreature); +} + +void AddSC_boss_pandemonius() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_pandemonius"; + newscript->GetAI = &GetAI_boss_pandemonius; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/auchindoun/sethekk_halls/boss_darkweaver_syth.cpp b/src/bindings/scripts/scripts/outland/auchindoun/sethekk_halls/boss_darkweaver_syth.cpp new file mode 100644 index 00000000000..00e43fa257d --- /dev/null +++ b/src/bindings/scripts/scripts/outland/auchindoun/sethekk_halls/boss_darkweaver_syth.cpp @@ -0,0 +1,438 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Darkweaver_Syth +SD%Complete: 85 +SDComment: Shock spells/times need more work. Heroic partly implemented. +SDCategory: Auchindoun, Sethekk Halls +EndScriptData */ + +#include "precompiled.h" + +#define SAY_SUMMON -1556000 + +#define SAY_AGGRO_1 -1556001 +#define SAY_AGGRO_2 -1556002 +#define SAY_AGGRO_3 -1556003 + +#define SAY_SLAY_1 -1556004 +#define SAY_SLAY_2 -1556005 + +#define SAY_DEATH -1556006 + +#define SPELL_FROST_SHOCK 21401 //37865 +#define SPELL_FLAME_SHOCK 34354 +#define SPELL_SHADOW_SHOCK 30138 +#define SPELL_ARCANE_SHOCK 37132 + +#define SPELL_CHAIN_LIGHTNING 15659 //15305 + +#define SPELL_SUMMON_SYTH_FIRE 33537 // Spawns 19203 +#define SPELL_SUMMON_SYTH_ARCANE 33538 // Spawns 19205 +#define SPELL_SUMMON_SYTH_FROST 33539 // Spawns 19204 +#define SPELL_SUMMON_SYTH_SHADOW 33540 // Spawns 19206 + +#define SPELL_FLAME_BUFFET (HeroicMode?38141:33526) +#define SPELL_ARCANE_BUFFET (HeroicMode?38138:33527) +#define SPELL_FROST_BUFFET (HeroicMode?38142:33528) +#define SPELL_SHADOW_BUFFET (HeroicMode?38143:33529) + +struct TRINITY_DLL_DECL boss_darkweaver_sythAI : public ScriptedAI +{ + boss_darkweaver_sythAI(Creature *c) : ScriptedAI(c) + + { + HeroicMode = m_creature->GetMap()->IsHeroic(); + } + + uint32 flameshock_timer; + uint32 arcaneshock_timer; + uint32 frostshock_timer; + uint32 shadowshock_timer; + uint32 chainlightning_timer; + + bool summon90; + bool summon50; + bool summon10; + bool HeroicMode; + + void Reset() + { + flameshock_timer = 2000; + arcaneshock_timer = 4000; + frostshock_timer = 6000; + shadowshock_timer = 8000; + chainlightning_timer = 15000; + + summon90 = false; + summon50 = false; + summon10 = false; + } + + void EnterCombat(Unit *who) + { + switch(rand()%3) + { + case 0: DoScriptText(SAY_AGGRO_1, m_creature); break; + case 1: DoScriptText(SAY_AGGRO_2, m_creature); break; + case 2: DoScriptText(SAY_AGGRO_3, m_creature); break; + } + } + + void JustDied(Unit* Killer) + { + DoScriptText(SAY_DEATH, m_creature); + } + + void KilledUnit(Unit* victim) + { + if (rand()%2) + return; + + switch(rand()%2) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature); break; + case 1: DoScriptText(SAY_SLAY_2, m_creature); break; + } + } + + void JustSummoned(Creature *summoned) + { + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) + summoned->AI()->AttackStart(target); + } + + void SythSummoning() + { + DoScriptText(SAY_SUMMON, m_creature); + + if (m_creature->IsNonMeleeSpellCasted(false)) + m_creature->InterruptNonMeleeSpells(false); + + DoCast(m_creature,SPELL_SUMMON_SYTH_ARCANE,true); //front + DoCast(m_creature,SPELL_SUMMON_SYTH_FIRE,true); //back + DoCast(m_creature,SPELL_SUMMON_SYTH_FROST,true); //left + DoCast(m_creature,SPELL_SUMMON_SYTH_SHADOW,true); //right + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() < 90) && !summon90) + { + SythSummoning(); + summon90 = true; + } + + if (((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() < 50) && !summon50) + { + SythSummoning(); + summon50 = true; + } + + if (((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() < 10) && !summon10) + { + SythSummoning(); + summon10 = true; + } + + if (flameshock_timer < diff) + { + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target,SPELL_FLAME_SHOCK); + + flameshock_timer = 10000 + rand()%5000; + } else flameshock_timer -= diff; + + if (arcaneshock_timer < diff) + { + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target,SPELL_ARCANE_SHOCK); + + arcaneshock_timer = 10000 + rand()%5000; + } else arcaneshock_timer -= diff; + + if (frostshock_timer < diff) + { + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target,SPELL_FROST_SHOCK); + + frostshock_timer = 10000 + rand()%5000; + } else frostshock_timer -= diff; + + if (shadowshock_timer < diff) + { + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target,SPELL_SHADOW_SHOCK); + + shadowshock_timer = 10000 + rand()%5000; + } else shadowshock_timer -= diff; + + if (chainlightning_timer < diff) + { + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target,SPELL_CHAIN_LIGHTNING); + + chainlightning_timer = 25000; + } else chainlightning_timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_darkweaver_syth(Creature* pCreature) +{ + return new boss_darkweaver_sythAI (pCreature); +} + +/* ELEMENTALS */ + +struct TRINITY_DLL_DECL mob_syth_fireAI : public ScriptedAI +{ + mob_syth_fireAI(Creature *c) : ScriptedAI(c) + + { + HeroicMode = m_creature->GetMap()->IsHeroic(); + } + + uint32 flameshock_timer; + uint32 flamebuffet_timer; + bool HeroicMode; + + void Reset() + { + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, true); + flameshock_timer = 2500; + flamebuffet_timer = 5000; + } + + void EnterCombat(Unit *who) { } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (flameshock_timer < diff) + { + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target,SPELL_FLAME_SHOCK); + + flameshock_timer = 5000; + }else flameshock_timer -= diff; + + if (flamebuffet_timer < diff) + { + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target,SPELL_FLAME_BUFFET); + + flamebuffet_timer = 5000; + }else flamebuffet_timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_syth_fire(Creature* pCreature) +{ + return new mob_syth_fireAI (pCreature); +} + +struct TRINITY_DLL_DECL mob_syth_arcaneAI : public ScriptedAI +{ + mob_syth_arcaneAI(Creature *c) : ScriptedAI(c) + + { + HeroicMode = m_creature->GetMap()->IsHeroic(); + } + + uint32 arcaneshock_timer; + uint32 arcanebuffet_timer; + bool HeroicMode; + + void Reset() + { + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_ARCANE, true); + arcaneshock_timer = 2500; + arcanebuffet_timer = 5000; + } + + void EnterCombat(Unit *who) { } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (arcaneshock_timer < diff) + { + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target,SPELL_ARCANE_SHOCK); + + arcaneshock_timer = 5000; + }else arcaneshock_timer -= diff; + + if (arcanebuffet_timer < diff) + { + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target,SPELL_ARCANE_BUFFET); + + arcanebuffet_timer = 5000; + }else arcanebuffet_timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_syth_arcane(Creature* pCreature) +{ + return new mob_syth_arcaneAI (pCreature); +} + +struct TRINITY_DLL_DECL mob_syth_frostAI : public ScriptedAI +{ + mob_syth_frostAI(Creature *c) : ScriptedAI(c) + + { + HeroicMode = m_creature->GetMap()->IsHeroic(); + } + + uint32 frostshock_timer; + uint32 frostbuffet_timer; + bool HeroicMode; + + void Reset() + { + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, true); + frostshock_timer = 2500; + frostbuffet_timer = 5000; + } + + void EnterCombat(Unit *who) { } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (frostshock_timer < diff) + { + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target,SPELL_FROST_SHOCK); + + frostshock_timer = 5000; + }else frostshock_timer -= diff; + + if (frostbuffet_timer < diff) + { + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target,SPELL_FROST_BUFFET); + + frostbuffet_timer = 5000; + }else frostbuffet_timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_syth_frost(Creature* pCreature) +{ + return new mob_syth_frostAI (pCreature); +} + +struct TRINITY_DLL_DECL mob_syth_shadowAI : public ScriptedAI +{ + mob_syth_shadowAI(Creature *c) : ScriptedAI(c) + + { + HeroicMode = m_creature->GetMap()->IsHeroic(); + } + + uint32 shadowshock_timer; + uint32 shadowbuffet_timer; + bool HeroicMode; + + void Reset() + { + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_SHADOW, true); + shadowshock_timer = 2500; + shadowbuffet_timer = 5000; + } + + void EnterCombat(Unit *who) { } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (shadowshock_timer < diff) + { + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target,SPELL_SHADOW_SHOCK); + + shadowshock_timer = 5000; + }else shadowshock_timer -= diff; + + if (shadowbuffet_timer < diff) + { + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target,SPELL_SHADOW_BUFFET); + + shadowbuffet_timer = 5000; + }else shadowbuffet_timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_syth_shadow(Creature* pCreature) +{ + return new mob_syth_shadowAI (pCreature); +} + +void AddSC_boss_darkweaver_syth() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_darkweaver_syth"; + newscript->GetAI = &GetAI_boss_darkweaver_syth; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_syth_fire"; + newscript->GetAI = &GetAI_mob_syth_arcane; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_syth_arcane"; + newscript->GetAI = &GetAI_mob_syth_arcane; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_syth_frost"; + newscript->GetAI = &GetAI_mob_syth_frost; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_syth_shadow"; + newscript->GetAI = &GetAI_mob_syth_shadow; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/auchindoun/sethekk_halls/boss_tailonking_ikiss.cpp b/src/bindings/scripts/scripts/outland/auchindoun/sethekk_halls/boss_tailonking_ikiss.cpp new file mode 100644 index 00000000000..7830fc10645 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/auchindoun/sethekk_halls/boss_tailonking_ikiss.cpp @@ -0,0 +1,221 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Talon_King_Ikiss +SD%Complete: 80 +SDComment: Heroic supported. Some details missing, but most are spell related. +SDCategory: Auchindoun, Sethekk Halls +EndScriptData */ + +#include "precompiled.h" +#include "def_sethekk_halls.h" + +#define SAY_INTRO -1556007 + +#define SAY_AGGRO_1 -1556008 +#define SAY_AGGRO_2 -1556009 +#define SAY_AGGRO_3 -1556010 + +#define SAY_SLAY_1 -1556011 +#define SAY_SLAY_2 -1556012 +#define SAY_DEATH -1556013 +#define EMOTE_ARCANE_EXP -1556015 + +#define SPELL_BLINK 38194 +#define SPELL_BLINK_TELEPORT 38203 +#define SPELL_MANA_SHIELD 38151 +#define SPELL_ARCANE_BUBBLE 9438 +#define H_SPELL_SLOW 35032 + +#define SPELL_POLYMORPH 38245 +#define H_SPELL_POLYMORPH 43309 + +#define SPELL_ARCANE_VOLLEY 35059 +#define H_SPELL_ARCANE_VOLLEY 40424 + +#define SPELL_ARCANE_EXPLOSION 38197 +#define H_SPELL_ARCANE_EXPLOSION 40425 + +struct TRINITY_DLL_DECL boss_talon_king_ikissAI : public ScriptedAI +{ + boss_talon_king_ikissAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance* pInstance; + + bool HeroicMode; + + uint32 ArcaneVolley_Timer; + uint32 Sheep_Timer; + uint32 Blink_Timer; + uint32 Slow_Timer; + + bool ManaShield; + bool Blink; + bool Intro; + + void Reset() + { + HeroicMode = m_creature->GetMap()->IsHeroic(); + + ArcaneVolley_Timer = 5000; + Sheep_Timer = 8000; + Blink_Timer = 35000; + Slow_Timer = 15000+rand()%15000; + Blink = false; + Intro = false; + ManaShield = false; + } + + void MoveInLineOfSight(Unit *who) + { + if (!m_creature->getVictim() && who->isTargetableForAttack() && (m_creature->IsHostileTo(who)) && who->isInAccessiblePlaceFor(m_creature)) + { + if (!Intro && m_creature->IsWithinDistInMap(who, 100)) + { + Intro = true; + DoScriptText(SAY_INTRO, m_creature); + } + + if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE) + return; + + float attackRadius = m_creature->GetAttackDistance(who); + if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who)) + { + //who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH); + AttackStart(who); + } + } + } + + void EnterCombat(Unit *who) + { + switch(rand()%3) + { + case 0: DoScriptText(SAY_AGGRO_1, m_creature); break; + case 1: DoScriptText(SAY_AGGRO_2, m_creature); break; + case 2: DoScriptText(SAY_AGGRO_3, m_creature); break; + } + } + + void JustDied(Unit* Killer) + { + DoScriptText(SAY_DEATH, m_creature); + + if (pInstance) + pInstance->SetData(DATA_IKISSDOOREVENT, DONE); + } + + void KilledUnit(Unit* victim) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature); break; + case 1: DoScriptText(SAY_SLAY_2, m_creature); break; + } + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (Blink) + { + DoCast(m_creature,HeroicMode ? H_SPELL_ARCANE_EXPLOSION : SPELL_ARCANE_EXPLOSION); + m_creature->CastSpell(m_creature,SPELL_ARCANE_BUBBLE,true); + Blink = false; + } + + if (ArcaneVolley_Timer < diff) + { + DoCast(m_creature,HeroicMode ? H_SPELL_ARCANE_VOLLEY : SPELL_ARCANE_VOLLEY); + ArcaneVolley_Timer = 7000+rand()%5000; + }else ArcaneVolley_Timer -= diff; + + if (Sheep_Timer < diff) + { + //second top aggro target in normal, random target in heroic correct? + Unit *target = NULL; + target = HeroicMode ? SelectUnit(SELECT_TARGET_RANDOM,0) : SelectUnit(SELECT_TARGET_TOPAGGRO,1); + if (target) + DoCast(target,HeroicMode ? H_SPELL_POLYMORPH : SPELL_POLYMORPH); + Sheep_Timer = 15000+rand()%2500; + }else Sheep_Timer -= diff; + + //may not be correct time to cast + if (!ManaShield && ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() < 20)) + { + DoCast(m_creature,SPELL_MANA_SHIELD); + ManaShield = true; + } + + if (HeroicMode) + { + if (Slow_Timer < diff) + { + DoCast(m_creature,H_SPELL_SLOW); + Slow_Timer = 15000+rand()%25000; + }else Slow_Timer -= diff; + } + + if (Blink_Timer < diff) + { + DoScriptText(EMOTE_ARCANE_EXP, m_creature); + + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) + { + if (m_creature->IsNonMeleeSpellCasted(false)) + m_creature->InterruptNonMeleeSpells(false); + + //Spell doesn't work, but we use for visual effect at least + DoCast(target,SPELL_BLINK); + + float X = target->GetPositionX(); + float Y = target->GetPositionY(); + float Z = target->GetPositionZ(); + + DoTeleportTo(X,Y,Z); + + DoCast(target,SPELL_BLINK_TELEPORT); + Blink = true; + } + Blink_Timer = 35000+rand()%5000; + }else Blink_Timer -= diff; + + if (!Blink) + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_talon_king_ikiss(Creature* pCreature) +{ + return new boss_talon_king_ikissAI (pCreature); +} + +void AddSC_boss_talon_king_ikiss() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_talon_king_ikiss"; + newscript->GetAI = &GetAI_boss_talon_king_ikiss; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/auchindoun/sethekk_halls/def_sethekk_halls.h b/src/bindings/scripts/scripts/outland/auchindoun/sethekk_halls/def_sethekk_halls.h new file mode 100644 index 00000000000..6156f354d84 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/auchindoun/sethekk_halls/def_sethekk_halls.h @@ -0,0 +1,14 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef DEF_SETHEKK_HALLS_H +#define DEF_SETHEKK_HALLS_H + +enum +{ + DATA_IKISSDOOREVENT = 1, + TYPE_ANZU_ENCOUNTER = 2, +}; +#endif + diff --git a/src/bindings/scripts/scripts/outland/auchindoun/sethekk_halls/instance_sethekk_halls.cpp b/src/bindings/scripts/scripts/outland/auchindoun/sethekk_halls/instance_sethekk_halls.cpp new file mode 100644 index 00000000000..060e09a1325 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/auchindoun/sethekk_halls/instance_sethekk_halls.cpp @@ -0,0 +1,91 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Instance - Sethekk Halls +SD%Complete: 50 +SDComment: Instance Data for Sethekk Halls instance +SDCategory: Auchindoun, Sethekk Halls +EndScriptData */ + +#include "precompiled.h" +#include "def_sethekk_halls.h" + +enum +{ + NPC_ANZU = 23035, + IKISS_DOOR = 177203, +}; + +struct TRINITY_DLL_DECL instance_sethekk_halls : public ScriptedInstance +{ + instance_sethekk_halls(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; + + uint32 AnzuEncounter; + uint64 m_uiIkissDoorGUID; + + void Initialize() + { + AnzuEncounter = NOT_STARTED; + m_uiIkissDoorGUID = 0; + } + + void OnCreatureCreate(Creature* pCreature, bool add) + { + if (pCreature->GetEntry() == NPC_ANZU && AnzuEncounter >= IN_PROGRESS) + { + pCreature->DealDamage(pCreature, pCreature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + pCreature->RemoveCorpse(); + } else { + AnzuEncounter = IN_PROGRESS; + } + } + + void OnGameObjectCreate(GameObject* pGo, bool add) + { + if (pGo->GetEntry() == IKISS_DOOR) + m_uiIkissDoorGUID = pGo->GetGUID(); + } + + void SetData(uint32 type, uint32 data) + { + switch(type) + { + case DATA_IKISSDOOREVENT: + if (data == DONE) + DoUseDoorOrButton(m_uiIkissDoorGUID,DAY*IN_MILISECONDS); + break; + case TYPE_ANZU_ENCOUNTER: + AnzuEncounter = data; + break; + } + } +}; + +InstanceData* GetInstanceData_instance_sethekk_halls(Map* pMap) +{ + return new instance_sethekk_halls(pMap); +} + +void AddSC_instance_sethekk_halls() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_sethekk_halls"; + newscript->GetInstanceData = &GetInstanceData_instance_sethekk_halls; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/auchindoun/shadow_labyrinth/boss_ambassador_hellmaw.cpp b/src/bindings/scripts/scripts/outland/auchindoun/shadow_labyrinth/boss_ambassador_hellmaw.cpp new file mode 100644 index 00000000000..66e6b3a108d --- /dev/null +++ b/src/bindings/scripts/scripts/outland/auchindoun/shadow_labyrinth/boss_ambassador_hellmaw.cpp @@ -0,0 +1,217 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Ambassador_Hellmaw +SD%Complete: 80 +SDComment: Enrage spell missing/not known +SDCategory: Auchindoun, Shadow Labyrinth +EndScriptData */ + +#include "precompiled.h" +#include "escort_ai.h" +#include "def_shadow_labyrinth.h" + +enum +{ + SAY_INTRO = -1555000, + SAY_AGGRO1 = -1555001, + SAY_AGGRO2 = -1555002, + SAY_AGGRO3 = -1555003, + SAY_HELP = -1555004, + SAY_SLAY1 = -1555005, + SAY_SLAY2 = -1555006, + SAY_DEATH = -1555007, + + SPELL_BANISH = 30231, + SPELL_CORROSIVE_ACID = 33551, + SPELL_FEAR = 33547, + SPELL_ENRAGE = 34970 +}; + +struct TRINITY_DLL_DECL boss_ambassador_hellmawAI : public npc_escortAI +{ + boss_ambassador_hellmawAI(Creature* pCreature) : npc_escortAI(pCreature) + { + m_pInstance = pCreature->GetInstanceData(); + HeroicMode = pCreature->GetMap()->IsHeroic(); + } + + ScriptedInstance* m_pInstance; + bool HeroicMode; + + uint32 EventCheck_Timer; + uint32 CorrosiveAcid_Timer; + uint32 Fear_Timer; + uint32 Enrage_Timer; + bool Intro; + bool IsBanished; + bool Enraged; + + void Reset() + { + EventCheck_Timer = 5000; + CorrosiveAcid_Timer = 5000 + rand()%5000; + Fear_Timer = 25000 + rand()%5000; + Enrage_Timer = 180000; + Intro = false; + IsBanished = true; + Enraged = false; + + if (m_pInstance && m_creature->isAlive()) + { + if (m_pInstance->GetData(TYPE_OVERSEER) != DONE) + m_creature->CastSpell(m_creature, SPELL_BANISH, true); + } + } + + void JustReachedHome() + { + if (m_pInstance) + m_pInstance->SetData(TYPE_HELLMAW, FAIL); + } + + void MoveInLineOfSight(Unit* pWho) + { + if (m_creature->HasAura(SPELL_BANISH)) + return; + + npc_escortAI::MoveInLineOfSight(pWho); + } + + void WaypointReached(uint32 i) + { + } + + void DoIntro() + { + if (m_creature->HasAura(SPELL_BANISH)) + m_creature->RemoveAurasDueToSpell(SPELL_BANISH); + + IsBanished = false; + Intro = true; + + if (m_pInstance) + { + if (m_pInstance->GetData(TYPE_HELLMAW) != FAIL) + { + DoScriptText(SAY_INTRO, m_creature); + Start(true, false, 0, NULL, false, true); + } + + m_pInstance->SetData(TYPE_HELLMAW, IN_PROGRESS); + } + } + + void EnterCombat(Unit *who) + { + switch(rand()%3) + { + case 0: DoScriptText(SAY_AGGRO1, m_creature); break; + case 1: DoScriptText(SAY_AGGRO2, m_creature); break; + case 2: DoScriptText(SAY_AGGRO3, m_creature); break; + } + } + + void KilledUnit(Unit *victim) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_SLAY1, m_creature); break; + case 1: DoScriptText(SAY_SLAY2, m_creature); break; + } + } + + void JustDied(Unit *victim) + { + DoScriptText(SAY_DEATH, m_creature); + + if (m_pInstance) + m_pInstance->SetData(TYPE_HELLMAW, DONE); + } + + void UpdateAI(const uint32 diff) + { + if (!Intro && !IsBeingEscorted) + { + if (EventCheck_Timer < diff) + { + if (m_pInstance) + { + if (m_pInstance->GetData(TYPE_OVERSEER) == DONE) + { + DoIntro(); + return; + } + } + EventCheck_Timer = 5000; + return; + } + else + { + EventCheck_Timer -= diff; + return; + } + } + + npc_escortAI::UpdateAI(diff); + + if (!UpdateVictim()) + return; + + if (m_creature->HasAura(SPELL_BANISH, 0)) + { + EnterEvadeMode(); + return; + } + + if (CorrosiveAcid_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_CORROSIVE_ACID); + CorrosiveAcid_Timer = 15000 + rand()%10000; + }else CorrosiveAcid_Timer -= diff; + + if (Fear_Timer < diff) + { + DoCast(m_creature,SPELL_FEAR); + Fear_Timer = 20000 + rand()%15000; + }else Fear_Timer -= diff; + + if (HeroicMode) + { + if (!Enraged && Enrage_Timer < diff) + { + DoCast(m_creature,SPELL_ENRAGE); + Enraged = true; + }else Enrage_Timer -= diff; + } + } +}; + +CreatureAI* GetAI_boss_ambassador_hellmaw(Creature* pCreature) +{ + return new boss_ambassador_hellmawAI(pCreature); +} + +void AddSC_boss_ambassador_hellmaw() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_ambassador_hellmaw"; + newscript->GetAI = &GetAI_boss_ambassador_hellmaw; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/auchindoun/shadow_labyrinth/boss_blackheart_the_inciter.cpp b/src/bindings/scripts/scripts/outland/auchindoun/shadow_labyrinth/boss_blackheart_the_inciter.cpp new file mode 100644 index 00000000000..73374c08f8c --- /dev/null +++ b/src/bindings/scripts/scripts/outland/auchindoun/shadow_labyrinth/boss_blackheart_the_inciter.cpp @@ -0,0 +1,177 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Blackheart_the_Inciter +SD%Complete: 75 +SDComment: Incite Chaos not functional since core lacks Mind Control support +SDCategory: Auchindoun, Shadow Labyrinth +EndScriptData */ + +#include "precompiled.h" +#include "def_shadow_labyrinth.h" + +#define SPELL_INCITE_CHAOS 33676 +#define SPELL_INCITE_CHAOS_B 33684 //debuff applied to each member of party +#define SPELL_CHARGE 33709 +#define SPELL_WAR_STOMP 33707 + +#define SAY_INTRO1 -1555008 +#define SAY_INTRO2 -1555009 +#define SAY_INTRO3 -1555010 +#define SAY_AGGRO1 -1555011 +#define SAY_AGGRO2 -1555012 +#define SAY_AGGRO3 -1555013 +#define SAY_SLAY1 -1555014 +#define SAY_SLAY2 -1555015 +#define SAY_HELP -1555016 +#define SAY_DEATH -1555017 + +#define SAY2_INTRO1 -1555018 +#define SAY2_INTRO2 -1555019 +#define SAY2_INTRO3 -1555020 +#define SAY2_AGGRO1 -1555021 +#define SAY2_AGGRO2 -1555022 +#define SAY2_AGGRO3 -1555023 +#define SAY2_SLAY1 -1555024 +#define SAY2_SLAY2 -1555025 +#define SAY2_HELP -1555026 +#define SAY2_DEATH -1555027 + +struct TRINITY_DLL_DECL boss_blackheart_the_inciterAI : public ScriptedAI +{ + boss_blackheart_the_inciterAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance *pInstance; + + bool InciteChaos; + uint32 InciteChaos_Timer; + uint32 InciteChaosWait_Timer; + uint32 Charge_Timer; + uint32 Knockback_Timer; + + void Reset() + { + InciteChaos = false; + InciteChaos_Timer = 20000; + InciteChaosWait_Timer = 15000; + Charge_Timer = 5000; + Knockback_Timer = 15000; + + if (pInstance) + pInstance->SetData(DATA_BLACKHEARTTHEINCITEREVENT, NOT_STARTED); + } + + void KilledUnit(Unit *victim) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_SLAY1, m_creature); break; + case 1: DoScriptText(SAY_SLAY2, m_creature); break; + } + } + + void JustDied(Unit *victim) + { + DoScriptText(SAY_DEATH, m_creature); + + if (pInstance) + pInstance->SetData(DATA_BLACKHEARTTHEINCITEREVENT, DONE); + } + + void EnterCombat(Unit *who) + { + switch(rand()%3) + { + case 0: DoScriptText(SAY_AGGRO1, m_creature); break; + case 1: DoScriptText(SAY_AGGRO2, m_creature); break; + case 2: DoScriptText(SAY_AGGRO3, m_creature); break; + } + + if (pInstance) + pInstance->SetData(DATA_BLACKHEARTTHEINCITEREVENT, IN_PROGRESS); + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + if (InciteChaos) + { + if (InciteChaosWait_Timer < diff) + { + InciteChaos = false; + InciteChaosWait_Timer = 15000; + }else InciteChaosWait_Timer -= diff; + + return; + } + + if (InciteChaos_Timer < diff) + { + DoCast(m_creature, SPELL_INCITE_CHAOS); + + std::list t_list = m_creature->getThreatManager().getThreatList(); + for(std::list::iterator itr = t_list.begin(); itr!= t_list.end(); ++itr) + { + Unit* target = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid()); + if (target && target->GetTypeId() == TYPEID_PLAYER) + target->CastSpell(target,SPELL_INCITE_CHAOS_B,true); + } + + DoResetThreat(); + InciteChaos = true; + InciteChaos_Timer = 40000; + return; + }else InciteChaos_Timer -= diff; + + //Charge_Timer + if (Charge_Timer < diff) + { + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + DoCast(target, SPELL_CHARGE); + Charge_Timer = 15000 + rand()%10000; + }else Charge_Timer -= diff; + + //Knockback_Timer + if (Knockback_Timer < diff) + { + DoCast(m_creature, SPELL_WAR_STOMP); + Knockback_Timer = 18000 + rand()%6000; + }else Knockback_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_blackheart_the_inciter(Creature* pCreature) +{ + return new boss_blackheart_the_inciterAI (pCreature); +} + +void AddSC_boss_blackheart_the_inciter() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_blackheart_the_inciter"; + newscript->GetAI = &GetAI_boss_blackheart_the_inciter; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/auchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp b/src/bindings/scripts/scripts/outland/auchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp new file mode 100644 index 00000000000..0cc6255f3cf --- /dev/null +++ b/src/bindings/scripts/scripts/outland/auchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp @@ -0,0 +1,321 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Grandmaster_Vorpil +SD%Complete: 100 +SDComment: +SDCategory: Auchindoun, Shadow Labyrinth +EndScriptData */ + +#include "precompiled.h" +#include "def_shadow_labyrinth.h" + +#define SAY_INTRO -1555028 +#define SAY_AGGRO1 -1555029 +#define SAY_AGGRO2 -1555030 +#define SAY_AGGRO3 -1555031 +#define SAY_HELP -1555032 +#define SAY_SLAY1 -1555033 +#define SAY_SLAY2 -1555034 +#define SAY_DEATH -1555035 + +#define SPELL_RAIN_OF_FIRE 33617 +#define H_SPELL_RAIN_OF_FIRE 39363 + +#define SPELL_DRAW_SHADOWS 33563 +#define SPELL_SHADOWBOLT_VOLLEY 33841 +#define SPELL_BANISH 38791 + +#define MOB_VOID_TRAVELER 19226 +#define SPELL_SACRIFICE 33587 +#define SPELL_SHADOW_NOVA 33846 +#define SPELL_EMPOWERING_SHADOWS 33783 +#define H_SPELL_EMPOWERING_SHADOWS 39364 + +#define MOB_VOID_PORTAL 19224 +#define SPELL_VOID_PORTAL_VISUAL 33569 + +float VorpilPosition[3] = {-252.8820,-264.3030,17.1}; + +float VoidPortalCoords[5][3] = +{ + {-283.5894, -239.5718, 12.7}, + {-306.5853, -258.4539, 12.7}, + {-295.8789, -269.0899, 12.7}, + {-209.3401, -262.7564, 17.1}, + {-261.4533, -297.3298, 17.1} +}; + +struct TRINITY_DLL_DECL mob_voidtravelerAI : public ScriptedAI +{ + mob_voidtravelerAI(Creature *c) : ScriptedAI(c) + { + HeroicMode = m_creature->GetMap()->IsHeroic(); + } + + bool HeroicMode; + Unit *Vorpil; + uint32 move; + bool sacrificed; + + void Reset() + { + Vorpil = NULL; + move = 0; + sacrificed = false; + } + + void EnterCombat(Unit *who){} + + void UpdateAI(const uint32 diff) + { + if (!Vorpil) + { + m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + return; + } + if (move < diff) + { + if (sacrificed) + { + SpellEntry *spell = GET_SPELL(HeroicMode?H_SPELL_EMPOWERING_SHADOWS:SPELL_EMPOWERING_SHADOWS); + if (spell) + Vorpil->AddAura(new Aura(spell, 1, NULL, Vorpil, m_creature)); + Vorpil->SetHealth(Vorpil->GetHealth()+Vorpil->GetMaxHealth()/25); + DoCast(m_creature, SPELL_SHADOW_NOVA, true); + m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + return; + } + m_creature->GetMotionMaster()->MoveFollow(Vorpil,0,0); + if (m_creature->IsWithinDist(Vorpil, 3)) + { + DoCast(m_creature, SPELL_SACRIFICE, false); + sacrificed = true; + move = 500; + return; + } + if (!Vorpil->isInCombat() || Vorpil->isDead()) + { + m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + return; + } + move = 1000; + }else move -= diff; + } +}; +CreatureAI* GetAI_mob_voidtraveler(Creature* pCreature) +{ + return new mob_voidtravelerAI (pCreature); +} + +struct TRINITY_DLL_DECL boss_grandmaster_vorpilAI : public ScriptedAI +{ + boss_grandmaster_vorpilAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + HeroicMode = m_creature->GetMap()->IsHeroic(); + Intro = false; + } + + ScriptedInstance *pInstance; + bool Intro, HelpYell; + bool sumportals; + bool HeroicMode; + + uint32 ShadowBoltVolley_Timer; + uint32 DrawShadows_Timer; + uint32 summonTraveler_Timer; + uint32 banish_Timer; + uint64 PortalsGuid[5]; + + void Reset() + { + ShadowBoltVolley_Timer = 7000 + rand()%7000; + DrawShadows_Timer = 45000; + summonTraveler_Timer = 90000; + banish_Timer = 17000; + HelpYell = false; + destroyPortals(); + + if (pInstance) + pInstance->SetData(DATA_GRANDMASTERVORPILEVENT, NOT_STARTED); + } + + void summonPortals() + { + if (!sumportals) + { + for (int i = 0;i<5; ++i) + { + Creature *Portal = NULL; + Portal = m_creature->SummonCreature(MOB_VOID_PORTAL,VoidPortalCoords[i][0],VoidPortalCoords[i][1],VoidPortalCoords[i][2],0,TEMPSUMMON_CORPSE_DESPAWN,3000000); + if (Portal) + { + PortalsGuid[i] = Portal->GetGUID(); + Portal->CastSpell(Portal,SPELL_VOID_PORTAL_VISUAL,false); + } + } + sumportals = true; + summonTraveler_Timer = 5000; + } + } + + void destroyPortals() + { + if (sumportals) + { + for (int i = 0;i < 5; i ++) + { + Unit *Portal = Unit::GetUnit((*m_creature), PortalsGuid[i]); + if (Portal && Portal->isAlive()) + Portal->DealDamage(Portal, Portal->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + PortalsGuid[i] = 0; + } + sumportals = false; + } + } + + void spawnVoidTraveler() + { + int pos = rand()%5; + m_creature->SummonCreature(MOB_VOID_TRAVELER,VoidPortalCoords[pos][0],VoidPortalCoords[pos][1],VoidPortalCoords[pos][2],0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,5000); + if (!HelpYell) + { + DoScriptText(SAY_HELP, m_creature); + HelpYell = true; + } + } + + void JustSummoned(Creature *summoned) + { + if (summoned && summoned->GetEntry() == MOB_VOID_TRAVELER) + CAST_AI(mob_voidtravelerAI, summoned->AI())->Vorpil = m_creature; + } + + void KilledUnit(Unit *victim) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_SLAY1, m_creature); break; + case 1: DoScriptText(SAY_SLAY2, m_creature); break; + } + } + + void JustDied(Unit *victim) + { + DoScriptText(SAY_DEATH, m_creature); + destroyPortals(); + + if (pInstance) + pInstance->SetData(DATA_GRANDMASTERVORPILEVENT, DONE); + } + + void EnterCombat(Unit *who) + { + switch(rand()%3) + { + case 0: DoScriptText(SAY_AGGRO1, m_creature); break; + case 1: DoScriptText(SAY_AGGRO2, m_creature); break; + case 2: DoScriptText(SAY_AGGRO3, m_creature); break; + } + summonPortals(); + + if (pInstance) + pInstance->SetData(DATA_GRANDMASTERVORPILEVENT, IN_PROGRESS); + } + + void MoveInLineOfSight(Unit *who) + { + ScriptedAI::MoveInLineOfSight(who); + + if (!Intro && m_creature->IsWithinLOSInMap(who)&& m_creature->IsWithinDistInMap(who, 100) && m_creature->IsHostileTo(who)) + { + DoScriptText(SAY_INTRO, m_creature); + Intro = true; + } + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (ShadowBoltVolley_Timer < diff) + { + DoCast(m_creature,SPELL_SHADOWBOLT_VOLLEY); + ShadowBoltVolley_Timer = 15000 + rand()%15000;; + }else ShadowBoltVolley_Timer -= diff; + + if (HeroicMode && banish_Timer < diff) + { + Unit *target = SelectTarget(SELECT_TARGET_RANDOM,0,30,false); + if (target) + { + DoCast(target,SPELL_BANISH); + banish_Timer = 16000; + } + }else banish_Timer -= diff; + + if (DrawShadows_Timer < diff) + { + Map* pMap = m_creature->GetMap(); + Map::PlayerList const &PlayerList = pMap->GetPlayers(); + for(Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) + if (Player* i_pl = i->getSource()) + if (i_pl->isAlive() && !i_pl->HasAura(SPELL_BANISH)) + i_pl->TeleportTo(m_creature->GetMapId(), VorpilPosition[0],VorpilPosition[1],VorpilPosition[2], 0, TELE_TO_NOT_LEAVE_COMBAT); + + m_creature->GetMap()->CreatureRelocation(m_creature, VorpilPosition[0],VorpilPosition[1],VorpilPosition[2],0.0f); + DoCast(m_creature,SPELL_DRAW_SHADOWS,true); + + DoCast(m_creature,HeroicMode?H_SPELL_RAIN_OF_FIRE:SPELL_RAIN_OF_FIRE); + + ShadowBoltVolley_Timer = 6000; + DrawShadows_Timer = 30000; + }else DrawShadows_Timer -= diff; + + if (summonTraveler_Timer < diff) + { + spawnVoidTraveler(); + summonTraveler_Timer = 10000; + //enrage at 20% + if ((m_creature->GetHealth()*5) < m_creature->GetMaxHealth()) + summonTraveler_Timer = 5000; + }else summonTraveler_Timer -=diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_grandmaster_vorpil(Creature* pCreature) +{ + return new boss_grandmaster_vorpilAI (pCreature); +} + +void AddSC_boss_grandmaster_vorpil() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_grandmaster_vorpil"; + newscript->GetAI = &GetAI_boss_grandmaster_vorpil; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_voidtraveler"; + newscript->GetAI = &GetAI_mob_voidtraveler; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/auchindoun/shadow_labyrinth/boss_murmur.cpp b/src/bindings/scripts/scripts/outland/auchindoun/shadow_labyrinth/boss_murmur.cpp new file mode 100644 index 00000000000..259f6091af6 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/auchindoun/shadow_labyrinth/boss_murmur.cpp @@ -0,0 +1,207 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Murmur +SD%Complete: 90 +SDComment: Timers may be incorrect +SDCategory: Auchindoun, Shadow Labyrinth +EndScriptData */ + +#include "precompiled.h" +#include "def_shadow_labyrinth.h" + +#define EMOTE_SONIC_BOOM -1555036 + +#define SPELL_SONIC_BOOM_CAST (HeroicMode?38796:33923) +#define SPELL_SONIC_BOOM_EFFECT (HeroicMode?38795:33666) +#define SPELL_RESONANCE 33657 +#define SPELL_MURMURS_TOUCH (HeroicMode?38794:33711) +#define SPELL_MAGNETIC_PULL 33689 +#define SPELL_SONIC_SHOCK 38797 +#define SPELL_THUNDERING_STORM 39365 + +struct TRINITY_DLL_DECL boss_murmurAI : public ScriptedAI +{ + boss_murmurAI(Creature *c) : ScriptedAI(c) + { + SetCombatMovement(false); + HeroicMode = m_creature->GetMap()->IsHeroic(); + } + + uint32 SonicBoom_Timer; + uint32 MurmursTouch_Timer; + uint32 Resonance_Timer; + uint32 MagneticPull_Timer; + uint32 SonicShock_Timer; + uint32 ThunderingStorm_Timer; + bool HeroicMode; + bool SonicBoom; + + void Reset() + { + SonicBoom_Timer = 30000; + MurmursTouch_Timer = 8000 + rand()%12000; + Resonance_Timer = 5000; + MagneticPull_Timer = 15000 + rand()%15000; + ThunderingStorm_Timer = 15000; + SonicShock_Timer = 10000; + SonicBoom = false; + + //database should have `RegenHealth`=0 to prevent regen + uint32 hp = (m_creature->GetMaxHealth()*40)/100; + if (hp) m_creature->SetHealth(hp); + m_creature->ResetPlayerDamageReq(); + } + + void SonicBoomEffect() + { + std::list t_list = m_creature->getThreatManager().getThreatList(); + for(std::list::iterator itr = t_list.begin(); itr!= t_list.end(); ++itr) + { + Unit* target = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid()); + if (target && target->GetTypeId() == TYPEID_PLAYER) + { + //Not do anything without aura, spell can be resisted! + if (target->HasAura(SPELL_SONIC_BOOM_CAST) && m_creature->IsWithinDistInMap(target, 34.0f)) + { + //This will be wrong calculation. Also, comments suggest it must deal damage + target->SetHealth(uint32(target->GetMaxHealth() - target->GetMaxHealth() * 0.8)); + } + } + } + } + + void EnterCombat(Unit *who) { } + + // Sonic Boom instant damage (needs core fix instead of this) + void SpellHitTarget(Unit *target, const SpellEntry *spell) + { + if (target && target->isAlive() && spell && spell->Id == SPELL_SONIC_BOOM_EFFECT) + m_creature->DealDamage(target,(target->GetHealth()*90)/100,NULL,SPELL_DIRECT_DAMAGE,SPELL_SCHOOL_MASK_NATURE,spell); + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target or casting + if (!UpdateVictim() || m_creature->IsNonMeleeSpellCasted(false)) + return; + + // Sonic Boom + if (SonicBoom) + { + DoCast(m_creature, SPELL_SONIC_BOOM_EFFECT, true); + SonicBoomEffect(); + + SonicBoom = false; + Resonance_Timer = 1500; + } + if (SonicBoom_Timer < diff) + { + DoScriptText(EMOTE_SONIC_BOOM, m_creature); + DoCast(m_creature, SPELL_SONIC_BOOM_CAST); + SonicBoom_Timer = 30000; + SonicBoom = true; + return; + }else SonicBoom_Timer -= diff; + + // Murmur's Touch + if (MurmursTouch_Timer < diff) + { + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM,0,80,true)) + DoCast(target, SPELL_MURMURS_TOUCH); + MurmursTouch_Timer = 25000 + rand()%10000; + }else MurmursTouch_Timer -= diff; + + // Resonance + if (!SonicBoom && !(m_creature->IsWithinMeleeRange(m_creature->getVictim()))) + { + if (Resonance_Timer < diff) + { + DoCast(m_creature, SPELL_RESONANCE); + Resonance_Timer = 5000; + }else Resonance_Timer -= diff; + } + + // Magnetic Pull + if (MagneticPull_Timer < diff) + { + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) + if (target->GetTypeId() == TYPEID_PLAYER && target->isAlive()) + { + DoCast(target, SPELL_MAGNETIC_PULL); + MagneticPull_Timer = 15000+rand()%15000; + return; + } + MagneticPull_Timer = 500; + }else MagneticPull_Timer -= diff; + + if (HeroicMode) + { + // Thundering Storm + if (ThunderingStorm_Timer < diff) + { + std::list& m_threatlist = m_creature->getThreatManager().getThreatList(); + for(std::list::iterator i = m_threatlist.begin(); i != m_threatlist.end(); ++i) + if (Unit* target = Unit::GetUnit((*m_creature),(*i)->getUnitGuid())) + if (target->isAlive() && !m_creature->IsWithinDist(target, 35, false)) + DoCast(target, SPELL_THUNDERING_STORM, true); + ThunderingStorm_Timer = 15000; + }else ThunderingStorm_Timer -= diff; + + // Sonic Shock + if (SonicShock_Timer < diff) + { + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM,0,20,false)) + if (target->isAlive()) + DoCast(target, SPELL_SONIC_SHOCK); + SonicShock_Timer = 10000+rand()%10000; + }else SonicShock_Timer -= diff; + } + + // Select nearest most aggro target if top aggro too far + if (!m_creature->isAttackReady()) + return; + if (!m_creature->IsWithinMeleeRange(m_creature->getVictim())) + { + std::list& m_threatlist = m_creature->getThreatManager().getThreatList(); + for(std::list::iterator i = m_threatlist.begin(); i != m_threatlist.end(); ++i) + if (Unit* target = Unit::GetUnit((*m_creature),(*i)->getUnitGuid())) + if (target->isAlive() && m_creature->IsWithinMeleeRange(target)) + { + m_creature->TauntApply(target); + break; + } + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_murmur(Creature* pCreature) +{ + return new boss_murmurAI (pCreature); +} + +void AddSC_boss_murmur() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_murmur"; + newscript->GetAI = &GetAI_boss_murmur; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/auchindoun/shadow_labyrinth/def_shadow_labyrinth.h b/src/bindings/scripts/scripts/outland/auchindoun/shadow_labyrinth/def_shadow_labyrinth.h new file mode 100644 index 00000000000..a78955368bf --- /dev/null +++ b/src/bindings/scripts/scripts/outland/auchindoun/shadow_labyrinth/def_shadow_labyrinth.h @@ -0,0 +1,15 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef DEF_SHADOW_LABYRINTH_H +#define DEF_SHADOW_LABYRINTH_H + +#define TYPE_HELLMAW 1 +#define TYPE_OVERSEER 2 +#define DATA_BLACKHEARTTHEINCITEREVENT 3 +#define DATA_GRANDMASTERVORPILEVENT 4 +#define DATA_MURMUREVENT 5 +#define DATA_GRANDMASTERVORPIL 6 +#endif + diff --git a/src/bindings/scripts/scripts/outland/auchindoun/shadow_labyrinth/instance_shadow_labyrinth.cpp b/src/bindings/scripts/scripts/outland/auchindoun/shadow_labyrinth/instance_shadow_labyrinth.cpp new file mode 100644 index 00000000000..f8f3b73bffa --- /dev/null +++ b/src/bindings/scripts/scripts/outland/auchindoun/shadow_labyrinth/instance_shadow_labyrinth.cpp @@ -0,0 +1,227 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Instance_Shadow_Labyrinth +SD%Complete: 85 +SDComment: Some cleanup left along with save +SDCategory: Auchindoun, Shadow Labyrinth +EndScriptData */ + +#include "precompiled.h" +#include "def_shadow_labyrinth.h" + +#define MAX_ENCOUNTER 5 + +#define REFECTORY_DOOR 183296 //door opened when blackheart the inciter dies +#define SCREAMING_HALL_DOOR 183295 //door opened when grandmaster vorpil dies + +/* Shadow Labyrinth encounters: +1 - Ambassador Hellmaw event +2 - Blackheart the Inciter event +3 - Grandmaster Vorpil event +4 - Murmur event +*/ + +struct TRINITY_DLL_DECL instance_shadow_labyrinth : public ScriptedInstance +{ + instance_shadow_labyrinth(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; + + uint32 m_auiEncounter[MAX_ENCOUNTER]; + std::string str_data; + + uint64 m_uiRefectoryDoorGUID; + uint64 m_uiScreamingHallDoorGUID; + + uint64 m_uiGrandmasterVorpil; + uint32 m_uiFelOverseerCount; + + void Initialize() + { + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + + m_uiRefectoryDoorGUID = 0; + m_uiScreamingHallDoorGUID = 0; + + m_uiGrandmasterVorpil = 0; + m_uiFelOverseerCount = 0; + } + + bool IsEncounterInProgress() const + { + for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) + if (m_auiEncounter[i] == IN_PROGRESS) return true; + + return false; + } + + void OnGameObjectCreate(GameObject* pGo, bool add) + { + switch(pGo->GetEntry()) + { + case REFECTORY_DOOR: + m_uiRefectoryDoorGUID = pGo->GetGUID(); + if (m_auiEncounter[2] == DONE) + pGo->SetGoState(GO_STATE_ACTIVE); + break; + case SCREAMING_HALL_DOOR: + m_uiScreamingHallDoorGUID = pGo->GetGUID(); + if (m_auiEncounter[3] == DONE) + pGo->SetGoState(GO_STATE_ACTIVE); + break; + } + } + + void OnCreatureCreate(Creature* pCreature, bool add) + { + switch(pCreature->GetEntry()) + { + case 18732: + m_uiGrandmasterVorpil = pCreature->GetGUID(); + break; + case 18796: + if (pCreature->isAlive()) + { + ++m_uiFelOverseerCount; + debug_log("TSCR: Shadow Labyrinth: counting %u Fel Overseers.",m_uiFelOverseerCount); + } + break; + } + } + + void SetData(uint32 type, uint32 uiData) + { + switch(type) + { + case TYPE_HELLMAW: + m_auiEncounter[0] = uiData; + break; + + case TYPE_OVERSEER: + if (uiData != DONE) + { + error_log("TSCR: Shadow Labyrinth: TYPE_OVERSEER did not expect other data than DONE"); + return; + } + if (m_uiFelOverseerCount) + { + --m_uiFelOverseerCount; + + if (m_uiFelOverseerCount) + debug_log("TSCR: Shadow Labyrinth: %u Fel Overseers left to kill.",m_uiFelOverseerCount); + else + { + m_auiEncounter[1] = DONE; + debug_log("TSCR: Shadow Labyrinth: TYPE_OVERSEER == DONE"); + } + } + break; + + case DATA_BLACKHEARTTHEINCITEREVENT: + if (uiData == DONE) + DoUseDoorOrButton(m_uiRefectoryDoorGUID); + m_auiEncounter[2] = uiData; + break; + + case DATA_GRANDMASTERVORPILEVENT: + if (uiData == DONE) + DoUseDoorOrButton(m_uiScreamingHallDoorGUID); + m_auiEncounter[3] = uiData; + break; + + case DATA_MURMUREVENT: + m_auiEncounter[4] = uiData; + break; + } + + if (uiData == DONE) + { + if (type == TYPE_OVERSEER && m_uiFelOverseerCount != 0) + return; + + OUT_SAVE_INST_DATA; + + std::ostringstream saveStream; + saveStream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " + << m_auiEncounter[2] << " " << m_auiEncounter[3] << " " << m_auiEncounter[4]; + + str_data = saveStream.str(); + + SaveToDB(); + OUT_SAVE_INST_DATA_COMPLETE; + } + } + + uint32 GetData(uint32 type) + { + switch(type) + { + case TYPE_HELLMAW: return m_auiEncounter[0]; + case TYPE_OVERSEER: return m_auiEncounter[1]; + case DATA_GRANDMASTERVORPILEVENT: return m_auiEncounter[3]; + case DATA_MURMUREVENT: return m_auiEncounter[4]; + } + return false; + } + + uint64 GetData64(uint32 identifier) + { + if (identifier == DATA_GRANDMASTERVORPIL) + return m_uiGrandmasterVorpil; + + return 0; + } + + std::string GetSaveData() + { + return str_data; + } + + void Load(const char* in) + { + if (!in) + { + OUT_LOAD_INST_DATA_FAIL; + return; + } + + OUT_LOAD_INST_DATA(in); + + std::istringstream loadStream(in); + loadStream >> m_auiEncounter[0] >> m_auiEncounter[1] >> m_auiEncounter[2] >> m_auiEncounter[3] >> m_auiEncounter[4]; + + for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) + if (m_auiEncounter[i] == IN_PROGRESS) + m_auiEncounter[i] = NOT_STARTED; + + OUT_LOAD_INST_DATA_COMPLETE; + } +}; + +InstanceData* GetInstanceData_instance_shadow_labyrinth(Map* pMap) +{ + return new instance_shadow_labyrinth(pMap); +} + +void AddSC_instance_shadow_labyrinth() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_shadow_labyrinth"; + newscript->GetInstanceData = &GetInstanceData_instance_shadow_labyrinth; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/aunchindoun/auchenai_crypts/boss_exarch_maladaar.cpp b/src/bindings/scripts/scripts/outland/aunchindoun/auchenai_crypts/boss_exarch_maladaar.cpp deleted file mode 100644 index 414804a6576..00000000000 --- a/src/bindings/scripts/scripts/outland/aunchindoun/auchenai_crypts/boss_exarch_maladaar.cpp +++ /dev/null @@ -1,358 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Exarch_Maladaar -SD%Complete: 95 -SDComment: Most of event implemented, some adjustments to timers remain and possibly make some better code for switching his dark side in to better "images" of player. -SDCategory: Auchindoun, Auchenai Crypts -EndScriptData */ - -/* ContentData -mob_stolen_soul -boss_exarch_maladaar -mob_avatar_of_martyred -EndContentData */ - -#include "precompiled.h" - -#define SPELL_MOONFIRE 37328 -#define SPELL_FIREBALL 37329 -#define SPELL_MIND_FLAY 37330 -#define SPELL_HEMORRHAGE 37331 -#define SPELL_FROSTSHOCK 37332 -#define SPELL_CURSE_OF_AGONY 37334 -#define SPELL_MORTAL_STRIKE 37335 -#define SPELL_FREEZING_TRAP 37368 -#define SPELL_HAMMER_OF_JUSTICE 37369 - -struct TRINITY_DLL_DECL mob_stolen_soulAI : public ScriptedAI -{ - mob_stolen_soulAI(Creature *c) : ScriptedAI(c) {} - - uint8 myClass; - uint32 Class_Timer; - - void Reset() - { - Class_Timer = 1000; - } - - void EnterCombat(Unit *who) - { } - - void SetMyClass(uint8 myclass) - { - myClass = myclass; - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (Class_Timer < diff) - { - switch (myClass) - { - case CLASS_WARRIOR: - DoCast(m_creature->getVictim(), SPELL_MORTAL_STRIKE); - Class_Timer = 6000; - break; - case CLASS_PALADIN: - DoCast(m_creature->getVictim(), SPELL_HAMMER_OF_JUSTICE); - Class_Timer = 6000; - break; - case CLASS_HUNTER: - DoCast(m_creature->getVictim(), SPELL_FREEZING_TRAP); - Class_Timer = 20000; - break; - case CLASS_ROGUE: - DoCast(m_creature->getVictim(), SPELL_HEMORRHAGE); - Class_Timer = 10000; - break; - case CLASS_PRIEST: - DoCast(m_creature->getVictim(), SPELL_MIND_FLAY); - Class_Timer = 5000; - break; - case CLASS_SHAMAN: - DoCast(m_creature->getVictim(), SPELL_FROSTSHOCK); - Class_Timer = 8000; - break; - case CLASS_MAGE: - DoCast(m_creature->getVictim(), SPELL_FIREBALL); - Class_Timer = 5000; - break; - case CLASS_WARLOCK: - DoCast(m_creature->getVictim(), SPELL_CURSE_OF_AGONY); - Class_Timer = 20000; - break; - case CLASS_DRUID: - DoCast(m_creature->getVictim(), SPELL_MOONFIRE); - Class_Timer = 10000; - break; - } - } else Class_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_mob_stolen_soul(Creature* pCreature) -{ - return new mob_stolen_soulAI (pCreature); -} - -#define SAY_INTRO -1558000 -#define SAY_SUMMON -1558001 - -#define SAY_AGGRO_1 -1558002 -#define SAY_AGGRO_2 -1558003 -#define SAY_AGGRO_3 -1558004 - -#define SAY_ROAR -1558005 -#define SAY_SOUL_CLEAVE -1558006 - -#define SAY_SLAY_1 -1558007 -#define SAY_SLAY_2 -1558008 - -#define SAY_DEATH -1558009 - -#define SPELL_RIBBON_OF_SOULS 32422 -#define SPELL_SOUL_SCREAM 32421 - -#define SPELL_STOLEN_SOUL 32346 -#define SPELL_STOLEN_SOUL_VISUAL 32395 - -#define SPELL_SUMMON_AVATAR 32424 - -#define ENTRY_STOLEN_SOUL 18441 - -struct TRINITY_DLL_DECL boss_exarch_maladaarAI : public ScriptedAI -{ - boss_exarch_maladaarAI(Creature *c) : ScriptedAI(c) - { - HasTaunted = false; - } - - uint32 soulmodel; - uint64 soulholder; - uint8 soulclass; - - uint32 Fear_timer; - uint32 Ribbon_of_Souls_timer; - uint32 StolenSoul_Timer; - - bool HasTaunted; - bool Avatar_summoned; - - void Reset() - { - soulmodel = 0; - soulholder = 0; - soulclass = 0; - - Fear_timer = 15000 + rand()% 5000; - Ribbon_of_Souls_timer = 5000; - StolenSoul_Timer = 25000 + rand()% 10000; - - Avatar_summoned = false; - } - - void MoveInLineOfSight(Unit *who) - { - if (!HasTaunted && m_creature->IsWithinDistInMap(who, 150.0)) - { - DoScriptText(SAY_INTRO, m_creature); - HasTaunted = true; - } - - ScriptedAI::MoveInLineOfSight(who); - } - - - void EnterCombat(Unit *who) - { - switch (rand()%3) - { - case 0: DoScriptText(SAY_AGGRO_1, m_creature); break; - case 1: DoScriptText(SAY_AGGRO_2, m_creature); break; - case 2: DoScriptText(SAY_AGGRO_3, m_creature); break; - } - } - - void JustSummoned(Creature *summoned) - { - if (summoned->GetEntry() == ENTRY_STOLEN_SOUL) - { - //SPELL_STOLEN_SOUL_VISUAL has shapeshift effect, but not implemented feature in Trinity for this spell. - summoned->CastSpell(summoned,SPELL_STOLEN_SOUL_VISUAL,false); - summoned->SetDisplayId(soulmodel); - summoned->setFaction(m_creature->getFaction()); - - if (Unit *target = Unit::GetUnit(*m_creature,soulholder)) - { - - CAST_AI(mob_stolen_soulAI, summoned->AI())->SetMyClass(soulclass); - summoned->AI()->AttackStart(target); - } - } - } - - void KilledUnit(Unit* victim) - { - if (rand()%2) - return; - - switch (rand()%2) - { - case 0: DoScriptText(SAY_SLAY_1, m_creature); break; - case 1: DoScriptText(SAY_SLAY_2, m_creature); break; - } - } - - void JustDied(Unit* Killer) - { - DoScriptText(SAY_DEATH, m_creature); - //When Exarch Maladar is defeated D'ore appear. - m_creature->SummonCreature(19412, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 600000); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (!Avatar_summoned && ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() < 25)) - { - if (m_creature->IsNonMeleeSpellCasted(false)) - m_creature->InterruptNonMeleeSpells(true); - - DoScriptText(SAY_SUMMON, m_creature); - - DoCast(m_creature, SPELL_SUMMON_AVATAR); - Avatar_summoned = true; - StolenSoul_Timer = 15000 + rand()% 15000; - } - - if (StolenSoul_Timer < diff) - { - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) - { - if (target->GetTypeId() == TYPEID_PLAYER) - { - if (m_creature->IsNonMeleeSpellCasted(false)) - m_creature->InterruptNonMeleeSpells(true); - - uint32 i = urand(1,2); - if (i == 1) - DoScriptText(SAY_ROAR, m_creature); - else - DoScriptText(SAY_SOUL_CLEAVE, m_creature); - - soulmodel = target->GetDisplayId(); - soulholder = target->GetGUID(); - soulclass = target->getClass(); - - DoCast(target,SPELL_STOLEN_SOUL); - m_creature->SummonCreature(ENTRY_STOLEN_SOUL, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000); - - StolenSoul_Timer = 20000 + rand()% 10000; - } else StolenSoul_Timer = 1000; - } - }else StolenSoul_Timer -= diff; - - if (Ribbon_of_Souls_timer < diff) - { - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target,SPELL_RIBBON_OF_SOULS); - - Ribbon_of_Souls_timer = 5000 + (rand()%20 * 1000); - }else Ribbon_of_Souls_timer -= diff; - - if (Fear_timer < diff) - { - DoCast(m_creature,SPELL_SOUL_SCREAM); - Fear_timer = 15000 + rand()% 15000; - }else Fear_timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_exarch_maladaar(Creature* pCreature) -{ - return new boss_exarch_maladaarAI (pCreature); -} - -#define SPELL_AV_MORTAL_STRIKE 16856 -#define SPELL_AV_SUNDER_ARMOR 16145 - -struct TRINITY_DLL_DECL mob_avatar_of_martyredAI : public ScriptedAI -{ - mob_avatar_of_martyredAI(Creature *c) : ScriptedAI(c) {} - - uint32 Mortal_Strike_timer; - - void Reset() - { - Mortal_Strike_timer = 10000; - } - - void EnterCombat(Unit *who) - { - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (Mortal_Strike_timer < diff) - { - DoCast(m_creature->getVictim(), SPELL_AV_MORTAL_STRIKE); - Mortal_Strike_timer = 10000 + rand()%20 * 1000; - } else Mortal_Strike_timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_mob_avatar_of_martyred(Creature* pCreature) -{ - return new mob_avatar_of_martyredAI (pCreature); -} - -void AddSC_boss_exarch_maladaar() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_exarch_maladaar"; - newscript->GetAI = &GetAI_boss_exarch_maladaar; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_avatar_of_martyred"; - newscript->GetAI = &GetAI_mob_avatar_of_martyred; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_stolen_soul"; - newscript->GetAI = &GetAI_mob_stolen_soul; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/outland/aunchindoun/auchenai_crypts/boss_shirrak_the_dead_watcher.cpp b/src/bindings/scripts/scripts/outland/aunchindoun/auchenai_crypts/boss_shirrak_the_dead_watcher.cpp deleted file mode 100644 index 4dfdd407731..00000000000 --- a/src/bindings/scripts/scripts/outland/aunchindoun/auchenai_crypts/boss_shirrak_the_dead_watcher.cpp +++ /dev/null @@ -1,212 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -Name: Boss_Shirrak_the_dead_watcher -%Complete: 80 -Comment: InhibitMagic should stack slower far from the boss, proper Visual for Focus Fire, heroic implemented -Category: Auchindoun, Auchenai Crypts -EndScriptData */ - -#include "precompiled.h" - -#define SPELL_INHIBITMAGIC 32264 -#define SPELL_ATTRACTMAGIC 32265 -#define N_SPELL_CARNIVOROUSBITE 36383 -#define H_SPELL_CARNIVOROUSBITE 39382 -#define SPELL_CARNIVOROUSBITE (HeroicMode?H_SPELL_CARNIVOROUSBITE:N_SPELL_CARNIVOROUSBITE) - -#define ENTRY_FOCUS_FIRE 18374 - -#define N_SPELL_FIERY_BLAST 32302 -#define H_SPELL_FIERY_BLAST 38382 -#define SPELL_FIERY_BLAST (HeroicMode?H_SPELL_FIERY_BLAST:N_SPELL_FIERY_BLAST) -#define SPELL_FOCUS_FIRE_VISUAL 42075 //need to find better visual - -struct TRINITY_DLL_DECL boss_shirrak_the_dead_watcherAI : public ScriptedAI -{ - boss_shirrak_the_dead_watcherAI(Creature *c) : ScriptedAI(c) - { - HeroicMode = m_creature->GetMap()->IsHeroic(); - } - - uint32 Inhibitmagic_Timer; - uint32 Attractmagic_Timer; - uint32 Carnivorousbite_Timer; - uint32 FocusFire_Timer; - bool HeroicMode; - Unit *focusedTarget; - - void Reset() - { - Inhibitmagic_Timer = 0; - Attractmagic_Timer = 28000; - Carnivorousbite_Timer = 10000; - FocusFire_Timer = 17000; - focusedTarget = NULL; - } - - void EnterCombat(Unit *who) - { } - - void JustSummoned(Creature *summoned) - { - if (summoned && summoned->GetEntry() == ENTRY_FOCUS_FIRE) - { - summoned->CastSpell(summoned,SPELL_FOCUS_FIRE_VISUAL,false); - summoned->setFaction(m_creature->getFaction()); - summoned->SetLevel(m_creature->getLevel()); - summoned->addUnitState(UNIT_STAT_ROOT); - - if (focusedTarget) - summoned->AI()->AttackStart(focusedTarget); - } - } - - void UpdateAI(const uint32 diff) - { - //Inhibitmagic_Timer - if (Inhibitmagic_Timer < diff) - { - float dist; - Map* pMap = m_creature->GetMap(); - Map::PlayerList const &PlayerList = pMap->GetPlayers(); - for(Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) - if (Player* i_pl = i->getSource()) - if (i_pl->isAlive() && (dist = i_pl->IsWithinDist(m_creature, 45))) - { - i_pl->RemoveAurasDueToSpell(SPELL_INHIBITMAGIC); - m_creature->AddAura(SPELL_INHIBITMAGIC, i_pl); - if (dist < 35) - m_creature->AddAura(SPELL_INHIBITMAGIC, i_pl); - if (dist < 25) - m_creature->AddAura(SPELL_INHIBITMAGIC, i_pl); - if (dist < 15) - m_creature->AddAura(SPELL_INHIBITMAGIC, i_pl); - } - Inhibitmagic_Timer = 3000+(rand()%1000); - }else Inhibitmagic_Timer -= diff; - - //Return since we have no target - if (!UpdateVictim()) - return; - - //Attractmagic_Timer - if (Attractmagic_Timer < diff) - { - DoCast(m_creature,SPELL_ATTRACTMAGIC); - Attractmagic_Timer = 30000; - Carnivorousbite_Timer = 1500; - }else Attractmagic_Timer -= diff; - - //Carnivorousbite_Timer - if (Carnivorousbite_Timer < diff) - { - DoCast(m_creature,SPELL_CARNIVOROUSBITE); - Carnivorousbite_Timer = 10000; - }else Carnivorousbite_Timer -= diff; - - //FocusFire_Timer - if (FocusFire_Timer < diff) - { - // Summon Focus Fire & Emote - Unit *target = SelectUnit(SELECT_TARGET_RANDOM,1); - if (target && target->GetTypeId() == TYPEID_PLAYER && target->isAlive()) - { - focusedTarget = target; - m_creature->SummonCreature(ENTRY_FOCUS_FIRE,target->GetPositionX(),target->GetPositionY(),target->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN,5500); - - // TODO: Find better way to handle emote - // Emote - std::string *emote = new std::string("focuses on "); - emote->append(target->GetName()); - emote->append("!"); - const char* text = emote->c_str(); - m_creature->MonsterTextEmote(text, 0, true); - delete emote; - } - FocusFire_Timer = 15000+(rand()%5000); - }else FocusFire_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_shirrak_the_dead_watcher(Creature* pCreature) -{ - return new boss_shirrak_the_dead_watcherAI (pCreature); -} - -struct TRINITY_DLL_DECL mob_focus_fireAI : public ScriptedAI -{ - mob_focus_fireAI(Creature *c) : ScriptedAI(c) - { - HeroicMode = m_creature->GetMap()->IsHeroic(); - } - - bool HeroicMode; - uint32 FieryBlast_Timer; - bool fiery1, fiery2; - - void Reset() - { - FieryBlast_Timer = 3000+(rand()%1000); - fiery1 = fiery2 = true; - } - - void EnterCombat(Unit *who) - { } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - //FieryBlast_Timer - if (fiery2 && FieryBlast_Timer < diff) - { - DoCast(m_creature,SPELL_FIERY_BLAST); - - if (fiery1) fiery1 = false; - else if (fiery2) fiery2 = false; - - FieryBlast_Timer = 1000; - }else FieryBlast_Timer -= diff; - - //DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_mob_focus_fire(Creature* pCreature) -{ - return new mob_focus_fireAI (pCreature); -} - -void AddSC_boss_shirrak_the_dead_watcher() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_shirrak_the_dead_watcher"; - newscript->GetAI = &GetAI_boss_shirrak_the_dead_watcher; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_focus_fire"; - newscript->GetAI = &GetAI_mob_focus_fire; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/outland/aunchindoun/mana_tombs/boss_nexusprince_shaffar.cpp b/src/bindings/scripts/scripts/outland/aunchindoun/mana_tombs/boss_nexusprince_shaffar.cpp deleted file mode 100644 index dcaaefee8c2..00000000000 --- a/src/bindings/scripts/scripts/outland/aunchindoun/mana_tombs/boss_nexusprince_shaffar.cpp +++ /dev/null @@ -1,369 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_NexusPrince_Shaffar -SD%Complete: 80 -SDComment: Need more tuning of spell timers, it should not be as linear fight as current. Also should possibly find a better way to deal with his three initial beacons to make sure all aggro. -SDCategory: Auchindoun, Mana Tombs -EndScriptData */ - -/* ContentData -boss_nexusprince_shaffar -mob_ethereal_beacon -EndContentData */ - -#include "precompiled.h" - -enum -{ - SAY_INTRO = -1557000, - SAY_AGGRO_1 = -1557001, - SAY_AGGRO_2 = -1557002, - SAY_AGGRO_3 = -1557003, - SAY_SLAY_1 = -1557004, - SAY_SLAY_2 = -1557005, - SAY_SUMMON = -1557006, - SAY_DEAD = -1557007, - - SPELL_BLINK = 34605, - SPELL_FROSTBOLT = 32364, - SPELL_FIREBALL = 32363, - SPELL_FROSTNOVA = 32365, - - SPELL_ETHEREAL_BEACON = 32371, // Summons NPC_BEACON - SPELL_ETHEREAL_BEACON_VISUAL = 32368, - - NPC_BEACON = 18431, - NPC_SHAFFAR = 18344, - - NR_INITIAL_BEACONS = 3 -}; - -struct TRINITY_DLL_DECL boss_nexusprince_shaffarAI : public ScriptedAI -{ - boss_nexusprince_shaffarAI(Creature *c) : ScriptedAI(c), summons(me) { HasTaunted = false; } - - uint32 Blink_Timer; - uint32 Beacon_Timer; - uint32 FireBall_Timer; - uint32 Frostbolt_Timer; - uint32 FrostNova_Timer; - - SummonList summons; - - bool HasTaunted; - bool CanBlink; - - void Reset() - { - Blink_Timer = 1500; - Beacon_Timer = 10000; - FireBall_Timer = 8000; - Frostbolt_Timer = 4000; - FrostNova_Timer = 15000; - - CanBlink = false; - - float dist = 8.0f; - float posX, posY, posZ, angle; - m_creature->GetHomePosition(posX, posY, posZ, angle); - - m_creature->SummonCreature(NPC_BEACON, posX - dist, posY - dist, posZ, angle, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 7200000); - m_creature->SummonCreature(NPC_BEACON, posX - dist, posY + dist, posZ, angle, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 7200000); - m_creature->SummonCreature(NPC_BEACON, posX + dist, posY, posZ, angle, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 7200000); - } - - void EnterEvadeMode() - { - summons.DespawnAll(); - ScriptedAI::EnterEvadeMode(); - } - - void MoveInLineOfSight(Unit *who) - { - if (!HasTaunted && who->GetTypeId() == TYPEID_PLAYER && m_creature->IsWithinDistInMap(who, 100.0f)) - { - DoScriptText(SAY_INTRO, m_creature); - HasTaunted = true; - } - } - - void EnterCombat(Unit *who) - { - switch(rand()%3) - { - case 0: DoScriptText(SAY_AGGRO_1, m_creature); break; - case 1: DoScriptText(SAY_AGGRO_2, m_creature); break; - case 2: DoScriptText(SAY_AGGRO_3, m_creature); break; - } - - DoZoneInCombat(); - summons.DoZoneInCombat(); - } - - void JustSummoned(Creature *summoned) - { - if (summoned->GetEntry() == NPC_BEACON) - { - summoned->CastSpell(summoned,SPELL_ETHEREAL_BEACON_VISUAL,false); - - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) - summoned->AI()->AttackStart(target); - } - - summons.Summon(summoned); - } - - void SummonedCreatureDespawn(Creature *summon) - { - summons.Despawn(summon); - } - - void KilledUnit(Unit* victim) - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_SLAY_1, m_creature); break; - case 1: DoScriptText(SAY_SLAY_2, m_creature); break; - } - } - - void JustDied(Unit* Killer) - { - DoScriptText(SAY_DEAD, m_creature); - summons.DespawnAll(); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (FrostNova_Timer < diff) - { - if (m_creature->IsNonMeleeSpellCasted(false)) - m_creature->InterruptNonMeleeSpells(true); - - DoCast(m_creature,SPELL_FROSTNOVA); - FrostNova_Timer = 17500 + rand()%7500; - CanBlink = true; - }else FrostNova_Timer -= diff; - - if (Frostbolt_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_FROSTBOLT); - Frostbolt_Timer = 4500 + rand()%1500; - }else Frostbolt_Timer -= diff; - - if (FireBall_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_FIREBALL); - FireBall_Timer = 4500 + rand()%1500; - }else FireBall_Timer -= diff; - - if (CanBlink) - { - if (Blink_Timer < diff) - { - if (m_creature->IsNonMeleeSpellCasted(false)) - m_creature->InterruptNonMeleeSpells(true); - - //expire movement, will prevent from running right back to victim after cast - //(but should MoveChase be used again at a certain time or should he not move?) - if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == TARGETED_MOTION_TYPE) - m_creature->GetMotionMaster()->MovementExpired(); - - DoCast(m_creature,SPELL_BLINK); - Blink_Timer = 1000 + rand()%1500; - CanBlink = false; - }else Blink_Timer -= diff; - } - - if (Beacon_Timer < diff) - { - if (m_creature->IsNonMeleeSpellCasted(false)) - m_creature->InterruptNonMeleeSpells(true); - - if (!urand(0,3)) - DoScriptText(SAY_SUMMON, m_creature); - - DoCast(m_creature,SPELL_ETHEREAL_BEACON, true); - - Beacon_Timer = 10000; - }else Beacon_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_nexusprince_shaffar(Creature* pCreature) -{ - return new boss_nexusprince_shaffarAI (pCreature); -} - -enum -{ - SPELL_ARCANE_BOLT = 15254, - SPELL_ETHEREAL_APPRENTICE = 32372 // Summon 18430 -}; - -struct TRINITY_DLL_DECL mob_ethereal_beaconAI : public ScriptedAI -{ - mob_ethereal_beaconAI(Creature *c) : ScriptedAI(c) - { - HeroicMode = m_creature->GetMap()->IsHeroic(); - } - - bool HeroicMode; - uint32 Apprentice_Timer; - uint32 ArcaneBolt_Timer; - uint32 Check_Timer; - - void KillSelf() - { - m_creature->Kill(m_creature); - } - - void Reset() - { - Apprentice_Timer = (HeroicMode ? 10000 : 20000); - ArcaneBolt_Timer = 1000; - Check_Timer = 1000; - } - - void EnterCombat(Unit *who) - { - // Send Shaffar to fight - Creature* Shaffar = me->FindNearestCreature(NPC_SHAFFAR, 100); - if (!Shaffar || Shaffar->isDead()) - { - KillSelf(); - return; - } - if (!Shaffar->isInCombat()) - Shaffar->AI()->AttackStart(who); - } - - void JustSummoned(Creature *summoned) - { - summoned->AI()->AttackStart(m_creature->getVictim()); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (Check_Timer < diff) - { - Creature *Shaffar = me->FindNearestCreature(NPC_SHAFFAR, 100); - if (!Shaffar || Shaffar->isDead() || !Shaffar->isInCombat()) - { - KillSelf(); - return; - } - Check_Timer = 1000; - }else Check_Timer -= diff; - - if (ArcaneBolt_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_ARCANE_BOLT); - ArcaneBolt_Timer = 2000 + rand()%2500; - }else ArcaneBolt_Timer -= diff; - - if (Apprentice_Timer < diff) - { - if (m_creature->IsNonMeleeSpellCasted(false)) - m_creature->InterruptNonMeleeSpells(true); - - m_creature->CastSpell(m_creature,SPELL_ETHEREAL_APPRENTICE,true); - m_creature->ForcedDespawn(); - return; - }else Apprentice_Timer -= diff; - } -}; - -CreatureAI* GetAI_mob_ethereal_beacon(Creature* pCreature) -{ - return new mob_ethereal_beaconAI (pCreature); -} - -enum -{ - SPELL_ETHEREAL_APPRENTICE_FIREBOLT = 32369, - SPELL_ETHEREAL_APPRENTICE_FROSTBOLT = 32370 -}; - -struct TRINITY_DLL_DECL mob_ethereal_apprenticeAI : public ScriptedAI -{ - mob_ethereal_apprenticeAI(Creature *c) : ScriptedAI(c) {} - - uint32 Cast_Timer; - - bool isFireboltTurn; - - void Reset() - { - Cast_Timer = 3000; - isFireboltTurn = true; - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (Cast_Timer < diff) - { - if (isFireboltTurn) - { - m_creature->CastSpell(m_creature->getVictim(), SPELL_ETHEREAL_APPRENTICE_FIREBOLT, true); - isFireboltTurn = false; - }else{ - m_creature->CastSpell(m_creature->getVictim(), SPELL_ETHEREAL_APPRENTICE_FROSTBOLT, true); - isFireboltTurn = true; - } - Cast_Timer = 3000; - }else Cast_Timer -= diff; - } -}; - -CreatureAI* GetAI_mob_ethereal_apprentice(Creature* pCreature) -{ - return new mob_ethereal_apprenticeAI (pCreature); -} - -void AddSC_boss_nexusprince_shaffar() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_nexusprince_shaffar"; - newscript->GetAI = &GetAI_boss_nexusprince_shaffar; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_ethereal_beacon"; - newscript->GetAI = &GetAI_mob_ethereal_beacon; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_ethereal_apprentice"; - newscript->GetAI = &GetAI_mob_ethereal_apprentice; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/outland/aunchindoun/mana_tombs/boss_pandemonius.cpp b/src/bindings/scripts/scripts/outland/aunchindoun/mana_tombs/boss_pandemonius.cpp deleted file mode 100644 index 77e1c535340..00000000000 --- a/src/bindings/scripts/scripts/outland/aunchindoun/mana_tombs/boss_pandemonius.cpp +++ /dev/null @@ -1,138 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Pandemonius -SD%Complete: 75 -SDComment: Not known how void blast is done (amount of rapid cast seems to be related to players in party). All mobs remaining in surrounding area should aggro when engaged. -SDCategory: Auchindoun, Mana Tombs -EndScriptData */ - -#include "precompiled.h" - -#define SAY_AGGRO_1 -1557008 -#define SAY_AGGRO_2 -1557009 -#define SAY_AGGRO_3 -1557010 - -#define SAY_KILL_1 -1557011 -#define SAY_KILL_2 -1557012 - -#define SAY_DEATH -1557013 - -#define EMOTE_DARK_SHELL -1557014 - -#define SPELL_VOID_BLAST 32325 -#define H_SPELL_VOID_BLAST 38760 -#define SPELL_DARK_SHELL 32358 -#define H_SPELL_DARK_SHELL 38759 - -struct TRINITY_DLL_DECL boss_pandemoniusAI : public ScriptedAI -{ - boss_pandemoniusAI(Creature *c) : ScriptedAI(c) - { - HeroicMode = m_creature->GetMap()->IsHeroic(); - } - - bool HeroicMode; - uint32 VoidBlast_Timer; - uint32 DarkShell_Timer; - uint32 VoidBlast_Counter; - - void Reset() - { - VoidBlast_Timer = 8000+rand()%15000; - DarkShell_Timer = 20000; - VoidBlast_Counter = 0; - } - - void JustDied(Unit* Killer) - { - DoScriptText(SAY_DEATH, m_creature); - } - - void KilledUnit(Unit* victim) - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_KILL_1, m_creature); break; - case 1: DoScriptText(SAY_KILL_2, m_creature); break; - } - } - - void EnterCombat(Unit *who) - { - switch(rand()%3) - { - case 0: DoScriptText(SAY_AGGRO_1, m_creature); break; - case 1: DoScriptText(SAY_AGGRO_2, m_creature); break; - case 2: DoScriptText(SAY_AGGRO_3, m_creature); break; - } - - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (VoidBlast_Timer < diff) - { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - { - DoCast(target,HeroicMode ? H_SPELL_VOID_BLAST : SPELL_VOID_BLAST); - VoidBlast_Timer = 500; - ++VoidBlast_Counter; - } - - if (VoidBlast_Counter == 5) - { - VoidBlast_Timer = 15000+rand()%10000; - VoidBlast_Counter = 0; - } - }else VoidBlast_Timer -= diff; - - if (!VoidBlast_Counter) - { - if (DarkShell_Timer < diff) - { - if (m_creature->IsNonMeleeSpellCasted(false)) - m_creature->InterruptNonMeleeSpells(true); - - DoScriptText(EMOTE_DARK_SHELL, m_creature); - - DoCast(m_creature,HeroicMode ? H_SPELL_DARK_SHELL : SPELL_DARK_SHELL); - DarkShell_Timer = 20000; - }else DarkShell_Timer -= diff; - } - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_pandemonius(Creature* pCreature) -{ - return new boss_pandemoniusAI (pCreature); -} - -void AddSC_boss_pandemonius() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_pandemonius"; - newscript->GetAI = &GetAI_boss_pandemonius; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/outland/aunchindoun/sethekk_halls/boss_darkweaver_syth.cpp b/src/bindings/scripts/scripts/outland/aunchindoun/sethekk_halls/boss_darkweaver_syth.cpp deleted file mode 100644 index 00e43fa257d..00000000000 --- a/src/bindings/scripts/scripts/outland/aunchindoun/sethekk_halls/boss_darkweaver_syth.cpp +++ /dev/null @@ -1,438 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Darkweaver_Syth -SD%Complete: 85 -SDComment: Shock spells/times need more work. Heroic partly implemented. -SDCategory: Auchindoun, Sethekk Halls -EndScriptData */ - -#include "precompiled.h" - -#define SAY_SUMMON -1556000 - -#define SAY_AGGRO_1 -1556001 -#define SAY_AGGRO_2 -1556002 -#define SAY_AGGRO_3 -1556003 - -#define SAY_SLAY_1 -1556004 -#define SAY_SLAY_2 -1556005 - -#define SAY_DEATH -1556006 - -#define SPELL_FROST_SHOCK 21401 //37865 -#define SPELL_FLAME_SHOCK 34354 -#define SPELL_SHADOW_SHOCK 30138 -#define SPELL_ARCANE_SHOCK 37132 - -#define SPELL_CHAIN_LIGHTNING 15659 //15305 - -#define SPELL_SUMMON_SYTH_FIRE 33537 // Spawns 19203 -#define SPELL_SUMMON_SYTH_ARCANE 33538 // Spawns 19205 -#define SPELL_SUMMON_SYTH_FROST 33539 // Spawns 19204 -#define SPELL_SUMMON_SYTH_SHADOW 33540 // Spawns 19206 - -#define SPELL_FLAME_BUFFET (HeroicMode?38141:33526) -#define SPELL_ARCANE_BUFFET (HeroicMode?38138:33527) -#define SPELL_FROST_BUFFET (HeroicMode?38142:33528) -#define SPELL_SHADOW_BUFFET (HeroicMode?38143:33529) - -struct TRINITY_DLL_DECL boss_darkweaver_sythAI : public ScriptedAI -{ - boss_darkweaver_sythAI(Creature *c) : ScriptedAI(c) - - { - HeroicMode = m_creature->GetMap()->IsHeroic(); - } - - uint32 flameshock_timer; - uint32 arcaneshock_timer; - uint32 frostshock_timer; - uint32 shadowshock_timer; - uint32 chainlightning_timer; - - bool summon90; - bool summon50; - bool summon10; - bool HeroicMode; - - void Reset() - { - flameshock_timer = 2000; - arcaneshock_timer = 4000; - frostshock_timer = 6000; - shadowshock_timer = 8000; - chainlightning_timer = 15000; - - summon90 = false; - summon50 = false; - summon10 = false; - } - - void EnterCombat(Unit *who) - { - switch(rand()%3) - { - case 0: DoScriptText(SAY_AGGRO_1, m_creature); break; - case 1: DoScriptText(SAY_AGGRO_2, m_creature); break; - case 2: DoScriptText(SAY_AGGRO_3, m_creature); break; - } - } - - void JustDied(Unit* Killer) - { - DoScriptText(SAY_DEATH, m_creature); - } - - void KilledUnit(Unit* victim) - { - if (rand()%2) - return; - - switch(rand()%2) - { - case 0: DoScriptText(SAY_SLAY_1, m_creature); break; - case 1: DoScriptText(SAY_SLAY_2, m_creature); break; - } - } - - void JustSummoned(Creature *summoned) - { - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) - summoned->AI()->AttackStart(target); - } - - void SythSummoning() - { - DoScriptText(SAY_SUMMON, m_creature); - - if (m_creature->IsNonMeleeSpellCasted(false)) - m_creature->InterruptNonMeleeSpells(false); - - DoCast(m_creature,SPELL_SUMMON_SYTH_ARCANE,true); //front - DoCast(m_creature,SPELL_SUMMON_SYTH_FIRE,true); //back - DoCast(m_creature,SPELL_SUMMON_SYTH_FROST,true); //left - DoCast(m_creature,SPELL_SUMMON_SYTH_SHADOW,true); //right - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() < 90) && !summon90) - { - SythSummoning(); - summon90 = true; - } - - if (((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() < 50) && !summon50) - { - SythSummoning(); - summon50 = true; - } - - if (((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() < 10) && !summon10) - { - SythSummoning(); - summon10 = true; - } - - if (flameshock_timer < diff) - { - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target,SPELL_FLAME_SHOCK); - - flameshock_timer = 10000 + rand()%5000; - } else flameshock_timer -= diff; - - if (arcaneshock_timer < diff) - { - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target,SPELL_ARCANE_SHOCK); - - arcaneshock_timer = 10000 + rand()%5000; - } else arcaneshock_timer -= diff; - - if (frostshock_timer < diff) - { - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target,SPELL_FROST_SHOCK); - - frostshock_timer = 10000 + rand()%5000; - } else frostshock_timer -= diff; - - if (shadowshock_timer < diff) - { - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target,SPELL_SHADOW_SHOCK); - - shadowshock_timer = 10000 + rand()%5000; - } else shadowshock_timer -= diff; - - if (chainlightning_timer < diff) - { - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target,SPELL_CHAIN_LIGHTNING); - - chainlightning_timer = 25000; - } else chainlightning_timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_darkweaver_syth(Creature* pCreature) -{ - return new boss_darkweaver_sythAI (pCreature); -} - -/* ELEMENTALS */ - -struct TRINITY_DLL_DECL mob_syth_fireAI : public ScriptedAI -{ - mob_syth_fireAI(Creature *c) : ScriptedAI(c) - - { - HeroicMode = m_creature->GetMap()->IsHeroic(); - } - - uint32 flameshock_timer; - uint32 flamebuffet_timer; - bool HeroicMode; - - void Reset() - { - m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, true); - flameshock_timer = 2500; - flamebuffet_timer = 5000; - } - - void EnterCombat(Unit *who) { } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (flameshock_timer < diff) - { - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target,SPELL_FLAME_SHOCK); - - flameshock_timer = 5000; - }else flameshock_timer -= diff; - - if (flamebuffet_timer < diff) - { - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target,SPELL_FLAME_BUFFET); - - flamebuffet_timer = 5000; - }else flamebuffet_timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_mob_syth_fire(Creature* pCreature) -{ - return new mob_syth_fireAI (pCreature); -} - -struct TRINITY_DLL_DECL mob_syth_arcaneAI : public ScriptedAI -{ - mob_syth_arcaneAI(Creature *c) : ScriptedAI(c) - - { - HeroicMode = m_creature->GetMap()->IsHeroic(); - } - - uint32 arcaneshock_timer; - uint32 arcanebuffet_timer; - bool HeroicMode; - - void Reset() - { - m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_ARCANE, true); - arcaneshock_timer = 2500; - arcanebuffet_timer = 5000; - } - - void EnterCombat(Unit *who) { } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (arcaneshock_timer < diff) - { - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target,SPELL_ARCANE_SHOCK); - - arcaneshock_timer = 5000; - }else arcaneshock_timer -= diff; - - if (arcanebuffet_timer < diff) - { - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target,SPELL_ARCANE_BUFFET); - - arcanebuffet_timer = 5000; - }else arcanebuffet_timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_mob_syth_arcane(Creature* pCreature) -{ - return new mob_syth_arcaneAI (pCreature); -} - -struct TRINITY_DLL_DECL mob_syth_frostAI : public ScriptedAI -{ - mob_syth_frostAI(Creature *c) : ScriptedAI(c) - - { - HeroicMode = m_creature->GetMap()->IsHeroic(); - } - - uint32 frostshock_timer; - uint32 frostbuffet_timer; - bool HeroicMode; - - void Reset() - { - m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, true); - frostshock_timer = 2500; - frostbuffet_timer = 5000; - } - - void EnterCombat(Unit *who) { } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (frostshock_timer < diff) - { - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target,SPELL_FROST_SHOCK); - - frostshock_timer = 5000; - }else frostshock_timer -= diff; - - if (frostbuffet_timer < diff) - { - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target,SPELL_FROST_BUFFET); - - frostbuffet_timer = 5000; - }else frostbuffet_timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_mob_syth_frost(Creature* pCreature) -{ - return new mob_syth_frostAI (pCreature); -} - -struct TRINITY_DLL_DECL mob_syth_shadowAI : public ScriptedAI -{ - mob_syth_shadowAI(Creature *c) : ScriptedAI(c) - - { - HeroicMode = m_creature->GetMap()->IsHeroic(); - } - - uint32 shadowshock_timer; - uint32 shadowbuffet_timer; - bool HeroicMode; - - void Reset() - { - m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_SHADOW, true); - shadowshock_timer = 2500; - shadowbuffet_timer = 5000; - } - - void EnterCombat(Unit *who) { } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (shadowshock_timer < diff) - { - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target,SPELL_SHADOW_SHOCK); - - shadowshock_timer = 5000; - }else shadowshock_timer -= diff; - - if (shadowbuffet_timer < diff) - { - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target,SPELL_SHADOW_BUFFET); - - shadowbuffet_timer = 5000; - }else shadowbuffet_timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_mob_syth_shadow(Creature* pCreature) -{ - return new mob_syth_shadowAI (pCreature); -} - -void AddSC_boss_darkweaver_syth() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_darkweaver_syth"; - newscript->GetAI = &GetAI_boss_darkweaver_syth; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_syth_fire"; - newscript->GetAI = &GetAI_mob_syth_arcane; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_syth_arcane"; - newscript->GetAI = &GetAI_mob_syth_arcane; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_syth_frost"; - newscript->GetAI = &GetAI_mob_syth_frost; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_syth_shadow"; - newscript->GetAI = &GetAI_mob_syth_shadow; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/outland/aunchindoun/sethekk_halls/boss_tailonking_ikiss.cpp b/src/bindings/scripts/scripts/outland/aunchindoun/sethekk_halls/boss_tailonking_ikiss.cpp deleted file mode 100644 index 7830fc10645..00000000000 --- a/src/bindings/scripts/scripts/outland/aunchindoun/sethekk_halls/boss_tailonking_ikiss.cpp +++ /dev/null @@ -1,221 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Talon_King_Ikiss -SD%Complete: 80 -SDComment: Heroic supported. Some details missing, but most are spell related. -SDCategory: Auchindoun, Sethekk Halls -EndScriptData */ - -#include "precompiled.h" -#include "def_sethekk_halls.h" - -#define SAY_INTRO -1556007 - -#define SAY_AGGRO_1 -1556008 -#define SAY_AGGRO_2 -1556009 -#define SAY_AGGRO_3 -1556010 - -#define SAY_SLAY_1 -1556011 -#define SAY_SLAY_2 -1556012 -#define SAY_DEATH -1556013 -#define EMOTE_ARCANE_EXP -1556015 - -#define SPELL_BLINK 38194 -#define SPELL_BLINK_TELEPORT 38203 -#define SPELL_MANA_SHIELD 38151 -#define SPELL_ARCANE_BUBBLE 9438 -#define H_SPELL_SLOW 35032 - -#define SPELL_POLYMORPH 38245 -#define H_SPELL_POLYMORPH 43309 - -#define SPELL_ARCANE_VOLLEY 35059 -#define H_SPELL_ARCANE_VOLLEY 40424 - -#define SPELL_ARCANE_EXPLOSION 38197 -#define H_SPELL_ARCANE_EXPLOSION 40425 - -struct TRINITY_DLL_DECL boss_talon_king_ikissAI : public ScriptedAI -{ - boss_talon_king_ikissAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance* pInstance; - - bool HeroicMode; - - uint32 ArcaneVolley_Timer; - uint32 Sheep_Timer; - uint32 Blink_Timer; - uint32 Slow_Timer; - - bool ManaShield; - bool Blink; - bool Intro; - - void Reset() - { - HeroicMode = m_creature->GetMap()->IsHeroic(); - - ArcaneVolley_Timer = 5000; - Sheep_Timer = 8000; - Blink_Timer = 35000; - Slow_Timer = 15000+rand()%15000; - Blink = false; - Intro = false; - ManaShield = false; - } - - void MoveInLineOfSight(Unit *who) - { - if (!m_creature->getVictim() && who->isTargetableForAttack() && (m_creature->IsHostileTo(who)) && who->isInAccessiblePlaceFor(m_creature)) - { - if (!Intro && m_creature->IsWithinDistInMap(who, 100)) - { - Intro = true; - DoScriptText(SAY_INTRO, m_creature); - } - - if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE) - return; - - float attackRadius = m_creature->GetAttackDistance(who); - if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who)) - { - //who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH); - AttackStart(who); - } - } - } - - void EnterCombat(Unit *who) - { - switch(rand()%3) - { - case 0: DoScriptText(SAY_AGGRO_1, m_creature); break; - case 1: DoScriptText(SAY_AGGRO_2, m_creature); break; - case 2: DoScriptText(SAY_AGGRO_3, m_creature); break; - } - } - - void JustDied(Unit* Killer) - { - DoScriptText(SAY_DEATH, m_creature); - - if (pInstance) - pInstance->SetData(DATA_IKISSDOOREVENT, DONE); - } - - void KilledUnit(Unit* victim) - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_SLAY_1, m_creature); break; - case 1: DoScriptText(SAY_SLAY_2, m_creature); break; - } - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (Blink) - { - DoCast(m_creature,HeroicMode ? H_SPELL_ARCANE_EXPLOSION : SPELL_ARCANE_EXPLOSION); - m_creature->CastSpell(m_creature,SPELL_ARCANE_BUBBLE,true); - Blink = false; - } - - if (ArcaneVolley_Timer < diff) - { - DoCast(m_creature,HeroicMode ? H_SPELL_ARCANE_VOLLEY : SPELL_ARCANE_VOLLEY); - ArcaneVolley_Timer = 7000+rand()%5000; - }else ArcaneVolley_Timer -= diff; - - if (Sheep_Timer < diff) - { - //second top aggro target in normal, random target in heroic correct? - Unit *target = NULL; - target = HeroicMode ? SelectUnit(SELECT_TARGET_RANDOM,0) : SelectUnit(SELECT_TARGET_TOPAGGRO,1); - if (target) - DoCast(target,HeroicMode ? H_SPELL_POLYMORPH : SPELL_POLYMORPH); - Sheep_Timer = 15000+rand()%2500; - }else Sheep_Timer -= diff; - - //may not be correct time to cast - if (!ManaShield && ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() < 20)) - { - DoCast(m_creature,SPELL_MANA_SHIELD); - ManaShield = true; - } - - if (HeroicMode) - { - if (Slow_Timer < diff) - { - DoCast(m_creature,H_SPELL_SLOW); - Slow_Timer = 15000+rand()%25000; - }else Slow_Timer -= diff; - } - - if (Blink_Timer < diff) - { - DoScriptText(EMOTE_ARCANE_EXP, m_creature); - - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) - { - if (m_creature->IsNonMeleeSpellCasted(false)) - m_creature->InterruptNonMeleeSpells(false); - - //Spell doesn't work, but we use for visual effect at least - DoCast(target,SPELL_BLINK); - - float X = target->GetPositionX(); - float Y = target->GetPositionY(); - float Z = target->GetPositionZ(); - - DoTeleportTo(X,Y,Z); - - DoCast(target,SPELL_BLINK_TELEPORT); - Blink = true; - } - Blink_Timer = 35000+rand()%5000; - }else Blink_Timer -= diff; - - if (!Blink) - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_talon_king_ikiss(Creature* pCreature) -{ - return new boss_talon_king_ikissAI (pCreature); -} - -void AddSC_boss_talon_king_ikiss() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_talon_king_ikiss"; - newscript->GetAI = &GetAI_boss_talon_king_ikiss; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/outland/aunchindoun/sethekk_halls/def_sethekk_halls.h b/src/bindings/scripts/scripts/outland/aunchindoun/sethekk_halls/def_sethekk_halls.h deleted file mode 100644 index 6156f354d84..00000000000 --- a/src/bindings/scripts/scripts/outland/aunchindoun/sethekk_halls/def_sethekk_halls.h +++ /dev/null @@ -1,14 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software licensed under GPL version 2 - * Please see the included DOCS/LICENSE.TXT for more information */ - -#ifndef DEF_SETHEKK_HALLS_H -#define DEF_SETHEKK_HALLS_H - -enum -{ - DATA_IKISSDOOREVENT = 1, - TYPE_ANZU_ENCOUNTER = 2, -}; -#endif - diff --git a/src/bindings/scripts/scripts/outland/aunchindoun/sethekk_halls/instance_sethekk_halls.cpp b/src/bindings/scripts/scripts/outland/aunchindoun/sethekk_halls/instance_sethekk_halls.cpp deleted file mode 100644 index 060e09a1325..00000000000 --- a/src/bindings/scripts/scripts/outland/aunchindoun/sethekk_halls/instance_sethekk_halls.cpp +++ /dev/null @@ -1,91 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Instance - Sethekk Halls -SD%Complete: 50 -SDComment: Instance Data for Sethekk Halls instance -SDCategory: Auchindoun, Sethekk Halls -EndScriptData */ - -#include "precompiled.h" -#include "def_sethekk_halls.h" - -enum -{ - NPC_ANZU = 23035, - IKISS_DOOR = 177203, -}; - -struct TRINITY_DLL_DECL instance_sethekk_halls : public ScriptedInstance -{ - instance_sethekk_halls(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; - - uint32 AnzuEncounter; - uint64 m_uiIkissDoorGUID; - - void Initialize() - { - AnzuEncounter = NOT_STARTED; - m_uiIkissDoorGUID = 0; - } - - void OnCreatureCreate(Creature* pCreature, bool add) - { - if (pCreature->GetEntry() == NPC_ANZU && AnzuEncounter >= IN_PROGRESS) - { - pCreature->DealDamage(pCreature, pCreature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - pCreature->RemoveCorpse(); - } else { - AnzuEncounter = IN_PROGRESS; - } - } - - void OnGameObjectCreate(GameObject* pGo, bool add) - { - if (pGo->GetEntry() == IKISS_DOOR) - m_uiIkissDoorGUID = pGo->GetGUID(); - } - - void SetData(uint32 type, uint32 data) - { - switch(type) - { - case DATA_IKISSDOOREVENT: - if (data == DONE) - DoUseDoorOrButton(m_uiIkissDoorGUID,DAY*IN_MILISECONDS); - break; - case TYPE_ANZU_ENCOUNTER: - AnzuEncounter = data; - break; - } - } -}; - -InstanceData* GetInstanceData_instance_sethekk_halls(Map* pMap) -{ - return new instance_sethekk_halls(pMap); -} - -void AddSC_instance_sethekk_halls() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "instance_sethekk_halls"; - newscript->GetInstanceData = &GetInstanceData_instance_sethekk_halls; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/boss_ambassador_hellmaw.cpp b/src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/boss_ambassador_hellmaw.cpp deleted file mode 100644 index 66e6b3a108d..00000000000 --- a/src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/boss_ambassador_hellmaw.cpp +++ /dev/null @@ -1,217 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Ambassador_Hellmaw -SD%Complete: 80 -SDComment: Enrage spell missing/not known -SDCategory: Auchindoun, Shadow Labyrinth -EndScriptData */ - -#include "precompiled.h" -#include "escort_ai.h" -#include "def_shadow_labyrinth.h" - -enum -{ - SAY_INTRO = -1555000, - SAY_AGGRO1 = -1555001, - SAY_AGGRO2 = -1555002, - SAY_AGGRO3 = -1555003, - SAY_HELP = -1555004, - SAY_SLAY1 = -1555005, - SAY_SLAY2 = -1555006, - SAY_DEATH = -1555007, - - SPELL_BANISH = 30231, - SPELL_CORROSIVE_ACID = 33551, - SPELL_FEAR = 33547, - SPELL_ENRAGE = 34970 -}; - -struct TRINITY_DLL_DECL boss_ambassador_hellmawAI : public npc_escortAI -{ - boss_ambassador_hellmawAI(Creature* pCreature) : npc_escortAI(pCreature) - { - m_pInstance = pCreature->GetInstanceData(); - HeroicMode = pCreature->GetMap()->IsHeroic(); - } - - ScriptedInstance* m_pInstance; - bool HeroicMode; - - uint32 EventCheck_Timer; - uint32 CorrosiveAcid_Timer; - uint32 Fear_Timer; - uint32 Enrage_Timer; - bool Intro; - bool IsBanished; - bool Enraged; - - void Reset() - { - EventCheck_Timer = 5000; - CorrosiveAcid_Timer = 5000 + rand()%5000; - Fear_Timer = 25000 + rand()%5000; - Enrage_Timer = 180000; - Intro = false; - IsBanished = true; - Enraged = false; - - if (m_pInstance && m_creature->isAlive()) - { - if (m_pInstance->GetData(TYPE_OVERSEER) != DONE) - m_creature->CastSpell(m_creature, SPELL_BANISH, true); - } - } - - void JustReachedHome() - { - if (m_pInstance) - m_pInstance->SetData(TYPE_HELLMAW, FAIL); - } - - void MoveInLineOfSight(Unit* pWho) - { - if (m_creature->HasAura(SPELL_BANISH)) - return; - - npc_escortAI::MoveInLineOfSight(pWho); - } - - void WaypointReached(uint32 i) - { - } - - void DoIntro() - { - if (m_creature->HasAura(SPELL_BANISH)) - m_creature->RemoveAurasDueToSpell(SPELL_BANISH); - - IsBanished = false; - Intro = true; - - if (m_pInstance) - { - if (m_pInstance->GetData(TYPE_HELLMAW) != FAIL) - { - DoScriptText(SAY_INTRO, m_creature); - Start(true, false, 0, NULL, false, true); - } - - m_pInstance->SetData(TYPE_HELLMAW, IN_PROGRESS); - } - } - - void EnterCombat(Unit *who) - { - switch(rand()%3) - { - case 0: DoScriptText(SAY_AGGRO1, m_creature); break; - case 1: DoScriptText(SAY_AGGRO2, m_creature); break; - case 2: DoScriptText(SAY_AGGRO3, m_creature); break; - } - } - - void KilledUnit(Unit *victim) - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_SLAY1, m_creature); break; - case 1: DoScriptText(SAY_SLAY2, m_creature); break; - } - } - - void JustDied(Unit *victim) - { - DoScriptText(SAY_DEATH, m_creature); - - if (m_pInstance) - m_pInstance->SetData(TYPE_HELLMAW, DONE); - } - - void UpdateAI(const uint32 diff) - { - if (!Intro && !IsBeingEscorted) - { - if (EventCheck_Timer < diff) - { - if (m_pInstance) - { - if (m_pInstance->GetData(TYPE_OVERSEER) == DONE) - { - DoIntro(); - return; - } - } - EventCheck_Timer = 5000; - return; - } - else - { - EventCheck_Timer -= diff; - return; - } - } - - npc_escortAI::UpdateAI(diff); - - if (!UpdateVictim()) - return; - - if (m_creature->HasAura(SPELL_BANISH, 0)) - { - EnterEvadeMode(); - return; - } - - if (CorrosiveAcid_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_CORROSIVE_ACID); - CorrosiveAcid_Timer = 15000 + rand()%10000; - }else CorrosiveAcid_Timer -= diff; - - if (Fear_Timer < diff) - { - DoCast(m_creature,SPELL_FEAR); - Fear_Timer = 20000 + rand()%15000; - }else Fear_Timer -= diff; - - if (HeroicMode) - { - if (!Enraged && Enrage_Timer < diff) - { - DoCast(m_creature,SPELL_ENRAGE); - Enraged = true; - }else Enrage_Timer -= diff; - } - } -}; - -CreatureAI* GetAI_boss_ambassador_hellmaw(Creature* pCreature) -{ - return new boss_ambassador_hellmawAI(pCreature); -} - -void AddSC_boss_ambassador_hellmaw() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_ambassador_hellmaw"; - newscript->GetAI = &GetAI_boss_ambassador_hellmaw; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/boss_blackheart_the_inciter.cpp b/src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/boss_blackheart_the_inciter.cpp deleted file mode 100644 index 73374c08f8c..00000000000 --- a/src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/boss_blackheart_the_inciter.cpp +++ /dev/null @@ -1,177 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Blackheart_the_Inciter -SD%Complete: 75 -SDComment: Incite Chaos not functional since core lacks Mind Control support -SDCategory: Auchindoun, Shadow Labyrinth -EndScriptData */ - -#include "precompiled.h" -#include "def_shadow_labyrinth.h" - -#define SPELL_INCITE_CHAOS 33676 -#define SPELL_INCITE_CHAOS_B 33684 //debuff applied to each member of party -#define SPELL_CHARGE 33709 -#define SPELL_WAR_STOMP 33707 - -#define SAY_INTRO1 -1555008 -#define SAY_INTRO2 -1555009 -#define SAY_INTRO3 -1555010 -#define SAY_AGGRO1 -1555011 -#define SAY_AGGRO2 -1555012 -#define SAY_AGGRO3 -1555013 -#define SAY_SLAY1 -1555014 -#define SAY_SLAY2 -1555015 -#define SAY_HELP -1555016 -#define SAY_DEATH -1555017 - -#define SAY2_INTRO1 -1555018 -#define SAY2_INTRO2 -1555019 -#define SAY2_INTRO3 -1555020 -#define SAY2_AGGRO1 -1555021 -#define SAY2_AGGRO2 -1555022 -#define SAY2_AGGRO3 -1555023 -#define SAY2_SLAY1 -1555024 -#define SAY2_SLAY2 -1555025 -#define SAY2_HELP -1555026 -#define SAY2_DEATH -1555027 - -struct TRINITY_DLL_DECL boss_blackheart_the_inciterAI : public ScriptedAI -{ - boss_blackheart_the_inciterAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance *pInstance; - - bool InciteChaos; - uint32 InciteChaos_Timer; - uint32 InciteChaosWait_Timer; - uint32 Charge_Timer; - uint32 Knockback_Timer; - - void Reset() - { - InciteChaos = false; - InciteChaos_Timer = 20000; - InciteChaosWait_Timer = 15000; - Charge_Timer = 5000; - Knockback_Timer = 15000; - - if (pInstance) - pInstance->SetData(DATA_BLACKHEARTTHEINCITEREVENT, NOT_STARTED); - } - - void KilledUnit(Unit *victim) - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_SLAY1, m_creature); break; - case 1: DoScriptText(SAY_SLAY2, m_creature); break; - } - } - - void JustDied(Unit *victim) - { - DoScriptText(SAY_DEATH, m_creature); - - if (pInstance) - pInstance->SetData(DATA_BLACKHEARTTHEINCITEREVENT, DONE); - } - - void EnterCombat(Unit *who) - { - switch(rand()%3) - { - case 0: DoScriptText(SAY_AGGRO1, m_creature); break; - case 1: DoScriptText(SAY_AGGRO2, m_creature); break; - case 2: DoScriptText(SAY_AGGRO3, m_creature); break; - } - - if (pInstance) - pInstance->SetData(DATA_BLACKHEARTTHEINCITEREVENT, IN_PROGRESS); - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - if (InciteChaos) - { - if (InciteChaosWait_Timer < diff) - { - InciteChaos = false; - InciteChaosWait_Timer = 15000; - }else InciteChaosWait_Timer -= diff; - - return; - } - - if (InciteChaos_Timer < diff) - { - DoCast(m_creature, SPELL_INCITE_CHAOS); - - std::list t_list = m_creature->getThreatManager().getThreatList(); - for(std::list::iterator itr = t_list.begin(); itr!= t_list.end(); ++itr) - { - Unit* target = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid()); - if (target && target->GetTypeId() == TYPEID_PLAYER) - target->CastSpell(target,SPELL_INCITE_CHAOS_B,true); - } - - DoResetThreat(); - InciteChaos = true; - InciteChaos_Timer = 40000; - return; - }else InciteChaos_Timer -= diff; - - //Charge_Timer - if (Charge_Timer < diff) - { - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - DoCast(target, SPELL_CHARGE); - Charge_Timer = 15000 + rand()%10000; - }else Charge_Timer -= diff; - - //Knockback_Timer - if (Knockback_Timer < diff) - { - DoCast(m_creature, SPELL_WAR_STOMP); - Knockback_Timer = 18000 + rand()%6000; - }else Knockback_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_boss_blackheart_the_inciter(Creature* pCreature) -{ - return new boss_blackheart_the_inciterAI (pCreature); -} - -void AddSC_boss_blackheart_the_inciter() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_blackheart_the_inciter"; - newscript->GetAI = &GetAI_boss_blackheart_the_inciter; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp b/src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp deleted file mode 100644 index 0cc6255f3cf..00000000000 --- a/src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp +++ /dev/null @@ -1,321 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Grandmaster_Vorpil -SD%Complete: 100 -SDComment: -SDCategory: Auchindoun, Shadow Labyrinth -EndScriptData */ - -#include "precompiled.h" -#include "def_shadow_labyrinth.h" - -#define SAY_INTRO -1555028 -#define SAY_AGGRO1 -1555029 -#define SAY_AGGRO2 -1555030 -#define SAY_AGGRO3 -1555031 -#define SAY_HELP -1555032 -#define SAY_SLAY1 -1555033 -#define SAY_SLAY2 -1555034 -#define SAY_DEATH -1555035 - -#define SPELL_RAIN_OF_FIRE 33617 -#define H_SPELL_RAIN_OF_FIRE 39363 - -#define SPELL_DRAW_SHADOWS 33563 -#define SPELL_SHADOWBOLT_VOLLEY 33841 -#define SPELL_BANISH 38791 - -#define MOB_VOID_TRAVELER 19226 -#define SPELL_SACRIFICE 33587 -#define SPELL_SHADOW_NOVA 33846 -#define SPELL_EMPOWERING_SHADOWS 33783 -#define H_SPELL_EMPOWERING_SHADOWS 39364 - -#define MOB_VOID_PORTAL 19224 -#define SPELL_VOID_PORTAL_VISUAL 33569 - -float VorpilPosition[3] = {-252.8820,-264.3030,17.1}; - -float VoidPortalCoords[5][3] = -{ - {-283.5894, -239.5718, 12.7}, - {-306.5853, -258.4539, 12.7}, - {-295.8789, -269.0899, 12.7}, - {-209.3401, -262.7564, 17.1}, - {-261.4533, -297.3298, 17.1} -}; - -struct TRINITY_DLL_DECL mob_voidtravelerAI : public ScriptedAI -{ - mob_voidtravelerAI(Creature *c) : ScriptedAI(c) - { - HeroicMode = m_creature->GetMap()->IsHeroic(); - } - - bool HeroicMode; - Unit *Vorpil; - uint32 move; - bool sacrificed; - - void Reset() - { - Vorpil = NULL; - move = 0; - sacrificed = false; - } - - void EnterCombat(Unit *who){} - - void UpdateAI(const uint32 diff) - { - if (!Vorpil) - { - m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - return; - } - if (move < diff) - { - if (sacrificed) - { - SpellEntry *spell = GET_SPELL(HeroicMode?H_SPELL_EMPOWERING_SHADOWS:SPELL_EMPOWERING_SHADOWS); - if (spell) - Vorpil->AddAura(new Aura(spell, 1, NULL, Vorpil, m_creature)); - Vorpil->SetHealth(Vorpil->GetHealth()+Vorpil->GetMaxHealth()/25); - DoCast(m_creature, SPELL_SHADOW_NOVA, true); - m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - return; - } - m_creature->GetMotionMaster()->MoveFollow(Vorpil,0,0); - if (m_creature->IsWithinDist(Vorpil, 3)) - { - DoCast(m_creature, SPELL_SACRIFICE, false); - sacrificed = true; - move = 500; - return; - } - if (!Vorpil->isInCombat() || Vorpil->isDead()) - { - m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - return; - } - move = 1000; - }else move -= diff; - } -}; -CreatureAI* GetAI_mob_voidtraveler(Creature* pCreature) -{ - return new mob_voidtravelerAI (pCreature); -} - -struct TRINITY_DLL_DECL boss_grandmaster_vorpilAI : public ScriptedAI -{ - boss_grandmaster_vorpilAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - HeroicMode = m_creature->GetMap()->IsHeroic(); - Intro = false; - } - - ScriptedInstance *pInstance; - bool Intro, HelpYell; - bool sumportals; - bool HeroicMode; - - uint32 ShadowBoltVolley_Timer; - uint32 DrawShadows_Timer; - uint32 summonTraveler_Timer; - uint32 banish_Timer; - uint64 PortalsGuid[5]; - - void Reset() - { - ShadowBoltVolley_Timer = 7000 + rand()%7000; - DrawShadows_Timer = 45000; - summonTraveler_Timer = 90000; - banish_Timer = 17000; - HelpYell = false; - destroyPortals(); - - if (pInstance) - pInstance->SetData(DATA_GRANDMASTERVORPILEVENT, NOT_STARTED); - } - - void summonPortals() - { - if (!sumportals) - { - for (int i = 0;i<5; ++i) - { - Creature *Portal = NULL; - Portal = m_creature->SummonCreature(MOB_VOID_PORTAL,VoidPortalCoords[i][0],VoidPortalCoords[i][1],VoidPortalCoords[i][2],0,TEMPSUMMON_CORPSE_DESPAWN,3000000); - if (Portal) - { - PortalsGuid[i] = Portal->GetGUID(); - Portal->CastSpell(Portal,SPELL_VOID_PORTAL_VISUAL,false); - } - } - sumportals = true; - summonTraveler_Timer = 5000; - } - } - - void destroyPortals() - { - if (sumportals) - { - for (int i = 0;i < 5; i ++) - { - Unit *Portal = Unit::GetUnit((*m_creature), PortalsGuid[i]); - if (Portal && Portal->isAlive()) - Portal->DealDamage(Portal, Portal->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - PortalsGuid[i] = 0; - } - sumportals = false; - } - } - - void spawnVoidTraveler() - { - int pos = rand()%5; - m_creature->SummonCreature(MOB_VOID_TRAVELER,VoidPortalCoords[pos][0],VoidPortalCoords[pos][1],VoidPortalCoords[pos][2],0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,5000); - if (!HelpYell) - { - DoScriptText(SAY_HELP, m_creature); - HelpYell = true; - } - } - - void JustSummoned(Creature *summoned) - { - if (summoned && summoned->GetEntry() == MOB_VOID_TRAVELER) - CAST_AI(mob_voidtravelerAI, summoned->AI())->Vorpil = m_creature; - } - - void KilledUnit(Unit *victim) - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_SLAY1, m_creature); break; - case 1: DoScriptText(SAY_SLAY2, m_creature); break; - } - } - - void JustDied(Unit *victim) - { - DoScriptText(SAY_DEATH, m_creature); - destroyPortals(); - - if (pInstance) - pInstance->SetData(DATA_GRANDMASTERVORPILEVENT, DONE); - } - - void EnterCombat(Unit *who) - { - switch(rand()%3) - { - case 0: DoScriptText(SAY_AGGRO1, m_creature); break; - case 1: DoScriptText(SAY_AGGRO2, m_creature); break; - case 2: DoScriptText(SAY_AGGRO3, m_creature); break; - } - summonPortals(); - - if (pInstance) - pInstance->SetData(DATA_GRANDMASTERVORPILEVENT, IN_PROGRESS); - } - - void MoveInLineOfSight(Unit *who) - { - ScriptedAI::MoveInLineOfSight(who); - - if (!Intro && m_creature->IsWithinLOSInMap(who)&& m_creature->IsWithinDistInMap(who, 100) && m_creature->IsHostileTo(who)) - { - DoScriptText(SAY_INTRO, m_creature); - Intro = true; - } - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (ShadowBoltVolley_Timer < diff) - { - DoCast(m_creature,SPELL_SHADOWBOLT_VOLLEY); - ShadowBoltVolley_Timer = 15000 + rand()%15000;; - }else ShadowBoltVolley_Timer -= diff; - - if (HeroicMode && banish_Timer < diff) - { - Unit *target = SelectTarget(SELECT_TARGET_RANDOM,0,30,false); - if (target) - { - DoCast(target,SPELL_BANISH); - banish_Timer = 16000; - } - }else banish_Timer -= diff; - - if (DrawShadows_Timer < diff) - { - Map* pMap = m_creature->GetMap(); - Map::PlayerList const &PlayerList = pMap->GetPlayers(); - for(Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) - if (Player* i_pl = i->getSource()) - if (i_pl->isAlive() && !i_pl->HasAura(SPELL_BANISH)) - i_pl->TeleportTo(m_creature->GetMapId(), VorpilPosition[0],VorpilPosition[1],VorpilPosition[2], 0, TELE_TO_NOT_LEAVE_COMBAT); - - m_creature->GetMap()->CreatureRelocation(m_creature, VorpilPosition[0],VorpilPosition[1],VorpilPosition[2],0.0f); - DoCast(m_creature,SPELL_DRAW_SHADOWS,true); - - DoCast(m_creature,HeroicMode?H_SPELL_RAIN_OF_FIRE:SPELL_RAIN_OF_FIRE); - - ShadowBoltVolley_Timer = 6000; - DrawShadows_Timer = 30000; - }else DrawShadows_Timer -= diff; - - if (summonTraveler_Timer < diff) - { - spawnVoidTraveler(); - summonTraveler_Timer = 10000; - //enrage at 20% - if ((m_creature->GetHealth()*5) < m_creature->GetMaxHealth()) - summonTraveler_Timer = 5000; - }else summonTraveler_Timer -=diff; - - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_boss_grandmaster_vorpil(Creature* pCreature) -{ - return new boss_grandmaster_vorpilAI (pCreature); -} - -void AddSC_boss_grandmaster_vorpil() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_grandmaster_vorpil"; - newscript->GetAI = &GetAI_boss_grandmaster_vorpil; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_voidtraveler"; - newscript->GetAI = &GetAI_mob_voidtraveler; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/boss_murmur.cpp b/src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/boss_murmur.cpp deleted file mode 100644 index 259f6091af6..00000000000 --- a/src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/boss_murmur.cpp +++ /dev/null @@ -1,207 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Murmur -SD%Complete: 90 -SDComment: Timers may be incorrect -SDCategory: Auchindoun, Shadow Labyrinth -EndScriptData */ - -#include "precompiled.h" -#include "def_shadow_labyrinth.h" - -#define EMOTE_SONIC_BOOM -1555036 - -#define SPELL_SONIC_BOOM_CAST (HeroicMode?38796:33923) -#define SPELL_SONIC_BOOM_EFFECT (HeroicMode?38795:33666) -#define SPELL_RESONANCE 33657 -#define SPELL_MURMURS_TOUCH (HeroicMode?38794:33711) -#define SPELL_MAGNETIC_PULL 33689 -#define SPELL_SONIC_SHOCK 38797 -#define SPELL_THUNDERING_STORM 39365 - -struct TRINITY_DLL_DECL boss_murmurAI : public ScriptedAI -{ - boss_murmurAI(Creature *c) : ScriptedAI(c) - { - SetCombatMovement(false); - HeroicMode = m_creature->GetMap()->IsHeroic(); - } - - uint32 SonicBoom_Timer; - uint32 MurmursTouch_Timer; - uint32 Resonance_Timer; - uint32 MagneticPull_Timer; - uint32 SonicShock_Timer; - uint32 ThunderingStorm_Timer; - bool HeroicMode; - bool SonicBoom; - - void Reset() - { - SonicBoom_Timer = 30000; - MurmursTouch_Timer = 8000 + rand()%12000; - Resonance_Timer = 5000; - MagneticPull_Timer = 15000 + rand()%15000; - ThunderingStorm_Timer = 15000; - SonicShock_Timer = 10000; - SonicBoom = false; - - //database should have `RegenHealth`=0 to prevent regen - uint32 hp = (m_creature->GetMaxHealth()*40)/100; - if (hp) m_creature->SetHealth(hp); - m_creature->ResetPlayerDamageReq(); - } - - void SonicBoomEffect() - { - std::list t_list = m_creature->getThreatManager().getThreatList(); - for(std::list::iterator itr = t_list.begin(); itr!= t_list.end(); ++itr) - { - Unit* target = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid()); - if (target && target->GetTypeId() == TYPEID_PLAYER) - { - //Not do anything without aura, spell can be resisted! - if (target->HasAura(SPELL_SONIC_BOOM_CAST) && m_creature->IsWithinDistInMap(target, 34.0f)) - { - //This will be wrong calculation. Also, comments suggest it must deal damage - target->SetHealth(uint32(target->GetMaxHealth() - target->GetMaxHealth() * 0.8)); - } - } - } - } - - void EnterCombat(Unit *who) { } - - // Sonic Boom instant damage (needs core fix instead of this) - void SpellHitTarget(Unit *target, const SpellEntry *spell) - { - if (target && target->isAlive() && spell && spell->Id == SPELL_SONIC_BOOM_EFFECT) - m_creature->DealDamage(target,(target->GetHealth()*90)/100,NULL,SPELL_DIRECT_DAMAGE,SPELL_SCHOOL_MASK_NATURE,spell); - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target or casting - if (!UpdateVictim() || m_creature->IsNonMeleeSpellCasted(false)) - return; - - // Sonic Boom - if (SonicBoom) - { - DoCast(m_creature, SPELL_SONIC_BOOM_EFFECT, true); - SonicBoomEffect(); - - SonicBoom = false; - Resonance_Timer = 1500; - } - if (SonicBoom_Timer < diff) - { - DoScriptText(EMOTE_SONIC_BOOM, m_creature); - DoCast(m_creature, SPELL_SONIC_BOOM_CAST); - SonicBoom_Timer = 30000; - SonicBoom = true; - return; - }else SonicBoom_Timer -= diff; - - // Murmur's Touch - if (MurmursTouch_Timer < diff) - { - if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM,0,80,true)) - DoCast(target, SPELL_MURMURS_TOUCH); - MurmursTouch_Timer = 25000 + rand()%10000; - }else MurmursTouch_Timer -= diff; - - // Resonance - if (!SonicBoom && !(m_creature->IsWithinMeleeRange(m_creature->getVictim()))) - { - if (Resonance_Timer < diff) - { - DoCast(m_creature, SPELL_RESONANCE); - Resonance_Timer = 5000; - }else Resonance_Timer -= diff; - } - - // Magnetic Pull - if (MagneticPull_Timer < diff) - { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) - if (target->GetTypeId() == TYPEID_PLAYER && target->isAlive()) - { - DoCast(target, SPELL_MAGNETIC_PULL); - MagneticPull_Timer = 15000+rand()%15000; - return; - } - MagneticPull_Timer = 500; - }else MagneticPull_Timer -= diff; - - if (HeroicMode) - { - // Thundering Storm - if (ThunderingStorm_Timer < diff) - { - std::list& m_threatlist = m_creature->getThreatManager().getThreatList(); - for(std::list::iterator i = m_threatlist.begin(); i != m_threatlist.end(); ++i) - if (Unit* target = Unit::GetUnit((*m_creature),(*i)->getUnitGuid())) - if (target->isAlive() && !m_creature->IsWithinDist(target, 35, false)) - DoCast(target, SPELL_THUNDERING_STORM, true); - ThunderingStorm_Timer = 15000; - }else ThunderingStorm_Timer -= diff; - - // Sonic Shock - if (SonicShock_Timer < diff) - { - if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM,0,20,false)) - if (target->isAlive()) - DoCast(target, SPELL_SONIC_SHOCK); - SonicShock_Timer = 10000+rand()%10000; - }else SonicShock_Timer -= diff; - } - - // Select nearest most aggro target if top aggro too far - if (!m_creature->isAttackReady()) - return; - if (!m_creature->IsWithinMeleeRange(m_creature->getVictim())) - { - std::list& m_threatlist = m_creature->getThreatManager().getThreatList(); - for(std::list::iterator i = m_threatlist.begin(); i != m_threatlist.end(); ++i) - if (Unit* target = Unit::GetUnit((*m_creature),(*i)->getUnitGuid())) - if (target->isAlive() && m_creature->IsWithinMeleeRange(target)) - { - m_creature->TauntApply(target); - break; - } - } - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_murmur(Creature* pCreature) -{ - return new boss_murmurAI (pCreature); -} - -void AddSC_boss_murmur() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_murmur"; - newscript->GetAI = &GetAI_boss_murmur; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/def_shadow_labyrinth.h b/src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/def_shadow_labyrinth.h deleted file mode 100644 index a78955368bf..00000000000 --- a/src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/def_shadow_labyrinth.h +++ /dev/null @@ -1,15 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software licensed under GPL version 2 - * Please see the included DOCS/LICENSE.TXT for more information */ - -#ifndef DEF_SHADOW_LABYRINTH_H -#define DEF_SHADOW_LABYRINTH_H - -#define TYPE_HELLMAW 1 -#define TYPE_OVERSEER 2 -#define DATA_BLACKHEARTTHEINCITEREVENT 3 -#define DATA_GRANDMASTERVORPILEVENT 4 -#define DATA_MURMUREVENT 5 -#define DATA_GRANDMASTERVORPIL 6 -#endif - diff --git a/src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/instance_shadow_labyrinth.cpp b/src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/instance_shadow_labyrinth.cpp deleted file mode 100644 index f8f3b73bffa..00000000000 --- a/src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/instance_shadow_labyrinth.cpp +++ /dev/null @@ -1,227 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Instance_Shadow_Labyrinth -SD%Complete: 85 -SDComment: Some cleanup left along with save -SDCategory: Auchindoun, Shadow Labyrinth -EndScriptData */ - -#include "precompiled.h" -#include "def_shadow_labyrinth.h" - -#define MAX_ENCOUNTER 5 - -#define REFECTORY_DOOR 183296 //door opened when blackheart the inciter dies -#define SCREAMING_HALL_DOOR 183295 //door opened when grandmaster vorpil dies - -/* Shadow Labyrinth encounters: -1 - Ambassador Hellmaw event -2 - Blackheart the Inciter event -3 - Grandmaster Vorpil event -4 - Murmur event -*/ - -struct TRINITY_DLL_DECL instance_shadow_labyrinth : public ScriptedInstance -{ - instance_shadow_labyrinth(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; - - uint32 m_auiEncounter[MAX_ENCOUNTER]; - std::string str_data; - - uint64 m_uiRefectoryDoorGUID; - uint64 m_uiScreamingHallDoorGUID; - - uint64 m_uiGrandmasterVorpil; - uint32 m_uiFelOverseerCount; - - void Initialize() - { - memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); - - m_uiRefectoryDoorGUID = 0; - m_uiScreamingHallDoorGUID = 0; - - m_uiGrandmasterVorpil = 0; - m_uiFelOverseerCount = 0; - } - - bool IsEncounterInProgress() const - { - for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) - if (m_auiEncounter[i] == IN_PROGRESS) return true; - - return false; - } - - void OnGameObjectCreate(GameObject* pGo, bool add) - { - switch(pGo->GetEntry()) - { - case REFECTORY_DOOR: - m_uiRefectoryDoorGUID = pGo->GetGUID(); - if (m_auiEncounter[2] == DONE) - pGo->SetGoState(GO_STATE_ACTIVE); - break; - case SCREAMING_HALL_DOOR: - m_uiScreamingHallDoorGUID = pGo->GetGUID(); - if (m_auiEncounter[3] == DONE) - pGo->SetGoState(GO_STATE_ACTIVE); - break; - } - } - - void OnCreatureCreate(Creature* pCreature, bool add) - { - switch(pCreature->GetEntry()) - { - case 18732: - m_uiGrandmasterVorpil = pCreature->GetGUID(); - break; - case 18796: - if (pCreature->isAlive()) - { - ++m_uiFelOverseerCount; - debug_log("TSCR: Shadow Labyrinth: counting %u Fel Overseers.",m_uiFelOverseerCount); - } - break; - } - } - - void SetData(uint32 type, uint32 uiData) - { - switch(type) - { - case TYPE_HELLMAW: - m_auiEncounter[0] = uiData; - break; - - case TYPE_OVERSEER: - if (uiData != DONE) - { - error_log("TSCR: Shadow Labyrinth: TYPE_OVERSEER did not expect other data than DONE"); - return; - } - if (m_uiFelOverseerCount) - { - --m_uiFelOverseerCount; - - if (m_uiFelOverseerCount) - debug_log("TSCR: Shadow Labyrinth: %u Fel Overseers left to kill.",m_uiFelOverseerCount); - else - { - m_auiEncounter[1] = DONE; - debug_log("TSCR: Shadow Labyrinth: TYPE_OVERSEER == DONE"); - } - } - break; - - case DATA_BLACKHEARTTHEINCITEREVENT: - if (uiData == DONE) - DoUseDoorOrButton(m_uiRefectoryDoorGUID); - m_auiEncounter[2] = uiData; - break; - - case DATA_GRANDMASTERVORPILEVENT: - if (uiData == DONE) - DoUseDoorOrButton(m_uiScreamingHallDoorGUID); - m_auiEncounter[3] = uiData; - break; - - case DATA_MURMUREVENT: - m_auiEncounter[4] = uiData; - break; - } - - if (uiData == DONE) - { - if (type == TYPE_OVERSEER && m_uiFelOverseerCount != 0) - return; - - OUT_SAVE_INST_DATA; - - std::ostringstream saveStream; - saveStream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " - << m_auiEncounter[2] << " " << m_auiEncounter[3] << " " << m_auiEncounter[4]; - - str_data = saveStream.str(); - - SaveToDB(); - OUT_SAVE_INST_DATA_COMPLETE; - } - } - - uint32 GetData(uint32 type) - { - switch(type) - { - case TYPE_HELLMAW: return m_auiEncounter[0]; - case TYPE_OVERSEER: return m_auiEncounter[1]; - case DATA_GRANDMASTERVORPILEVENT: return m_auiEncounter[3]; - case DATA_MURMUREVENT: return m_auiEncounter[4]; - } - return false; - } - - uint64 GetData64(uint32 identifier) - { - if (identifier == DATA_GRANDMASTERVORPIL) - return m_uiGrandmasterVorpil; - - return 0; - } - - std::string GetSaveData() - { - return str_data; - } - - void Load(const char* in) - { - if (!in) - { - OUT_LOAD_INST_DATA_FAIL; - return; - } - - OUT_LOAD_INST_DATA(in); - - std::istringstream loadStream(in); - loadStream >> m_auiEncounter[0] >> m_auiEncounter[1] >> m_auiEncounter[2] >> m_auiEncounter[3] >> m_auiEncounter[4]; - - for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) - if (m_auiEncounter[i] == IN_PROGRESS) - m_auiEncounter[i] = NOT_STARTED; - - OUT_LOAD_INST_DATA_COMPLETE; - } -}; - -InstanceData* GetInstanceData_instance_shadow_labyrinth(Map* pMap) -{ - return new instance_shadow_labyrinth(pMap); -} - -void AddSC_instance_shadow_labyrinth() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "instance_shadow_labyrinth"; - newscript->GetInstanceData = &GetInstanceData_instance_shadow_labyrinth; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/outland/tempest_keep/arcatraz/instance_arcatraz.cpp b/src/bindings/scripts/scripts/outland/tempest_keep/arcatraz/instance_arcatraz.cpp index 081c80c56e5..ebf5484671c 100644 --- a/src/bindings/scripts/scripts/outland/tempest_keep/arcatraz/instance_arcatraz.cpp +++ b/src/bindings/scripts/scripts/outland/tempest_keep/arcatraz/instance_arcatraz.cpp @@ -84,8 +84,7 @@ struct TRINITY_DLL_DECL instance_arcatraz : public ScriptedInstance bool IsEncounterInProgress() const { for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) - if (m_auiEncounter[i] == IN_PROGRESS) - return true; + if (m_auiEncounter[i] == IN_PROGRESS) return true; return false; } diff --git a/src/bindings/scripts/system/ScriptLoader.cpp b/src/bindings/scripts/system/ScriptLoader.cpp index 024fbe7b7a1..236dab3bfcc 100644 --- a/src/bindings/scripts/system/ScriptLoader.cpp +++ b/src/bindings/scripts/system/ScriptLoader.cpp @@ -307,14 +307,14 @@ extern void AddSC_wintergrasp(); extern void AddSC_zuldrak(); //outland -extern void AddSC_boss_exarch_maladaar(); //Aunchindoun Auchenai Crypts +extern void AddSC_boss_exarch_maladaar(); //Auchindoun Auchenai Crypts extern void AddSC_boss_shirrak_the_dead_watcher(); -extern void AddSC_boss_nexusprince_shaffar(); //Aunchindoun Mana Tombs +extern void AddSC_boss_nexusprince_shaffar(); //Auchindoun Mana Tombs extern void AddSC_boss_pandemonius(); -extern void AddSC_boss_darkweaver_syth(); //Aunchindoun Sekketh Halls +extern void AddSC_boss_darkweaver_syth(); //Auchindoun Sekketh Halls extern void AddSC_boss_talon_king_ikiss(); extern void AddSC_instance_sethekk_halls(); -extern void AddSC_instance_shadow_labyrinth(); //Aunchindoun Shadow Labyrinth +extern void AddSC_instance_shadow_labyrinth(); //Auchindoun Shadow Labyrinth extern void AddSC_boss_ambassador_hellmaw(); extern void AddSC_boss_blackheart_the_inciter(); extern void AddSC_boss_grandmaster_vorpil(); @@ -693,14 +693,14 @@ void AddScripts() AddSC_zuldrak(); //outland - AddSC_boss_exarch_maladaar(); //Aunchindoun Auchenai Crypts + AddSC_boss_exarch_maladaar(); //Auchindoun Auchenai Crypts AddSC_boss_shirrak_the_dead_watcher(); - AddSC_boss_nexusprince_shaffar(); //Aunchindoun Mana Tombs + AddSC_boss_nexusprince_shaffar(); //Auchindoun Mana Tombs AddSC_boss_pandemonius(); - AddSC_boss_darkweaver_syth(); //Aunchindoun Sekketh Halls + AddSC_boss_darkweaver_syth(); //Auchindoun Sekketh Halls AddSC_boss_talon_king_ikiss(); AddSC_instance_sethekk_halls(); - AddSC_instance_shadow_labyrinth(); //Aunchindoun Shadow Labyrinth + AddSC_instance_shadow_labyrinth(); //Auchindoun Shadow Labyrinth AddSC_boss_ambassador_hellmaw(); AddSC_boss_blackheart_the_inciter(); AddSC_boss_grandmaster_vorpil(); -- cgit v1.2.3 From 73b2226827b9695ecb9e26378a7d3975446a842c Mon Sep 17 00:00:00 2001 From: maximius Date: Sun, 16 Aug 2009 13:30:27 -0700 Subject: *Hopefully this should be the last of the talent/skill cleanup, thanks Drethek and XTElite1 :) --HG-- branch : trunk --- sql/updates/5036_character_updates_dual_spec.sql | 10 ++++++---- sql/updates/5084_character_updates_dual_spec.sql | 9 --------- sql/updates/5097_character_updates_dual_spec.sql | 13 +++++++++++++ 3 files changed, 19 insertions(+), 13 deletions(-) delete mode 100644 sql/updates/5084_character_updates_dual_spec.sql create mode 100644 sql/updates/5097_character_updates_dual_spec.sql (limited to 'sql') diff --git a/sql/updates/5036_character_updates_dual_spec.sql b/sql/updates/5036_character_updates_dual_spec.sql index 1718a70c554..b345755f298 100644 --- a/sql/updates/5036_character_updates_dual_spec.sql +++ b/sql/updates/5036_character_updates_dual_spec.sql @@ -20,10 +20,12 @@ CREATE TABLE `character_talent` ( PRIMARY KEY (`guid`,`spell`,`spec`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/* The below DELETE query should remove all known talents from `character_spell`, - talents gathered by rockzOr of getmangos.com and updated/fixed by oc_redfox of trinitycore.org. - This update should (probably) only be run once, on your characters database before enabling Dual Spec.. */ -DELETE FROM `character_spell` WHERE `spell` IN (724,974,1329,3674,5570,5923,5924,5925,5926,5952,9452,9453,9799,10060,11069,11070,11071,11078,11080,11083,11094,11095,11100,11103,11108,11113,11115,11119,11120,11124,11129,11151,11160,11170,11175,11180,11185,11189,11190,11207,11210,11213,11222,11232,11237,11242,11247,11252,11255,11366,11367,11368,11426,11958,12042,12043,12163,12281,12282,12284,12285,12286,12287,12289,12290,12292,12294,12295,12296,12297,12298,12299,12300,12301,12308,12311,12312,12313,12317,12318,12319,12320,12321,12322,12323,12324,12328,12329,12330,12338,12339,12340,12341,12349,12350,12351,12353,12357,12358,12378,12398,12399,12400,12463,12464,12467,12469,12472,12473,12487,12488,12489,12490,12496,12497,12500,12501,12502,12503,12518,12519,12569,12571,12574,12575,12576,12577,12592,12598,12605,12606,12658,12663,12664,12665,12666,12668,12672,12676,12677,12697,12700,12701,12702,12703,12704,12711,12712,12724,12725,12726,12727,12750,12751,12752,12753,12761,12762,12763,12764,12781,12783,12784,12785,12797,12799,12803,12804,12809,12810,12811,12812,12813,12814,12815,12818,12834,12835,12839,12840,12846,12847,12848,12849,12852,12853,12855,12856,12857,12858,12860,12861,12862,12867,12872,12873,12876,12877,12878,12879,12950,12952,12953,12958,12959,12960,12963,12971,12972,12973,12974,12975,12982,12983,12999,13000,13001,13002,13043,13045,13046,13047,13048,13705,13706,13709,13712,13713,13715,13732,13733,13741,13742,13743,13750,13754,13788,13789,13790,13791,13792,13793,13800,13801,13802,13803,13804,13805,13806,13807,13832,13843,13844,13845,13848,13849,13851,13852,13853,13854,13863,13865,13866,13867,13872,13875,13877,13958,13960,13961,13962,13963,13964,13970,13971,13975,13976,13979,13980,13981,13983,14057,14062,14063,14066,14070,14071,14072,14076,14079,14080,14082,14083,14094,14113,14114,14115,14116,14117,14128,14132,14135,14136,14137,14138,14139,14140,14141,14142,14144,14148,14156,14158,14159,14160,14161,14162,14163,14164,14165,14166,14168,14169,14171,14172,14173,14174,14175,14176,14177,14179,14183,14185,14186,14190,14193,14194,14195,14251,14278,14520,14521,14522,14523,14531,14747,14748,14749,14750,14751,14752,14767,14768,14769,14770,14771,14772,14774,14776,14777,14780,14781,14782,14783,14784,14785,14788,14789,14790,14791,14889,14892,14898,14901,14908,14909,14910,14911,14912,14913,14983,15008,15009,15010,15011,15012,15013,15014,15017,15018,15020,15028,15029,15030,15031,15047,15058,15059,15060,15257,15259,15260,15268,15270,15272,15273,15274,15275,15286,15307,15308,15309,15310,15311,15312,15313,15314,15316,15317,15318,15320,15323,15324,15325,15326,15327,15328,15331,15332,15335,15336,15337,15338,15349,15354,15355,15356,15362,15363,15392,15407,15448,15473,15487,16035,16038,16039,16040,16041,16043,16086,16089,16105,16106,16107,16108,16109,16110,16111,16112,16113,16114,16115,16116,16130,16160,16161,16164,16166,16173,16176,16178,16179,16180,16181,16182,16184,16187,16188,16190,16194,16196,16198,16205,16206,16207,16208,16209,16210,16211,16212,16213,16214,16215,16216,16217,16218,16219,16220,16221,16222,16223,16224,16225,16226,16227,16228,16229,16230,16232,16235,16240,16252,16254,16255,16256,16258,16259,16261,16262,16266,16268,16271,16272,16281,16282,16283,16284,16287,16290,16293,16295,16302,16303,16304,16305,16306,16307,16308,16309,16462,16463,16464,16465,16466,16487,16489,16492,16493,16494,16511,16513,16514,16515,16538,16539,16540,16541,16542,16544,16578,16579,16580,16581,16582,16757,16758,16763,16765,16766,16769,16770,16814,16815,16816,16817,16818,16819,16820,16821,16822,16833,16834,16835,16836,16839,16840,16845,16846,16847,16850,16858,16859,16860,16861,16862,16864,16880,16896,16897,16899,16909,16910,16911,16912,16913,16923,16924,16929,16930,16931,16934,16935,16936,16937,16938,16940,16941,16942,16943,16944,16947,16948,16949,16966,16968,16972,16974,16975,16998,16999,17002,17003,17004,17005,17006,17007,17050,17051,17056,17058,17059,17060,17061,17063,17065,17066,17069,17070,17071,17072,17073,17074,17075,17076,17077,17078,17104,17106,17107,17108,17111,17112,17113,17116,17118,17119,17120,17123,17124,17191,17322,17323,17364,17485,17486,17487,17488,17489,17778,17779,17780,17783,17784,17785,17788,17789,17790,17791,17792,17793,17796,17801,17802,17803,17804,17805,17810,17811,17812,17813,17814,17815,17833,17834,17877,17917,17918,17927,17929,17930,17954,17955,17956,17957,17958,17959,17962,18073,18094,18095,18096,18119,18120,18126,18127,18130,18135,18136,18174,18175,18176,18179,18180,18182,18183,18213,18218,18219,18220,18223,18265,18271,18272,18273,18274,18275,18288,18372,18427,18428,18429,18459,18460,18462,18463,18464,18530,18531,18533,18534,18535,18551,18552,18553,18554,18555,18562,18692,18693,18694,18695,18696,18697,18698,18699,18700,18701,18703,18704,18705,18706,18707,18708,18709,18710,18731,18743,18744,18754,18755,18756,18767,18768,18769,18770,18771,18772,18773,18788,18821,18822,18827,18829,19028,19159,19160,19168,19180,19181,19184,19228,19232,19233,19236,19255,19256,19257,19258,19259,19286,19287,19290,19294,19295,19297,19298,19306,19370,19371,19373,19376,19386,19387,19388,19407,19412,19416,19417,19418,19419,19420,19421,19422,19423,19426,19427,19429,19430,19431,19434,19454,19455,19456,19461,19462,19464,19465,19466,19485,19487,19488,19489,19490,19498,19499,19500,19503,19506,19507,19508,19509,19510,19511,19549,19550,19551,19552,19553,19554,19555,19556,19559,19560,19572,19573,19574,19575,19577,19578,19583,19584,19585,19586,19587,19590,19592,19596,19596,19596,19598,19599,19600,19601,19602,19609,19610,19612,19616,19617,19618,19619,19620,19621,19622,19623,19624,19625,20042,20045,20049,20056,20057,20060,20061,20062,20063,20064,20066,20091,20092,20096,20097,20098,20099,20100,20101,20102,20103,20104,20105,20111,20112,20113,20117,20118,20119,20120,20121,20127,20130,20135,20138,20139,20140,20143,20144,20145,20146,20147,20174,20175,20177,20179,20180,20181,20182,20196,20197,20198,20199,20200,20205,20206,20207,20208,20209,20210,20212,20213,20214,20215,20216,20217,20224,20225,20234,20235,20237,20238,20239,20243,20244,20245,20254,20255,20256,20257,20258,20259,20260,20261,20262,20263,20264,20265,20266,20330,20331,20332,20335,20336,20337,20359,20360,20361,20375,20468,20469,20470,20473,20487,20488,20489,20496,20500,20501,20502,20503,20504,20505,20711,20895,20911,20925,23145,23145,23584,23585,23586,23587,23588,23695,23785,23822,23823,23824,23825,23881,23989,24283,24296,24297,24443,24691,24858,24866,24894,24943,24944,24945,24946,24968,24969,24970,24971,24972,25829,25836,25956,25957,25988,26016,26022,26023,27789,27790,27811,27815,27816,27839,27840,27900,27901,27902,27903,27904,28332,28574,28592,28593,28996,28997,28998,28999,29000,29062,29064,29065,29074,29075,29076,29079,29080,29082,29084,29086,29140,29143,29144,29179,29180,29187,29189,29191,29192,29193,29202,29205,29206,29438,29439,29440,29441,29444,29447,29590,29591,29592,29593,29594,29598,29599,29623,29721,29723,29724,29725,29759,29760,29761,29762,29763,29776,29787,29790,29792,29801,29834,29836,29838,29859,29888,29889,30054,30057,30060,30061,30062,30063,30064,30108,30143,30144,30145,30146,30160,30242,30245,30246,30247,30248,30283,30288,30289,30290,30291,30292,30293,30295,30296,30299,30301,30302,30319,30320,30321,30326,30327,30328,30664,30665,30666,30672,30673,30674,30675,30678,30679,30680,30681,30706,30798,30802,30808,30809,30810,30811,30812,30813,30814,30816,30818,30819,30823,30864,30865,30866,30867,30868,30869,30872,30873,30881,30883,30884,30885,30886,30892,30893,30894,30895,30902,30903,30904,30905,30906,30919,30920,31122,31123,31124,31126,31130,31131,31208,31209,31211,31212,31213,31216,31217,31218,31219,31220,31221,31222,31223,31226,31227,31228,31229,31230,31234,31235,31236,31244,31245,31380,31382,31383,31569,31570,31571,31572,31574,31575,31579,31582,31583,31584,31585,31586,31587,31588,31589,31638,31639,31640,31641,31642,31656,31657,31658,31661,31667,31668,31669,31670,31672,31674,31675,31676,31677,31678,31679,31680,31682,31683,31687,31785,31821,31822,31823,31825,31826,31828,31829,31830,31833,31835,31836,31837,31838,31839,31840,31841,31842,31844,31845,31848,31849,31850,31851,31852,31853,31854,31858,31859,31860,31866,31867,31868,31869,31871,31872,31876,31877,31878,31879,31880,31881,31882,31883,31935,32043,32381,32382,32383,32385,32387,32392,32393,32394,32477,32483,32484,32601,33142,33145,33146,33150,33154,33158,33159,33160,33161,33162,33167,33171,33172,33174,33182,33186,33190,33191,33192,33193,33201,33202,33203,33206,33213,33214,33215,33221,33222,33223,33224,33225,33371,33589,33590,33591,33592,33596,33597,33599,33600,33601,33602,33603,33604,33605,33606,33607,33776,33831,33851,33852,33853,33855,33856,33859,33866,33867,33872,33873,33879,33880,33881,33882,33883,33886,33887,33888,33889,33890,33891,33917,33956,33957,34151,34152,34153,34293,34295,34296,34297,34300,34453,34454,34455,34459,34460,34462,34464,34465,34466,34467,34468,34469,34470,34475,34476,34482,34483,34484,34485,34486,34487,34488,34489,34490,34491,34492,34493,34494,34496,34497,34498,34499,34500,34502,34503,34506,34507,34508,34692,34753,34838,34839,34859,34860,34861,34908,34909,34910,34911,34912,34914,34935,34938,34939,34948,34949,34950,34954,35029,35030,35100,35102,35103,35104,35110,35111,35363,35364,35395,35396,35397,35446,35448,35449,35541,35550,35551,35552,35553,35578,35581,35691,35692,35693,36554,37116,37117,43338,44378,44379,44394,44395,44396,44397,44398,44399,44400,44402,44403,44404,44425,44440,44441,44442,44443,44445,44446,44448,44449,44457,44469,44470,44471,44472,44543,44545,44546,44548,44549,44557,44560,44561,44566,44567,44568,44570,44571,44572,44745,45234,45243,45244,46854,46855,46859,46860,46865,46866,46867,46908,46909,46910,46911,46913,46914,46915,46917,46924,46945,46949,46951,46952,46953,46968,47193,47195,47196,47197,47198,47199,47200,47201,47202,47203,47204,47205,47220,47221,47223,47230,47231,47236,47237,47238,47239,47240,47245,47246,47247,47258,47259,47260,47266,47267,47268,47269,47270,47294,47295,47296,47507,47508,47509,47511,47515,47516,47517,47535,47536,47537,47538,47539,47540,47549,47551,47552,47555,47556,47557,47558,47559,47560,47562,47564,47565,47566,47567,47569,47570,47571,47572,47573,47577,47578,47580,47581,47582,47585,47586,47587,47588,47788,48079,48080,48081,48181,48384,48389,48392,48393,48395,48396,48409,48410,48411,48412,48432,48433,48434,48438,48483,48484,48485,48488,48489,48491,48492,48494,48495,48496,48499,48500,48505,48506,48510,48511,48514,48516,48521,48525,48532,48535,48536,48537,48539,48544,48545,48962,48963,48965,48977,48978,48979,48982,48985,48987,48988,48997,49004,49005,49006,49013,49015,49016,49018,49023,49024,49027,49028,49032,49036,49039,49042,49137,49140,49143,49145,49146,49149,49157,49158,49175,49182,49184,49186,49188,49189,49194,49200,49202,49203,49206,49208,49217,49219,49220,49222,49223,49224,49226,49377,49390,49391,49392,49393,49394,49395,49455,49467,49471,49477,49478,49479,49480,49483,49488,49489,49490,49491,49495,49497,49500,49501,49503,49504,49508,49509,49526,49529,49530,49531,49532,49533,49534,49538,49542,49543,49562,49564,49565,49567,49568,49571,49572,49588,49589,49599,49610,49611,49612,49614,49627,49628,49631,49632,49633,49635,49636,49638,49654,49655,49657,49661,49662,49663,49664,49786,49787,49788,49789,49790,49791,49796,50029,50031,50033,50034,50040,50041,50043,50115,50117,50118,50119,50120,50121,50127,50128,50129,50130,50137,50138,50147,50148,50149,50150,50151,50152,50154,50187,50190,50191,50334,50365,50371,50384,50385,50391,50392,50516,50685,50686,50687,50720,50796,50880,50884,50885,50886,50887,51052,51099,51108,51109,51123,51127,51128,51129,51130,51160,51161,51166,51167,51179,51180,51181,51182,51183,51267,51268,51269,51271,51456,51459,51462,51463,51464,51465,51466,51468,51470,51472,51473,51474,51478,51479,51480,51481,51482,51483,51485,51486,51490,51521,51522,51523,51524,51525,51526,51527,51528,51529,51530,51531,51532,51533,51554,51555,51556,51557,51558,51560,51561,51562,51563,51564,51565,51566,51625,51626,51627,51628,51629,51632,51633,51634,51635,51636,51662,51664,51665,51667,51668,51669,51672,51674,51679,51682,51685,51686,51687,51688,51689,51690,51692,51696,51698,51700,51701,51708,51709,51710,51711,51712,51713,51745,51746,51881,51883,51884,51885,51886,52143,52234,52456,52783,52785,52786,52787,52788,52795,52797,52798,52799,52800,52802,52803,52825,52858,52858,52858,53137,53138,53175,53176,53178,53179,53180,53181,53182,53182,53182,53183,53183,53183,53184,53184,53184,53186,53187,53203,53204,53205,53209,53215,53216,53217,53221,53222,53224,53228,53232,53234,53237,53238,53241,53243,53244,53245,53246,53252,53253,53256,53259,53260,53262,53263,53264,53265,53270,53290,53291,53292,53293,53294,53295,53296,53297,53298,53299,53301,53302,53303,53304,53375,53376,53379,53380,53381,53382,53383,53384,53385,53401,53409,53409,53409,53411,53411,53411,53426,53427,53427,53427,53429,53429,53429,53430,53430,53430,53434,53450,53451,53476,53477,53478,53480,53481,53482,53483,53484,53485,53486,53488,53490,53497,53501,53502,53503,53508,53511,53512,53514,53516,53517,53519,53527,53530,53551,53552,53553,53554,53555,53556,53557,53563,53569,53576,53583,53585,53590,53591,53592,53595,53620,53621,53622,53648,53660,53661,53671,53673,53695,53696,53709,53710,53711,53754,53759,54037,54038,54044,54117,54118,54151,54154,54155,54347,54348,54349,54354,54486,54488,54489,54490,54637,54638,54639,54646,54658,54659,54734,54747,54749,54787,55050,55061,55062,55090,55091,55092,55094,55107,55108,55129,55130,55131,55132,55133,55136,55198,55225,55226,55233,55236,55237,55339,55340,55610,55620,55623,55666,55667,55668,55669,55670,55709,56314,56315,56316,56317,56318,56333,56336,56337,56339,56340,56341,56342,56343,56344,56611,56612,56613,56614,56636,56637,56638,56822,56834,56835,56924,56927,56929,56930,56931,56932,57470,57472,57499,57810,57811,57812,57813,57814,57849,57850,57851,57865,57873,57876,57877,57878,57880,57881,58410,58413,58414,58415,58422,58423,58424,58425,58426,58435,58436,58437,58872,58874,59057,59088,59089,59295,59296,59297,59298,59672,59738,59739,59740,59741,60103,60184,60185,60187,60188,60970,61154,61155,61156,61157,61158,61216,61221,61222,61295,61329,61330,61331,61336,61345,61346,61433,61434,61680,61680,61680,61681,61681,61681,61682,61682,61682,61683,61683,61683,61684,61684,61685,61685,61686,61686,61686,61687,61687,61687,61688,61688,61688,61689,61689,61689,61690,61690,61690,62097,62098,62099,62100,62101,62758,62759,62760,62762,62764,62765,62905,62908,63108,63117,63121,63123,63156,63158,63245,63349,63350,63351,63370,63372,63373,63374,63410,63411,63457,63458,63503,63504,63505,63506,63534,63542,63543,63560,63574,63625,63626,63627,63646,63647,63648,63649,63650,63730,63733,63737,63900,64044,64127,64129,64205,64353,64357,64976,65139); +/* Drethek - This should be all talents without major rank of learned spells: */ +DELETE FROM `character_spell` WHERE `spell` IN (724,974,1329,5570,5923,5924,5925,5926,5952,9452,9453,9799,10060,11069,11070,11071,11078,11080,11083,11094,11095,11100,11103,11108,11113,11115,11119,11120,11124,11129,11151,11160,11170,11175,11180,11185,11189,11190,11207,11210,11213,11222,11232,11237,11242,11247,11252,11255,11366,11367,11368,11426,11958,12042,12043,12163,12281,12282,12284,12285,12286,12287,12289,12290,12292,12294,12295,12296,12297,12298,12299,12300,12301,12308,12311,12312,12313,12317,12318,12319,12320,12321,12322,12323,12324,12328,12329,12330,12338,12339,12340,12341,12349,12350,12351,12353,12357,12358,12378,12398,12399,12400,12463,12464,12467,12469,12472,12473,12487,12488,12489,12490,12496,12497,12500,12501,12502,12503,12518,12519,12569,12571,12574,12575,12576,12577,12592,12598,12605,12606,12658,12663,12664,12665,12666,12668,12672,12676,12677,12697,12700,12701,12702,12703,12704,12711,12712,12724,12725,12726,12727,12750,12751,12752,12753,12761,12762,12763,12764,12781,12783,12784,12785,12797,12799,12803,12804,12809,12810,12811,12812,12813,12814,12815,12818,12834,12835,12839,12840,12846,12847,12848,12849,12852,12853,12855,12856,12857,12858,12860,12861,12862,12867,12872,12873,12876,12877,12878,12879,12950,12952,12953,12958,12959,12960,12963,12971,12972,12973,12974,12975,12982,12983,12999,13000,13001,13002,13043,13045,13046,13047,13048,13705,13706,13709,13712,13713,13715,13732,13733,13741,13742,13743,13750,13754,13788,13789,13792,13793,13800,13801,13802,13803,13804,13805,13806,13807,13832,13843,13844,13845,13848,13849,13851,13852,13853,13854,13863,13865,13866,13867,13872,13875,13877,13958,13960,13961,13962,13963,13964,13970,13971,13975,13976,13979,13980,13981,13983,14057,14062,14063,14066,14070,14071,14072,14076,14079,14080,14082,14083,14094,14113,14114,14115,14116,14117,14128,14132,14135,14136,14137,14138,14139,14140,14141,14142,14144,14148,14156,14158,14159,14160,14161,14162,14163,14164,14165,14166,14168,14169,14171,14172,14173,14174,14175,14176,14177,14179,14183,14185,14186,14190,14193,14194,14195,14251,14278,14520,14521,14522,14523,14531,14747,14748,14749,14750,14751,14767,14768,14769,14770,14771,14772,14774,14776,14777,14780,14781,14784,14785,14788,14789,14790,14791,14889,14892,14898,14901,14908,14909,14910,14911,14912,14913,14983,15008,15009,15010,15011,15012,15013,15014,15017,15018,15020,15028,15029,15030,15031,15047,15058,15059,15060,15257,15259,15260,15270,15272,15273,15274,15275,15286,15307,15308,15309,15310,15311,15312,15313,15314,15316,15317,15318,15320,15327,15328,15331,15332,15335,15336,15337,15338,15349,15354,15355,15356,15362,15363,15392,15407,15448,15473,15487,16035,16038,16039,16040,16041,16043,16086,16089,16105,16106,16107,16108,16109,16110,16111,16112,16113,16114,16115,16116,16130,16160,16161,16164,16166,16173,16176,16178,16179,16180,16181,16182,16184,16187,16188,16190,16194,16196,16198,16205,16206,16209,16210,16211,16212,16213,16214,16215,16216,16217,16218,16219,16220,16221,16222,16223,16224,16225,16226,16227,16228,16229,16230,16232,16235,16240,16252,16254,16255,16256,16258,16259,16261,16262,16266,16268,16271,16272,16281,16282,16283,16284,16287,16290,16293,16295,16302,16303,16304,16305,16306,16307,16308,16309,16462,16463,16464,16465,16466,16487,16489,16492,16493,16494,16511,16513,16514,16515,16538,16539,16540,16541,16542,16544,16578,16579,16580,16581,16582,16757,16758,16763,16765,16766,16769,16770,16814,16815,16816,16817,16818,16819,16820,16821,16822,16833,16834,16835,16836,16839,16840,16845,16846,16847,16850,16858,16859,16860,16861,16862,16864,16880,16896,16897,16899,16909,16910,16911,16912,16913,16923,16924,16929,16930,16931,16934,16935,16936,16937,16938,16940,16941,16942,16943,16944,16947,16948,16949,16966,16968,16972,16974,16975,16998,16999,17002,17003,17004,17005,17006,17007,17050,17051,17056,17058,17059,17060,17061,17063,17065,17066,17069,17070,17071,17072,17073,17074,17075,17076,17077,17078,17104,17106,17107,17108,17111,17112,17113,17116,17118,17119,17120,17123,17124,17191,17322,17323,17364,17485,17486,17487,17488,17489,17778,17779,17780,17783,17784,17785,17788,17789,17790,17791,17792,17793,17796,17801,17802,17803,17804,17805,17810,17811,17812,17813,17814,17815,17833,17834,17877,17917,17918,17927,17929,17930,17954,17955,17956,17957,17958,17959,17962,18073,18094,18095,18096,18119,18120,18126,18127,18130,18135,18136,18174,18175,18176,18179,18180,18182,18183,18213,18218,18219,18220,18223,18271,18272,18273,18274,18275,18288,18372,18427,18428,18429,18459,18460,18462,18463,18464,18530,18531,18533,18534,18535,18551,18552,18553,18554,18555,18562,18692,18693,18694,18695,18696,18697,18698,18699,18703,18704,18705,18706,18707,18708,18709,18710,18731,18743,18744,18754,18755,18756,18767,18768,18769,18770,18771,18772,18773,18827,18829,19028,19159,19160,19168,19180,19181,19184,19236,19255,19256,19257,19258,19259,19286,19287,19290,19294,19295,19297,19298,19306,19370,19371,19373,19376,19386,19387,19388,19407,19412,19416,19417,19418,19419,19420,19421,19422,19423,19426,19427,19429,19430,19431,19434,19454,19455,19456,19461,19462,19464,19465,19466,19485,19487,19488,19489,19490,19498,19499,19500,19503,19506,19507,19508,19509,19549,19550,19551,19552,19553,19554,19555,19556,19559,19560,19572,19573,19574,19575,19577,19578,19583,19584,19585,19586,19587,19590,19592,19598,19599,19600,19601,19602,19609,19610,19612,19616,19617,19618,19619,19620,19621,19622,19623,19624,19625,20042,20045,20049,20056,20057,20060,20061,20062,20063,20064,20066,20096,20097,20098,20099,20100,20101,20102,20103,20104,20105,20111,20112,20113,20117,20118,20119,20120,20121,20127,20130,20135,20138,20139,20140,20143,20144,20145,20146,20147,20174,20175,20177,20179,20180,20181,20182,20196,20197,20198,20205,20206,20207,20208,20209,20210,20212,20213,20214,20215,20216,20224,20225,20234,20235,20237,20238,20239,20243,20244,20245,20254,20255,20256,20257,20258,20259,20260,20261,20262,20263,20264,20265,20266,20330,20331,20332,20335,20336,20337,20359,20360,20361,20375,20468,20469,20470,20473,20487,20488,20496,20500,20501,20502,20503,20504,20505,20711,20895,20911,20925,23584,23585,23586,23587,23588,23695,23785,23822,23823,23824,23825,23881,23989,24283,24296,24297,24443,24691,24858,24866,24894,24943,24944,24945,24946,24968,24969,24970,24971,24972,25829,25836,25956,25957,25988,26016,26022,26023,27789,27790,27811,27815,27816,27839,27840,27900,27901,27902,27903,27904,28332,28574,28592,28593,28996,28997,28998,28999,29000,29062,29064,29065,29074,29075,29076,29079,29080,29082,29084,29086,29140,29143,29144,29179,29180,29187,29189,29191,29192,29193,29202,29205,29206,29438,29439,29440,29441,29444,29447,29590,29591,29592,29593,29594,29598,29599,29623,29721,29723,29724,29725,29759,29760,29761,29762,29763,29776,29787,29790,29792,29801,29834,29836,29838,29859,29888,29889,30054,30057,30060,30061,30062,30063,30064,30108,30143,30144,30145,30146,30160,30242,30245,30246,30247,30248,30283,30288,30289,30290,30291,30292,30293,30295,30296,30299,30301,30302,30319,30320,30321,30326,30664,30665,30666,30672,30673,30674,30675,30678,30679,30706,30798,30802,30808,30809,30812,30813,30814,30816,30818,30819,30823,30864,30865,30866,30867,30868,30869,30872,30873,30881,30883,30884,30885,30886,30892,30893,30894,30895,30902,30903,30904,30905,30906,30919,30920,31122,31123,31124,31126,31130,31131,31208,31209,31211,31212,31213,31216,31217,31218,31219,31220,31221,31222,31223,31226,31227,31228,31229,31230,31244,31245,31380,31382,31383,31569,31570,31571,31572,31574,31575,31579,31582,31583,31584,31585,31586,31587,31588,31589,31638,31639,31640,31641,31642,31656,31657,31658,31661,31667,31668,31669,31670,31672,31674,31675,31676,31677,31678,31679,31680,31682,31683,31687,31785,31821,31822,31823,31825,31826,31828,31829,31830,31833,31835,31836,31837,31838,31839,31840,31841,31842,31844,31845,31848,31849,31850,31851,31852,31858,31859,31860,31866,31867,31868,31869,31871,31872,31876,31877,31878,31879,31880,31881,31935,32043,32381,32382,32383,32385,32387,32392,32393,32394,32477,32483,32484,32601,33142,33145,33146,33150,33154,33158,33159,33160,33161,33162,33167,33171,33172,33186,33190,33191,33192,33193,33201,33202,33206,33213,33214,33215,33221,33222,33223,33224,33225,33371,33589,33590,33591,33592,33596,33597,33599,33600,33601,33602,33603,33604,33605,33606,33607,33776,33831,33851,33852,33853,33855,33856,33859,33866,33867,33872,33873,33879,33880,33881,33882,33883,33886,33887,33888,33889,33890,33917,33956,33957,34151,34152,34153,34293,34295,34296,34297,34300,34453,34454,34455,34459,34460,34462,34464,34465,34466,34467,34468,34469,34470,34475,34476,34482,34483,34484,34485,34486,34487,34488,34489,34490,34491,34492,34493,34494,34496,34497,34498,34499,34500,34502,34503,34506,34507,34508,34692,34753,34838,34839,34859,34860,34861,34908,34909,34910,34914,34935,34938,34939,34948,34949,34950,34954,35029,35030,35100,35102,35104,35110,35111,35363,35364,35395,35396,35397,35446,35448,35449,35541,35550,35551,35552,35553,35578,35581,35691,35692,35693,36554,37116,37117,43338,44378,44379,44394,44395,44396,44397,44398,44399,44400,44402,44403,44404,44425,44442,44443,44445,44446,44448,44449,44457,44469,44470,44471,44472,44543,44545,44546,44548,44549,44557,44560,44561,44566,44567,44568,44570,44571,44572,44745,45234,45243,45244,46854,46855,46859,46860,46865,46866,46867,46908,46909,46910,46911,46913,46914,46915,46917,46924,46945,46949,46951,46952,46953,46968,47193,47195,47196,47197,47198,47199,47200,47201,47202,47203,47204,47205,47220,47221,47223,47230,47231,47236,47237,47238,47239,47240,47245,47246,47247,47258,47259,47260,47266,47267,47268,47269,47270,47294,47295,47296,47507,47508,47509,47511,47515,47516,47517,47535,47536,47537,47540,47558,47559,47560,47562,47564,47565,47566,47567,47569,47570,47573,47577,47578,47580,47581,47582,47585,47586,47587,47588,47788,48181,48384,48389,48392,48393,48395,48396,48409,48410,48411,48412,48432,48433,48434,48438,48483,48484,48485,48488,48489,48491,48492,48494,48495,48496,48499,48500,48505,48506,48510,48511,48514,48516,48521,48525,48532,48535,48536,48537,48539,48544,48545,48962,48963,48965,48977,48978,48979,48982,48985,48987,48988,48997,49004,49005,49006,49013,49015,49016,49018,49023,49024,49027,49028,49032,49036,49039,49042,49137,49140,49143,49145,49146,49149,49158,49175,49182,49184,49186,49188,49189,49194,49200,49202,49203,49206,49208,49217,49219,49220,49222,49223,49224,49226,49377,49390,49391,49392,49393,49394,49395,49455,49467,49471,49477,49478,49479,49480,49483,49488,49489,49490,49491,49495,49497,49500,49501,49503,49504,49508,49509,49526,49529,49530,49533,49534,49538,49542,49543,49562,49564,49565,49567,49568,49571,49572,49588,49589,49599,49610,49611,49627,49628,49631,49632,49633,49635,49636,49638,49654,49655,49657,49661,49662,49663,49664,49786,49787,49788,49789,49790,49791,49796,50029,50031,50033,50034,50040,50041,50043,50115,50117,50118,50119,50120,50121,50127,50128,50129,50130,50137,50138,50147,50149,50150,50151,50152,50154,50187,50190,50191,50334,50365,50371,50384,50385,50391,50392,50516,50685,50686,50687,50720,50796,50880,50884,50885,50886,50887,51052,51099,51108,51109,51123,51127,51128,51129,51130,51160,51161,51166,51167,51179,51180,51181,51182,51183,51267,51268,51269,51271,51456,51459,51462,51463,51464,51465,51466,51468,51470,51472,51473,51474,51478,51479,51480,51481,51482,51483,51485,51486,51490,51521,51522,51523,51524,51525,51526,51527,51528,51529,51530,51531,51532,51533,51554,51555,51556,51557,51558,51560,51561,51562,51563,51564,51565,51566,51625,51626,51627,51628,51629,51632,51633,51634,51635,51636,51662,51664,51665,51667,51668,51669,51672,51674,51679,51682,51685,51686,51687,51688,51689,51690,51692,51696,51698,51700,51701,51708,51709,51710,51711,51712,51713,51745,51746,51881,51883,51884,51885,51886,52143,52456,52783,52785,52786,52787,52788,52795,52797,52798,52799,52800,52802,52803,53137,53138,53209,53215,53216,53217,53221,53222,53224,53228,53232,53234,53237,53238,53241,53243,53244,53245,53246,53252,53253,53256,53259,53260,53262,53263,53264,53265,53270,53290,53291,53292,53295,53296,53297,53298,53299,53301,53302,53303,53304,53375,53376,53379,53380,53381,53382,53385,53484,53486,53488,53501,53502,53503,53519,53527,53530,53551,53552,53553,53556,53557,53563,53569,53576,53583,53585,53590,53591,53592,53595,53620,53621,53622,53648,53660,53661,53671,53673,53695,53696,53709,53710,53711,53754,53759,54037,54038,54117,54118,54151,54154,54155,54347,54348,54349,54354,54486,54488,54489,54490,54637,54638,54639,54646,54658,54659,54734,54747,54749,54787,55050,55061,55062,55090,55091,55092,55094,55107,55108,55129,55130,55131,55132,55133,55136,55198,55225,55226,55233,55236,55237,55339,55340,55610,55620,55623,55666,55667,56314,56315,56316,56317,56318,56333,56336,56337,56339,56340,56341,56342,56343,56344,56611,56612,56613,56614,56636,56637,56638,56822,56834,56835,56924,56927,56929,56930,56931,56932,57470,57472,57499,57810,57811,57812,57813,57814,57849,57850,57851,57865,57873,57876,57877,57878,57880,57881,58410,58413,58414,58415,58422,58423,58424,58425,58426,58435,58872,58874,59057,59088,59089,59672,59738,59739,59740,59741,60103,60184,60185,60187,60188,60970,61154,61155,61156,61157,61158,61216,61221,61222,61295,61329,61330,61331,61336,61345,61346,62097,62098,62099,62100,62101,62905,62908,63108,63117,63121,63123,63156,63158,63245,63349,63350,63351,63370,63372,63373,63374,63410,63411,63457,63458,63503,63504,63505,63506,63534,63542,63543,63560,63574,63625,63626,63627,63646,63647,63648,63649,63650,63730,63733,63737,64044,64127,64129,64205,64353,64357,64976,65139,65661,66191,66192,66799,66814,66815,66816,66817); + +/* XTElite1 - Talents that teach an initial skill, and you learn higher ranks from a trainer. Here's a cleanup query that will remove all those: */ +DELETE FROM `character_spell` WHERE `spell` IN (12505,12522,12523,12524,12525,12526,13018,13019,13020,13021,13031,13032,13033,16979,17311,17312,17313,17314,17347,17348,18807,18809,18867,18868,18869,18870,18871,18937,18938,19238,19240,19241,19242,19243,20900,20901,20902,20903,20904,20909,20910,21551,21552,21553,24132,24133,24974,24975,24976,24977,25248,25387,25437,26864,27013,27065,27067,27068,27132,27133,27134,27263,27265,27870,27871,28275,30016,30022,30330,30404,30405,30413,30414,30546,32593,32594,33041,33042,33043,33405,33876,33878,33933,33938,33982,33983,33986,33987,34411,34412,34413,34863,34864,34865,34866,34916,34917,42890,42891,42944,42945,42949,42950,43038,43039,44780,44781,47485,47486,47497,47498,47826,47827,47841,47843,47846,47847,48086,48087,48088,48089,48155,48156,48159,48160,48172,48173,48468,48563,48564,48565,48566,48660,48663,48666,48998,48999,49011,49012,49049,49050,49283,49284,49376,53005,53006,53007,53199,53200,53201,53223,53225,53226,53227,53248,53249,53251,55359,55360,57720,57721,57722,59092,59156,59158,59159,59161,59163,59164,59170,59171,59172,60051,60052,60053,61299,61300,61301,61384); + ALTER TABLE `characters` ADD `speccount` tinyint(3) unsigned NOT NULL default 1 AFTER `arena_pending_points`; ALTER TABLE `characters` ADD `activespec` tinyint(3) unsigned NOT NULL default 0 AFTER `speccount`; diff --git a/sql/updates/5084_character_updates_dual_spec.sql b/sql/updates/5084_character_updates_dual_spec.sql deleted file mode 100644 index c6cdacf0d69..00000000000 --- a/sql/updates/5084_character_updates_dual_spec.sql +++ /dev/null @@ -1,9 +0,0 @@ - -/* Begin intentional error */ -"Run 5084_character_updates_dual_spec.sql manually, or don't run it at all. This is only intended for people who need to clean up missed talents from r5036. If you never used r5036 - 5083, ignore this."; - -/* This is what you're supposed to run manually, for those of you reading this: - -DELETE FROM `character_spell` WHERE `spell` IN (12505,12522,12523,12524,12525,12526,13018,13019,13020,13021,13031,13032,13033,17311,17312,17313,17314,17347,17348,18807,18809,18867,18868,18869,18870,18871,18937,18938,19238,19240,19241,19242,19243,20900,20901,20902,20903,20904,20909,20910,20929,20930,21551,21552,21553,24132,24133,24974,24975,24976,24977,25248,25387,25437,25899,26864,27013,27065,27067,27068,27132,27133,27134,27174,27263,27265,27870,27871,28275,30016,30022,30330,30404,30405,30413,30414,30546,32593,32594,32699,32700,33041,33042,33043,33072,33405,33891,33933,33938,33982,33983,33986,33987,34411,34412,34413,34863,34864,34865,34866,34916,34917,42890,42891,42944,42945,42949,42950,43038,43039,44780,44781,47485,47486,47497,47498,47826,47827,47841,47843,47846,47847,48086,48087,48088,48089,48155,48156,48159,48160,48172,48173,48468,48563,48564,48565,48566,48660,48663,48666,48824,48825,48826,48827,48998,48999,49011,49012,49049,49050,49283,49284,51325,51326,51327,51328,51376,51378,51379,51409,51410,51411,51416,51417,51418,51419,53005,53006,53007,53199,53200,53201,53223,53225,53226,53248,53249,53251,55258,55259,55260,55261,55262,55265,55268,55270,55271,55359,55360,57720,57721,57722,59092,59156,59158,59159,59161,59163,59164,59170,59171,59172,60051,61299,61300,61301,61384,63668,63669,63670,63671,63672,66052,66053); - -*/ diff --git a/sql/updates/5097_character_updates_dual_spec.sql b/sql/updates/5097_character_updates_dual_spec.sql new file mode 100644 index 00000000000..13f5f4b6d20 --- /dev/null +++ b/sql/updates/5097_character_updates_dual_spec.sql @@ -0,0 +1,13 @@ + +/* Begin intentional error */ +"Run 5097_character_updates_dual_spec.sql manually, or don't run it at all. This is only intended for people who need to clean up missed skills from r5036. If you never used r5036 - 5096, ignore this. Tell your users to reset their talents (or just switch specs) to fix their talent points."; + +/* + +-- Drethek - This should be all talents without a learned spell as a major rank: +DELETE FROM `character_spell` WHERE `spell` IN (724,974,1329,5570,5923,5924,5925,5926,5952,9452,9453,9799,10060,11069,11070,11071,11078,11080,11083,11094,11095,11100,11103,11108,11113,11115,11119,11120,11124,11129,11151,11160,11170,11175,11180,11185,11189,11190,11207,11210,11213,11222,11232,11237,11242,11247,11252,11255,11366,11367,11368,11426,11958,12042,12043,12163,12281,12282,12284,12285,12286,12287,12289,12290,12292,12294,12295,12296,12297,12298,12299,12300,12301,12308,12311,12312,12313,12317,12318,12319,12320,12321,12322,12323,12324,12328,12329,12330,12338,12339,12340,12341,12349,12350,12351,12353,12357,12358,12378,12398,12399,12400,12463,12464,12467,12469,12472,12473,12487,12488,12489,12490,12496,12497,12500,12501,12502,12503,12518,12519,12569,12571,12574,12575,12576,12577,12592,12598,12605,12606,12658,12663,12664,12665,12666,12668,12672,12676,12677,12697,12700,12701,12702,12703,12704,12711,12712,12724,12725,12726,12727,12750,12751,12752,12753,12761,12762,12763,12764,12781,12783,12784,12785,12797,12799,12803,12804,12809,12810,12811,12812,12813,12814,12815,12818,12834,12835,12839,12840,12846,12847,12848,12849,12852,12853,12855,12856,12857,12858,12860,12861,12862,12867,12872,12873,12876,12877,12878,12879,12950,12952,12953,12958,12959,12960,12963,12971,12972,12973,12974,12975,12982,12983,12999,13000,13001,13002,13043,13045,13046,13047,13048,13705,13706,13709,13712,13713,13715,13732,13733,13741,13742,13743,13750,13754,13788,13789,13792,13793,13800,13801,13802,13803,13804,13805,13806,13807,13832,13843,13844,13845,13848,13849,13851,13852,13853,13854,13863,13865,13866,13867,13872,13875,13877,13958,13960,13961,13962,13963,13964,13970,13971,13975,13976,13979,13980,13981,13983,14057,14062,14063,14066,14070,14071,14072,14076,14079,14080,14082,14083,14094,14113,14114,14115,14116,14117,14128,14132,14135,14136,14137,14138,14139,14140,14141,14142,14144,14148,14156,14158,14159,14160,14161,14162,14163,14164,14165,14166,14168,14169,14171,14172,14173,14174,14175,14176,14177,14179,14183,14185,14186,14190,14193,14194,14195,14251,14278,14520,14521,14522,14523,14531,14747,14748,14749,14750,14751,14767,14768,14769,14770,14771,14772,14774,14776,14777,14780,14781,14784,14785,14788,14789,14790,14791,14889,14892,14898,14901,14908,14909,14910,14911,14912,14913,14983,15008,15009,15010,15011,15012,15013,15014,15017,15018,15020,15028,15029,15030,15031,15047,15058,15059,15060,15257,15259,15260,15270,15272,15273,15274,15275,15286,15307,15308,15309,15310,15311,15312,15313,15314,15316,15317,15318,15320,15327,15328,15331,15332,15335,15336,15337,15338,15349,15354,15355,15356,15362,15363,15392,15407,15448,15473,15487,16035,16038,16039,16040,16041,16043,16086,16089,16105,16106,16107,16108,16109,16110,16111,16112,16113,16114,16115,16116,16130,16160,16161,16164,16166,16173,16176,16178,16179,16180,16181,16182,16184,16187,16188,16190,16194,16196,16198,16205,16206,16209,16210,16211,16212,16213,16214,16215,16216,16217,16218,16219,16220,16221,16222,16223,16224,16225,16226,16227,16228,16229,16230,16232,16235,16240,16252,16254,16255,16256,16258,16259,16261,16262,16266,16268,16271,16272,16281,16282,16283,16284,16287,16290,16293,16295,16302,16303,16304,16305,16306,16307,16308,16309,16462,16463,16464,16465,16466,16487,16489,16492,16493,16494,16511,16513,16514,16515,16538,16539,16540,16541,16542,16544,16578,16579,16580,16581,16582,16757,16758,16763,16765,16766,16769,16770,16814,16815,16816,16817,16818,16819,16820,16821,16822,16833,16834,16835,16836,16839,16840,16845,16846,16847,16850,16858,16859,16860,16861,16862,16864,16880,16896,16897,16899,16909,16910,16911,16912,16913,16923,16924,16929,16930,16931,16934,16935,16936,16937,16938,16940,16941,16942,16943,16944,16947,16948,16949,16966,16968,16972,16974,16975,16998,16999,17002,17003,17004,17005,17006,17007,17050,17051,17056,17058,17059,17060,17061,17063,17065,17066,17069,17070,17071,17072,17073,17074,17075,17076,17077,17078,17104,17106,17107,17108,17111,17112,17113,17116,17118,17119,17120,17123,17124,17191,17322,17323,17364,17485,17486,17487,17488,17489,17778,17779,17780,17783,17784,17785,17788,17789,17790,17791,17792,17793,17796,17801,17802,17803,17804,17805,17810,17811,17812,17813,17814,17815,17833,17834,17877,17917,17918,17927,17929,17930,17954,17955,17956,17957,17958,17959,17962,18073,18094,18095,18096,18119,18120,18126,18127,18130,18135,18136,18174,18175,18176,18179,18180,18182,18183,18213,18218,18219,18220,18223,18271,18272,18273,18274,18275,18288,18372,18427,18428,18429,18459,18460,18462,18463,18464,18530,18531,18533,18534,18535,18551,18552,18553,18554,18555,18562,18692,18693,18694,18695,18696,18697,18698,18699,18703,18704,18705,18706,18707,18708,18709,18710,18731,18743,18744,18754,18755,18756,18767,18768,18769,18770,18771,18772,18773,18827,18829,19028,19159,19160,19168,19180,19181,19184,19236,19255,19256,19257,19258,19259,19286,19287,19290,19294,19295,19297,19298,19306,19370,19371,19373,19376,19386,19387,19388,19407,19412,19416,19417,19418,19419,19420,19421,19422,19423,19426,19427,19429,19430,19431,19434,19454,19455,19456,19461,19462,19464,19465,19466,19485,19487,19488,19489,19490,19498,19499,19500,19503,19506,19507,19508,19509,19549,19550,19551,19552,19553,19554,19555,19556,19559,19560,19572,19573,19574,19575,19577,19578,19583,19584,19585,19586,19587,19590,19592,19598,19599,19600,19601,19602,19609,19610,19612,19616,19617,19618,19619,19620,19621,19622,19623,19624,19625,20042,20045,20049,20056,20057,20060,20061,20062,20063,20064,20066,20096,20097,20098,20099,20100,20101,20102,20103,20104,20105,20111,20112,20113,20117,20118,20119,20120,20121,20127,20130,20135,20138,20139,20140,20143,20144,20145,20146,20147,20174,20175,20177,20179,20180,20181,20182,20196,20197,20198,20205,20206,20207,20208,20209,20210,20212,20213,20214,20215,20216,20224,20225,20234,20235,20237,20238,20239,20243,20244,20245,20254,20255,20256,20257,20258,20259,20260,20261,20262,20263,20264,20265,20266,20330,20331,20332,20335,20336,20337,20359,20360,20361,20375,20468,20469,20470,20473,20487,20488,20496,20500,20501,20502,20503,20504,20505,20711,20895,20911,20925,23584,23585,23586,23587,23588,23695,23785,23822,23823,23824,23825,23881,23989,24283,24296,24297,24443,24691,24858,24866,24894,24943,24944,24945,24946,24968,24969,24970,24971,24972,25829,25836,25956,25957,25988,26016,26022,26023,27789,27790,27811,27815,27816,27839,27840,27900,27901,27902,27903,27904,28332,28574,28592,28593,28996,28997,28998,28999,29000,29062,29064,29065,29074,29075,29076,29079,29080,29082,29084,29086,29140,29143,29144,29179,29180,29187,29189,29191,29192,29193,29202,29205,29206,29438,29439,29440,29441,29444,29447,29590,29591,29592,29593,29594,29598,29599,29623,29721,29723,29724,29725,29759,29760,29761,29762,29763,29776,29787,29790,29792,29801,29834,29836,29838,29859,29888,29889,30054,30057,30060,30061,30062,30063,30064,30108,30143,30144,30145,30146,30160,30242,30245,30246,30247,30248,30283,30288,30289,30290,30291,30292,30293,30295,30296,30299,30301,30302,30319,30320,30321,30326,30664,30665,30666,30672,30673,30674,30675,30678,30679,30706,30798,30802,30808,30809,30812,30813,30814,30816,30818,30819,30823,30864,30865,30866,30867,30868,30869,30872,30873,30881,30883,30884,30885,30886,30892,30893,30894,30895,30902,30903,30904,30905,30906,30919,30920,31122,31123,31124,31126,31130,31131,31208,31209,31211,31212,31213,31216,31217,31218,31219,31220,31221,31222,31223,31226,31227,31228,31229,31230,31244,31245,31380,31382,31383,31569,31570,31571,31572,31574,31575,31579,31582,31583,31584,31585,31586,31587,31588,31589,31638,31639,31640,31641,31642,31656,31657,31658,31661,31667,31668,31669,31670,31672,31674,31675,31676,31677,31678,31679,31680,31682,31683,31687,31785,31821,31822,31823,31825,31826,31828,31829,31830,31833,31835,31836,31837,31838,31839,31840,31841,31842,31844,31845,31848,31849,31850,31851,31852,31858,31859,31860,31866,31867,31868,31869,31871,31872,31876,31877,31878,31879,31880,31881,31935,32043,32381,32382,32383,32385,32387,32392,32393,32394,32477,32483,32484,32601,33142,33145,33146,33150,33154,33158,33159,33160,33161,33162,33167,33171,33172,33186,33190,33191,33192,33193,33201,33202,33206,33213,33214,33215,33221,33222,33223,33224,33225,33371,33589,33590,33591,33592,33596,33597,33599,33600,33601,33602,33603,33604,33605,33606,33607,33776,33831,33851,33852,33853,33855,33856,33859,33866,33867,33872,33873,33879,33880,33881,33882,33883,33886,33887,33888,33889,33890,33917,33956,33957,34151,34152,34153,34293,34295,34296,34297,34300,34453,34454,34455,34459,34460,34462,34464,34465,34466,34467,34468,34469,34470,34475,34476,34482,34483,34484,34485,34486,34487,34488,34489,34490,34491,34492,34493,34494,34496,34497,34498,34499,34500,34502,34503,34506,34507,34508,34692,34753,34838,34839,34859,34860,34861,34908,34909,34910,34914,34935,34938,34939,34948,34949,34950,34954,35029,35030,35100,35102,35104,35110,35111,35363,35364,35395,35396,35397,35446,35448,35449,35541,35550,35551,35552,35553,35578,35581,35691,35692,35693,36554,37116,37117,43338,44378,44379,44394,44395,44396,44397,44398,44399,44400,44402,44403,44404,44425,44442,44443,44445,44446,44448,44449,44457,44469,44470,44471,44472,44543,44545,44546,44548,44549,44557,44560,44561,44566,44567,44568,44570,44571,44572,44745,45234,45243,45244,46854,46855,46859,46860,46865,46866,46867,46908,46909,46910,46911,46913,46914,46915,46917,46924,46945,46949,46951,46952,46953,46968,47193,47195,47196,47197,47198,47199,47200,47201,47202,47203,47204,47205,47220,47221,47223,47230,47231,47236,47237,47238,47239,47240,47245,47246,47247,47258,47259,47260,47266,47267,47268,47269,47270,47294,47295,47296,47507,47508,47509,47511,47515,47516,47517,47535,47536,47537,47540,47558,47559,47560,47562,47564,47565,47566,47567,47569,47570,47573,47577,47578,47580,47581,47582,47585,47586,47587,47588,47788,48181,48384,48389,48392,48393,48395,48396,48409,48410,48411,48412,48432,48433,48434,48438,48483,48484,48485,48488,48489,48491,48492,48494,48495,48496,48499,48500,48505,48506,48510,48511,48514,48516,48521,48525,48532,48535,48536,48537,48539,48544,48545,48962,48963,48965,48977,48978,48979,48982,48985,48987,48988,48997,49004,49005,49006,49013,49015,49016,49018,49023,49024,49027,49028,49032,49036,49039,49042,49137,49140,49143,49145,49146,49149,49158,49175,49182,49184,49186,49188,49189,49194,49200,49202,49203,49206,49208,49217,49219,49220,49222,49223,49224,49226,49377,49390,49391,49392,49393,49394,49395,49455,49467,49471,49477,49478,49479,49480,49483,49488,49489,49490,49491,49495,49497,49500,49501,49503,49504,49508,49509,49526,49529,49530,49533,49534,49538,49542,49543,49562,49564,49565,49567,49568,49571,49572,49588,49589,49599,49610,49611,49627,49628,49631,49632,49633,49635,49636,49638,49654,49655,49657,49661,49662,49663,49664,49786,49787,49788,49789,49790,49791,49796,50029,50031,50033,50034,50040,50041,50043,50115,50117,50118,50119,50120,50121,50127,50128,50129,50130,50137,50138,50147,50149,50150,50151,50152,50154,50187,50190,50191,50334,50365,50371,50384,50385,50391,50392,50516,50685,50686,50687,50720,50796,50880,50884,50885,50886,50887,51052,51099,51108,51109,51123,51127,51128,51129,51130,51160,51161,51166,51167,51179,51180,51181,51182,51183,51267,51268,51269,51271,51456,51459,51462,51463,51464,51465,51466,51468,51470,51472,51473,51474,51478,51479,51480,51481,51482,51483,51485,51486,51490,51521,51522,51523,51524,51525,51526,51527,51528,51529,51530,51531,51532,51533,51554,51555,51556,51557,51558,51560,51561,51562,51563,51564,51565,51566,51625,51626,51627,51628,51629,51632,51633,51634,51635,51636,51662,51664,51665,51667,51668,51669,51672,51674,51679,51682,51685,51686,51687,51688,51689,51690,51692,51696,51698,51700,51701,51708,51709,51710,51711,51712,51713,51745,51746,51881,51883,51884,51885,51886,52143,52456,52783,52785,52786,52787,52788,52795,52797,52798,52799,52800,52802,52803,53137,53138,53209,53215,53216,53217,53221,53222,53224,53228,53232,53234,53237,53238,53241,53243,53244,53245,53246,53252,53253,53256,53259,53260,53262,53263,53264,53265,53270,53290,53291,53292,53295,53296,53297,53298,53299,53301,53302,53303,53304,53375,53376,53379,53380,53381,53382,53385,53484,53486,53488,53501,53502,53503,53519,53527,53530,53551,53552,53553,53556,53557,53563,53569,53576,53583,53585,53590,53591,53592,53595,53620,53621,53622,53648,53660,53661,53671,53673,53695,53696,53709,53710,53711,53754,53759,54037,54038,54117,54118,54151,54154,54155,54347,54348,54349,54354,54486,54488,54489,54490,54637,54638,54639,54646,54658,54659,54734,54747,54749,54787,55050,55061,55062,55090,55091,55092,55094,55107,55108,55129,55130,55131,55132,55133,55136,55198,55225,55226,55233,55236,55237,55339,55340,55610,55620,55623,55666,55667,56314,56315,56316,56317,56318,56333,56336,56337,56339,56340,56341,56342,56343,56344,56611,56612,56613,56614,56636,56637,56638,56822,56834,56835,56924,56927,56929,56930,56931,56932,57470,57472,57499,57810,57811,57812,57813,57814,57849,57850,57851,57865,57873,57876,57877,57878,57880,57881,58410,58413,58414,58415,58422,58423,58424,58425,58426,58435,58872,58874,59057,59088,59089,59672,59738,59739,59740,59741,60103,60184,60185,60187,60188,60970,61154,61155,61156,61157,61158,61216,61221,61222,61295,61329,61330,61331,61336,61345,61346,62097,62098,62099,62100,62101,62905,62908,63108,63117,63121,63123,63156,63158,63245,63349,63350,63351,63370,63372,63373,63374,63410,63411,63457,63458,63503,63504,63505,63506,63534,63542,63543,63560,63574,63625,63626,63627,63646,63647,63648,63649,63650,63730,63733,63737,64044,64127,64129,64205,64353,64357,64976,65139,65661,66191,66192,66799,66814,66815,66816,66817); + +-- XTElite1 - Talents that teach an initial skill, and you learn higher ranks from a trainer. Here's a cleanup query that will remove all those: +DELETE FROM `character_spell` WHERE `spell` IN (12505,12522,12523,12524,12525,12526,13018,13019,13020,13021,13031,13032,13033,16979,17311,17312,17313,17314,17347,17348,18807,18809,18867,18868,18869,18870,18871,18937,18938,19238,19240,19241,19242,19243,20900,20901,20902,20903,20904,20909,20910,21551,21552,21553,24132,24133,24974,24975,24976,24977,25248,25387,25437,26864,27013,27065,27067,27068,27132,27133,27134,27263,27265,27870,27871,28275,30016,30022,30330,30404,30405,30413,30414,30546,32593,32594,33041,33042,33043,33405,33876,33878,33933,33938,33982,33983,33986,33987,34411,34412,34413,34863,34864,34865,34866,34916,34917,42890,42891,42944,42945,42949,42950,43038,43039,44780,44781,47485,47486,47497,47498,47826,47827,47841,47843,47846,47847,48086,48087,48088,48089,48155,48156,48159,48160,48172,48173,48468,48563,48564,48565,48566,48660,48663,48666,48998,48999,49011,49012,49049,49050,49283,49284,49376,53005,53006,53007,53199,53200,53201,53223,53225,53226,53227,53248,53249,53251,55359,55360,57720,57721,57722,59092,59156,59158,59159,59161,59163,59164,59170,59171,59172,60051,60052,60053,61299,61300,61301,61384); + +*/ -- cgit v1.2.3 From 68e0c6fcbdc54dab725dbef2369d78d07477c29b Mon Sep 17 00:00:00 2001 From: maximius Date: Sun, 16 Aug 2009 14:36:56 -0700 Subject: *Just in case this gets run twice without recreating `npc_option`.. --HG-- branch : trunk --- sql/FULL/world_script_texts.sql | 1 + 1 file changed, 1 insertion(+) (limited to 'sql') diff --git a/sql/FULL/world_script_texts.sql b/sql/FULL/world_script_texts.sql index e833bc9024d..fd2cc390d85 100644 --- a/sql/FULL/world_script_texts.sql +++ b/sql/FULL/world_script_texts.sql @@ -2030,4 +2030,5 @@ INSERT INTO `npc_text` (`ID`, `text0_0`, `text0_1`, `lang0`, `prob0`, `em0_0`, ` -- Dual Spec `npc_option` change UPDATE `npc_option` SET `id`=52,`action`=19 WHERE `id`=51 AND `action`=18 AND `option_text`='UNIT_NPC_FLAG_OUTDOORPVP'; +DELETE FROM `npc_option` WHERE `id`=51 AND `action`=16 AND `option_text`='Purchase a Dual Talent Specialization.'; INSERT INTO `npc_option` (`id`, `gossip_id`, `npcflag`, `icon`, `action`, `box_money`, `coded`, `option_text`, `box_text`) values('51','0','16','2','18','10000000','0','Purchase a Dual Talent Specialization.','Are you sure you wish to purchase a Dual Talent Specialization?'); -- cgit v1.2.3 From cad925e31d0cf71ead219d717ce34e6fea8be251 Mon Sep 17 00:00:00 2001 From: Kudlaty Date: Mon, 17 Aug 2009 00:29:53 +0200 Subject: Merge [SD2] r1326 Correct waypoints and details for quest 863 r1327 Add function GetPlayerForEscort to escortAI (not used by escortAI yet) r1328 Updated 0.12 patch and redesigned Karathress for better maintenance. Fixed an issue with Karathres's speech and a little casting bug. - skip r1329 Remove use of old uint64 variable for player guid in escortAI and use function to retrieve pointer to player instead. r1330 Restore compile and use FailQuest instead of no longer existing FailTimedQuest (ref Mangos 8355). Move all waypoints to db --HG-- branch : trunk --- sql/FULL/world_script_waypoints.sql | 312 +++++++++++++++++++++ sql/updates/5105_world_scripts.sql | 311 ++++++++++++++++++++ src/bindings/scripts/base/escort_ai.cpp | 14 +- src/bindings/scripts/base/escort_ai.h | 9 +- .../scripts/eastern_kingdoms/arathi_highlands.cpp | 5 +- .../scripts/eastern_kingdoms/eversong_woods.cpp | 13 +- .../scripts/eastern_kingdoms/ghostlands.cpp | 2 +- .../scripts/eastern_kingdoms/hinterlands.cpp | 6 +- .../scarlet_enclave/the_scarlet_enclave.cpp | 2 +- .../scripts/eastern_kingdoms/silverpine_forest.cpp | 34 +-- .../scripts/scripts/eastern_kingdoms/westfall.cpp | 4 +- .../scripts/scripts/eastern_kingdoms/wetlands.cpp | 6 +- .../scripts/scripts/examples/example_escort.cpp | 16 +- .../scripts/scripts/kalimdor/ashenvale.cpp | 12 +- .../scripts/scripts/kalimdor/azuremyst_isle.cpp | 2 +- .../old_hillsbrad/old_hillsbrad.cpp | 9 +- .../scripts/scripts/kalimdor/darkshore.cpp | 7 +- src/bindings/scripts/scripts/kalimdor/feralas.cpp | 2 +- .../kalimdor/razorfen_kraul/razorfen_kraul.cpp | 66 +---- .../scripts/kalimdor/stonetalon_mountains.cpp | 6 +- src/bindings/scripts/scripts/kalimdor/tanaris.cpp | 104 +------ .../scripts/scripts/kalimdor/the_barrens.cpp | 195 +++++++------ .../scripts/scripts/kalimdor/thousand_needles.cpp | 6 +- .../scripts/scripts/kalimdor/ungoro_crater.cpp | 79 +----- .../scripts/scripts/northrend/sholazar_basin.cpp | 11 +- .../scripts/scripts/outland/hellfire_peninsula.cpp | 6 +- .../scripts/scripts/outland/netherstorm.cpp | 55 +--- .../scripts/scripts/outland/shadowmoon_valley.cpp | 12 +- .../scripts/scripts/outland/shattrath_city.cpp | 82 +++--- .../scripts/scripts/outland/terokkar_forest.cpp | 82 +----- .../scripts/scripts/outland/zangarmarsh.cpp | 16 +- 31 files changed, 888 insertions(+), 598 deletions(-) create mode 100644 sql/updates/5105_world_scripts.sql (limited to 'sql') diff --git a/sql/FULL/world_script_waypoints.sql b/sql/FULL/world_script_waypoints.sql index 86aee4a71ac..940ef9920ce 100644 --- a/sql/FULL/world_script_waypoints.sql +++ b/sql/FULL/world_script_waypoints.sql @@ -13,6 +13,318 @@ CREATE TABLE script_waypoint ( PRIMARY KEY (entry, pointid) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Script Creature waypoints'; +DELETE FROM script_waypoint WHERE entry = 20415; +INSERT INTO script_waypoint VALUES +(20415 ,0, 2488.77, 2184.89, 104.64, 0, ''), +(20415 ,1, 2478.72, 2184.77, 98.58, 0, ''), +(20415 ,2, 2473.52, 2184.71, 99.00, 0, ''), +(20415 ,3, 2453.15, 2184.96, 97.09,4000, ''), +(20415 ,4, 2424.18, 2184.15, 94.11, 0, ''), +(20415 ,5, 2413.18, 2184.15, 93.42, 0, ''), +(20415 ,6, 2402.02, 2183.90, 87.59, 0, ''), +(20415 ,7, 2333.31, 2181.63, 90.03,4000, ''), +(20415 ,8, 2308.73, 2184.34, 92.04, 0, ''), +(20415 ,9, 2303.10, 2196.89, 94.94, 0, ''), +(20415 ,10, 2304.58, 2272.23, 96.67, 0, ''), +(20415 ,11, 2297.09, 2271.40, 95.16, 0, ''), +(20415 ,12, 2297.68, 2266.79, 95.07,4000, ''), +(20415 ,13, 2297.67, 2266.76, 95.07,4000, ''); + +DELETE FROM script_waypoint WHERE entry = 18760; +INSERT INTO script_waypoint VALUES +(18760 ,0, -2265.21, 3091.14, 13.91, 0, ''), +(18760 ,1, -2266.80, 3091.33, 13.82, 1000, ''), +(18760 ,2, -2268.20, 3091.14, 13.82, 7000, 'progress1'), +(18760 ,3, -2278.32, 3098.98, 13.82, 0, ''), +(18760 ,4, -2294.82, 3110.59, 13.82, 0, ''), +(18760 ,5, -2300.71, 3114.60, 13.82, 20000, 'progress2'), +(18760 ,6, -2300.71, 3114.60, 13.82, 3000, 'progress3'), +(18760 ,7, -2307.36, 3122.76, 13.79, 0, ''), +(18760 ,8, -2312.83, 3130.55, 12.04, 0, ''), +(18760 ,9, -2345.02, 3151.00, 8.38, 0, ''), +(18760 ,10, -2351.97, 3157.61, 6.27, 0, ''), +(18760 ,11, -2360.35, 3171.48, 3.31, 0, ''), +(18760 ,12, -2371.44, 3185.41, 0.89, 0, ''), +(18760 ,13, -2371.21, 3197.92, -0.96, 0, ''), +(18760 ,14, -2380.35, 3210.45, -1.08, 0, ''), +(18760 ,15, -2384.74, 3221.25, -1.17, 0, ''), +(18760 ,16, -2386.15, 3233.39, -1.29, 0, ''), +(18760 ,17, -2383.45, 3247.79, -1.32, 0, ''), +(18760 ,18, -2367.50, 3265.64, -1.33, 0, ''), +(18760 ,19, -2354.90, 3273.30, -1.50, 0, ''), +(18760 ,20, -2348.88, 3280.58, -0.09, 0, ''), +(18760 ,21, -2349.06, 3295.86, -0.95, 0, ''), +(18760 ,22, -2350.43, 3328.27, -2.10, 0, ''), +(18760 ,23, -2346.76, 3356.27, -2.82, 0, ''), +(18760 ,24, -2340.56, 3370.68, -4.02, 0, ''), +(18760 ,25, -2318.84, 3384.60, -7.61, 0, ''), +(18760 ,26, -2313.99, 3398.61, -10.40, 0, ''), +(18760 ,27, -2320.85, 3414.49, -11.49, 0, ''), +(18760 ,28, -2338.26, 3426.06, -11.46, 0, ''), +(18760 ,29, -2342.67, 3439.44, -11.32, 12000, 'progress4'), +(18760 ,30, -2342.67, 3439.44, -11.32, 7000, 'emote bye'), +(18760 ,31, -2342.67, 3439.44, -11.32, 5000, 'cat form'), +(18760 ,32, -2344.60, 3461.27, -10.44, 0, ''), +(18760 ,33, -2396.81, 3517.17, -3.55, 0, ''), +(18760 ,34, -2439.23, 3523.00, -1.05, 0, ''); + +DELETE FROM script_waypoint WHERE entry = 9623; +INSERT INTO script_waypoint VALUES +(9623 ,1, -6380.38, -1965.14, -258.292, 5000, ''), +(9623 ,2, -6383.06, -1962.9, -258.936, 0, ''), +(9623 ,3, -6391.09, -1956.13, -260.291, 0, ''), +(9623 ,4, -6395.29, -1933.58, -262.949, 0, ''), +(9623 ,5, -6396.58, -1919.93, -263.838, 0, ''), +(9623 ,6, -6389.01, -1912.64, -260.689, 0, ''), +(9623 ,7, -6369.19, -1892.87, -255.924, 0, ''), +(9623 ,8, -6373.77, -1879.36, -259.268, 0, ''), +(9623 ,9, -6377.55, -1869.56, -260.503, 0, ''), +(9623 ,10, -6376.58, -1860.79, -260.026, 0, ''), +(9623 ,11, -6373.13, -1847.22, -259.249, 0, ''), +(9623 ,12, -6370.54, -1837.04, -260.007, 0, ''), +(9623 ,13, -6372.52, -1829.16, -260.071, 0, ''), +(9623 ,14, -6377.13, -1815.94, -262.632, 0, ''), +(9623 ,15, -6380.27, -1806.95, -265.53, 0, ''), +(9623 ,16, -6386.04, -1790.43, -268.546, 0, ''), +(9623 ,17, -6386.72, -1776.29, -269.851, 0, ''), +(9623 ,18, -6385.92, -1762.31, -271.494, 0, ''), +(9623 ,19, -6384.69, -1744.86, -272.196, 0, ''), +(9623 ,20, -6383.8, -1732.66, -272.222, 0, ''), +(9623 ,21, -6382.66, -1716.96, -272.235, 0, ''), +(9623 ,22, -6381.5, -1703.01, -272.964, 0, ''), +(9623 ,23, -6379.96, -1685.58, -272.842, 0, ''), +(9623 ,24, -6379.34, -1678.61, -272.34, 0, ''), +(9623 ,25, -6364.45, -1636.27, -271.065, 0, ''), +(9623 ,26, -6371.85, -1626.36, -272.188, 0, ''), +(9623 ,27, -6383.5, -1629.01, -272.206, 0, ''), +(9623 ,28, -6388.09, -1635.37, -272.105, 5000, ''), +(9623 ,29, -6375.42, -1637.33, -272.193, 0, ''), +(9623 ,30, -6365.46, -1617.25, -272.141, 0, ''), +(9623 ,31, -6353.79, -1603.48, -271.932, 0, ''), +(9623 ,32, -6340.24, -1592.41, -269.435, 0, ''), +(9623 ,33, -6329.45, -1566.89, -269.895, 0, ''), +(9623 ,34, -6312.2, -1499.06, -269.507, 0, ''), +(9623 ,35, -6304.55, -1468.5, -269.431, 0, ''), +(9623 ,36, -6310.36, -1440.94, -268.427, 0, ''), +(9623 ,37, -6321, -1418.91, -266.525, 0, ''), +(9623 ,38, -6358.76, -1389.97, -267.522, 0, ''), +(9623 ,39, -6378.65, -1375.67, -271.749, 0, ''), +(9623 ,40, -6387.22, -1360.95, -272.109, 0, ''), +(9623 ,41, -6406.95, -1323.87, -271.586, 0, ''), +(9623 ,42, -6405, -1311.92, -271.906, 0, ''), +(9623 ,43, -6395.56, -1303.62, -271.902, 0, ''), +(9623 ,44, -6375.97, -1296.08, -271.865, 0, ''), +(9623 ,45, -6364.39, -1281.23, -269.012, 0, ''), +(9623 ,46, -6353.71, -1263.19, -267.95, 0, ''), +(9623 ,47, -6340.09, -1248.65, -267.441, 0, ''), +(9623 ,48, -6338.21, -1237.11, -267.844, 0, ''), +(9623 ,49, -6336.6, -1219.69, -269.196, 0, ''), +(9623 ,50, -6334.44, -1202.33, -271.527, 0, ''), +(9623 ,51, -6329.56, -1189.82, -270.947, 0, ''), +(9623 ,52, -6324.66, -1179.46, -270.103, 0, ''), +(9623 ,53, -6315.08, -1176.74, -269.735, 0, ''), +(9623 ,54, -6308.49, -1179.12, -269.57, 0, ''), +(9623 ,55, -6302.43, -1181.32, -269.328, 5000, ''), +(9623 ,56, -6298.87, -1185.79, -269.278, 0, ''); + +DELETE FROM script_waypoint WHERE entry = 4508; +INSERT INTO script_waypoint VALUES +(4508 ,0, 2194.38, 1791.65, 65.48, 5000, ''), +(4508 ,1, 2188.56, 1805.87, 64.45, 0, ''), +(4508 ,2, 2187, 1843.49, 59.33, 0, ''), +(4508 ,3, 2163.27, 1851.67, 56.73, 5000, ''), +(4508 ,4, 2137.66, 1843.98, 48.08, 5000, ''), +(4508 ,5, 2140.22, 1845.02, 48.32, 0, ''), +(4508 ,6, 2131.5, 1804.29, 46.85, 0, ''), +(4508 ,7, 2096.18, 1789.03, 51.13, 0, ''), +(4508 ,8, 2074.46, 1780.09, 55.64, 3000, ''), +(4508 ,9, 2055.12, 1768.67, 58.46, 5000, ''), +(4508 ,10, 2037.83, 1748.62, 60.27, 0, ''), +(4508 ,11, 2037.51, 1728.94, 60.85, 0, ''), +(4508 ,12, 2044.7, 1711.71, 59.71, 0, ''), +(4508 ,13, 2067.66, 1701.84, 57.77, 3000, ''), +(4508 ,14, 2078.91, 1704.54, 56.77, 3000, ''), +(4508 ,15, 2097.65, 1715.24, 54.74, 0, ''), +(4508 ,16, 2106.44, 1720.98, 54.41, 0, ''), +(4508 ,17, 2123.96, 1732.56, 52.27, 0, ''), +(4508 ,18, 2153.82, 1728.73, 51.92, 0, ''), +(4508 ,19, 2163.49, 1706.33, 54.42, 0, ''), +(4508 ,20, 2158.75, 1695.98, 55.70, 0, ''), +(4508 ,21, 2142.6, 1680.72, 58.24, 0, ''), +(4508 ,22, 2118.31, 1671.54, 59.21, 0, ''), +(4508 ,23, 2086.02, 1672.04, 61.24, 0, ''), +(4508 ,24, 2068.81, 1658.93, 61.24, 0, ''), +(4508 ,25, 2062.82, 1633.31, 64.35, 3000, ''), +(4508 ,26, 2063.05, 1589.16, 63.26, 0, ''), +(4508 ,27, 2063.67, 1577.22, 65.89, 0, ''), +(4508 ,28, 2057.94, 1560.68, 68.40, 0, ''), +(4508 ,29, 2052.56, 1548.05, 73.35, 0, ''), +(4508 ,30, 2045.22, 1543.4, 76.65, 0, ''), +(4508 ,31, 2034.35, 1543.01, 79.70, 0, ''), +(4508 ,32, 2029.95, 1542.94, 80.79, 0, ''), +(4508 ,33, 2021.34, 1538.67, 80.8, 0, ''), +(4508 ,34, 2012.45, 1549.48, 79.93, 0, ''), +(4508 ,35, 2008.05, 1554.92, 80.44, 0, ''), +(4508 ,36, 2006.54, 1562.72, 81.11, 0, ''), +(4508 ,37, 2003.8, 1576.43, 81.57, 0, ''), +(4508 ,38, 2000.57, 1590.06, 80.62, 0, ''), +(4508 ,39, 1998.96, 1596.87, 80.22, 0, ''), +(4508 ,40, 1991.19, 1600.82, 79.39, 0, ''), +(4508 ,41, 1980.71, 1601.44, 79.77, 3000, ''), +(4508 ,42, 1967.22, 1600.18, 80.62, 3000, ''), +(4508 ,43, 1956.43, 1596.97, 81.75, 3000, ''), +(4508 ,44, 1954.87, 1592.02, 82.18, 0, ''), +(4508 ,45, 1948.35, 1571.35, 80.96, 30000, ''), +(4508 ,46, 1947.02, 1566.42, 81.80, 30000, ''); + +DELETE FROM script_waypoint WHERE entry = 7784; +INSERT INTO script_waypoint VALUES +(7784 ,0, -8843.73, -4374.44, 43.71, 0, ''), +(7784 ,1, -8834.68, -4373.88, 45.71, 0, ''), +(7784 ,2, -8832.93, -4373.85, 45.67, 0, ''), +(7784 ,3, -8829.21, -4373.72, 44.14, 0, ''), +(7784 ,4, -8825.10, -4373.56, 41.44, 0, ''), +(7784 ,5, -8818.88, -4372.75, 36.43, 0, ''), +(7784 ,6, -8803.37, -4369.68, 30.06, 0, ''), +(7784 ,7, -8786.68, -4366.18, 23.91, 0, ''), +(7784 ,8, -8764.97, -4366.94, 25.23, 0, ''), +(7784 ,9, -8745.49, -4363.16, 22.80, 0, ''), +(7784 ,10, -8724.13, -4353.55, 20.72, 0, ''), +(7784 ,11, -8706.77, -4346.14, 16.12, 0, ''), +(7784 ,12, -8688.27, -4372.85, 13.64, 0, ''), +(7784 ,13, -8668.76, -4380.38, 11.69, 0, ''), +(7784 ,14, -8645.19, -4388.62, 12.56, 0, ''), +(7784 ,15, -8614.73, -4398.60, 9.86, 0, ''), +(7784 ,16, -8560.33, -4411.27, 13.17, 0, ''), +(7784 ,17, -8536.45, -4416.49, 11.84, 0, ''), +(7784 ,18, -8503.48, -4423.70, 13.59, 0, ''), +(7784 ,19, -8471.91, -4430.60, 9.56, 0, ''), +(7784 ,20, -8441.36, -4435.31, 9.40, 0, ''), +(7784 ,21, -8403.41, -4441.16, 11.83, 0, ''), +(7784 ,22, -8371.24, -4446.13, 9.47, 0, ''), +(7784 ,23, -8353.96, -4448.79, 10.10, 0, 'Scorpid'), +(7784 ,24, -8336.40, -4446.39, 8.98, 0, ''), +(7784 ,25, -8303.78, -4441.96, 11.89, 0, ''), +(7784 ,26, -8272.20, -4433.31, 9.60, 0, ''), +(7784 ,27, -8224.76, -4419.39, 13.03, 0, ''), +(7784 ,28, -8193.31, -4406.04, 10.17, 0, ''), +(7784 ,29, -8155.65, -4397.74, 8.99, 0, ''), +(7784 ,30, -8129.25, -4394.57, 10.92, 0, ''), +(7784 ,31, -8104.86, -4399.03, 8.93, 0, ''), +(7784 ,32, -8063.15, -4423.40, 10.07, 0, ''), +(7784 ,33, -8032.15, -4443.47, 9.97, 0, ''), +(7784 ,34, -8015.39, -4454.33, 9.39, 0, ''), +(7784 ,35, -7981.64, -4482.44, 10.32, 0, ''), +(7784 ,36, -7958.83, -4503.98, 9.69, 0, ''), +(7784 ,37, -7932.45, -4528.91, 10.08, 0, ''), +(7784 ,38, -7904.09, -4566.67, 12.59, 0, ''), +(7784 ,39, -7883.33, -4593.91, 12.15, 0, ''), +(7784 ,40, -7862.83, -4624.53, 10.21, 0, ''), +(7784 ,41, -7840.79, -4654.26, 9.45, 0, ''), +(7784 ,42, -7826.17, -4673.99, 10.61, 0, ''), +(7784 ,43, -7807.86, -4698.69, 11.24, 0, ''), +(7784 ,44, -7793.88, -4717.55, 10.48, 0, ''), +(7784 ,45, -7778.68, -4738.05, 8.89, 0, ''), +(7784 ,46, -7746.42, -4780.39, 9.84, 0, ''), +(7784 ,47, -7724.11, -4772.75, 10.28, 0, ''), +(7784 ,48, -7697.98, -4763.80, 9.52, 0, ''), +(7784 ,49, -7665.33, -4752.62, 10.56, 0, ''), +(7784 ,50, -7641.47, -4750.33, 8.94, 0, ''), +(7784 ,51, -7620.08, -4753.96, 8.93, 0, ''), +(7784 ,52, -7603.15, -4757.53, 9.06, 0, ''), +(7784 ,53, -7579.43, -4767.07, 8.93, 0, ''), +(7784 ,54, -7558.51, -4779.01, 9.64, 0, ''), +(7784 ,55, -7536.40, -4789.32, 8.92, 0, ''), +(7784 ,56, -7512.07, -4793.50, 9.35, 0, 'Wastewander'), +(7784 ,57, -7490.79, -4788.80, 10.53, 0, ''), +(7784 ,58, -7469.10, -4785.11, 10.42, 0, ''), +(7784 ,59, -7453.18, -4782.41, 9.15, 0, ''), +(7784 ,60, -7426.27, -4777.83, 9.54, 0, ''), +(7784 ,61, -7393.84, -4770.19, 12.57, 0, ''), +(7784 ,62, -7367.25, -4764.17, 11.92, 0, ''), +(7784 ,63, -7341.00, -4752.11, 10.17, 0, ''), +(7784 ,64, -7321.62, -4744.97, 11.58, 0, ''), +(7784 ,65, -7302.35, -4744.35, 11.97, 0, ''), +(7784 ,66, -7281.00, -4743.66, 11.21, 0, ''), +(7784 ,67, -7258.33, -4742.93, 9.64, 0, ''), +(7784 ,68, -7236.70, -4742.24, 10.16, 0, ''), +(7784 ,69, -7217.52, -4743.87, 10.79, 0, ''), +(7784 ,70, -7201.86, -4746.32, 9.58, 0, ''), +(7784 ,71, -7182.01, -4749.41, 9.09, 0, ''), +(7784 ,72, -7159.61, -4752.90, 9.52, 0, ''), +(7784 ,73, -7139.58, -4756.02, 9.53, 0, ''), +(7784 ,74, -7122.60, -4754.91, 9.66, 0, ''), +(7784 ,75, -7101.06, -4753.87, 8.92, 0, ''), +(7784 ,76, -7082.79, -4752.99, 9.97, 0, ''), +(7784 ,77, -7061.81, -4751.98, 9.26, 0, ''), +(7784 ,78, -7035.12, -4754.39, 9.19, 0, ''), +(7784 ,79, -7013.90, -4758.64, 10.28, 0, ''), +(7784 ,80, -7001.71, -4769.73, 10.59, 0, ''), +(7784 ,81, -6984.95, -4788.61, 9.30, 0, ''), +(7784 ,82, -6970.41, -4788.77, 9.42, 0, ''), +(7784 ,83, -6957.16, -4788.92, 6.26, 0, ''), +(7784 ,84, -6951.29, -4802.73, 4.45, 0, ''), +(7784 ,85, -6944.81, -4816.58, 1.60, 0, ''), +(7784 ,86, -6942.06, -4839.40, 0.66, 5000, ''); + +DELETE FROM script_waypoint WHERE entry = 1978; +INSERT INTO script_waypoint VALUES +(1978, 0, 1406.32, 1083.10, 52.55, 0, ''), +(1978, 1, 1400.49, 1080.42, 52.50, 0, 'first say'), +(1978, 2, 1388.48, 1083.10, 52.52, 0, ''), +(1978, 3, 1370.16, 1084.02, 52.30, 0, ''), +(1978, 4, 1359.02, 1080.85, 52.46, 0, ''), +(1978, 5, 1341.43, 1087.39, 52.69, 0, ''), +(1978, 6, 1321.93, 1090.51, 50.66, 0, ''), +(1978, 7, 1312.98, 1095.91, 47.49, 0, ''), +(1978, 8, 1301.09, 1102.94, 47.76, 0, ''), +(1978, 9, 1297.73, 1106.35, 50.18, 0, ''), +(1978, 10, 1295.49, 1124.32, 50.49, 0, ''), +(1978, 11, 1294.84, 1137.25, 51.75, 0, ''), +(1978, 12, 1292.89, 1158.99, 52.65, 0, ''), +(1978, 13, 1290.75, 1168.67, 52.56, 1000, 'complete quest and say last'), +(1978, 14, 1287.12, 1203.49, 52.66, 5000, ''), +(1978, 15, 1287.12, 1203.49, 52.66, 4000, ''), +(1978, 16, 1287.12, 1203.49, 52.66, 5000, ''), +(1978, 17, 1287.12, 1203.49, 52.66, 4000, ''), +(1978, 18, 1290.72, 1207.44, 52.69, 0, ''), +(1978, 19, 1297.50, 1207.18, 53.74, 0, ''), +(1978, 20, 1301.32, 1220.90, 53.74, 0, ''), +(1978, 21, 1298.55, 1220.43, 53.74, 0, ''), +(1978, 22, 1297.59, 1211.23, 58.47, 0, ''), +(1978, 23, 1305.01, 1206.10, 58.51, 0, ''), +(1978, 24, 1310.51, 1207.36, 58.51, 5000, ''), +(1978, 25, 1310.51, 1207.36, 58.51, 5000, ''), +(1978, 26, 1310.51, 1207.36, 58.51, 2000, ''); + +DELETE FROM script_waypoint WHERE entry=3439; +INSERT INTO script_waypoint VALUES +(3439, 0, 1105.090332, -3101.254150, 82.706, 1000, 'SAY_STARTUP1'), +(3439, 1, 1103.204468, -3104.345215, 83.113, 1000, ''), +(3439, 2, 1107.815186, -3106.495361, 82.739, 1000, ''), +(3439, 3, 1104.733276, -3100.830811, 82.747, 1000, ''), +(3439, 4, 1103.242554, -3106.270020, 83.133, 1000, ''), +(3439, 5, 1112.807373, -3106.285400, 82.320, 1000, ''), +(3439, 6, 1112.826782, -3108.908691, 82.377, 1000, ''), +(3439, 7, 1108.053955, -3115.156738, 82.894, 0, ''), +(3439, 8, 1108.355591, -3104.365234, 82.377, 5000, ''), +(3439, 9, 1100.306763, -3097.539063, 83.150, 0, 'SAY_STARTUP2'), +(3439, 10, 1100.562378, -3082.721924, 82.768, 0, ''), +(3439, 11, 1097.512939, -3069.226563, 82.206, 0, ''), +(3439, 12, 1092.964966, -3053.114746, 82.351, 0, ''), +(3439, 13, 1094.010986, -3036.958496, 82.888, 0, ''), +(3439, 14, 1095.623901, -3025.760254, 83.392, 0, ''), +(3439, 15, 1107.656494, -3013.530518, 85.653, 0, ''), +(3439, 16, 1119.647705, -3006.928223, 87.019, 0, ''), +(3439, 17, 1129.991211, -3002.410645, 91.232, 7000, 'SAY_MERCENARY'), +(3439, 18, 1133.328735, -2997.710693, 91.675, 1000, 'SAY_PROGRESS_1'), +(3439, 19, 1131.799316, -2987.948242, 91.976, 1000, ''), +(3439, 20, 1122.028687, -2993.397461, 91.536, 0, ''), +(3439, 21, 1116.614868, -2981.916748, 92.103, 0, ''), +(3439, 22, 1102.239136, -2994.245117, 92.074, 0, ''), +(3439, 23, 1096.366211, -2978.306885, 91.873, 0, ''), +(3439, 24, 1091.971558, -2985.919189, 91.730, 40000, 'SAY_PROGRESS_2'); + DELETE FROM script_waypoint WHERE entry=7806; INSERT INTO script_waypoint VALUES (7806, 0, 495.404358, -3478.350830, 114.837, 0, ''), diff --git a/sql/updates/5105_world_scripts.sql b/sql/updates/5105_world_scripts.sql new file mode 100644 index 00000000000..33a32fcc254 --- /dev/null +++ b/sql/updates/5105_world_scripts.sql @@ -0,0 +1,311 @@ +DELETE FROM script_waypoint WHERE entry=3439; +INSERT INTO script_waypoint VALUES +(3439, 0, 1105.090332, -3101.254150, 82.706, 1000, 'SAY_STARTUP1'), +(3439, 1, 1103.204468, -3104.345215, 83.113, 1000, ''), +(3439, 2, 1107.815186, -3106.495361, 82.739, 1000, ''), +(3439, 3, 1104.733276, -3100.830811, 82.747, 1000, ''), +(3439, 4, 1103.242554, -3106.270020, 83.133, 1000, ''), +(3439, 5, 1112.807373, -3106.285400, 82.320, 1000, ''), +(3439, 6, 1112.826782, -3108.908691, 82.377, 1000, ''), +(3439, 7, 1108.053955, -3115.156738, 82.894, 0, ''), +(3439, 8, 1108.355591, -3104.365234, 82.377, 5000, ''), +(3439, 9, 1100.306763, -3097.539063, 83.150, 0, 'SAY_STARTUP2'), +(3439, 10, 1100.562378, -3082.721924, 82.768, 0, ''), +(3439, 11, 1097.512939, -3069.226563, 82.206, 0, ''), +(3439, 12, 1092.964966, -3053.114746, 82.351, 0, ''), +(3439, 13, 1094.010986, -3036.958496, 82.888, 0, ''), +(3439, 14, 1095.623901, -3025.760254, 83.392, 0, ''), +(3439, 15, 1107.656494, -3013.530518, 85.653, 0, ''), +(3439, 16, 1119.647705, -3006.928223, 87.019, 0, ''), +(3439, 17, 1129.991211, -3002.410645, 91.232, 7000, 'SAY_MERCENARY'), +(3439, 18, 1133.328735, -2997.710693, 91.675, 1000, 'SAY_PROGRESS_1'), +(3439, 19, 1131.799316, -2987.948242, 91.976, 1000, ''), +(3439, 20, 1122.028687, -2993.397461, 91.536, 0, ''), +(3439, 21, 1116.614868, -2981.916748, 92.103, 0, ''), +(3439, 22, 1102.239136, -2994.245117, 92.074, 0, ''), +(3439, 23, 1096.366211, -2978.306885, 91.873, 0, ''), +(3439, 24, 1091.971558, -2985.919189, 91.730, 40000, 'SAY_PROGRESS_2'); + +DELETE FROM script_waypoint WHERE entry = 1978; +INSERT INTO script_waypoint VALUES +(1978, 0, 1406.32, 1083.10, 52.55, 0, ''), +(1978, 1, 1400.49, 1080.42, 52.50, 0, 'first say'), +(1978, 2, 1388.48, 1083.10, 52.52, 0, ''), +(1978, 3, 1370.16, 1084.02, 52.30, 0, ''), +(1978, 4, 1359.02, 1080.85, 52.46, 0, ''), +(1978, 5, 1341.43, 1087.39, 52.69, 0, ''), +(1978, 6, 1321.93, 1090.51, 50.66, 0, ''), +(1978, 7, 1312.98, 1095.91, 47.49, 0, ''), +(1978, 8, 1301.09, 1102.94, 47.76, 0, ''), +(1978, 9, 1297.73, 1106.35, 50.18, 0, ''), +(1978, 10, 1295.49, 1124.32, 50.49, 0, ''), +(1978, 11, 1294.84, 1137.25, 51.75, 0, ''), +(1978, 12, 1292.89, 1158.99, 52.65, 0, ''), +(1978, 13, 1290.75, 1168.67, 52.56, 1000, 'complete quest and say last'), +(1978, 14, 1287.12, 1203.49, 52.66, 5000, ''), +(1978, 15, 1287.12, 1203.49, 52.66, 4000, ''), +(1978, 16, 1287.12, 1203.49, 52.66, 5000, ''), +(1978, 17, 1287.12, 1203.49, 52.66, 4000, ''), +(1978, 18, 1290.72, 1207.44, 52.69, 0, ''), +(1978, 19, 1297.50, 1207.18, 53.74, 0, ''), +(1978, 20, 1301.32, 1220.90, 53.74, 0, ''), +(1978, 21, 1298.55, 1220.43, 53.74, 0, ''), +(1978, 22, 1297.59, 1211.23, 58.47, 0, ''), +(1978, 23, 1305.01, 1206.10, 58.51, 0, ''), +(1978, 24, 1310.51, 1207.36, 58.51, 5000, ''), +(1978, 25, 1310.51, 1207.36, 58.51, 5000, ''), +(1978, 26, 1310.51, 1207.36, 58.51, 2000, ''); + +DELETE FROM script_waypoint WHERE entry = 7784; +INSERT INTO script_waypoint VALUES +(7784 ,0, -8843.73, -4374.44, 43.71, 0, ''), +(7784 ,1, -8834.68, -4373.88, 45.71, 0, ''), +(7784 ,2, -8832.93, -4373.85, 45.67, 0, ''), +(7784 ,3, -8829.21, -4373.72, 44.14, 0, ''), +(7784 ,4, -8825.10, -4373.56, 41.44, 0, ''), +(7784 ,5, -8818.88, -4372.75, 36.43, 0, ''), +(7784 ,6, -8803.37, -4369.68, 30.06, 0, ''), +(7784 ,7, -8786.68, -4366.18, 23.91, 0, ''), +(7784 ,8, -8764.97, -4366.94, 25.23, 0, ''), +(7784 ,9, -8745.49, -4363.16, 22.80, 0, ''), +(7784 ,10, -8724.13, -4353.55, 20.72, 0, ''), +(7784 ,11, -8706.77, -4346.14, 16.12, 0, ''), +(7784 ,12, -8688.27, -4372.85, 13.64, 0, ''), +(7784 ,13, -8668.76, -4380.38, 11.69, 0, ''), +(7784 ,14, -8645.19, -4388.62, 12.56, 0, ''), +(7784 ,15, -8614.73, -4398.60, 9.86, 0, ''), +(7784 ,16, -8560.33, -4411.27, 13.17, 0, ''), +(7784 ,17, -8536.45, -4416.49, 11.84, 0, ''), +(7784 ,18, -8503.48, -4423.70, 13.59, 0, ''), +(7784 ,19, -8471.91, -4430.60, 9.56, 0, ''), +(7784 ,20, -8441.36, -4435.31, 9.40, 0, ''), +(7784 ,21, -8403.41, -4441.16, 11.83, 0, ''), +(7784 ,22, -8371.24, -4446.13, 9.47, 0, ''), +(7784 ,23, -8353.96, -4448.79, 10.10, 0, 'Scorpid'), +(7784 ,24, -8336.40, -4446.39, 8.98, 0, ''), +(7784 ,25, -8303.78, -4441.96, 11.89, 0, ''), +(7784 ,26, -8272.20, -4433.31, 9.60, 0, ''), +(7784 ,27, -8224.76, -4419.39, 13.03, 0, ''), +(7784 ,28, -8193.31, -4406.04, 10.17, 0, ''), +(7784 ,29, -8155.65, -4397.74, 8.99, 0, ''), +(7784 ,30, -8129.25, -4394.57, 10.92, 0, ''), +(7784 ,31, -8104.86, -4399.03, 8.93, 0, ''), +(7784 ,32, -8063.15, -4423.40, 10.07, 0, ''), +(7784 ,33, -8032.15, -4443.47, 9.97, 0, ''), +(7784 ,34, -8015.39, -4454.33, 9.39, 0, ''), +(7784 ,35, -7981.64, -4482.44, 10.32, 0, ''), +(7784 ,36, -7958.83, -4503.98, 9.69, 0, ''), +(7784 ,37, -7932.45, -4528.91, 10.08, 0, ''), +(7784 ,38, -7904.09, -4566.67, 12.59, 0, ''), +(7784 ,39, -7883.33, -4593.91, 12.15, 0, ''), +(7784 ,40, -7862.83, -4624.53, 10.21, 0, ''), +(7784 ,41, -7840.79, -4654.26, 9.45, 0, ''), +(7784 ,42, -7826.17, -4673.99, 10.61, 0, ''), +(7784 ,43, -7807.86, -4698.69, 11.24, 0, ''), +(7784 ,44, -7793.88, -4717.55, 10.48, 0, ''), +(7784 ,45, -7778.68, -4738.05, 8.89, 0, ''), +(7784 ,46, -7746.42, -4780.39, 9.84, 0, ''), +(7784 ,47, -7724.11, -4772.75, 10.28, 0, ''), +(7784 ,48, -7697.98, -4763.80, 9.52, 0, ''), +(7784 ,49, -7665.33, -4752.62, 10.56, 0, ''), +(7784 ,50, -7641.47, -4750.33, 8.94, 0, ''), +(7784 ,51, -7620.08, -4753.96, 8.93, 0, ''), +(7784 ,52, -7603.15, -4757.53, 9.06, 0, ''), +(7784 ,53, -7579.43, -4767.07, 8.93, 0, ''), +(7784 ,54, -7558.51, -4779.01, 9.64, 0, ''), +(7784 ,55, -7536.40, -4789.32, 8.92, 0, ''), +(7784 ,56, -7512.07, -4793.50, 9.35, 0, 'Wastewander'), +(7784 ,57, -7490.79, -4788.80, 10.53, 0, ''), +(7784 ,58, -7469.10, -4785.11, 10.42, 0, ''), +(7784 ,59, -7453.18, -4782.41, 9.15, 0, ''), +(7784 ,60, -7426.27, -4777.83, 9.54, 0, ''), +(7784 ,61, -7393.84, -4770.19, 12.57, 0, ''), +(7784 ,62, -7367.25, -4764.17, 11.92, 0, ''), +(7784 ,63, -7341.00, -4752.11, 10.17, 0, ''), +(7784 ,64, -7321.62, -4744.97, 11.58, 0, ''), +(7784 ,65, -7302.35, -4744.35, 11.97, 0, ''), +(7784 ,66, -7281.00, -4743.66, 11.21, 0, ''), +(7784 ,67, -7258.33, -4742.93, 9.64, 0, ''), +(7784 ,68, -7236.70, -4742.24, 10.16, 0, ''), +(7784 ,69, -7217.52, -4743.87, 10.79, 0, ''), +(7784 ,70, -7201.86, -4746.32, 9.58, 0, ''), +(7784 ,71, -7182.01, -4749.41, 9.09, 0, ''), +(7784 ,72, -7159.61, -4752.90, 9.52, 0, ''), +(7784 ,73, -7139.58, -4756.02, 9.53, 0, ''), +(7784 ,74, -7122.60, -4754.91, 9.66, 0, ''), +(7784 ,75, -7101.06, -4753.87, 8.92, 0, ''), +(7784 ,76, -7082.79, -4752.99, 9.97, 0, ''), +(7784 ,77, -7061.81, -4751.98, 9.26, 0, ''), +(7784 ,78, -7035.12, -4754.39, 9.19, 0, ''), +(7784 ,79, -7013.90, -4758.64, 10.28, 0, ''), +(7784 ,80, -7001.71, -4769.73, 10.59, 0, ''), +(7784 ,81, -6984.95, -4788.61, 9.30, 0, ''), +(7784 ,82, -6970.41, -4788.77, 9.42, 0, ''), +(7784 ,83, -6957.16, -4788.92, 6.26, 0, ''), +(7784 ,84, -6951.29, -4802.73, 4.45, 0, ''), +(7784 ,85, -6944.81, -4816.58, 1.60, 0, ''), +(7784 ,86, -6942.06, -4839.40, 0.66, 5000, ''); + +DELETE FROM script_waypoint WHERE entry = 4508; +INSERT INTO script_waypoint VALUES +(4508 ,0, 2194.38, 1791.65, 65.48, 5000, ''), +(4508 ,1, 2188.56, 1805.87, 64.45, 0, ''), +(4508 ,2, 2187, 1843.49, 59.33, 0, ''), +(4508 ,3, 2163.27, 1851.67, 56.73, 5000, ''), +(4508 ,4, 2137.66, 1843.98, 48.08, 5000, ''), +(4508 ,5, 2140.22, 1845.02, 48.32, 0, ''), +(4508 ,6, 2131.5, 1804.29, 46.85, 0, ''), +(4508 ,7, 2096.18, 1789.03, 51.13, 0, ''), +(4508 ,8, 2074.46, 1780.09, 55.64, 3000, ''), +(4508 ,9, 2055.12, 1768.67, 58.46, 5000, ''), +(4508 ,10, 2037.83, 1748.62, 60.27, 0, ''), +(4508 ,11, 2037.51, 1728.94, 60.85, 0, ''), +(4508 ,12, 2044.7, 1711.71, 59.71, 0, ''), +(4508 ,13, 2067.66, 1701.84, 57.77, 3000, ''), +(4508 ,14, 2078.91, 1704.54, 56.77, 3000, ''), +(4508 ,15, 2097.65, 1715.24, 54.74, 0, ''), +(4508 ,16, 2106.44, 1720.98, 54.41, 0, ''), +(4508 ,17, 2123.96, 1732.56, 52.27, 0, ''), +(4508 ,18, 2153.82, 1728.73, 51.92, 0, ''), +(4508 ,19, 2163.49, 1706.33, 54.42, 0, ''), +(4508 ,20, 2158.75, 1695.98, 55.70, 0, ''), +(4508 ,21, 2142.6, 1680.72, 58.24, 0, ''), +(4508 ,22, 2118.31, 1671.54, 59.21, 0, ''), +(4508 ,23, 2086.02, 1672.04, 61.24, 0, ''), +(4508 ,24, 2068.81, 1658.93, 61.24, 0, ''), +(4508 ,25, 2062.82, 1633.31, 64.35, 3000, ''), +(4508 ,26, 2063.05, 1589.16, 63.26, 0, ''), +(4508 ,27, 2063.67, 1577.22, 65.89, 0, ''), +(4508 ,28, 2057.94, 1560.68, 68.40, 0, ''), +(4508 ,29, 2052.56, 1548.05, 73.35, 0, ''), +(4508 ,30, 2045.22, 1543.4, 76.65, 0, ''), +(4508 ,31, 2034.35, 1543.01, 79.70, 0, ''), +(4508 ,32, 2029.95, 1542.94, 80.79, 0, ''), +(4508 ,33, 2021.34, 1538.67, 80.8, 0, ''), +(4508 ,34, 2012.45, 1549.48, 79.93, 0, ''), +(4508 ,35, 2008.05, 1554.92, 80.44, 0, ''), +(4508 ,36, 2006.54, 1562.72, 81.11, 0, ''), +(4508 ,37, 2003.8, 1576.43, 81.57, 0, ''), +(4508 ,38, 2000.57, 1590.06, 80.62, 0, ''), +(4508 ,39, 1998.96, 1596.87, 80.22, 0, ''), +(4508 ,40, 1991.19, 1600.82, 79.39, 0, ''), +(4508 ,41, 1980.71, 1601.44, 79.77, 3000, ''), +(4508 ,42, 1967.22, 1600.18, 80.62, 3000, ''), +(4508 ,43, 1956.43, 1596.97, 81.75, 3000, ''), +(4508 ,44, 1954.87, 1592.02, 82.18, 0, ''), +(4508 ,45, 1948.35, 1571.35, 80.96, 30000, ''), +(4508 ,46, 1947.02, 1566.42, 81.80, 30000, ''); + +DELETE FROM script_waypoint WHERE entry = 9623; +INSERT INTO script_waypoint VALUES +(9623 ,1, -6380.38, -1965.14, -258.292, 5000, ''), +(9623 ,2, -6383.06, -1962.9, -258.936, 0, ''), +(9623 ,3, -6391.09, -1956.13, -260.291, 0, ''), +(9623 ,4, -6395.29, -1933.58, -262.949, 0, ''), +(9623 ,5, -6396.58, -1919.93, -263.838, 0, ''), +(9623 ,6, -6389.01, -1912.64, -260.689, 0, ''), +(9623 ,7, -6369.19, -1892.87, -255.924, 0, ''), +(9623 ,8, -6373.77, -1879.36, -259.268, 0, ''), +(9623 ,9, -6377.55, -1869.56, -260.503, 0, ''), +(9623 ,10, -6376.58, -1860.79, -260.026, 0, ''), +(9623 ,11, -6373.13, -1847.22, -259.249, 0, ''), +(9623 ,12, -6370.54, -1837.04, -260.007, 0, ''), +(9623 ,13, -6372.52, -1829.16, -260.071, 0, ''), +(9623 ,14, -6377.13, -1815.94, -262.632, 0, ''), +(9623 ,15, -6380.27, -1806.95, -265.53, 0, ''), +(9623 ,16, -6386.04, -1790.43, -268.546, 0, ''), +(9623 ,17, -6386.72, -1776.29, -269.851, 0, ''), +(9623 ,18, -6385.92, -1762.31, -271.494, 0, ''), +(9623 ,19, -6384.69, -1744.86, -272.196, 0, ''), +(9623 ,20, -6383.8, -1732.66, -272.222, 0, ''), +(9623 ,21, -6382.66, -1716.96, -272.235, 0, ''), +(9623 ,22, -6381.5, -1703.01, -272.964, 0, ''), +(9623 ,23, -6379.96, -1685.58, -272.842, 0, ''), +(9623 ,24, -6379.34, -1678.61, -272.34, 0, ''), +(9623 ,25, -6364.45, -1636.27, -271.065, 0, ''), +(9623 ,26, -6371.85, -1626.36, -272.188, 0, ''), +(9623 ,27, -6383.5, -1629.01, -272.206, 0, ''), +(9623 ,28, -6388.09, -1635.37, -272.105, 5000, ''), +(9623 ,29, -6375.42, -1637.33, -272.193, 0, ''), +(9623 ,30, -6365.46, -1617.25, -272.141, 0, ''), +(9623 ,31, -6353.79, -1603.48, -271.932, 0, ''), +(9623 ,32, -6340.24, -1592.41, -269.435, 0, ''), +(9623 ,33, -6329.45, -1566.89, -269.895, 0, ''), +(9623 ,34, -6312.2, -1499.06, -269.507, 0, ''), +(9623 ,35, -6304.55, -1468.5, -269.431, 0, ''), +(9623 ,36, -6310.36, -1440.94, -268.427, 0, ''), +(9623 ,37, -6321, -1418.91, -266.525, 0, ''), +(9623 ,38, -6358.76, -1389.97, -267.522, 0, ''), +(9623 ,39, -6378.65, -1375.67, -271.749, 0, ''), +(9623 ,40, -6387.22, -1360.95, -272.109, 0, ''), +(9623 ,41, -6406.95, -1323.87, -271.586, 0, ''), +(9623 ,42, -6405, -1311.92, -271.906, 0, ''), +(9623 ,43, -6395.56, -1303.62, -271.902, 0, ''), +(9623 ,44, -6375.97, -1296.08, -271.865, 0, ''), +(9623 ,45, -6364.39, -1281.23, -269.012, 0, ''), +(9623 ,46, -6353.71, -1263.19, -267.95, 0, ''), +(9623 ,47, -6340.09, -1248.65, -267.441, 0, ''), +(9623 ,48, -6338.21, -1237.11, -267.844, 0, ''), +(9623 ,49, -6336.6, -1219.69, -269.196, 0, ''), +(9623 ,50, -6334.44, -1202.33, -271.527, 0, ''), +(9623 ,51, -6329.56, -1189.82, -270.947, 0, ''), +(9623 ,52, -6324.66, -1179.46, -270.103, 0, ''), +(9623 ,53, -6315.08, -1176.74, -269.735, 0, ''), +(9623 ,54, -6308.49, -1179.12, -269.57, 0, ''), +(9623 ,55, -6302.43, -1181.32, -269.328, 5000, ''), +(9623 ,56, -6298.87, -1185.79, -269.278, 0, ''); + +DELETE FROM script_waypoint WHERE entry = 18760; +INSERT INTO script_waypoint VALUES +(18760 ,0, -2265.21, 3091.14, 13.91, 0, ''), +(18760 ,1, -2266.80, 3091.33, 13.82, 1000, ''), +(18760 ,2, -2268.20, 3091.14, 13.82, 7000, 'progress1'), +(18760 ,3, -2278.32, 3098.98, 13.82, 0, ''), +(18760 ,4, -2294.82, 3110.59, 13.82, 0, ''), +(18760 ,5, -2300.71, 3114.60, 13.82, 20000, 'progress2'), +(18760 ,6, -2300.71, 3114.60, 13.82, 3000, 'progress3'), +(18760 ,7, -2307.36, 3122.76, 13.79, 0, ''), +(18760 ,8, -2312.83, 3130.55, 12.04, 0, ''), +(18760 ,9, -2345.02, 3151.00, 8.38, 0, ''), +(18760 ,10, -2351.97, 3157.61, 6.27, 0, ''), +(18760 ,11, -2360.35, 3171.48, 3.31, 0, ''), +(18760 ,12, -2371.44, 3185.41, 0.89, 0, ''), +(18760 ,13, -2371.21, 3197.92, -0.96, 0, ''), +(18760 ,14, -2380.35, 3210.45, -1.08, 0, ''), +(18760 ,15, -2384.74, 3221.25, -1.17, 0, ''), +(18760 ,16, -2386.15, 3233.39, -1.29, 0, ''), +(18760 ,17, -2383.45, 3247.79, -1.32, 0, ''), +(18760 ,18, -2367.50, 3265.64, -1.33, 0, ''), +(18760 ,19, -2354.90, 3273.30, -1.50, 0, ''), +(18760 ,20, -2348.88, 3280.58, -0.09, 0, ''), +(18760 ,21, -2349.06, 3295.86, -0.95, 0, ''), +(18760 ,22, -2350.43, 3328.27, -2.10, 0, ''), +(18760 ,23, -2346.76, 3356.27, -2.82, 0, ''), +(18760 ,24, -2340.56, 3370.68, -4.02, 0, ''), +(18760 ,25, -2318.84, 3384.60, -7.61, 0, ''), +(18760 ,26, -2313.99, 3398.61, -10.40, 0, ''), +(18760 ,27, -2320.85, 3414.49, -11.49, 0, ''), +(18760 ,28, -2338.26, 3426.06, -11.46, 0, ''), +(18760 ,29, -2342.67, 3439.44, -11.32, 12000, 'progress4'), +(18760 ,30, -2342.67, 3439.44, -11.32, 7000, 'emote bye'), +(18760 ,31, -2342.67, 3439.44, -11.32, 5000, 'cat form'), +(18760 ,32, -2344.60, 3461.27, -10.44, 0, ''), +(18760 ,33, -2396.81, 3517.17, -3.55, 0, ''), +(18760 ,34, -2439.23, 3523.00, -1.05, 0, ''); + +DELETE FROM script_waypoint WHERE entry = 20415; +INSERT INTO script_waypoint VALUES +(20415 ,0, 2488.77, 2184.89, 104.64, 0, ''), +(20415 ,1, 2478.72, 2184.77, 98.58, 0, ''), +(20415 ,2, 2473.52, 2184.71, 99.00, 0, ''), +(20415 ,3, 2453.15, 2184.96, 97.09,4000, ''), +(20415 ,4, 2424.18, 2184.15, 94.11, 0, ''), +(20415 ,5, 2413.18, 2184.15, 93.42, 0, ''), +(20415 ,6, 2402.02, 2183.90, 87.59, 0, ''), +(20415 ,7, 2333.31, 2181.63, 90.03,4000, ''), +(20415 ,8, 2308.73, 2184.34, 92.04, 0, ''), +(20415 ,9, 2303.10, 2196.89, 94.94, 0, ''), +(20415 ,10, 2304.58, 2272.23, 96.67, 0, ''), +(20415 ,11, 2297.09, 2271.40, 95.16, 0, ''), +(20415 ,12, 2297.68, 2266.79, 95.07,4000, ''), +(20415 ,13, 2297.67, 2266.76, 95.07,4000, ''); diff --git a/src/bindings/scripts/base/escort_ai.cpp b/src/bindings/scripts/base/escort_ai.cpp index 37c8c31981b..34b4efcbe60 100644 --- a/src/bindings/scripts/base/escort_ai.cpp +++ b/src/bindings/scripts/base/escort_ai.cpp @@ -22,7 +22,7 @@ enum npc_escortAI::npc_escortAI(Creature* pCreature) : ScriptedAI(pCreature), IsBeingEscorted(false), IsOnHold(false), - PlayerGUID(0), + m_uiPlayerGUID(0), MaxPlayerDistance(DEFAULT_MAX_PLAYER_DISTANCE), CanMelee(true), m_uiPlayerCheckTimer(1000), @@ -63,10 +63,10 @@ void npc_escortAI::MoveInLineOfSight(Unit* pWho) void npc_escortAI::JustDied(Unit* pKiller) { - if (!IsBeingEscorted || !PlayerGUID || !m_pQuestForEscort) + if (!IsBeingEscorted || !m_uiPlayerGUID || !m_pQuestForEscort) return; - if (Player* pPlayer = Unit::GetPlayer(PlayerGUID)) + if (Player* pPlayer = GetPlayerForEscort()) { if (Group* pGroup = pPlayer->GetGroup()) { @@ -132,7 +132,7 @@ void npc_escortAI::EnterEvadeMode() bool npc_escortAI::IsPlayerOrGroupInRange() { - if (Player* pPlayer = Unit::GetPlayer(PlayerGUID)) + if (Player* pPlayer = GetPlayerForEscort()) { if (Group* pGroup = pPlayer->GetGroup()) { @@ -216,7 +216,7 @@ void npc_escortAI::UpdateAI(const uint32 uiDiff) } //Check if player or any member of his group is within range - if (IsBeingEscorted && PlayerGUID && !m_creature->getVictim() && !m_bIsReturning) + if (IsBeingEscorted && m_uiPlayerGUID && !m_creature->getVictim() && !m_bIsReturning) { if (m_uiPlayerCheckTimer < uiDiff) { @@ -404,7 +404,7 @@ void npc_escortAI::Start(bool bIsActiveAttacker, bool bRun, uint64 uiPlayerGUID, m_bIsActiveAttacker = bIsActiveAttacker; m_bIsRunning = bRun; - PlayerGUID = uiPlayerGUID; + m_uiPlayerGUID = uiPlayerGUID; m_pQuestForEscort = pQuest; m_bCanInstantRespawn = bInstantRespawn; @@ -423,7 +423,7 @@ void npc_escortAI::Start(bool bIsActiveAttacker, bool bRun, uint64 uiPlayerGUID, //disable npcflags m_creature->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE); - debug_log("TSCR: EscortAI started with %d waypoints. ActiveAttacker = %d, Run = %d, PlayerGUID = %d", WaypointList.size(), m_bIsActiveAttacker, m_bIsRunning, PlayerGUID); + debug_log("TSCR: EscortAI started with %d waypoints. ActiveAttacker = %d, Run = %d, PlayerGUID = %d", WaypointList.size(), m_bIsActiveAttacker, m_bIsRunning, m_uiPlayerGUID); CurrentWP = WaypointList.begin(); diff --git a/src/bindings/scripts/base/escort_ai.h b/src/bindings/scripts/base/escort_ai.h index 243e64d6d21..60e555dcfd4 100644 --- a/src/bindings/scripts/base/escort_ai.h +++ b/src/bindings/scripts/base/escort_ai.h @@ -58,6 +58,11 @@ struct TRINITY_DLL_DECL npc_escortAI : public ScriptedAI bool IsPlayerOrGroupInRange(); + Player* GetPlayerForEscort() + { + return Unit::GetPlayer(m_uiPlayerGUID); + } + void FillPointMovementListForCreature(); void Start(bool bIsActiveAttacker = true, bool bRun = false, uint64 uiPlayerGUID = 0, const Quest* pQuest = NULL, bool bInstantRespawn = false, bool bCanLoopPath = false); @@ -76,15 +81,15 @@ struct TRINITY_DLL_DECL npc_escortAI : public ScriptedAI bool GetIsBeingEscorted() { return IsBeingEscorted; }//used in EnterEvadeMode override void SetReturning(bool returning) { m_bIsReturning = returning; }//used in EnterEvadeMode override void SetCanAttack(bool attack) { m_bIsActiveAttacker = attack; } - uint64 GetEventStarterGUID() { return PlayerGUID; } + uint64 GetEventStarterGUID() { return m_uiPlayerGUID; } // EscortAI variables protected: - uint64 PlayerGUID; bool IsBeingEscorted; bool IsOnHold; private: + uint64 m_uiPlayerGUID; uint32 m_uiWPWaitTimer; uint32 m_uiPlayerCheckTimer; float MaxPlayerDistance; diff --git a/src/bindings/scripts/scripts/eastern_kingdoms/arathi_highlands.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/arathi_highlands.cpp index c5325da12d3..e9169ae60f6 100644 --- a/src/bindings/scripts/scripts/eastern_kingdoms/arathi_highlands.cpp +++ b/src/bindings/scripts/scripts/eastern_kingdoms/arathi_highlands.cpp @@ -55,7 +55,10 @@ struct TRINITY_DLL_DECL npc_professor_phizzlethorpeAI : public npc_escortAI void WaypointReached(uint32 uiPointId) { - Player* pPlayer = Unit::GetPlayer(PlayerGUID); + Player* pPlayer = GetPlayerForEscort(); + + if (!pPlayer) + return; switch(uiPointId) { diff --git a/src/bindings/scripts/scripts/eastern_kingdoms/eversong_woods.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/eversong_woods.cpp index 929fea7f41a..f63baa7a18f 100644 --- a/src/bindings/scripts/scripts/eastern_kingdoms/eversong_woods.cpp +++ b/src/bindings/scripts/scripts/eastern_kingdoms/eversong_woods.cpp @@ -52,7 +52,7 @@ struct TRINITY_DLL_DECL npc_prospector_anvilwardAI : public npc_escortAI // Pure Virtual Functions void WaypointReached(uint32 i) { - Player* pPlayer = Unit::GetPlayer(PlayerGUID); + Player* pPlayer = GetPlayerForEscort(); if (!pPlayer) return; @@ -65,21 +65,14 @@ struct TRINITY_DLL_DECL npc_prospector_anvilwardAI : public npc_escortAI } } - void EnterCombat(Unit* who) { } - void Reset() { - m_creature->setFaction(35); + me->RestoreFaction(); } void JustDied(Unit* killer) { - m_creature->setFaction(35); - } - - void UpdateAI(const uint32 diff) - { - npc_escortAI::UpdateAI(diff); + me->RestoreFaction(); } }; diff --git a/src/bindings/scripts/scripts/eastern_kingdoms/ghostlands.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/ghostlands.cpp index 42122c1f002..849ed2e029a 100644 --- a/src/bindings/scripts/scripts/eastern_kingdoms/ghostlands.cpp +++ b/src/bindings/scripts/scripts/eastern_kingdoms/ghostlands.cpp @@ -159,7 +159,7 @@ struct TRINITY_DLL_DECL npc_ranger_lilathaAI : public npc_escortAI void WaypointReached(uint32 i) { - Player* pPlayer = Unit::GetPlayer(PlayerGUID); + Player* pPlayer = GetPlayerForEscort(); if (!pPlayer) return; diff --git a/src/bindings/scripts/scripts/eastern_kingdoms/hinterlands.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/hinterlands.cpp index 6b661dad5ef..f8ae2bc66ff 100644 --- a/src/bindings/scripts/scripts/eastern_kingdoms/hinterlands.cpp +++ b/src/bindings/scripts/scripts/eastern_kingdoms/hinterlands.cpp @@ -67,7 +67,7 @@ struct MANGOS_DLL_DECL npc_00x09hlAI : public npc_escortAI break; case 64: DoScriptText(SAY_OOX_COMPLETE, m_creature); - if (Player* pPlayer = Unit::GetPlayer(PlayerGUID)) + if (Player* pPlayer = GetPlayerForEscort()) pPlayer->GroupEventHappens(QUEST_RESQUE_OOX_09, m_creature); break; } @@ -247,7 +247,7 @@ struct TRINITY_DLL_DECL npc_rinjiAI : public npc_escortAI void WaypointReached(uint32 uiPointId) { - Player* pPlayer = (Player*)Unit::GetUnit(*m_creature, PlayerGUID); + Player* pPlayer = GetPlayerForEscort(); if (!pPlayer) return; @@ -283,7 +283,7 @@ struct TRINITY_DLL_DECL npc_rinjiAI : public npc_escortAI { m_uiPostEventTimer = 3000; - if (Unit* pPlayer = Unit::GetUnit(*m_creature, PlayerGUID)) + if (Unit* pPlayer = GetPlayerForEscort()) { switch(m_uiPostEventCount) { diff --git a/src/bindings/scripts/scripts/eastern_kingdoms/scarlet_enclave/the_scarlet_enclave.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/scarlet_enclave/the_scarlet_enclave.cpp index 1a081a49050..96a4dbdc2c4 100644 --- a/src/bindings/scripts/scripts/eastern_kingdoms/scarlet_enclave/the_scarlet_enclave.cpp +++ b/src/bindings/scripts/scripts/eastern_kingdoms/scarlet_enclave/the_scarlet_enclave.cpp @@ -564,7 +564,7 @@ struct TRINITY_DLL_DECL npc_koltira_deathweaverAI : public npc_escortAI void JustSummoned(Creature* pSummoned) { - if (Unit* pPlayer = Unit::GetUnit(*m_creature, PlayerGUID)) + if (Player* pPlayer = GetPlayerForEscort()) { pSummoned->AI()->AttackStart(pPlayer); pSummoned->AddThreat(m_creature, 0.0f); diff --git a/src/bindings/scripts/scripts/eastern_kingdoms/silverpine_forest.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/silverpine_forest.cpp index 07b1979f87f..409d6702d2b 100644 --- a/src/bindings/scripts/scripts/eastern_kingdoms/silverpine_forest.cpp +++ b/src/bindings/scripts/scripts/eastern_kingdoms/silverpine_forest.cpp @@ -119,7 +119,7 @@ struct TRINITY_DLL_DECL npc_deathstalker_erlandAI : public npc_escortAI void WaypointReached(uint32 i) { - Player* pPlayer = Unit::GetPlayer(PlayerGUID); + Player* pPlayer = GetPlayerForEscort(); if (!pPlayer) return; @@ -176,37 +176,7 @@ bool QuestAccept_npc_deathstalker_erland(Player* pPlayer, Creature* pCreature, Q CreatureAI* GetAI_npc_deathstalker_erlandAI(Creature* pCreature) { - npc_deathstalker_erlandAI* deathstalker_erlandAI = new npc_deathstalker_erlandAI(pCreature); - - deathstalker_erlandAI->AddWaypoint(0, 1406.32, 1083.10, 52.55); - deathstalker_erlandAI->AddWaypoint(1, 1400.49, 1080.42, 52.50); //first say - deathstalker_erlandAI->AddWaypoint(2, 1388.48, 1083.10, 52.52); - deathstalker_erlandAI->AddWaypoint(3, 1370.16, 1084.02, 52.30); - deathstalker_erlandAI->AddWaypoint(4, 1359.02, 1080.85, 52.46); - deathstalker_erlandAI->AddWaypoint(5, 1341.43, 1087.39, 52.69); - deathstalker_erlandAI->AddWaypoint(6, 1321.93, 1090.51, 50.66); - deathstalker_erlandAI->AddWaypoint(7, 1312.98, 1095.91, 47.49); - deathstalker_erlandAI->AddWaypoint(8, 1301.09, 1102.94, 47.76); - deathstalker_erlandAI->AddWaypoint(9, 1297.73, 1106.35, 50.18); - deathstalker_erlandAI->AddWaypoint(10, 1295.49, 1124.32, 50.49); - deathstalker_erlandAI->AddWaypoint(11, 1294.84, 1137.25, 51.75); - deathstalker_erlandAI->AddWaypoint(12, 1292.89, 1158.99, 52.65); - deathstalker_erlandAI->AddWaypoint(13, 1290.75, 1168.67, 52.56, 1000); //complete quest and say last - deathstalker_erlandAI->AddWaypoint(14, 1287.12, 1203.49, 52.66, 5000); - deathstalker_erlandAI->AddWaypoint(15, 1287.12, 1203.49, 52.66, 4000); - deathstalker_erlandAI->AddWaypoint(16, 1287.12, 1203.49, 52.66, 5000); - deathstalker_erlandAI->AddWaypoint(17, 1287.12, 1203.49, 52.66, 4000); - deathstalker_erlandAI->AddWaypoint(18, 1290.72, 1207.44, 52.69); - deathstalker_erlandAI->AddWaypoint(19, 1297.50, 1207.18, 53.74); - deathstalker_erlandAI->AddWaypoint(20, 1301.32, 1220.90, 53.74); - deathstalker_erlandAI->AddWaypoint(21, 1298.55, 1220.43, 53.74); - deathstalker_erlandAI->AddWaypoint(22, 1297.59, 1211.23, 58.47); - deathstalker_erlandAI->AddWaypoint(23, 1305.01, 1206.10, 58.51); - deathstalker_erlandAI->AddWaypoint(24, 1310.51, 1207.36, 58.51, 5000); - deathstalker_erlandAI->AddWaypoint(25, 1310.51, 1207.36, 58.51, 5000); - deathstalker_erlandAI->AddWaypoint(26, 1310.51, 1207.36, 58.51, 2000); - - return deathstalker_erlandAI; + return new npc_deathstalker_erlandAI(pCreature); } /*###### diff --git a/src/bindings/scripts/scripts/eastern_kingdoms/westfall.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/westfall.cpp index d6cbea99fb5..0799f745a70 100644 --- a/src/bindings/scripts/scripts/eastern_kingdoms/westfall.cpp +++ b/src/bindings/scripts/scripts/eastern_kingdoms/westfall.cpp @@ -73,7 +73,7 @@ struct TRINITY_DLL_DECL npc_daphne_stilwellAI : public npc_escortAI void WaypointReached(uint32 uiPoint) { - Player* pPlayer = Unit::GetPlayer(PlayerGUID); + Player* pPlayer = GetPlayerForEscort(); if (!pPlayer) return; @@ -197,7 +197,7 @@ struct TRINITY_DLL_DECL npc_defias_traitorAI : public npc_escortAI void WaypointReached(uint32 i) { - Player* pPlayer = Unit::GetPlayer(PlayerGUID); + Player* pPlayer = GetPlayerForEscort(); if (!pPlayer) return; diff --git a/src/bindings/scripts/scripts/eastern_kingdoms/wetlands.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/wetlands.cpp index 4a9d944cb3e..3568c7e555b 100644 --- a/src/bindings/scripts/scripts/eastern_kingdoms/wetlands.cpp +++ b/src/bindings/scripts/scripts/eastern_kingdoms/wetlands.cpp @@ -70,7 +70,7 @@ struct TRINITY_DLL_DECL npc_tapoke_slim_jahnAI : public npc_escortAI void Aggro(Unit* pWho) { - Unit* pPlayer = Unit::GetUnit(*m_creature, PlayerGUID); + Player* pPlayer = GetPlayerForEscort(); if (IsBeingEscorted && !m_bFriendSummoned && pPlayer) { @@ -83,7 +83,7 @@ struct TRINITY_DLL_DECL npc_tapoke_slim_jahnAI : public npc_escortAI void JustSummoned(Creature* pSummoned) { - if (Unit* pPlayer = Unit::GetPlayer(PlayerGUID)) + if (Player* pPlayer = GetPlayerForEscort()) pSummoned->AI()->AttackStart(pPlayer); } @@ -102,7 +102,7 @@ struct TRINITY_DLL_DECL npc_tapoke_slim_jahnAI : public npc_escortAI { if (m_creature->GetHealth()*100 < m_creature->GetMaxHealth()*20) { - if (Unit* pPlayer = Unit::GetUnit(*m_creature, PlayerGUID)) + if (Player* pPlayer = GetPlayerForEscort()) { if (pPlayer->GetTypeId() == TYPEID_PLAYER) CAST_PLR(pPlayer)->GroupEventHappens(QUEST_MISSING_DIPLO_PT11, m_creature); diff --git a/src/bindings/scripts/scripts/examples/example_escort.cpp b/src/bindings/scripts/scripts/examples/example_escort.cpp index e603d3ce79c..4fdc1b7e1ad 100644 --- a/src/bindings/scripts/scripts/examples/example_escort.cpp +++ b/src/bindings/scripts/scripts/examples/example_escort.cpp @@ -76,12 +76,12 @@ struct TRINITY_DLL_DECL example_escortAI : public npc_escortAI m_creature->SummonCreature(NPC_FELBOAR, m_creature->GetPositionX()+5.0f, m_creature->GetPositionY()+7.0f, m_creature->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 3000); break; case 4: - if (Unit* pTmpPlayer = Unit::GetUnit(*m_creature, PlayerGUID)) + if (Player* pPlayer = GetPlayerForEscort()) { //pTmpPlayer is the target of the text - DoScriptText(SAY_WP_3, m_creature, pTmpPlayer); + DoScriptText(SAY_WP_3, m_creature, pPlayer); //pTmpPlayer is the source of the text - DoScriptText(SAY_WP_4, pTmpPlayer); + DoScriptText(SAY_WP_4, pPlayer); } break; } @@ -91,8 +91,8 @@ struct TRINITY_DLL_DECL example_escortAI : public npc_escortAI { if (IsBeingEscorted) { - if (Unit* pTemp = Unit::GetUnit(*m_creature, PlayerGUID)) - DoScriptText(SAY_AGGRO1, m_creature, pTemp); + if (Player* pPlayer = GetPlayerForEscort()) + DoScriptText(SAY_AGGRO1, m_creature, pPlayer); } else DoScriptText(SAY_AGGRO2, m_creature); @@ -108,15 +108,15 @@ struct TRINITY_DLL_DECL example_escortAI : public npc_escortAI { if (IsBeingEscorted) { - if (Unit *pTemp = Unit::GetUnit(*m_creature,PlayerGUID)) + if (Player* pPlayer = GetPlayerForEscort()) { // not a likely case, code here for the sake of example if (pKiller == m_creature) { - DoScriptText(SAY_DEATH_1, m_creature, pTemp); + DoScriptText(SAY_DEATH_1, m_creature, pPlayer); } else - DoScriptText(SAY_DEATH_2, m_creature, pTemp); + DoScriptText(SAY_DEATH_2, m_creature, pPlayer); } } else diff --git a/src/bindings/scripts/scripts/kalimdor/ashenvale.cpp b/src/bindings/scripts/scripts/kalimdor/ashenvale.cpp index 88572bf3463..7bb193b98be 100644 --- a/src/bindings/scripts/scripts/kalimdor/ashenvale.cpp +++ b/src/bindings/scripts/scripts/kalimdor/ashenvale.cpp @@ -59,7 +59,7 @@ struct TRINITY_DLL_DECL npc_torekAI : public npc_escortAI void WaypointReached(uint32 i) { - Player* pPlayer = Unit::GetPlayer(PlayerGUID); + Player* pPlayer = GetPlayerForEscort(); if (!pPlayer) return; @@ -81,8 +81,8 @@ struct TRINITY_DLL_DECL npc_torekAI : public npc_escortAI case 20: DoScriptText(SAY_WIN, m_creature, pPlayer); Completed = true; - if (pPlayer && pPlayer->GetTypeId() == TYPEID_PLAYER) - CAST_PLR(pPlayer)->GroupEventHappens(QUEST_TOREK_ASSULT,m_creature); + if (pPlayer) + pPlayer->GroupEventHappens(QUEST_TOREK_ASSULT, m_creature); break; case 21: DoScriptText(SAY_END, m_creature, pPlayer); @@ -160,7 +160,7 @@ struct TRINITY_DLL_DECL npc_ruul_snowhoofAI : public npc_escortAI void WaypointReached(uint32 i) { - Player* pPlayer = Unit::GetPlayer(PlayerGUID); + Player* pPlayer = GetPlayerForEscort(); if (!pPlayer) return; @@ -185,8 +185,8 @@ struct TRINITY_DLL_DECL npc_ruul_snowhoofAI : public npc_escortAI break; case 21:{ - if (pPlayer && pPlayer->GetTypeId() == TYPEID_PLAYER) - CAST_PLR(pPlayer)->GroupEventHappens(QUEST_FREEDOM_TO_RUUL,m_creature); + if (pPlayer) + pPlayer->GroupEventHappens(QUEST_FREEDOM_TO_RUUL, m_creature); break; } } diff --git a/src/bindings/scripts/scripts/kalimdor/azuremyst_isle.cpp b/src/bindings/scripts/scripts/kalimdor/azuremyst_isle.cpp index 0e21a4b310d..f881715ca64 100644 --- a/src/bindings/scripts/scripts/kalimdor/azuremyst_isle.cpp +++ b/src/bindings/scripts/scripts/kalimdor/azuremyst_isle.cpp @@ -338,7 +338,7 @@ struct TRINITY_DLL_DECL npc_magwinAI : public npc_escortAI void WaypointReached(uint32 i) { - Player* pPlayer = Unit::GetPlayer(PlayerGUID); + Player* pPlayer = GetPlayerForEscort(); if (!pPlayer) return; diff --git a/src/bindings/scripts/scripts/kalimdor/caverns_of_time/old_hillsbrad/old_hillsbrad.cpp b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/old_hillsbrad/old_hillsbrad.cpp index 7c0290fe565..d8471deb96b 100644 --- a/src/bindings/scripts/scripts/kalimdor/caverns_of_time/old_hillsbrad/old_hillsbrad.cpp +++ b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/old_hillsbrad/old_hillsbrad.cpp @@ -329,14 +329,11 @@ struct TRINITY_DLL_DECL npc_thrall_old_hillsbradAI : public npc_escortAI case 106: { - if (!PlayerGUID) - break; - //trigger taretha to run down outside - if (uint64 TarethaGUID = pInstance->GetData64(DATA_TARETHA)) + if (Creature* Taretha = pInstance->instance->GetCreature(pInstance->GetData64(DATA_TARETHA))) { - if (Creature* Taretha = (Unit::GetCreature(*m_creature, TarethaGUID))) - CAST_AI(npc_escortAI, (Taretha->AI()))->Start(false, true, PlayerGUID); + if (Player* pPlayer = GetPlayerForEscort()) + CAST_AI(npc_escortAI, (Taretha->AI()))->Start(false, true, pPlayer->GetGUID()); } //kill credit Creature for quest diff --git a/src/bindings/scripts/scripts/kalimdor/darkshore.cpp b/src/bindings/scripts/scripts/kalimdor/darkshore.cpp index 6c2520cd8b5..8ff16a53832 100644 --- a/src/bindings/scripts/scripts/kalimdor/darkshore.cpp +++ b/src/bindings/scripts/scripts/kalimdor/darkshore.cpp @@ -62,7 +62,7 @@ struct TRINITY_DLL_DECL npc_prospector_remtravelAI : public npc_escortAI void WaypointReached(uint32 i) { - Player* pPlayer = Unit::GetPlayer(PlayerGUID); + Player* pPlayer = GetPlayerForEscort(); if (!pPlayer) return; @@ -136,11 +136,6 @@ struct TRINITY_DLL_DECL npc_prospector_remtravelAI : public npc_escortAI //unsure if it should be any //pSummoned->AI()->AttackStart(m_creature); } - - void UpdateAI(const uint32 diff) - { - npc_escortAI::UpdateAI(diff); - } }; CreatureAI* GetAI_npc_prospector_remtravel(Creature* pCreature) diff --git a/src/bindings/scripts/scripts/kalimdor/feralas.cpp b/src/bindings/scripts/scripts/kalimdor/feralas.cpp index 08c00a9a5a7..99090b06039 100644 --- a/src/bindings/scripts/scripts/kalimdor/feralas.cpp +++ b/src/bindings/scripts/scripts/kalimdor/feralas.cpp @@ -111,7 +111,7 @@ struct TRINITY_DLL_DECL npc_oox22feAI : public npc_escortAI case 37: DoScriptText(SAY_END,m_creature); // Award quest credit - if (Player* pPlayer = Unit::GetPlayer(PlayerGUID)) + if (Player* pPlayer = GetPlayerForEscort()) { pPlayer->GroupEventHappens(QUEST_RESCUE_OOX22FE, m_creature); } diff --git a/src/bindings/scripts/scripts/kalimdor/razorfen_kraul/razorfen_kraul.cpp b/src/bindings/scripts/scripts/kalimdor/razorfen_kraul/razorfen_kraul.cpp index 5c51e64f5a2..b24a51cb3cb 100644 --- a/src/bindings/scripts/scripts/kalimdor/razorfen_kraul/razorfen_kraul.cpp +++ b/src/bindings/scripts/scripts/kalimdor/razorfen_kraul/razorfen_kraul.cpp @@ -51,7 +51,7 @@ struct TRINITY_DLL_DECL npc_willixAI : public npc_escortAI void WaypointReached(uint32 i) { - Player* pPlayer = Unit::GetPlayer(PlayerGUID); + Player* pPlayer = GetPlayerForEscort(); if (!pPlayer) return; @@ -114,16 +114,8 @@ struct TRINITY_DLL_DECL npc_willixAI : public npc_escortAI void JustDied(Unit* killer) { - if (PlayerGUID) - { - if (Player* pPlayer = Unit::GetPlayer(PlayerGUID)) - CAST_PLR(pPlayer)->FailQuest(QUEST_WILLIX_THE_IMPORTER); - } - } - - void UpdateAI(const uint32 diff) - { - npc_escortAI::UpdateAI(diff); + if (Player* pPlayer = GetPlayerForEscort()) + CAST_PLR(pPlayer)->FailQuest(QUEST_WILLIX_THE_IMPORTER); } }; @@ -181,57 +173,7 @@ CreatureAI* GetAI_npc_deaths_head_ward_keeper(Creature* pCreature) CreatureAI* GetAI_npc_willix(Creature* pCreature) { - npc_willixAI* thisAI = new npc_willixAI(pCreature); - - thisAI->AddWaypoint(0, 2194.38, 1791.65, 65.48, 5000); - thisAI->AddWaypoint(1, 2188.56, 1805.87, 64.45); - thisAI->AddWaypoint(2, 2187, 1843.49, 59.33); - thisAI->AddWaypoint(3, 2163.27, 1851.67, 56.73, 5000); - thisAI->AddWaypoint(4, 2137.66, 1843.98, 48.08, 5000); - thisAI->AddWaypoint(5, 2140.22, 1845.02, 48.32); - thisAI->AddWaypoint(6, 2131.5, 1804.29, 46.85); - thisAI->AddWaypoint(7, 2096.18, 1789.03, 51.13); - thisAI->AddWaypoint(8, 2074.46, 1780.09, 55.64, 3000); - thisAI->AddWaypoint(9, 2055.12, 1768.67, 58.46, 5000); - thisAI->AddWaypoint(10, 2037.83, 1748.62, 60.27); - thisAI->AddWaypoint(11, 2037.51, 1728.94, 60.85); - thisAI->AddWaypoint(12, 2044.7, 1711.71, 59.71); - thisAI->AddWaypoint(13, 2067.66, 1701.84, 57.77, 3000); - thisAI->AddWaypoint(14, 2078.91, 1704.54, 56.77, 3000); - thisAI->AddWaypoint(15, 2097.65, 1715.24, 54.74); - thisAI->AddWaypoint(16, 2106.44, 1720.98, 54.41); - thisAI->AddWaypoint(17, 2123.96, 1732.56, 52.27); - thisAI->AddWaypoint(18, 2153.82, 1728.73, 51.92); - thisAI->AddWaypoint(19, 2163.49, 1706.33, 54.42); - thisAI->AddWaypoint(20, 2158.75, 1695.98, 55.70); - thisAI->AddWaypoint(21, 2142.6, 1680.72, 58.24); - thisAI->AddWaypoint(22, 2118.31, 1671.54, 59.21); - thisAI->AddWaypoint(23, 2086.02, 1672.04, 61.24); - thisAI->AddWaypoint(24, 2068.81, 1658.93, 61.24); - thisAI->AddWaypoint(25, 2062.82, 1633.31, 64.35, 3000); - thisAI->AddWaypoint(26, 2063.05, 1589.16, 63.26); - thisAI->AddWaypoint(27, 2063.67, 1577.22, 65.89); - thisAI->AddWaypoint(28, 2057.94, 1560.68, 68.40); - thisAI->AddWaypoint(29, 2052.56, 1548.05, 73.35); - thisAI->AddWaypoint(30, 2045.22, 1543.4, 76.65); - thisAI->AddWaypoint(31, 2034.35, 1543.01, 79.70); - thisAI->AddWaypoint(32, 2029.95, 1542.94, 80.79); - thisAI->AddWaypoint(33, 2021.34, 1538.67, 80.8); - thisAI->AddWaypoint(34, 2012.45, 1549.48, 79.93); - thisAI->AddWaypoint(35, 2008.05, 1554.92, 80.44); - thisAI->AddWaypoint(36, 2006.54, 1562.72, 81.11); - thisAI->AddWaypoint(37, 2003.8, 1576.43, 81.57); - thisAI->AddWaypoint(38, 2000.57, 1590.06, 80.62); - thisAI->AddWaypoint(39, 1998.96, 1596.87, 80.22); - thisAI->AddWaypoint(40, 1991.19, 1600.82, 79.39); - thisAI->AddWaypoint(41, 1980.71, 1601.44, 79.77, 3000); - thisAI->AddWaypoint(42, 1967.22, 1600.18, 80.62, 3000); - thisAI->AddWaypoint(43, 1956.43, 1596.97, 81.75, 3000); - thisAI->AddWaypoint(44, 1954.87, 1592.02, 82.18); - thisAI->AddWaypoint(45, 1948.35, 1571.35, 80.96, 30000); - thisAI->AddWaypoint(46, 1947.02, 1566.42, 81.80, 30000); - - return thisAI; + return new npc_willixAI(pCreature); } void AddSC_razorfen_kraul() diff --git a/src/bindings/scripts/scripts/kalimdor/stonetalon_mountains.cpp b/src/bindings/scripts/scripts/kalimdor/stonetalon_mountains.cpp index 2b927af4852..272cef3d33b 100644 --- a/src/bindings/scripts/scripts/kalimdor/stonetalon_mountains.cpp +++ b/src/bindings/scripts/scripts/kalimdor/stonetalon_mountains.cpp @@ -101,7 +101,7 @@ struct TRINITY_DLL_DECL npc_kaya_flathoofAI : public npc_escortAI void WaypointReached(uint32 i) { - Player* pPlayer = Unit::GetPlayer(PlayerGUID); + Player* pPlayer = GetPlayerForEscort(); if (!pPlayer) return; @@ -116,8 +116,8 @@ struct TRINITY_DLL_DECL npc_kaya_flathoofAI : public npc_escortAI break; case 18: m_creature->SetInFront(pPlayer); DoScriptText(SAY_END, m_creature, pPlayer); - if (pPlayer && pPlayer->GetTypeId() == TYPEID_PLAYER) - CAST_PLR(pPlayer)->GroupEventHappens(QUEST_PROTECT_KAYA, m_creature); + if (pPlayer) + pPlayer->GroupEventHappens(QUEST_PROTECT_KAYA, m_creature); break; } } diff --git a/src/bindings/scripts/scripts/kalimdor/tanaris.cpp b/src/bindings/scripts/scripts/kalimdor/tanaris.cpp index 9745fce9966..813e178b6f0 100644 --- a/src/bindings/scripts/scripts/kalimdor/tanaris.cpp +++ b/src/bindings/scripts/scripts/kalimdor/tanaris.cpp @@ -153,7 +153,7 @@ struct TRINITY_DLL_DECL npc_custodian_of_timeAI : public npc_escortAI void WaypointReached(uint32 i) { - Player *pPlayer = Unit::GetPlayer(PlayerGUID); + Player *pPlayer = GetPlayerForEscort(); if (!pPlayer) return; @@ -357,7 +357,7 @@ struct TRINITY_DLL_DECL npc_OOX17AI : public npc_escortAI void WaypointReached(uint32 i) { - Player* pPlayer = Unit::GetPlayer(PlayerGUID); + Player* pPlayer = GetPlayerForEscort(); if (!pPlayer) return; @@ -424,97 +424,7 @@ bool QuestAccept_npc_OOX17(Player* pPlayer, Creature* pCreature, Quest const* qu CreatureAI* GetAI_npc_OOX17(Creature* pCreature) { - npc_OOX17AI* OOX17AI = new npc_OOX17AI(pCreature); - - OOX17AI->AddWaypoint(0, -8843.73, -4374.44, 43.71); - OOX17AI->AddWaypoint(1, -8834.68, -4373.88, 45.71); - OOX17AI->AddWaypoint(2, -8832.93, -4373.85, 45.67); - OOX17AI->AddWaypoint(3, -8829.21, -4373.72, 44.14); - OOX17AI->AddWaypoint(4, -8825.10, -4373.56, 41.44); - OOX17AI->AddWaypoint(5, -8818.88, -4372.75, 36.43); - OOX17AI->AddWaypoint(6, -8803.37, -4369.68, 30.06); - OOX17AI->AddWaypoint(7, -8786.68, -4366.18, 23.91); - OOX17AI->AddWaypoint(8, -8764.97, -4366.94, 25.23); - OOX17AI->AddWaypoint(9, -8745.49, -4363.16, 22.80); - OOX17AI->AddWaypoint(10, -8724.13, -4353.55, 20.72); - OOX17AI->AddWaypoint(11, -8706.77, -4346.14, 16.12); - OOX17AI->AddWaypoint(12, -8688.27, -4372.85, 13.64); - OOX17AI->AddWaypoint(13, -8668.76, -4380.38, 11.69); - OOX17AI->AddWaypoint(14, -8645.19, -4388.62, 12.56); - OOX17AI->AddWaypoint(15, -8614.73, -4398.60, 9.86); - OOX17AI->AddWaypoint(16, -8560.33, -4411.27, 13.17); - OOX17AI->AddWaypoint(17, -8536.45, -4416.49, 11.84); - OOX17AI->AddWaypoint(18, -8503.48, -4423.70, 13.59); - OOX17AI->AddWaypoint(19, -8471.91, -4430.60, 9.56); - OOX17AI->AddWaypoint(20, -8441.36, -4435.31, 9.40); - OOX17AI->AddWaypoint(21, -8403.41, -4441.16, 11.83); - OOX17AI->AddWaypoint(22, -8371.24, -4446.13, 9.47); - OOX17AI->AddWaypoint(23, -8353.96, -4448.79, 10.10); //Scorpid - OOX17AI->AddWaypoint(24, -8336.40, -4446.39, 8.98); - OOX17AI->AddWaypoint(25, -8303.78, -4441.96, 11.89); - OOX17AI->AddWaypoint(26, -8272.20, -4433.31, 9.60); - OOX17AI->AddWaypoint(27, -8224.76, -4419.39, 13.03); - OOX17AI->AddWaypoint(28, -8193.31, -4406.04, 10.17); - OOX17AI->AddWaypoint(29, -8155.65, -4397.74, 8.99); - OOX17AI->AddWaypoint(30, -8129.25, -4394.57, 10.92); - OOX17AI->AddWaypoint(31, -8104.86, -4399.03, 8.93); - OOX17AI->AddWaypoint(32, -8063.15, -4423.40, 10.07); - OOX17AI->AddWaypoint(33, -8032.15, -4443.47, 9.97); - OOX17AI->AddWaypoint(34, -8015.39, -4454.33, 9.39); - OOX17AI->AddWaypoint(35, -7981.64, -4482.44, 10.32); - OOX17AI->AddWaypoint(36, -7958.83, -4503.98, 9.69); - OOX17AI->AddWaypoint(37, -7932.45, -4528.91, 10.08); - OOX17AI->AddWaypoint(38, -7904.09, -4566.67, 12.59); - OOX17AI->AddWaypoint(39, -7883.33, -4593.91, 12.15); - OOX17AI->AddWaypoint(40, -7862.83, -4624.53, 10.21); - OOX17AI->AddWaypoint(41, -7840.79, -4654.26, 9.45); - OOX17AI->AddWaypoint(42, -7826.17, -4673.99, 10.61); - OOX17AI->AddWaypoint(43, -7807.86, -4698.69, 11.24); - OOX17AI->AddWaypoint(44, -7793.88, -4717.55, 10.48); - OOX17AI->AddWaypoint(45, -7778.68, -4738.05, 8.89); - OOX17AI->AddWaypoint(46, -7746.42, -4780.39, 9.84); - OOX17AI->AddWaypoint(47, -7724.11, -4772.75, 10.28); - OOX17AI->AddWaypoint(48, -7697.98, -4763.80, 9.52); - OOX17AI->AddWaypoint(49, -7665.33, -4752.62, 10.56); - OOX17AI->AddWaypoint(50, -7641.47, -4750.33, 8.94); - OOX17AI->AddWaypoint(51, -7620.08, -4753.96, 8.93); - OOX17AI->AddWaypoint(52, -7603.15, -4757.53, 9.06); - OOX17AI->AddWaypoint(53, -7579.43, -4767.07, 8.93); - OOX17AI->AddWaypoint(54, -7558.51, -4779.01, 9.64); - OOX17AI->AddWaypoint(55, -7536.40, -4789.32, 8.92); - OOX17AI->AddWaypoint(56, -7512.07, -4793.50, 9.35); //Wastewander - OOX17AI->AddWaypoint(57, -7490.79, -4788.80, 10.53); - OOX17AI->AddWaypoint(58, -7469.10, -4785.11, 10.42); - OOX17AI->AddWaypoint(59, -7453.18, -4782.41, 9.15); - OOX17AI->AddWaypoint(60, -7426.27, -4777.83, 9.54); - OOX17AI->AddWaypoint(61, -7393.84, -4770.19, 12.57); - OOX17AI->AddWaypoint(62, -7367.25, -4764.17, 11.92); - OOX17AI->AddWaypoint(63, -7341.00, -4752.11, 10.17); - OOX17AI->AddWaypoint(64, -7321.62, -4744.97, 11.58); - OOX17AI->AddWaypoint(65, -7302.35, -4744.35, 11.97); - OOX17AI->AddWaypoint(66, -7281.00, -4743.66, 11.21); - OOX17AI->AddWaypoint(67, -7258.33, -4742.93, 9.64); - OOX17AI->AddWaypoint(68, -7236.70, -4742.24, 10.16); - OOX17AI->AddWaypoint(69, -7217.52, -4743.87, 10.79); - OOX17AI->AddWaypoint(70, -7201.86, -4746.32, 9.58); - OOX17AI->AddWaypoint(71, -7182.01, -4749.41, 9.09); - OOX17AI->AddWaypoint(72, -7159.61, -4752.90, 9.52); - OOX17AI->AddWaypoint(73, -7139.58, -4756.02, 9.53); - OOX17AI->AddWaypoint(74, -7122.60, -4754.91, 9.66); - OOX17AI->AddWaypoint(75, -7101.06, -4753.87, 8.92); - OOX17AI->AddWaypoint(76, -7082.79, -4752.99, 9.97); - OOX17AI->AddWaypoint(77, -7061.81, -4751.98, 9.26); - OOX17AI->AddWaypoint(78, -7035.12, -4754.39, 9.19); - OOX17AI->AddWaypoint(79, -7013.90, -4758.64, 10.28); - OOX17AI->AddWaypoint(80, -7001.71, -4769.73, 10.59); - OOX17AI->AddWaypoint(81, -6984.95, -4788.61, 9.30); - OOX17AI->AddWaypoint(82, -6970.41, -4788.77, 9.42); - OOX17AI->AddWaypoint(83, -6957.16, -4788.92, 6.26); - OOX17AI->AddWaypoint(84, -6951.29, -4802.73, 4.45); - OOX17AI->AddWaypoint(85, -6944.81, -4816.58, 1.60); - OOX17AI->AddWaypoint(86, -6942.06, -4839.40, 0.66,5000); - - return OOX17AI; + return new npc_OOX17AI(pCreature); } /*#### @@ -631,8 +541,7 @@ struct MANGOS_DLL_DECL npc_toogaAI : public ScriptedAI void JustRespawned() { - if (m_creature->getFaction() != m_creature->GetCreatureInfo()->faction_A) - m_creature->setFaction(m_creature->GetCreatureInfo()->faction_A); + me->RestoreFaction(); m_creature->SetUInt32Value(UNIT_NPC_FLAGS, m_creature->GetCreatureInfo()->npcflag); @@ -684,7 +593,10 @@ struct MANGOS_DLL_DECL npc_toogaAI : public ScriptedAI void JustDied(Unit* pKiller) { if (Player* pPlayer = Unit::GetPlayer(m_uiPlayerGUID)) - pPlayer->FailQuest(QUEST_TOOGA); + { + if (pPlayer->GetQuestStatus(QUEST_TOOGA) == QUEST_STATUS_INCOMPLETE) + pPlayer->FailQuest(QUEST_TOOGA); + } m_uiPlayerGUID = 0; m_creature->GetMotionMaster()->MovementExpired(); diff --git a/src/bindings/scripts/scripts/kalimdor/the_barrens.cpp b/src/bindings/scripts/scripts/kalimdor/the_barrens.cpp index d17d0b06cd1..d957ba26ae7 100644 --- a/src/bindings/scripts/scripts/kalimdor/the_barrens.cpp +++ b/src/bindings/scripts/scripts/kalimdor/the_barrens.cpp @@ -94,7 +94,7 @@ struct TRINITY_DLL_DECL npc_giltharesAI : public npc_escortAI void WaypointReached(uint32 uiPointId) { - Player* pPlayer = (Player*)Unit::GetUnit(*m_creature, PlayerGUID); + Player* pPlayer = GetPlayerForEscort(); if (!pPlayer) return; @@ -507,75 +507,143 @@ CreatureAI* GetAI_npc_twiggy_flathead(Creature* pCreature) enum { - SAY_PROGRESS_1 = -1000272, - SAY_PROGRESS_2 = -1000273, - SAY_PROGRESS_3 = -1000274, - - SAY_MERCENARY_4 = -1000275, - - SAY_PROGRESS_5 = -1000276, - SAY_PROGRESS_6 = -1000277, - SAY_PROGRESS_7 = -1000278, - SAY_PROGRESS_8 = -1000279, + SAY_START = -1000272, + SAY_STARTUP1 = -1000273, + SAY_STARTUP2 = -1000274, + SAY_MERCENARY = -1000275, + SAY_PROGRESS_1 = -1000276, + SAY_PROGRESS_2 = -1000277, + SAY_PROGRESS_3 = -1000278, + SAY_END = -1000279, QUEST_ESCAPE = 863, FACTION_RATCHET = 637, - NPC_PILOT = 3451, - MOB_MERCENARY = 3282, + NPC_PILOT_WIZZ = 3451, + NPC_MERCENARY = 3282, }; struct TRINITY_DLL_DECL npc_wizzlecrank_shredderAI : public npc_escortAI { - npc_wizzlecrank_shredderAI(Creature* c) : npc_escortAI(c) { } + npc_wizzlecrank_shredderAI(Creature* pCreature) : npc_escortAI(pCreature) + { + m_bIsPostEvent = false; + m_uiPostEventTimer = 1000; + m_uiPostEventCount = 0; + } - bool Completed; + bool m_bIsPostEvent; + uint32 m_uiPostEventTimer; + uint32 m_uiPostEventCount; - void WaypointReached(uint32 i) + void Reset() { - Player* pPlayer = Unit::GetPlayer(PlayerGUID); + if (!IsBeingEscorted) + { + if (m_creature->getStandState() == UNIT_STAND_STATE_DEAD) + m_creature->SetStandState(UNIT_STAND_STATE_STAND); + + m_bIsPostEvent = false; + m_uiPostEventTimer = 1000; + m_uiPostEventCount = 0; + } + } + + void WaypointReached(uint32 uiPointId) + { + Player* pPlayer = GetPlayerForEscort(); if (!pPlayer) return; - switch(i) + switch(uiPointId) { - case 0: DoScriptText(SAY_PROGRESS_1, m_creature); - m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); break; - case 1: DoScriptText(SAY_PROGRESS_2, m_creature); break; - case 10: DoScriptText(SAY_PROGRESS_3, m_creature, pPlayer); - m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); break; - case 20:{ - Unit* Mercenary = m_creature->FindNearestCreature(MOB_MERCENARY, 99); - if (Mercenary) + case 0: + DoScriptText(SAY_STARTUP1, m_creature); + break; + case 9: + SetRun(false); + break; + case 17: + if (Creature* pTemp = m_creature->SummonCreature(NPC_MERCENARY, 1128.489f, -3037.611f, 92.701f, 1.472f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000)) { - DoScriptText(SAY_MERCENARY_4, Mercenary); - CAST_CRE(Mercenary)->AI()->AttackStart(m_creature); - AttackStart(Mercenary); + DoScriptText(SAY_MERCENARY, pTemp); + m_creature->SummonCreature(NPC_MERCENARY, 1160.172f, -2980.168f, 97.313f, 3.690f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000); } - }break; - case 21: DoScriptText(SAY_PROGRESS_5, m_creature); - m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); break; - case 28: DoScriptText(SAY_PROGRESS_6, m_creature); break; - case 29: DoScriptText(SAY_PROGRESS_7, m_creature); break; - case 30: DoScriptText(SAY_PROGRESS_8, m_creature); break; - case 31: m_creature->SummonCreature(NPC_PILOT, 1088.77, -2985.39, 91.84, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 300000); - m_creature->setDeathState(JUST_DIED); - Completed = true; - pPlayer->GroupEventHappens(QUEST_ESCAPE, m_creature); + break; + case 24: + m_bIsPostEvent = true; break; } } - void Reset() + void WaypointStart(uint32 uiPointId) { - m_creature->setDeathState(ALIVE); - Completed = false; - if (!IsBeingEscorted) + Player* pPlayer = GetPlayerForEscort(); + + if (!pPlayer) + return; + + switch(uiPointId) { - if (m_creature->getStandState() == UNIT_STAND_STATE_DEAD) - m_creature->SetStandState(UNIT_STAND_STATE_STAND); + case 9: + DoScriptText(SAY_STARTUP2, m_creature, pPlayer); + break; + case 18: + DoScriptText(SAY_PROGRESS_1, m_creature, pPlayer); + SetRun(); + break; } } + + void JustSummoned(Creature* pSummoned) + { + if (pSummoned->GetEntry() == NPC_PILOT_WIZZ) + m_creature->SetStandState(UNIT_STAND_STATE_DEAD); + + if (pSummoned->GetEntry() == NPC_MERCENARY) + pSummoned->AI()->AttackStart(m_creature); + } + + void UpdateEscortAI(const uint32 uiDiff) + { + if (!UpdateVictim()) + { + if (m_bIsPostEvent) + { + if (m_uiPostEventTimer < uiDiff) + { + switch(m_uiPostEventCount) + { + case 0: + DoScriptText(SAY_PROGRESS_2, m_creature); + break; + case 1: + DoScriptText(SAY_PROGRESS_3, m_creature); + break; + case 2: + DoScriptText(SAY_END, m_creature); + break; + case 3: + if (Player* pPlayer = GetPlayerForEscort()) + { + pPlayer->GroupEventHappens(QUEST_ESCAPE, m_creature); + m_creature->SummonCreature(NPC_PILOT_WIZZ, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 180000); + } + break; + } + + ++m_uiPostEventCount; + m_uiPostEventTimer = 5000; + } + else + m_uiPostEventTimer -= uiDiff; + } + + return; + } + + DoMeleeAttackIfReady(); + } }; bool QuestAccept_npc_wizzlecrank_shredder(Player* pPlayer, Creature* pCreature, Quest const* quest) @@ -591,42 +659,7 @@ bool QuestAccept_npc_wizzlecrank_shredder(Player* pPlayer, Creature* pCreature, CreatureAI* GetAI_npc_wizzlecrank_shredderAI(Creature* pCreature) { - npc_wizzlecrank_shredderAI* thisAI = new npc_wizzlecrank_shredderAI(pCreature); - - thisAI->AddWaypoint(0, 1109.15, -3104.11, 82.41, 6000); - thisAI->AddWaypoint(1, 1105.39, -3102.86, 82.74, 2000); - thisAI->AddWaypoint(2, 1104.97, -3108.52, 83.10, 1000); - thisAI->AddWaypoint(3, 1110.01, -3110.48, 82.81, 1000); - thisAI->AddWaypoint(4, 1111.72, -3103.03, 82.21, 1000); - thisAI->AddWaypoint(5, 1106.98, -3099.44, 82.18, 1000); - thisAI->AddWaypoint(6, 1103.74, -3103.29, 83.05, 1000); - thisAI->AddWaypoint(7, 1112.55, -3106.56, 82.31, 1000); - thisAI->AddWaypoint(8, 1108.12, -3111.04, 82.99, 1000); - thisAI->AddWaypoint(9, 1109.32, -3100.39, 82.08, 1000); - thisAI->AddWaypoint(10, 1109.32, -3100.39, 82.08, 6000); - thisAI->AddWaypoint(11, 1098.92, -3095.14, 82.97); - thisAI->AddWaypoint(12, 1100.94, -3082.60, 82.83); - thisAI->AddWaypoint(13, 1101.12, -3068.83, 82.53); - thisAI->AddWaypoint(14, 1096.97, -3051.99, 82.50); - thisAI->AddWaypoint(15, 1094.06, -3036.79, 82.70); - thisAI->AddWaypoint(16, 1098.22, -3027.84, 83.79); - thisAI->AddWaypoint(17, 1109.51, -3015.92, 85.73); - thisAI->AddWaypoint(18, 1119.87, -3007.21, 87.08); - thisAI->AddWaypoint(19, 1130.23, -3002.49, 91.27, 5000); - thisAI->AddWaypoint(20, 1130.23, -3002.49, 91.27, 3000); - thisAI->AddWaypoint(21, 1130.23, -3002.49, 91.27, 4000); - thisAI->AddWaypoint(22, 1129.73, -2985.89, 92.46); - thisAI->AddWaypoint(23, 1124.10, -2983.29, 92.81); - thisAI->AddWaypoint(24, 1111.74, -2992.38, 91.59); - thisAI->AddWaypoint(25, 1111.06, -2976.54, 91.81); - thisAI->AddWaypoint(26, 1099.91, -2991.17, 91.67); - thisAI->AddWaypoint(27, 1096.32, -2981.55, 91.73); - thisAI->AddWaypoint(28, 1091.28, -2985.82, 91.74, 4000); - thisAI->AddWaypoint(29, 1091.28, -2985.82, 91.74, 3000); - thisAI->AddWaypoint(30, 1091.28, -2985.82, 91.74, 7000); - thisAI->AddWaypoint(31, 1091.28, -2985.82, 91.74, 3000); - - return thisAI; + return new npc_wizzlecrank_shredderAI(pCreature); } void AddSC_the_barrens() diff --git a/src/bindings/scripts/scripts/kalimdor/thousand_needles.cpp b/src/bindings/scripts/scripts/kalimdor/thousand_needles.cpp index be0c2db5aa9..24e6a21e743 100644 --- a/src/bindings/scripts/scripts/kalimdor/thousand_needles.cpp +++ b/src/bindings/scripts/scripts/kalimdor/thousand_needles.cpp @@ -60,7 +60,7 @@ struct TRINITY_DLL_DECL npc_kanatiAI : public npc_escortAI DoSpawnGalak(); break; case 1: - if (Player* pPlayer = Unit::GetPlayer(PlayerGUID)) + if (Player* pPlayer = GetPlayerForEscort()) pPlayer->GroupEventHappens(QUEST_PROTECT_KANATI, m_creature); break; } @@ -149,7 +149,7 @@ struct TRINITY_DLL_DECL npc_lakota_windsongAI : public npc_escortAI DoSpawnBandits(ID_AMBUSH_3); break; case 45: - if (Player* pPlayer = (Player*)Unit::GetUnit(*m_creature, PlayerGUID)) + if (Player* pPlayer = GetPlayerForEscort()) pPlayer->GroupEventHappens(QUEST_FREE_AT_LAST, m_creature); break; } @@ -222,7 +222,7 @@ struct TRINITY_DLL_DECL npc_paoka_swiftmountainAI : public npc_escortAI DoScriptText(SAY_COMPLETE, m_creature); break; case 27: - if (Player* pPlayer = (Player*)Unit::GetUnit(*m_creature, PlayerGUID)) + if (Player* pPlayer = GetPlayerForEscort()) pPlayer->GroupEventHappens(QUEST_HOMEWARD, m_creature); break; } diff --git a/src/bindings/scripts/scripts/kalimdor/ungoro_crater.cpp b/src/bindings/scripts/scripts/kalimdor/ungoro_crater.cpp index 323faf67814..81f122d61db 100644 --- a/src/bindings/scripts/scripts/kalimdor/ungoro_crater.cpp +++ b/src/bindings/scripts/scripts/kalimdor/ungoro_crater.cpp @@ -51,7 +51,7 @@ struct TRINITY_DLL_DECL npc_ameAI : public npc_escortAI void WaypointReached(uint32 i) { - Player* pPlayer = Unit::GetPlayer(PlayerGUID); + Player* pPlayer = GetPlayerForEscort(); if (!pPlayer) return; @@ -76,21 +76,18 @@ struct TRINITY_DLL_DECL npc_ameAI : public npc_escortAI break; case 55: DoScriptText(SAY_FINISH, m_creature, pPlayer); - if (pPlayer && pPlayer->GetTypeId() == TYPEID_PLAYER) - CAST_PLR(pPlayer)->GroupEventHappens(QUEST_CHASING_AME,m_creature); + if (pPlayer) + pPlayer->GroupEventHappens(QUEST_CHASING_AME,m_creature); break; } - } + } void Reset() { DEMORALIZINGSHOUT_Timer = 5000; } - void EnterCombat(Unit* who) - {} - void JustSummoned(Creature* summoned) { summoned->AI()->AttackStart(m_creature); @@ -98,11 +95,8 @@ struct TRINITY_DLL_DECL npc_ameAI : public npc_escortAI void JustDied(Unit* killer) { - if (PlayerGUID) - { - if (Player* pPlayer = Unit::GetPlayer(PlayerGUID)) - CAST_PLR(pPlayer)->FailQuest(QUEST_CHASING_AME); - } + if (Player* pPlayer = GetPlayerForEscort()) + pPlayer->FailQuest(QUEST_CHASING_AME); } void UpdateAI(const uint32 diff) @@ -135,66 +129,7 @@ bool QuestAccept_npc_ame(Player* pPlayer, Creature* pCreature, Quest const* ques CreatureAI* GetAI_npc_ame(Creature* pCreature) { - npc_ameAI* thisAI = new npc_ameAI(pCreature); - - thisAI->AddWaypoint(1, -6380.38, -1965.14, -258.292, 5000); - thisAI->AddWaypoint(2, -6383.06, -1962.9, -258.936); - thisAI->AddWaypoint(3, -6391.09, -1956.13, -260.291); - thisAI->AddWaypoint(4, -6395.29, -1933.58, -262.949); - thisAI->AddWaypoint(5, -6396.58, -1919.93, -263.838); - thisAI->AddWaypoint(6, -6389.01, -1912.64, -260.689); - thisAI->AddWaypoint(7, -6369.19, -1892.87, -255.924); - thisAI->AddWaypoint(8, -6373.77, -1879.36, -259.268); - thisAI->AddWaypoint(9, -6377.55, -1869.56, -260.503); - thisAI->AddWaypoint(10, -6376.58, -1860.79, -260.026); - thisAI->AddWaypoint(11, -6373.13, -1847.22, -259.249); - thisAI->AddWaypoint(12, -6370.54, -1837.04, -260.007); - thisAI->AddWaypoint(13, -6372.52, -1829.16, -260.071); - thisAI->AddWaypoint(14, -6377.13, -1815.94, -262.632); - thisAI->AddWaypoint(15, -6380.27, -1806.95, -265.53); - thisAI->AddWaypoint(16, -6386.04, -1790.43, -268.546); - thisAI->AddWaypoint(17, -6386.72, -1776.29, -269.851); - thisAI->AddWaypoint(18, -6385.92, -1762.31, -271.494); - thisAI->AddWaypoint(19, -6384.69, -1744.86, -272.196); - thisAI->AddWaypoint(20, -6383.8, -1732.66, -272.222); - thisAI->AddWaypoint(21, -6382.66, -1716.96, -272.235); - thisAI->AddWaypoint(22, -6381.5, -1703.01, -272.964); - thisAI->AddWaypoint(23, -6379.96, -1685.58, -272.842); - thisAI->AddWaypoint(24, -6379.34, -1678.61, -272.34); - thisAI->AddWaypoint(25, -6364.45, -1636.27, -271.065); - thisAI->AddWaypoint(26, -6371.85, -1626.36, -272.188); - thisAI->AddWaypoint(27, -6383.5, -1629.01, -272.206); - thisAI->AddWaypoint(28, -6388.09, -1635.37, -272.105, 5000); - thisAI->AddWaypoint(29, -6375.42, -1637.33, -272.193); - thisAI->AddWaypoint(30, -6365.46, -1617.25, -272.141); - thisAI->AddWaypoint(31, -6353.79, -1603.48, -271.932); - thisAI->AddWaypoint(32, -6340.24, -1592.41, -269.435); - thisAI->AddWaypoint(33, -6329.45, -1566.89, -269.895); - thisAI->AddWaypoint(34, -6312.2, -1499.06, -269.507); - thisAI->AddWaypoint(35, -6304.55, -1468.5, -269.431); - thisAI->AddWaypoint(36, -6310.36, -1440.94, -268.427); - thisAI->AddWaypoint(37, -6321, -1418.91, -266.525); - thisAI->AddWaypoint(38, -6358.76, -1389.97, -267.522); - thisAI->AddWaypoint(39, -6378.65, -1375.67, -271.749); - thisAI->AddWaypoint(40, -6387.22, -1360.95, -272.109); - thisAI->AddWaypoint(41, -6406.95, -1323.87, -271.586); - thisAI->AddWaypoint(42, -6405, -1311.92, -271.906); - thisAI->AddWaypoint(43, -6395.56, -1303.62, -271.902); - thisAI->AddWaypoint(44, -6375.97, -1296.08, -271.865); - thisAI->AddWaypoint(45, -6364.39, -1281.23, -269.012); - thisAI->AddWaypoint(46, -6353.71, -1263.19, -267.95); - thisAI->AddWaypoint(47, -6340.09, -1248.65, -267.441); - thisAI->AddWaypoint(48, -6338.21, -1237.11, -267.844); - thisAI->AddWaypoint(49, -6336.6, -1219.69, -269.196); - thisAI->AddWaypoint(50, -6334.44, -1202.33, -271.527); - thisAI->AddWaypoint(51, -6329.56, -1189.82, -270.947); - thisAI->AddWaypoint(52, -6324.66, -1179.46, -270.103); - thisAI->AddWaypoint(53, -6315.08, -1176.74, -269.735); - thisAI->AddWaypoint(54, -6308.49, -1179.12, -269.57); - thisAI->AddWaypoint(55, -6302.43, -1181.32, -269.328, 5000); - thisAI->AddWaypoint(56, -6298.87, -1185.79, -269.278); - - return thisAI; + return new npc_ameAI(pCreature); } void AddSC_ungoro_crater() diff --git a/src/bindings/scripts/scripts/northrend/sholazar_basin.cpp b/src/bindings/scripts/scripts/northrend/sholazar_basin.cpp index bb97fb12d18..41454f330f1 100644 --- a/src/bindings/scripts/scripts/northrend/sholazar_basin.cpp +++ b/src/bindings/scripts/scripts/northrend/sholazar_basin.cpp @@ -64,7 +64,7 @@ struct TRINITY_DLL_DECL npc_injured_rainspeaker_oracleAI : public npc_escortAI void WaypointReached(uint32 i) { - Player* pPlayer = Unit::GetPlayer(PlayerGUID); + Player* pPlayer = GetPlayerForEscort(); if (!pPlayer) return; @@ -90,7 +90,7 @@ struct TRINITY_DLL_DECL npc_injured_rainspeaker_oracleAI : public npc_escortAI m_creature->SetUnitMovementFlags(MOVEMENTFLAG_JUMPING); break; case 28: - if (Player* pPlayer = Unit::GetPlayer(PlayerGUID)) + if (Player* pPlayer = GetPlayerForEscort()) pPlayer->GroupEventHappens(QUEST_FORTUNATE_MISUNDERSTANDINGS, m_creature); // me->RestoreFaction(); DoScriptText(SAY_END_IRO,m_creature); @@ -104,17 +104,12 @@ struct TRINITY_DLL_DECL npc_injured_rainspeaker_oracleAI : public npc_escortAI if (!IsBeingEscorted) return; - if (Player* pPlayer = Unit::GetPlayer(PlayerGUID)) + if (Player* pPlayer = GetPlayerForEscort()) { if (pPlayer->GetQuestStatus(QUEST_FORTUNATE_MISUNDERSTANDINGS) != QUEST_STATUS_COMPLETE) pPlayer->FailQuest(QUEST_FORTUNATE_MISUNDERSTANDINGS); } } - - void UpdateAI(Player* pPlayer, Creature* pCreature,const uint32 diff) - { - npc_escortAI::UpdateAI(diff); - } }; diff --git a/src/bindings/scripts/scripts/outland/hellfire_peninsula.cpp b/src/bindings/scripts/scripts/outland/hellfire_peninsula.cpp index 209d11c3509..9e7e6145178 100644 --- a/src/bindings/scripts/scripts/outland/hellfire_peninsula.cpp +++ b/src/bindings/scripts/scripts/outland/hellfire_peninsula.cpp @@ -70,8 +70,6 @@ struct TRINITY_DLL_DECL npc_aeranasAI : public ScriptedAI DoScriptText(SAY_SUMMON, m_creature); } - void EnterCombat(Unit *who) {} - void UpdateAI(const uint32 diff) { if (Faction_Timer) @@ -227,9 +225,9 @@ struct TRINITY_DLL_DECL npc_wounded_blood_elfAI : public npc_escortAI void WaypointReached(uint32 i) { - Player* pPlayer = Unit::GetPlayer(PlayerGUID); + Player* pPlayer = GetPlayerForEscort(); - if (!pPlayer || pPlayer->GetTypeId() != TYPEID_PLAYER) + if (!pPlayer) return; switch (i) diff --git a/src/bindings/scripts/scripts/outland/netherstorm.cpp b/src/bindings/scripts/scripts/outland/netherstorm.cpp index 1e3c4349116..8d1aa2c3b3c 100644 --- a/src/bindings/scripts/scripts/outland/netherstorm.cpp +++ b/src/bindings/scripts/scripts/outland/netherstorm.cpp @@ -803,20 +803,15 @@ struct TRINITY_DLL_DECL npc_bessyAI : public npc_escortAI npc_bessyAI(Creature *c) : npc_escortAI(c) {} - bool Completed; - void JustDied(Unit* killer) { - if (PlayerGUID) - { - if (Player* pPlayer = Unit::GetPlayer(PlayerGUID)) - CAST_PLR(pPlayer)->FailQuest(Q_ALMABTRIEB); - } + if (Player* pPlayer = GetPlayerForEscort()) + pPlayer->FailQuest(Q_ALMABTRIEB); } void WaypointReached(uint32 i) { - Player* pPlayer = Unit::GetPlayer(PlayerGUID); + Player* pPlayer = GetPlayerForEscort(); if (!pPlayer) return; @@ -836,17 +831,12 @@ struct TRINITY_DLL_DECL npc_bessyAI : public npc_escortAI case 12: if (pPlayer) - { - CAST_PLR(pPlayer)->GroupEventHappens(Q_ALMABTRIEB, m_creature); - Completed = true; - } - {Unit* Thadell = me->FindNearestCreature(N_THADELL, 30); - if (Thadell) - DoScriptText(SAY_THADELL_1, m_creature);}break; + pPlayer->GroupEventHappens(Q_ALMABTRIEB, m_creature); + if (Unit* Thadell = me->FindNearestCreature(N_THADELL, 30)) + DoScriptText(SAY_THADELL_1, m_creature); break; case 13: - {Unit* Thadell = me->FindNearestCreature(N_THADELL, 30); - if (Thadell) - DoScriptText(SAY_THADELL_2, m_creature, pPlayer);}break; + if (Unit* Thadell = me->FindNearestCreature(N_THADELL, 30)) + DoScriptText(SAY_THADELL_2, m_creature, pPlayer); break; } } @@ -855,17 +845,9 @@ struct TRINITY_DLL_DECL npc_bessyAI : public npc_escortAI summoned->AI()->AttackStart(m_creature); } - void EnterCombat(Unit* who){} - void Reset() { - Completed = false; - m_creature->setFaction(35); - } - - void UpdateAI(const uint32 diff) - { - npc_escortAI::UpdateAI(diff); + me->RestoreFaction(); } }; @@ -883,24 +865,7 @@ bool QuestAccept_npc_bessy(Player* pPlayer, Creature* pCreature, Quest const* qu CreatureAI* GetAI_npc_bessy(Creature* pCreature) { - npc_bessyAI* bessyAI = new npc_bessyAI(pCreature); - - bessyAI->AddWaypoint(0, 2488.77, 2184.89, 104.64); - bessyAI->AddWaypoint(1, 2478.72, 2184.77, 98.58); - bessyAI->AddWaypoint(2, 2473.52, 2184.71, 99.00); - bessyAI->AddWaypoint(3, 2453.15, 2184.96, 97.09,4000); - bessyAI->AddWaypoint(4, 2424.18, 2184.15, 94.11); - bessyAI->AddWaypoint(5, 2413.18, 2184.15, 93.42); - bessyAI->AddWaypoint(6, 2402.02, 2183.90, 87.59); - bessyAI->AddWaypoint(7, 2333.31, 2181.63, 90.03,4000); - bessyAI->AddWaypoint(8, 2308.73, 2184.34, 92.04); - bessyAI->AddWaypoint(9, 2303.10, 2196.89, 94.94); - bessyAI->AddWaypoint(10, 2304.58, 2272.23, 96.67); - bessyAI->AddWaypoint(11, 2297.09, 2271.40, 95.16); - bessyAI->AddWaypoint(12, 2297.68, 2266.79, 95.07,4000); - bessyAI->AddWaypoint(13, 2297.67, 2266.76, 95.07,4000); - - return bessyAI; + return new npc_bessyAI(pCreature); } /*###### diff --git a/src/bindings/scripts/scripts/outland/shadowmoon_valley.cpp b/src/bindings/scripts/scripts/outland/shadowmoon_valley.cpp index 998cedf9c1e..5ef2be74bf9 100644 --- a/src/bindings/scripts/scripts/outland/shadowmoon_valley.cpp +++ b/src/bindings/scripts/scripts/outland/shadowmoon_valley.cpp @@ -83,8 +83,6 @@ struct TRINITY_DLL_DECL mob_mature_netherwing_drakeAI : public ScriptedAI CastTimer = 5000; } - void EnterCombat(Unit* who) { } - void SpellHit(Unit* pCaster, SpellEntry const* pSpell) { if (bCanEat || bIsEating) @@ -205,8 +203,6 @@ struct TRINITY_DLL_DECL mob_enslaved_netherwing_drakeAI : public ScriptedAI m_creature->SetVisibility(VISIBILITY_ON); } - void EnterCombat(Unit* who) { } - void SpellHit(Unit* caster, const SpellEntry* spell) { if (!caster) @@ -325,8 +321,6 @@ struct TRINITY_DLL_DECL mob_dragonmaw_peonAI : public ScriptedAI PoisonTimer = 0; } - void EnterCombat(Unit* who) { } - void SpellHit(Unit* caster, const SpellEntry* spell) { if (!caster) @@ -696,8 +690,6 @@ struct TRINITY_DLL_DECL npc_overlord_morghorAI : public ScriptedAI Event = false; } - void EnterCombat(Unit* who){} - void StartEvent() { m_creature->SetUInt32Value(UNIT_NPC_FLAGS, 0); @@ -891,7 +883,7 @@ struct TRINITY_DLL_DECL npc_earthmender_wildaAI : public npc_escortAI void WaypointReached(uint32 uiPointId) { - Player* pPlayer = (Player*)Unit::GetUnit(*m_creature, PlayerGUID); + Player* pPlayer = GetPlayerForEscort(); if (!pPlayer) return; @@ -944,7 +936,7 @@ struct TRINITY_DLL_DECL npc_earthmender_wildaAI : public npc_escortAI case 50: DoScriptText(SAY_WIL_END, m_creature, pPlayer); - if (Player* pPlayer = Unit::GetPlayer(PlayerGUID)) + if (Player* pPlayer = GetPlayerForEscort()) pPlayer->GroupEventHappens(QUEST_ESCAPE_COILSCAR, m_creature); break; } diff --git a/src/bindings/scripts/scripts/outland/shattrath_city.cpp b/src/bindings/scripts/scripts/outland/shattrath_city.cpp index 5e0904f7661..23d54ce83b6 100644 --- a/src/bindings/scripts/scripts/outland/shattrath_city.cpp +++ b/src/bindings/scripts/scripts/outland/shattrath_city.cpp @@ -61,12 +61,9 @@ struct TRINITY_DLL_DECL npc_raliq_the_drunkAI : public ScriptedAI void Reset() { Uppercut_Timer = 5000; - if (m_creature->getFaction() != m_uiNormFaction) - m_creature->setFaction(m_uiNormFaction); + me->RestoreFaction(); } - void EnterCombat(Unit *who) {} - void UpdateAI(const uint32 diff) { if (!UpdateVictim()) @@ -126,11 +123,9 @@ struct TRINITY_DLL_DECL npc_salsalabimAI : public ScriptedAI void Reset() { MagneticPull_Timer = 15000; - m_creature->setFaction(FACTION_FRIENDLY_SA); + me->RestoreFaction(); } - void EnterCombat(Unit *who) {} - void DamageTaken(Unit *done_by, uint32 &damage) { if (done_by->GetTypeId() == TYPEID_PLAYER) @@ -288,71 +283,60 @@ public: void WaypointReached(uint32 i) { - Unit *pTemp = Unit::GetUnit(*m_creature,PlayerGUID); + Player* pPlayer = GetPlayerForEscort(); - if (!pTemp) + if (!pPlayer) return; switch(i) { - case 0: DoScriptText(SAY1, m_creature, pTemp); break; - case 4: DoScriptText(WHISP1, m_creature, pTemp); break; - case 6: DoScriptText(WHISP2, m_creature, pTemp); break; - case 7: DoScriptText(WHISP3, m_creature, pTemp); break; - case 8: DoScriptText(WHISP4, m_creature, pTemp); break; - case 17: DoScriptText(WHISP5, m_creature, pTemp); break; - case 18: DoScriptText(WHISP6, m_creature, pTemp); break; - case 19: DoScriptText(WHISP7, m_creature, pTemp); break; - case 33: DoScriptText(WHISP8, m_creature, pTemp); break; - case 34: DoScriptText(WHISP9, m_creature, pTemp); break; - case 35: DoScriptText(WHISP10, m_creature, pTemp); break; - case 36: DoScriptText(WHISP11, m_creature, pTemp); break; - case 43: DoScriptText(WHISP12, m_creature, pTemp); break; - case 44: DoScriptText(WHISP13, m_creature, pTemp); break; - case 49: DoScriptText(WHISP14, m_creature, pTemp); break; - case 50: DoScriptText(WHISP15, m_creature, pTemp); break; - case 51: DoScriptText(WHISP16, m_creature, pTemp); break; - case 52: DoScriptText(WHISP17, m_creature, pTemp); break; - case 53: DoScriptText(WHISP18, m_creature, pTemp); break; - case 54: DoScriptText(WHISP19, m_creature, pTemp); break; - case 55: DoScriptText(WHISP20, m_creature, pTemp); break; - case 56: DoScriptText(WHISP21, m_creature, pTemp); - if (PlayerGUID) - { - Player* pPlayer = (Unit::GetPlayer(PlayerGUID)); - if (pPlayer) - pPlayer->GroupEventHappens(10211,m_creature); - } + case 0: DoScriptText(SAY1, m_creature, pPlayer); break; + case 4: DoScriptText(WHISP1, m_creature, pPlayer); break; + case 6: DoScriptText(WHISP2, m_creature, pPlayer); break; + case 7: DoScriptText(WHISP3, m_creature, pPlayer); break; + case 8: DoScriptText(WHISP4, m_creature, pPlayer); break; + case 17: DoScriptText(WHISP5, m_creature, pPlayer); break; + case 18: DoScriptText(WHISP6, m_creature, pPlayer); break; + case 19: DoScriptText(WHISP7, m_creature, pPlayer); break; + case 33: DoScriptText(WHISP8, m_creature, pPlayer); break; + case 34: DoScriptText(WHISP9, m_creature, pPlayer); break; + case 35: DoScriptText(WHISP10, m_creature, pPlayer); break; + case 36: DoScriptText(WHISP11, m_creature, pPlayer); break; + case 43: DoScriptText(WHISP12, m_creature, pPlayer); break; + case 44: DoScriptText(WHISP13, m_creature, pPlayer); break; + case 49: DoScriptText(WHISP14, m_creature, pPlayer); break; + case 50: DoScriptText(WHISP15, m_creature, pPlayer); break; + case 51: DoScriptText(WHISP16, m_creature, pPlayer); break; + case 52: DoScriptText(WHISP17, m_creature, pPlayer); break; + case 53: DoScriptText(WHISP18, m_creature, pPlayer); break; + case 54: DoScriptText(WHISP19, m_creature, pPlayer); break; + case 55: DoScriptText(WHISP20, m_creature, pPlayer); break; + case 56: DoScriptText(WHISP21, m_creature, pPlayer); + if (pPlayer) + pPlayer->GroupEventHappens(10211,m_creature); break; } } - void EnterCombat(Unit* who) {} - - void MoveInLineOfSight(Unit *who) + void MoveInLineOfSight(Unit* pWho) { if (IsBeingEscorted) return; - if (who->GetTypeId() == TYPEID_PLAYER) + if (pWho->GetTypeId() == TYPEID_PLAYER) { - if (CAST_PLR(who)->GetQuestStatus(10211) == QUEST_STATUS_INCOMPLETE) + if (CAST_PLR(pWho)->GetQuestStatus(10211) == QUEST_STATUS_INCOMPLETE) { float Radius = 10.0; - if (m_creature->IsWithinDistInMap(who, Radius)) + if (m_creature->IsWithinDistInMap(pWho, Radius)) { - Start(false, false, who->GetGUID()); + Start(false, false, pWho->GetGUID()); } } } } void Reset() {} - - void UpdateAI(const uint32 diff) - { - npc_escortAI::UpdateAI(diff); - } }; CreatureAI* GetAI_npc_kservantAI(Creature* pCreature) { diff --git a/src/bindings/scripts/scripts/outland/terokkar_forest.cpp b/src/bindings/scripts/scripts/outland/terokkar_forest.cpp index b2c658c0eef..bfce48a17dd 100644 --- a/src/bindings/scripts/scripts/outland/terokkar_forest.cpp +++ b/src/bindings/scripts/scripts/outland/terokkar_forest.cpp @@ -179,7 +179,7 @@ public: void WaypointReached(uint32 i) { - Player *pPlayer = Unit::GetPlayer(PlayerGUID); + Player* pPlayer = GetPlayerForEscort(); if (!pPlayer) return; @@ -412,11 +412,9 @@ struct TRINITY_DLL_DECL npc_isla_starmaneAI : public npc_escortAI { npc_isla_starmaneAI(Creature* c) : npc_escortAI(c) {} - bool Completed; - void WaypointReached(uint32 i) { - Player* pPlayer = Unit::GetPlayer(PlayerGUID); + Player* pPlayer = GetPlayerForEscort(); if (!pPlayer) return; @@ -435,11 +433,11 @@ struct TRINITY_DLL_DECL npc_isla_starmaneAI : public npc_escortAI case 29:DoScriptText(SAY_PROGRESS_4, m_creature, pPlayer); if (pPlayer) { - if (CAST_PLR(pPlayer)->GetTeam() == ALLIANCE) - CAST_PLR(pPlayer)->GroupEventHappens(QUEST_EFTW_A, m_creature); - else if (CAST_PLR(pPlayer)->GetTeam() == HORDE) - CAST_PLR(pPlayer)->GroupEventHappens(QUEST_EFTW_H, m_creature); - } Completed = true; + if (pPlayer->GetTeam() == ALLIANCE) + pPlayer->GroupEventHappens(QUEST_EFTW_A, m_creature); + else if (pPlayer->GetTeam() == HORDE) + pPlayer->GroupEventHappens(QUEST_EFTW_H, m_creature); + } m_creature->SetInFront(pPlayer); break; case 30: m_creature->HandleEmoteCommand(EMOTE_ONESHOT_WAVE); break; case 31: DoCast(m_creature, SPELL_CAT); @@ -449,31 +447,19 @@ struct TRINITY_DLL_DECL npc_isla_starmaneAI : public npc_escortAI void Reset() { - Completed = false; - m_creature->setFaction(1660); + me->RestoreFaction(); } - void EnterCombat(Unit* who){} - void JustDied(Unit* killer) { - if (PlayerGUID) + if (Player* pPlayer = GetPlayerForEscort()) { - Player* pPlayer = Unit::GetPlayer(PlayerGUID); - if (pPlayer && !Completed) - { - if (CAST_PLR(pPlayer)->GetTeam() == ALLIANCE) - CAST_PLR(pPlayer)->FailQuest(QUEST_EFTW_A); - else if (CAST_PLR(pPlayer)->GetTeam() == HORDE) - CAST_PLR(pPlayer)->FailQuest(QUEST_EFTW_H); - } + if (pPlayer->GetTeam() == ALLIANCE) + pPlayer->FailQuest(QUEST_EFTW_A); + else if (pPlayer->GetTeam() == HORDE) + pPlayer->FailQuest(QUEST_EFTW_H); } } - - void UpdateAI(const uint32 diff) - { - npc_escortAI::UpdateAI(diff); - } }; bool QuestAccept_npc_isla_starmane(Player* pPlayer, Creature* pCreature, Quest const* quest) @@ -488,45 +474,7 @@ bool QuestAccept_npc_isla_starmane(Player* pPlayer, Creature* pCreature, Quest c CreatureAI* GetAI_npc_isla_starmaneAI(Creature* pCreature) { - npc_isla_starmaneAI* thisAI = new npc_isla_starmaneAI(pCreature); - - thisAI->AddWaypoint(0, -2265.21, 3091.14, 13.91); - thisAI->AddWaypoint(1, -2266.80, 3091.33, 13.82, 1000); - thisAI->AddWaypoint(2, -2268.20, 3091.14, 13.82, 7000);//progress1 - thisAI->AddWaypoint(3, -2278.32, 3098.98, 13.82); - thisAI->AddWaypoint(4, -2294.82, 3110.59, 13.82); - thisAI->AddWaypoint(5, -2300.71, 3114.60, 13.82, 20000);//progress2 - thisAI->AddWaypoint(6, -2300.71, 3114.60, 13.82, 3000);//progress3 - thisAI->AddWaypoint(7, -2307.36, 3122.76, 13.79); - thisAI->AddWaypoint(8, -2312.83, 3130.55, 12.04); - thisAI->AddWaypoint(9, -2345.02, 3151.00, 8.38); - thisAI->AddWaypoint(10, -2351.97, 3157.61, 6.27); - thisAI->AddWaypoint(11, -2360.35, 3171.48, 3.31); - thisAI->AddWaypoint(12, -2371.44, 3185.41, 0.89); - thisAI->AddWaypoint(13, -2371.21, 3197.92, -0.96); - thisAI->AddWaypoint(14, -2380.35, 3210.45, -1.08); - thisAI->AddWaypoint(15, -2384.74, 3221.25, -1.17); - thisAI->AddWaypoint(16, -2386.15, 3233.39, -1.29); - thisAI->AddWaypoint(17, -2383.45, 3247.79, -1.32); - thisAI->AddWaypoint(18, -2367.50, 3265.64, -1.33); - thisAI->AddWaypoint(19, -2354.90, 3273.30, -1.50); - thisAI->AddWaypoint(20, -2348.88, 3280.58, -0.09); - thisAI->AddWaypoint(21, -2349.06, 3295.86, -0.95); - thisAI->AddWaypoint(22, -2350.43, 3328.27, -2.10); - thisAI->AddWaypoint(23, -2346.76, 3356.27, -2.82); - thisAI->AddWaypoint(24, -2340.56, 3370.68, -4.02); - thisAI->AddWaypoint(25, -2318.84, 3384.60, -7.61); - thisAI->AddWaypoint(26, -2313.99, 3398.61, -10.40); - thisAI->AddWaypoint(27, -2320.85, 3414.49, -11.49); - thisAI->AddWaypoint(28, -2338.26, 3426.06, -11.46); - thisAI->AddWaypoint(29, -2342.67, 3439.44, -11.32, 12000);//progress4 - thisAI->AddWaypoint(30, -2342.67, 3439.44, -11.32, 7000);//emote bye - thisAI->AddWaypoint(31, -2342.67, 3439.44, -11.32, 5000);//cat form - thisAI->AddWaypoint(32, -2344.60, 3461.27, -10.44); - thisAI->AddWaypoint(33, -2396.81, 3517.17, -3.55); - thisAI->AddWaypoint(34, -2439.23, 3523.00, -1.05); - - return thisAI; + return new npc_isla_starmaneAI(pCreature); } /*###### @@ -624,7 +572,7 @@ struct TRINITY_DLL_DECL npc_akunoAI : public npc_escortAI void WaypointReached(uint32 i) { - Player* pPlayer = Unit::GetPlayer(PlayerGUID); + Player* pPlayer = GetPlayerForEscort(); if(!pPlayer) return; diff --git a/src/bindings/scripts/scripts/outland/zangarmarsh.cpp b/src/bindings/scripts/scripts/outland/zangarmarsh.cpp index 0ce14cc0aee..2d505a5183a 100644 --- a/src/bindings/scripts/scripts/outland/zangarmarsh.cpp +++ b/src/bindings/scripts/scripts/outland/zangarmarsh.cpp @@ -284,34 +284,34 @@ struct TRINITY_DLL_DECL npc_kayra_longmaneAI : public npc_escortAI void WaypointReached(uint32 i) { - Player* pUnit = Unit::GetPlayer(PlayerGUID); + Player* pPlayer = GetPlayerForEscort(); - if (!pUnit) + if (!pPlayer) return; switch(i) { case 4: - DoScriptText(SAY_AMBUSH1, m_creature, pUnit); + DoScriptText(SAY_AMBUSH1, m_creature, pPlayer); DoSpawnCreature(NPC_SLAVEBINDER, -10.0f, -5.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); DoSpawnCreature(NPC_SLAVEBINDER, -8.0f, 5.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); break; case 5: - DoScriptText(SAY_PROGRESS, m_creature, pUnit); + DoScriptText(SAY_PROGRESS, m_creature, pPlayer); SetRun(); break; case 16: - DoScriptText(SAY_AMBUSH2, m_creature, pUnit); + DoScriptText(SAY_AMBUSH2, m_creature, pPlayer); DoSpawnCreature(NPC_SLAVEBINDER, -10.0f, -5.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); DoSpawnCreature(NPC_SLAVEBINDER, -8.0f, 5.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); break; case 17: SetRun(false); - DoScriptText(SAY_NEAR_END, m_creature, pUnit); + DoScriptText(SAY_NEAR_END, m_creature, pPlayer); break; case 25: - DoScriptText(SAY_END, m_creature, pUnit); - pUnit->GroupEventHappens(QUEST_ESCAPE_FROM, m_creature); + DoScriptText(SAY_END, m_creature, pPlayer); + pPlayer->GroupEventHappens(QUEST_ESCAPE_FROM, m_creature); break; } } -- cgit v1.2.3