aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts/EasternKingdoms
diff options
context:
space:
mode:
authorSubv <s.v.h21@hotmail.com>2012-08-12 13:18:19 -0500
committerSubv <s.v.h21@hotmail.com>2012-08-12 13:18:19 -0500
commit61fcae113b92053388433c2a98e0ec7f3c360acd (patch)
tree10f3da98a5f8dd7056fc28a4edb6bd1cda0c30e8 /src/server/scripts/EasternKingdoms
parent75af5ac3535e8726a03f9575357f44f3981989a0 (diff)
parentf92946e128ed44de21c97900b0a935c7c55fcd65 (diff)
Merge branch 'master' of github.com:TrinityCore/TrinityCore into 4.3.4
Conflicts: src/server/scripts/Kalimdor/moonglade.cpp
Diffstat (limited to 'src/server/scripts/EasternKingdoms')
-rw-r--r--src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp22
-rw-r--r--src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/SunwellPlateau/instance_sunwell_plateau.cpp11
-rw-r--r--src/server/scripts/EasternKingdoms/ZulAman/instance_zulaman.cpp9
4 files changed, 18 insertions, 28 deletions
diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp
index bc29a6f1f3c..06c1243645c 100644
--- a/src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp
+++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp
@@ -75,8 +75,8 @@ public:
{
boss_moroesAI(Creature* creature) : ScriptedAI(creature)
{
- for (uint8 i = 0; i < 4; ++i)
- AddId[i] = 0;
+ memset(AddId, 0, sizeof(AddId));
+ memset(AddGUID, 0, sizeof(AddGUID));
instance = creature->GetInstanceScript();
}
@@ -105,10 +105,8 @@ public:
Enrage = false;
InVanish = false;
- if (me->GetHealth() > 0)
- {
+ if (me->GetHealth())
SpawnAdds();
- }
if (instance)
instance->SetData(TYPE_MOROES, NOT_STARTED);
@@ -193,10 +191,9 @@ public:
bool isAddlistEmpty()
{
for (uint8 i = 0; i < 4; ++i)
- {
if (AddId[i] == 0)
return true;
- }
+
return false;
}
@@ -341,17 +338,10 @@ struct boss_moroes_guestAI : public ScriptedAI
if (!instance)
return;
- uint64 MoroesGUID = instance->GetData64(DATA_MOROES);
- Creature* Moroes = (Unit::GetCreature((*me), MoroesGUID));
- if (Moroes)
- {
+ if (Creature* Moroes = Unit::GetCreature(*me, instance->GetData64(DATA_MOROES)))
for (uint8 i = 0; i < 4; ++i)
- {
- uint64 GUID = CAST_AI(boss_moroes::boss_moroesAI, Moroes->AI())->AddGUID[i];
- if (GUID)
+ if (uint64 GUID = CAST_AI(boss_moroes::boss_moroesAI, Moroes->AI())->AddGUID[i])
GuestGUID[i] = GUID;
- }
- }
}
Unit* SelectGuestTarget()
diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp
index 1ed4da1f25e..d5add0f0bb7 100644
--- a/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp
+++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp
@@ -187,6 +187,7 @@ public:
boss_malchezaarAI(Creature* creature) : ScriptedAI(creature)
{
instance = creature->GetInstanceScript();
+ memset(axes, 0, sizeof(axes));
}
InstanceScript* instance;
@@ -218,7 +219,10 @@ public:
positions.clear();
for (uint8 i = 0; i < 5; ++i)
+ {
enfeeble_targets[i] = 0;
+ enfeeble_health[i] = 0;
+ }
for (uint8 i = 0; i < TOTAL_INFERNAL_POINTS; ++i)
positions.push_back(&InfernalPoints[i]);
diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/instance_sunwell_plateau.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/instance_sunwell_plateau.cpp
index 68b3bdb9b7e..6324c5adf16 100644
--- a/src/server/scripts/EasternKingdoms/SunwellPlateau/instance_sunwell_plateau.cpp
+++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/instance_sunwell_plateau.cpp
@@ -276,14 +276,9 @@ public:
std::ostringstream stream;
stream << m_auiEncounter[0] << ' ' << m_auiEncounter[1] << ' ' << m_auiEncounter[2] << ' ' << m_auiEncounter[3] << ' '
<< m_auiEncounter[4] << ' ' << m_auiEncounter[5];
- char* out = new char[stream.str().length() + 1];
- strcpy(out, stream.str().c_str());
- if (out)
- {
- OUT_SAVE_INST_DATA_COMPLETE;
- return out;
- }
- return NULL;
+
+ OUT_SAVE_INST_DATA_COMPLETE;
+ return stream.str();
}
void Load(const char* in)
diff --git a/src/server/scripts/EasternKingdoms/ZulAman/instance_zulaman.cpp b/src/server/scripts/EasternKingdoms/ZulAman/instance_zulaman.cpp
index 305e3813ebc..235bec7cc8a 100644
--- a/src/server/scripts/EasternKingdoms/ZulAman/instance_zulaman.cpp
+++ b/src/server/scripts/EasternKingdoms/ZulAman/instance_zulaman.cpp
@@ -180,12 +180,13 @@ class instance_zulaman : public InstanceMapScript
std::string GetSaveData()
{
+ OUT_SAVE_INST_DATA;
+
std::ostringstream ss;
ss << "S " << BossKilled << ' ' << ChestLooted << ' ' << QuestMinute;
- char* data = new char[ss.str().length()+1];
- strcpy(data, ss.str().c_str());
- //sLog->outError(LOG_FILTER_TSCR, "Zul'aman saved, %s.", data);
- return data;
+
+ OUT_SAVE_INST_DATA_COMPLETE;
+ return ss.str();
}
void Load(const char* load)