aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sql/updates/1247_world.sql1
-rw-r--r--sql/updates/1249_world.sql1
-rw-r--r--src/bindings/scripts/scripts/go/go_scripts.cpp47
-rw-r--r--src/game/Player.cpp4
-rw-r--r--src/game/SpellAuras.cpp5
-rw-r--r--src/game/SpellHandler.cpp2
-rw-r--r--src/game/Unit.cpp37
-rw-r--r--src/game/Unit.h6
8 files changed, 77 insertions, 26 deletions
diff --git a/sql/updates/1247_world.sql b/sql/updates/1247_world.sql
new file mode 100644
index 00000000000..2e9a7088beb
--- /dev/null
+++ b/sql/updates/1247_world.sql
@@ -0,0 +1 @@
+UPDATE `gameobject_template` SET `ScriptName` = 'go_jump_a_tron' WHERE `entry` = 183146;
diff --git a/sql/updates/1249_world.sql b/sql/updates/1249_world.sql
new file mode 100644
index 00000000000..6ce0e777210
--- /dev/null
+++ b/sql/updates/1249_world.sql
@@ -0,0 +1 @@
+UPDATE `gameobject_template` SET `ScriptName` = 'go_ethereum_prison' WHERE `entry` = 184421;
diff --git a/src/bindings/scripts/scripts/go/go_scripts.cpp b/src/bindings/scripts/scripts/go/go_scripts.cpp
index 8489cc5417d..faa55482b8a 100644
--- a/src/bindings/scripts/scripts/go/go_scripts.cpp
+++ b/src/bindings/scripts/scripts/go/go_scripts.cpp
@@ -183,6 +183,42 @@ bool GOHello_go_tablet_of_the_seven(Player *player, GameObject* _GO)
return true;
}
+/*#####
+## go_jump_a_tron
+######*/
+
+bool GOHello_go_jump_a_tron(Player *player, GameObject* _GO)
+{
+ if (player->GetQuestStatus(10111) == QUEST_STATUS_INCOMPLETE)
+ player->CastSpell(player,33382,true);
+
+ return true;
+}
+
+/*######
+## go_ethereum_prison
+######*/
+
+float ethereum_NPC[2][7] =
+{
+ {20785,20790,20789,20784,20786,20783,20788}, // hostile npc
+ {22810,22811,22812,22813,22814,22815,0} // fiendly npc (need script in acid ? only to cast spell reputation reward)
+};
+
+bool GOHello_go_ethereum_prison(Player *player, GameObject* _GO)
+{
+ _GO->SetGoState(0);
+ switch(rand()%2){
+ case 0:
+ _GO->SummonCreature(ethereum_NPC[0][rand()%6],_GO->GetPositionX(),_GO->GetPositionY(),_GO->GetPositionZ()+0.3, 0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,10000);
+ break;
+ case 1:
+ _GO->SummonCreature(ethereum_NPC[1][rand()%5],_GO->GetPositionX(),_GO->GetPositionY(),_GO->GetPositionZ()+0.3, 0,TEMPSUMMON_TIMED_DESPAWN,10000);
+ break;
+}
+return true;
+}
+
void AddSC_go_scripts()
{
Script *newscript;
@@ -236,5 +272,16 @@ void AddSC_go_scripts()
newscript->Name="go_tablet_of_the_seven";
newscript->pGOHello = &GOHello_go_tablet_of_the_seven;
newscript->RegisterSelf();
+
+ newscript = new Script;
+ newscript->Name="go_jump_a_tron";
+ newscript->pGOHello = &GOHello_go_jump_a_tron;
+ newscript->RegisterSelf();
+
+ newscript = new Script;
+ newscript->Name="go_ethereum_prison";
+ newscript->pGOHello = &GOHello_go_ethereum_prison;
+ newscript->RegisterSelf();
+
}
diff --git a/src/game/Player.cpp b/src/game/Player.cpp
index 5f6d17b2ee7..7f9ceffda7f 100644
--- a/src/game/Player.cpp
+++ b/src/game/Player.cpp
@@ -6742,7 +6742,7 @@ void Player::DuelComplete(DuelCompleteType type)
}
for(size_t i=0; i<auras2remove.size(); i++)
- duel->opponent->RemoveAurasDueToSpellByCancel(auras2remove[i]);
+ duel->opponent->RemoveAurasByCasterSpell(auras2remove[i], GetGUID(), AURA_REMOVE_BY_DELETE);
auras2remove.clear();
AuraMap const& auras = GetAuras();
@@ -6752,7 +6752,7 @@ void Player::DuelComplete(DuelCompleteType type)
auras2remove.push_back(i->second->GetId());
}
for(size_t i=0; i<auras2remove.size(); i++)
- RemoveAurasDueToSpellByCancel(auras2remove[i]);
+ RemoveAurasByCasterSpell(auras2remove[i], duel->opponent->GetGUID(), AURA_REMOVE_BY_DELETE);
// cleanup combo points
if(GetComboTarget()==duel->opponent->GetGUID())
diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp
index c6b24074e12..1798fbf6f21 100644
--- a/src/game/SpellAuras.cpp
+++ b/src/game/SpellAuras.cpp
@@ -1022,8 +1022,9 @@ void Aura::_RemoveAura()
((Player*)caster)->SendCooldownEvent(GetSpellProto());
}
+ // not cancel, overkill
// do not proc anything if aura is cancelled
- if(m_removeMode == AURA_REMOVE_BY_CANCEL)
+ if(m_removeMode == AURA_REMOVE_BY_DELETE)
return;
// Remove Linked Auras (on last aura remove)
@@ -1063,7 +1064,7 @@ void Aura::_RemoveAura()
uint32 procEx=0;
if (m_removeMode == AURA_REMOVE_BY_ENEMY_SPELL)
procEx = PROC_EX_AURA_REMOVE_DESTROY;
- else if (m_removeMode == AURA_REMOVE_BY_DEFAULT)// || m_removeMode == AURA_REMOVE_BY_CANCEL)
+ else if (m_removeMode == AURA_REMOVE_BY_DEFAULT || m_removeMode == AURA_REMOVE_BY_CANCEL)
procEx = PROC_EX_AURA_REMOVE_EXPIRE;
caster->ProcDamageAndSpell(m_target,ProcCaster, ProcVictim, procEx, m_modifier.m_amount, BASE_ATTACK, m_spellProto);
diff --git a/src/game/SpellHandler.cpp b/src/game/SpellHandler.cpp
index b9e773437b6..d5dfcb8dab4 100644
--- a/src/game/SpellHandler.cpp
+++ b/src/game/SpellHandler.cpp
@@ -341,7 +341,7 @@ void WorldSession::HandleCancelAuraOpcode( WorldPacket& recvPacket)
}
// non channeled case
- _player->RemoveAurasDueToSpellByCancel(spellId);
+ _player->RemoveAurasByCasterSpell(spellId, _player->GetGUID(), AURA_REMOVE_BY_CANCEL);
}
void WorldSession::HandlePetCancelAuraOpcode( WorldPacket& recvPacket)
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index 3c2713c6d91..e7b31aa5546 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -572,7 +572,7 @@ void Unit::RemoveAurasWithInterruptFlags(uint32 flag, uint32 except)
sLog.outError("Aura %u is trying to remove itself! Flag %u. May cause crash!", (*iter)->GetId(), flag);
else if(!except || (*iter)->GetId() != except)
{
- RemoveAurasDueToSpell((*iter)->GetId());
+ RemoveAurasBySpell((*iter)->GetId(), AURA_REMOVE_BY_CANCEL);
if (!m_interruptableAuras.empty())
next = m_interruptableAuras.begin();
else
@@ -3843,7 +3843,7 @@ bool Unit::AddAura(Aura *Aur)
if(Aur->GetStackAmount() < aurSpellInfo->StackAmount)
Aur->InitStackAmount(Aur->GetStackAmount()+1);
}
- RemoveAura(i2,AURA_REMOVE_BY_STACK);
+ RemoveAura(i2,AURA_REMOVE_BY_DELETE);
i2=m_Auras.lower_bound(spair);
continue;
}
@@ -3863,7 +3863,7 @@ bool Unit::AddAura(Aura *Aur)
++i2;
continue;
}
- RemoveAura(i2,AURA_REMOVE_BY_STACK);
+ RemoveAura(i2,AURA_REMOVE_BY_DELETE);
i2=m_Auras.lower_bound(spair);
continue;
}
@@ -3901,7 +3901,7 @@ bool Unit::AddAura(Aura *Aur)
sLog.outError("Aura (Spell %u Effect %u) is in process but attempt removed at aura (Spell %u Effect %u) adding, need add stack rule for IsSingleTargetSpell", (*itr)->GetId(), (*itr)->GetEffIndex(),Aur->GetId(), Aur->GetEffIndex());
continue;
}
- (*itr)->GetTarget()->RemoveAurasByCasterSpell((*itr)->GetId(),(*itr)->GetEffIndex(), caster->GetGUID(), AURA_REMOVE_BY_STACK);
+ (*itr)->GetTarget()->RemoveAurasByCasterSpell((*itr)->GetId(),(*itr)->GetEffIndex(), caster->GetGUID(), AURA_REMOVE_BY_DELETE);
restart = true;
break;
}
@@ -3964,7 +3964,7 @@ void Unit::RemoveRankAurasDueToSpell(uint32 spellId)
{
if(iter->second->GetCasterGUID()==(*i).second->GetCasterGUID())
{
- RemoveAura(iter, AURA_REMOVE_BY_STACK);
+ RemoveAura(iter, AURA_REMOVE_BY_DELETE);
iter = m_Auras.lower_bound(spair);
}
else
@@ -4090,7 +4090,7 @@ bool Unit::RemoveNoStackAurasDueToAura(Aura *Aur)
{
if(iter->second->GetCasterGUID()==caster)
{
- RemoveAura(iter, AURA_REMOVE_BY_STACK);
+ RemoveAura(iter, AURA_REMOVE_BY_DELETE);
iter = m_Auras.lower_bound(spair);
}
else
@@ -4121,6 +4121,18 @@ void Unit::RemoveAura(uint32 spellId, uint32 effindex, Aura* except)
}
}
+void Unit::RemoveAurasBySpell(uint32 spellId, AuraRemoveMode removeMode)
+{
+ for (AuraMap::iterator iter = m_Auras.begin(); iter != m_Auras.end(); )
+ {
+ Aura *aur = iter->second;
+ if (aur->GetId() == spellId)
+ RemoveAura(iter, removeMode);
+ else
+ ++iter;
+ }
+}
+
void Unit::RemoveAurasByCasterSpell(uint32 spellId, uint64 casterGUID, AuraRemoveMode removeMode)
{
for (AuraMap::iterator iter = m_Auras.begin(); iter != m_Auras.end(); )
@@ -4259,17 +4271,6 @@ void Unit::RemoveAurasDueToSpellBySteal(uint32 spellId, uint64 casterGUID, Unit
}
}
-void Unit::RemoveAurasDueToSpellByCancel(uint32 spellId)
-{
- for (AuraMap::iterator iter = m_Auras.begin(); iter != m_Auras.end(); )
- {
- if (iter->second->GetId() == spellId)
- RemoveAura(iter, AURA_REMOVE_BY_CANCEL);
- else
- ++iter;
- }
-}
-
void Unit::RemoveAurasWithDispelType( DispelType type )
{
// Create dispel mask by dispel type
@@ -4336,7 +4337,7 @@ void Unit::RemoveNotOwnSingleTargetAuras()
for (AuraMap::iterator iter = m_Auras.begin(); iter != m_Auras.end(); )
{
if (iter->second->GetCasterGUID()!=GetGUID() && IsSingleTargetSpell(iter->second->GetSpellProto()))
- RemoveAura(iter, AURA_REMOVE_BY_STACK);
+ RemoveAura(iter, AURA_REMOVE_BY_DELETE);
else
++iter;
}
diff --git a/src/game/Unit.h b/src/game/Unit.h
index 9bf55edd15a..80547a7e237 100644
--- a/src/game/Unit.h
+++ b/src/game/Unit.h
@@ -328,7 +328,7 @@ enum DamageTypeToSchool
enum AuraRemoveMode
{
AURA_REMOVE_BY_DEFAULT,
- AURA_REMOVE_BY_STACK, // at replace by semillar aura (or single target aura remove)
+ AURA_REMOVE_BY_DELETE, // change stack, single aura remove, duel complete
AURA_REMOVE_BY_CANCEL,
AURA_REMOVE_BY_ENEMY_SPELL, // dispel and absorb aura destroy
AURA_REMOVE_BY_DEATH
@@ -1245,7 +1245,8 @@ class TRINITY_DLL_SPEC Unit : public WorldObject
void RemoveSingleAuraFromStack(uint32 spellId, uint32 effindex);
void RemoveAurasDueToSpell(uint32 spellId, Aura* except = NULL);
void RemoveAurasDueToItemSpell(Item* castItem,uint32 spellId);
- void RemoveAurasByCasterSpell(uint32 spellId, uint64 casterGUID, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT);
+ void RemoveAurasBySpell(uint32 spellId, AuraRemoveMode removeMode = AURA_REMOVE_BY_DEFAULT);
+ void RemoveAurasByCasterSpell(uint32 spellId, uint64 casterGUID, AuraRemoveMode removeMode = AURA_REMOVE_BY_DEFAULT);
void RemoveAurasByCasterSpell(uint32 spellId, uint8 effindex, uint64 casterGUID, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT);
void RefreshAurasByCasterSpell(uint32 spellId, uint64 casterGUID);
void SetAurasDurationByCasterSpell(uint32 spellId, uint64 casterGUID, int32 duration);
@@ -1253,7 +1254,6 @@ class TRINITY_DLL_SPEC Unit : public WorldObject
void RemoveAurasDueToSpellByDispel(uint32 spellId, uint64 casterGUID, Unit *dispeler);
void RemoveAurasDueToSpellBySteal(uint32 spellId, uint64 casterGUID, Unit *stealer);
- void RemoveAurasDueToSpellByCancel(uint32 spellId);
void RemoveAurasAtChanneledTarget(SpellEntry const* spellInfo, Unit * caster);
void RemoveNotOwnSingleTargetAuras();