*Allow to spawn correct npc for defender/attacker in wintergrasp based on game event. Now only xxx Champion is spawned based on faction for test. Other npc and gameobjects requires DB support (now in db the defender is always horde and attacker always alliance, and the data of counterpart is missing)

*Fix defenders' portal (now only useable for horde)
*Display random model if the model id in creature table is one of those in creature_template table (in this case they should be 0 actually).

--HG--
branch : trunk
This commit is contained in:
megamage
2009-05-30 15:05:54 -05:00
parent 790181add0
commit 76d0498aae
5 changed files with 59 additions and 1 deletions
+13
View File
@@ -0,0 +1,13 @@
DELETE FROM `spell_script_target` WHERE entry IN
(54643);
INSERT INTO `spell_script_target` (`entry`, `type`, `targetEntry`) VALUES
(54643,1,23472);
DELETE FROM `game_event` WHERE `entry` IN (50,51);
INSERT INTO `game_event` (`entry`, `description`, `world_event`) VALUES
(50, 'Wintergrasp Alliance Defence', 5),
(51, 'Wintergrasp Horde Defence', 5);
DELETE FROM `spell_linked_spell` WHERE `spell_trigger` IN (54643);
INSERT INTO `spell_linked_spell` (`spell_trigger`, `spell_effect`, `type`, `comment`) VALUES
( 54643,-54643, 2, 'Wintergrasp Defender Teleport');
+16
View File
@@ -1707,6 +1707,13 @@ spell8 = VALUES(spell8);
-- --------
-- WINTERGRASP
-- --------
DELETE FROM `game_event` WHERE `entry` IN (50,51);
INSERT INTO `game_event` (`entry`, `description`, `world_event`) VALUES
(50, 'Wintergrasp Alliance Defence', 5),
(51, 'Wintergrasp Horde Defence', 5);
-- Build Vehicles
DELETE FROM `spell_script_target` WHERE entry IN
(56575,56661,56663,56665,56667,56669,61408);
INSERT INTO `spell_script_target` (`entry`, `type`, `targetEntry`) VALUES
@@ -1718,6 +1725,15 @@ INSERT INTO `spell_script_target` (`entry`, `type`, `targetEntry`) VALUES
(56669, 1, 27852),
(61408, 1, 27852);
-- Defender's Portal
DELETE FROM `spell_script_target` WHERE entry IN
(54643);
INSERT INTO `spell_script_target` (`entry`, `type`, `targetEntry`) VALUES
(54643,1,23472);
DELETE FROM `spell_linked_spell` WHERE `spell_trigger` IN (54643);
INSERT INTO `spell_linked_spell` (`spell_trigger`, `spell_effect`, `type`, `comment`) VALUES
( 54643,-54643, 2, 'Wintergrasp Defender Teleport');
update creature_template set maxhealth = 30000, minhealth = 30000, speed = 2, spell1=50025, spell2=50989, VehicleId = 36 where entry = 27881;
update creature_template set maxhealth = 50000, minhealth = 50000, speed = 1.6, spell1=50896, spell2=50652, VehicleId = 106 where entry = 28094;
update creature_template set maxhealth = 75000, minhealth = 75000, speed = 1, spell1=51678, VehicleId = 117 where entry IN (28312,32627);
+26 -1
View File
@@ -892,7 +892,15 @@ uint32 ObjectMgr::ChooseDisplayId(uint32 team, const CreatureInfo *cinfo, const
if (!data || data->displayid == 0) // use defaults from the template
{
display_id = cinfo->GetRandomValidModelId();
} else display_id = data->displayid; // overwritten from creature data
}
else
{
display_id = data->displayid; // overwritten from creature data
// I do not know why but in db most display id are not zero
if(display_id == cinfo->Modelid_A1 || display_id == cinfo->Modelid_A2
|| display_id == cinfo->Modelid_H1 || display_id == cinfo->Modelid_H2)
display_id = cinfo->GetRandomValidModelId();
}
return display_id;
}
@@ -1059,6 +1067,9 @@ void ObjectMgr::LoadCreatures()
if(cInfo->HeroicEntry)
heroicCreatures.insert(cInfo->HeroicEntry);
//TODO: remove this
gameeventmgr.mGameEventCreatureGuids.resize(52*2-1);
barGoLink bar(result->GetRowCount());
do
@@ -1160,6 +1171,20 @@ void ObjectMgr::LoadCreatures()
data.phaseMask = 1;
}
//if(entry == 32307 || entry == 32308)
if(entry == 30739 || entry == 30740)
{
gameEvent = 51;
uint32 guid2 = objmgr.GenerateLowGuid(HIGHGUID_UNIT);
CreatureData& data2 = mCreatureDataMap[guid2];
data2 = data;
// data2.id = (entry == 32307 ? 32308 : 32307);
data2.id = (entry == 30739 ? 30740 : 30739);
data2.displayid = 0;
gameeventmgr.mGameEventCreatureGuids[51+51].push_back(guid);
gameeventmgr.mGameEventCreatureGuids[51+50].push_back(guid2);
}
if (gameEvent==0 && PoolId==0) // if not this is to be managed by GameEvent System or Pool system
AddCreatureToGrid(guid, &data);
+2
View File
@@ -19,6 +19,7 @@
#include "Wintergrasp.h"
#include "SpellAuras.h"
#include "Vehicle.h"
#include "GameEventMgr.h"
bool OPvPWintergrasp::SetupOutdoorPvP()
{
@@ -32,6 +33,7 @@ bool OPvPWintergrasp::SetupOutdoorPvP()
}
m_defender = TeamId(rand()%2);
gameeventmgr.StartInternalEvent(GameEventWintergraspDefender[m_defender]);
return true;
}
+2
View File
@@ -23,6 +23,8 @@
#define ZONE_WINTERGRASP 4197
const uint16 GameEventWintergraspDefender[2] = {50, 51};
#define POS_X_CENTER 4700
#define SPELL_RECRUIT 37795