Skip to content

Commit cd48854

Browse files
committed
[2273] Add placeholders for world map scripts
1 parent 68aec19 commit cd48854

10 files changed

Lines changed: 148 additions & 3 deletions

VC100/100ScriptDev2.vcxproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -685,6 +685,7 @@
685685
<ClCompile Include="..\scripts\world\npc_professions.cpp" />
686686
<ClCompile Include="..\scripts\world\npcs_special.cpp" />
687687
<ClCompile Include="..\scripts\world\spell_scripts.cpp" />
688+
<ClCompile Include="..\scripts\world\world_map_scripts.cpp" />
688689
<ClCompile Include="..\include\precompiled.cpp">
689690
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
690691
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>

VC100/100ScriptDev2.vcxproj.filters

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1710,6 +1710,9 @@
17101710
<ClCompile Include="..\scripts\world\spell_scripts.cpp">
17111711
<Filter>scripts\world</Filter>
17121712
</ClCompile>
1713+
<ClCompile Include="..\scripts\world\world_map_scripts.cpp">
1714+
<Filter>scripts\world</Filter>
1715+
</ClCompile>
17131716
<ClCompile Include="..\include\precompiled.cpp">
17141717
<Filter>include</Filter>
17151718
</ClCompile>

VC80/80ScriptDev2.vcproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2913,6 +2913,10 @@
29132913
RelativePath="..\scripts\world\spell_scripts.cpp"
29142914
>
29152915
</File>
2916+
<File
2917+
RelativePath="..\scripts\world\world_map_scripts.cpp"
2918+
>
2919+
</File>
29162920
</Filter>
29172921
</Filter>
29182922
<Filter

VC90/90ScriptDev2.vcproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2911,6 +2911,10 @@
29112911
RelativePath="..\scripts\world\spell_scripts.cpp"
29122912
>
29132913
</File>
2914+
<File
2915+
RelativePath="..\scripts\world\world_map_scripts.cpp"
2916+
>
2917+
</File>
29142918
</Filter>
29152919
</Filter>
29162920
<Filter

include/sc_instance.h

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ enum EncounterState
2020
#define OUT_SAVE_INST_DATA debug_log("SD2: Saving Instance Data for Instance %s (Map %d, Instance Id %d)", instance->GetMapName(), instance->GetId(), instance->GetInstanceId())
2121
#define OUT_SAVE_INST_DATA_COMPLETE debug_log("SD2: Saving Instance Data for Instance %s (Map %d, Instance Id %d) completed.", instance->GetMapName(), instance->GetId(), instance->GetInstanceId())
2222
#define OUT_LOAD_INST_DATA(a) debug_log("SD2: Loading Instance Data for Instance %s (Map %d, Instance Id %d). Input is '%s'", instance->GetMapName(), instance->GetId(), instance->GetInstanceId(), a)
23-
#define OUT_LOAD_INST_DATA_COMPLETE debug_log("SD2: Instance Data Load for Instance %s (Map %d, Instance Id: %d) is complete.",instance->GetMapName(), instance->GetId(), instance->GetInstanceId())
24-
#define OUT_LOAD_INST_DATA_FAIL error_log("SD2: Unable to load Instance Data for Instance %s (Map %d, Instance Id: %d).",instance->GetMapName(), instance->GetId(), instance->GetInstanceId())
23+
#define OUT_LOAD_INST_DATA_COMPLETE debug_log("SD2: Instance Data Load for Instance %s (Map %d, Instance Id: %d) is complete.", instance->GetMapName(), instance->GetId(), instance->GetInstanceId())
24+
#define OUT_LOAD_INST_DATA_FAIL error_log("SD2: Unable to load Instance Data for Instance %s (Map %d, Instance Id: %d).", instance->GetMapName(), instance->GetId(), instance->GetInstanceId())
2525

2626
class MANGOS_DLL_DECL ScriptedInstance : public InstanceData
2727
{
@@ -63,6 +63,13 @@ class MANGOS_DLL_DECL ScriptedInstance : public InstanceData
6363
EntryGuidMap m_mNpcEntryGuidStore; ///< Store unique NPC-Guids by entry
6464
};
6565

66+
// Class for world maps (May need additional zone-wide functions later on)
67+
class MANGOS_DLL_DECL ScriptedMap : public ScriptedInstance
68+
{
69+
public:
70+
ScriptedMap(Map* pMap) : ScriptedInstance(pMap) {}
71+
};
72+
6673
/// A static const array of this structure must be handled to DialogueHelper
6774
struct DialogueEntry
6875
{
Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
/* Copyright (C) 2006 - 2011 ScriptDev2 <http://www.scriptdev2.com/>
2+
* This program is free software; you can redistribute it and/or modify
3+
* it under the terms of the GNU General Public License as published by
4+
* the Free Software Foundation; either version 2 of the License, or
5+
* (at your option) any later version.
6+
*
7+
* This program is distributed in the hope that it will be useful,
8+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
9+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10+
* GNU General Public License for more details.
11+
*
12+
* You should have received a copy of the GNU General Public License
13+
* along with this program; if not, write to the Free Software
14+
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
15+
*/
16+
17+
/* ScriptData
18+
SDName: world_map_scripts
19+
SD%Complete: 0
20+
SDComment: Placeholder, Scripts for continents
21+
SDCategory: World Map Scripts
22+
EndScriptData */
23+
24+
#include "precompiled.h"
25+
26+
/* *********************************************************
27+
* EASTERN KINGDOMS
28+
*/
29+
struct MANGOS_DLL_DECL world_map_eastern_kingdoms : public ScriptedMap
30+
{
31+
world_map_eastern_kingdoms(Map* pMap) : ScriptedMap(pMap) {}
32+
33+
void SetData(uint32 uiType, uint32 uiData) {}
34+
};
35+
36+
InstanceData* GetInstanceData_world_map_eastern_kingdoms(Map* pMap)
37+
{
38+
return new world_map_eastern_kingdoms(pMap);
39+
}
40+
41+
/* *********************************************************
42+
* KALIMDOR
43+
*/
44+
struct MANGOS_DLL_DECL world_map_kalimdor : public ScriptedMap
45+
{
46+
world_map_kalimdor(Map* pMap) : ScriptedMap(pMap) {}
47+
48+
void SetData(uint32 uiType, uint32 uiData) {}
49+
};
50+
51+
InstanceData* GetInstanceData_world_map_kalimdor(Map* pMap)
52+
{
53+
return new world_map_kalimdor(pMap);
54+
}
55+
56+
/* *********************************************************
57+
* OUTLAND
58+
*/
59+
60+
struct MANGOS_DLL_DECL world_map_outland : public ScriptedMap
61+
{
62+
world_map_outland(Map* pMap) : ScriptedMap(pMap) {}
63+
64+
void SetData(uint32 uiType, uint32 uiData) {}
65+
};
66+
67+
InstanceData* GetInstanceData_world_map_outland(Map* pMap)
68+
{
69+
return new world_map_outland(pMap);
70+
}
71+
72+
/* *********************************************************
73+
* NORTHREND
74+
*/
75+
struct MANGOS_DLL_DECL world_map_northrend : public ScriptedMap
76+
{
77+
world_map_northrend(Map* pMap) : ScriptedMap(pMap) {}
78+
79+
void SetData(uint32 uiType, uint32 uiData) {}
80+
};
81+
82+
InstanceData* GetInstanceData_world_map_northrend(Map* pMap)
83+
{
84+
return new world_map_northrend(pMap);
85+
}
86+
87+
void AddSC_world_map_scripts()
88+
{
89+
Script* pNewScript;
90+
91+
pNewScript = new Script;
92+
pNewScript->Name = "world_map_eastern_kingdoms";
93+
pNewScript->GetInstanceData = &GetInstanceData_world_map_eastern_kingdoms;
94+
pNewScript->RegisterSelf();
95+
96+
pNewScript = new Script;
97+
pNewScript->Name = "world_map_kalimdor";
98+
pNewScript->GetInstanceData = &GetInstanceData_world_map_kalimdor;
99+
pNewScript->RegisterSelf();
100+
101+
pNewScript = new Script;
102+
pNewScript->Name = "world_map_outland";
103+
pNewScript->GetInstanceData = &GetInstanceData_world_map_outland;
104+
pNewScript->RegisterSelf();
105+
106+
pNewScript = new Script;
107+
pNewScript->Name = "world_map_northrend";
108+
pNewScript->GetInstanceData = &GetInstanceData_world_map_northrend;
109+
pNewScript->RegisterSelf();
110+
}

sd2_revision_nr.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#ifndef __SD2_REVISION_NR_H__
22
#define __SD2_REVISION_NR_H__
3-
#define SD2_REVISION_NR "2272"
3+
#define SD2_REVISION_NR "2273"
44
#endif // __SD2_REVISION_NR_H__

sql/mangos_scriptname_full.sql

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,14 @@ UPDATE creature_template SET ScriptName='spell_dummy_npc' WHERE entry IN (
159159

160160
UPDATE gameobject_template SET ScriptName='spell_dummy_go' WHERE entry IN (181616,186949);
161161

162+
/* WORLD MAP SCRIPTS */
163+
DELETE FROM world_template WHERE map IN (0, 1, 530, 571);
164+
INSERT INTO world_template VALUES
165+
(0, 'world_map_eastern_kingdoms'),
166+
(1, 'world_map_kalimdor'),
167+
(530, 'world_map_outland'),
168+
(571, 'world_map_northrend');
169+
162170
/* */
163171
/* ZONE */
164172
/* */

sql/updates/r2273_mangos.sql

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
DELETE FROM world_template WHERE map IN (0, 1, 530, 571);
2+
INSERT INTO world_template VALUES
3+
(0, 'world_map_eastern_kingdoms'),
4+
(1, 'world_map_kalimdor'),
5+
(530, 'world_map_outland'),
6+
(571, 'world_map_northrend');

system/ScriptLoader.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ extern void AddSC_item_scripts();
2525
extern void AddSC_npc_professions();
2626
extern void AddSC_npcs_special();
2727
extern void AddSC_spell_scripts();
28+
extern void AddSC_world_map_scripts();
2829

2930
// eastern kingdoms
3031
extern void AddSC_blackrock_depths(); // blackrock_depths
@@ -514,6 +515,7 @@ void AddScripts()
514515
AddSC_npc_professions();
515516
AddSC_npcs_special();
516517
AddSC_spell_scripts();
518+
AddSC_world_map_scripts();
517519

518520
// eastern kingdoms
519521
AddSC_blackrock_depths(); // blackrock_depths

0 commit comments

Comments
 (0)