diff options
Diffstat (limited to 'src/server/game')
| -rw-r--r-- | src/server/game/AI/CoreAI/UnitAI.cpp | 1 | ||||
| -rw-r--r-- | src/server/game/AI/ScriptedAI/ScriptedCreature.cpp | 3 | ||||
| -rw-r--r-- | src/server/game/Entities/GameObject/GameObject.cpp | 6 | ||||
| -rw-r--r-- | src/server/game/Entities/Player/Player.cpp | 6 | ||||
| -rw-r--r-- | src/server/game/Entities/Transport/Transport.cpp | 15 | ||||
| -rw-r--r-- | src/server/game/Globals/ObjectMgr.cpp | 4 | ||||
| -rw-r--r-- | src/server/game/Globals/ObjectMgr.h | 2 | ||||
| -rw-r--r-- | src/server/game/Handlers/TradeHandler.cpp | 1 | ||||
| -rw-r--r-- | src/server/game/Maps/Map.cpp | 44 | ||||
| -rw-r--r-- | src/server/game/Quests/QuestDef.cpp | 2 | ||||
| -rw-r--r-- | src/server/game/Spells/Auras/SpellAuras.cpp | 12 | ||||
| -rw-r--r-- | src/server/game/Spells/SpellMgr.cpp | 12 |
12 files changed, 60 insertions, 48 deletions
diff --git a/src/server/game/AI/CoreAI/UnitAI.cpp b/src/server/game/AI/CoreAI/UnitAI.cpp index 8bf34527769..9631b75fe06 100644 --- a/src/server/game/AI/CoreAI/UnitAI.cpp +++ b/src/server/game/AI/CoreAI/UnitAI.cpp @@ -28,7 +28,6 @@ void UnitAI::AttackStart(Unit* victim) { - if (victim && me->Attack(victim, true)) me->GetMotionMaster()->MoveChase(victim); } diff --git a/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp b/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp index 36c1d384693..c205dd908c7 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp +++ b/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp @@ -478,10 +478,7 @@ void BossAI::_JustDied() events.Reset(); summons.DespawnAll(); if (instance) - { instance->SetBossState(_bossId, DONE); - instance->SaveToDB(); - } } void BossAI::_EnterCombat() diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp index 8051c757bf2..40488df9ef3 100644 --- a/src/server/game/Entities/GameObject/GameObject.cpp +++ b/src/server/game/Entities/GameObject/GameObject.cpp @@ -526,7 +526,7 @@ void GameObject::Update(uint32 diff) { case GAMEOBJECT_TYPE_DOOR: case GAMEOBJECT_TYPE_BUTTON: - if (GetGOInfo()->GetAutoCloseTime() && (m_cooldownTime < time(NULL))) + if (m_cooldownTime && (m_cooldownTime < time(NULL))) ResetDoorOrButton(); break; case GAMEOBJECT_TYPE_GOOBER: @@ -568,10 +568,12 @@ void GameObject::Update(uint32 diff) CastSpell(target, goInfo->trap.spellId); // Template value or 4 seconds - m_cooldownTime = time(NULL) + (goInfo->trap.cooldown ? goInfo->trap.cooldown : uint32(4)); + m_cooldownTime = time(NULL) + (goInfo->trap.cooldown ? goInfo->trap.cooldown : uint32(4)); if (goInfo->trap.type == 1) SetLootState(GO_JUST_DEACTIVATED); + else if (!goInfo->trap.type) + SetLootState(GO_READY); // Battleground gameobjects have data2 == 0 && data5 == 3 if (!goInfo->trap.diameter && goInfo->trap.cooldown == 3) diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index a701e6fc38f..e7d14d68377 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -364,6 +364,12 @@ void TradeData::SetMoney(uint32 money) if (m_money == money) return; + if (!m_player->HasEnoughMoney(money)) + { + m_player->GetSession()->SendTradeStatus(TRADE_STATUS_BUSY); + return; + } + m_money = money; SetAccepted(false); diff --git a/src/server/game/Entities/Transport/Transport.cpp b/src/server/game/Entities/Transport/Transport.cpp index fd45c3fc596..8bc07732bb6 100644 --- a/src/server/game/Entities/Transport/Transport.cpp +++ b/src/server/game/Entities/Transport/Transport.cpp @@ -85,8 +85,8 @@ bool Transport::Create(uint32 guidlow, uint32 entry, uint32 mapid, float x, floa _triggeredDepartureEvent = false; m_goValue.Transport.PathProgress = 0; - SetFloatValue(OBJECT_FIELD_SCALE_X, goinfo->size); - SetUInt32Value(GAMEOBJECT_FACTION, goinfo->faction); + SetObjectScale(goinfo->size); + SetFaction(goinfo->faction); SetUInt32Value(GAMEOBJECT_FLAGS, goinfo->flags); SetPeriod(tInfo->pathTime); SetEntry(goinfo->entry); @@ -210,8 +210,14 @@ void Transport::Update(uint32 diff) 3. transport moves from active to inactive grid 4. the grid that transport is currently in unloads */ - if (_staticPassengers.empty() && GetMap()->IsGridLoaded(GetPositionX(), GetPositionY())) // 2. + bool gridActive = GetMap()->IsGridLoaded(GetPositionX(), GetPositionY()); + + if (_staticPassengers.empty() && gridActive) // 2. LoadStaticPassengers(); + else if (!_staticPassengers.empty() && !gridActive) + // 4. - if transports stopped on grid edge, some passengers can remain in active grids + // unload all static passengers otherwise passengers won't load correctly when the grid that transport is currently in becomes active + UnloadStaticPassengers(); } } @@ -450,6 +456,7 @@ TempSummon* Transport::SummonPassenger(uint32 entry, Position const& pos, TempSu void Transport::UpdatePosition(float x, float y, float z, float o) { bool newActive = GetMap()->IsGridLoaded(x, y); + Cell oldCell(GetPositionX(), GetPositionY()); Relocate(x, y, z, o); UpdateModelPosition(); @@ -464,7 +471,7 @@ void Transport::UpdatePosition(float x, float y, float z, float o) */ if (_staticPassengers.empty() && newActive) // 1. LoadStaticPassengers(); - else if (!_staticPassengers.empty() && !newActive && Cell(x, y).DiffGrid(Cell(GetPositionX(), GetPositionY()))) // 3. + else if (!_staticPassengers.empty() && !newActive && oldCell.DiffGrid(Cell(GetPositionX(), GetPositionY()))) // 3. UnloadStaticPassengers(); else UpdatePassengerPositions(_staticPassengers); diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 2905b0454c4..207f80eabe7 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -3822,8 +3822,8 @@ void ObjectMgr::LoadQuests() "RequiredItemId1, RequiredItemId2, RequiredItemId3, RequiredItemId4, RequiredItemId5, RequiredItemId6, RequiredItemCount1, RequiredItemCount2, RequiredItemCount3, RequiredItemCount4, RequiredItemCount5, RequiredItemCount6, " // 117 118 119 120 121 122 123 124 125 126 127 128 129 "Unknown0, ObjectiveText1, ObjectiveText2, ObjectiveText3, ObjectiveText4, DetailsEmote1, DetailsEmote2, DetailsEmote3, DetailsEmote4, DetailsEmoteDelay1, DetailsEmoteDelay2, DetailsEmoteDelay3, DetailsEmoteDelay4, " - // 130 131 132 133 134 135 136 137 138 139 140 - "EmoteOnIncomplete, EmoteOnComplete, OfferRewardEmote1, OfferRewardEmote2, OfferRewardEmote3, OfferRewardEmote4, OfferRewardEmoteDelay1, OfferRewardEmoteDelay2, OfferRewardEmoteDelay3, OfferRewardEmoteDelay4, WDBVerified" + // 130 131 132 133 134 135 136 137 138 139 + "EmoteOnIncomplete, EmoteOnComplete, OfferRewardEmote1, OfferRewardEmote2, OfferRewardEmote3, OfferRewardEmote4, OfferRewardEmoteDelay1, OfferRewardEmoteDelay2, OfferRewardEmoteDelay3, OfferRewardEmoteDelay4" " FROM quest_template"); if (!result) { diff --git a/src/server/game/Globals/ObjectMgr.h b/src/server/game/Globals/ObjectMgr.h index 48c9e618a1d..ba5940d7e12 100644 --- a/src/server/game/Globals/ObjectMgr.h +++ b/src/server/game/Globals/ObjectMgr.h @@ -432,7 +432,7 @@ struct BroadcastText uint32 SoundId; uint32 Unk1; uint32 Unk2; - // uint32 WDBVerified; + // uint32 VerifiedBuild; std::string const& GetText(LocaleConstant locale = DEFAULT_LOCALE, uint8 gender = GENDER_MALE, bool forceGender = false) const { diff --git a/src/server/game/Handlers/TradeHandler.cpp b/src/server/game/Handlers/TradeHandler.cpp index 4372de9eafe..1fe4718d7ae 100644 --- a/src/server/game/Handlers/TradeHandler.cpp +++ b/src/server/game/Handlers/TradeHandler.cpp @@ -686,7 +686,6 @@ void WorldSession::HandleSetTradeGoldOpcode(WorldPacket& recvPacket) if (!my_trade) return; - // gold can be incorrect, but this is checked at trade finished. my_trade->SetMoney(gold); } diff --git a/src/server/game/Maps/Map.cpp b/src/server/game/Maps/Map.cpp index cd391299785..ba271235330 100644 --- a/src/server/game/Maps/Map.cpp +++ b/src/server/game/Maps/Map.cpp @@ -1544,11 +1544,8 @@ void Map::UnloadAll() Transport* transport = *itr; ++itr; - transport->RemoveFromWorld(); - delete transport; + RemoveFromMap<Transport>(transport, true); } - - _transports.clear(); } // ***************************** @@ -2648,24 +2645,27 @@ void Map::RemoveAllObjectsInRemoveList() RemoveFromMap(corpse, true); break; } - case TYPEID_DYNAMICOBJECT: - RemoveFromMap((DynamicObject*)obj, true); - break; - case TYPEID_GAMEOBJECT: - if (Transport* transport = obj->ToGameObject()->ToTransport()) - RemoveFromMap(transport, true); - else - RemoveFromMap(obj->ToGameObject(), true); - break; - case TYPEID_UNIT: - // in case triggered sequence some spell can continue casting after prev CleanupsBeforeDelete call - // make sure that like sources auras/etc removed before destructor start - obj->ToCreature()->CleanupsBeforeDelete(); - RemoveFromMap(obj->ToCreature(), true); - break; - default: - TC_LOG_ERROR("maps", "Non-grid object (TypeId: %u) is in grid object remove list, ignored.", obj->GetTypeId()); - break; + case TYPEID_DYNAMICOBJECT: + RemoveFromMap(obj->ToDynObject(), true); + break; + case TYPEID_GAMEOBJECT: + { + GameObject* go = obj->ToGameObject(); + if (Transport* transport = go->ToTransport()) + RemoveFromMap(transport, true); + else + RemoveFromMap(go, true); + break; + } + case TYPEID_UNIT: + // in case triggered sequence some spell can continue casting after prev CleanupsBeforeDelete call + // make sure that like sources auras/etc removed before destructor start + obj->ToCreature()->CleanupsBeforeDelete(); + RemoveFromMap(obj->ToCreature(), true); + break; + default: + TC_LOG_ERROR("maps", "Non-grid object (TypeId: %u) is in grid object remove list, ignored.", obj->GetTypeId()); + break; } i_objectsToRemove.erase(itr); diff --git a/src/server/game/Quests/QuestDef.cpp b/src/server/game/Quests/QuestDef.cpp index 9b3732d232b..099275ba8dc 100644 --- a/src/server/game/Quests/QuestDef.cpp +++ b/src/server/game/Quests/QuestDef.cpp @@ -137,7 +137,7 @@ Quest::Quest(Field* questRecord) for (int i = 0; i < QUEST_EMOTE_COUNT; ++i) OfferRewardEmoteDelay[i] = questRecord[136+i].GetInt32(); - //int32 WDBVerified = questRecord[140].GetInt32(); + //int32 VerifiedBuild = questRecord[140].GetInt32(); if (SpecialFlags & QUEST_SPECIAL_FLAGS_AUTO_ACCEPT) Flags |= QUEST_FLAGS_AUTO_ACCEPT; diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp index 8e7edfc5355..3e1763e6c5b 100644 --- a/src/server/game/Spells/Auras/SpellAuras.cpp +++ b/src/server/game/Spells/Auras/SpellAuras.cpp @@ -1343,17 +1343,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b if (target->HasAura(61988) && !target->HasAura(25771)) target->RemoveAura(61988); break; - case 72368: // Shared Suffering - case 72369: - if (caster) - { - if (AuraEffect* aurEff = GetEffect(0)) - { - int32 remainingDamage = aurEff->GetAmount() * (aurEff->GetTotalTicks() - aurEff->GetTickNumber()); - if (remainingDamage > 0) - caster->CastCustomSpell(caster, 72373, NULL, &remainingDamage, NULL, true); - } - } + default: break; } break; diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index ba5b8856323..501cb1e77f2 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -3375,6 +3375,18 @@ void SpellMgr::LoadSpellInfoCorrections() break; // ENDOF TRIAL OF THE CRUSADER SPELLS // + // HALLS OF REFLECTION SPELLS + // + case 72435: // Defiling Horror + case 72452: // Defiling Horror + spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_60_YARDS); // 60yd + spellInfo->Effects[EFFECT_1].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_60_YARDS); // 60yd + break; + case 72900: // Start Halls of Reflection Quest AE + spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_200_YARDS); // 200yd + break; + // ENDOF HALLS OF REFLECTION SPELLS + // // ICECROWN CITADEL SPELLS // // THESE SPELLS ARE WORKING CORRECTLY EVEN WITHOUT THIS HACK |
