Merge pull request #3889 from Souler/master
Core/Achievements: Implement "Snakes. Why'd It Have To Be Snakes?"
This commit is contained in:
@@ -52,6 +52,7 @@ enum Creatures
|
|||||||
enum ConstrictorSpells
|
enum ConstrictorSpells
|
||||||
{
|
{
|
||||||
SPELL_GRIP_OF_SLAD_RAN = 55093,
|
SPELL_GRIP_OF_SLAD_RAN = 55093,
|
||||||
|
SPELL_SNAKE_WRAP = 55126,
|
||||||
SPELL_VENOMOUS_BITE = 54987,
|
SPELL_VENOMOUS_BITE = 54987,
|
||||||
H_SPELL_VENOMOUS_BITE = 58996
|
H_SPELL_VENOMOUS_BITE = 58996
|
||||||
};
|
};
|
||||||
@@ -65,6 +66,8 @@ static Position SpawnLoc[]=
|
|||||||
{1716.76f, 635.159f, 129.282f, 0.191986f}
|
{1716.76f, 635.159f, 129.282f, 0.191986f}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#define DATA_SNAKES_WHYD_IT_HAVE_TO_BE_SNAKES 1
|
||||||
|
|
||||||
class boss_slad_ran : public CreatureScript
|
class boss_slad_ran : public CreatureScript
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -89,6 +92,7 @@ public:
|
|||||||
|
|
||||||
uint8 uiPhase;
|
uint8 uiPhase;
|
||||||
|
|
||||||
|
std::set<uint64> lWrappedPlayers;
|
||||||
SummonList lSummons;
|
SummonList lSummons;
|
||||||
|
|
||||||
InstanceScript* instance;
|
InstanceScript* instance;
|
||||||
@@ -100,6 +104,7 @@ public:
|
|||||||
uiVenomBoltTimer = 15*IN_MILLISECONDS;
|
uiVenomBoltTimer = 15*IN_MILLISECONDS;
|
||||||
uiSpawnTimer = 5*IN_MILLISECONDS;
|
uiSpawnTimer = 5*IN_MILLISECONDS;
|
||||||
uiPhase = 0;
|
uiPhase = 0;
|
||||||
|
lWrappedPlayers.clear();
|
||||||
|
|
||||||
lSummons.DespawnAll();
|
lSummons.DespawnAll();
|
||||||
|
|
||||||
@@ -171,6 +176,7 @@ public:
|
|||||||
void JustDied(Unit* /*killer*/)
|
void JustDied(Unit* /*killer*/)
|
||||||
{
|
{
|
||||||
DoScriptText(SAY_DEATH, me);
|
DoScriptText(SAY_DEATH, me);
|
||||||
|
lSummons.DespawnAll();
|
||||||
|
|
||||||
if (instance)
|
if (instance)
|
||||||
instance->SetData(DATA_SLAD_RAN_EVENT, DONE);
|
instance->SetData(DATA_SLAD_RAN_EVENT, DONE);
|
||||||
@@ -186,6 +192,17 @@ public:
|
|||||||
summoned->GetMotionMaster()->MovePoint(0, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ());
|
summoned->GetMotionMaster()->MovePoint(0, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ());
|
||||||
lSummons.Summon(summoned);
|
lSummons.Summon(summoned);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SetGUID(uint64 guid, int32 type)
|
||||||
|
{
|
||||||
|
if (type == DATA_SNAKES_WHYD_IT_HAVE_TO_BE_SNAKES)
|
||||||
|
lWrappedPlayers.insert(guid);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool WasWrapped(uint64 guid)
|
||||||
|
{
|
||||||
|
return lWrappedPlayers.count(guid);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
@@ -215,10 +232,26 @@ public:
|
|||||||
{
|
{
|
||||||
if (!UpdateVictim())
|
if (!UpdateVictim())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (uiGripOfSladRanTimer <= diff)
|
if (uiGripOfSladRanTimer <= diff)
|
||||||
{
|
{
|
||||||
DoCast(me->getVictim(), SPELL_GRIP_OF_SLAD_RAN);
|
Unit* target = me->getVictim();
|
||||||
uiGripOfSladRanTimer = 5*IN_MILLISECONDS;
|
|
||||||
|
DoCast(target, SPELL_GRIP_OF_SLAD_RAN);
|
||||||
|
uiGripOfSladRanTimer = urand(3, 6)*IN_MILLISECONDS;
|
||||||
|
|
||||||
|
Aura* grip = target->GetAura(SPELL_GRIP_OF_SLAD_RAN, me->GetGUID());
|
||||||
|
if (grip && grip->GetStackAmount() == 5)
|
||||||
|
{
|
||||||
|
target->RemoveAurasDueToSpell(SPELL_GRIP_OF_SLAD_RAN, me->GetGUID());
|
||||||
|
target->CastSpell(target, SPELL_SNAKE_WRAP, true);
|
||||||
|
|
||||||
|
if (TempSummon* _me = me->ToTempSummon())
|
||||||
|
if (Creature* sladran = _me->GetSummoner()->ToCreature())
|
||||||
|
sladran->AI()->SetGUID(target->GetGUID() ,DATA_SNAKES_WHYD_IT_HAVE_TO_BE_SNAKES);
|
||||||
|
|
||||||
|
me->DespawnOrUnsummon();
|
||||||
|
}
|
||||||
} else uiGripOfSladRanTimer -= diff;
|
} else uiGripOfSladRanTimer -= diff;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -265,9 +298,28 @@ public:
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class achievement_snakes_whyd_it_have_to_be_snakes : public AchievementCriteriaScript
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
achievement_snakes_whyd_it_have_to_be_snakes() : AchievementCriteriaScript("achievement_snakes_whyd_it_have_to_be_snakes")
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
bool OnCheck(Player* player, Unit* target)
|
||||||
|
{
|
||||||
|
if (!target)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (boss_slad_ran::boss_slad_ranAI* sladRanAI = CAST_AI(boss_slad_ran::boss_slad_ranAI, target->GetAI()))
|
||||||
|
return !sladRanAI->WasWrapped(player->GetGUID());
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
void AddSC_boss_slad_ran()
|
void AddSC_boss_slad_ran()
|
||||||
{
|
{
|
||||||
new boss_slad_ran();
|
new boss_slad_ran();
|
||||||
new mob_slad_ran_constrictor();
|
new mob_slad_ran_constrictor();
|
||||||
new mob_slad_ran_viper();
|
new mob_slad_ran_viper();
|
||||||
}
|
new achievement_snakes_whyd_it_have_to_be_snakes();
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user