diff --git a/README.mdown b/README.mdown
index 27f1940e..5f894db1 100644
--- a/README.mdown
+++ b/README.mdown
@@ -14,6 +14,16 @@ be a part of any redistributable packages made from this software. No licenses
should be removed from this software if you are making redistributable copies.
+Development
+-----------
+The **develop** branch is where the development of *scriptdev0* is done. Any
+of the commits submitted here may or may not become part of the next release.
+
+It is recommended to use the **master** branch for stable systems, and only use
+the **develop** branch if you intend to test commits and submit issues and/or
+reports.
+
+
Compatibility
-------------
The *scriptdev0* bindings are compatible with [mangos-zero revision 1765][10]
diff --git a/ScriptMgr.cpp b/ScriptMgr.cpp
index cc5377bf..5381af4d 100644
--- a/ScriptMgr.cpp
+++ b/ScriptMgr.cpp
@@ -148,7 +148,7 @@ void InitScriptLibrary()
/**
* Function that does script text
*
- * @param iTextEntry Entry of the text, stored in SD2-database
+ * @param iTextEntry Entry of the text, stored in SD0-database
* @param pSource Source of the text
* @param pTarget Can be NULL (depending on CHAT_TYPE of iTextEntry). Possible target for the text
*/
@@ -169,7 +169,6 @@ void DoScriptText(int32 iTextEntry, WorldObject* pSource, Unit* pTarget)
}
const StringTextData* pData = pSystemMgr.GetTextData(iTextEntry);
-
if (!pData)
{
error_log("SD0: DoScriptText with source entry %u (TypeId=%u, guid=%u) could not find text entry %i.",
@@ -184,7 +183,18 @@ void DoScriptText(int32 iTextEntry, WorldObject* pSource, Unit* pTarget)
if (pData->uiSoundId)
{
if (GetSoundEntriesStore()->LookupEntry(pData->uiSoundId))
- pSource->PlayDirectSound(pData->uiSoundId);
+ {
+ if (pData->uiType == CHAT_TYPE_ZONE_YELL)
+ pSource->GetMap()->PlayDirectSoundToMap(pData->uiSoundId, pSource->GetZoneId());
+ else if (pData->uiType == CHAT_TYPE_WHISPER || pData->uiType == CHAT_TYPE_BOSS_WHISPER)
+ {
+ // An error will be displayed for the text
+ if (pTarget && pTarget->GetTypeId() == TYPEID_PLAYER)
+ pSource->PlayDirectSound(pData->uiSoundId, (Player*)pTarget);
+ }
+ else
+ pSource->PlayDirectSound(pData->uiSoundId);
+ }
else
error_log("SD0: DoScriptText entry %i tried to process invalid sound id %u.", iTextEntry, pData->uiSoundId);
}
@@ -238,7 +248,7 @@ void DoScriptText(int32 iTextEntry, WorldObject* pSource, Unit* pTarget)
/**
* Function that either simulates or does script text for a map
*
- * @param iTextEntry Entry of the text, stored in SD2-database, only type CHAT_TYPE_ZONE_YELL supported
+ * @param iTextEntry Entry of the text, stored in SD0-database, only type CHAT_TYPE_ZONE_YELL supported
* @param uiCreatureEntry Id of the creature of whom saying will be simulated
* @param pMap Given Map on which the map-wide text is displayed
* @param pCreatureSource Can be NULL. If pointer to Creature is given, then the creature does the map-wide text
@@ -248,51 +258,51 @@ void DoOrSimulateScriptTextForMap(int32 iTextEntry, uint32 uiCreatureEntry, Map*
{
if (!pMap)
{
- error_log("SD2: DoOrSimulateScriptTextForMap entry %i, invalid Map pointer.", iTextEntry);
+ error_log("SD0: DoOrSimulateScriptTextForMap entry %i, invalid Map pointer.", iTextEntry);
return;
}
if (iTextEntry >= 0)
{
- error_log("SD2: DoOrSimulateScriptTextForMap with source entry %u for map %u attempts to process text entry %i, but text entry must be negative.", uiCreatureEntry, pMap->GetId(), iTextEntry);
+ error_log("SD0: DoOrSimulateScriptTextForMap with source entry %u for map %u attempts to process text entry %i, but text entry must be negative.", uiCreatureEntry, pMap->GetId(), iTextEntry);
return;
}
CreatureInfo const* pInfo = GetCreatureTemplateStore(uiCreatureEntry);
if (!pInfo)
{
- error_log("SD2: DoOrSimulateScriptTextForMap has invalid source entry %u for map %u.", uiCreatureEntry, pMap->GetId());
+ error_log("SD0: DoOrSimulateScriptTextForMap has invalid source entry %u for map %u.", uiCreatureEntry, pMap->GetId());
return;
}
const StringTextData* pData = pSystemMgr.GetTextData(iTextEntry);
-
if (!pData)
{
- error_log("SD2: DoOrSimulateScriptTextForMap with source entry %u for map %u could not find text entry %i.", uiCreatureEntry, pMap->GetId(), iTextEntry);
+ error_log("SD0: DoOrSimulateScriptTextForMap with source entry %u for map %u could not find text entry %i.", uiCreatureEntry, pMap->GetId(), iTextEntry);
return;
}
- debug_log("SD2: DoOrSimulateScriptTextForMap: text entry=%i, Sound=%u, Type=%u, Language=%u, Emote=%u",
+ debug_log("SD0: DoOrSimulateScriptTextForMap: text entry=%i, Sound=%u, Type=%u, Language=%u, Emote=%u",
iTextEntry, pData->uiSoundId, pData->uiType, pData->uiLanguage, pData->uiEmote);
+ if (pData->uiType != CHAT_TYPE_ZONE_YELL)
+ {
+ error_log("SD0: DoSimulateScriptTextForMap entry %i has not supported chat type %u.", iTextEntry, pData->uiType);
+ return;
+ }
+
if (pData->uiSoundId)
{
if (GetSoundEntriesStore()->LookupEntry(pData->uiSoundId))
pMap->PlayDirectSoundToMap(pData->uiSoundId);
else
- error_log("SD2: DoOrSimulateScriptTextForMap entry %i tried to process invalid sound id %u.", iTextEntry, pData->uiSoundId);
+ error_log("SD0: DoOrSimulateScriptTextForMap entry %i tried to process invalid sound id %u.", iTextEntry, pData->uiSoundId);
}
- if (pData->uiType == CHAT_TYPE_ZONE_YELL)
- {
- if (pCreatureSource) // If provided pointer for sayer, use direct version
- pMap->MonsterYellToMap(pCreatureSource->GetObjectGuid(), iTextEntry, pData->uiLanguage, pTarget);
- else // Simulate yell
- pMap->MonsterYellToMap(pInfo, iTextEntry, pData->uiLanguage, pTarget);
- }
- else
- error_log("SD2: DoSimulateScriptTextForMap entry %i has not supported chat type %u.", iTextEntry, pData->uiType);
+ if (pCreatureSource) // If provided pointer for sayer, use direct version
+ pMap->MonsterYellToMap(pCreatureSource->GetObjectGuid(), iTextEntry, pData->uiLanguage, pTarget);
+ else // Simulate yell
+ pMap->MonsterYellToMap(pInfo, iTextEntry, pData->uiLanguage, pTarget);
}
//*********************************
diff --git a/VC100/100ScriptDev0.vcxproj b/VC100/100ScriptDev0.vcxproj
index 49f2f766..bcdb0aa9 100644
--- a/VC100/100ScriptDev0.vcxproj
+++ b/VC100/100ScriptDev0.vcxproj
@@ -336,7 +336,6 @@
-
diff --git a/VC100/100ScriptDev0.vcxproj.filters b/VC100/100ScriptDev0.vcxproj.filters
index d82c8bd2..84ee321f 100644
--- a/VC100/100ScriptDev0.vcxproj.filters
+++ b/VC100/100ScriptDev0.vcxproj.filters
@@ -453,9 +453,6 @@
scripts\eastern_kingdoms\uldaman
-
- scripts\eastern_kingdoms\uldaman
-
scripts\eastern_kingdoms\uldaman
diff --git a/VC90/90ScriptDev0.vcproj b/VC90/90ScriptDev0.vcproj
index ac3595e3..372285a0 100644
--- a/VC90/90ScriptDev0.vcproj
+++ b/VC90/90ScriptDev0.vcproj
@@ -1302,10 +1302,6 @@
RelativePath="..\scripts\eastern_kingdoms\uldaman\boss_archaedas.cpp"
>
-
-
diff --git a/base/escort_ai.cpp b/base/escort_ai.cpp
index eaa4a17c..8d85138b 100644
--- a/base/escort_ai.cpp
+++ b/base/escort_ai.cpp
@@ -97,6 +97,9 @@ void npc_escortAI::AttackStart(Unit* pWho)
void npc_escortAI::EnterCombat(Unit* pEnemy)
{
+ // Store combat start position
+ m_creature->SetCombatStartPosition(m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ());
+
if (!pEnemy)
return;
@@ -234,10 +237,11 @@ void npc_escortAI::EnterEvadeMode()
if (HasEscortState(STATE_ESCORT_ESCORTING))
{
- debug_log("SD0: EscortAI has left combat and is now returning to CombatStartPosition.");
-
- if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == CHASE_MOTION_TYPE)
+ // We have left our path
+ if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() != POINT_MOTION_TYPE)
{
+ debug_log("SD0: EscortAI has left combat and is now returning to CombatStartPosition.");
+
AddEscortState(STATE_ESCORT_RETURNING);
float fPosX, fPosY, fPosZ;
@@ -400,12 +404,15 @@ void npc_escortAI::MovementInform(uint32 uiMoveType, uint32 uiPointId)
//Make sure that we are still on the right waypoint
if (CurrentWP->uiId != uiPointId)
{
- error_log("SD0: EscortAI reached waypoint out of order %u, expected %u.", uiPointId, CurrentWP->uiId);
+ error_log("SD0: EscortAI for Npc %u reached waypoint out of order %u, expected %u.", m_creature->GetEntry(), uiPointId, CurrentWP->uiId);
return;
}
debug_log("SD0: EscortAI waypoint %u reached.", CurrentWP->uiId);
+ // In case we were moving while in combat, we should evade back to this position
+ m_creature->SetCombatStartPosition(m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ());
+
//Call WP function
WaypointReached(CurrentWP->uiId);
diff --git a/include/sc_creature.cpp b/include/sc_creature.cpp
index 8061b982..67795a20 100644
--- a/include/sc_creature.cpp
+++ b/include/sc_creature.cpp
@@ -458,22 +458,22 @@ Player* ScriptedAI::GetPlayerAtMinimumRange(float fMinimumRange)
return pPlayer;
}
-void ScriptedAI::SetEquipmentSlots(bool bLoadDefault, int32 uiMainHand, int32 uiOffHand, int32 uiRanged)
+void ScriptedAI::SetEquipmentSlots(bool bLoadDefault, int32 iMainHand, int32 iOffHand, int32 iRanged)
{
if (bLoadDefault)
{
- m_creature->LoadEquipment(m_creature->GetCreatureInfo()->equipmentId,true);
+ m_creature->LoadEquipment(m_creature->GetCreatureInfo()->equipmentId, true);
return;
}
- if (uiMainHand >= 0)
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 0, uint32(uiMainHand));
+ if (iMainHand >= 0)
+ m_creature->SetVirtualItem(VIRTUAL_ITEM_SLOT_0, iMainHand);
- if (uiOffHand >= 0)
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1, uint32(uiOffHand));
+ if (iOffHand >= 0)
+ m_creature->SetVirtualItem(VIRTUAL_ITEM_SLOT_1, iOffHand);
- if (uiRanged >= 0)
- m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 2, uint32(uiRanged));
+ if (iRanged >= 0)
+ m_creature->SetVirtualItem(VIRTUAL_ITEM_SLOT_2, iRanged);
}
void ScriptedAI::SetCombatMovement(bool bCombatMove)
diff --git a/include/sc_creature.h b/include/sc_creature.h
index 03269d46..20d9c6a0 100644
--- a/include/sc_creature.h
+++ b/include/sc_creature.h
@@ -177,7 +177,7 @@ struct MANGOS_DLL_DECL ScriptedAI : public CreatureAI
//Checks if you can cast the specified spell
bool CanCast(Unit* pTarget, SpellEntry const* pSpell, bool bTriggered = false);
- void SetEquipmentSlots(bool bLoadDefault, int32 uiMainHand = EQUIP_NO_CHANGE, int32 uiOffHand = EQUIP_NO_CHANGE, int32 uiRanged = EQUIP_NO_CHANGE);
+ void SetEquipmentSlots(bool bLoadDefault, int32 iMainHand = EQUIP_NO_CHANGE, int32 iOffHand = EQUIP_NO_CHANGE, int32 iRanged = EQUIP_NO_CHANGE);
//Generally used to control if MoveChase() is to be used or not in AttackStart(). Some creatures does not chase victims
void SetCombatMovement(bool bCombatMove);
diff --git a/scripts/eastern_kingdoms/blackwing_lair/boss_flamegor.cpp b/scripts/eastern_kingdoms/blackwing_lair/boss_flamegor.cpp
index aa6c33f3..8e309606 100644
--- a/scripts/eastern_kingdoms/blackwing_lair/boss_flamegor.cpp
+++ b/scripts/eastern_kingdoms/blackwing_lair/boss_flamegor.cpp
@@ -19,8 +19,8 @@
/* ScriptData
SDName: Boss_Flamegor
-SD%Complete: 90
-SDComment: Thrash is missing
+SD%Complete: 100%
+SDComment:
SDCategory: Blackwing Lair
EndScriptData */
@@ -34,7 +34,7 @@ enum
SPELL_SHADOW_FLAME = 22539,
SPELL_WING_BUFFET = 23339,
SPELL_FRENZY = 23342, // This spell periodically triggers fire nova
- SPELL_THRASH = 3391, // TODO missing
+ SPELL_THRASH = 3391
};
struct MANGOS_DLL_DECL boss_flamegorAI : public ScriptedAI
@@ -50,12 +50,14 @@ struct MANGOS_DLL_DECL boss_flamegorAI : public ScriptedAI
uint32 m_uiShadowFlameTimer;
uint32 m_uiWingBuffetTimer;
uint32 m_uiFrenzyTimer;
+ uint32 m_uiThrashTimer;
void Reset()
{
m_uiShadowFlameTimer = 21000; // These times are probably wrong
m_uiWingBuffetTimer = 35000;
m_uiFrenzyTimer = 10000;
+ m_uiThrashTimer = 25000;
}
void Aggro(Unit* pWho)
@@ -115,6 +117,15 @@ struct MANGOS_DLL_DECL boss_flamegorAI : public ScriptedAI
}
else
m_uiFrenzyTimer -= uiDiff;
+
+ // Thrash Timer
+ if (m_uiThrashTimer < uiDiff)
+ {
+ if (DoCastSpellIfCan(m_creature, SPELL_THRASH) == CAST_OK)
+ m_uiThrashTimer = 20000;
+ }
+ else
+ m_uiThrashTimer -= uiDiff;
DoMeleeAttackIfReady();
}
diff --git a/scripts/eastern_kingdoms/deadmines/deadmines.cpp b/scripts/eastern_kingdoms/deadmines/deadmines.cpp
index 5c892ade..2b602c53 100644
--- a/scripts/eastern_kingdoms/deadmines/deadmines.cpp
+++ b/scripts/eastern_kingdoms/deadmines/deadmines.cpp
@@ -148,7 +148,7 @@ struct MANGOS_DLL_DECL boss_mr_smiteAI : public ScriptedAI
m_creature->SetStandState(UNIT_STAND_STATE_STAND);
m_uiPhase = PHASE_EQUIP_END;
- m_uiEquipTimer = 5000;
+ m_uiEquipTimer = 1000;
Unit* pVictim = m_creature->SelectAttackingTarget(ATTACKING_TARGET_TOPAGGRO, 0);
@@ -157,14 +157,6 @@ struct MANGOS_DLL_DECL boss_mr_smiteAI : public ScriptedAI
EnterEvadeMode();
return;
}
-
- // Takes longer to run further distance. Not accurate, but will probably be sufficient for most cases
- if (m_creature->IsWithinDistInMap(pVictim, ATTACK_DISTANCE))
- m_uiEquipTimer -= 1000;
- else if (m_creature->IsWithinDistInMap(pVictim, 2*ATTACK_DISTANCE))
- m_uiEquipTimer -= 2000;
- else
- m_uiEquipTimer -= 3000;
}
void PhaseEquipEnd()
@@ -251,6 +243,7 @@ struct MANGOS_DLL_DECL boss_mr_smiteAI : public ScriptedAI
m_uiPhase = PHASE_EQUIP_START;
m_uiEquipTimer = 2500;
+ // will clear getVictim (m_attacking)
m_creature->AttackStop(true);
m_creature->RemoveAurasDueToSpell(SPELL_THRASH);
}
@@ -281,21 +274,6 @@ CreatureAI* GetAI_boss_mr_smite(Creature* pCreature)
return new boss_mr_smiteAI(pCreature);
}
-bool GOUse_go_door_lever_dm(Player* pPlayer, GameObject* pGo)
-{
- ScriptedInstance* pInstance = (ScriptedInstance*)pGo->GetInstanceData();
-
- if (!pInstance)
- return false;
-
- GameObject* pGoDoor = pInstance->GetSingleGameObjectFromStorage(GO_IRON_CLAD_DOOR);
-
- if (pGoDoor && pGoDoor->GetGoState() == GO_STATE_READY)
- return false;
-
- return true;
-}
-
bool GOUse_go_defias_cannon(Player* pPlayer, GameObject* pGo)
{
ScriptedInstance* pInstance = (ScriptedInstance*)pGo->GetInstanceData();
@@ -303,29 +281,24 @@ bool GOUse_go_defias_cannon(Player* pPlayer, GameObject* pGo)
if (!pInstance)
return false;
- if (pInstance->GetData(TYPE_DEFIAS_ENDDOOR) == DONE || pInstance->GetData(TYPE_DEFIAS_ENDDOOR) == IN_PROGRESS)
+ if (pInstance->GetData(TYPE_IRON_CLAD_DOOR) == DONE)
return false;
- pInstance->SetData(TYPE_DEFIAS_ENDDOOR, IN_PROGRESS);
+ pInstance->SetData(TYPE_IRON_CLAD_DOOR, DONE);
return false;
}
void AddSC_deadmines()
{
- Script *newscript;
-
- newscript = new Script;
- newscript->Name = "boss_mr_smite";
- newscript->GetAI = &GetAI_boss_mr_smite;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "go_door_lever_dm";
- newscript->pGOUse = &GOUse_go_door_lever_dm;
- newscript->RegisterSelf();
-
- newscript = new Script;
- newscript->Name = "go_defias_cannon";
- newscript->pGOUse = &GOUse_go_defias_cannon;
- newscript->RegisterSelf();
+ Script* pNewScript;
+
+ pNewScript = new Script;
+ pNewScript->Name = "boss_mr_smite";
+ pNewScript->GetAI = &GetAI_boss_mr_smite;
+ pNewScript->RegisterSelf();
+
+ pNewScript = new Script;
+ pNewScript->Name = "go_defias_cannon";
+ pNewScript->pGOUse = &GOUse_go_defias_cannon;
+ pNewScript->RegisterSelf();
}
diff --git a/scripts/eastern_kingdoms/deadmines/deadmines.h b/scripts/eastern_kingdoms/deadmines/deadmines.h
index 9027dd16..5ac6eaff 100644
--- a/scripts/eastern_kingdoms/deadmines/deadmines.h
+++ b/scripts/eastern_kingdoms/deadmines/deadmines.h
@@ -24,20 +24,19 @@ enum
{
MAX_ENCOUNTER = 4,
- TYPE_DEFIAS_ENDDOOR = 1,
- TYPE_RHAHKZOR = 2,
- TYPE_SNEED = 3,
- TYPE_GILNID = 4,
+ TYPE_RHAHKZOR = 0,
+ TYPE_SNEED = 1,
+ TYPE_GILNID = 2,
+ TYPE_IRON_CLAD_DOOR = 3,
INST_SAY_ALARM1 = -1036000,
INST_SAY_ALARM2 = -1036001,
GO_FACTORY_DOOR = 13965, // rhahk'zor
- GO_FOUNDRY_DOOR = 16399, // gilnid
GO_MAST_ROOM_DOOR = 16400, // sneed
+ GO_FOUNDRY_DOOR = 16399, // gilnid
GO_HEAVY_DOOR_1 = 17153, // to sneed
GO_HEAVY_DOOR_2 = 17154, // to gilnid
- GO_DOOR_LEVER = 101833,
GO_IRON_CLAD_DOOR = 16397,
GO_DEFIAS_CANNON = 16398,
GO_SMITE_CHEST = 144111, // use to get correct location of mr.smites equipment changes
@@ -65,13 +64,16 @@ class MANGOS_DLL_DECL instance_deadmines : public ScriptedInstance
void SetData(uint32 uiType, uint32 uiData);
uint32 GetData(uint32 uiType);
+ const char* Save() { return m_strInstData.c_str(); }
+ void Load(const char* chrIn);
+
void Update(uint32 uiDiff);
private:
uint32 m_auiEncounter[MAX_ENCOUNTER];
+ std::string m_strInstData;
uint32 m_uiIronDoorTimer;
- uint32 m_uiDoorStep;
};
#endif
diff --git a/scripts/eastern_kingdoms/deadmines/instance_deadmines.cpp b/scripts/eastern_kingdoms/deadmines/instance_deadmines.cpp
index b447ecdf..4f4bcd72 100644
--- a/scripts/eastern_kingdoms/deadmines/instance_deadmines.cpp
+++ b/scripts/eastern_kingdoms/deadmines/instance_deadmines.cpp
@@ -28,8 +28,7 @@ EndScriptData */
#include "deadmines.h"
instance_deadmines::instance_deadmines(Map* pMap) : ScriptedInstance(pMap),
- m_uiIronDoorTimer(0),
- m_uiDoorStep(0)
+ m_uiIronDoorTimer(0)
{
Initialize();
}
@@ -50,21 +49,25 @@ void instance_deadmines::OnObjectCreate(GameObject* pGo)
switch(pGo->GetEntry())
{
case GO_FACTORY_DOOR:
- if (GetData(TYPE_RHAHKZOR) == DONE)
+ if (m_auiEncounter[TYPE_RHAHKZOR] == DONE)
pGo->SetGoState(GO_STATE_ACTIVE);
break;
case GO_MAST_ROOM_DOOR:
- if (GetData(TYPE_SNEED) == DONE)
+ if (m_auiEncounter[TYPE_SNEED] == DONE)
pGo->SetGoState(GO_STATE_ACTIVE);
break;
case GO_FOUNDRY_DOOR:
- if (GetData(TYPE_GILNID) == DONE)
+ if (m_auiEncounter[TYPE_GILNID] == DONE)
pGo->SetGoState(GO_STATE_ACTIVE);
break;
case GO_IRON_CLAD_DOOR:
+ if (m_auiEncounter[TYPE_IRON_CLAD_DOOR] == DONE)
+ pGo->SetGoState(GO_STATE_ACTIVE_ALTERNATIVE);
+
+ break;
case GO_DEFIAS_CANNON:
case GO_SMITE_CHEST:
break;
@@ -80,15 +83,9 @@ void instance_deadmines::OnCreatureDeath(Creature* pCreature)
{
switch(pCreature->GetEntry())
{
- case NPC_RHAHKZOR:
- SetData(TYPE_RHAHKZOR, DONE);
- break;
- case NPC_SNEED:
- SetData(TYPE_SNEED, DONE);
- break;
- case NPC_GILNID:
- SetData(TYPE_GILNID, DONE);
- break;
+ case NPC_RHAHKZOR: SetData(TYPE_RHAHKZOR, DONE); break;
+ case NPC_SNEED: SetData(TYPE_SNEED, DONE); break;
+ case NPC_GILNID: SetData(TYPE_GILNID, DONE); break;
}
}
@@ -101,7 +98,7 @@ void instance_deadmines::SetData(uint32 uiType, uint32 uiData)
if (uiData == DONE)
DoUseDoorOrButton(GO_FACTORY_DOOR);
- m_auiEncounter[1] = uiData;
+ m_auiEncounter[uiType] = uiData;
break;
}
case TYPE_SNEED:
@@ -109,7 +106,7 @@ void instance_deadmines::SetData(uint32 uiType, uint32 uiData)
if (uiData == DONE)
DoUseDoorOrButton(GO_MAST_ROOM_DOOR);
- m_auiEncounter[2] = uiData;
+ m_auiEncounter[uiType] = uiData;
break;
}
case TYPE_GILNID:
@@ -117,40 +114,83 @@ void instance_deadmines::SetData(uint32 uiType, uint32 uiData)
if (uiData == DONE)
DoUseDoorOrButton(GO_FOUNDRY_DOOR);
- m_auiEncounter[3] = uiData;
+ m_auiEncounter[uiType] = uiData;
break;
}
- case TYPE_DEFIAS_ENDDOOR:
+ case TYPE_IRON_CLAD_DOOR:
{
- if (uiData == IN_PROGRESS)
+ if (uiData == DONE)
{
- if (GameObject* pGo = GetSingleGameObjectFromStorage(GO_IRON_CLAD_DOOR))
+ DoUseDoorOrButton(GO_IRON_CLAD_DOOR, 0, true);
+ m_uiIronDoorTimer = 15000;
+
+ if (Creature* pMrSmite = GetSingleCreatureFromStorage(NPC_MR_SMITE))
+ DoScriptText(INST_SAY_ALARM1, pMrSmite);
+
+ if (GameObject* pDoor = GetSingleGameObjectFromStorage(GO_IRON_CLAD_DOOR))
{
- pGo->SetGoState(GO_STATE_ACTIVE_ALTERNATIVE);
- m_uiIronDoorTimer = 3000;
+ // should be static spawns, fetch the closest ones at the pier
+ if (Creature* pi1 = GetClosestCreatureWithEntry(pDoor, NPC_PIRATE, 40.0f))
+ {
+ pi1->RemoveSplineFlag(SPLINEFLAG_WALKMODE);
+ pi1->GetMotionMaster()->MovePoint(0, pDoor->GetPositionX(), pDoor->GetPositionY(), pDoor->GetPositionZ());
+ }
+
+ if (Creature* pi2 = GetClosestCreatureWithEntry(pDoor, NPC_SQUALLSHAPER, 40.0f))
+ {
+ pi2->RemoveSplineFlag(SPLINEFLAG_WALKMODE);
+ pi2->GetMotionMaster()->MovePoint(0, pDoor->GetPositionX(), pDoor->GetPositionY(), pDoor->GetPositionZ());
+ }
}
}
- m_auiEncounter[0] = uiData;
+
+ m_auiEncounter[uiType] = uiData;
break;
}
}
+
+ if (uiData == DONE)
+ {
+ OUT_SAVE_INST_DATA;
+
+ std::ostringstream saveStream;
+ saveStream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " << m_auiEncounter[2] << " " << m_auiEncounter[3];
+
+ m_strInstData = saveStream.str();
+
+ SaveToDB();
+ OUT_SAVE_INST_DATA_COMPLETE;
+ }
}
uint32 instance_deadmines::GetData(uint32 uiType)
{
- switch(uiType)
+ if (uiType < MAX_ENCOUNTER)
+ return m_auiEncounter[uiType];
+
+ return 0;
+}
+
+void instance_deadmines::Load(const char* chrIn)
+{
+ if (!chrIn)
{
- case TYPE_DEFIAS_ENDDOOR:
- return m_auiEncounter[0];
- case TYPE_RHAHKZOR:
- return m_auiEncounter[1];
- case TYPE_SNEED:
- return m_auiEncounter[2];
- case TYPE_GILNID:
- return m_auiEncounter[3];
+ OUT_LOAD_INST_DATA_FAIL;
+ return;
}
- return 0;
+ OUT_LOAD_INST_DATA(chrIn);
+
+ std::istringstream loadStream(chrIn);
+ loadStream >> m_auiEncounter[0] >> m_auiEncounter[1] >> m_auiEncounter[2] >> m_auiEncounter[3];
+
+ for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
+ {
+ if (m_auiEncounter[i] == IN_PROGRESS)
+ m_auiEncounter[i] = NOT_STARTED;
+ }
+
+ OUT_LOAD_INST_DATA_COMPLETE;
}
void instance_deadmines::Update(uint32 uiDiff)
@@ -160,46 +200,9 @@ void instance_deadmines::Update(uint32 uiDiff)
if (m_uiIronDoorTimer <= uiDiff)
{
if (Creature* pMrSmite = GetSingleCreatureFromStorage(NPC_MR_SMITE))
- {
- switch(m_uiDoorStep)
- {
- case 0:
- DoScriptText(INST_SAY_ALARM1,pMrSmite);
- m_uiIronDoorTimer = 2000;
- ++m_uiDoorStep;
- break;
- case 1:
- {
- if (GameObject* pDoor = GetSingleGameObjectFromStorage(GO_IRON_CLAD_DOOR))
- {
- // should be static spawns, fetch the closest ones at the pier
- if (Creature* pi1 = GetClosestCreatureWithEntry(pDoor, NPC_PIRATE, 40.0f))
- {
- pi1->RemoveSplineFlag(SPLINEFLAG_WALKMODE);
- pi1->GetMotionMaster()->MovePoint(0, pDoor->GetPositionX(), pDoor->GetPositionY(), pDoor->GetPositionZ());
- }
-
- if (Creature* pi2 = GetClosestCreatureWithEntry(pDoor, NPC_SQUALLSHAPER, 40.0f))
- {
- pi2->RemoveSplineFlag(SPLINEFLAG_WALKMODE);
- pi2->GetMotionMaster()->MovePoint(0, pDoor->GetPositionX(), pDoor->GetPositionY(), pDoor->GetPositionZ());
- }
- }
-
- ++m_uiDoorStep;
- m_uiIronDoorTimer = 10000;
- break;
- }
- case 2:
- DoScriptText(INST_SAY_ALARM2,pMrSmite);
- m_uiDoorStep = 0;
- m_uiIronDoorTimer = 0;
- debug_log("SD2: Instance Deadmines: Iron door event reached end.");
- break;
- }
- }
- else
- m_uiIronDoorTimer = 0;
+ DoScriptText(INST_SAY_ALARM2, pMrSmite);
+
+ m_uiIronDoorTimer = 0;
}
else
m_uiIronDoorTimer -= uiDiff;
diff --git a/scripts/eastern_kingdoms/uldaman/boss_ironaya.cpp b/scripts/eastern_kingdoms/uldaman/boss_ironaya.cpp
deleted file mode 100644
index 46820957..00000000
--- a/scripts/eastern_kingdoms/uldaman/boss_ironaya.cpp
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * Copyright (C) 2006-2011 ScriptDev2
- * Copyright (C) 2010-2011 ScriptDev0
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Ironaya
-SD%Complete: 100
-SDComment:
-SDCategory: Uldaman
-EndScriptData */
-
-#include "precompiled.h"
-
-#define SAY_AGGRO -1070000
-
-#define SPELL_ARCINGSMASH 8374
-#define SPELL_KNOCKAWAY 10101
-#define SPELL_WSTOMP 11876
-
-struct MANGOS_DLL_DECL boss_ironayaAI : public ScriptedAI
-{
- boss_ironayaAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();}
-
- uint32 Arcing_Timer;
- bool hasCastedWstomp;
- bool hasCastedKnockaway;
-
- void Reset()
- {
- Arcing_Timer = 3000;
- hasCastedKnockaway = false;
- hasCastedWstomp = false;
- }
-
- void Aggro(Unit *who)
- {
- DoScriptText(SAY_AGGRO, m_creature);
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!m_creature->SelectHostileTarget() || !m_creature->getVictim())
- return;
-
- //If we are <50% hp do knockaway ONCE
- if (!hasCastedKnockaway && m_creature->GetHealthPercent() < 50.0f)
- {
- m_creature->CastSpell(m_creature->getVictim(),SPELL_KNOCKAWAY, true);
-
- // current aggro target is knocked away pick new target
- Unit* Target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_TOPAGGRO, 0);
-
- if (!Target || Target == m_creature->getVictim())
- Target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_TOPAGGRO, 1);
-
- if (Target)
- m_creature->TauntApply(Target);
-
- //Shouldn't cast this agian
- hasCastedKnockaway = true;
- }
-
- //Arcing_Timer
- if (Arcing_Timer < diff)
- {
- DoCastSpellIfCan(m_creature,SPELL_ARCINGSMASH);
- Arcing_Timer = 13000;
- }else Arcing_Timer -= diff;
-
- if (!hasCastedWstomp && m_creature->GetHealthPercent() < 25.0f)
- {
- DoCastSpellIfCan(m_creature,SPELL_WSTOMP);
- hasCastedWstomp = true;
- }
-
- DoMeleeAttackIfReady();
- }
-};
-
-CreatureAI* GetAI_boss_ironaya(Creature* pCreature)
-{
- return new boss_ironayaAI(pCreature);
-}
-
-void AddSC_boss_ironaya()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name = "boss_ironaya";
- newscript->GetAI = &GetAI_boss_ironaya;
- newscript->RegisterSelf();
-}
diff --git a/scripts/kalimdor/moonglade.cpp b/scripts/kalimdor/moonglade.cpp
index 886d2196..ae6e6b86 100644
--- a/scripts/kalimdor/moonglade.cpp
+++ b/scripts/kalimdor/moonglade.cpp
@@ -302,8 +302,8 @@ static EventLocations aShadowsLocations[] =
{7811.48f, -2573.20f, 488.49f},
// Outside shade points - basically only the first set of coords is used for the summoning; there is no solid proof of using the other coords
{7888.32f, -2566.25f, 487.02f},
- //{7946.12f, -2577.10f, 489.97f},
- //{7963.00f, -2492.03f, 487.84f}
+ {7946.12f, -2577.10f, 489.97f},
+ {7963.00f, -2492.03f, 487.84f}
};
struct MANGOS_DLL_DECL npc_keeper_remulosAI : public npc_escortAI
@@ -315,7 +315,7 @@ struct MANGOS_DLL_DECL npc_keeper_remulosAI : public npc_escortAI
uint32 m_uiShadesummonTimer;
uint32 m_uiOutroTimer;
- ObjectGuid m_uiEranikusGUID;
+ ObjectGuid m_eranikusGuid;
uint8 m_uiOutroPhase;
uint8 m_uiSummonCount;
@@ -330,7 +330,7 @@ struct MANGOS_DLL_DECL npc_keeper_remulosAI : public npc_escortAI
m_uiOutroPhase = 0;
m_uiSummonCount = 0;
- m_uiEranikusGUID.Clear();
+ m_eranikusGuid.Clear();
m_uiShadesummonTimer = 0;
m_uiHealTimer = 10000;
@@ -345,18 +345,17 @@ struct MANGOS_DLL_DECL npc_keeper_remulosAI : public npc_escortAI
switch(pSummoned->GetEntry())
{
case NPC_ERANIKUS_TYRANT:
- m_uiEranikusGUID = pSummoned->GetObjectGuid();
+ m_eranikusGuid = pSummoned->GetObjectGuid();
// Make Eranikus unattackable first
- pSummoned->SetByteValue(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_ALWAYS_STAND /*| UNIT_BYTE1_FLAG_UNK_2*/);
+ // ToDo: uncomment the fly effect when it will be possible to cancel it properly
+ //pSummoned->SetByteValue(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_ALWAYS_STAND /*| UNIT_BYTE1_FLAG_UNK_2*/);
pSummoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
pSummoned->AddSplineFlag(SPLINEFLAG_FLYING);
- pSummoned->SetRespawnDelay(DAY);
break;
case NPC_NIGHTMARE_PHANTASM:
// ToDo: set faction to DB
pSummoned->setFaction(14);
pSummoned->AI()->AttackStart(m_creature);
- pSummoned->SetRespawnDelay(DAY);
break;
}
}
@@ -383,13 +382,11 @@ struct MANGOS_DLL_DECL npc_keeper_remulosAI : public npc_escortAI
void JustDied(Unit* pKiller)
{
- // set quest to failed
- if (Player* pPlayer = GetPlayerForEscort())
- pPlayer->FailQuest(QUEST_NIGHTMARE_MANIFESTS);
-
- // despawn the summons
- if (Creature* pEranikus = m_creature->GetMap()->GetCreature(m_uiEranikusGUID))
+ // Make Eranikus evade in order to despawn all the summons
+ if (Creature* pEranikus = m_creature->GetMap()->GetCreature(m_eranikusGuid))
pEranikus->AI()->EnterEvadeMode();
+
+ npc_escortAI::JustDied(pKiller);
}
void WaypointReached(uint32 uiPointId)
@@ -417,7 +414,7 @@ struct MANGOS_DLL_DECL npc_keeper_remulosAI : public npc_escortAI
DoCastSpellIfCan(m_creature, SPELL_CONJURE_RIFT);
break;
case 17:
- if (Creature* pEranikus = m_creature->GetMap()->GetCreature(m_uiEranikusGUID))
+ if (Creature* pEranikus = m_creature->GetMap()->GetCreature(m_eranikusGuid))
{
// This big yellow emote was removed at some point in WotLK
//DoScriptText(EMOTE_SUMMON_ERANIKUS, pEranikus);
@@ -428,37 +425,37 @@ struct MANGOS_DLL_DECL npc_keeper_remulosAI : public npc_escortAI
DoScriptText(SAY_REMULOS_TAUNT_1, m_creature);
break;
case 19:
- if (Creature* pEranikus = m_creature->GetMap()->GetCreature(m_uiEranikusGUID))
+ if (Creature* pEranikus = m_creature->GetMap()->GetCreature(m_eranikusGuid))
DoScriptText(EMOTE_ERANIKUS_LAUGH, pEranikus);
break;
case 20:
- if (Creature* pEranikus = m_creature->GetMap()->GetCreature(m_uiEranikusGUID))
+ if (Creature* pEranikus = m_creature->GetMap()->GetCreature(m_eranikusGuid))
DoScriptText(SAY_ERANIKUS_TAUNT_2, pEranikus);
break;
case 21:
DoScriptText(SAY_REMULOS_TAUNT_3, m_creature);
break;
case 22:
- if (Creature* pEranikus = m_creature->GetMap()->GetCreature(m_uiEranikusGUID))
+ if (Creature* pEranikus = m_creature->GetMap()->GetCreature(m_eranikusGuid))
DoScriptText(SAY_ERANIKUS_TAUNT_4, pEranikus);
break;
case 23:
- if (Creature* pEranikus = m_creature->GetMap()->GetCreature(m_uiEranikusGUID))
+ if (Creature* pEranikus = m_creature->GetMap()->GetCreature(m_eranikusGuid))
DoScriptText(EMOTE_ERANIKUS_ATTACK, pEranikus);
break;
case 24:
if (Player* pPlayer = GetPlayerForEscort())
DoScriptText(SAY_REMULOS_DEFEND_1, m_creature, pPlayer);
- if (Creature* pEranikus = m_creature->GetMap()->GetCreature(m_uiEranikusGUID))
+ if (Creature* pEranikus = m_creature->GetMap()->GetCreature(m_eranikusGuid))
pEranikus->GetMotionMaster()->MovePoint(POINT_ID_ERANIKUS_FLIGHT, aEranikusLocations[1].m_fX, aEranikusLocations[1].m_fY, aEranikusLocations[1].m_fZ);
break;
case 28:
DoScriptText(SAY_REMULOS_DEFEND_2, m_creature);
- if (Creature* pEranikus = m_creature->GetMap()->GetCreature(m_uiEranikusGUID))
+ if (Creature* pEranikus = m_creature->GetMap()->GetCreature(m_eranikusGuid))
m_creature->SetFacingToObject(pEranikus);
break;
case 29:
- if (Creature* pEranikus = m_creature->GetMap()->GetCreature(m_uiEranikusGUID))
+ if (Creature* pEranikus = m_creature->GetMap()->GetCreature(m_eranikusGuid))
DoScriptText(SAY_ERANIKUS_SHADOWS, pEranikus);
break;
case 30:
@@ -495,6 +492,7 @@ struct MANGOS_DLL_DECL npc_keeper_remulosAI : public npc_escortAI
case 1:
// Despawn Remulos after the outro is finished - he will respawn automatically at his home position after a few min
DoScriptText(SAY_REMULOS_OUTRO_2, m_creature);
+ m_creature->SetRespawnDelay(1*MINUTE);
m_creature->ForcedDespawn(3000);
m_uiOutroTimer = 0;
break;
@@ -517,7 +515,7 @@ struct MANGOS_DLL_DECL npc_keeper_remulosAI : public npc_escortAI
for (uint8 i = 0; i < MAX_SHADOWS; ++i)
m_creature->SummonCreature(NPC_NIGHTMARE_PHANTASM, aShadowsLocations[i].m_fX, aShadowsLocations[i].m_fY, aShadowsLocations[i].m_fZ, 0,TEMPSUMMON_DEAD_DESPAWN, 0);
- if (Creature* pEranikus = m_creature->GetMap()->GetCreature(m_uiEranikusGUID))
+ if (Creature* pEranikus = m_creature->GetMap()->GetCreature(m_eranikusGuid))
DoScriptText(SAY_ERANIKUS_ATTACK_1, pEranikus);
++m_uiSummonCount;
@@ -527,15 +525,15 @@ struct MANGOS_DLL_DECL npc_keeper_remulosAI : public npc_escortAI
// Summon 3 shades per turn until the maximum summon turns are reached
float fX, fY, fZ;
- // Randomize the summon point - guesswork; not used
- //uint8 uiSummonPoint = roll_chance_i(70) ? MAX_SHADOWS : urand(MAX_SHADOWS + 1, 2*MAX_SHADOWS - 1);
+ // Randomize the summon point
+ uint8 uiSummonPoint = roll_chance_i(70) ? MAX_SHADOWS : urand(MAX_SHADOWS + 1, MAX_SHADOWS + 2);
if (m_uiSummonCount < MAX_SUMMON_TURNS)
{
for (uint8 i = 0; i < MAX_SHADOWS; ++i)
{
- m_creature->GetRandomPoint(aShadowsLocations[MAX_SHADOWS].m_fX, aShadowsLocations[MAX_SHADOWS].m_fY, aShadowsLocations[MAX_SHADOWS].m_fZ, 10.0f, fX, fY, fZ);
- m_creature->SummonCreature(NPC_NIGHTMARE_PHANTASM, fX, fY, fZ, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
+ m_creature->GetRandomPoint(aShadowsLocations[uiSummonPoint].m_fX, aShadowsLocations[uiSummonPoint].m_fY, aShadowsLocations[uiSummonPoint].m_fZ, 10.0f, fX, fY, fZ);
+ m_creature->SummonCreature(NPC_NIGHTMARE_PHANTASM, fX, fY, fZ, 0.0f, TEMPSUMMON_DEAD_DESPAWN, 0);
}
++m_uiSummonCount;
@@ -547,11 +545,11 @@ struct MANGOS_DLL_DECL npc_keeper_remulosAI : public npc_escortAI
{
m_uiShadesummonTimer = 0;
- if (Creature* pEranikus = m_creature->GetMap()->GetCreature(m_uiEranikusGUID))
+ if (Creature* pEranikus = m_creature->GetMap()->GetCreature(m_eranikusGuid))
{
- pEranikus->GetMotionMaster()->MovePoint(POINT_ID_ERANIKUS_COMBAT, aEranikusLocations[2].m_fX, aEranikusLocations[2].m_fY, aEranikusLocations[2].m_fZ);
pEranikus->SetByteFlag(UNIT_FIELD_BYTES_1, 3, 0);
pEranikus->RemoveSplineFlag(SPLINEFLAG_FLYING);
+ pEranikus->GetMotionMaster()->MovePoint(POINT_ID_ERANIKUS_COMBAT, aEranikusLocations[2].m_fX, aEranikusLocations[2].m_fY, aEranikusLocations[2].m_fZ);
}
}
else
@@ -605,14 +603,14 @@ bool QuestAccept_npc_keeper_remulos(Player* pPlayer, Creature* pCreature, const
{
if (pQuest->GetQuestId() == QUEST_NIGHTMARE_MANIFESTS)
{
- // avoid starting the escort twice
- pCreature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER);
-
if (npc_keeper_remulosAI* pEscortAI = dynamic_cast(pCreature->AI()))
pEscortAI->Start(true, pPlayer, pQuest);
+
+ return true;
}
- return true;
+ // Return false for other quests in order to handle DB scripts. Example: quest 8447
+ return false;
}
bool EffectDummyCreature_conjure_rift(Unit* pCaster, uint32 uiSpellId, SpellEffectIndex uiEffIndex, Creature* pCreatureTarget)
@@ -620,7 +618,7 @@ bool EffectDummyCreature_conjure_rift(Unit* pCaster, uint32 uiSpellId, SpellEffe
//always check spellid and effectindex
if (uiSpellId == SPELL_CONJURE_RIFT && uiEffIndex == EFFECT_INDEX_0)
{
- pCaster->SummonCreature(NPC_ERANIKUS_TYRANT, aEranikusLocations[0].m_fX, aEranikusLocations[0].m_fY, aEranikusLocations[0].m_fZ, aEranikusLocations[0].m_fO, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000);
+ pCaster->SummonCreature(NPC_ERANIKUS_TYRANT, aEranikusLocations[0].m_fX, aEranikusLocations[0].m_fY, aEranikusLocations[0].m_fZ, aEranikusLocations[0].m_fO, TEMPSUMMON_DEAD_DESPAWN, 0);
//always return true when we are handling this spell and effect
return true;
@@ -663,8 +661,8 @@ struct MANGOS_DLL_DECL boss_eranikusAI : public ScriptedAI
uint8 m_uiTyrandeMovePoint;
uint8 m_uiHealthCheck;
- ObjectGuid m_uiRemulosGUID;
- ObjectGuid m_uiTyrandeGUID;
+ ObjectGuid m_remulosGuid;
+ ObjectGuid m_tyrandeGuid;
GUIDList m_lPriestessList;
void Reset()
@@ -674,8 +672,8 @@ struct MANGOS_DLL_DECL boss_eranikusAI : public ScriptedAI
m_uiShadowboltVolleyTimer = 5000;
m_uiTyrandeMoveTimer = 0;
- m_uiRemulosGUID.Clear();
- m_uiTyrandeGUID.Clear();
+ m_remulosGuid.Clear();
+ m_tyrandeGuid.Clear();
m_uiHealthCheck = 85;
m_uiEventPhase = 0;
@@ -699,7 +697,7 @@ struct MANGOS_DLL_DECL boss_eranikusAI : public ScriptedAI
// Get Remulos guid and make him stop summoning shades
if (Creature* pRemulos = GetClosestCreatureWithEntry(m_creature, NPC_REMULOS, 50.0f))
{
- m_uiRemulosGUID = pRemulos->GetObjectGuid();
+ m_remulosGuid = pRemulos->GetObjectGuid();
pRemulos->AI()->EnterEvadeMode();
}
@@ -717,7 +715,7 @@ struct MANGOS_DLL_DECL boss_eranikusAI : public ScriptedAI
m_creature->ForcedDespawn();
DoDespawnSummoned();
- if (Creature* pTyrande = m_creature->GetMap()->GetCreature(m_uiTyrandeGUID))
+ if (Creature* pTyrande = m_creature->GetMap()->GetCreature(m_tyrandeGuid))
pTyrande->ForcedDespawn();
}
}
@@ -745,12 +743,14 @@ struct MANGOS_DLL_DECL boss_eranikusAI : public ScriptedAI
switch(pSummoned->GetEntry())
{
case NPC_TYRANDE_WHISPERWIND:
- m_uiTyrandeGUID = pSummoned->GetObjectGuid();
+ m_tyrandeGuid = pSummoned->GetObjectGuid();
+ pSummoned->RemoveSplineFlag(SPLINEFLAG_WALKMODE);
pSummoned->GetMotionMaster()->MovePoint(POINT_ID_TYRANDE_HEAL, aTyrandeLocations[1].m_fX, aTyrandeLocations[1].m_fY, aTyrandeLocations[1].m_fZ);
break;
case NPC_ELUNE_PRIESTESS:
m_lPriestessList.push_back(pSummoned->GetObjectGuid());
float fX, fY, fZ;
+ pSummoned->RemoveSplineFlag(SPLINEFLAG_WALKMODE);
m_creature->GetRandomPoint(aTyrandeLocations[1].m_fX, aTyrandeLocations[1].m_fY, aTyrandeLocations[1].m_fZ, 10.0f, fX, fY, fZ);
pSummoned->GetMotionMaster()->MovePoint(POINT_ID_TYRANDE_HEAL, fX, fY, fZ);
break;
@@ -814,12 +814,14 @@ struct MANGOS_DLL_DECL boss_eranikusAI : public ScriptedAI
{
case 0:
// Eranikus is redeemed - make Tyrande kneel and stop casting
- if (Creature* pTyrande = m_creature->GetMap()->GetCreature(m_uiTyrandeGUID))
+ if (Creature* pTyrande = m_creature->GetMap()->GetCreature(m_tyrandeGuid))
{
pTyrande->InterruptNonMeleeSpells(false);
pTyrande->SetStandState(UNIT_STAND_STATE_KNEEL);
DoScriptText(EMOTE_TYRANDE_KNEEL, pTyrande);
}
+ if (Creature* pRemulos = m_creature->GetMap()->GetCreature(m_remulosGuid))
+ pRemulos->SetFacingToObject(m_creature);
// Note: this emote was a world wide yellow emote before WotLK
DoScriptText(EMOTE_ERANIKUS_REDEEM, m_creature);
//DoCastSpellIfCan(m_creature, SPELL_MOONGLADE_TRANQUILITY); // spell id unk for the moment
@@ -827,7 +829,7 @@ struct MANGOS_DLL_DECL boss_eranikusAI : public ScriptedAI
m_uiEventTimer = 5000;
break;
case 1:
- if (Creature* pTyrande = m_creature->GetMap()->GetCreature(m_uiTyrandeGUID))
+ if (Creature* pTyrande = m_creature->GetMap()->GetCreature(m_tyrandeGuid))
DoScriptText(SAY_TYRANDE_REDEEMED, pTyrande);
m_uiEventTimer = 6000;
break;
@@ -839,6 +841,7 @@ struct MANGOS_DLL_DECL boss_eranikusAI : public ScriptedAI
case 3:
// Move Eranikus in front of Tyrande
m_creature->SetStandState(UNIT_STAND_STATE_STAND);
+ m_creature->AddSplineFlag(SPLINEFLAG_WALKMODE);
m_creature->GetMotionMaster()->MovePoint(POINT_ID_ERANIKUS_REDEEMED, aEranikusLocations[3].m_fX, aEranikusLocations[3].m_fY, aEranikusLocations[3].m_fZ);
m_uiEventTimer = 0;
break;
@@ -856,12 +859,12 @@ struct MANGOS_DLL_DECL boss_eranikusAI : public ScriptedAI
break;
case 7:
// Complete Quest and end event
- if (Creature* pTyrande = m_creature->GetMap()->GetCreature(m_uiTyrandeGUID))
+ if (Creature* pTyrande = m_creature->GetMap()->GetCreature(m_tyrandeGuid))
{
pTyrande->SetStandState(UNIT_STAND_STATE_STAND);
pTyrande->ForcedDespawn(9000);
}
- if (Creature* pRemulos = m_creature->GetMap()->GetCreature(m_uiRemulosGUID))
+ if (Creature* pRemulos = m_creature->GetMap()->GetCreature(m_remulosGuid))
((npc_keeper_remulosAI*)pRemulos->AI())->DoHandleOutro(m_creature);
m_creature->HandleEmote(EMOTE_ONESHOT_BOW);
m_creature->ForcedDespawn(2000);
@@ -882,7 +885,7 @@ struct MANGOS_DLL_DECL boss_eranikusAI : public ScriptedAI
{
if (m_uiTyrandeMoveTimer <= uiDiff)
{
- if (Creature* pTyrande = m_creature->GetMap()->GetCreature(m_uiTyrandeGUID))
+ if (Creature* pTyrande = m_creature->GetMap()->GetCreature(m_tyrandeGuid))
pTyrande->GetMotionMaster()->MovePoint(POINT_ID_TYRANDE_ABSOLUTION, aTyrandeLocations[2].m_fX, aTyrandeLocations[2].m_fY, aTyrandeLocations[2].m_fZ);
m_uiTyrandeMoveTimer = 0;
}
@@ -919,12 +922,12 @@ struct MANGOS_DLL_DECL boss_eranikusAI : public ScriptedAI
m_uiHealthCheck = 31;
break;
case 31:
- if (Creature* pTyrande = m_creature->GetMap()->GetCreature(m_uiTyrandeGUID))
+ if (Creature* pTyrande = m_creature->GetMap()->GetCreature(m_tyrandeGuid))
DoScriptText(SAY_TYRANDE_FORGIVEN_2, pTyrande);
m_uiHealthCheck = 27;
break;
case 27:
- if (Creature* pTyrande = m_creature->GetMap()->GetCreature(m_uiTyrandeGUID))
+ if (Creature* pTyrande = m_creature->GetMap()->GetCreature(m_tyrandeGuid))
DoScriptText(SAY_TYRANDE_FORGIVEN_3, pTyrande);
m_uiHealthCheck = 25;
break;
diff --git a/sql/Updates/z0469_r2277_scriptdevzero.sql b/sql/Updates/z0469_r2277_scriptdevzero.sql
new file mode 100644
index 00000000..933e10cd
--- /dev/null
+++ b/sql/Updates/z0469_r2277_scriptdevzero.sql
@@ -0,0 +1 @@
+UPDATE script_texts SET content_default='I must make the necessary preparations before the awakening ritual can begin. You must protect me!' WHERE entry=-1043001;
diff --git a/sql/Updates/z0470_r2289_scriptdevzero.sql b/sql/Updates/z0470_r2289_scriptdevzero.sql
new file mode 100644
index 00000000..76b4cb2d
--- /dev/null
+++ b/sql/Updates/z0470_r2289_scriptdevzero.sql
@@ -0,0 +1,3 @@
+DELETE FROM script_texts WHERE entry=-1000716;
+INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES
+(-1000716,'To Nighthaven! Keep your army close, champion. ',0,0,0,0,'remulos SAY_REMULOS_INTRO_2'),
diff --git a/sql/Updates/z0471_rxxxx_mangoszero.sql b/sql/Updates/z0471_rxxxx_mangoszero.sql
new file mode 100644
index 00000000..4d1dad6f
--- /dev/null
+++ b/sql/Updates/z0471_rxxxx_mangoszero.sql
@@ -0,0 +1 @@
+UPDATE creature_template SET ScriptName='' WHERE entry=7228;
diff --git a/sql/Updates/z0472_r2300_scriptdevzero.sql b/sql/Updates/z0472_r2300_scriptdevzero.sql
new file mode 100644
index 00000000..d8fbb524
--- /dev/null
+++ b/sql/Updates/z0472_r2300_scriptdevzero.sql
@@ -0,0 +1,4 @@
+DELETE FROM script_texts WHERE entry=-1000716;
+
+INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES
+(-1000716,'To Nighthaven! Keep your army close, champion. ',0,0,0,0,'remulos SAY_REMULOS_INTRO_2');
diff --git a/sql/Updates/z0475_rxxxx_scriptdevzero.sql b/sql/Updates/z0475_rxxxx_scriptdevzero.sql
new file mode 100644
index 00000000..cdfd62dc
--- /dev/null
+++ b/sql/Updates/z0475_rxxxx_scriptdevzero.sql
@@ -0,0 +1 @@
+UPDATE script_texts SET type=6 WHERE entry IN (-1036000, -1036001);
diff --git a/sql/Updates/z0476_rxxxx_mangoszero.sql b/sql/Updates/z0476_rxxxx_mangoszero.sql
new file mode 100644
index 00000000..fcfcff32
--- /dev/null
+++ b/sql/Updates/z0476_rxxxx_mangoszero.sql
@@ -0,0 +1 @@
+UPDATE gameobject_template SET ScriptName='' WHERE entry=101833;
diff --git a/sql/mangoszero_scriptname_full.sql b/sql/mangoszero_scriptname_full.sql
index 5c743012..f3eee6b7 100644
--- a/sql/mangoszero_scriptname_full.sql
+++ b/sql/mangoszero_scriptname_full.sql
@@ -239,7 +239,6 @@ UPDATE creature_template SET ScriptName='npc_threshwackonator' WHERE entry=6669;
UPDATE creature_template SET ScriptName='boss_mr_smite' WHERE entry=646;
UPDATE instance_template SET ScriptName='instance_deadmines' WHERE map=36;
UPDATE gameobject_template SET ScriptName='go_defias_cannon' WHERE entry=16398;
-UPDATE gameobject_template SET ScriptName='go_door_lever_dm' WHERE entry=101833;
/* DEADWIND PASS */
diff --git a/sql/scriptdevzero_script_full.sql b/sql/scriptdevzero_script_full.sql
index 4c7ed8cd..8aa9d8fc 100644
--- a/sql/scriptdevzero_script_full.sql
+++ b/sql/scriptdevzero_script_full.sql
@@ -745,7 +745,7 @@ INSERT INTO script_texts (entry,content_default,sound,type,language,emote,commen
(-1000714,'Well, I\'m off to the Gelkis. They\'re not as dumb as the Maraudines, but they\'re more reasonable.',0,0,0,3,'melizza SAY_3'),
(-1000715,'We will locate the origin of the Nightmare through the fragments you collected, $N. From there, we will pull Eranikus through a rift in the Dream. Steel yourself, $C. We are inviting the embodiment of the Nightmare into our world.',0,0,0,0,'remulos SAY_REMULOS_INTRO_1'),
-(-1000716,'To Nighthaven! Keep your army close, champion.',0,0,0,0,'remulos SAY_REMULOS_INTRO_2'),
+(-1000716,'To Nighthaven! Keep your army close, champion. ',0,0,0,0,'remulos SAY_REMULOS_INTRO_2'),
(-1000717,'The rift will be opened there, above the Lake Elun\'ara. Prepare yourself, $N. Eranikus entry into our world will be wrought with chaos and strife.',0,0,0,0,'remulos SAY_REMULOS_INTRO_3'),
(-1000718,'He will stop at nothing to get to Malfurion\'s physical manifistation. That must not happen... We must keep the beast occupied long enough for Tyrande to arrive.',0,0,0,0,'remulos SAY_REMULOS_INTRO_4'),
(-1000719,'Defend Nightaven, hero...',0,0,0,0,'remulos SAY_REMULOS_INTRO_5'),
@@ -843,15 +843,15 @@ INSERT INTO script_texts (entry,content_default,sound,type,language,emote,commen
-- -1 036 000 DEADMINES
INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES
-(-1036000,'You there, check out that noise.',5775,1,7,0,'smite INST_SAY_ALARM1'),
-(-1036001,'We\'re under attack! A vast, ye swabs! Repel the invaders!',5777,1,7,0,'smite INST_SAY_ALARM2'),
+(-1036000,'You there, check out that noise.',5775,6,7,0,'smite INST_SAY_ALARM1'),
+(-1036001,'We\'re under attack! A vast, ye swabs! Repel the invaders!',5777,6,7,0,'smite INST_SAY_ALARM2'),
(-1036002,'You land lubbers are tougher than I thought! I\'ll have to improvise!',5778,0,0,21,'smite SAY_PHASE_2'),
(-1036003,'D\'ah! Now you\'re making me angry!',5779,0,0,15,'smite SAY_PHASE_3');
-- -1 043 000 WAILING CAVERNS
INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES
(-1043000,'At last! Naralex can be awakened! Come aid me, brave adventurers!',0,6,0,0,'Disciple of Naralex - SAY_INTRO'),
-(-1043001,'I must make the nescessary preparations before the awakening ritual can begin. You must protect me!',0,0,0,0,'SAY_PREPARE'),
+(-1043001,'I must make the necessary preparations before the awakening ritual can begin. You must protect me!',0,0,0,0,'SAY_PREPARE'),
(-1043002,'These caverns were once a temple of promise for regrowth in the Barrens. Now, they are the halls of nightmares.',0,0,0,0,'Disciple of Naralex - SAY_FIRST_CORNER'),
(-1043003,'Come. We must continue. There is much to be done before we can pull Naralex from his nightmare.',0,0,0,0,'Disciple of Naralex - SAY_CONTINUE'),
(-1043004,'Within this circle of fire I must cast the spell to banish the spirits of the slain Fanglords.',0,0,0,0,'Disciple of Naralex - SAY_CIRCLE_BANISH'),
diff --git a/system/ScriptLoader.cpp b/system/ScriptLoader.cpp
index d2105e10..8dfbf37c 100644
--- a/system/ScriptLoader.cpp
+++ b/system/ScriptLoader.cpp
@@ -134,7 +134,6 @@ extern void AddSC_stratholme();
extern void AddSC_instance_sunken_temple(); //sunken_temple
extern void AddSC_sunken_temple();
extern void AddSC_boss_archaedas(); //uldaman
-extern void AddSC_boss_ironaya();
extern void AddSC_uldaman();
extern void AddSC_instance_uldaman();
extern void AddSC_boss_arlokk(); //zulgurub
@@ -353,7 +352,6 @@ void AddScripts()
AddSC_instance_sunken_temple(); //sunken_temple
AddSC_sunken_temple();
AddSC_boss_archaedas(); //uldaman
- AddSC_boss_ironaya();
AddSC_uldaman();
AddSC_instance_uldaman();
AddSC_boss_arlokk(); //zulgurub
diff --git a/system/revision_nr.h b/system/revision_nr.h
index 1fc9a814..0bf77269 100644
--- a/system/revision_nr.h
+++ b/system/revision_nr.h
@@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
- #define REVISION_NR "0468"
+ #define REVISION_NR "0477"
#endif // __REVISION_NR_H__
diff --git a/tool/git_id/CMakeLists.txt b/tool/git_id/CMakeLists.txt
index 5250bebc..90bbd6ac 100644
--- a/tool/git_id/CMakeLists.txt
+++ b/tool/git_id/CMakeLists.txt
@@ -15,6 +15,6 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-SET(CMAKE_VERBOSE_MAKEFILE ON)
-cmake_minimum_required (VERSION 2.6)
+cmake_minimum_required (VERSION 2.8)
+
ADD_EXECUTABLE (git_id git_id.cpp)