Merge branch 'master' of github.com:TrinityCore/TrinityCore into 4.3.4
Conflicts: src/server/scripts/Kalimdor/moonglade.cpp
This commit is contained in:
commit
61fcae113b
20 files changed
+128
-140
No files matched your search
@@ -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()
|
||||
|
||||
@@ -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]);
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -36,6 +36,7 @@ enum Spells
|
||||
SPELL_SLEEP = 52721, //Puts an enemy to sleep for up to 10 sec. Any damage caused will awaken the target.
|
||||
H_SPELL_SLEEP = 58849,
|
||||
SPELL_VAMPIRIC_TOUCH = 52723, //Heals the caster for half the damage dealt by a melee attack.
|
||||
SPELL_MAL_GANIS_KILL_CREDIT = 58124, // Quest credit
|
||||
SPELL_KILL_CREDIT = 58630 // Non-existing spell as encounter credit, created in spell_dbc
|
||||
};
|
||||
|
||||
@@ -238,9 +239,9 @@ public:
|
||||
if (instance)
|
||||
{
|
||||
instance->SetData(DATA_MAL_GANIS_EVENT, DONE);
|
||||
|
||||
DoCastAOE(SPELL_MAL_GANIS_KILL_CREDIT);
|
||||
// give achievement credit and LFG rewards to players. criteria use spell 58630 which doesn't exist, but it was created in spell_dbc
|
||||
DoCast(me, SPELL_KILL_CREDIT);
|
||||
DoCastAOE(SPELL_KILL_CREDIT);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -119,6 +119,18 @@ public:
|
||||
void Initialize()
|
||||
{
|
||||
GahzRillaEncounter = NOT_STARTED;
|
||||
ZumrahGUID = 0;
|
||||
BlyGUID = 0;
|
||||
WeegliGUID = 0;
|
||||
OroGUID = 0;
|
||||
RavenGUID = 0;
|
||||
MurtaGUID = 0;
|
||||
EndDoorGUID = 0;
|
||||
PyramidPhase = 0;
|
||||
major_wave_Timer = 0;
|
||||
minor_wave_Timer = 0;
|
||||
addGroupSize = 0;
|
||||
waypoint = 0;
|
||||
}
|
||||
|
||||
void OnCreatureCreate(Creature* creature)
|
||||
|
||||
-2
@@ -219,8 +219,6 @@ public:
|
||||
}
|
||||
|
||||
InstanceScript* instance;
|
||||
|
||||
Creature* pMemory;
|
||||
uint64 MemoryGUID;
|
||||
|
||||
bool bHealth;
|
||||
|
||||
@@ -190,16 +190,12 @@ public:
|
||||
{
|
||||
OUT_SAVE_INST_DATA;
|
||||
|
||||
std::string str_data;
|
||||
|
||||
std::ostringstream saveStream;
|
||||
saveStream << "D K " << m_auiEncounter[0] << ' ' << m_auiEncounter[1] << ' '
|
||||
<< m_auiEncounter[2] << ' ' << m_auiEncounter[3];
|
||||
|
||||
str_data = saveStream.str();
|
||||
|
||||
OUT_SAVE_INST_DATA_COMPLETE;
|
||||
return str_data;
|
||||
return saveStream.str();
|
||||
}
|
||||
|
||||
void Load(const char* in)
|
||||
|
||||
@@ -134,6 +134,7 @@ class instance_ulduar : public InstanceMapScript
|
||||
elderCount = 0;
|
||||
conSpeedAtory = false;
|
||||
Unbroken = true;
|
||||
_algalonSummoned = false;
|
||||
_summonAlgalon = false;
|
||||
|
||||
memset(AlgalonSigilDoorGUID, 0, sizeof(AlgalonSigilDoorGUID));
|
||||
|
||||
@@ -101,6 +101,7 @@ public:
|
||||
boss_ingvar_the_plundererAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
instance = creature->GetInstanceScript();
|
||||
bIsUndead = false;
|
||||
}
|
||||
|
||||
InstanceScript* instance;
|
||||
|
||||
@@ -600,100 +600,99 @@ enum eSmokeEmOut
|
||||
QUEST_SMOKE_EM_OUT_H = 12324,
|
||||
SPELL_SMOKE_BOMB = 49075,
|
||||
SPELL_CHOP = 43410,
|
||||
NPC_VENTURE_CO_STABLES_KC = 27568,
|
||||
SPELL_VENTURE_STRAGGLER_CREDIT = 49093,
|
||||
};
|
||||
|
||||
class npc_venture_co_straggler : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_venture_co_straggler() : CreatureScript("npc_venture_co_straggler") { }
|
||||
public:
|
||||
npc_venture_co_straggler() : CreatureScript("npc_venture_co_straggler") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new npc_venture_co_stragglerAI(creature);
|
||||
}
|
||||
|
||||
struct npc_venture_co_stragglerAI : public ScriptedAI
|
||||
{
|
||||
npc_venture_co_stragglerAI(Creature* creature) : ScriptedAI(creature) { }
|
||||
|
||||
uint64 uiPlayerGUID;
|
||||
uint32 uiRunAwayTimer;
|
||||
uint32 uiTimer;
|
||||
uint32 uiChopTimer;
|
||||
|
||||
void Reset()
|
||||
struct npc_venture_co_stragglerAI : public ScriptedAI
|
||||
{
|
||||
uiPlayerGUID = 0;
|
||||
uiTimer = 0;
|
||||
uiChopTimer = urand(10000, 12500);
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC);
|
||||
me->SetReactState(REACT_AGGRESSIVE);
|
||||
}
|
||||
npc_venture_co_stragglerAI(Creature* creature) : ScriptedAI(creature) { }
|
||||
|
||||
void UpdateAI(const uint32 uiDiff)
|
||||
{
|
||||
if (uiRunAwayTimer <= uiDiff)
|
||||
uint64 uiPlayerGUID;
|
||||
uint32 uiRunAwayTimer;
|
||||
uint32 uiTimer;
|
||||
uint32 uiChopTimer;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
if (Player* player = Unit::GetPlayer(*me, uiPlayerGUID))
|
||||
uiPlayerGUID = 0;
|
||||
uiTimer = 0;
|
||||
uiRunAwayTimer = 0;
|
||||
uiChopTimer = urand(10000, 12500);
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC);
|
||||
me->SetReactState(REACT_AGGRESSIVE);
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 uiDiff)
|
||||
{
|
||||
if (uiPlayerGUID && uiRunAwayTimer <= uiDiff)
|
||||
{
|
||||
switch (uiTimer)
|
||||
if (Player* player = Unit::GetPlayer(*me, uiPlayerGUID))
|
||||
{
|
||||
case 0:
|
||||
if (player->GetQuestStatus(QUEST_SMOKE_EM_OUT_A) == QUEST_STATUS_INCOMPLETE ||
|
||||
player->GetQuestStatus(QUEST_SMOKE_EM_OUT_H) == QUEST_STATUS_INCOMPLETE)
|
||||
player->KilledMonsterCredit(NPC_VENTURE_CO_STABLES_KC, 0);
|
||||
me->GetMotionMaster()->MovePoint(0, me->GetPositionX()-7, me->GetPositionY()+7, me->GetPositionZ());
|
||||
uiRunAwayTimer = 2500;
|
||||
++uiTimer;
|
||||
break;
|
||||
case 1:
|
||||
DoScriptText(RAND(SAY_SEO1, SAY_SEO2, SAY_SEO3, SAY_SEO4, SAY_SEO5), me);
|
||||
me->GetMotionMaster()->MovePoint(0, me->GetPositionX()-7, me->GetPositionY()-5, me->GetPositionZ());
|
||||
uiRunAwayTimer = 2500;
|
||||
++uiTimer;
|
||||
break;
|
||||
case 2:
|
||||
me->GetMotionMaster()->MovePoint(0, me->GetPositionX()-5, me->GetPositionY()-5, me->GetPositionZ());
|
||||
uiRunAwayTimer = 2500;
|
||||
++uiTimer;
|
||||
break;
|
||||
case 3:
|
||||
me->DisappearAndDie();
|
||||
uiTimer = 0;
|
||||
break;
|
||||
switch (uiTimer)
|
||||
{
|
||||
case 0:
|
||||
DoCast(player, SPELL_VENTURE_STRAGGLER_CREDIT);
|
||||
me->GetMotionMaster()->MovePoint(0, me->GetPositionX()-7, me->GetPositionY()+7, me->GetPositionZ());
|
||||
uiRunAwayTimer = 2500;
|
||||
++uiTimer;
|
||||
break;
|
||||
case 1:
|
||||
DoScriptText(RAND(SAY_SEO1, SAY_SEO2, SAY_SEO3, SAY_SEO4, SAY_SEO5), me);
|
||||
me->GetMotionMaster()->MovePoint(0, me->GetPositionX()-7, me->GetPositionY()-5, me->GetPositionZ());
|
||||
uiRunAwayTimer = 2500;
|
||||
++uiTimer;
|
||||
break;
|
||||
case 2:
|
||||
me->GetMotionMaster()->MovePoint(0, me->GetPositionX()-5, me->GetPositionY()-5, me->GetPositionZ());
|
||||
uiRunAwayTimer = 2500;
|
||||
++uiTimer;
|
||||
break;
|
||||
case 3:
|
||||
me->DisappearAndDie();
|
||||
uiTimer = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (uiRunAwayTimer)
|
||||
uiRunAwayTimer -= uiDiff;
|
||||
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (uiChopTimer <= uiDiff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_CHOP);
|
||||
uiChopTimer = urand(10000, 12000);
|
||||
}
|
||||
else
|
||||
uiChopTimer -= uiDiff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
else
|
||||
uiRunAwayTimer -= uiDiff;
|
||||
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (uiChopTimer <= uiDiff)
|
||||
void SpellHit(Unit* caster, SpellInfo const* spell)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_CHOP);
|
||||
uiChopTimer = urand(10000, 12000);
|
||||
if (spell->Id == SPELL_SMOKE_BOMB && caster->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC);
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
me->CombatStop(false);
|
||||
uiPlayerGUID = caster->GetGUID();
|
||||
uiRunAwayTimer = 3500;
|
||||
}
|
||||
}
|
||||
else
|
||||
uiChopTimer -= uiDiff;
|
||||
};
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
void SpellHit(Unit* pCaster, const SpellInfo* pSpell)
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
if (pCaster && pCaster->GetTypeId() == TYPEID_PLAYER && pSpell->Id == SPELL_SMOKE_BOMB)
|
||||
{
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC);
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
me->CombatStop(false);
|
||||
uiPlayerGUID = pCaster->GetGUID();
|
||||
uiRunAwayTimer = 3500;
|
||||
}
|
||||
return new npc_venture_co_stragglerAI(creature);
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
void AddSC_grizzly_hills()
|
||||
|
||||
@@ -171,6 +171,7 @@ public:
|
||||
summonTraveler_Timer = 90000;
|
||||
banish_Timer = 17000;
|
||||
HelpYell = false;
|
||||
sumportals = false;
|
||||
destroyPortals();
|
||||
|
||||
if (instance)
|
||||
|
||||
@@ -200,16 +200,12 @@ public:
|
||||
std::string GetSaveData()
|
||||
{
|
||||
OUT_SAVE_INST_DATA;
|
||||
|
||||
std::ostringstream stream;
|
||||
stream << m_auiEncounter[0] << ' ' << m_auiEncounter[1] << ' ' << m_auiEncounter[2] << ' ' << m_auiEncounter[3];
|
||||
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)
|
||||
|
||||
@@ -171,15 +171,9 @@ public:
|
||||
OUT_SAVE_INST_DATA;
|
||||
std::ostringstream stream;
|
||||
stream << m_auiEncounter[0] << ' ' << m_auiEncounter[1];
|
||||
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)
|
||||
|
||||
@@ -166,16 +166,12 @@ class instance_the_eye : public InstanceMapScript
|
||||
std::string GetSaveData()
|
||||
{
|
||||
OUT_SAVE_INST_DATA;
|
||||
|
||||
std::ostringstream stream;
|
||||
stream << m_auiEncounter[0] << ' ' << m_auiEncounter[1] << ' ' << m_auiEncounter[2] << ' ' << m_auiEncounter[3];
|
||||
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)
|
||||
|
||||
Reference in new issue
Block a user