[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:
@@ -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;
|
||||
|
||||
+1
-1
@@ -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
@@ -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
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user