Advertisement
Guest User

Untitled

a guest
Jun 23rd, 2017
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.19 KB | None | 0 0
  1. /*Author: Byeqq*/
  2. /*###############
  3. ##mob_reservist##
  4. ###############*/
  5.  
  6. enum
  7. {
  8.     SPELL_NORTH_FLEET_RESERVIST_KILL_CREDIT                  = 43138,
  9.     QUEST_TEST_AT_SEA                            = 11170,
  10.     SPELL_PLAGUE_VIAL                            = 43115
  11.  
  12. };
  13.  
  14.  
  15. struct MANGOS_DLL_DECL mob_reservistAI : public ScriptedAI
  16. {
  17.     mob_reservistAI(Creature* pCreature) : ScriptedAI(pCreature)
  18.     {
  19.         SetCombatMovement(false);
  20.         Reset();
  21.     }
  22.  
  23.    
  24.    
  25. void Reset(){}
  26.  
  27.  
  28. void SpellHit(Unit* pCaster, const SpellEntry* pSpell)
  29.     {
  30.    
  31.         if (pCaster->GetTypeId() == TYPEID_PLAYER && pSpell->Id == SPELL_PLAGUE_VIAL)
  32.         {
  33.             if (((Player*)pCaster)->GetQuestStatus(QUEST_TEST_AT_SEA) == QUEST_STATUS_INCOMPLETE)
  34.             {
  35.                 m_creature->CastSpell(pCaster,SPELL_NORTH_FLEET_RESERVIST_KILL_CREDIT,true);
  36.                 m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
  37.                
  38.                
  39.             }
  40.    
  41.         }
  42.  
  43.     }
  44. };
  45.  
  46.  
  47. CreatureAI* GetAI_mob_reservist(Creature* pCreature)
  48. {
  49.     return new mob_reservistAI(pCreature);
  50. }
  51.  
  52.  
  53. void AddSC_howling_fjord()
  54. {
  55.     Script* newscript;
  56.  
  57.     newscript = new Script;
  58.     newscript->Name = "mob_reservist";
  59.     newscript->GetAI = &GetAI_mob_reservist;
  60.     newscript->RegisterSelf();
  61.  
  62. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement