Merge branch 'master' of github.com:TrinityCore/TrinityCore into mmaps

This commit is contained in:
Subv
2012-08-24 15:34:29 -05:00
6 changed files with 50 additions and 26 deletions

View File

@@ -0,0 +1,3 @@
DELETE FROM `spell_script_names` WHERE `spell_id` = 54640;
INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES
(54640, 'spell_wintergrasp_defender_teleport');

View File

@@ -0,0 +1 @@
DELETE FROM `gameobject` WHERE `guid` IN (67259,67135,60476,66674,66675,67127,67128,66728,66731,67125,66730,66732,67126,67256,67132,67133,66733,67134,67251,67255,67129,67130,67131,67253,67258,67259,67260,75975,75976,76021,76022,66729,66718,66719,66720,66721,66722,66723,66724,66725,66726);

View File

@@ -538,7 +538,6 @@ void BattlefieldWG::OnCreatureCreate(Creature* creature)
{
UpdateData(BATTLEFIELD_WG_DATA_VEHICLE_H, 1);
creature->AddAura(SPELL_HORDE_FLAG, creature);
creature->setFaction(creator->getFaction());
m_vehicles[team].insert(creature->GetGUID());
UpdateVehicleCountWG();
}
@@ -555,7 +554,6 @@ void BattlefieldWG::OnCreatureCreate(Creature* creature)
{
UpdateData(BATTLEFIELD_WG_DATA_VEHICLE_A, 1);
creature->AddAura(SPELL_ALLIANCE_FLAG, creature);
creature->setFaction(creator->getFaction());
m_vehicles[team].insert(creature->GetGUID());
UpdateVehicleCountWG();
}

View File

@@ -29,7 +29,7 @@
uint32 const VehNumWorldState[2] = { 3680, 3490 };
uint32 const MaxVehNumWorldState[2] = { 3681, 3491 };
uint32 const ClockWorldState[2] = { 3781, 4354 };
uint32 const WintergraspFaction[3] = { 1, 2, 35 };
uint32 const WintergraspFaction[3] = { 1732, 1735, 35 };
float const WintergraspStalkerPos[4] = { 0, 0, 0, 0 };
class BattlefieldWG;

View File

@@ -135,7 +135,7 @@ void GameObject::AddToWorld()
sObjectAccessor->AddObject(this);
bool startOpen = (GetGoType() == GAMEOBJECT_TYPE_DOOR || GetGoType() == GAMEOBJECT_TYPE_BUTTON ? GetGOInfo()->door.startOpen : false);
// The state can be changed after GameObject::Create but before GameObject::AddToWorld
bool toggledState = GetGOData() ? GetGOData()->go_state == GO_STATE_READY : false;
bool toggledState = GetGOData() ? GetGOData()->go_state != GO_STATE_READY : false;
if (m_model)
GetMap()->InsertGameObjectModel(*m_model);
@@ -1929,7 +1929,7 @@ void GameObject::SetLootState(LootState state, Unit* unit)
bool startOpen = (GetGoType() == GAMEOBJECT_TYPE_DOOR || GetGoType() == GAMEOBJECT_TYPE_BUTTON ? GetGOInfo()->door.startOpen : false);
// Use the current go state
if (GetGoState() != GO_STATE_ACTIVE)
if (GetGoState() != GO_STATE_READY)
startOpen = !startOpen;
if (state == GO_ACTIVATED || state == GO_JUST_DEACTIVATED)
@@ -1951,13 +1951,10 @@ void GameObject::SetGoState(GOState state)
// startOpen determines whether we are going to add or remove the LoS on activation
bool startOpen = (GetGoType() == GAMEOBJECT_TYPE_DOOR || GetGoType() == GAMEOBJECT_TYPE_BUTTON ? GetGOInfo()->door.startOpen : false);
if (GetGOData() && GetGOData()->go_state == GO_STATE_READY)
if (state != GO_STATE_READY)
startOpen = !startOpen;
if (state == GO_STATE_ACTIVE || state == GO_STATE_ACTIVE_ALTERNATIVE)
EnableCollision(startOpen);
else if (state == GO_STATE_READY)
EnableCollision(!startOpen);
EnableCollision(startOpen);
}
}

View File

@@ -119,8 +119,6 @@ class npc_wg_demolisher_engineer : public CreatureScript
if (creature->isQuestGiver())
player->PrepareQuestMenu(creature->GetGUID());
Battlefield* wintergrasp = sBattlefieldMgr->GetBattlefieldByBattleId(BATTLEFIELD_BATTLEID_WG);
if (canBuild(creature))
{
if (player->HasAura(SPELL_CORPORAL))
@@ -143,8 +141,6 @@ class npc_wg_demolisher_engineer : public CreatureScript
{
player->CLOSE_GOSSIP_MENU();
Battlefield* wintergrasp= sBattlefieldMgr->GetBattlefieldByBattleId(BATTLEFIELD_BATTLEID_WG);
if (canBuild(creature))
{
switch (action - GOSSIP_ACTION_INFO_DEF)
@@ -169,9 +165,9 @@ class npc_wg_demolisher_engineer : public CreatureScript
bool canBuild(Creature* creature)
{
Battlefield* wintergrasp = sBattlefieldMgr->GetBattlefieldByBattleId(BATTLEFIELD_BATTLEID_WG);
if (!wintergrasp)
return false;
switch (creature->GetEntry())
{
case NPC_GOBLIN_MECHANIC:
@@ -207,7 +203,7 @@ class npc_wg_spirit_guide : public CreatureScript
return true;
}
bool OnGossipSelect(Player* player, Creature* /*creature*/ , uint32 /*sender */ , uint32 action)
bool OnGossipSelect(Player* player, Creature* /*creature*/, uint32 /*sender*/, uint32 action)
{
player->CLOSE_GOSSIP_MENU();
@@ -307,15 +303,13 @@ class go_wg_vehicle_teleporter : public GameObjectScript
{
if (_checkTimer <= diff)
{
// Tabulation madness in the hole!
for (uint8 i = 0; i < MAX_WINTERGRASP_VEHICLES; i++)
if (Creature* vehicleCreature = go->FindNearestCreature(vehiclesList[i], 3.0f, true))
if (!vehicleCreature->HasAura(SPELL_VEHICLE_TELEPORT))
if (Vehicle* vehicle = vehicleCreature->GetVehicle())
if (Unit* passenger = vehicle->GetPassenger(0))
if (go->GetUInt32Value(GAMEOBJECT_FACTION) == passenger->getFaction())
if (Creature* teleportTrigger = vehicleCreature->FindNearestCreature(NPC_WORLD_TRIGGER_LARGE_AOI_NOT_IMMUNE_PC_NPC, 100.0f, true))
teleportTrigger->CastSpell(vehicleCreature, SPELL_VEHICLE_TELEPORT, true);
if (Battlefield* wg = sBattlefieldMgr->GetBattlefieldByBattleId(BATTLEFIELD_BATTLEID_WG))
// Tabulation madness in the hole!
for (uint8 i = 0; i < MAX_WINTERGRASP_VEHICLES; i++)
if (Creature* vehicleCreature = go->FindNearestCreature(vehiclesList[i], 3.0f, true))
if (!vehicleCreature->HasAura(SPELL_VEHICLE_TELEPORT) && vehicleCreature->getFaction() == WintergraspFaction[wg->GetDefenderTeam()])
if (Creature* teleportTrigger = vehicleCreature->FindNearestCreature(NPC_WORLD_TRIGGER_LARGE_AOI_NOT_IMMUNE_PC_NPC, 100.0f, true))
teleportTrigger->CastSpell(vehicleCreature, SPELL_VEHICLE_TELEPORT, true);
_checkTimer = 1000;
}
@@ -326,7 +320,7 @@ class go_wg_vehicle_teleporter : public GameObjectScript
uint32 _checkTimer;
};
GameObjectAI* GetGameObjectAI(GameObject* go) const
GameObjectAI* GetAI(GameObject* go) const
{
return new go_wg_vehicle_teleporterAI(go);
}
@@ -547,6 +541,36 @@ public:
}
};
class spell_wintergrasp_defender_teleport : public SpellScriptLoader
{
public:
spell_wintergrasp_defender_teleport() : SpellScriptLoader("spell_wintergrasp_defender_teleport") { }
class spell_wintergrasp_defender_teleport_SpellScript : public SpellScript
{
PrepareSpellScript(spell_wintergrasp_defender_teleport_SpellScript);
SpellCastResult CheckCast()
{
if (Battlefield* wg = sBattlefieldMgr->GetBattlefieldByBattleId(BATTLEFIELD_BATTLEID_WG))
if (Player* target = GetExplTargetUnit()->ToPlayer())
if (target->GetTeamId() != wg->GetDefenderTeam())
return SPELL_FAILED_BAD_TARGETS;
return SPELL_CAST_OK;
}
void Register()
{
OnCheckCast += SpellCheckCastFn(spell_wintergrasp_defender_teleport_SpellScript::CheckCast);
}
};
SpellScript* GetSpellScript() const
{
return new spell_wintergrasp_defender_teleport_SpellScript();
}
};
void AddSC_wintergrasp()
{
new npc_wg_queue();
@@ -557,4 +581,5 @@ void AddSC_wintergrasp()
new spell_wintergrasp_force_building();
new spell_wintergrasp_grab_passenger();
new achievement_wg_didnt_stand_a_chance();
new spell_wintergrasp_defender_teleport();
}