fix(DB/SAI): Lazy Peons quest (#1348)
- Quest: Lazy Peons: Moved from core to SAI - Lazy Peon will now play work sounds - Lazy Peon will now display the axe-swing emote - Lazy Peon will now kneel in front of the pile, and start cutting in front of the tree - Lazy Peon will now use better positions and orientations for the wood pile and the trees - Lazy Peon will fall asleep after 80 seconds of working - Lazy Peon will now activate itself every 120 000 till 150 000 milliseconds
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -10,90 +10,6 @@
|
|||||||
#include "SpellScript.h"
|
#include "SpellScript.h"
|
||||||
#include "Player.h"
|
#include "Player.h"
|
||||||
|
|
||||||
/*######
|
|
||||||
##Quest 5441: Lazy Peons
|
|
||||||
##npc_lazy_peon
|
|
||||||
######*/
|
|
||||||
|
|
||||||
enum LazyPeonYells
|
|
||||||
{
|
|
||||||
SAY_SPELL_HIT = 0
|
|
||||||
};
|
|
||||||
|
|
||||||
enum LazyPeon
|
|
||||||
{
|
|
||||||
QUEST_LAZY_PEONS = 5441,
|
|
||||||
GO_LUMBERPILE = 175784,
|
|
||||||
SPELL_BUFF_SLEEP = 17743,
|
|
||||||
SPELL_AWAKEN_PEON = 19938
|
|
||||||
};
|
|
||||||
|
|
||||||
class npc_lazy_peon : public CreatureScript
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
npc_lazy_peon() : CreatureScript("npc_lazy_peon") { }
|
|
||||||
|
|
||||||
CreatureAI* GetAI(Creature* creature) const
|
|
||||||
{
|
|
||||||
return new npc_lazy_peonAI(creature);
|
|
||||||
}
|
|
||||||
|
|
||||||
struct npc_lazy_peonAI : public ScriptedAI
|
|
||||||
{
|
|
||||||
npc_lazy_peonAI(Creature* creature) : ScriptedAI(creature) { }
|
|
||||||
|
|
||||||
uint64 PlayerGUID;
|
|
||||||
|
|
||||||
uint32 RebuffTimer;
|
|
||||||
bool work;
|
|
||||||
|
|
||||||
void Reset()
|
|
||||||
{
|
|
||||||
PlayerGUID = 0;
|
|
||||||
RebuffTimer = 0;
|
|
||||||
work = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
void MovementInform(uint32 /*type*/, uint32 id)
|
|
||||||
{
|
|
||||||
if (id == 1)
|
|
||||||
work = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void SpellHit(Unit* caster, const SpellInfo* spell)
|
|
||||||
{
|
|
||||||
if (spell->Id != SPELL_AWAKEN_PEON)
|
|
||||||
return;
|
|
||||||
|
|
||||||
Player* player = caster->ToPlayer();
|
|
||||||
if (player && player->GetQuestStatus(QUEST_LAZY_PEONS) == QUEST_STATUS_INCOMPLETE)
|
|
||||||
{
|
|
||||||
player->KilledMonsterCredit(me->GetEntry(), me->GetGUID());
|
|
||||||
Talk(SAY_SPELL_HIT, caster);
|
|
||||||
me->RemoveAllAuras();
|
|
||||||
if (GameObject* Lumberpile = me->FindNearestGameObject(GO_LUMBERPILE, 20))
|
|
||||||
me->GetMotionMaster()->MovePoint(1, Lumberpile->GetPositionX()-1, Lumberpile->GetPositionY(), Lumberpile->GetPositionZ());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void UpdateAI(uint32 diff)
|
|
||||||
{
|
|
||||||
if (work == true)
|
|
||||||
me->HandleEmoteCommand(EMOTE_ONESHOT_WORK_CHOPWOOD);
|
|
||||||
if (RebuffTimer <= diff)
|
|
||||||
{
|
|
||||||
DoCast(me, SPELL_BUFF_SLEEP);
|
|
||||||
RebuffTimer = 300000; //Rebuff agian in 5 minutes
|
|
||||||
}
|
|
||||||
else
|
|
||||||
RebuffTimer -= diff;
|
|
||||||
if (!UpdateVictim())
|
|
||||||
return;
|
|
||||||
DoMeleeAttackIfReady();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
enum Texts
|
enum Texts
|
||||||
{
|
{
|
||||||
// Tiger Matriarch Credit
|
// Tiger Matriarch Credit
|
||||||
@@ -574,7 +490,6 @@ class spell_voodoo : public SpellScriptLoader
|
|||||||
|
|
||||||
void AddSC_durotar()
|
void AddSC_durotar()
|
||||||
{
|
{
|
||||||
new npc_lazy_peon();
|
|
||||||
new npc_tiger_matriarch_credit();
|
new npc_tiger_matriarch_credit();
|
||||||
new npc_tiger_matriarch();
|
new npc_tiger_matriarch();
|
||||||
new npc_troll_volunteer();
|
new npc_troll_volunteer();
|
||||||
|
|||||||
Reference in New Issue
Block a user