diff --git a/COPYING b/COPYING index d60c31a97a..bee9f8d231 100644 --- a/COPYING +++ b/COPYING @@ -1,12 +1,12 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. - Preamble + Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public @@ -56,7 +56,7 @@ patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. - GNU GENERAL PUBLIC LICENSE + GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains @@ -255,7 +255,7 @@ make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. - NO WARRANTY + NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN @@ -277,9 +277,9 @@ YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - END OF TERMS AND CONDITIONS + END OF TERMS AND CONDITIONS - How to Apply These Terms to Your New Programs + How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it diff --git a/dep/include/g3dlite/G3D/Vector3.inl b/dep/include/g3dlite/G3D/Vector3.inl index 99110ffc8e..e2f328165b 100644 --- a/dep/include/g3dlite/G3D/Vector3.inl +++ b/dep/include/g3dlite/G3D/Vector3.inl @@ -13,11 +13,11 @@ //---------------------------------------------------------------------------- #ifdef SSE - // If you receive an error on this line, it is because you do not have the file - // xmmintrin.h needed for MMX & SSE extensions. Download and install + // If you receive an error on this line, it is because you do not have the file + // xmmintrin.h needed for MMX & SSE extensions. Download and install // // http://download.microsoft.com/download/vstudio60ent/SP5/Wideband-Full/WIN98Me/EN-US/vs6sp5.exe - // and + // and // http://download.microsoft.com/download/vb60ent/Update/6/W9X2KXP/EN-US/vcpp5.exe // // to get this file. diff --git a/dep/include/g3dlite/G3D/g3dmath.inl b/dep/include/g3dlite/G3D/g3dmath.inl index 1068ed5bf8..ad685bc5ce 100644 --- a/dep/include/g3dlite/G3D/g3dmath.inl +++ b/dep/include/g3dlite/G3D/g3dmath.inl @@ -42,46 +42,46 @@ inline int iCeil (double fValue) { inline int iClamp(int val, int low, int hi) { debugAssert(low <= hi); - if (val <= low) { - return low; - } else if (val >= hi) { - return hi; - } else { - return val; - } + if (val <= low) { + return low; + } else if (val >= hi) { + return hi; + } else { + return val; + } } //---------------------------------------------------------------------------- inline double clamp(double val, double low, double hi) { debugAssert(low <= hi); - if (val <= low) { - return low; - } else if (val >= hi) { - return hi; - } else { - return val; - } + if (val <= low) { + return low; + } else if (val >= hi) { + return hi; + } else { + return val; + } } inline float clamp(float val, float low, float hi) { debugAssert(low <= hi); - if (val <= low) { - return low; - } else if (val >= hi) { - return hi; - } else { - return val; - } + if (val <= low) { + return low; + } else if (val >= hi) { + return hi; + } else { + return val; + } } //---------------------------------------------------------------------------- inline int iWrap(int val, int hi) { - if (val < 0) { - return ((val % hi) + hi) % hi; - } else { - return val % hi; - } + if (val < 0) { + return ((val % hi) + hi) % hi; + } else { + return val % hi; + } } //---------------------------------------------------------------------------- @@ -142,11 +142,11 @@ inline double aTan2 (double fY, double fX) { inline double sign (double fValue) { if (fValue > 0.0) { return 1.0; - } + } if (fValue < 0.0) { return -1.0; - } + } return 0.0; } diff --git a/dep/src/g3dlite/Box.cpp b/dep/src/g3dlite/Box.cpp index c30211fd5b..fd3067048c 100644 --- a/dep/src/g3dlite/Box.cpp +++ b/dep/src/g3dlite/Box.cpp @@ -131,21 +131,21 @@ void Box::getFaceCorners(int f, Vector3& v0, Vector3& v1, Vector3& v2, Vector3& bool Box::culledBy( - const Array& plane, - int& cullingPlaneIndex, - const uint32 inMask, - uint32& outMask) const { + const Array& plane, + int& cullingPlaneIndex, + const uint32 inMask, + uint32& outMask) const { - return culledBy(plane.getCArray(), plane.size(), cullingPlaneIndex, inMask, outMask); + return culledBy(plane.getCArray(), plane.size(), cullingPlaneIndex, inMask, outMask); } bool Box::culledBy( - const Array& plane, - int& cullingPlaneIndex, - const uint32 inMask) const { + const Array& plane, + int& cullingPlaneIndex, + const uint32 inMask) const { - return culledBy(plane.getCArray(), plane.size(), cullingPlaneIndex, inMask); + return culledBy(plane.getCArray(), plane.size(), cullingPlaneIndex, inMask); } @@ -154,23 +154,23 @@ int32 Box::dummy = 0; bool Box::culledBy( const class Plane* plane, int numPlanes, - int& cullingPlane, - const uint32 _inMask, + int& cullingPlane, + const uint32 _inMask, uint32& childMask) const { - uint32 inMask = _inMask; - assert(numPlanes < 31); + uint32 inMask = _inMask; + assert(numPlanes < 31); childMask = 0; // See if there is one plane for which all of the - // vertices are in the negative half space. + // vertices are in the negative half space. for (int p = 0; p < numPlanes; p++) { - // Only test planes that are not masked - if ((inMask & 1) != 0) { - - Vector3 corner; + // Only test planes that are not masked + if ((inMask & 1) != 0) { + + Vector3 corner; int numContained = 0; int v = 0; @@ -178,36 +178,36 @@ bool Box::culledBy( // We can early-out only if we have found one point on each // side of the plane (i.e. if we are straddling). That // occurs when (numContained < v) && (numContained > 0) - for (v = 0; (v < 8) && ((numContained == v) || (numContained == 0)); ++v) { + for (v = 0; (v < 8) && ((numContained == v) || (numContained == 0)); ++v) { if (plane[p].halfSpaceContains(getCorner(v))) { ++numContained; } - } + } - if (numContained == 0) { - // Plane p culled the box - cullingPlane = p; + if (numContained == 0) { + // Plane p culled the box + cullingPlane = p; // The caller should not recurse into the children, // since the parent is culled. If they do recurse, // make them only test against this one plane, which // will immediately cull the volume. childMask = 1 << p; - return true; + return true; } else if (numContained < v) { // The bounding volume straddled the plane; we have // to keep testing against this plane childMask |= (1 << p); } - } + } // Move on to the next bit. - inMask = inMask >> 1; + inMask = inMask >> 1; } // None of the planes could cull this box - cullingPlane = -1; + cullingPlane = -1; return false; } @@ -215,44 +215,44 @@ bool Box::culledBy( bool Box::culledBy( const class Plane* plane, int numPlanes, - int& cullingPlane, - const uint32 _inMask) const { + int& cullingPlane, + const uint32 _inMask) const { - uint32 inMask = _inMask; - assert(numPlanes < 31); + uint32 inMask = _inMask; + assert(numPlanes < 31); // See if there is one plane for which all of the - // vertices are in the negative half space. + // vertices are in the negative half space. for (int p = 0; p < numPlanes; p++) { - // Only test planes that are not masked - if ((inMask & 1) != 0) { - - bool culled = true; + // Only test planes that are not masked + if ((inMask & 1) != 0) { + + bool culled = true; int v; - // Assume this plane culls all points. See if there is a point - // not culled by the plane... early out when at least one point + // Assume this plane culls all points. See if there is a point + // not culled by the plane... early out when at least one point // is in the positive half space. - for (v = 0; (v < 8) && culled; ++v) { + for (v = 0; (v < 8) && culled; ++v) { culled = ! plane[p].halfSpaceContains(getCorner(v)); - } - - if (culled) { - // Plane p culled the box - cullingPlane = p; - - return true; } - } + + if (culled) { + // Plane p culled the box + cullingPlane = p; + + return true; + } + } // Move on to the next bit. - inMask = inMask >> 1; + inMask = inMask >> 1; } // None of the planes could cull this box - cullingPlane = -1; + cullingPlane = -1; return false; } diff --git a/src/bindings/scripts/ScriptMgr.cpp b/src/bindings/scripts/ScriptMgr.cpp index 2ae7072dee..10b23ba1b4 100644 --- a/src/bindings/scripts/ScriptMgr.cpp +++ b/src/bindings/scripts/ScriptMgr.cpp @@ -1690,7 +1690,7 @@ TRINITY_DLL_EXPORT bool GOSelect( Player *player, GameObject *_GO, uint32 sender, uint32 action ) { if(!_GO) - return false; + return false; debug_log("TSCR: Gossip selection, sender: %d, action: %d",sender, action); Script *tmpscript = m_scripts[_GO->GetGOInfo()->ScriptId]; @@ -1704,7 +1704,7 @@ TRINITY_DLL_EXPORT bool GOSelectWithCode( Player *player, GameObject *_GO, uint32 sender, uint32 action, const char* sCode ) { if(!_GO) - return false; + return false; debug_log("TSCR: Gossip selection, sender: %d, action: %d",sender, action); Script *tmpscript = m_scripts[_GO->GetGOInfo()->ScriptId]; diff --git a/src/bindings/scripts/scripts/go/go_scripts.cpp b/src/bindings/scripts/scripts/go/go_scripts.cpp index 969c7ea69e..eea2e40a1a 100644 --- a/src/bindings/scripts/scripts/go/go_scripts.cpp +++ b/src/bindings/scripts/scripts/go/go_scripts.cpp @@ -190,7 +190,7 @@ bool GOHello_go_tablet_of_the_seven(Player *player, GameObject* _GO) bool GOHello_go_jump_a_tron(Player *player, GameObject* _GO) { if (player->GetQuestStatus(10111) == QUEST_STATUS_INCOMPLETE) - player->CastSpell(player,33382,true); + player->CastSpell(player,33382,true); return true; } diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/def_old_hillsbrad.h b/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/def_old_hillsbrad.h index 39db5bed06..3253a38421 100644 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/def_old_hillsbrad.h +++ b/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/def_old_hillsbrad.h @@ -13,7 +13,7 @@ #define TYPE_THRALL_PART4 6 #define DATA_THRALL 7 #define DATA_TARETHA 8 -#define DATA_EPOCH 9 +#define DATA_EPOCH 9 #define WORLD_STATE_OH 2436 #endif diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/instance_old_hillsbrad.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/instance_old_hillsbrad.cpp index 8b0a62c445..d03d53cd39 100644 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/instance_old_hillsbrad.cpp +++ b/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/instance_old_hillsbrad.cpp @@ -28,7 +28,7 @@ EndScriptData */ #define THRALL_ENTRY 17876 #define TARETHA_ENTRY 18887 -#define EPOCH_ENTRY 18096 +#define EPOCH_ENTRY 18096 #define DRAKE_ENTRY 17848 @@ -53,7 +53,7 @@ struct TRINITY_DLL_DECL instance_old_hillsbrad : public ScriptedInstance mThrallEventCount = 0; ThrallGUID = 0; TarethaGUID = 0; - EpochGUID = 0; + EpochGUID = 0; for(uint8 i = 0; i < ENCOUNTERS; i++) Encounter[i] = NOT_STARTED; @@ -106,9 +106,9 @@ struct TRINITY_DLL_DECL instance_old_hillsbrad : public ScriptedInstance case TARETHA_ENTRY: TarethaGUID = creature->GetGUID(); break; - case EPOCH_ENTRY: - EpochGUID = creature->GetGUID(); - break; + case EPOCH_ENTRY: + EpochGUID = creature->GetGUID(); + break; } } @@ -222,8 +222,8 @@ struct TRINITY_DLL_DECL instance_old_hillsbrad : public ScriptedInstance return ThrallGUID; case DATA_TARETHA: return TarethaGUID; - case DATA_EPOCH: - return EpochGUID; + case DATA_EPOCH: + return EpochGUID; } return 0; } diff --git a/src/game/Chat.cpp b/src/game/Chat.cpp index 9a01742abc..5587293739 100644 --- a/src/game/Chat.cpp +++ b/src/game/Chat.cpp @@ -1021,9 +1021,6 @@ int ChatHandler::ParseCommands(const char* text) std::string fullcmd = text; - //if(m_session->GetSecurity() == 0) - // return 0; - /// chat case (.command or !command format) if(m_session) { diff --git a/src/game/MiscHandler.cpp b/src/game/MiscHandler.cpp index 57d6394887..0672c38ee2 100644 --- a/src/game/MiscHandler.cpp +++ b/src/game/MiscHandler.cpp @@ -115,6 +115,7 @@ void WorldSession::HandleGossipSelectOptionOpcode( WorldPacket & recv_data ) else { sLog.outDebug( "WORLD: HandleGossipSelectOptionOpcode - unsupported GUID type for highguid %u. lowpart %u.", uint32(GUID_HIPART(guid)), uint32(GUID_LOPART(guid)) ); + return; } // remove fake death diff --git a/src/game/Object.cpp b/src/game/Object.cpp index 015bb6d347..3ec11e83f8 100644 --- a/src/game/Object.cpp +++ b/src/game/Object.cpp @@ -1145,6 +1145,7 @@ WorldObject::WorldObject() m_mapId = 0; m_InstanceId = 0; + m_map = NULL; m_name = ""; @@ -1674,12 +1675,14 @@ void WorldObject::SendObjectDeSpawnAnim(uint64 guid) Map* WorldObject::GetMap() const { - return MapManager::Instance().GetMap(GetMapId(), this); + if(m_map) return m_map; + else return const_cast(m_map) = MapManager::Instance().GetMap(GetMapId(), this); } Map* WorldObject::FindMap() const { - return MapManager::Instance().FindMap(GetMapId(), GetInstanceId()); + if(m_map) return m_map; + else return const_cast(m_map) = MapManager::Instance().FindMap(GetMapId(), GetInstanceId()); } Map const* WorldObject::GetBaseMap() const diff --git a/src/game/Object.h b/src/game/Object.h index 83c2afbb88..9bb99af50d 100644 --- a/src/game/Object.h +++ b/src/game/Object.h @@ -439,8 +439,10 @@ class TRINITY_DLL_SPEC WorldObject : public Object void GetRandomPoint( float x, float y, float z, float distance, float &rand_x, float &rand_y, float &rand_z ) const; - void SetMapId(uint32 newMap) { m_mapId = newMap; } + void SetMapId(uint32 newMap) { m_mapId = newMap; m_map = NULL; } uint32 GetMapId() const { return m_mapId; } + void SetInstanceId(uint32 val) { m_InstanceId = val; m_map = NULL; } + uint32 GetInstanceId() const { return m_InstanceId; } virtual void SetPhaseMask(uint32 newPhaseMask, bool update); uint32 GetPhaseMask() const { return m_phaseMask; } @@ -502,9 +504,6 @@ class TRINITY_DLL_SPEC WorldObject : public Object virtual void SaveRespawnTime() {} - uint32 GetInstanceId() const { return m_InstanceId; } - void SetInstanceId(uint32 val) { m_InstanceId = val; } - void AddObjectToRemoveList(); // main visibility check function in normal case (ignore grey zone distance check) @@ -540,6 +539,7 @@ class TRINITY_DLL_SPEC WorldObject : public Object uint32 m_mapId; // object at map with map_id uint32 m_InstanceId; // in map copy with instance id uint32 m_phaseMask; // in area phase state + Map *m_map; float m_positionX; float m_positionY; diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 930e58e17d..7fd6194d73 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -18246,7 +18246,7 @@ template void Player::UpdateVisibilityOf(T* target, UpdateData& data, std::set& visibleNow) { if(!target) - return; + return; if(HaveAtClient(target)) { if(!target->isVisibleForInState(this,true)) diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index 09ad6501c4..d8b50b10a9 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -4019,6 +4019,7 @@ void AuraEffect::HandleAuraModDecreaseSpeed(bool /*apply*/, bool Real) if(!Real) return; + //m_target->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH); m_target->UpdateSpeed(MOVE_RUN, true); m_target->UpdateSpeed(MOVE_SWIM, true); m_target->UpdateSpeed(MOVE_FLIGHT, true); @@ -5092,6 +5093,28 @@ void AuraEffect::HandleRangedAmmoHaste(bool apply, bool Real) void AuraEffect::HandleAuraModAttackPower(bool apply, bool Real) { m_target->HandleStatModifier(UNIT_MOD_ATTACK_POWER, TOTAL_VALUE, float(m_amount), apply); + if(apply) + switch(m_spellProto->Id){ + // Warrior & Druid Demoshout should remove stealth + case 1160: + case 6190: + case 11554: + case 11555: + case 11556: + case 25202: + case 25203: + case 47437: //WotLK spell + case 99: + case 1735: + case 9490: + case 9747: + case 9898: + case 26998: + case 48559: //WotLK spell + case 48560: //WotLK spell + m_target->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH); + break; + } } void AuraEffect::HandleAuraModRangedAttackPower(bool apply, bool Real) diff --git a/src/game/WaypointMovementGenerator.cpp b/src/game/WaypointMovementGenerator.cpp index 7c606697ac..4ca838ebc3 100644 --- a/src/game/WaypointMovementGenerator.cpp +++ b/src/game/WaypointMovementGenerator.cpp @@ -196,8 +196,9 @@ WaypointMovementGenerator::Update(Creature &unit, const uint32 &diff) if(node->delay) i_nextMoveTime.Reset(node->delay); + //note: disable "start" for mtmap if(node->event_id && rand()%100 < node->event_chance) - sWorld.ScriptsStart(sWaypointScripts, node->event_id, &unit, NULL); + sWorld.ScriptsStart(sWaypointScripts, node->event_id, &unit, NULL, false); MovementInform(unit); unit.UpdateWaypointID(i_currentNode);