Zdravím uživatele wowresource.eu
Chtěl bych vás poprosit o pomoc s custom bossem. Vytvořil jsem C++ script pro bosse, zapsal jsem ho do ScriptLoaderu i do CMakeListu, zkompiloval jsem to bez chyb. V DB jsem tento script přiřadil mnou vytvořenému npc. Když toto npc spawnu, tak script vůbec nevyužívá, ale ve výpisu z příkazu .npc i se vypíše, že script je k tomuto npc přiřazen. Vůbec netuším kde by mohl být problém, tak žádám o pomoc vás.
Děkuji za pomoc
boss_gasguald.cpp
#include "ScriptPCH.h"
#define SPELL_SBREATH 57570
#define SPELL_SDOT 57579
#define SPELL_TAIL 74531
#define SPELL_CLEAVE 74524
#define SPELL_FEAR 65543
class boss_gasguald : public CreatureScript
{
public:
boss_gasguald()
: CreatureScript("boss_gasguald")
{
}
struct boss_gasgualdAI : public ScriptedAI
{
boss_gasgualdAI(Creature* creature) : ScriptedAI(creature) {}
uint32 Sbreath_Timer;
uint32 Sdot_Timer;
uint32 Tail_Timer;
uint32 Cleave_Timer;
uint32 Fear_Timer;
void Reset()
{
Sbreath_Timer = 15000;
Sdot_Timer = 23000;
Tail_Timer = 20000;
Cleave_Timer = 6000;
Fear_Timer = 35000;
}
void EnterCombat(Unit * /*who*/)
{
me->MonsterYell("Enemies! Now is my time! None shall survive!", LANG_UNIVERSAL, NULL);
}
void JustDied(Unit * /*killer*/)
{
me->MonsterYell("I.. I have been.. defeated! How.. can this.. be?", LANG_UNIVERSAL, NULL);
}
void KilledUnit(Unit * /*victim*/)
{
me->MonsterYell("You tried to kill me and you die! How funny end!", LANG_UNIVERSAL, NULL);
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
//Sbreath_Timer
if (Sbreath_Timer <= diff)
{
DoCast (me->getVictim(), SPELL_SBREATH);
Sbreath_Timer = 15000;
} else Sbreath_Timer -= diff;
//Sdot_Timer
if (Sdot_Timer <= diff)
{
DoCast (me->getVictim(), SPELL_SDOT);
Sdot_Timer = 23000;
} else Sdot_Timer -=diff;
//Tail_Timer
if (Tail_Timer <= diff)
{
DoCast (me->getVictim(), SPELL_TAIL);
Tail_Timer = 20000;
} else Tail_Timer -= diff;
//Cleave_Timer
if (Cleave_Timer <= diff)
{
DoCast (me->getVictim(), SPELL_CLEAVE);
Cleave_Timer = 6000;
} else Cleave_Timer -= diff;
//Fear_Timer
if (Fear_Timer <= diff)
{
DoCast (me->getVictim(), SPELL_FEAR);
Fear_Timer = 35000;
} else Fear_Timer -= diff;
DoMeleeAttackIfReady();
}
};
};
void AddSC_boss_gasguald()
{
new boss_gasguald();
}
ScriptLoader.cpp
#ifdef SCRIPTS
/* This is where custom scripts' loading functions should be declared. */
void AddSC_boss_gasguald();
#endif
void AddCustomScripts()
{
#ifdef SCRIPTS
/* This is where custom scripts should be added. */
AddSC_boss_gasguald();
#endif
}
CMakeList.txt
# Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
#
# This file is free software; as a special exception the author gives
# unlimited permission to copy and/or distribute it, with or without
# modifications, as long as this notice is preserved.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
set(scripts_STAT_SRCS
${scripts_STAT_SRCS}
Custom/boss_gasguald.cpp
)
message(" -> Prepared: Custom")