mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-22 18:15:31 +01:00
Merge branch 'master' of github.com:TrinityCore/TrinityCore into mmaps
This commit is contained in:
@@ -642,19 +642,13 @@ public:
|
||||
{
|
||||
handler->PSendSysMessage("|cff00ff00DEBUG: wp modify del, PathID: |r|cff00ffff%u|r", pathid);
|
||||
|
||||
// wpCreature
|
||||
Creature* wpCreature = NULL;
|
||||
|
||||
if (wpGuid != 0)
|
||||
{
|
||||
wpCreature = handler->GetSession()->GetPlayer()->GetMap()->GetCreature(MAKE_NEW_GUID(wpGuid, VISUAL_WAYPOINT, HIGHGUID_UNIT));
|
||||
if (wpCreature)
|
||||
if (Creature* wpCreature = handler->GetSession()->GetPlayer()->GetMap()->GetCreature(MAKE_NEW_GUID(wpGuid, VISUAL_WAYPOINT, HIGHGUID_UNIT)))
|
||||
{
|
||||
wpCreature->CombatStop();
|
||||
wpCreature->DeleteFromDB();
|
||||
wpCreature->AddObjectToRemoveList();
|
||||
}
|
||||
}
|
||||
|
||||
PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_DEL_WAYPOINT_DATA);
|
||||
|
||||
@@ -681,15 +675,12 @@ public:
|
||||
Player* chr = handler->GetSession()->GetPlayer();
|
||||
Map* map = chr->GetMap();
|
||||
{
|
||||
// wpCreature
|
||||
Creature* wpCreature = NULL;
|
||||
// What to do:
|
||||
// Move the visual spawnpoint
|
||||
// Respawn the owner of the waypoints
|
||||
if (wpGuid != 0)
|
||||
{
|
||||
wpCreature = map->GetCreature(MAKE_NEW_GUID(wpGuid, VISUAL_WAYPOINT, HIGHGUID_UNIT));
|
||||
if (wpCreature)
|
||||
if (Creature* wpCreature = map->GetCreature(MAKE_NEW_GUID(wpGuid, VISUAL_WAYPOINT, HIGHGUID_UNIT)))
|
||||
{
|
||||
wpCreature->CombatStop();
|
||||
wpCreature->DeleteFromDB();
|
||||
|
||||
@@ -243,11 +243,9 @@ public:
|
||||
std::list<HostileReference*> threatlist = me->getThreatManager().getThreatList();
|
||||
for (std::list<HostileReference*>::const_iterator i = threatlist.begin(); i != threatlist.end(); ++i)
|
||||
{
|
||||
Unit* unit;
|
||||
if ((*i) && (*i)->getSource())
|
||||
{
|
||||
unit = Unit::GetUnit(*me, (*i)->getUnitGuid());
|
||||
if (unit)
|
||||
if (Unit* unit = Unit::GetUnit(*me, (*i)->getUnitGuid()))
|
||||
{
|
||||
//Cast affliction
|
||||
DoCast(unit, RAND(SPELL_BROODAF_BLUE, SPELL_BROODAF_BLACK,
|
||||
|
||||
@@ -201,12 +201,11 @@ public:
|
||||
{
|
||||
for (uint8 i = 0; i < 4; ++i)
|
||||
{
|
||||
Creature* Temp = NULL;
|
||||
if (AddGUID[i])
|
||||
{
|
||||
Temp = Creature::GetCreature((*me), AddGUID[i]);
|
||||
if (Temp && Temp->isAlive())
|
||||
Temp->DisappearAndDie();
|
||||
Creature* temp = Creature::GetCreature((*me), AddGUID[i]);
|
||||
if (temp && temp->isAlive())
|
||||
temp->DisappearAndDie();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -215,14 +214,13 @@ public:
|
||||
{
|
||||
for (uint8 i = 0; i < 4; ++i)
|
||||
{
|
||||
Creature* Temp = NULL;
|
||||
if (AddGUID[i])
|
||||
{
|
||||
Temp = Creature::GetCreature((*me), AddGUID[i]);
|
||||
if (Temp && Temp->isAlive())
|
||||
Creature* temp = Creature::GetCreature((*me), AddGUID[i]);
|
||||
if (temp && temp->isAlive())
|
||||
{
|
||||
Temp->AI()->AttackStart(me->getVictim());
|
||||
DoZoneInCombat(Temp);
|
||||
temp->AI()->AttackStart(me->getVictim());
|
||||
DoZoneInCombat(temp);
|
||||
} else
|
||||
EnterEvadeMode();
|
||||
}
|
||||
@@ -250,13 +248,12 @@ public:
|
||||
{
|
||||
for (uint8 i = 0; i < 4; ++i)
|
||||
{
|
||||
Creature* Temp = NULL;
|
||||
if (AddGUID[i])
|
||||
{
|
||||
Temp = Unit::GetCreature((*me), AddGUID[i]);
|
||||
if (Temp && Temp->isAlive())
|
||||
if (!Temp->getVictim())
|
||||
Temp->AI()->AttackStart(me->getVictim());
|
||||
Creature* temp = Unit::GetCreature((*me), AddGUID[i]);
|
||||
if (temp && temp->isAlive())
|
||||
if (!temp->getVictim())
|
||||
temp->AI()->AttackStart(me->getVictim());
|
||||
}
|
||||
}
|
||||
CheckAdds_Timer = 5000;
|
||||
|
||||
@@ -240,7 +240,6 @@ public:
|
||||
return;
|
||||
|
||||
Creature* pArchmage = instance->GetCreature(uiArchmageArugalGUID);
|
||||
Creature* summon = NULL;
|
||||
|
||||
if (!pArchmage || !pArchmage->isAlive())
|
||||
return;
|
||||
@@ -252,7 +251,8 @@ public:
|
||||
switch (uiPhase)
|
||||
{
|
||||
case 1:
|
||||
summon = pArchmage->SummonCreature(pArchmage->GetEntry(), SpawnLocation[4], TEMPSUMMON_TIMED_DESPAWN, 10000);
|
||||
{
|
||||
Creature* summon = pArchmage->SummonCreature(pArchmage->GetEntry(), SpawnLocation[4], TEMPSUMMON_TIMED_DESPAWN, 10000);
|
||||
summon->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
|
||||
summon->SetReactState(REACT_DEFENSIVE);
|
||||
summon->CastSpell(summon, SPELL_ASHCROMBE_TELEPORT, true);
|
||||
@@ -260,13 +260,16 @@ public:
|
||||
uiTimer = 2000;
|
||||
uiPhase = 2;
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
pArchmage->SummonCreature(NPC_ARUGAL_VOIDWALKER, SpawnLocation[0], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 60000);
|
||||
pArchmage->SummonCreature(NPC_ARUGAL_VOIDWALKER, SpawnLocation[1], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 60000);
|
||||
pArchmage->SummonCreature(NPC_ARUGAL_VOIDWALKER, SpawnLocation[2], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 60000);
|
||||
pArchmage->SummonCreature(NPC_ARUGAL_VOIDWALKER, SpawnLocation[3], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 60000);
|
||||
uiPhase = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
} else uiTimer -= uiDiff;
|
||||
|
||||
@@ -315,14 +315,12 @@ class boss_zuljin : public CreatureScript
|
||||
{
|
||||
for (uint8 i = 0; i < 4; ++i)
|
||||
{
|
||||
Unit* Temp = NULL;
|
||||
if (SpiritGUID[i])
|
||||
{
|
||||
Temp = Unit::GetUnit(*me, SpiritGUID[i]);
|
||||
if (Temp)
|
||||
if (Unit* temp = Unit::GetUnit(*me, SpiritGUID[i]))
|
||||
{
|
||||
Temp->SetVisible(false);
|
||||
Temp->setDeathState(DEAD);
|
||||
temp->SetVisible(false);
|
||||
temp->setDeathState(DEAD);
|
||||
}
|
||||
}
|
||||
SpiritGUID[i] = 0;
|
||||
|
||||
@@ -230,13 +230,11 @@ public:
|
||||
{
|
||||
if (Creature* summoned = me->SummonCreature(creatureId, PyrewoodSpawnPoints[position][0], PyrewoodSpawnPoints[position][1], PyrewoodSpawnPoints[position][2], PyrewoodSpawnPoints[position][3], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 15000))
|
||||
{
|
||||
Player* player = NULL;
|
||||
Unit* target = NULL;
|
||||
if (PlayerGUID)
|
||||
{
|
||||
player = Unit::GetPlayer(*me, PlayerGUID);
|
||||
if (player)
|
||||
target = RAND((Unit*)me, (Unit*)player);
|
||||
if (Unit* player = Unit::GetPlayer(*me, PlayerGUID)->ToUnit())
|
||||
target = RAND((Unit*)me, player);
|
||||
} else
|
||||
target = me;
|
||||
|
||||
|
||||
@@ -60,12 +60,12 @@ public:
|
||||
{
|
||||
npc_tapoke_slim_jahnAI(Creature* creature) : npc_escortAI(creature) { }
|
||||
|
||||
bool m_bFriendSummoned;
|
||||
bool IsFriendSummoned;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
if (!HasEscortState(STATE_ESCORT_ESCORTING))
|
||||
m_bFriendSummoned = false;
|
||||
IsFriendSummoned = false;
|
||||
}
|
||||
|
||||
void WaypointReached(uint32 waypointId)
|
||||
@@ -83,14 +83,12 @@ public:
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
Player* player = GetPlayerForEscort();
|
||||
|
||||
if (HasEscortState(STATE_ESCORT_ESCORTING) && !m_bFriendSummoned && player)
|
||||
if (HasEscortState(STATE_ESCORT_ESCORTING) && !IsFriendSummoned && GetPlayerForEscort())
|
||||
{
|
||||
for (uint8 i = 0; i < 3; ++i)
|
||||
DoCast(me, SPELL_CALL_FRIENDS, true);
|
||||
|
||||
m_bFriendSummoned = true;
|
||||
IsFriendSummoned = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -222,11 +222,9 @@ public:
|
||||
ItemPosCountVec dest;
|
||||
uint8 msg = player->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, ITEM_TEAR_OF_GODDESS, 1);
|
||||
if (msg == EQUIP_ERR_OK)
|
||||
{
|
||||
Item* item = player->StoreNewItem(dest, ITEM_TEAR_OF_GODDESS, true);
|
||||
if (item && player)
|
||||
if (Item* item = player->StoreNewItem(dest, ITEM_TEAR_OF_GODDESS, true))
|
||||
player->SendNewItem(item, 1, true, false, true);
|
||||
}
|
||||
|
||||
player->SEND_GOSSIP_MENU(907, creature->GetGUID());
|
||||
}
|
||||
return true;
|
||||
|
||||
@@ -537,7 +537,6 @@ public:
|
||||
if (!Fandral || !Arygos || !Caelestrasz || !Merithra)
|
||||
return;
|
||||
|
||||
Unit* mob = NULL;
|
||||
AnimationTimer = EventAnim[AnimationCount].Timer;
|
||||
if (eventEnd == false)
|
||||
{
|
||||
@@ -720,6 +719,7 @@ public:
|
||||
case 51:
|
||||
{
|
||||
uint32 entries[4] = { 15423, 15424, 15414, 15422 };
|
||||
Unit* mob = NULL;
|
||||
for (uint8 i = 0; i < 4; ++i)
|
||||
{
|
||||
mob = player->FindNearestCreature(entries[i], 50, me);
|
||||
@@ -844,9 +844,6 @@ public:
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
Unit* target = NULL;
|
||||
//Player* player = me->GetPlayer(PlayerGUID);
|
||||
|
||||
if (!Timers)
|
||||
{
|
||||
if (me->GetEntry() == 15424 || me->GetEntry() == 15422 || me->GetEntry() == 15414) //all but Kaldorei Soldiers
|
||||
@@ -890,6 +887,7 @@ public:
|
||||
}
|
||||
if (!hasTarget)
|
||||
{
|
||||
Unit* target = NULL;
|
||||
if (me->GetEntry() == 15424 || me->GetEntry() == 15422 || me->GetEntry() == 15414)
|
||||
target = me->FindNearestCreature(15423, 20, true);
|
||||
if (me->GetEntry() == 15423)
|
||||
|
||||
@@ -314,15 +314,14 @@ class boss_gothik : public CreatureScript
|
||||
|
||||
bool CheckGroupSplitted()
|
||||
{
|
||||
bool checklife = false;
|
||||
bool checkdead = false;
|
||||
|
||||
Map* map = me->GetMap();
|
||||
if (map && map->IsDungeon())
|
||||
{
|
||||
Map::PlayerList const &PlayerList = map->GetPlayers();
|
||||
if (!PlayerList.isEmpty())
|
||||
{
|
||||
bool checklife = false;
|
||||
bool checkdead = false;
|
||||
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
|
||||
{
|
||||
if (i->getSource() && i->getSource()->isAlive() &&
|
||||
|
||||
@@ -248,11 +248,9 @@ public:
|
||||
{
|
||||
for (uint8 i = 0; i < 3; ++i)
|
||||
{
|
||||
Unit* unit = NULL;
|
||||
if (TargetGUID[i])
|
||||
{
|
||||
unit = Unit::GetUnit(*me, TargetGUID[i]);
|
||||
if (unit)
|
||||
if (Unit* unit = Unit::GetUnit(*me, TargetGUID[i]))
|
||||
unit->CastSpell(unit, SPELL_ATTRACTION, true);
|
||||
TargetGUID[i] = 0;
|
||||
}
|
||||
|
||||
@@ -299,12 +299,11 @@ public:
|
||||
|
||||
for (uint8 i = 0; i < 4; ++i)
|
||||
{
|
||||
Unit* Member = NULL;
|
||||
if (Council[i])
|
||||
{
|
||||
Member = Unit::GetUnit(*me, Council[i]);
|
||||
if (Member && Member->isAlive())
|
||||
CAST_CRE(Member)->AI()->AttackStart(target);
|
||||
Unit* member = Unit::GetUnit(*me, Council[i]);
|
||||
if (member && member->isAlive())
|
||||
CAST_CRE(member)->AI()->AttackStart(target);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -950,14 +950,14 @@ class spell_generic_clone : public SpellScriptLoader
|
||||
|
||||
enum CloneWeaponSpells
|
||||
{
|
||||
SPELL_COPY_WEAPON = 41055,
|
||||
SPELL_COPY_WEAPON_2 = 63416,
|
||||
SPELL_COPY_WEAPON_3 = 69891,
|
||||
SPELL_COPY_WEAPON_AURA = 41054,
|
||||
SPELL_COPY_WEAPON_2_AURA = 63418,
|
||||
SPELL_COPY_WEAPON_3_AURA = 69893,
|
||||
|
||||
SPELL_COPY_OFFHAND = 45206,
|
||||
SPELL_COPY_OFFHAND_2 = 69892,
|
||||
SPELL_COPY_OFFHAND_AURA = 45205,
|
||||
SPELL_COPY_OFFHAND_2_AURA = 69896,
|
||||
|
||||
SPELL_COPY_RANGED = 57593
|
||||
SPELL_COPY_RANGED_AURA = 57594
|
||||
};
|
||||
|
||||
class spell_generic_clone_weapon : public SpellScriptLoader
|
||||
@@ -969,68 +969,16 @@ class spell_generic_clone_weapon : public SpellScriptLoader
|
||||
{
|
||||
PrepareSpellScript(spell_generic_clone_weapon_SpellScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellEntry*/)
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_COPY_WEAPON) || !sSpellMgr->GetSpellInfo(SPELL_COPY_WEAPON_2) || !sSpellMgr->GetSpellInfo(SPELL_COPY_WEAPON_3) || !sSpellMgr->GetSpellInfo(SPELL_COPY_OFFHAND)
|
||||
|| !sSpellMgr->GetSpellInfo(SPELL_COPY_OFFHAND_2) || !sSpellMgr->GetSpellInfo(SPELL_COPY_RANGED))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleScriptEffect(SpellEffIndex effIndex)
|
||||
{
|
||||
PreventHitDefaultEffect(effIndex);
|
||||
Unit* caster = GetCaster();
|
||||
|
||||
if (Unit* target = GetHitUnit())
|
||||
{
|
||||
|
||||
uint32 spellId = uint32(GetSpellInfo()->Effects[EFFECT_0].CalcValue());
|
||||
target->CastSpell(caster, spellId, true);
|
||||
|
||||
if (target->GetTypeId() == TYPEID_PLAYER)
|
||||
return;
|
||||
|
||||
switch (GetSpellInfo()->Id)
|
||||
{
|
||||
case SPELL_COPY_WEAPON:
|
||||
case SPELL_COPY_WEAPON_2:
|
||||
case SPELL_COPY_WEAPON_3:
|
||||
{
|
||||
if (Player* player = caster->ToPlayer())
|
||||
{
|
||||
if (Item* mainItem = player->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_MAINHAND))
|
||||
target->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, mainItem->GetEntry());
|
||||
}
|
||||
else
|
||||
target->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, caster->GetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID));
|
||||
break;
|
||||
}
|
||||
case SPELL_COPY_OFFHAND:
|
||||
case SPELL_COPY_OFFHAND_2:
|
||||
{
|
||||
if (Player* player = caster->ToPlayer())
|
||||
{
|
||||
if (Item* offItem = player->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND))
|
||||
target->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1, offItem->GetEntry());
|
||||
}
|
||||
else
|
||||
target->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1, caster->GetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1));
|
||||
break;
|
||||
}
|
||||
case SPELL_COPY_RANGED:
|
||||
{
|
||||
if (Player* player = caster->ToPlayer())
|
||||
{
|
||||
if (Item* rangedItem = player->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_RANGED))
|
||||
target->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 2, rangedItem->GetEntry());
|
||||
}
|
||||
else
|
||||
target->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 2, caster->GetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 2));
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
caster->CastSpell(target, spellId, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1046,6 +994,125 @@ class spell_generic_clone_weapon : public SpellScriptLoader
|
||||
}
|
||||
};
|
||||
|
||||
class spell_gen_clone_weapon_aura : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_gen_clone_weapon_aura() : SpellScriptLoader("spell_gen_clone_weapon_aura") { }
|
||||
|
||||
class spell_gen_clone_weapon_auraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_gen_clone_weapon_auraScript);
|
||||
|
||||
uint32 prevItem;
|
||||
|
||||
bool Validate(SpellInfo const* /*spellEntry*/)
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_COPY_WEAPON_AURA) || !sSpellMgr->GetSpellInfo(SPELL_COPY_WEAPON_2_AURA) || !sSpellMgr->GetSpellInfo(SPELL_COPY_WEAPON_3_AURA)
|
||||
|| !sSpellMgr->GetSpellInfo(SPELL_COPY_OFFHAND_AURA) || !sSpellMgr->GetSpellInfo(SPELL_COPY_OFFHAND_2_AURA) || !sSpellMgr->GetSpellInfo(SPELL_COPY_RANGED_AURA))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
Unit* caster = GetCaster();
|
||||
Unit* target = GetTarget();
|
||||
|
||||
if (!caster)
|
||||
return;
|
||||
|
||||
switch (GetSpellInfo()->Id)
|
||||
{
|
||||
case SPELL_COPY_WEAPON_AURA:
|
||||
case SPELL_COPY_WEAPON_2_AURA:
|
||||
case SPELL_COPY_WEAPON_3_AURA:
|
||||
{
|
||||
prevItem = target->GetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID);
|
||||
|
||||
if (Player* player = caster->ToPlayer())
|
||||
{
|
||||
if (Item* mainItem = player->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_MAINHAND))
|
||||
target->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, mainItem->GetEntry());
|
||||
}
|
||||
else
|
||||
target->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, caster->GetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID));
|
||||
break;
|
||||
}
|
||||
case SPELL_COPY_OFFHAND_AURA:
|
||||
case SPELL_COPY_OFFHAND_2_AURA:
|
||||
{
|
||||
prevItem = target->GetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID) + 1;
|
||||
|
||||
if (Player* player = caster->ToPlayer())
|
||||
{
|
||||
if (Item* offItem = player->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND))
|
||||
target->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1, offItem->GetEntry());
|
||||
}
|
||||
else
|
||||
target->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1, caster->GetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1));
|
||||
break;
|
||||
}
|
||||
case SPELL_COPY_RANGED_AURA:
|
||||
{
|
||||
prevItem = target->GetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID) + 2;
|
||||
|
||||
if (Player* player = caster->ToPlayer())
|
||||
{
|
||||
if (Item* rangedItem = player->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_RANGED))
|
||||
target->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 2, rangedItem->GetEntry());
|
||||
}
|
||||
else
|
||||
target->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 2, caster->GetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 2));
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
Unit* target = GetTarget();
|
||||
|
||||
switch (GetSpellInfo()->Id)
|
||||
{
|
||||
case SPELL_COPY_WEAPON_AURA:
|
||||
case SPELL_COPY_WEAPON_2_AURA:
|
||||
case SPELL_COPY_WEAPON_3_AURA:
|
||||
{
|
||||
target->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, prevItem);
|
||||
break;
|
||||
}
|
||||
case SPELL_COPY_OFFHAND_AURA:
|
||||
case SPELL_COPY_OFFHAND_2_AURA:
|
||||
{
|
||||
target->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1, prevItem);
|
||||
break;
|
||||
}
|
||||
case SPELL_COPY_RANGED_AURA:
|
||||
{
|
||||
target->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 2, prevItem);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectApply += AuraEffectApplyFn(spell_gen_clone_weapon_auraScript::OnApply, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK);
|
||||
OnEffectRemove += AuraEffectRemoveFn(spell_gen_clone_weapon_auraScript::OnRemove, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_gen_clone_weapon_auraScript();
|
||||
}
|
||||
};
|
||||
|
||||
enum SeaforiumSpells
|
||||
{
|
||||
SPELL_PLANT_CHARGES_CREDIT_ACHIEVEMENT = 60937,
|
||||
@@ -1844,16 +1911,18 @@ class spell_gen_break_shield: public SpellScriptLoader
|
||||
Unit::AuraApplicationMap const& auras = target->GetAppliedAuras();
|
||||
for (Unit::AuraApplicationMap::const_iterator itr = auras.begin(); itr != auras.end(); ++itr)
|
||||
{
|
||||
Aura* aura = itr->second->GetBase();
|
||||
SpellInfo const* auraInfo = aura->GetSpellInfo();
|
||||
if (aura && auraInfo->SpellIconID == 2007 && aura->HasEffectType(SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN))
|
||||
if (Aura* aura = itr->second->GetBase())
|
||||
{
|
||||
aura->ModStackAmount(-1, AURA_REMOVE_BY_ENEMY_SPELL);
|
||||
// Remove dummys from rider (Necessary for updating visual shields)
|
||||
if (Unit* rider = target->GetCharmer())
|
||||
if (Aura* defend = rider->GetAura(aura->GetId()))
|
||||
defend->ModStackAmount(-1, AURA_REMOVE_BY_ENEMY_SPELL);
|
||||
break;
|
||||
SpellInfo const* auraInfo = aura->GetSpellInfo();
|
||||
if (auraInfo && auraInfo->SpellIconID == 2007 && aura->HasEffectType(SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN))
|
||||
{
|
||||
aura->ModStackAmount(-1, AURA_REMOVE_BY_ENEMY_SPELL);
|
||||
// Remove dummys from rider (Necessary for updating visual shields)
|
||||
if (Unit* rider = target->GetCharmer())
|
||||
if (Aura* defend = rider->GetAura(aura->GetId()))
|
||||
defend->ModStackAmount(-1, AURA_REMOVE_BY_ENEMY_SPELL);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -1972,16 +2041,18 @@ class spell_gen_mounted_charge: public SpellScriptLoader
|
||||
Unit::AuraApplicationMap const& auras = target->GetAppliedAuras();
|
||||
for (Unit::AuraApplicationMap::const_iterator itr = auras.begin(); itr != auras.end(); ++itr)
|
||||
{
|
||||
Aura* aura = itr->second->GetBase();
|
||||
SpellInfo const* auraInfo = aura->GetSpellInfo();
|
||||
if (aura && auraInfo->SpellIconID == 2007 && aura->HasEffectType(SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN))
|
||||
if (Aura* aura = itr->second->GetBase())
|
||||
{
|
||||
aura->ModStackAmount(-1, AURA_REMOVE_BY_ENEMY_SPELL);
|
||||
// Remove dummys from rider (Necessary for updating visual shields)
|
||||
if (Unit* rider = target->GetCharmer())
|
||||
if (Aura* defend = rider->GetAura(aura->GetId()))
|
||||
defend->ModStackAmount(-1, AURA_REMOVE_BY_ENEMY_SPELL);
|
||||
break;
|
||||
SpellInfo const* auraInfo = aura->GetSpellInfo();
|
||||
if (auraInfo && auraInfo->SpellIconID == 2007 && aura->HasEffectType(SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN))
|
||||
{
|
||||
aura->ModStackAmount(-1, AURA_REMOVE_BY_ENEMY_SPELL);
|
||||
// Remove dummys from rider (Necessary for updating visual shields)
|
||||
if (Unit* rider = target->GetCharmer())
|
||||
if (Aura* defend = rider->GetAura(aura->GetId()))
|
||||
defend->ModStackAmount(-1, AURA_REMOVE_BY_ENEMY_SPELL);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -3189,6 +3260,7 @@ void AddSC_generic_spell_scripts()
|
||||
new spell_gen_profession_research();
|
||||
new spell_generic_clone();
|
||||
new spell_generic_clone_weapon();
|
||||
new spell_gen_clone_weapon_aura();
|
||||
new spell_gen_seaforium_blast();
|
||||
new spell_gen_turkey_marker();
|
||||
new spell_gen_lifeblood();
|
||||
|
||||
@@ -1291,7 +1291,7 @@ class spell_q12372_destabilize_azure_dragonshrine_dummy : public SpellScriptLoad
|
||||
class spell_q12372_destabilize_azure_dragonshrine_dummy_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_q12372_destabilize_azure_dragonshrine_dummy_SpellScript);
|
||||
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
if (GetHitCreature())
|
||||
|
||||
@@ -278,6 +278,9 @@ class achievement_tilted : public AchievementCriteriaScript
|
||||
|
||||
bool OnCheck(Player* player, Unit* /*target*/)
|
||||
{
|
||||
if (!player)
|
||||
return false;
|
||||
|
||||
bool checkArea = player->GetAreaId() == AREA_ARGENT_TOURNAMENT_FIELDS ||
|
||||
player->GetAreaId() == AREA_RING_OF_ASPIRANTS ||
|
||||
player->GetAreaId() == AREA_RING_OF_ARGENT_VALIANTS ||
|
||||
@@ -285,7 +288,7 @@ class achievement_tilted : public AchievementCriteriaScript
|
||||
player->GetAreaId() == AREA_RING_OF_HORDE_VALIANTS ||
|
||||
player->GetAreaId() == AREA_RING_OF_CHAMPIONS;
|
||||
|
||||
return player && checkArea && player->duel && player->duel->isMounted;
|
||||
return checkArea && player->duel && player->duel->isMounted;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user