Решил немного покодить для скриптдева, вот что получилось, кто-нибудь может проверить?
компилируется без ошибок, это скрипт на Таддиуса в наксрамасе.
изначально работоспособность было нулевая, но я поднял ее примерно до 50%.
на данный момент пытаюсь сделать Polarity Shift, может кто подсказать, как кинуть бафф на всех игроков сразу? while? а как узнать кол-во человек, и выбирать по-одному?
выкладываю код и отдельно .cpp
PHP код:
/* Copyright (C) 2006 - 2011 ScriptDev2 <http://www.scriptdev2.com/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ScriptData
SDName: Boss_Thaddius
SD%Complete: 50%
SDComment: Polarity Shift is not working, mini-bosses not working.
SDCategory: Naxxramas
EndScriptData */
#include "precompiled.h"
#include "naxxramas.h"
enum
{
//Thaddus
SAY_GREET = -1533029,
SAY_AGGRO1 = -1533030,
SAY_AGGRO2 = -1533031,
SAY_AGGRO3 = -1533032,
SAY_SLAY = -1533033,
SAY_ELECT = -1533034,
SAY_DEATH = -1533035,
SAY_SCREAM1 = -1533036,
SAY_SCREAM2 = -1533037,
SAY_SCREAM3 = -1533038,
SAY_SCREAM4 = -1533039,
SPELL_BALL_LIGHTNING = 28299,
SPELL_CHARGE_POSITIVE_DMGBUFF = 29659,
SPELL_CHARGE_POSITIVE_NEARDMG = 28059,
SPELL_CHARGE_NEGATIVE_DMGBUFF = 29660,
SPELL_CHARGE_NEGATIVE_NEARDMG = 28084,
SPELL_CHAIN_LIGHTNING = 28167,
SPELL_BERSERK = 26662,
//generic
C_TESLA_COIL = 16218 //the coils (emotes "Tesla Coil overloads!")
};
struct MANGOS_DLL_DECL boss_thaddiusAI : public ScriptedAI
{
boss_thaddiusAI(Creature* pCreature) : ScriptedAI(pCreature)
{
m_pInstance = (instance_naxxramas*)pCreature->GetInstanceData();
m_bHasTaunted = false;
Reset();
}
instance_naxxramas* m_pInstance;
uint32 m_uiPolarityShiftTimer;
uint32 m_uiChainLightningTimer;
uint32 m_uiBerserkTimer;
uint32 m_uiBallLightningTimer;
bool m_bHasTaunted;
void Reset()
{
m_uiBallLightningTimer = 30000;
m_uiPolarityShiftTimer = 30000;
m_uiChainLightningTimer = 8000;
m_uiBerserkTimer = 600000;
}
void Aggro(Unit* pWho)
{
switch(urand(0, 2))
{
case 0: DoScriptText(SAY_AGGRO1, m_creature); break;
case 1: DoScriptText(SAY_AGGRO2, m_creature); break;
case 2: DoScriptText(SAY_AGGRO3, m_creature); break;
}
if (m_pInstance)
m_pInstance->SetData(TYPE_THADDIUS, IN_PROGRESS);
}
void KilledUnit(Unit* pVictim)
{
DoScriptText(SAY_SLAY, m_creature);
}
void JustDied(Unit* pKiller)
{
DoScriptText(SAY_DEATH, m_creature);
if (m_pInstance)
m_pInstance->SetData(TYPE_THADDIUS, DONE);
}
//boss casts
void UpdateAI(const uint32 uiDiff)
{
if (!m_creature->SelectHostileTarget() || !m_creature->getVictim())
return;
// Chain Lightning
if (m_uiChainLightningTimer < uiDiff)
{
if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0))
DoCastSpellIfCan(pTarget, SPELL_CHAIN_LIGHTNING);
m_uiChainLightningTimer = 30000;
}
else
m_uiChainLightningTimer -= uiDiff;
// Polarity Shift
if (m_uiPolarityShiftTimer < uiDiff)
{
if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0))
DoCastSpellIfCan(pTarget, urand(0, 1)?SPELL_CHARGE_POSITIVE_DMGBUFF:SPELL_CHARGE_NEGATIVE_DMGBUFF);
m_uiChainLightningTimer = 10000;
}
else
m_uiChainLightningTimer -= uiDiff;
//Enrage_Timer
if (m_uiBerserkTimer < uiDiff)
{
DoCastSpellIfCan(m_creature, SPELL_BERSERK);
m_uiBerserkTimer = 600000;
}
else
m_uiBerserkTimer -= uiDiff;
DoMeleeAttackIfReady();
}
};
CreatureAI* GetAI_boss_thaddius(Creature* pCreature)
{
return new boss_thaddiusAI(pCreature);
}
void AddSC_boss_thaddius()
{
Script* NewScript;
NewScript = new Script;
NewScript->Name = "boss_thaddius";
NewScript->GetAI = &GetAI_boss_thaddius;
NewScript->RegisterSelf();
}
Высказывайте пожелания и подсказки, критику выдавать без цензуры.