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

Commit 2eddc91

Browse files
author
philipp.dallig
committed
big merge
1 parent 22b936a commit 2eddc91

File tree

177 files changed

+9016
-4537
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

177 files changed

+9016
-4537
lines changed

CMakeLists.txt

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -54,22 +54,22 @@ if(PCH)
5454
)
5555
endif()
5656

57-
add_library(mangosscript SHARED
57+
add_library(mangosscriptR2 SHARED
5858
${mangosscript_SRCS}
5959
)
6060

6161
if(WIN32)
62-
target_link_libraries(mangosscript
62+
target_link_libraries(mangosscriptR2
6363
mangosd # FIXME: could this be done for unix? because unix won't generate exe.libs
6464
${ACE_LIBRARIES}
6565
debug ${WIN_DEBUGLIBS}
6666
)
6767
endif()
6868

69-
add_dependencies(mangosscript revision.h)
69+
add_dependencies(mangosscriptR2 revision.h)
7070
if(NOT ACE_USE_EXTERNAL)
71-
add_dependencies(mangosscript ACE_Project)
72-
# add_dependencies(mangosscript ace)
71+
add_dependencies(mangosscriptR2 ACE_Project)
72+
# add_dependencies(mangosscriptR2 ace)
7373
endif()
7474

7575
if(UNIX)
@@ -92,15 +92,15 @@ if(UNIX)
9292
BUILD_WITH_INSTALL_RPATH OFF
9393
)
9494

95-
set_target_properties(mangosscript PROPERTIES
95+
set_target_properties(mangosscriptR2 PROPERTIES
9696
LINK_FLAGS ${mangosscript_LINK_FLAGS}
9797
${mangosscript_PROPERTIES}
9898
)
9999
endif()
100100

101101
# Because size for linker is to big - seriously ?!
102102
if(WIN32)
103-
set_target_properties(mangosscript PROPERTIES
103+
set_target_properties(mangosscriptR2 PROPERTIES
104104
LINK_FLAGS_DEBUG "/DEBUG /INCREMENTAL:NO"
105105
)
106106
endif()
@@ -128,14 +128,14 @@ if(PCH)
128128
if(MSVC)
129129
set(mangosscript_pch "${CMAKE_CURRENT_SOURCE_DIR}/include/precompiled.cpp")
130130
endif()
131-
add_native_precompiled_header(mangosscript ${CMAKE_CURRENT_SOURCE_DIR}/include/precompiled.h)
131+
add_native_precompiled_header(mangosscriptR2 ${CMAKE_CURRENT_SOURCE_DIR}/include/precompiled.h)
132132
elseif(CMAKE_COMPILER_IS_GNUCXX)
133-
add_precompiled_header(mangosscript ${CMAKE_CURRENT_SOURCE_DIR}/include/precompiled.h)
133+
add_precompiled_header(mangosscriptR2 ${CMAKE_CURRENT_SOURCE_DIR}/include/precompiled.h)
134134
endif()
135135
endif()
136136

137137
# LIBRARY = dyld / so, RUNTIME = dll
138-
install(TARGETS mangosscript
138+
install(TARGETS mangosscriptR2
139139
LIBRARY DESTINATION ${LIBS_DIR}
140140
RUNTIME DESTINATION ${LIBS_DIR}
141141
)

ScriptMgr.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,8 @@ void InitScriptLibrary()
113113
outstring_log(" MM M M MMMM");
114114
outstring_log("MM M M M ");
115115
outstring_log(" MMM MMM http://www.scriptdev2.com");
116-
outstring_log("");
116+
outstring_log("R2 modifications included (https://github.com/mangosR2/scriptdev2)");
117+
outstring_log(_VERSION);
117118

118119
// Get configuration file
119120
if (!SD2Config.SetSource(_SCRIPTDEV2_CONFIG))

VC100/100ScriptDev2.vcxproj

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,10 @@
8787
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
8888
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
8989
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
90-
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">mangosscript</TargetName>
91-
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">mangosscript</TargetName>
92-
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">mangosscript</TargetName>
93-
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">mangosscript</TargetName>
90+
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">mangosscriptR2</TargetName>
91+
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">mangosscriptR2</TargetName>
92+
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">mangosscriptR2</TargetName>
93+
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">mangosscriptR2</TargetName>
9494
</PropertyGroup>
9595
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
9696
<ClCompile>
@@ -116,7 +116,7 @@
116116
<RandomizedBaseAddress>false</RandomizedBaseAddress>
117117
<DataExecutionPrevention>
118118
</DataExecutionPrevention>
119-
<ImportLibrary>$(OutDir)mangosscript.lib</ImportLibrary>
119+
<ImportLibrary>$(OutDir)mangosscriptR2.lib</ImportLibrary>
120120
<TargetMachine>MachineX86</TargetMachine>
121121
</Link>
122122
</ItemDefinitionGroup>
@@ -147,7 +147,7 @@
147147
<RandomizedBaseAddress>false</RandomizedBaseAddress>
148148
<DataExecutionPrevention>
149149
</DataExecutionPrevention>
150-
<ImportLibrary>$(OutDir)mangosscript.lib</ImportLibrary>
150+
<ImportLibrary>$(OutDir)mangosscriptR2.lib</ImportLibrary>
151151
<TargetMachine>MachineX64</TargetMachine>
152152
</Link>
153153
</ItemDefinitionGroup>
@@ -176,7 +176,7 @@
176176
<RandomizedBaseAddress>false</RandomizedBaseAddress>
177177
<DataExecutionPrevention>
178178
</DataExecutionPrevention>
179-
<ImportLibrary>$(OutDir)mangosscript.lib</ImportLibrary>
179+
<ImportLibrary>$(OutDir)mangosscriptR2.lib</ImportLibrary>
180180
</Link>
181181
</ItemDefinitionGroup>
182182
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
@@ -206,7 +206,7 @@
206206
<RandomizedBaseAddress>false</RandomizedBaseAddress>
207207
<DataExecutionPrevention>
208208
</DataExecutionPrevention>
209-
<ImportLibrary>$(OutDir)mangosscript.lib</ImportLibrary>
209+
<ImportLibrary>$(OutDir)mangosscriptR2.lib</ImportLibrary>
210210
</Link>
211211
</ItemDefinitionGroup>
212212
<ItemGroup>
@@ -221,6 +221,7 @@
221221
<ClCompile Include="..\include\sc_instance.cpp" />
222222
<ClCompile Include="..\include\sc_outdoor_pvp.cpp" />
223223
<ClCompile Include="..\scripts\battlegrounds\battleground.cpp" />
224+
<ClCompile Include="..\scripts\battlegrounds\battlegroundSA.cpp" />
224225
<ClCompile Include="..\scripts\custom\custom_cybernetic.cpp" />
225226
<ClCompile Include="..\scripts\custom\npc_arena_honor.cpp" />
226227
<ClCompile Include="..\scripts\custom\teleguy.cpp" />

VC90/90ScriptDev2.vcproj

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -69,15 +69,15 @@
6969
<Tool
7070
Name="VCLinkerTool"
7171
AdditionalDependencies="mangosd.lib ACEd.lib"
72-
OutputFile="$(OutDir)/mangosscript.dll"
72+
OutputFile="$(OutDir)/mangosscriptR2.dll"
7373
LinkIncremental="2"
7474
AdditionalLibraryDirectories="..\..\..\..\win\VC90\mangosd__Win32_Debug;..\..\..\..\dep\lib\win32_debug\"
7575
GenerateDebugInformation="true"
76-
ProgramDatabaseFile="$(OutDir)/mangosscript.pdb"
76+
ProgramDatabaseFile="$(OutDir)/mangosscriptR2.pdb"
7777
SubSystem="2"
7878
RandomizedBaseAddress="1"
7979
DataExecutionPrevention="0"
80-
ImportLibrary="$(OutDir)/mangosscript.lib"
80+
ImportLibrary="$(OutDir)/mangosscriptR2.lib"
8181
TargetMachine="1"
8282
/>
8383
<Tool
@@ -150,7 +150,7 @@
150150
<Tool
151151
Name="VCLinkerTool"
152152
AdditionalDependencies="mangosd.lib ACE.lib"
153-
OutputFile="$(OutDir)/mangosscript.dll"
153+
OutputFile="$(OutDir)/mangosscriptR2.dll"
154154
LinkIncremental="1"
155155
AdditionalLibraryDirectories="..\..\..\..\win\VC90\mangosd__Win32_Release;..\..\..\..\dep\lib\win32_release\"
156156
GenerateDebugInformation="false"
@@ -159,7 +159,7 @@
159159
EnableCOMDATFolding="2"
160160
RandomizedBaseAddress="1"
161161
DataExecutionPrevention="0"
162-
ImportLibrary="$(OutDir)/mangosscript.lib"
162+
ImportLibrary="$(OutDir)/mangosscriptR2.lib"
163163
TargetMachine="1"
164164
/>
165165
<Tool
@@ -234,15 +234,15 @@
234234
<Tool
235235
Name="VCLinkerTool"
236236
AdditionalDependencies="mangosd.lib ACEd.lib"
237-
OutputFile="$(OutDir)/mangosscript.dll"
237+
OutputFile="$(OutDir)/mangosscriptR2.dll"
238238
LinkIncremental="2"
239239
AdditionalLibraryDirectories="..\..\..\..\win\VC90\mangosd__x64_Debug;..\..\..\..\dep\lib\x64_Debug\"
240240
GenerateDebugInformation="true"
241-
ProgramDatabaseFile="$(OutDir)/mangosscript.pdb"
241+
ProgramDatabaseFile="$(OutDir)/mangosscriptR2.pdb"
242242
SubSystem="2"
243243
RandomizedBaseAddress="1"
244244
DataExecutionPrevention="0"
245-
ImportLibrary="$(OutDir)/mangosscript.lib"
245+
ImportLibrary="$(OutDir)/mangosscriptR2.lib"
246246
TargetMachine="17"
247247
/>
248248
<Tool
@@ -316,7 +316,7 @@
316316
<Tool
317317
Name="VCLinkerTool"
318318
AdditionalDependencies="mangosd.lib ACE.lib"
319-
OutputFile="$(OutDir)/mangosscript.dll"
319+
OutputFile="$(OutDir)/mangosscriptR2.dll"
320320
LinkIncremental="1"
321321
AdditionalLibraryDirectories="..\..\..\..\win\VC90\mangosd__x64_Release;..\..\..\..\dep\lib\x64_release\"
322322
GenerateDebugInformation="false"
@@ -325,7 +325,7 @@
325325
EnableCOMDATFolding="2"
326326
RandomizedBaseAddress="1"
327327
DataExecutionPrevention="0"
328-
ImportLibrary="$(OutDir)/mangosscript.lib"
328+
ImportLibrary="$(OutDir)/mangosscriptR2.lib"
329329
TargetMachine="17"
330330
/>
331331
<Tool
@@ -416,6 +416,10 @@
416416
RelativePath="..\scripts\battlegrounds\battleground.cpp"
417417
>
418418
</File>
419+
<File
420+
RelativePath="..\scripts\battlegrounds\battlegroundSA.cpp"
421+
>
422+
</File>
419423
</Filter>
420424
<Filter
421425
Name="custom"

base/BSW_ai.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (C) 2009 - 2010 by /dev/rsa for ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
1+
/* Copyright (C) 2009 - 2011 by /dev/rsa for ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
22
* This program is free software licensed under GPL version 2
33
* Please see the included DOCS/LICENSE.TXT for more information */
44
#include "precompiled.h"
@@ -153,7 +153,7 @@ CanCastResult BSWScriptedAI::_BSWSpellSelector(uint8 m_uiSpellIdx, Unit* pTarget
153153

154154
switch (pSpell->m_CastTarget) {
155155

156-
case DO_NOTHING:
156+
case DO_NOTHING:
157157
result = CAST_OK;
158158
break;
159159

@@ -191,7 +191,7 @@ CanCastResult BSWScriptedAI::_BSWSpellSelector(uint8 m_uiSpellIdx, Unit* pTarget
191191
break;
192192

193193
case APPLY_AURA_TARGET:
194-
if (!pTarget || !pTarget->IsInMap(m_creature))
194+
if (!pTarget || !pTarget->IsInMap(m_creature))
195195
{
196196
result = CAST_FAIL_OTHER;
197197
break;
@@ -231,7 +231,7 @@ CanCastResult BSWScriptedAI::_BSWSpellSelector(uint8 m_uiSpellIdx, Unit* pTarget
231231
pTarget = itr->getSource();
232232
if (pTarget && pTarget->isAlive() && pTarget->IsWithinDistInMap(m_creature, pSpell->LocData.x))
233233
{
234-
if (!pSpell->m_IsBugged)
234+
if (!pSpell->m_IsBugged)
235235
{
236236
m_creature->CastSpell(pTarget, pSpell->m_uiSpellEntry[currentDifficulty], false);
237237
}
@@ -258,7 +258,7 @@ CanCastResult BSWScriptedAI::_BSWSpellSelector(uint8 m_uiSpellIdx, Unit* pTarget
258258

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

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

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

532-
switch (pSpell->m_CastTarget)
532+
switch (pSpell->m_CastTarget)
533533
{
534534
case SUMMON_NORMAL:
535535
return _doSummonAtPosition(pSpell->m_uiSpellEntry[currentDifficulty], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 0, fPosX, fPosY, fPosZ);
@@ -749,7 +749,7 @@ bool BSWScriptedAI::_doAura(uint32 SpellID, Unit* pTarget, SpellEffectIndex inde
749749
if (isStack)
750750
holder->ModStackAmount(1);
751751
}
752-
else
752+
else
753753
{
754754
aura = CreateAura(spell, index, &_basepoint, holder, pTarget);
755755
holder->SetAuraDuration(aura->GetAuraMaxDuration());

base/BSW_ai.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (C) 2009 - 2010 by /dev/rsa for ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
1+
/* Copyright (C) 2009 - 2011 by /dev/rsa for ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
22
* This program is free software licensed under GPL version 2
33
* Please see the included DOCS/LICENSE.TXT for more information */
44

base/BSW_instance.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (C) 2009 - 2010 by /dev/rsa for ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
1+
/* Copyright (C) 2009 - 2011 by /dev/rsa for ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
22
* This program is free software licensed under GPL version 2
33
* Please see the included DOCS/LICENSE.TXT for more information */
44

base/BSW_instance.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (C) 2009 - 2010 by /dev/rsa for ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
1+
/* Copyright (C) 2009 - 2011 by /dev/rsa for ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
22
* This program is free software licensed under GPL version 2
33
* Please see the included DOCS/LICENSE.TXT for more information */
44

base/escort_ai.cpp

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -363,11 +363,7 @@ void npc_escortAI::MovementInform(uint32 uiMoveType, uint32 uiPointId)
363363
{
364364
debug_log("SD2: EscortAI has returned to original position before combat");
365365

366-
if (m_bIsRunning && m_creature->HasSplineFlag(SPLINEFLAG_WALKMODE))
367-
m_creature->RemoveSplineFlag(SPLINEFLAG_WALKMODE);
368-
else if (!m_bIsRunning && !m_creature->HasSplineFlag(SPLINEFLAG_WALKMODE))
369-
m_creature->AddSplineFlag(SPLINEFLAG_WALKMODE);
370-
366+
m_creature->SetWalk(!m_bIsRunning);
371367
RemoveEscortState(STATE_ESCORT_RETURNING);
372368

373369
if (!m_uiWPWaitTimer)
@@ -425,23 +421,27 @@ void npc_escortAI::FillPointMovementListForCreature()
425421

426422
void npc_escortAI::SetCurrentWaypoint(uint32 uiPointId)
427423
{
428-
if (!(HasEscortState(STATE_ESCORT_PAUSED))) // only when paused
429-
return;
430-
431-
if (uiPointId >= WaypointList.size()) // too high number
424+
if (!(HasEscortState(STATE_ESCORT_PAUSED))) // Only when paused
432425
return;
433426

434-
if (uiPointId == CurrentWP->uiId) // already here
427+
if (uiPointId == CurrentWP->uiId) // Already here
435428
return;
436429

437-
CurrentWP = WaypointList.begin(); // set to begin (can't -- backwards in itr list)
438-
439-
while(uiPointId != CurrentWP->uiId)
430+
bool bFoundWaypoint = false;
431+
for (std::list<Escort_Waypoint>::iterator itr = WaypointList.begin(); itr != WaypointList.end(); ++itr)
440432
{
441-
++CurrentWP;
442-
443-
if (CurrentWP == WaypointList.end())
433+
if (itr->uiId == uiPointId)
434+
{
435+
CurrentWP = itr; // Set to found itr
436+
bFoundWaypoint = true;
444437
break;
438+
}
439+
}
440+
441+
if (!bFoundWaypoint)
442+
{
443+
debug_log("SD2: EscortAI current waypoint tried to set to id %u, but doesn't exist in WaypointList", uiPointId);
444+
return;
445445
}
446446

447447
m_uiWPWaitTimer = 1;
@@ -454,14 +454,14 @@ void npc_escortAI::SetRun(bool bRun)
454454
if (bRun)
455455
{
456456
if (!m_bIsRunning)
457-
m_creature->RemoveSplineFlag(SPLINEFLAG_WALKMODE);
457+
m_creature->SetWalk(false);
458458
else
459459
debug_log("SD2: EscortAI attempt to set run mode, but is already running.");
460460
}
461461
else
462462
{
463463
if (m_bIsRunning)
464-
m_creature->AddSplineFlag(SPLINEFLAG_WALKMODE);
464+
m_creature->SetWalk(true);
465465
else
466466
debug_log("SD2: EscortAI attempt to set walk mode, but is already walking.");
467467
}
@@ -521,8 +521,7 @@ void npc_escortAI::Start(bool bRun, const Player* pPlayer, const Quest* pQuest,
521521
CurrentWP = WaypointList.begin();
522522

523523
//Set initial speed
524-
if (m_bIsRunning)
525-
m_creature->RemoveSplineFlag(SPLINEFLAG_WALKMODE);
524+
m_creature->SetWalk(!m_bIsRunning);
526525

527526
AddEscortState(STATE_ESCORT_ESCORTING);
528527

base/follower_ai.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ void FollowerAI::StartFollow(Player* pLeader, uint32 uiFactionForFollower, const
308308

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

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

314314
Player* FollowerAI::GetLeaderForFollower()

0 commit comments

Comments
 (0)