Skip to content
This repository has been archived by the owner on Mar 30, 2019. It is now read-only.

Commit

Permalink
big merge
Browse files Browse the repository at this point in the history
  • Loading branch information
philipp.dallig committed Aug 27, 2011
1 parent 22b936a commit 2eddc91
Show file tree
Hide file tree
Showing 177 changed files with 9,016 additions and 4,537 deletions.
20 changes: 10 additions & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,22 +54,22 @@ if(PCH)
)
endif()

add_library(mangosscript SHARED
add_library(mangosscriptR2 SHARED
${mangosscript_SRCS}
)

if(WIN32)
target_link_libraries(mangosscript
target_link_libraries(mangosscriptR2
mangosd # FIXME: could this be done for unix? because unix won't generate exe.libs
${ACE_LIBRARIES}
debug ${WIN_DEBUGLIBS}
)
endif()

add_dependencies(mangosscript revision.h)
add_dependencies(mangosscriptR2 revision.h)
if(NOT ACE_USE_EXTERNAL)
add_dependencies(mangosscript ACE_Project)
# add_dependencies(mangosscript ace)
add_dependencies(mangosscriptR2 ACE_Project)
# add_dependencies(mangosscriptR2 ace)
endif()

if(UNIX)
Expand All @@ -92,15 +92,15 @@ if(UNIX)
BUILD_WITH_INSTALL_RPATH OFF
)

set_target_properties(mangosscript PROPERTIES
set_target_properties(mangosscriptR2 PROPERTIES
LINK_FLAGS ${mangosscript_LINK_FLAGS}
${mangosscript_PROPERTIES}
)
endif()

# Because size for linker is to big - seriously ?!
if(WIN32)
set_target_properties(mangosscript PROPERTIES
set_target_properties(mangosscriptR2 PROPERTIES
LINK_FLAGS_DEBUG "/DEBUG /INCREMENTAL:NO"
)
endif()
Expand Down Expand Up @@ -128,14 +128,14 @@ if(PCH)
if(MSVC)
set(mangosscript_pch "${CMAKE_CURRENT_SOURCE_DIR}/include/precompiled.cpp")
endif()
add_native_precompiled_header(mangosscript ${CMAKE_CURRENT_SOURCE_DIR}/include/precompiled.h)
add_native_precompiled_header(mangosscriptR2 ${CMAKE_CURRENT_SOURCE_DIR}/include/precompiled.h)
elseif(CMAKE_COMPILER_IS_GNUCXX)
add_precompiled_header(mangosscript ${CMAKE_CURRENT_SOURCE_DIR}/include/precompiled.h)
add_precompiled_header(mangosscriptR2 ${CMAKE_CURRENT_SOURCE_DIR}/include/precompiled.h)
endif()
endif()

# LIBRARY = dyld / so, RUNTIME = dll
install(TARGETS mangosscript
install(TARGETS mangosscriptR2
LIBRARY DESTINATION ${LIBS_DIR}
RUNTIME DESTINATION ${LIBS_DIR}
)
Expand Down
3 changes: 2 additions & 1 deletion ScriptMgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,8 @@ void InitScriptLibrary()
outstring_log(" MM M M MMMM");
outstring_log("MM M M M ");
outstring_log(" MMM MMM http://www.scriptdev2.com");
outstring_log("");
outstring_log("R2 modifications included (https://github.com/mangosR2/scriptdev2)");
outstring_log(_VERSION);

// Get configuration file
if (!SD2Config.SetSource(_SCRIPTDEV2_CONFIG))
Expand Down
17 changes: 9 additions & 8 deletions VC100/100ScriptDev2.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,10 @@
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">mangosscript</TargetName>
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">mangosscript</TargetName>
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">mangosscript</TargetName>
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">mangosscript</TargetName>
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">mangosscriptR2</TargetName>
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">mangosscriptR2</TargetName>
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">mangosscriptR2</TargetName>
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">mangosscriptR2</TargetName>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
Expand All @@ -116,7 +116,7 @@
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<DataExecutionPrevention>
</DataExecutionPrevention>
<ImportLibrary>$(OutDir)mangosscript.lib</ImportLibrary>
<ImportLibrary>$(OutDir)mangosscriptR2.lib</ImportLibrary>
<TargetMachine>MachineX86</TargetMachine>
</Link>
</ItemDefinitionGroup>
Expand Down Expand Up @@ -147,7 +147,7 @@
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<DataExecutionPrevention>
</DataExecutionPrevention>
<ImportLibrary>$(OutDir)mangosscript.lib</ImportLibrary>
<ImportLibrary>$(OutDir)mangosscriptR2.lib</ImportLibrary>
<TargetMachine>MachineX64</TargetMachine>
</Link>
</ItemDefinitionGroup>
Expand Down Expand Up @@ -176,7 +176,7 @@
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<DataExecutionPrevention>
</DataExecutionPrevention>
<ImportLibrary>$(OutDir)mangosscript.lib</ImportLibrary>
<ImportLibrary>$(OutDir)mangosscriptR2.lib</ImportLibrary>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
Expand Down Expand Up @@ -206,7 +206,7 @@
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<DataExecutionPrevention>
</DataExecutionPrevention>
<ImportLibrary>$(OutDir)mangosscript.lib</ImportLibrary>
<ImportLibrary>$(OutDir)mangosscriptR2.lib</ImportLibrary>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
Expand All @@ -221,6 +221,7 @@
<ClCompile Include="..\include\sc_instance.cpp" />
<ClCompile Include="..\include\sc_outdoor_pvp.cpp" />
<ClCompile Include="..\scripts\battlegrounds\battleground.cpp" />
<ClCompile Include="..\scripts\battlegrounds\battlegroundSA.cpp" />
<ClCompile Include="..\scripts\custom\custom_cybernetic.cpp" />
<ClCompile Include="..\scripts\custom\npc_arena_honor.cpp" />
<ClCompile Include="..\scripts\custom\teleguy.cpp" />
Expand Down
24 changes: 14 additions & 10 deletions VC90/90ScriptDev2.vcproj
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,15 @@
<Tool
Name="VCLinkerTool"
AdditionalDependencies="mangosd.lib ACEd.lib"
OutputFile="$(OutDir)/mangosscript.dll"
OutputFile="$(OutDir)/mangosscriptR2.dll"
LinkIncremental="2"
AdditionalLibraryDirectories="..\..\..\..\win\VC90\mangosd__Win32_Debug;..\..\..\..\dep\lib\win32_debug\"
GenerateDebugInformation="true"
ProgramDatabaseFile="$(OutDir)/mangosscript.pdb"
ProgramDatabaseFile="$(OutDir)/mangosscriptR2.pdb"
SubSystem="2"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
ImportLibrary="$(OutDir)/mangosscript.lib"
ImportLibrary="$(OutDir)/mangosscriptR2.lib"
TargetMachine="1"
/>
<Tool
Expand Down Expand Up @@ -150,7 +150,7 @@
<Tool
Name="VCLinkerTool"
AdditionalDependencies="mangosd.lib ACE.lib"
OutputFile="$(OutDir)/mangosscript.dll"
OutputFile="$(OutDir)/mangosscriptR2.dll"
LinkIncremental="1"
AdditionalLibraryDirectories="..\..\..\..\win\VC90\mangosd__Win32_Release;..\..\..\..\dep\lib\win32_release\"
GenerateDebugInformation="false"
Expand All @@ -159,7 +159,7 @@
EnableCOMDATFolding="2"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
ImportLibrary="$(OutDir)/mangosscript.lib"
ImportLibrary="$(OutDir)/mangosscriptR2.lib"
TargetMachine="1"
/>
<Tool
Expand Down Expand Up @@ -234,15 +234,15 @@
<Tool
Name="VCLinkerTool"
AdditionalDependencies="mangosd.lib ACEd.lib"
OutputFile="$(OutDir)/mangosscript.dll"
OutputFile="$(OutDir)/mangosscriptR2.dll"
LinkIncremental="2"
AdditionalLibraryDirectories="..\..\..\..\win\VC90\mangosd__x64_Debug;..\..\..\..\dep\lib\x64_Debug\"
GenerateDebugInformation="true"
ProgramDatabaseFile="$(OutDir)/mangosscript.pdb"
ProgramDatabaseFile="$(OutDir)/mangosscriptR2.pdb"
SubSystem="2"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
ImportLibrary="$(OutDir)/mangosscript.lib"
ImportLibrary="$(OutDir)/mangosscriptR2.lib"
TargetMachine="17"
/>
<Tool
Expand Down Expand Up @@ -316,7 +316,7 @@
<Tool
Name="VCLinkerTool"
AdditionalDependencies="mangosd.lib ACE.lib"
OutputFile="$(OutDir)/mangosscript.dll"
OutputFile="$(OutDir)/mangosscriptR2.dll"
LinkIncremental="1"
AdditionalLibraryDirectories="..\..\..\..\win\VC90\mangosd__x64_Release;..\..\..\..\dep\lib\x64_release\"
GenerateDebugInformation="false"
Expand All @@ -325,7 +325,7 @@
EnableCOMDATFolding="2"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
ImportLibrary="$(OutDir)/mangosscript.lib"
ImportLibrary="$(OutDir)/mangosscriptR2.lib"
TargetMachine="17"
/>
<Tool
Expand Down Expand Up @@ -416,6 +416,10 @@
RelativePath="..\scripts\battlegrounds\battleground.cpp"
>
</File>
<File
RelativePath="..\scripts\battlegrounds\battlegroundSA.cpp"
>
</File>
</Filter>
<Filter
Name="custom"
Expand Down
16 changes: 8 additions & 8 deletions base/BSW_ai.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (C) 2009 - 2010 by /dev/rsa for ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
/* Copyright (C) 2009 - 2011 by /dev/rsa for ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software licensed under GPL version 2
* Please see the included DOCS/LICENSE.TXT for more information */
#include "precompiled.h"
Expand Down Expand Up @@ -153,7 +153,7 @@ CanCastResult BSWScriptedAI::_BSWSpellSelector(uint8 m_uiSpellIdx, Unit* pTarget

switch (pSpell->m_CastTarget) {

case DO_NOTHING:
case DO_NOTHING:
result = CAST_OK;
break;

Expand Down Expand Up @@ -191,7 +191,7 @@ CanCastResult BSWScriptedAI::_BSWSpellSelector(uint8 m_uiSpellIdx, Unit* pTarget
break;

case APPLY_AURA_TARGET:
if (!pTarget || !pTarget->IsInMap(m_creature))
if (!pTarget || !pTarget->IsInMap(m_creature))
{
result = CAST_FAIL_OTHER;
break;
Expand Down Expand Up @@ -231,7 +231,7 @@ CanCastResult BSWScriptedAI::_BSWSpellSelector(uint8 m_uiSpellIdx, Unit* pTarget
pTarget = itr->getSource();
if (pTarget && pTarget->isAlive() && pTarget->IsWithinDistInMap(m_creature, pSpell->LocData.x))
{
if (!pSpell->m_IsBugged)
if (!pSpell->m_IsBugged)
{
m_creature->CastSpell(pTarget, pSpell->m_uiSpellEntry[currentDifficulty], false);
}
Expand All @@ -258,7 +258,7 @@ CanCastResult BSWScriptedAI::_BSWSpellSelector(uint8 m_uiSpellIdx, Unit* pTarget

case CAST_ON_RANDOM_POINT:
if (!pTarget) pTarget = m_creature;
if (pSpell->LocData.z <= 1.0f)
if (pSpell->LocData.z <= 1.0f)
{
float fPosX, fPosY, fPosZ;
if (!pTarget->IsPositionValid() || !pTarget->IsInMap(m_creature))
Expand Down Expand Up @@ -510,7 +510,7 @@ Unit* BSWScriptedAI::_doSummon(uint8 m_uiSpellIdx, TempSummonType summontype, ui

debug_log("BSW: Summoning creature number %u type %u despawn delay %u",pSpell->m_uiSpellEntry[currentDifficulty], pSpell->m_CastTarget, delay);

if (pSpell->LocData.z <= 1.0f)
if (pSpell->LocData.z <= 1.0f)
{
float fPosX, fPosY, fPosZ;
if (!m_creature->IsPositionValid())
Expand All @@ -529,7 +529,7 @@ Unit* BSWScriptedAI::_doSummonAtPosition(uint8 m_uiSpellIdx, float fPosX, float
{
BSWRecord* pSpell = &m_BSWRecords[m_uiSpellIdx];

switch (pSpell->m_CastTarget)
switch (pSpell->m_CastTarget)
{
case SUMMON_NORMAL:
return _doSummonAtPosition(pSpell->m_uiSpellEntry[currentDifficulty], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 0, fPosX, fPosY, fPosZ);
Expand Down Expand Up @@ -749,7 +749,7 @@ bool BSWScriptedAI::_doAura(uint32 SpellID, Unit* pTarget, SpellEffectIndex inde
if (isStack)
holder->ModStackAmount(1);
}
else
else
{
aura = CreateAura(spell, index, &_basepoint, holder, pTarget);
holder->SetAuraDuration(aura->GetAuraMaxDuration());
Expand Down
2 changes: 1 addition & 1 deletion base/BSW_ai.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (C) 2009 - 2010 by /dev/rsa for ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
/* Copyright (C) 2009 - 2011 by /dev/rsa for ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software licensed under GPL version 2
* Please see the included DOCS/LICENSE.TXT for more information */

Expand Down
2 changes: 1 addition & 1 deletion base/BSW_instance.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (C) 2009 - 2010 by /dev/rsa for ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
/* Copyright (C) 2009 - 2011 by /dev/rsa for ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software licensed under GPL version 2
* Please see the included DOCS/LICENSE.TXT for more information */

Expand Down
2 changes: 1 addition & 1 deletion base/BSW_instance.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (C) 2009 - 2010 by /dev/rsa for ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
/* Copyright (C) 2009 - 2011 by /dev/rsa for ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software licensed under GPL version 2
* Please see the included DOCS/LICENSE.TXT for more information */

Expand Down
39 changes: 19 additions & 20 deletions base/escort_ai.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -363,11 +363,7 @@ void npc_escortAI::MovementInform(uint32 uiMoveType, uint32 uiPointId)
{
debug_log("SD2: EscortAI has returned to original position before combat");

if (m_bIsRunning && m_creature->HasSplineFlag(SPLINEFLAG_WALKMODE))
m_creature->RemoveSplineFlag(SPLINEFLAG_WALKMODE);
else if (!m_bIsRunning && !m_creature->HasSplineFlag(SPLINEFLAG_WALKMODE))
m_creature->AddSplineFlag(SPLINEFLAG_WALKMODE);

m_creature->SetWalk(!m_bIsRunning);
RemoveEscortState(STATE_ESCORT_RETURNING);

if (!m_uiWPWaitTimer)
Expand Down Expand Up @@ -425,23 +421,27 @@ void npc_escortAI::FillPointMovementListForCreature()

void npc_escortAI::SetCurrentWaypoint(uint32 uiPointId)
{
if (!(HasEscortState(STATE_ESCORT_PAUSED))) // only when paused
return;

if (uiPointId >= WaypointList.size()) // too high number
if (!(HasEscortState(STATE_ESCORT_PAUSED))) // Only when paused
return;

if (uiPointId == CurrentWP->uiId) // already here
if (uiPointId == CurrentWP->uiId) // Already here
return;

CurrentWP = WaypointList.begin(); // set to begin (can't -- backwards in itr list)

while(uiPointId != CurrentWP->uiId)
bool bFoundWaypoint = false;
for (std::list<Escort_Waypoint>::iterator itr = WaypointList.begin(); itr != WaypointList.end(); ++itr)
{
++CurrentWP;

if (CurrentWP == WaypointList.end())
if (itr->uiId == uiPointId)
{
CurrentWP = itr; // Set to found itr
bFoundWaypoint = true;
break;
}
}

if (!bFoundWaypoint)
{
debug_log("SD2: EscortAI current waypoint tried to set to id %u, but doesn't exist in WaypointList", uiPointId);
return;
}

m_uiWPWaitTimer = 1;
Expand All @@ -454,14 +454,14 @@ void npc_escortAI::SetRun(bool bRun)
if (bRun)
{
if (!m_bIsRunning)
m_creature->RemoveSplineFlag(SPLINEFLAG_WALKMODE);
m_creature->SetWalk(false);
else
debug_log("SD2: EscortAI attempt to set run mode, but is already running.");
}
else
{
if (m_bIsRunning)
m_creature->AddSplineFlag(SPLINEFLAG_WALKMODE);
m_creature->SetWalk(true);
else
debug_log("SD2: EscortAI attempt to set walk mode, but is already walking.");
}
Expand Down Expand Up @@ -521,8 +521,7 @@ void npc_escortAI::Start(bool bRun, const Player* pPlayer, const Quest* pQuest,
CurrentWP = WaypointList.begin();

//Set initial speed
if (m_bIsRunning)
m_creature->RemoveSplineFlag(SPLINEFLAG_WALKMODE);
m_creature->SetWalk(!m_bIsRunning);

AddEscortState(STATE_ESCORT_ESCORTING);

Expand Down
2 changes: 1 addition & 1 deletion base/follower_ai.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ void FollowerAI::StartFollow(Player* pLeader, uint32 uiFactionForFollower, const

m_creature->GetMotionMaster()->MoveFollow(pLeader, PET_FOLLOW_DIST, PET_FOLLOW_ANGLE);

debug_log("SD2: FollowerAI start follow %s (Guid %s)", pLeader->GetName(), m_leaderGuid.GetString().c_str());
debug_log("SD2: FollowerAI start follow %s (%u)", pLeader ? pLeader->GetName() : "", m_leaderGuid.GetCounter());
}

Player* FollowerAI::GetLeaderForFollower()
Expand Down
Loading

0 comments on commit 2eddc91

Please sign in to comment.