BG/Isle of Conquest:

- Fix seaforium bombs.
- Add flag pole for Refinery
- Some cleanup
Also correct a typo in 0083290322
This commit is contained in:
kaelima
2011-10-29 15:16:13 +01:00
parent 0083290322
commit 526ada47e1
4 changed files with 158 additions and 156 deletions
@@ -0,0 +1 @@
UPDATE `gameobject_template` SET `ScriptName`= 'go_massive_seaforium_charge' WHERE `entry` IN (195235,195331);
@@ -644,178 +644,178 @@ void BattlegroundIC::HandleCapturedNodes(ICNodePoint* nodePoint, bool recapture)
switch (nodePoint->gameobject_type)
{
case BG_IC_GO_HANGAR_BANNER:
// all the players on the stopped transport should be teleported out
if (!gunshipAlliance || !gunshipHorde)
break;
case BG_IC_GO_HANGAR_BANNER:
// all the players on the stopped transport should be teleported out
if (!gunshipAlliance || !gunshipHorde)
break;
for (uint8 u = 0; u < MAX_HANGAR_TELEPORTERS_SPAWNS; u++)
{
uint8 type = BG_IC_GO_HANGAR_TELEPORTER_1+u;
AddObject(type, (nodePoint->faction == TEAM_ALLIANCE ? GO_ALLIANCE_GUNSHIP_PORTAL : GO_HORDE_GUNSHIP_PORTAL),
BG_IC_HangarTeleporters[u].GetPositionX(), BG_IC_HangarTeleporters[u].GetPositionY(),
BG_IC_HangarTeleporters[u].GetPositionZ(), BG_IC_HangarTeleporters[u].GetOrientation(),
0, 0, 0, 0, RESPAWN_ONE_DAY);
}
//sLog->outError("BG_IC_GO_HANGAR_BANNER CAPTURED Faction: %u", nodePoint->faction);
(nodePoint->faction == TEAM_ALLIANCE ? gunshipAlliance : gunshipHorde)->BuildStartMovePacket(GetBgMap());
(nodePoint->faction == TEAM_ALLIANCE ? gunshipHorde : gunshipAlliance)->BuildStopMovePacket(GetBgMap());
// we should spawn teleporters
break;
case BG_IC_GO_QUARRY_BANNER:
RemoveAuraOnTeam(SPELL_QUARRY, (nodePoint->faction == TEAM_ALLIANCE ? HORDE : ALLIANCE));
CastSpellOnTeam(SPELL_QUARRY, (nodePoint->faction == TEAM_ALLIANCE ? ALLIANCE : HORDE));
break;
case BG_IC_GO_REFINERY_BANNER:
RemoveAuraOnTeam(SPELL_OIL_REFINERY, (nodePoint->faction == TEAM_ALLIANCE ? HORDE : ALLIANCE));
CastSpellOnTeam(SPELL_OIL_REFINERY, (nodePoint->faction == TEAM_ALLIANCE ? ALLIANCE : HORDE));
break;
case BG_IC_GO_DOCKS_BANNER:
if (recapture)
break;
if (docksTimer < DOCKS_UPDATE_TIME)
docksTimer = DOCKS_UPDATE_TIME;
// we must del opposing faction vehicles when the node is captured (unused ones)
for (uint8 i = (nodePoint->faction == TEAM_ALLIANCE ? BG_IC_NPC_GLAIVE_THROWER_1_H : BG_IC_NPC_GLAIVE_THROWER_1_A); i < (nodePoint->faction == TEAM_ALLIANCE ? BG_IC_NPC_GLAIVE_THROWER_2_H : BG_IC_NPC_GLAIVE_THROWER_2_A); i++)
{
if (Creature* glaiveThrower = GetBGCreature(i))
for (uint8 u = 0; u < MAX_HANGAR_TELEPORTERS_SPAWNS; u++)
{
if (Vehicle* vehicleGlaive = glaiveThrower->GetVehicleKit())
{
if (!vehicleGlaive->GetPassenger(0))
DelCreature(i);
}
uint8 type = BG_IC_GO_HANGAR_TELEPORTER_1+u;
AddObject(type, (nodePoint->faction == TEAM_ALLIANCE ? GO_ALLIANCE_GUNSHIP_PORTAL : GO_HORDE_GUNSHIP_PORTAL),
BG_IC_HangarTeleporters[u].GetPositionX(), BG_IC_HangarTeleporters[u].GetPositionY(),
BG_IC_HangarTeleporters[u].GetPositionZ(), BG_IC_HangarTeleporters[u].GetOrientation(),
0, 0, 0, 0, RESPAWN_ONE_DAY);
}
}
for (uint8 i = (nodePoint->faction == TEAM_ALLIANCE ? BG_IC_NPC_CATAPULT_1_H : BG_IC_NPC_CATAPULT_1_A); i < (nodePoint->faction == TEAM_ALLIANCE ? BG_IC_NPC_CATAPULT_4_H : BG_IC_NPC_CATAPULT_4_A); i++)
{
if (Creature* catapult = GetBGCreature(i))
//sLog->outError("BG_IC_GO_HANGAR_BANNER CAPTURED Faction: %u", nodePoint->faction);
(nodePoint->faction == TEAM_ALLIANCE ? gunshipAlliance : gunshipHorde)->BuildStartMovePacket(GetBgMap());
(nodePoint->faction == TEAM_ALLIANCE ? gunshipHorde : gunshipAlliance)->BuildStopMovePacket(GetBgMap());
// we should spawn teleporters
break;
case BG_IC_GO_QUARRY_BANNER:
RemoveAuraOnTeam(SPELL_QUARRY, (nodePoint->faction == TEAM_ALLIANCE ? HORDE : ALLIANCE));
CastSpellOnTeam(SPELL_QUARRY, (nodePoint->faction == TEAM_ALLIANCE ? ALLIANCE : HORDE));
break;
case BG_IC_GO_REFINERY_BANNER:
RemoveAuraOnTeam(SPELL_OIL_REFINERY, (nodePoint->faction == TEAM_ALLIANCE ? HORDE : ALLIANCE));
CastSpellOnTeam(SPELL_OIL_REFINERY, (nodePoint->faction == TEAM_ALLIANCE ? ALLIANCE : HORDE));
break;
case BG_IC_GO_DOCKS_BANNER:
if (recapture)
break;
if (docksTimer < DOCKS_UPDATE_TIME)
docksTimer = DOCKS_UPDATE_TIME;
// we must del opposing faction vehicles when the node is captured (unused ones)
for (uint8 i = (nodePoint->faction == TEAM_ALLIANCE ? BG_IC_NPC_GLAIVE_THROWER_1_H : BG_IC_NPC_GLAIVE_THROWER_1_A); i < (nodePoint->faction == TEAM_ALLIANCE ? BG_IC_NPC_GLAIVE_THROWER_2_H : BG_IC_NPC_GLAIVE_THROWER_2_A); i++)
{
if (Vehicle* vehicleGlaive = catapult->GetVehicleKit())
if (Creature* glaiveThrower = GetBGCreature(i))
{
if (!vehicleGlaive->GetPassenger(0))
DelCreature(i);
}
}
}
// spawning glaive throwers
for (uint8 i = 0; i < MAX_GLAIVE_THROWERS_SPAWNS_PER_FACTION; i++)
{
uint8 type = (nodePoint->faction == TEAM_ALLIANCE ? BG_IC_NPC_GLAIVE_THROWER_1_A : BG_IC_NPC_GLAIVE_THROWER_1_H)+i;
if (GetBGCreature(type) && GetBGCreature(type)->isAlive())
continue;
if (AddCreature(nodePoint->faction == TEAM_ALLIANCE ? NPC_GLAIVE_THROWER_A : NPC_GLAIVE_THROWER_H, type, nodePoint->faction,
BG_IC_DocksVehiclesGlaives[i].GetPositionX(), BG_IC_DocksVehiclesGlaives[i].GetPositionY(),
BG_IC_DocksVehiclesGlaives[i].GetPositionZ(), BG_IC_DocksVehiclesGlaives[i].GetOrientation(),
RESPAWN_ONE_DAY))
GetBGCreature(type)->setFaction(BG_IC_Factions[(nodePoint->faction == TEAM_ALLIANCE ? 0 : 1)]);
}
// spawning catapults
for (uint8 i = 0; i < MAX_CATAPULTS_SPAWNS_PER_FACTION; i++)
{
uint8 type = (nodePoint->faction == TEAM_ALLIANCE ? BG_IC_NPC_CATAPULT_1_A : BG_IC_NPC_CATAPULT_1_H)+i;
if (GetBGCreature(type) && GetBGCreature(type)->isAlive())
continue;
if (AddCreature(NPC_CATAPULT, type, nodePoint->faction,
BG_IC_DocksVehiclesCatapults[i].GetPositionX(), BG_IC_DocksVehiclesCatapults[i].GetPositionY(),
BG_IC_DocksVehiclesCatapults[i].GetPositionZ(), BG_IC_DocksVehiclesCatapults[i].GetOrientation(),
RESPAWN_ONE_DAY))
GetBGCreature(type)->setFaction(BG_IC_Factions[(nodePoint->faction == TEAM_ALLIANCE ? 0 : 1)]);
}
break;
case BG_IC_GO_WORKSHOP_BANNER:
{
if (siegeEngineWorkshopTimer < WORKSHOP_UPDATE_TIME)
siegeEngineWorkshopTimer = WORKSHOP_UPDATE_TIME;
if (!recapture)
{
// we must del opposing faction vehicles when the node is captured (unused ones)
for (uint8 i = (nodePoint->faction == TEAM_ALLIANCE ? BG_IC_NPC_DEMOLISHER_1_H : BG_IC_NPC_DEMOLISHER_1_A); i < (nodePoint->faction == TEAM_ALLIANCE ? BG_IC_NPC_DEMOLISHER_4_H : BG_IC_NPC_DEMOLISHER_4_A); i++)
{
if (Creature* demolisher = GetBGCreature(i))
if (Vehicle* vehicleGlaive = glaiveThrower->GetVehicleKit())
{
if (Vehicle* vehicleDemolisher = demolisher->GetVehicleKit())
if (!vehicleGlaive->GetPassenger(0))
DelCreature(i);
}
}
}
for (uint8 i = (nodePoint->faction == TEAM_ALLIANCE ? BG_IC_NPC_CATAPULT_1_H : BG_IC_NPC_CATAPULT_1_A); i < (nodePoint->faction == TEAM_ALLIANCE ? BG_IC_NPC_CATAPULT_4_H : BG_IC_NPC_CATAPULT_4_A); i++)
{
if (Creature* catapult = GetBGCreature(i))
{
if (Vehicle* vehicleGlaive = catapult->GetVehicleKit())
{
if (!vehicleGlaive->GetPassenger(0))
DelCreature(i);
}
}
}
// spawning glaive throwers
for (uint8 i = 0; i < MAX_GLAIVE_THROWERS_SPAWNS_PER_FACTION; i++)
{
uint8 type = (nodePoint->faction == TEAM_ALLIANCE ? BG_IC_NPC_GLAIVE_THROWER_1_A : BG_IC_NPC_GLAIVE_THROWER_1_H)+i;
if (GetBGCreature(type) && GetBGCreature(type)->isAlive())
continue;
if (AddCreature(nodePoint->faction == TEAM_ALLIANCE ? NPC_GLAIVE_THROWER_A : NPC_GLAIVE_THROWER_H, type, nodePoint->faction,
BG_IC_DocksVehiclesGlaives[i].GetPositionX(), BG_IC_DocksVehiclesGlaives[i].GetPositionY(),
BG_IC_DocksVehiclesGlaives[i].GetPositionZ(), BG_IC_DocksVehiclesGlaives[i].GetOrientation(),
RESPAWN_ONE_DAY))
GetBGCreature(type)->setFaction(BG_IC_Factions[(nodePoint->faction == TEAM_ALLIANCE ? 0 : 1)]);
}
// spawning catapults
for (uint8 i = 0; i < MAX_CATAPULTS_SPAWNS_PER_FACTION; i++)
{
uint8 type = (nodePoint->faction == TEAM_ALLIANCE ? BG_IC_NPC_CATAPULT_1_A : BG_IC_NPC_CATAPULT_1_H)+i;
if (GetBGCreature(type) && GetBGCreature(type)->isAlive())
continue;
if (AddCreature(NPC_CATAPULT, type, nodePoint->faction,
BG_IC_DocksVehiclesCatapults[i].GetPositionX(), BG_IC_DocksVehiclesCatapults[i].GetPositionY(),
BG_IC_DocksVehiclesCatapults[i].GetPositionZ(), BG_IC_DocksVehiclesCatapults[i].GetOrientation(),
RESPAWN_ONE_DAY))
GetBGCreature(type)->setFaction(BG_IC_Factions[(nodePoint->faction == TEAM_ALLIANCE ? 0 : 1)]);
}
break;
case BG_IC_GO_WORKSHOP_BANNER:
{
if (siegeEngineWorkshopTimer < WORKSHOP_UPDATE_TIME)
siegeEngineWorkshopTimer = WORKSHOP_UPDATE_TIME;
if (!recapture)
{
// we must del opposing faction vehicles when the node is captured (unused ones)
for (uint8 i = (nodePoint->faction == TEAM_ALLIANCE ? BG_IC_NPC_DEMOLISHER_1_H : BG_IC_NPC_DEMOLISHER_1_A); i < (nodePoint->faction == TEAM_ALLIANCE ? BG_IC_NPC_DEMOLISHER_4_H : BG_IC_NPC_DEMOLISHER_4_A); i++)
{
if (Creature* demolisher = GetBGCreature(i))
{
// is IsVehicleInUse working as expected?
if (!vehicleDemolisher->IsVehicleInUse())
DelCreature(i);
if (Vehicle* vehicleDemolisher = demolisher->GetVehicleKit())
{
// is IsVehicleInUse working as expected?
if (!vehicleDemolisher->IsVehicleInUse())
DelCreature(i);
}
}
}
for (uint8 i = 0; i < MAX_DEMOLISHERS_SPAWNS_PER_FACTION; i++)
{
uint8 type = (nodePoint->faction == TEAM_ALLIANCE ? BG_IC_NPC_DEMOLISHER_1_A : BG_IC_NPC_DEMOLISHER_1_H)+i;
if (GetBGCreature(type) && GetBGCreature(type)->isAlive())
continue;
if (AddCreature(NPC_DEMOLISHER, type, nodePoint->faction,
BG_IC_WorkshopVehicles[i].GetPositionX(), BG_IC_WorkshopVehicles[i].GetPositionY(),
BG_IC_WorkshopVehicles[i].GetPositionZ(), BG_IC_WorkshopVehicles[i].GetOrientation(),
RESPAWN_ONE_DAY))
GetBGCreature(type)->setFaction(BG_IC_Factions[(nodePoint->faction == TEAM_ALLIANCE ? 0 : 1)]);
}
// we check if the opossing siege engine is in use
int8 enemySiege = (nodePoint->faction == TEAM_ALLIANCE ? BG_IC_NPC_SIEGE_ENGINE_H : BG_IC_NPC_SIEGE_ENGINE_A);
if (Creature* siegeEngine = GetBGCreature(enemySiege))
{
if (Vehicle* vehicleSiege = siegeEngine->GetVehicleKit())
{
// is VehicleInUse working as expected ?
if (!vehicleSiege->IsVehicleInUse())
DelCreature(enemySiege);
}
}
uint8 siegeType = (nodePoint->faction == TEAM_ALLIANCE ? BG_IC_NPC_SIEGE_ENGINE_A : BG_IC_NPC_SIEGE_ENGINE_H);
if (!GetBGCreature(siegeType) || !GetBGCreature(siegeType)->isAlive())
{
AddCreature((nodePoint->faction == TEAM_ALLIANCE ? NPC_SIEGE_ENGINE_A : NPC_SIEGE_ENGINE_H), siegeType, nodePoint->faction,
BG_IC_WorkshopVehicles[4].GetPositionX(), BG_IC_WorkshopVehicles[4].GetPositionY(),
BG_IC_WorkshopVehicles[4].GetPositionZ(), BG_IC_WorkshopVehicles[4].GetOrientation(),
RESPAWN_ONE_DAY);
if (Creature* siegeEngine = GetBGCreature(siegeType))
{
siegeEngine->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE|UNIT_FLAG_UNK_14|UNIT_FLAG_OOC_NOT_ATTACKABLE);
siegeEngine->setFaction(BG_IC_Factions[(nodePoint->faction == TEAM_ALLIANCE ? 0 : 1)]);
}
}
}
for (uint8 i = 0; i < MAX_DEMOLISHERS_SPAWNS_PER_FACTION; i++)
for (uint8 i = 0; i < MAX_WORKSHOP_BOMBS_SPAWNS_PER_FACTION; i++)
{
uint8 type = (nodePoint->faction == TEAM_ALLIANCE ? BG_IC_NPC_DEMOLISHER_1_A : BG_IC_NPC_DEMOLISHER_1_H)+i;
AddObject(BG_IC_GO_SEAFORIUM_BOMBS_1+i, GO_SEAFORIUM_BOMBS,
workshopBombs[i].GetPositionX(), workshopBombs[i].GetPositionY(),
workshopBombs[i].GetPositionZ(), workshopBombs[i].GetOrientation(),
0, 0, 0, 0, 10);
if (GetBGCreature(type) && GetBGCreature(type)->isAlive())
continue;
if (AddCreature(NPC_DEMOLISHER, type, nodePoint->faction,
BG_IC_WorkshopVehicles[i].GetPositionX(), BG_IC_WorkshopVehicles[i].GetPositionY(),
BG_IC_WorkshopVehicles[i].GetPositionZ(), BG_IC_WorkshopVehicles[i].GetOrientation(),
RESPAWN_ONE_DAY))
GetBGCreature(type)->setFaction(BG_IC_Factions[(nodePoint->faction == TEAM_ALLIANCE ? 0 : 1)]);
}
// we check if the opossing siege engine is in use
int8 enemySiege = (nodePoint->faction == TEAM_ALLIANCE ? BG_IC_NPC_SIEGE_ENGINE_H : BG_IC_NPC_SIEGE_ENGINE_A);
if (Creature* siegeEngine = GetBGCreature(enemySiege))
{
if (Vehicle* vehicleSiege = siegeEngine->GetVehicleKit())
if (GameObject* seaforiumBombs = GetBGObject(BG_IC_GO_SEAFORIUM_BOMBS_1+i))
{
// is VehicleInUse working as expected ?
if (!vehicleSiege->IsVehicleInUse())
DelCreature(enemySiege);
}
}
uint8 siegeType = (nodePoint->faction == TEAM_ALLIANCE ? BG_IC_NPC_SIEGE_ENGINE_A : BG_IC_NPC_SIEGE_ENGINE_H);
if (!GetBGCreature(siegeType) || !GetBGCreature(siegeType)->isAlive())
{
AddCreature((nodePoint->faction == TEAM_ALLIANCE ? NPC_SIEGE_ENGINE_A : NPC_SIEGE_ENGINE_H), siegeType, nodePoint->faction,
BG_IC_WorkshopVehicles[4].GetPositionX(), BG_IC_WorkshopVehicles[4].GetPositionY(),
BG_IC_WorkshopVehicles[4].GetPositionZ(), BG_IC_WorkshopVehicles[4].GetOrientation(),
RESPAWN_ONE_DAY);
if (Creature* siegeEngine = GetBGCreature(siegeType))
{
siegeEngine->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE|UNIT_FLAG_UNK_14|UNIT_FLAG_OOC_NOT_ATTACKABLE);
siegeEngine->setFaction(BG_IC_Factions[(nodePoint->faction == TEAM_ALLIANCE ? 0 : 1)]);
seaforiumBombs->SetRespawnTime(10);
seaforiumBombs->SetUInt32Value(GAMEOBJECT_FACTION, BG_IC_Factions[(nodePoint->faction == TEAM_ALLIANCE ? 0 : 1)]);
}
}
break;
}
for (uint8 i = 0; i < MAX_WORKSHOP_BOMBS_SPAWNS_PER_FACTION; i++)
{
AddObject(BG_IC_GO_SEAFORIUM_BOMBS_1+i, GO_SEAFORIUM_BOMBS,
workshopBombs[i].GetPositionX(), workshopBombs[i].GetPositionY(),
workshopBombs[i].GetPositionZ(), workshopBombs[i].GetOrientation(),
0, 0, 0, 0, 10);
if (GameObject* seaforiumBombs = GetBGObject(BG_IC_GO_SEAFORIUM_BOMBS_1+i))
{
seaforiumBombs->SetRespawnTime(10);
seaforiumBombs->SetUInt32Value(GAMEOBJECT_FACTION, BG_IC_Factions[(nodePoint->faction == TEAM_ALLIANCE ? 0 : 1)]);
}
}
default:
break;
}
default:
break;
}
}
@@ -903,7 +903,7 @@ Transport* BattlegroundIC::CreateTransport(uint32 goEntry, uint32 period)
{
Transport* t = new Transport(period, 0);
const GameObjectTemplate* goinfo = sObjectMgr->GetGameObjectTemplate(goEntry);
GameObjectTemplate const* goinfo = sObjectMgr->GetGameObjectTemplate(goEntry);
if (!goinfo)
{
@@ -93,7 +93,6 @@ enum gameobjectsIC
GO_FLAGPOLE_1 = 195131,
GO_FLAGPOLE_2 = 195439,
GO_FLAGPOLE_3 = 195131,
GO_GUNSHIP_PORTAL_1 = 195371,
GO_GUNSHIP_PORTAL_2 = 196413,
@@ -270,6 +269,7 @@ enum BG_IC_GOs
BG_IC_GO_FLAGPOLE_1_3,
BG_IC_GO_FLAGPOLE_1_4,
BG_IC_GO_FLAGPOLE_1_5,
BG_IC_GO_FLAGPOLE_1_6,
BG_IC_GO_HANGAR_BANNER,
@@ -624,6 +624,7 @@ const ICGo BG_IC_ObjSpawnlocs[MAX_NORMAL_GAMEOBJECTS_SPAWNS] =
{BG_IC_GO_FLAGPOLE_1_3, GO_FLAGPOLE_1, 807.78f, -1000.07f, 132.381f, -1.91986f}, // Flagpole
{BG_IC_GO_FLAGPOLE_1_4, GO_FLAGPOLE_1, 776.229f, -804.283f, 6.45052f, 1.6057f}, // Flagpole
{BG_IC_GO_FLAGPOLE_1_5, GO_FLAGPOLE_1, 251.016f, -1159.32f, 17.2376f, -2.25147f}, // Flagpole
{BG_IC_GO_FLAGPOLE_1_6, GO_FLAGPOLE_1, 1269.502f, -400.809f, 37.62525f, -1.762782f}, // Flagpole
{BG_IC_GO_HORDE_KEEP_PORTCULLIS, GO_HORDE_KEEP_PORTCULLIS, 1283.05f, -765.878f, 50.8297f, -3.13286f}, // Horde Keep Portcullis
+1 -1
View File
@@ -6248,7 +6248,7 @@ void Player::UpdateWeaponSkill(WeaponAttackType attType)
Item* tmpitem = GetWeaponForAttack(attType, true);
if (!tmpitem && attType == BASE_ATTACK)
UpdateSkill(SKILL_UNARMED, weapon_skill_gain);
else if (tmpitem->GetTemplate()->SubClass != ITEM_SUBCLASS_WEAPON_FISHING_POLE)
else if (tmpitem && tmpitem->GetTemplate()->SubClass != ITEM_SUBCLASS_WEAPON_FISHING_POLE)
UpdateSkill(tmpitem->GetSkill(), weapon_skill_gain);
UpdateAllCritPercentages();