From 410586cf436fa0f44ea07c1dcf4d959be8712b93 Mon Sep 17 00:00:00 2001 From: Gacko Date: Thu, 20 Dec 2012 23:55:21 +0100 Subject: Core/Spell: Shadow's Fate conditions Some of the quests only can be done in 25man mode --- src/server/game/Entities/Unit/Unit.cpp | 61 +++++++++++++++++++++++----------- 1 file changed, 41 insertions(+), 20 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 19f3f78fc06..cba0767b66d 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -5572,28 +5572,42 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere // Shadow's Fate (Shadowmourne questline) case 71169: { - uint32 spellId = 0; - - switch (GetEntry()) + bool ok = false; + if (GetMap()->GetDifficulty() == RAID_DIFFICULTY_25MAN_NORMAL || GetMap()->GetDifficulty() == RAID_DIFFICULTY_25MAN_HEROIC) { - case 36678: // NPC: Professor Putricide - spellId = 71518; // Spell: Unholy Infusion Credit - break; - case 37955: // NPC: Blood-Queen Lana'thel - spellId = 72934; // Spell: Quest Credit - break; - case 36853: // NPC: Sindragosa - spellId = 72289; // Spell: Frost Infusion Quest Credit - break; - default: - break; + uint32 spellId = 0; + + switch (GetEntry()) + { + case 36678: // NPC: Professor Putricide + spellId = 71518; // Spell: Unholy Infusion Credit + break; + case 37955: // NPC: Blood-Queen Lana'thel + spellId = 72934; // Spell: Quest Credit + break; + case 36853: // NPC: Sindragosa + spellId = 72289; // Spell: Frost Infusion Quest Credit + break; + default: + break; + } + + if (spellId) + CastSpell((Unit*)NULL, spellId, true); + + ok = true; } - if (spellId) - CastSpell((Unit*)NULL, spellId, true); - CastSpell((Unit*)NULL, 71203, true); + // The spell usually only hits one target, but it should hit every player + // which applied Shadows Fate at least once to the victim. + if (target->GetTypeId() == TYPEID_PLAYER && target->ToPlayer()->GetQuestStatus(24547) == QUEST_STATUS_INCOMPLETE) + { + triggered_spell_id = 71203; + ok = true; + } - return true; + if (!ok) + return false; } // Essence of the Blood Queen case 70871: @@ -9043,7 +9057,11 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg return false; Player* player = ToPlayer(); - if (player->GetQuestStatus(24547) != QUEST_STATUS_INCOMPLETE) + if (player->GetQuestStatus(24547) == QUEST_STATUS_INCOMPLETE) + { + break; + } + else if (player->GetDifficulty(true) == RAID_DIFFICULTY_25MAN_NORMAL || player->GetDifficulty(true) == RAID_DIFFICULTY_25MAN_HEROIC) { uint32 spellId = 0; uint32 questId = 0; @@ -9067,8 +9085,11 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg if (player->GetQuestStatus(questId) != QUEST_STATUS_INCOMPLETE || !player->HasAura(spellId)) return false; + + break; } - break; + else + return false; } } -- cgit v1.2.3 From a8b145348aedf0faba03a60057588b72d3b68c6c Mon Sep 17 00:00:00 2001 From: Gacko Date: Fri, 21 Dec 2012 14:14:58 +0100 Subject: Core/Spell: Add missing break. --- src/server/game/Entities/Unit/Unit.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index cba0767b66d..d4b276fd2db 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -5608,6 +5608,8 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere if (!ok) return false; + + break; } // Essence of the Blood Queen case 70871: -- cgit v1.2.3 From 63ea4b1056dd6fc8b25f580331307d14bdcc26d2 Mon Sep 17 00:00:00 2001 From: Vincent_Michael Date: Fri, 21 Dec 2012 22:22:36 +0100 Subject: Core: Fix some codestyle in 957571e18c4d6e5874ce1052ae49e4d0d21018be --- src/server/game/Entities/Item/Item.cpp | 15 +++++++-------- src/server/game/Entities/Item/Item.h | 2 +- src/server/game/Handlers/LootHandler.cpp | 2 ++ src/server/game/Loot/LootMgr.h | 2 +- .../shared/Database/Implementation/CharacterDatabase.cpp | 4 ++-- 5 files changed, 13 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Item/Item.cpp b/src/server/game/Entities/Item/Item.cpp index 5303fb8dc38..dd54a3d39db 100644 --- a/src/server/game/Entities/Item/Item.cpp +++ b/src/server/game/Entities/Item/Item.cpp @@ -1210,7 +1210,6 @@ bool Item::CheckSoulboundTradeExpire() void Item::ItemContainerSaveLootToDB() { // Saves the money and item loot associated with an openable item to the DB - if (loot.isLooted()) // no money and no loot return; @@ -1235,7 +1234,7 @@ void Item::ItemContainerSaveLootToDB() // Save items if (!loot.isLooted()) { - + PreparedStatement* stmt_items = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ITEMCONTAINER_ITEMS); stmt_items->setUInt32(0, container_id); trans->Append(stmt_items); @@ -1272,7 +1271,6 @@ void Item::ItemContainerSaveLootToDB() bool Item::ItemContainerLoadLootFromDB() { // Loads the money and item loot associated with an openable item from the DB - // Default. If there are no records for this item then it will be rolled for in Player::SendLoot() m_lootGenerated = false; @@ -1335,18 +1333,19 @@ bool Item::ItemContainerLoadLootFromDB() // Finally add the LootItem to the container loot.items.push_back(loot_item); - + // Increment unlooted count loot.unlootedCount++; - } while (item_result->NextRow()); + } + while (item_result->NextRow()); } } - // Mark the item if it has loot so it won't be generated again on open - m_lootGenerated = !loot.isLooted(); + // Mark the item if it has loot so it won't be generated again on open + m_lootGenerated = !loot.isLooted(); - return m_lootGenerated; + return m_lootGenerated; } void Item::ItemContainerDeleteLootItemsFromDB() diff --git a/src/server/game/Entities/Item/Item.h b/src/server/game/Entities/Item/Item.h index 2e1956250f3..ffe31ed765e 100644 --- a/src/server/game/Entities/Item/Item.h +++ b/src/server/game/Entities/Item/Item.h @@ -231,7 +231,7 @@ class Item : public Object static void DeleteFromDB(SQLTransaction& trans, uint32 itemGuid); virtual void DeleteFromDB(SQLTransaction& trans); static void DeleteFromInventoryDB(SQLTransaction& trans, uint32 itemGuid); - + // Lootable items and their contents void ItemContainerSaveLootToDB(); bool ItemContainerLoadLootFromDB(); diff --git a/src/server/game/Handlers/LootHandler.cpp b/src/server/game/Handlers/LootHandler.cpp index b15636e75d2..92ba5237c68 100644 --- a/src/server/game/Handlers/LootHandler.cpp +++ b/src/server/game/Handlers/LootHandler.cpp @@ -393,8 +393,10 @@ void WorldSession::DoLootRelease(uint64 lguid) player->DestroyItemCount(pItem, count, true); } else + { if (pItem->loot.isLooted()) // Only delete item if no loot or money (unlooted loot is saved to db) player->DestroyItem(pItem->GetBagSlot(), pItem->GetSlot(), true); + } return; // item can be looted only single player } else diff --git a/src/server/game/Loot/LootMgr.h b/src/server/game/Loot/LootMgr.h index cfa5d370e3b..89425e1ee66 100644 --- a/src/server/game/Loot/LootMgr.h +++ b/src/server/game/Loot/LootMgr.h @@ -290,7 +290,7 @@ struct Loot uint8 unlootedCount; uint64 roundRobinPlayer; // GUID of the player having the Round-Robin ownership for the loot. If 0, round robin owner has released. LootType loot_type; // required for achievement system - + // GUIDLow of container that holds this loot (item_instance.entry) // Only set for inventory items that can be right-click looted uint32 containerID; diff --git a/src/server/shared/Database/Implementation/CharacterDatabase.cpp b/src/server/shared/Database/Implementation/CharacterDatabase.cpp index 3ef94f3aafd..b36513ba3bb 100644 --- a/src/server/shared/Database/Implementation/CharacterDatabase.cpp +++ b/src/server/shared/Database/Implementation/CharacterDatabase.cpp @@ -544,10 +544,10 @@ void CharacterDatabaseConnection::DoPrepareStatements() PREPARE_STATEMENT(CHAR_SEL_ITEMCONTAINER_ITEMS, "SELECT item_id, item_count, follow_rules, ffa, blocked, counted, under_threshold, needs_quest, rnd_prop, rnd_suffix FROM item_loot_items WHERE container_id = ?", CONNECTION_SYNCH); PREPARE_STATEMENT(CHAR_DEL_ITEMCONTAINER_ITEMS, "DELETE FROM item_loot_items WHERE container_id = ?", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_DEL_ITEMCONTAINER_ITEM, "DELETE FROM item_loot_items WHERE container_id = ? AND item_id = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_INS_ITEMCONTAINER_ITEMS, "INSERT INTO item_loot_items (container_id, item_id, item_count, follow_rules, ffa, blocked, counted, under_threshold, needs_quest, rnd_prop, rnd_suffix) VALUES (?,?,?,?,?,?,?,?,?,?,?)", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_INS_ITEMCONTAINER_ITEMS, "INSERT INTO item_loot_items (container_id, item_id, item_count, follow_rules, ffa, blocked, counted, under_threshold, needs_quest, rnd_prop, rnd_suffix) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_SEL_ITEMCONTAINER_MONEY, "SELECT money FROM item_loot_money WHERE container_id = ?", CONNECTION_SYNCH); PREPARE_STATEMENT(CHAR_DEL_ITEMCONTAINER_MONEY, "DELETE FROM item_loot_money WHERE container_id = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_INS_ITEMCONTAINER_MONEY," INSERT INTO item_loot_money (container_id, money) VALUES (?,?)", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_INS_ITEMCONTAINER_MONEY, "INSERT INTO item_loot_money (container_id, money) VALUES (?, ?)", CONNECTION_ASYNC); // Calendar PREPARE_STATEMENT(CHAR_REP_CALENDAR_EVENT, "REPLACE INTO calendar_events (id, creator, title, description, type, dungeon, eventtime, flags, time2) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC); -- cgit v1.2.3 From a3b34e2894e19c3e5939b7c74e49302046a88b0c Mon Sep 17 00:00:00 2001 From: Vincent_Michael Date: Sat, 22 Dec 2012 01:13:56 +0100 Subject: Core: Fix more some codestyle --- src/server/game/Entities/Item/Item.cpp | 7 ------- src/server/game/Entities/Unit/Unit.cpp | 2 +- src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_viscidus.cpp | 2 +- src/server/scripts/Kalimdor/moonglade.cpp | 2 +- 4 files changed, 3 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Item/Item.cpp b/src/server/game/Entities/Item/Item.cpp index dd54a3d39db..5be1bbf5290 100644 --- a/src/server/game/Entities/Item/Item.cpp +++ b/src/server/game/Entities/Item/Item.cpp @@ -1234,7 +1234,6 @@ void Item::ItemContainerSaveLootToDB() // Save items if (!loot.isLooted()) { - PreparedStatement* stmt_items = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ITEMCONTAINER_ITEMS); stmt_items->setUInt32(0, container_id); trans->Append(stmt_items); @@ -1300,7 +1299,6 @@ bool Item::ItemContainerLoadLootFromDB() // Get a LootTemplate for the container item. This is where // the saved loot was originally rolled from, we will copy conditions from it LootTemplate const* lt = LootTemplates_Item.GetLootFor(GetEntry()); - if (lt) { do @@ -1351,7 +1349,6 @@ bool Item::ItemContainerLoadLootFromDB() void Item::ItemContainerDeleteLootItemsFromDB() { // Deletes items associated with an openable item from the DB - uint32 containerId = GetGUIDLow(); PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ITEMCONTAINER_ITEMS); stmt->setUInt32(0, containerId); @@ -1363,7 +1360,6 @@ void Item::ItemContainerDeleteLootItemsFromDB() void Item::ItemContainerDeleteLootItemFromDB(uint32 itemID) { // Deletes a single item associated with an openable item from the DB - uint32 containerId = GetGUIDLow(); PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ITEMCONTAINER_ITEM); stmt->setUInt32(0, containerId); @@ -1376,7 +1372,6 @@ void Item::ItemContainerDeleteLootItemFromDB(uint32 itemID) void Item::ItemContainerDeleteLootMoneyFromDB() { // Deletes the money loot associated with an openable item from the DB - uint32 containerId = GetGUIDLow(); PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ITEMCONTAINER_MONEY); stmt->setUInt32(0, containerId); @@ -1388,8 +1383,6 @@ void Item::ItemContainerDeleteLootMoneyFromDB() void Item::ItemContainerDeleteLootMoneyAndLootItemsFromDB() { // Deletes money and items associated with an openable item from the DB - ItemContainerDeleteLootMoneyFromDB(); ItemContainerDeleteLootItemsFromDB(); } - diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index d4b276fd2db..05dd8656d9c 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -5598,7 +5598,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere ok = true; } - // The spell usually only hits one target, but it should hit every player + // The spell usually only hits one target, but it should hit every player // which applied Shadows Fate at least once to the victim. if (target->GetTypeId() == TYPEID_PLAYER && target->ToPlayer()->GetQuestStatus(24547) == QUEST_STATUS_INCOMPLETE) { diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_viscidus.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_viscidus.cpp index c97fd40929a..14ea31a6518 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_viscidus.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_viscidus.cpp @@ -59,7 +59,7 @@ enum Emotes EMOTE_SLOW = 0, EMOTE_FREEZE = 1, EMOTE_FROZEN = 2, - + EMOTE_CRACK = 3, EMOTE_SHATTER = 4, EMOTE_EXPLODE = 5 diff --git a/src/server/scripts/Kalimdor/moonglade.cpp b/src/server/scripts/Kalimdor/moonglade.cpp index f438275b82a..14a76cc153e 100644 --- a/src/server/scripts/Kalimdor/moonglade.cpp +++ b/src/server/scripts/Kalimdor/moonglade.cpp @@ -323,7 +323,7 @@ public: } void IsSummonedBy(Unit* /*summoner*/) - { + { std::list playerOnQuestList; Trinity::AnyPlayerInObjectRangeCheck checker(me, 5.0f); Trinity::PlayerListSearcher searcher(me, playerOnQuestList, checker); -- cgit v1.2.3 From 4c9451d54c885df3fac4be875728425ca0defa45 Mon Sep 17 00:00:00 2001 From: MrSmite Date: Fri, 21 Dec 2012 20:57:22 -0500 Subject: Fix pet stopping approach when attacked by another creature Fix pet placed on stay after "attack" not attacking new attackers Closes #8735 --- src/server/game/AI/CoreAI/PetAI.cpp | 4 ++++ src/server/game/Entities/Unit/Unit.cpp | 5 ++++- src/server/game/Entities/Unit/Unit.h | 18 ++++++++++++++---- 3 files changed, 22 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/server/game/AI/CoreAI/PetAI.cpp b/src/server/game/AI/CoreAI/PetAI.cpp index 78c22e74f44..47cc4d12501 100644 --- a/src/server/game/AI/CoreAI/PetAI.cpp +++ b/src/server/game/AI/CoreAI/PetAI.cpp @@ -106,8 +106,12 @@ void PetAI::UpdateAI(const uint32 diff) // Check before attacking to prevent pets from leaving stay position if (me->GetCharmInfo()->HasCommandState(COMMAND_STAY)) { + // Case where pet was put on stay after "attack" was clicked and it gets attacked by + // another creature. Pet can switch target if victim is out of range. if (me->GetCharmInfo()->IsCommandAttack() || (me->GetCharmInfo()->IsAtStay() && me->IsWithinMeleeRange(me->getVictim()))) DoMeleeAttackIfReady(); + else if (me->GetCharmInfo()->IsCommandAttack() || (me->GetCharmInfo()->IsAtStay() && me->IsWithinMeleeRange(me->getAttackerForHelper()))) + DoAttack(me->getAttackerForHelper(), false); } else DoMeleeAttackIfReady(); diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index d4b276fd2db..4252bf1cb1f 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -12136,7 +12136,10 @@ void Unit::CombatStart(Unit* target, bool initialAggro) if (!target->isInCombat() && target->GetTypeId() != TYPEID_PLAYER && !target->ToCreature()->HasReactState(REACT_PASSIVE) && target->ToCreature()->IsAIEnabled) { - target->ToCreature()->AI()->AttackStart(this); + if (target->isPet()) + target->ToCreature()->AI()->AttackedBy(this); // PetAI has special handler before AttackStart() + else + target->ToCreature()->AI()->AttackStart(this); } SetInCombatWith(target); diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index 3053d0018d4..8cb0f434907 100644 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -1261,12 +1261,22 @@ class Unit : public WorldObject } Unit* getAttackerForHelper() const // If someone wants to help, who to give them { - if (getVictim() != NULL) - return getVictim(); + if (isPet()) + { + if (!m_attackers.empty()) + return *(m_attackers.begin()); - if (!m_attackers.empty()) - return *(m_attackers.begin()); + if (getVictim() != NULL) + return getVictim(); + } + else + { + if (getVictim() != NULL) + return getVictim(); + if (!m_attackers.empty()) + return *(m_attackers.begin()); + } return NULL; } bool Attack(Unit* victim, bool meleeAttack); -- cgit v1.2.3 From 80dcf879deb61198ff2c91d71887f0eae9acad68 Mon Sep 17 00:00:00 2001 From: Trista Date: Sat, 22 Dec 2012 04:27:02 +0200 Subject: Core/Spells: TARGET_UNIT_MASTER passenger support * what happened before was spells casted from vehicle to passenger getting blocked by general check exceptions that state passengers to be not implicitly spell hit, however they should be ignored when caster is vehicle to master passenger * fix a lot of quests that award kill credit that was blocked before * precisely closes: #8643 and makes #5254 awardable --- src/server/game/Spells/SpellInfo.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index fcfa441455e..6631a8138b4 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -1546,11 +1546,18 @@ SpellCastResult SpellInfo::CheckTarget(Unit const* caster, WorldObject const* ta if (unitTarget->HasUnitState(UNIT_STATE_IN_FLIGHT)) return SPELL_FAILED_BAD_TARGETS; - if (TargetAuraState && !unitTarget->HasAuraState(AuraStateType(TargetAuraState), this, caster)) - return SPELL_FAILED_TARGET_AURASTATE; + // TARGET_UNIT_MASTER gets blocked here for passengers, because the whole idea of this check is to + // not allow passengers to be implicitly hit by spells, however this target type should be an exception, + // if this is left it kills spells that award kill credit from vehicle to master and some or all* spells, + // the use of these 2 covers passenger target check + if (!(Targets & TARGET_UNIT_MASTER) && !caster->IsVehicle()) + { + if (TargetAuraState && !unitTarget->HasAuraState(AuraStateType(TargetAuraState), this, caster)) + return SPELL_FAILED_TARGET_AURASTATE; - if (TargetAuraStateNot && unitTarget->HasAuraState(AuraStateType(TargetAuraStateNot), this, caster)) - return SPELL_FAILED_TARGET_AURASTATE; + if (TargetAuraStateNot && unitTarget->HasAuraState(AuraStateType(TargetAuraStateNot), this, caster)) + return SPELL_FAILED_TARGET_AURASTATE; + } if (TargetAuraSpell && !unitTarget->HasAura(sSpellMgr->GetSpellIdForDifficulty(TargetAuraSpell, caster))) return SPELL_FAILED_TARGET_AURASTATE; -- cgit v1.2.3 From aabfa3afae128e5cc23852d6b9ddef145c6e360e Mon Sep 17 00:00:00 2001 From: Trista Date: Sat, 22 Dec 2012 06:32:45 +0200 Subject: Core/Spell: Properly rewrite previous change: 80dcf879deb61198ff2c91d71887f0eae9acad68 * thx to @joschiwald for noticing problem and helping, see rest info in comment or previous fix --- src/server/game/Spells/SpellInfo.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index 6631a8138b4..61b92ce6f81 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -1546,11 +1546,14 @@ SpellCastResult SpellInfo::CheckTarget(Unit const* caster, WorldObject const* ta if (unitTarget->HasUnitState(UNIT_STATE_IN_FLIGHT)) return SPELL_FAILED_BAD_TARGETS; - // TARGET_UNIT_MASTER gets blocked here for passengers, because the whole idea of this check is to - // not allow passengers to be implicitly hit by spells, however this target type should be an exception, - // if this is left it kills spells that award kill credit from vehicle to master and some or all* spells, - // the use of these 2 covers passenger target check - if (!(Targets & TARGET_UNIT_MASTER) && !caster->IsVehicle()) + /* TARGET_UNIT_MASTER gets blocked here for passengers, because the whole idea of this check is to + not allow passengers to be implicitly hit by spells, however this target type should be an exception, + if this is left it kills spells that award kill credit from vehicle to master (few spells), + the use of these 2 covers passenger target check, logically, if vehicle cast this to master it should always hit + him, because it would be it's passenger, there's no such case where this gets to fail legitimacy, this problem + cannot be solved from within the check in other way since target type cannot be called for the spell currently + Spell examples: [ID - 52864 Devour Water, ID - 52862 Devour Wind, ID - 49370 Wyrmrest Defender: Destabilize Azure Dragonshrine Effect] */ + if (!caster->IsVehicle() && !(caster->GetCharmerOrOwner() == target)) { if (TargetAuraState && !unitTarget->HasAuraState(AuraStateType(TargetAuraState), this, caster)) return SPELL_FAILED_TARGET_AURASTATE; -- cgit v1.2.3 From 8cbb3763dd3f6fb043c5c60bb81014349125b942 Mon Sep 17 00:00:00 2001 From: Gacko Date: Sat, 22 Dec 2012 16:42:46 +0100 Subject: Core/Spell: Shadows Fate crash fix --- src/server/game/Entities/Unit/Unit.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 05dd8656d9c..92629d286bc 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -5598,18 +5598,18 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere ok = true; } - // The spell usually only hits one target, but it should hit every player - // which applied Shadows Fate at least once to the victim. - if (target->GetTypeId() == TYPEID_PLAYER && target->ToPlayer()->GetQuestStatus(24547) == QUEST_STATUS_INCOMPLETE) + // TODO: The aura should be applieable by multiple players + Unit* caster = triggeredByAura->GetCaster(); + if (caster && caster->GetTypeId() == TYPEID_PLAYER && caster->ToPlayer()->GetQuestStatus(24547) == QUEST_STATUS_INCOMPLETE) { - triggered_spell_id = 71203; + CastSpell(caster, 71203, true); ok = true; } if (!ok) return false; - break; + return true; } // Essence of the Blood Queen case 70871: -- cgit v1.2.3 From 2302b04a063e79988fb8fae0c0c595c5fc5c8a55 Mon Sep 17 00:00:00 2001 From: Gacko Date: Sat, 22 Dec 2012 17:49:51 +0100 Subject: Core/Spell: Last work on Shadows Fate - Shadows Fate can now be applied by more than just one player at the same time. So on everyone who hits the unit the credit spell with the visual will be casted on death. - The AOE credit spells for the three infusion quests will be casted by the boss once. If this would be done on proc, these AOE spells could be casted up to 25 times. -> 25 AOE credit spells plus 25 Soul Feast credit spells equals Sh** --- src/server/game/Entities/Unit/Unit.cpp | 36 +-------- src/server/game/Spells/SpellMgr.cpp | 3 + .../IcecrownCitadel/boss_blood_queen_lana_thel.cpp | 7 ++ .../IcecrownCitadel/boss_professor_putricide.cpp | 91 ++++++++++++---------- .../Northrend/IcecrownCitadel/boss_sindragosa.cpp | 9 ++- .../Northrend/IcecrownCitadel/icecrown_citadel.h | 3 + 6 files changed, 73 insertions(+), 76 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 92629d286bc..52515ebee8b 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -5572,44 +5572,14 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere // Shadow's Fate (Shadowmourne questline) case 71169: { - bool ok = false; - if (GetMap()->GetDifficulty() == RAID_DIFFICULTY_25MAN_NORMAL || GetMap()->GetDifficulty() == RAID_DIFFICULTY_25MAN_HEROIC) - { - uint32 spellId = 0; - - switch (GetEntry()) - { - case 36678: // NPC: Professor Putricide - spellId = 71518; // Spell: Unholy Infusion Credit - break; - case 37955: // NPC: Blood-Queen Lana'thel - spellId = 72934; // Spell: Quest Credit - break; - case 36853: // NPC: Sindragosa - spellId = 72289; // Spell: Frost Infusion Quest Credit - break; - default: - break; - } - - if (spellId) - CastSpell((Unit*)NULL, spellId, true); - - ok = true; - } - - // TODO: The aura should be applieable by multiple players Unit* caster = triggeredByAura->GetCaster(); if (caster && caster->GetTypeId() == TYPEID_PLAYER && caster->ToPlayer()->GetQuestStatus(24547) == QUEST_STATUS_INCOMPLETE) { CastSpell(caster, 71203, true); - ok = true; + return true; } - - if (!ok) + else return false; - - return true; } // Essence of the Blood Queen case 70871: @@ -9055,7 +9025,7 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg case 71169: { // Victim needs more checks so bugs, rats or summons can not be affected by the proc. - if (GetTypeId() != TYPEID_PLAYER || victim->GetTypeId() != TYPEID_UNIT || victim->GetCreatureType() == CREATURE_TYPE_CRITTER) + if (GetTypeId() != TYPEID_PLAYER || !victim || victim->GetTypeId() != TYPEID_UNIT || victim->GetCreatureType() == CREATURE_TYPE_CRITTER) return false; Player* player = ToPlayer(); diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index 3eefd969eed..d166c6f9ebf 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -3413,6 +3413,9 @@ void SpellMgr::LoadDbcDataCorrections() case 71123: // Decimate (Stinky & Precious) spellInfo->EffectRadiusIndex[0] = EFFECT_RADIUS_100_YARDS; // 100yd break; + case 71169: // Shadow's Fate + spellInfo->AttributesEx3 |= SPELL_ATTR3_STACK_FOR_DIFF_CASTERS; + break; case 72378: // Blood Nova (Deathbringer Saurfang) case 73058: // Blood Nova (Deathbringer Saurfang) spellInfo->EffectRadiusIndex[0] = EFFECT_RADIUS_200_YARDS; diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp index 2b240bc93d8..a246852c8ed 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp @@ -62,6 +62,9 @@ enum Spells SPELL_INCITE_TERROR = 73070, SPELL_BLOODBOLT_WHIRL = 71772, SPELL_ANNIHILATE = 71322, + + // Blood Infusion + SPELL_BLOOD_INFUSION_CREDIT = 72934 }; enum Shadowmourne @@ -182,6 +185,10 @@ class boss_blood_queen_lana_thel : public CreatureScript { _JustDied(); Talk(SAY_DEATH); + + if (Is25ManRaid() && me->HasAura(SPELL_SHADOWS_FATE)) + DoCastAOE(SPELL_BLOOD_INFUSION_CREDIT, true); + CleanAuras(); // Blah, credit the quest if (_creditBloodQuickening) diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp index 4727504a4bd..d697be214c7 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp @@ -51,62 +51,65 @@ enum ScriptTexts enum Spells { // Festergut - SPELL_RELEASE_GAS_VISUAL = 69125, - SPELL_GASEOUS_BLIGHT_LARGE = 69157, - SPELL_GASEOUS_BLIGHT_MEDIUM = 69162, - SPELL_GASEOUS_BLIGHT_SMALL = 69164, - SPELL_MALLABLE_GOO_H = 70852, + SPELL_RELEASE_GAS_VISUAL = 69125, + SPELL_GASEOUS_BLIGHT_LARGE = 69157, + SPELL_GASEOUS_BLIGHT_MEDIUM = 69162, + SPELL_GASEOUS_BLIGHT_SMALL = 69164, + SPELL_MALLABLE_GOO_H = 70852, // Rotface - SPELL_VILE_GAS_H = 69240, + SPELL_VILE_GAS_H = 69240, // Professor Putricide - SPELL_SLIME_PUDDLE_TRIGGER = 70341, - SPELL_MALLEABLE_GOO = 70852, - SPELL_UNSTABLE_EXPERIMENT = 70351, - SPELL_TEAR_GAS = 71617, // phase transition - SPELL_TEAR_GAS_CREATURE = 71618, - SPELL_TEAR_GAS_CANCEL = 71620, - SPELL_TEAR_GAS_PERIODIC_TRIGGER = 73170, - SPELL_CREATE_CONCOCTION = 71621, - SPELL_GUZZLE_POTIONS = 71893, - SPELL_OOZE_TANK_PROTECTION = 71770, // protects the tank - SPELL_CHOKING_GAS_BOMB = 71255, - SPELL_OOZE_VARIABLE = 74118, - SPELL_GAS_VARIABLE = 74119, - SPELL_UNBOUND_PLAGUE = 70911, - SPELL_UNBOUND_PLAGUE_SEARCHER = 70917, - SPELL_PLAGUE_SICKNESS = 70953, - SPELL_UNBOUND_PLAGUE_PROTECTION = 70955, - SPELL_MUTATED_PLAGUE = 72451, - SPELL_MUTATED_PLAGUE_CLEAR = 72618, + SPELL_SLIME_PUDDLE_TRIGGER = 70341, + SPELL_MALLEABLE_GOO = 70852, + SPELL_UNSTABLE_EXPERIMENT = 70351, + SPELL_TEAR_GAS = 71617, // phase transition + SPELL_TEAR_GAS_CREATURE = 71618, + SPELL_TEAR_GAS_CANCEL = 71620, + SPELL_TEAR_GAS_PERIODIC_TRIGGER = 73170, + SPELL_CREATE_CONCOCTION = 71621, + SPELL_GUZZLE_POTIONS = 71893, + SPELL_OOZE_TANK_PROTECTION = 71770, // protects the tank + SPELL_CHOKING_GAS_BOMB = 71255, + SPELL_OOZE_VARIABLE = 74118, + SPELL_GAS_VARIABLE = 74119, + SPELL_UNBOUND_PLAGUE = 70911, + SPELL_UNBOUND_PLAGUE_SEARCHER = 70917, + SPELL_PLAGUE_SICKNESS = 70953, + SPELL_UNBOUND_PLAGUE_PROTECTION = 70955, + SPELL_MUTATED_PLAGUE = 72451, + SPELL_MUTATED_PLAGUE_CLEAR = 72618, // Slime Puddle - SPELL_GROW_STACKER = 70345, - SPELL_GROW = 70347, - SPELL_SLIME_PUDDLE_AURA = 70343, + SPELL_GROW_STACKER = 70345, + SPELL_GROW = 70347, + SPELL_SLIME_PUDDLE_AURA = 70343, // Gas Cloud - SPELL_GASEOUS_BLOAT_PROC = 70215, - SPELL_GASEOUS_BLOAT = 70672, - SPELL_GASEOUS_BLOAT_PROTECTION = 70812, - SPELL_EXPUNGED_GAS = 70701, + SPELL_GASEOUS_BLOAT_PROC = 70215, + SPELL_GASEOUS_BLOAT = 70672, + SPELL_GASEOUS_BLOAT_PROTECTION = 70812, + SPELL_EXPUNGED_GAS = 70701, // Volatile Ooze - SPELL_OOZE_ERUPTION = 70492, - SPELL_VOLATILE_OOZE_ADHESIVE = 70447, - SPELL_OOZE_ERUPTION_SEARCH_PERIODIC = 70457, - SPELL_VOLATILE_OOZE_PROTECTION = 70530, + SPELL_OOZE_ERUPTION = 70492, + SPELL_VOLATILE_OOZE_ADHESIVE = 70447, + SPELL_OOZE_ERUPTION_SEARCH_PERIODIC = 70457, + SPELL_VOLATILE_OOZE_PROTECTION = 70530, // Choking Gas Bomb - SPELL_CHOKING_GAS_BOMB_PERIODIC = 71259, - SPELL_CHOKING_GAS_EXPLOSION_TRIGGER = 71280, + SPELL_CHOKING_GAS_BOMB_PERIODIC = 71259, + SPELL_CHOKING_GAS_EXPLOSION_TRIGGER = 71280, // Mutated Abomination vehicle - SPELL_ABOMINATION_VEHICLE_POWER_DRAIN = 70385, - SPELL_MUTATED_TRANSFORMATION = 70311, - SPELL_MUTATED_TRANSFORMATION_DAMAGE = 70405, - SPELL_MUTATED_TRANSFORMATION_NAME = 72401, + SPELL_ABOMINATION_VEHICLE_POWER_DRAIN = 70385, + SPELL_MUTATED_TRANSFORMATION = 70311, + SPELL_MUTATED_TRANSFORMATION_DAMAGE = 70405, + SPELL_MUTATED_TRANSFORMATION_NAME = 72401, + + // Unholy Infusion + SPELL_UNHOLY_INFUSION_CREDIT = 71518 }; #define SPELL_GASEOUS_BLOAT_HELPER RAID_MODE(70672, 72455, 72832, 72833) @@ -293,6 +296,10 @@ class boss_professor_putricide : public CreatureScript { _JustDied(); Talk(SAY_DEATH); + + if (Is25ManRaid() && me->HasAura(SPELL_SHADOWS_FATE)) + DoCastAOE(SPELL_UNHOLY_INFUSION_CREDIT, true); + DoCast(SPELL_MUTATED_PLAGUE_CLEAR); } diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp index 96cabfed918..8bdef30a711 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp @@ -82,6 +82,9 @@ enum Spells SPELL_FOCUS_FIRE = 71350, SPELL_ORDER_WHELP = 71357, SPELL_CONCUSSIVE_SHOCK = 71337, + + // Frost Infusion + SPELL_FROST_INFUSION_CREDIT = 72289 }; enum Events @@ -231,8 +234,12 @@ class boss_sindragosa : public CreatureScript void JustDied(Unit* killer) { - BossAI::JustDied(killer); + _JustDied(); Talk(SAY_DEATH); + + if (Is25ManRaid() && me->HasAura(SPELL_SHADOWS_FATE)) + DoCastAOE(SPELL_FROST_INFUSION_CREDIT, true); + } void EnterCombat(Unit* victim) diff --git a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.h b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.h index 4e117d9f3e3..8edaf1aa985 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.h +++ b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.h @@ -54,6 +54,9 @@ enum SharedSpells // The Lich King SPELL_ARTHAS_TELEPORTER_CEREMONY = 72915, SPELL_FROSTMOURNE_TELEPORT_VISUAL = 73078, + + // Shadowmourne questline + SPELL_SHADOWS_FATE = 71169 }; enum TeleporterSpells -- cgit v1.2.3 From 9a5b17d536c3c39f81548b1f4dca51caa6b3f48d Mon Sep 17 00:00:00 2001 From: MrSmite Date: Sat, 22 Dec 2012 12:01:51 -0500 Subject: Update src/server/game/AI/CoreAI/PetAI.cpp --- src/server/game/AI/CoreAI/PetAI.cpp | 4 ---- 1 file changed, 4 deletions(-) (limited to 'src') diff --git a/src/server/game/AI/CoreAI/PetAI.cpp b/src/server/game/AI/CoreAI/PetAI.cpp index 47cc4d12501..78c22e74f44 100644 --- a/src/server/game/AI/CoreAI/PetAI.cpp +++ b/src/server/game/AI/CoreAI/PetAI.cpp @@ -106,12 +106,8 @@ void PetAI::UpdateAI(const uint32 diff) // Check before attacking to prevent pets from leaving stay position if (me->GetCharmInfo()->HasCommandState(COMMAND_STAY)) { - // Case where pet was put on stay after "attack" was clicked and it gets attacked by - // another creature. Pet can switch target if victim is out of range. if (me->GetCharmInfo()->IsCommandAttack() || (me->GetCharmInfo()->IsAtStay() && me->IsWithinMeleeRange(me->getVictim()))) DoMeleeAttackIfReady(); - else if (me->GetCharmInfo()->IsCommandAttack() || (me->GetCharmInfo()->IsAtStay() && me->IsWithinMeleeRange(me->getAttackerForHelper()))) - DoAttack(me->getAttackerForHelper(), false); } else DoMeleeAttackIfReady(); -- cgit v1.2.3 From 09204f15347a4a0988e9acb8f5420d3f39eac755 Mon Sep 17 00:00:00 2001 From: MrSmite Date: Sat, 22 Dec 2012 12:04:10 -0500 Subject: Update src/server/game/Entities/Unit/Unit.h --- src/server/game/Entities/Unit/Unit.h | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index 8cb0f434907..3053d0018d4 100644 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -1261,22 +1261,12 @@ class Unit : public WorldObject } Unit* getAttackerForHelper() const // If someone wants to help, who to give them { - if (isPet()) - { - if (!m_attackers.empty()) - return *(m_attackers.begin()); + if (getVictim() != NULL) + return getVictim(); - if (getVictim() != NULL) - return getVictim(); - } - else - { - if (getVictim() != NULL) - return getVictim(); + if (!m_attackers.empty()) + return *(m_attackers.begin()); - if (!m_attackers.empty()) - return *(m_attackers.begin()); - } return NULL; } bool Attack(Unit* victim, bool meleeAttack); -- cgit v1.2.3 From 621a249188768c9aa65db70125e90670482e0152 Mon Sep 17 00:00:00 2001 From: Shauren Date: Sun, 23 Dec 2012 12:42:28 +0100 Subject: Scripts/Icecrown Citadel: Fixed a possible crash in Blood Nova spell script Closes #7046 --- .../Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp index 9ee4bcea4d9..40781169f44 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp @@ -1218,6 +1218,12 @@ class spell_deathbringer_blood_nova_targeting : public SpellScriptLoader if (targetsAtRange < minTargets) targetsAtRange = std::min(targets.size() - 1, minTargets); + if (!targetsAtRange) + { + targets.clear(); + return; + } + std::list::const_iterator itr = targets.begin(); std::advance(itr, urand(0, targetsAtRange)); target = *itr; @@ -1228,10 +1234,10 @@ class spell_deathbringer_blood_nova_targeting : public SpellScriptLoader // use the same target for first and second effect void FilterTargetsSubsequent(std::list& unitList) { + unitList.clear(); if (!target) return; - unitList.clear(); unitList.push_back(target); } -- cgit v1.2.3 From 143340b38c857b2cc50ee9f8577abf9248b6317a Mon Sep 17 00:00:00 2001 From: Subv Date: Sat, 22 Dec 2012 23:03:26 -0500 Subject: Core/Movement: Fixed near teleports, big thanks to @Trista who basically figured this out on his own. --- src/server/game/Entities/Player/Player.cpp | 9 --------- src/server/game/Entities/Player/Player.h | 1 - src/server/game/Entities/Unit/Unit.cpp | 15 ++++++++++++++- src/server/game/Entities/Unit/Unit.h | 1 + 4 files changed, 15 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index af7692b87c5..bca94517ef4 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -2067,15 +2067,6 @@ uint8 Player::GetChatTag() const return tag; } -void Player::SendTeleportPacket(Position &oldPos) -{ - WorldPacket data2(MSG_MOVE_TELEPORT, 38); - data2.append(GetPackGUID()); - BuildMovementPacket(&data2); - Relocate(&oldPos); - SendMessageToSet(&data2, false); -} - void Player::SendTeleportAckPacket() { WorldPacket data(MSG_MOVE_TELEPORT_ACK, 41); diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index cc08e9c2e18..1e8b6aedb3e 100644 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -1947,7 +1947,6 @@ class Player : public Unit, public GridObject void SendMessageToSetInRange(WorldPacket* data, float dist, bool self, bool own_team_only); void SendMessageToSet(WorldPacket* data, Player const* skipped_rcvr); - void SendTeleportPacket(Position &oldPos); void SendTeleportAckPacket(); Corpse* GetCorpse() const; diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 78123d2500c..6e0d76208e5 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -17325,10 +17325,23 @@ void Unit::NearTeleportTo(float x, float y, float z, float orientation, bool cas else { UpdatePosition(x, y, z, orientation, true); - SendMovementFlagUpdate(); + Position pos; // dummy, not used for creatures. + SendTeleportPacket(pos); } } +void Unit::SendTeleportPacket(Position& oldPos) +{ + WorldPacket data2(MSG_MOVE_TELEPORT, 38); + data2.append(GetPackGUID()); + BuildMovementPacket(&data2); + + if (GetTypeId() == TYPEID_PLAYER) + Relocate(&oldPos); + + SendMessageToSet(&data2, false); +} + bool Unit::UpdatePosition(float x, float y, float z, float orientation, bool teleport) { // prevent crash when a bad coord is sent by the client diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index 3053d0018d4..e46fbb99a8c 100644 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -1592,6 +1592,7 @@ class Unit : public WorldObject void SendSpellDamageImmune(Unit* target, uint32 spellId); void NearTeleportTo(float x, float y, float z, float orientation, bool casting = false); + void SendTeleportPacket(Position& oldPos); virtual bool UpdatePosition(float x, float y, float z, float ang, bool teleport = false); // returns true if unit's position really changed bool UpdatePosition(const Position &pos, bool teleport = false) { return UpdatePosition(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), pos.GetOrientation(), teleport); } -- cgit v1.2.3 From 24466d721ce337306b11fbbeb301fa635a109cfe Mon Sep 17 00:00:00 2001 From: Subv Date: Sun, 23 Dec 2012 09:33:29 -0500 Subject: Core/Entities: Missing change from previous commit Calling UpdateObjectVisibility() will make sure that the semi-far teleports (those where the destination position is not in direct sight) will work correctly. --- src/server/game/Entities/Unit/Unit.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 6e0d76208e5..d44dc6ff235 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -17327,6 +17327,7 @@ void Unit::NearTeleportTo(float x, float y, float z, float orientation, bool cas UpdatePosition(x, y, z, orientation, true); Position pos; // dummy, not used for creatures. SendTeleportPacket(pos); + UpdateObjectVisibility(); } } -- cgit v1.2.3