*Wintergrasp: Set Faction on workshop capture + GO check faction fix, by Spp

--HG--
branch : trunk
This commit is contained in:
maximius
2009-10-13 23:04:11 -07:00
parent 832159de12
commit 075989a8a4
3 changed files with 12 additions and 26 deletions

View File

@@ -7043,13 +7043,9 @@ void Spell::EffectWMODamage(uint32 /*i*/)
if(!caster)
return;
const GameObjectInfo *gInfo = objmgr.GetGameObjectInfo(gameObjTarget->GetEntry());
if (!gInfo)
return;
FactionTemplateEntry const *casterft, *goft;
casterft = caster->getFactionTemplateEntry();
goft = sFactionTemplateStore.LookupEntry(gInfo->faction);
goft = sFactionTemplateStore.LookupEntry(gameObjTarget->GetUInt32Value(GAMEOBJECT_FACTION));
// Do not allow to damage GO's of friendly factions (ie: Wintergrasp Walls)
if (casterft && goft && !casterft->IsFriendlyTo(*goft))
gameObjTarget->TakenDamage((uint32)damage);

View File

@@ -630,24 +630,7 @@ bool OPvPWintergrasp::UpdateCreatureInfo(Creature *creature) const
bool OPvPWintergrasp::UpdateGameObjectInfo(GameObject *go) const
{
/*
switch(go->GetEntry())
{
// Defender's Portal
case 190763:
go->SetUInt32Value(GAMEOBJECT_FACTION, WintergraspFaction[m_defender]);
return true;
// Titan relic
case 192829:
go->SetUInt32Value(GAMEOBJECT_FACTION, WintergraspFaction[OTHER_TEAM(m_defender)]);
return true;
}
*/
const GameObjectInfo *gInfo = objmgr.GetGameObjectInfo(go->GetEntry());
if (!gInfo)
return false;
switch(gInfo->displayId)
switch(go->GetGOInfo()->displayId)
{
case 8165: // Wintergrasp Keep Door
case 7877: // Wintergrasp Fortress Wall
@@ -656,12 +639,18 @@ bool OPvPWintergrasp::UpdateGameObjectInfo(GameObject *go) const
case 7909: // Wintergrasp Wall
case 8244: // Defender's Portal - Vehicle Teleporter
go->SetUInt32Value(GAMEOBJECT_FACTION, WintergraspFaction[m_defender]);
return true;
return true;
case 7900: // Flamewatch Tower - Shadowsight Tower - Winter's Edge Tower
case 7967: // Titan relic
go->SetUInt32Value(GAMEOBJECT_FACTION, WintergraspFaction[OTHER_TEAM(m_defender)]);
return true;
// case 8208: // Goblin Workshop
case 8208: // Goblin Workshop
SiegeWorkshop *workshop = GetWorkshopByGOGuid(go->GetGUID());
if (workshop)
{
go->SetUInt32Value(GAMEOBJECT_FACTION, WintergraspFaction[workshop->m_buildingState->GetTeam()]);
return true;
}
}
// Note: this is only for test, still need db support

View File

@@ -25,7 +25,7 @@
#define POS_X_CENTER 4700
#define MAX_VEHICLE_PER_WORKSHOP 4
const uint32 WintergraspFaction[2] = {1732, 1735};
const uint32 WintergraspFaction[3] = {1732, 1735, 35};
const uint32 WG_MARK_OF_HONOR = 43589;
const uint32 VehNumWorldState[2] = {3680,3490};
const uint32 MaxVehNumWorldState[2] = {3681,3491};
@@ -155,6 +155,7 @@ struct BuildingState
if(graveTeam)
*graveTeam = TeamId2Team[t];
}
GameObject * GetBuilding() { return building; }
private:
TeamId team;
};