Advertisement
Guest User

Untitled

a guest
Jun 23rd, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.64 KB | None | 0 0
  1. /*####mob_riven_widow_cocon####*/
  2.  
  3. enum
  4. {
  5.     NPC_FREED_WINTERHOOF_LONGRUNNER      = 24211,
  6.     QUEST_RIVENWOOD_CAPTIVES         = 11296
  7.    
  8. };
  9.  
  10. const uint32 riven_widow_coconVictims[3] =
  11. {
  12.     23990, 23989, 23991
  13. };
  14. struct MANGOS_DLL_DECL mob_riven_widow_cocon_victimAI : public ScriptedAI
  15. {
  16.     mob_riven_widow_cocon_victimAI(Creature* pCreature) : ScriptedAI(pCreature)
  17.     {
  18.         SetCombatMovement(false);
  19.         Reset();
  20.     }
  21.  
  22.     void Reset() { }
  23.     void MoveInLineOfSight(Unit* pWho) { }
  24.  
  25.     void JustDied(Unit* pKiller)
  26.     {
  27.         if (pKiller->GetTypeId() == TYPEID_PLAYER)
  28.         {
  29.             if (((Player*)pKiller)->GetQuestStatus(QUEST_RIVENWOOD_CAPTIVES) == QUEST_STATUS_INCOMPLETE)
  30.             {
  31.                 if (!urand(0, 3))
  32.                 {
  33.                     m_creature->SummonCreature(NPC_FREED_WINTERHOOF_LONGRUNNER, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000);
  34.                     ((Player*)pKiller)->KilledMonsterCredit(NPC_FREED_WINTERHOOF_LONGRUNNER, m_creature->GetGUID());
  35.                 }
  36.                 else
  37.                     m_creature->SummonCreature(riven_widow_coconVictims[rand()%3], 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,60000);
  38.             }
  39.         }
  40.     }
  41. };
  42.  
  43. CreatureAI* GetAI_mob_riven_widow_cocon_victim(Creature* pCreature)
  44. {
  45.     return new mob_riven_widow_cocon_victimAI(pCreature);
  46. }
  47.  
  48. void AddSC_howling_fjord()
  49. {
  50.     Script* newscript;
  51.  
  52.     newscript = new Script;
  53.     newscript->Name = "mob_riven_widow_cocon_victim";
  54.     newscript->GetAI = &GetAI_mob_riven_widow_cocon_victim;
  55.     newscript->RegisterSelf();
  56. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement