aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rwxr-xr-xsrc/server/authserver/Realms/RealmList.cpp16
-rwxr-xr-xsrc/server/authserver/Realms/RealmList.h5
-rw-r--r--src/server/game/Battlefield/BattlefieldHandler.cpp6
-rwxr-xr-xsrc/server/game/Entities/GameObject/GameObject.cpp2
-rwxr-xr-xsrc/server/game/Entities/Player/Player.cpp8
-rwxr-xr-xsrc/server/game/Entities/Player/Player.h2
-rwxr-xr-xsrc/server/game/Entities/Unit/Unit.cpp12
-rwxr-xr-xsrc/server/game/Entities/Unit/Unit.h2
-rwxr-xr-xsrc/server/game/Spells/Auras/SpellAuraEffects.cpp7
-rw-r--r--src/server/scripts/Northrend/icecrown.cpp373
-rw-r--r--src/server/worldserver/CMakeLists.txt1
-rw-r--r--src/tools/map_extractor/dbcfile.h2
-rw-r--r--src/tools/vmap4_extractor/adtfile.h10
-rw-r--r--src/tools/vmap4_extractor/model.h22
-rw-r--r--src/tools/vmap4_extractor/wdtfile.cpp2
-rw-r--r--src/tools/vmap4_extractor/wdtfile.h7
-rw-r--r--src/tools/vmap4_extractor/wmo.h35
17 files changed, 436 insertions, 76 deletions
diff --git a/src/server/authserver/Realms/RealmList.cpp b/src/server/authserver/Realms/RealmList.cpp
index 453efd5bf72..79df2b15605 100755
--- a/src/server/authserver/Realms/RealmList.cpp
+++ b/src/server/authserver/Realms/RealmList.cpp
@@ -31,7 +31,7 @@ void RealmList::Initialize(uint32 updateInterval)
UpdateRealms(true);
}
-void RealmList::UpdateRealm(uint32 ID, const std::string& name, const std::string& address, uint16 port, uint8 icon, RealmFlags flag, uint8 timezone, AccountTypes allowedSecurityLevel, float popu, uint32 build)
+void RealmList::UpdateRealm(uint32 ID, const std::string& name, ACE_INET_Addr const& address, uint8 icon, RealmFlags flag, uint8 timezone, AccountTypes allowedSecurityLevel, float popu, uint32 build)
{
// Create new if not exist or update existed
Realm& realm = m_realms[name];
@@ -45,9 +45,7 @@ void RealmList::UpdateRealm(uint32 ID, const std::string& name, const std::strin
realm.populationLevel = popu;
// Append port to IP address.
- std::ostringstream ss;
- ss << address << ':' << port;
- realm.address = ss.str();
+ address.addr_to_string(realm.address, ACE_MAX_FULLY_QUALIFIED_NAME_LEN + 16);
realm.gamebuild = build;
}
@@ -80,8 +78,8 @@ void RealmList::UpdateRealms(bool init)
{
Field* fields = result->Fetch();
uint32 realmId = fields[0].GetUInt32();
- const std::string& name = fields[1].GetString();
- const std::string& address = fields[2].GetString();
+ std::string name = fields[1].GetString();
+ std::string address = fields[2].GetString();
uint16 port = fields[3].GetUInt16();
uint8 icon = fields[4].GetUInt8();
RealmFlags flag = RealmFlags(fields[5].GetUInt8());
@@ -90,10 +88,12 @@ void RealmList::UpdateRealms(bool init)
float pop = fields[8].GetFloat();
uint32 build = fields[9].GetUInt32();
- UpdateRealm(realmId, name, address, port, icon, flag, timezone, (allowedSecurityLevel <= SEC_ADMINISTRATOR ? AccountTypes(allowedSecurityLevel) : SEC_ADMINISTRATOR), pop, build);
+ ACE_INET_Addr addr(port, address.c_str(), AF_INET);
+
+ UpdateRealm(realmId, name, addr, icon, flag, timezone, (allowedSecurityLevel <= SEC_ADMINISTRATOR ? AccountTypes(allowedSecurityLevel) : SEC_ADMINISTRATOR), pop, build);
if (init)
- sLog->outInfo(LOG_FILTER_AUTHSERVER, "Added realm \"%s\".", fields[1].GetCString());
+ sLog->outInfo(LOG_FILTER_AUTHSERVER, "Added realm \"%s\" at %s.", name.c_str(), m_realms[name].address);
}
while (result->NextRow());
}
diff --git a/src/server/authserver/Realms/RealmList.h b/src/server/authserver/Realms/RealmList.h
index c8407b0fea1..52482897ea4 100755
--- a/src/server/authserver/Realms/RealmList.h
+++ b/src/server/authserver/Realms/RealmList.h
@@ -21,6 +21,7 @@
#include <ace/Singleton.h>
#include <ace/Null_Mutex.h>
+#include <ace/INET_Addr.h>
#include "Common.h"
enum RealmFlags
@@ -39,7 +40,7 @@ enum RealmFlags
// Storage object for a realm
struct Realm
{
- std::string address;
+ char address[ACE_MAX_FULLY_QUALIFIED_NAME_LEN + 16];
std::string name;
uint8 icon;
RealmFlags flag;
@@ -71,7 +72,7 @@ public:
private:
void UpdateRealms(bool init=false);
- void UpdateRealm(uint32 ID, const std::string& name, const std::string& address, uint16 port, uint8 icon, RealmFlags flag, uint8 timezone, AccountTypes allowedSecurityLevel, float popu, uint32 build);
+ void UpdateRealm(uint32 ID, const std::string& name, ACE_INET_Addr const& address, uint8 icon, RealmFlags flag, uint8 timezone, AccountTypes allowedSecurityLevel, float popu, uint32 build);
RealmMap m_realms;
uint32 m_UpdateInterval;
diff --git a/src/server/game/Battlefield/BattlefieldHandler.cpp b/src/server/game/Battlefield/BattlefieldHandler.cpp
index a2d8cec3936..c4225551311 100644
--- a/src/server/game/Battlefield/BattlefieldHandler.cpp
+++ b/src/server/game/Battlefield/BattlefieldHandler.cpp
@@ -102,7 +102,7 @@ void WorldSession::HandleBfQueueInviteResponse(WorldPacket & recvData)
uint8 Accepted;
recvData >> BattleId >> Accepted;
- sLog->outError(LOG_FILTER_GENERAL, "HandleQueueInviteResponse: BattleID:%u Accepted:%u", BattleId, Accepted);
+ sLog->outDebug(LOG_FILTER_GENERAL, "HandleQueueInviteResponse: BattleID:%u Accepted:%u", BattleId, Accepted);
Battlefield* Bf = sBattlefieldMgr->GetBattlefieldByBattleId(BattleId);
if (!Bf)
return;
@@ -120,7 +120,7 @@ void WorldSession::HandleBfEntryInviteResponse(WorldPacket & recvData)
uint8 Accepted;
recvData >> BattleId >> Accepted;
- sLog->outError(LOG_FILTER_GENERAL, "HandleBattlefieldInviteResponse: BattleID:%u Accepted:%u", BattleId, Accepted);
+ sLog->outDebug(LOG_FILTER_GENERAL, "HandleBattlefieldInviteResponse: BattleID:%u Accepted:%u", BattleId, Accepted);
Battlefield* Bf = sBattlefieldMgr->GetBattlefieldByBattleId(BattleId);
if (!Bf)
return;
@@ -142,7 +142,7 @@ void WorldSession::HandleBfExitRequest(WorldPacket & recvData)
uint32 BattleId;
recvData >> BattleId;
- sLog->outError(LOG_FILTER_GENERAL, "HandleBfExitRequest: BattleID:%u ", BattleId);
+ sLog->outDebug(LOG_FILTER_GENERAL, "HandleBfExitRequest: BattleID:%u ", BattleId);
Battlefield* Bf = sBattlefieldMgr->GetBattlefieldByBattleId(BattleId);
if (!Bf)
return;
diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp
index bf27015e8e3..f72e36e2d30 100755
--- a/src/server/game/Entities/GameObject/GameObject.cpp
+++ b/src/server/game/Entities/GameObject/GameObject.cpp
@@ -118,7 +118,7 @@ void GameObject::RemoveFromOwner()
else if (IS_PET_GUID(ownerGUID))
ownerType = "pet";
- sLog->outFatal(LOG_FILTER_GENERAL, "Delete GameObject (GUID: %u Entry: %u SpellId %u LinkedGO %u) that lost references to owner (GUID %u Type '%s') GO list. Crash possible later.",
+ sLog->outFatal(LOG_FILTER_GENERAL, "Removed GameObject (GUID: %u Entry: %u SpellId: %u LinkedGO: %u) that just lost any reference to the owner (GUID: %u Type: '%s') GO list",
GetGUIDLow(), GetGOInfo()->entry, m_spellId, GetGOInfo()->GetLinkedGameObjectEntry(), GUID_LOPART(ownerGUID), ownerType);
SetOwnerGUID(0);
}
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp
index 85f12812014..99795193b85 100755
--- a/src/server/game/Entities/Player/Player.cpp
+++ b/src/server/game/Entities/Player/Player.cpp
@@ -25560,14 +25560,6 @@ bool Player::IsInWhisperWhiteList(uint64 guid)
return false;
}
-bool Player::SetHover(bool enable)
-{
- if (!Unit::SetHover(enable))
- return false;
-
- return true;
-}
-
void Player::SendMovementSetCanFly(bool apply)
{
WorldPacket data(apply ? SMSG_MOVE_SET_CAN_FLY : SMSG_MOVE_UNSET_CAN_FLY, 12);
diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h
index 3e4b3e8a971..4cd90f27875 100755
--- a/src/server/game/Entities/Player/Player.h
+++ b/src/server/game/Entities/Player/Player.h
@@ -2279,8 +2279,6 @@ class Player : public Unit, public GridObject<Player>
m_mover->m_movedPlayer = this;
}
- bool SetHover(bool enable);
-
void SetSeer(WorldObject* target) { m_seer = target; }
void SetViewpoint(WorldObject* target, bool apply);
WorldObject* GetViewpoint() const;
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp
index ab2c07e1925..686b944d967 100755
--- a/src/server/game/Entities/Unit/Unit.cpp
+++ b/src/server/game/Entities/Unit/Unit.cpp
@@ -7545,12 +7545,18 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
// Unholy Blight
if (dummySpell->Id == 49194)
{
+ triggered_spell_id = 50536;
+ SpellInfo const* unholyBlight = sSpellMgr->GetSpellInfo(triggered_spell_id);
+ if (!unholyBlight)
+ return false;
+
basepoints0 = CalculatePct(int32(damage), triggerAmount);
- // Glyph of Unholy Blight
+
+ //Glyph of Unholy Blight
if (AuraEffect* glyph=GetAuraEffect(63332, 0))
AddPct(basepoints0, glyph->GetAmount());
-
- triggered_spell_id = 50536;
+
+ basepoints0 = basepoints0 / (unholyBlight->GetMaxDuration() / unholyBlight->Effects[0].Amplitude);
basepoints0 += victim->GetRemainingPeriodicAmount(GetGUID(), triggered_spell_id, SPELL_AURA_PERIODIC_DAMAGE);
break;
}
diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h
index 1f999477f9a..7b2308c2a51 100755
--- a/src/server/game/Entities/Unit/Unit.h
+++ b/src/server/game/Entities/Unit/Unit.h
@@ -1618,7 +1618,7 @@ class Unit : public WorldObject
bool IsWalking() const { return m_movementInfo.HasMovementFlag(MOVEMENTFLAG_WALKING);}
virtual bool SetWalk(bool enable);
virtual bool SetDisableGravity(bool disable, bool packetOnly = false);
- bool SetHover(bool enable);
+ virtual bool SetHover(bool enable);
void SetInFront(Unit const* target);
void SetFacingTo(float ori);
diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
index b29f1498152..24bc9540ab7 100755
--- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp
+++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
@@ -658,13 +658,6 @@ int32 AuraEffect::CalculateAmount(Unit* caster)
AddPct(amount, m_spellInfo->Effects[EFFECT_2].CalcValue(caster));
}
}
- // Unholy Blight damage over time effect
- else if (GetId() == 50536)
- {
- m_canBeRecalculated = false;
- // we're getting total damage on aura apply, change it to be damage per tick
- amount = int32((float)amount / GetTotalTicks());
- }
break;
case SPELL_AURA_PERIODIC_ENERGIZE:
switch (m_spellInfo->Id)
diff --git a/src/server/scripts/Northrend/icecrown.cpp b/src/server/scripts/Northrend/icecrown.cpp
index 030df23028c..dc450a8fea4 100644
--- a/src/server/scripts/Northrend/icecrown.cpp
+++ b/src/server/scripts/Northrend/icecrown.cpp
@@ -494,6 +494,378 @@ class npc_tournament_training_dummy : public CreatureScript
};
+// Battle for Crusaders' Pinnacle
+enum BlessedBanner
+{
+ SPELL_BLESSING_OF_THE_CRUSADE = 58026,
+ SPELL_THREAT_PULSE = 58113,
+ SPELL_CRUSADERS_SPIRE_VICTORY = 58084,
+ SPELL_TORCH = 58121,
+
+ NPC_BLESSED_BANNER = 30891,
+ NPC_CRUSADER_LORD_DALFORS = 31003,
+ NPC_ARGENT_BATTLE_PRIEST = 30919,
+ NPC_ARGENT_MASON = 30900,
+ NPC_REANIMATED_CAPTAIN = 30986,
+ NPC_SCOURGE_DRUDGE = 30984,
+ NPC_HIDEOUS_PLAGEBRINGER = 30987,
+ NPC_HALOF_THE_DEATHBRINGER = 30989,
+ NPC_LK = 31013,
+
+ BANNER_SAY = 0, // "The Blessed Banner of the Crusade has been planted.\n Defend the banner from all attackers!"
+ DALFORS_SAY_PRE_1 = 0, // "BY THE LIGHT! Those damned monsters! Look at what they've done to our people!"
+ DALFORS_SAY_PRE_2 = 1, // "Burn it down, boys. Burn it all down."
+ DALFORS_SAY_START = 2, // "Let 'em come. They'll pay for what they've done!"
+ DALFORS_YELL_FINISHED = 3, // "We've done it, lads! We've taken the pinnacle from the Scourge! Report to Father Gustav at once and tell him the good news! We're gonna get to buildin' and settin' up! Go!"
+ LK_TALK_1 = 0, // "Leave no survivors!"
+ LK_TALK_2 = 1, // "Cower before my terrible creations!"
+ LK_TALK_3 = 2, // "Feast my children! Feast upon the flesh of the living!"
+ LK_TALK_4 = 3, // "Lay down your arms and surrender your souls!"
+
+ EVENT_SPAWN = 1,
+ EVENT_INTRO_1 = 2,
+ EVENT_INTRO_2 = 3,
+ EVENT_INTRO_3 = 4,
+ EVENT_MASON_ACTION = 5,
+ EVENT_START_FIGHT = 6,
+ EVENT_WAVE_SPAWN = 7,
+ EVENT_HALOF = 8,
+ EVENT_ENDED = 9,
+};
+
+Position const DalforsPos[3] =
+{
+ {6458.703f, 403.858f, 490.498f, 3.1205f}, // Dalfors spawn point
+ {6422.950f, 423.335f, 510.451f, 0.0f}, // Dalfors intro pos
+ {6426.343f, 420.515f, 508.650f, 0.0f}, // Dalfors fight pos
+};
+
+Position const Priest1Pos[2] =
+{
+ {6462.025f, 403.681f, 489.721f, 3.1007f}, // priest1 spawn point
+ {6421.480f, 423.576f, 510.781f, 5.7421f}, // priest1 intro pos
+};
+
+Position const Priest2Pos[2] =
+{
+ {6463.969f, 407.198f, 489.240f, 2.2689f}, // priest2 spawn point
+ {6419.778f, 421.404f, 510.972f, 5.7421f}, // priest2 intro pos
+};
+
+Position const Priest3Pos[2] =
+{
+ {6464.371f, 400.944f, 489.186f, 6.1610f}, // priest3 spawn point
+ {6423.516f, 425.782f, 510.774f, 5.7421f}, // priest3 intro pos
+};
+
+Position const Mason1Pos[3] =
+{
+ {6462.929f, 409.826f, 489.392f, 3.0968f}, // mason1 spawn point
+ {6428.163f, 421.960f, 508.297f, 0.0f}, // mason1 intro pos
+ {6414.335f, 454.904f, 511.395f, 2.8972f}, // mason1 action pos
+};
+
+Position const Mason2Pos[3] =
+{
+ {6462.650f, 405.670f, 489.576f, 2.9414f}, // mason2 spawn point
+ {6426.250f, 419.194f, 508.219f, 0.0f}, // mason2 intro pos
+ {6415.014f, 446.849f, 511.395f, 3.1241f}, // mason2 action pos
+};
+
+Position const Mason3Pos[3] =
+{
+ {6462.646f, 401.218f, 489.601f, 2.7864f}, // mason3 spawn point
+ {6423.855f, 416.598f, 508.305f, 0.0f}, // mason3 intro pos
+ {6417.070f, 438.824f, 511.395f, 3.6651f}, // mason3 action pos
+};
+
+class npc_blessed_banner : public CreatureScript
+{
+public:
+ npc_blessed_banner() : CreatureScript("npc_blessed_banner") { }
+
+ struct npc_blessed_bannerAI : public Scripted_NoMovementAI
+ {
+ npc_blessed_bannerAI(Creature* creature) : Scripted_NoMovementAI(creature) , Summons(me)
+ {
+ HalofSpawned = false;
+ PhaseCount = 0;
+ Summons.DespawnAll();
+ }
+
+ EventMap events;
+
+ bool HalofSpawned;
+
+ uint32 PhaseCount;
+
+ SummonList Summons;
+
+ uint64 guidDalfors;
+ uint64 guidPriest[3];
+ uint64 guidMason[3];
+ uint64 guidHalof;
+
+ void Reset()
+ {
+ me->setRegeneratingHealth(false);
+ DoCast(SPELL_THREAT_PULSE);
+ me->AI()->Talk(BANNER_SAY);
+ events.ScheduleEvent(EVENT_SPAWN,3000);
+ }
+
+ void EnterCombat(Unit* /*who*/) {}
+
+ void MoveInLineOfSight(Unit* /*who*/) {}
+
+ void JustSummoned(Creature* Summoned)
+ {
+ Summons.Summon(Summoned);
+ }
+
+ void JustDied(Unit* /*killer*/)
+ {
+ Summons.DespawnAll();
+ me->DespawnOrUnsummon();
+ }
+
+ void UpdateAI(uint32 const diff)
+ {
+ events.Update(diff);
+
+ switch (events.ExecuteEvent())
+ {
+ case EVENT_SPAWN:
+ {
+ if (Creature* Dalfors = DoSummon(NPC_CRUSADER_LORD_DALFORS, DalforsPos[0]))
+ {
+ guidDalfors = Dalfors->GetGUID();
+ Dalfors->GetMotionMaster()->MovePoint(0, DalforsPos[1]);
+ }
+ if (Creature* Priest1 = DoSummon(NPC_ARGENT_BATTLE_PRIEST, Priest1Pos[0]))
+ {
+ guidPriest[0] = Priest1->GetGUID();
+ Priest1->GetMotionMaster()->MovePoint(0, Priest1Pos[1]);
+ }
+ if (Creature* Priest2 = DoSummon(NPC_ARGENT_BATTLE_PRIEST, Priest2Pos[0]))
+ {
+ guidPriest[1] = Priest2->GetGUID();
+ Priest2->GetMotionMaster()->MovePoint(0, Priest2Pos[1]);
+ }
+ if (Creature* Priest3 = DoSummon(NPC_ARGENT_BATTLE_PRIEST, Priest3Pos[0]))
+ {
+ guidPriest[2] = Priest3->GetGUID();
+ Priest3->GetMotionMaster()->MovePoint(0, Priest3Pos[1]);
+ }
+ if (Creature* Mason1 = DoSummon(NPC_ARGENT_MASON, Mason1Pos[0]))
+ {
+ guidMason[0] = Mason1->GetGUID();
+ Mason1->GetMotionMaster()->MovePoint(0, Mason1Pos[1]);
+ }
+ if (Creature* Mason2 = DoSummon(NPC_ARGENT_MASON, Mason2Pos[0]))
+ {
+ guidMason[1] = Mason2->GetGUID();
+ Mason2->GetMotionMaster()->MovePoint(0, Mason2Pos[1]);
+ }
+ if (Creature* Mason3 = DoSummon(NPC_ARGENT_MASON, Mason3Pos[0]))
+ {
+ guidMason[2] = Mason3->GetGUID();
+ Mason3->GetMotionMaster()->MovePoint(0, Mason3Pos[1]);
+ }
+ events.ScheduleEvent(EVENT_INTRO_1,15000);
+ }
+ break;
+ case EVENT_INTRO_1:
+ {
+ if (Creature* Dalfors = me->GetCreature(*me,guidDalfors))
+ Dalfors->AI()->Talk(DALFORS_SAY_PRE_1);
+ events.ScheduleEvent(EVENT_INTRO_2,5000);
+ }
+ break;
+ case EVENT_INTRO_2:
+ {
+ if (Creature* Dalfors = me->GetCreature(*me,guidDalfors))
+ {
+ Dalfors->SetFacingTo(6.215f);
+ Dalfors->AI()->Talk(DALFORS_SAY_PRE_2);
+ }
+ events.ScheduleEvent(EVENT_INTRO_3,5000);
+ }
+ break;
+ case EVENT_INTRO_3:
+ {
+ if (Creature* Dalfors = me->GetCreature(*me,guidDalfors))
+ {
+ Dalfors->GetMotionMaster()->MovePoint(0, DalforsPos[2]);
+ Dalfors->SetHomePosition(DalforsPos[2]);
+ }
+ if (Creature* Priest1 = me->GetCreature(*me,guidPriest[0]))
+ {
+ Priest1->SetFacingTo(5.7421f);
+ Priest1->SetHomePosition(Priest1Pos[1]);
+ }
+ if (Creature* Priest2 = me->GetCreature(*me,guidPriest[1]))
+ {
+ Priest2->SetFacingTo(5.7421f);
+ Priest2->SetHomePosition(Priest2Pos[1]);
+ }
+ if (Creature* Priest3 = me->GetCreature(*me,guidPriest[2]))
+ {
+ Priest3->SetFacingTo(5.7421f);
+ Priest3->SetHomePosition(Priest3Pos[1]);
+ }
+ if (Creature* Mason1 = me->GetCreature(*me,guidMason[0]))
+ {
+ Mason1->GetMotionMaster()->MovePoint(0, Mason1Pos[2]);
+ Mason1->SetHomePosition(Mason1Pos[2]);
+ }
+ if (Creature* Mason2 = me->GetCreature(*me,guidMason[1]))
+ {
+ Mason2->GetMotionMaster()->MovePoint(0, Mason2Pos[2]);
+ Mason2->SetHomePosition(Mason2Pos[2]);
+ }
+ if (Creature* Mason3 = me->GetCreature(*me,guidMason[2]))
+ {
+ Mason3->GetMotionMaster()->MovePoint(0, Mason3Pos[2]);
+ Mason3->SetHomePosition(Mason3Pos[2]);
+ }
+ events.ScheduleEvent(EVENT_START_FIGHT,5000);
+ events.ScheduleEvent(EVENT_MASON_ACTION,15000);
+ }
+ break;
+ case EVENT_MASON_ACTION:
+ {
+ if (Creature* Mason1 = me->GetCreature(*me,guidMason[0]))
+ {
+ Mason1->SetFacingTo(2.8972f);
+ Mason1->AI()->SetData(1,1); // triggers SAI actions on npc
+ }
+ if (Creature* Mason2 = me->GetCreature(*me,guidMason[1]))
+ {
+ Mason2->SetFacingTo(3.1241f);
+ Mason2->AI()->SetData(1,1); // triggers SAI actions on npc
+ }
+ if (Creature* Mason3 = me->GetCreature(*me,guidMason[2]))
+ {
+ Mason3->SetFacingTo(3.6651f);
+ Mason3->AI()->SetData(1,1); // triggers SAI actions on npc
+ }
+ }
+ break;
+ case EVENT_START_FIGHT:
+ {
+ if(Creature* LK = GetClosestCreatureWithEntry(me,NPC_LK,100))
+ LK->AI()->Talk(LK_TALK_1);
+ if (Creature* Dalfors = me->GetCreature(*me,guidDalfors))
+ Dalfors->AI()->Talk(DALFORS_SAY_START);
+ events.ScheduleEvent(EVENT_WAVE_SPAWN,1000);
+ }
+ break;
+ case EVENT_WAVE_SPAWN:
+ {
+ if (PhaseCount == 3)
+ {
+ if (Creature* LK = GetClosestCreatureWithEntry(me,NPC_LK,100))
+ LK->AI()->Talk(LK_TALK_2);
+ }
+ else if (PhaseCount == 6)
+ {
+ if (Creature* LK = GetClosestCreatureWithEntry(me,NPC_LK,100))
+ LK->AI()->Talk(LK_TALK_3);
+ }
+ if (Creature* tempsum = DoSummon(NPC_SCOURGE_DRUDGE,Mason3Pos[0]))
+ {
+ tempsum->SetHomePosition(DalforsPos[2]);
+ tempsum->AI()->AttackStart(GetClosestCreatureWithEntry(me,NPC_BLESSED_BANNER,100));
+ }
+ if (urand(0,1) == 0)
+ {
+ if (Creature* tempsum = DoSummon(NPC_HIDEOUS_PLAGEBRINGER,Mason1Pos[0]))
+ {
+ tempsum->SetHomePosition(DalforsPos[2]);
+ tempsum->AI()->AttackStart(GetClosestCreatureWithEntry(me,NPC_BLESSED_BANNER,100));
+ }
+ if (Creature* tempsum = DoSummon(NPC_HIDEOUS_PLAGEBRINGER,Mason2Pos[0]))
+ {
+ tempsum->SetHomePosition(DalforsPos[2]);
+ tempsum->AI()->AttackStart(GetClosestCreatureWithEntry(me,NPC_BLESSED_BANNER,100));
+ }
+ }
+ else
+ {
+ if (Creature* tempsum = DoSummon(NPC_REANIMATED_CAPTAIN,Mason1Pos[0]))
+ {
+ tempsum->SetHomePosition(DalforsPos[2]);
+ tempsum->AI()->AttackStart(GetClosestCreatureWithEntry(me,NPC_BLESSED_BANNER,100));
+ }
+ if (Creature* tempsum = DoSummon(NPC_REANIMATED_CAPTAIN,Mason2Pos[0]))
+ {
+ tempsum->SetHomePosition(DalforsPos[2]);
+ tempsum->AI()->AttackStart(GetClosestCreatureWithEntry(me,NPC_BLESSED_BANNER,100));
+ }
+ }
+
+ PhaseCount++;
+
+ if (PhaseCount < 8)
+ events.ScheduleEvent(EVENT_WAVE_SPAWN,urand(10000,20000));
+ else
+ events.ScheduleEvent(EVENT_HALOF,urand(10000,20000));
+ }
+ break;
+ case EVENT_HALOF:
+ {
+ if (Creature* LK = GetClosestCreatureWithEntry(me,NPC_LK,100))
+ LK->AI()->Talk(LK_TALK_4);
+ if (Creature* tempsum = DoSummon(NPC_SCOURGE_DRUDGE,Mason1Pos[0]))
+ {
+ tempsum->SetHomePosition(DalforsPos[2]);
+ tempsum->AI()->AttackStart(GetClosestCreatureWithEntry(me,NPC_BLESSED_BANNER,100));
+ }
+ if (Creature* tempsum = DoSummon(NPC_SCOURGE_DRUDGE,Mason2Pos[0]))
+ {
+ tempsum->SetHomePosition(DalforsPos[2]);
+ tempsum->AI()->AttackStart(GetClosestCreatureWithEntry(me,NPC_BLESSED_BANNER,100));
+ }
+ if (Creature* tempsum = DoSummon(NPC_HALOF_THE_DEATHBRINGER,DalforsPos[0]))
+ {
+ HalofSpawned = true;
+ guidHalof = tempsum->GetGUID();
+ tempsum->SetHomePosition(DalforsPos[2]);
+ tempsum->AI()->AttackStart(GetClosestCreatureWithEntry(me,NPC_BLESSED_BANNER,100));
+ }
+ }
+ break;
+ case EVENT_ENDED:
+ {
+ Summons.DespawnAll();
+ me->DespawnOrUnsummon();
+ }
+ break;
+ }
+
+ if (PhaseCount == 8)
+ if (Creature* Halof = me->GetCreature(*me,guidHalof))
+ if (Halof->isDead())
+ {
+ DoCast(me,SPELL_CRUSADERS_SPIRE_VICTORY,true);
+ Summons.DespawnEntry(NPC_HIDEOUS_PLAGEBRINGER);
+ Summons.DespawnEntry(NPC_REANIMATED_CAPTAIN);
+ Summons.DespawnEntry(NPC_SCOURGE_DRUDGE);
+ Summons.DespawnEntry(NPC_HALOF_THE_DEATHBRINGER);
+ if (Creature* Dalfors = me->GetCreature(*me,guidDalfors))
+ Dalfors->AI()->Talk(DALFORS_YELL_FINISHED);
+ events.ScheduleEvent(EVENT_ENDED,10000);
+ }
+ }
+ };
+
+ CreatureAI *GetAI(Creature *creature) const
+ {
+ return new npc_blessed_bannerAI(creature);
+ }
+};
+
void AddSC_icecrown()
{
new npc_arete;
@@ -502,4 +874,5 @@ void AddSC_icecrown()
new npc_guardian_pavilion;
new npc_vereth_the_cunning;
new npc_tournament_training_dummy;
+ new npc_blessed_banner();
}
diff --git a/src/server/worldserver/CMakeLists.txt b/src/server/worldserver/CMakeLists.txt
index 58167aad703..556edb5a2c7 100644
--- a/src/server/worldserver/CMakeLists.txt
+++ b/src/server/worldserver/CMakeLists.txt
@@ -150,7 +150,6 @@ endif()
add_dependencies(worldserver revision.h)
-
if( UNIX AND NOT NOJEM )
set(worldserver_LINK_FLAGS "-pthread -lncurses ${worldserver_LINK_FLAGS}")
endif()
diff --git a/src/tools/map_extractor/dbcfile.h b/src/tools/map_extractor/dbcfile.h
index aef61df7aaa..6862678a73b 100644
--- a/src/tools/map_extractor/dbcfile.h
+++ b/src/tools/map_extractor/dbcfile.h
@@ -59,8 +59,8 @@ public:
}
private:
Record(DBCFile &file, unsigned char *offset): file(file), offset(offset) {}
- unsigned char *offset;
DBCFile &file;
+ unsigned char *offset;
friend class DBCFile;
friend class DBCFile::Iterator;
diff --git a/src/tools/vmap4_extractor/adtfile.h b/src/tools/vmap4_extractor/adtfile.h
index 08814996f68..3de1dccfacd 100644
--- a/src/tools/vmap4_extractor/adtfile.h
+++ b/src/tools/vmap4_extractor/adtfile.h
@@ -109,6 +109,11 @@ struct MapChunkHeader
class ADTFile
{
+private:
+ //size_t mcnk_offsets[256], mcnk_sizes[256];
+ MPQFile ADT;
+ //mcell Mcell;
+ string Adtfilename;
public:
ADTFile(char* filename);
~ADTFile();
@@ -126,11 +131,6 @@ public:
return Mcell;
}
*/
-private:
- //size_t mcnk_offsets[256], mcnk_sizes[256];
- MPQFile ADT;
- //mcell Mcell;
- string Adtfilename;
};
const char * GetPlainName(const char * FileName);
diff --git a/src/tools/vmap4_extractor/model.h b/src/tools/vmap4_extractor/model.h
index 7dd69212b54..bf15d813ce8 100644
--- a/src/tools/vmap4_extractor/model.h
+++ b/src/tools/vmap4_extractor/model.h
@@ -30,6 +30,15 @@ Vec3D fixCoordSystem(Vec3D v);
class Model
{
+private:
+ void _unload()
+ {
+ delete[] vertices;
+ delete[] indices;
+ vertices = NULL;
+ indices = NULL;
+ }
+ std::string filename;
public:
ModelHeader header;
Vec3D* vertices;
@@ -40,17 +49,6 @@ public:
Model(std::string& filename);
~Model() { _unload(); }
-
-private:
- void _unload()
- {
- delete[] vertices;
- delete[] indices;
- vertices = NULL;
- indices = NULL;
- }
-
- std::string filename;
};
class ModelInstance
@@ -63,7 +61,7 @@ public:
unsigned int d1, scale;
float w, sc;
- ModelInstance() : model(NULL), d1(0), scale(0), w(0.0f), sc(0.0f), id(0) {}
+ ModelInstance() : model(NULL), id(0), d1(0), scale(0), w(0.0f), sc(0.0f) {}
ModelInstance(MPQFile& f, char const* ModelInstName, uint32 mapID, uint32 tileX, uint32 tileY, FILE* pDirfile);
};
diff --git a/src/tools/vmap4_extractor/wdtfile.cpp b/src/tools/vmap4_extractor/wdtfile.cpp
index a799a928710..7420edfee2e 100644
--- a/src/tools/vmap4_extractor/wdtfile.cpp
+++ b/src/tools/vmap4_extractor/wdtfile.cpp
@@ -35,7 +35,7 @@ WDTFile::WDTFile(char* file_name, char* file_name1) : WDT(file_name), gWmoInstan
filename.append(file_name1,strlen(file_name1));
}
-bool WDTFile::init(char *map_id, unsigned int mapID)
+bool WDTFile::init(char */*map_id*/, unsigned int mapID)
{
if (WDT.isEof())
{
diff --git a/src/tools/vmap4_extractor/wdtfile.h b/src/tools/vmap4_extractor/wdtfile.h
index 2c66dbceb92..5d6aed8f0bc 100644
--- a/src/tools/vmap4_extractor/wdtfile.h
+++ b/src/tools/vmap4_extractor/wdtfile.h
@@ -10,6 +10,9 @@ class ADTFile;
class WDTFile
{
+private:
+ MPQFile WDT;
+ string filename;
public:
WDTFile(char* file_name, char* file_name1);
~WDTFile(void);
@@ -19,10 +22,6 @@ public:
int gnWMO;
ADTFile* GetMap(int x, int z);
-
-private:
- MPQFile WDT;
- string filename;
};
#endif
diff --git a/src/tools/vmap4_extractor/wmo.h b/src/tools/vmap4_extractor/wmo.h
index 74e666d3f82..d0333265851 100644
--- a/src/tools/vmap4_extractor/wmo.h
+++ b/src/tools/vmap4_extractor/wmo.h
@@ -44,9 +44,11 @@ static inline Vec3D fixCoords(const Vec3D &v){ return Vec3D(v.z, v.x, v.y); }
class WMORoot
{
+private:
+ std::string filename;
public:
- uint32 nTextures, nGroups, nP, nLights, nModels, nDoodads, nDoodadSets, RootWMOID, liquidType;
unsigned int col;
+ uint32 nTextures, nGroups, nP, nLights, nModels, nDoodads, nDoodadSets, RootWMOID, liquidType;
float bbcorn1[3];
float bbcorn2[3];
@@ -55,8 +57,6 @@ public:
bool open();
bool ConvertToVMAPRootWmo(FILE* output);
-private:
- std::string filename;
};
struct WMOLiquidHeader
@@ -77,9 +77,22 @@ struct WMOLiquidVert
class WMOGroup
{
+private:
+ std::string filename;
public:
// MOGP
- int groupName, descGroupName, mogpFlags;
+
+ char* MOPY;
+ uint16* MOVI;
+ uint16* MoviEx;
+ float* MOVT;
+ uint16* MOBA;
+ int* MobaEx;
+ WMOLiquidHeader* hlq;
+ WMOLiquidVert* LiquEx;
+ char* LiquBytes;
+ int groupName, descGroupName;
+ int mogpFlags;
float bbcorn1[3];
float bbcorn2[3];
uint16 moprIdx;
@@ -92,15 +105,6 @@ public:
int LiquEx_size;
unsigned int nVertices; // number when loaded
int nTriangles; // number when loaded
- char* MOPY;
- uint16* MOVI;
- uint16* MoviEx;
- float* MOVT;
- uint16* MOBA;
- int* MobaEx;
- WMOLiquidHeader* hlq;
- WMOLiquidVert* LiquEx;
- char* LiquBytes;
uint32 liquflags;
WMOGroup(std::string const& filename);
@@ -108,9 +112,6 @@ public:
bool open();
int ConvertToVMAPGroupWmo(FILE* output, WMORoot* rootWMO, bool preciseVectorData);
-
-private:
- std::string filename;
};
class WMOInstance
@@ -121,10 +122,10 @@ public:
int currx;
int curry;
WMOGroup* wmo;
+ int doodadset;
Vec3D pos;
Vec3D pos2, pos3, rot;
uint32 indx, id, d2, d3;
- int doodadset;
WMOInstance(MPQFile&f , char const* WmoInstName, uint32 mapID, uint32 tileX, uint32 tileY, FILE* pDirfile);