[svn] *Update Kalecgos script.

*Correctly select aura triggered spell target.
*Fix some scripts, should be pGOHello = &
*Fix a bug that some channel spells cannot be interrupted.
*Fix a bug that not-selectable creature cannot be hit by target_entry spells.
*If eventAI cannot find heroic flag and normal flag, enable event as default rather than disable it.

--HG--
branch : trunk
This commit is contained in:
megamage
2008-11-15 15:09:22 -06:00
parent 61d9723c5b
commit 7d3997f7d6
12 changed files with 656 additions and 680 deletions
-5
View File
@@ -17,11 +17,6 @@ INSERT INTO spell_linked_spell
VALUES
(-30410, 44032, 0, 'Manticron Cube Mind Exhaustion');
INSERT INTO spell_linked_spell
(`spell_trigger`, `spell_effect`, `type`, `comment`)
VALUES
(-45934, 7, 0, 'Dark Fiend Suicide');
INSERT INTO spell_linked_spell
(`spell_trigger`, `spell_effect`, `type`, `comment`)
VALUES
-11
View File
@@ -1,14 +1,3 @@
DELETE FROM spell_linked_spell WHERE `spell_trigger` IN (46648, 46019, 46021, -46021, 46020);
INSERT INTO spell_linked_spell (`spell_trigger`, `spell_effect`, `type`, `comment`) VALUES (46648, 44866, 1, 'Spectral Blast');
INSERT INTO spell_linked_spell (`spell_trigger`, `spell_effect`, `type`, `comment`) VALUES (46019, 46021, 1, 'Teleport: Spectral Realm');
INSERT INTO spell_linked_spell (`spell_trigger`, `spell_effect`, `type`, `comment`) VALUES (46021, 44852, 1, 'Spectral Realm Aura');
INSERT INTO spell_linked_spell (`spell_trigger`, `spell_effect`, `type`, `comment`) VALUES (-46021, 46020, 0, 'Teleport: Normal Realm');
INSERT INTO spell_linked_spell (`spell_trigger`, `spell_effect`, `type`, `comment`) VALUES (46020, 44867, 1, 'Spectral Exhaustion');
DELETE FROM spell_target_position WHERE `id` IN (46019, 46020);
INSERT INTO spell_target_position () VALUES (46019, 580, 1704.34, 928.17, -74.558, 0);
INSERT INTO spell_target_position () VALUES (46020, 580, 1704.34, 928.17, 53.079, 0);
-- Magtheridon Earthquake
DELETE FROM spell_script_target WHERE `entry` IN (30657);
INSERT INTO spell_script_target VALUES ('30657', '1', '24136');
+29
View File
@@ -0,0 +1,29 @@
ALTER TABLE `spell_linked_spell` DROP PRIMARY KEY;
UPDATE creature_template SET scriptname = 'boss_kalecgos' WHERE entry = 24850;
UPDATE creature_template SET scriptname = 'boss_sathrovarr' WHERE entry = 24892;
UPDATE creature_template SET scriptname = 'boss_kalec' WHERE entry = 24891;
UPDATE creature_template SET minhealth = 2018275, maxhealth = minhealth = 2018275 WHERE entry = 24892;
UPDATE creature_template SET minlevel = 73, maxlevel = 73, minhealth = 828555, maxhealth = 828555, armor = 5000, mindmg = 1000, maxdmg = 2000 WHERE entry = 24891;
UPDATE gameobject_template SET scriptname = 'kalocegos_teleporter' WHERE entry = 187055;
INSERT INTO creature_template_addon (entry) SELECT 24891 FROM creature_template_addon WHERE NOT EXISTS(SELECT * FROM creature_template_addon WHERE entry = 24891) LIMIT 1;
INSERT INTO creature_template_addon (entry) SELECT 24892 FROM creature_template_addon WHERE NOT EXISTS(SELECT * FROM creature_template_addon WHERE entry = 24892) LIMIT 1;
UPDATE creature_template_addon SET auras = '45769 0 45769 1' WHERE entry = 24850;
UPDATE creature_template_addon SET auras = '45769 0 45769 1 44801 0 44801 1 44801 2' WHERE entry = 24891;
UPDATE creature_template_addon SET auras = '45769 0 45769 1 44801 0 44801 1 44801 2 44800 0' WHERE entry = 24892;
DELETE FROM spell_linked_spell WHERE `spell_trigger` IN (44869, 46648, 46019, 46021, -46021, 46020);
INSERT INTO spell_linked_spell (`spell_trigger`, `spell_effect`, `type`, `comment`) VALUES (44869, 44866, 1, 'Spectral Blast Portal');
-- 46648 will cause severe lag if your video card is not good enough
-- INSERT INTO spell_linked_spell (`spell_trigger`, `spell_effect`, `type`, `comment`) VALUES (44869, 46648, 1, 'Spectral Blast Visual');
INSERT INTO spell_linked_spell (`spell_trigger`, `spell_effect`, `type`, `comment`) VALUES (44869, 46019, 1, 'Spectral Blast Teleport');
INSERT INTO spell_linked_spell (`spell_trigger`, `spell_effect`, `type`, `comment`) VALUES (46019, 46021, 1, 'Spectral Realm Aura');
-- 44852 makes boss friendly to you, weird
-- INSERT INTO spell_linked_spell (`spell_trigger`, `spell_effect`, `type`, `comment`) VALUES (46021, 44852, 1, 'Spectral Realm Aura');
INSERT INTO spell_linked_spell (`spell_trigger`, `spell_effect`, `type`, `comment`) VALUES (-46021, 46020, 0, 'Teleport: Normal Realm');
INSERT INTO spell_linked_spell (`spell_trigger`, `spell_effect`, `type`, `comment`) VALUES (46020, 44867, 1, 'Spectral Exhaustion');
DELETE FROM spell_target_position WHERE `id` IN (46019, 46020);
INSERT INTO spell_target_position () VALUES (46019, 580, 1704.34, 928.17, -74.558, 0);
INSERT INTO spell_target_position () VALUES (46020, 580, 1704.34, 928.17, 53.079, 0);
@@ -1370,7 +1370,10 @@ CreatureAI* GetAI_Mob_EventAI(Creature *_Creature)
}
if (EAI_ErrorLevel > 1)
error_db_log("SD2: Creature %u Event %u. Creature are in instance but neither EFLAG_NORMAL or EFLAG_HEROIC are set. Event Disabled.", _Creature->GetEntry(), (*i).event_id);
{
error_db_log("SD2: Creature %u Event %u. Creature are in instance but neither EFLAG_NORMAL or EFLAG_HEROIC are set.", _Creature->GetEntry(), (*i).event_id);
EventList.push_back(EventHolder(*i));
}
continue;
}
@@ -194,16 +194,16 @@ void AddSC_go_scripts()
newscript = new Script;
newscript->Name="go_tablet_of_madness";
newscript->pGOHello = GOHello_go_tablet_of_madness;
newscript->pGOHello = &GOHello_go_tablet_of_madness;
m_scripts[nrscripts++] = newscript;
newscript = new Script;
newscript->Name="go_tablet_of_the_seven";
newscript->pGOHello = GOHello_go_tablet_of_the_seven;
newscript->pGOHello = &GOHello_go_tablet_of_the_seven;
m_scripts[nrscripts++] = newscript;
newscript = new Script;
newscript->Name="go_teleporter";
newscript->pGOHello = GOHello_go_teleporter;
newscript->pGOHello = &GOHello_go_teleporter;
m_scripts[nrscripts++] = newscript;
}
@@ -2278,7 +2278,7 @@ void AddSC_boss_illidan()
newscript = new Script;
newscript->Name="mob_cage_trap_trigger";
newscript->GetAI = GetAI_cage_trap_trigger;
newscript->GetAI = &GetAI_cage_trap_trigger;
m_scripts[nrscripts++] = newscript;
newscript = new Script;
@@ -193,7 +193,7 @@ void AddSC_boss_lieutenant_drake()
newscript = new Script;
newscript->Name="go_barrel_old_hillsbrad";
newscript->pGOHello = GOHello_go_barrel_old_hillsbrad;
newscript->pGOHello = &GOHello_go_barrel_old_hillsbrad;
m_scripts[nrscripts++] = newscript;
newscript = new Script;
File diff suppressed because it is too large Load Diff
@@ -36,8 +36,4 @@
#define DATA_GATE_5 23
/*** Misc ***/
#define DATA_PLAYER_SPECTRAL_REALM 24
#define DATA_SET_SPECTRAL_CHECK 25
#define DATA_RANDOM_SPECTRAL_PLAYER 26
#define DATA_INST_EJECT_PLAYERS 27
#endif
@@ -14,10 +14,6 @@ EndScriptData */
#define ENCOUNTERS 6
#define SPELL_SPECTRAL_REALM 46021
#define SPELL_TELEPORT_NORMAL_REALM 46020
#define SPELL_SPECTRAL_EXHAUSTION 44867
/* Sunwell Plateau:
0 - Kalecgos and Sathrovarr
1 - Brutallus
@@ -158,11 +154,8 @@ struct TRINITY_DLL_DECL instance_sunwell_plateau : public ScriptedInstance
case DATA_KILJAEDEN: return KilJaeden; break;
case DATA_KILJAEDEN_CONTROLLER: return KilJaedenController; break;
case DATA_ANVEENA: return Anveena; break;
case DATA_RANDOM_SPECTRAL_PLAYER:
return *(SpectralRealmList.begin() + rand()%SpectralRealmList.size());
break;
}
return 0;
}
@@ -176,87 +169,15 @@ struct TRINITY_DLL_DECL instance_sunwell_plateau : public ScriptedInstance
case DATA_EREDAR_TWINS_EVENT: Encounters[3] = data; break;
case DATA_MURU_EVENT: Encounters[4] = data; break;
case DATA_KILJAEDEN_EVENT: Encounters[5] = data; break;
case DATA_SET_SPECTRAL_CHECK: SpectralRealmTimer = data; break;
case DATA_INST_EJECT_PLAYERS: EjectPlayers(); break;
}
}
void SetData64(uint32 id, uint64 guid)
{
switch(id)
{
case DATA_PLAYER_SPECTRAL_REALM:
SpectralRealmList.push_back(guid);
break;
}
}
// Dirty Hack as we can't use Unit::GetUnit in instance scripts due to lack of a WorldObject.
Player* DirtyHackToGetPlayerFromSpectralList(uint64 guid)
{
Player* first = ((InstanceMap*)instance)->GetPlayers().front();
if(!first)
return NULL;
Player* plr = ((Player*)Unit::GetUnit(*first, guid));
if(plr)
return plr;
return NULL;
}
void EjectPlayer(Player* plr)
{
debug_log("SD2: INST: Ejecting Player %s from Spectral Realm", plr->GetName());
// Remove player from Sathrovarr's threat list
Creature* Sath = ((Creature*)Unit::GetUnit(*plr, Sathrovarr));
if(Sath && Sath->isAlive())
{
HostilReference* ref = Sath->getThreatManager().getOnlineContainer().getReferenceByTarget(plr);
if(ref)
{
ref->removeReference();
debug_log("SD2: INST: Deleting %s from Sathrovarr's threatlist", plr->GetName());
}
}
// Put player back in Kalecgos(Dragon)'s threat list
Creature* Kalecgos = ((Creature*)Unit::GetUnit(*plr, Kalecgos_Dragon));
if(Kalecgos && Kalecgos->isAlive())
{
debug_log("SD2: INST: Putting %s in Kalecgos' threatlist", plr->GetName());
Kalecgos->AddThreat(plr, 1.0f);
}
plr->CastSpell(plr, SPELL_TELEPORT_NORMAL_REALM, true);
plr->CastSpell(plr, SPELL_SPECTRAL_EXHAUSTION, true);
}
void EjectPlayers()
{
for(uint8 i = 0; i < SpectralRealmList.size(); ++i)
{
Player* plr = DirtyHackToGetPlayerFromSpectralList(SpectralRealmList[i]);
if(plr && !plr->HasAura(SPELL_SPECTRAL_REALM, 0))
{
EjectPlayer(plr);
SpectralRealmList.erase(SpectralRealmList.begin() + i);
}
}
SpectralRealmList.clear();
}
void Update(uint32 diff)
{
// Only check for Spectral Realm if Kalecgos Encounter is running
if(Encounters[0] == IN_PROGRESS)
if(SpectralRealmTimer < diff)
{
EjectPlayers();
SpectralRealmTimer = 5000;
}else SpectralRealmTimer -= diff;
}
};
+2 -2
View File
@@ -4928,10 +4928,10 @@ bool Spell::CheckTarget( Unit* target, uint32 eff, bool hitPhase )
// unselectable targets skipped in all cases except TARGET_SCRIPT targeting
// in case TARGET_SCRIPT target selected by server always and can't be cheated
if( target->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE) &&
/*if( target->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE) &&
m_spellInfo->EffectImplicitTargetA[eff] != TARGET_SCRIPT &&
m_spellInfo->EffectImplicitTargetB[eff] != TARGET_SCRIPT )
return false;
return false;*/
}
//Check player targets and remove if in GM mode or GM invisibility (for not self casting case)
+2 -2
View File
@@ -497,7 +497,7 @@ void Unit::RemoveAurasWithInterruptFlags(uint32 flag)
// interrupt channeled spell
if(Spell* spell = m_currentSpells[CURRENT_CHANNELED_SPELL])
if(spell->getState() == SPELL_STATE_CASTING && (spell->m_spellInfo->AuraInterruptFlags & flag))
if(spell->getState() == SPELL_STATE_CASTING && (spell->m_spellInfo->ChannelInterruptFlags & flag))
InterruptNonMeleeSpells(false);
}
@@ -511,7 +511,7 @@ void Unit::UpdateInterruptMask()
}
if(Spell* spell = m_currentSpells[CURRENT_CHANNELED_SPELL])
if(spell->getState() == SPELL_STATE_CASTING)
m_interruptMask |= spell->m_spellInfo->AuraInterruptFlags;
m_interruptMask |= spell->m_spellInfo->ChannelInterruptFlags;
}
bool Unit::HasAuraType(AuraType auraType) const