Krinolin

Untitled

Mar 10th, 2013
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 4.26 KB | None | 0 0
  1. /*
  2.  Errors when compiling
  3. */
  4.  
  5. 3>  Flameh.cpp
  6. 3>..\..\..\..\build\src\server\scripts\Custom\Flameh.cpp(71): warning C4373: 'Flameh::Custom_BossAI::UpdateAI': virtual function overrides 'ScriptedAI::UpdateAI', previous versions of the compiler did not override when parameters only differed by const/volatile qualifiers
  7. 3>          C:/Users/Racoon/Desktop/TrinityCompiled - Copy/Source/build/src/server/game/AI/ScriptedAI\ScriptedCreature.h(93) : see declaration of 'ScriptedAI::UpdateAI'
  8. 3>..\..\..\..\build\src\server\scripts\Custom\Flameh.cpp(61): error C3861: 'DoScriptText': identifier not found
  9. 3>..\..\..\..\build\src\server\scripts\Custom\Flameh.cpp(67): error C3861: 'DoScriptText': identifier not found
  10. 3>..\..\..\..\build\src\server\scripts\Custom\Flameh.cpp(68): error C3861: 'DoScriptText': identifier not found
  11. 3>..\..\..\..\build\src\server\scripts\Custom\Flameh.cpp(79): error C3861: 'DoScriptText': identifier not found
  12. 4>------ Build started: Project: worldserver, Configuration: Release Win32 ------
  13. 4>     Creating library C:/Users/Racoon/Desktop/TrinityCompiled - Copy/Source/Trinity/src/server/worldserver/Release/worldserver.lib and object C:/Users/Racoon/Desktop/TrinityCompiled - Copy/Source/Trinity/src/server/worldserver/Release/worldserver.exp
  14. 4>game.lib(ScriptLoader.obj) : error LNK2019: unresolved external symbol "void __cdecl AddSC_Flameh(void)" (?AddSC_Flameh@@YAXXZ) referenced in function "void __cdecl AddCustomScripts(void)" (?AddCustomScripts@@YAXXZ)
  15. 4>C:\Users\Racoon\Desktop\TrinityCompiled - Copy\Source\Trinity\bin\Release\worldserver.exe : fatal error LNK1120: 1 unresolved externals
  16.  
  17.  
  18. /*
  19. The whole script
  20. */
  21.  
  22. #include "ScriptPCH.h"
  23.      
  24. enum Yells
  25. {
  26.     SAY_AGGRO                   = -1603278,
  27.     SAY_ENRAGE                  = -1189002,
  28.     SAY_KILL                    = -1189003
  29. };
  30.  
  31. enum Emotes
  32. {
  33.     EMOTE_ENRAGE                = -1189004
  34. };
  35.  
  36. enum Spells
  37. {
  38.     SPELL_RUSHINGCHARGE         = 8260,
  39.     SPELL_BARKSKIN              =22812,
  40.     SPELL_FIREBREATH            =74528,
  41.     SPELL_RAKE                  =1822,
  42.     SPELL_FRENZY                = 8269,
  43. };
  44.      
  45. class Flameh : public CreatureScript
  46. {
  47. public:
  48.    Flameh() : CreatureScript("Flameh") { }
  49.  
  50.     CreatureAI* GetAI(Creature* creature) const
  51.     {
  52.         return new Custom_BossAI(creature);
  53.     }
  54.  
  55.     struct Custom_BossAI : public ScriptedAI
  56.     {
  57.         Custom_BossAI(Creature* creature) : ScriptedAI(creature) {}
  58.  
  59.         bool Enrage;
  60.  
  61.         uint32 BARKSKIN_Timer;
  62.         uint32 FIREBREATH_Timer;
  63.         uint32 RAKE_Timer;
  64.        
  65.         void Reset()
  66.         {
  67.             Enrage = false;
  68.            BARKSKIN_Timer = 25000;
  69.            FIREBREATH_Timer = 3000;
  70.            RAKE_Timer = 6000;
  71.            
  72.  }
  73.  
  74.  
  75.                 void EnterCombat(Unit* /*who*/)
  76.         {
  77.            DoScriptText(SAY_AGGRO, me);
  78.             DoCast(me, SPELL_RUSHINGCHARGE);
  79.         }
  80.  
  81.          void KilledUnit(Unit* /*victim*/)
  82.          {
  83.              DoScriptText(SAY_AGGRO, me);
  84.              DoScriptText(SAY_KILL, me);
  85.          }
  86.          
  87.                  void UpdateAI(const uint32 diff)
  88.         {
  89.             if (!UpdateVictim())
  90.                 return;
  91.  
  92.             //If we are <25% hp goes Enraged
  93.             if (!Enrage && !HealthAbovePct(25) && !me->IsNonMeleeSpellCasted(false))
  94.             {
  95.                 DoScriptText(EMOTE_ENRAGE, me);
  96.                 DoCast(me, SPELL_FRENZY);
  97.                 Enrage = true;
  98.             }
  99.            
  100.  
  101.             //BARKSKIN_Timer
  102.             if (BARKSKIN_Timer <= diff)
  103.             {
  104.                 DoCast(me->getVictim(), SPELL_BARKSKIN);
  105.                 BARKSKIN_Timer = 9000;
  106.             }
  107.             else BARKSKIN_Timer -= diff;
  108.  
  109.             // FIREBREATH_Timer
  110.             if (FIREBREATH_Timer <= diff)
  111.             {
  112.                 DoCast(me->getVictim(), SPELL_FIREBREATH);
  113.                 FIREBREATH_Timer = 3000;
  114.             }
  115.             else FIREBREATH_Timer -= diff;
  116.            
  117.               DoMeleeAttackIfReady();
  118.              
  119.              
  120.              
  121.               // RAKE_Timer
  122.             if (RAKE_Timer <= diff)
  123.             {
  124.                 DoCast(me->getVictim(), SPELL_RAKE);
  125.                 RAKE_Timer = 4000;
  126.             }
  127.             else RAKE_Timer -= diff;
  128.  
  129.             DoMeleeAttackIfReady();
  130.  
  131.            
  132.         }
  133.     };
  134. };
  135.  
  136. void AddSC_Flameh()
  137. {
  138.     new Flameh();
  139. }
Advertisement
Add Comment
Please, Sign In to add comment