Здравствуйте.Решил попробовать написать скрипт на Рагнароса из Огненных Просторов.Ну точнее переделать.Признаюсь честно,взял вот этот скрипт за основу и решил переделать его.
Вот ссылка:Рагнарос.
Единственные мануалы для меня-это код Р2.Просто книги читаю,ничего немогу понять честно.Копирайты все сохранены,Rsa говорил,что переделка(переработка)не меняет автора кода,я по такому же принципу иду.Спеллы брал с вовхеда,таймера на глаз делал.На компилирование и работоспособность не проверял.
Прошу прощения,не получается выровнять.
Вот сам код:
Перевод на английский язык:
Hello I decided to try to write a script on Ragnaros of the Firelands. Well, more precisely alter. Frankly, that's taken as a basis for the script and decided to remake it.The only manual for me is code P2. Just read the book, can not understand anything honestly. All copyrights retained, Rsa said modifications (processing) does not change the author of the code, I'm going to the same principle.Please do not swear,I'm new to this. Code for certain curves were obtained, but there is no progress without errors. Mainly for use EventAI scripts. Most want to try to implement. Texts are not changed. Happy New Year and Merry Christmas! All the best to you!
P.S:Шикарный босс,так он того стоит.
Вот ссылка:Рагнарос.
Единственные мануалы для меня-это код Р2.Просто книги читаю,ничего немогу понять честно.Копирайты все сохранены,Rsa говорил,что переделка(переработка)не меняет автора кода,я по такому же принципу иду.Спеллы брал с вовхеда,таймера на глаз делал.На компилирование и работоспособность не проверял.
Прошу прощения,не получается выровнять.
Вот сам код:
- Code:
/* Copyright (C) 2006 - 2012 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
SDAuthor:ScriptDev2.
SDName: boss_ragnaros_firelands
SD%Complete:
SDComment: Easy script boss.Placeholder.
SDCategory: Firelands
EndScriptData */
#include "precompiled.h"
/* There have been quite some bugs about his spells, keep this as reference untill all finished
* Missing features (based on wowwiki)
* Lava Burst - this spell is handled by Go 178088 which is summoned by spells 21886, 21900 - 21907
*/
enum
{
SAY_INTRO = -7000001,
SAY_UNKNOWN = -7000002,
SAY_KILL = -7000003,
SAY_TARESGOSA = -7000004,
SAY_SUMMON = -7000005,
SAY_AGGRO = -7000006,
SAY_UNKNOWN2 = -7000007,
SPELL_BURNING_WOUND = 99399,
SPELL_MAGMA_TRAP = 98164,
SPELL_MAGMA_BLAST = 98313, // Ranged attack if nobody is in melee range
SPELL_HAND_OF_RAGNAROS = 98237,
SPELL_ENGULFING_FLAMES = 99172, // Ragnaros begins to engulf the area of the platform nearest to him in flames!
SPELL_SULFURAS_SMASH = 98710, // Ragnaros slams Sulfuras to the ground, creating a massive impact and causing waves of lava to be sent out from the target location.
SPELL_WRATH_OF_RAGNAROS = 98263,
struct MANGOS_DLL_DECL boss_ragnaros_firelandsAI : public Scripted_NoMovementAI
{
boss_ragnarosAI(Creature* pCreature) : Scripted_NoMovementAI(pCreature)
{
m_pInstance = (instance_firelands*)pCreature->GetInstanceData();
m_uiEnterCombatTimer = 0;
m_bHasAggroYelled = false;
Reset();
}
instance_firelands* m_pInstance;
uint32 m_uiEnterCombatTimer;
uint32 m_uiWrathOfRagnarosTimer;
uint32 m_uiBurningWoundTimer;
uint32 m_uiMagmaBlastTimer;
uint32 m_uiMagmaTrapTimer;
uint32 m_uiHandOfRagnarosTimer;
uint32 m_uiAttackTimer;
uint32 m_uiEngulfingFlamesTimer;
uint32 m_uiSulfurasSmashTimer;
uint32 m_uiWrathOfRagnarosTimer;
bool m_bHasAggroYelled;
bool m_bHasYelledMagmaBurst;
void Reset()
{
m_uiWrathOfRagnarosTimer = 30000;
m_uiBurningWoundTimer = 11000;
m_uiMagmaBlastTimer = 2000;
m_uiMagmaTrapTimer = 28000
m_uiHandOfRagnarosTimer = 38000
m_uiSulfurasSmashTimer = 23000;
m_uiEngulfingFlamesTimer = 55000;
m_uiAttackTimer = 90*IN_MILLISECONDS;
m_bHasYelledMagmaBurst = false;
}
void KilledUnit(Unit* pVictim)
{
if (pVictim->GetTypeId() != TYPEID_PLAYER)
return;
if (urand(0, 3))
return;
DoScriptText(SAY_KILL, m_creature);
}
void JustDied(Unit* pKiller)
{
if (m_pInstance)
m_pInstance->SetData(TYPE_RAGNAROS, DONE);
}
void Aggro(Unit* pWho)
{
DoCastSpellIfCan(m_creature, SPELL_BURNING_WOUND);
if (m_pInstance)
m_pInstance->SetData(TYPE_RAGNAROS, IN_PROGRESS);
DoScriptText(SAY_AGGRO, m_creature);
}
void EnterEvadeMode()
{
if (m_pInstance)
m_pInstance->SetData(TYPE_RAGNAROS, FAIL);
// Reset flag if had been submerged
if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE))
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
ScriptedAI::EnterEvadeMode();
}
void UpdateAI(const uint32 uiDiff)
{
if (m_uiEnterCombatTimer)
{
if (m_uiEnterCombatTimer <= uiDiff)
{
if (!m_bHasAggroYelled)
{
m_uiEnterCombatTimer = 3000;
m_bHasAggroYelled = true;
DoScriptText(SAY_INTRO, m_creature);
}
else
{
m_uiEnterCombatTimer = 0;
// If we don't remove this passive flag, he will be unattackable after evading, this way he will enter combat
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PASSIVE);
if (m_pInstance)
{
if (Player* pPlayer = m_pInstance->GetPlayerInMap(true, false))
{
m_creature->AI()->AttackStart(pPlayer);
return;
}
}
}
}
else
m_uiEnterCombatTimer -= uiDiff;
}
// Wrath Of Ragnaros Timer
if (m_uiWrathOfRagnarosTimer < uiDiff)
{
if (DoCastSpellIfCan(m_creature, SPELL_WRATH_OF_RAGNAROS) == CAST_OK)
{
DoScriptText(SAY_UNKNOWN, m_creature);
m_uiWrathOfRagnarosTimer = 30000;
}
}
else
m_uiWrathOfRagnarosTimer -= uiDiff;
// Magma Trap
if (m_uiMagmaTrapTimer < uiDiff)
{
if (DoCastSpellIfCan(m_creature->getVictim(), SPELL_MAGMA_TRAP) == CAST_OK)
m_uiMagmaTrapTimer = urand(23000, 28000);
}
else
m_uiMagmaTrapTimer -= uiDiff;
// Sulfuras Smash
if (m_uiSulfurasSmashTimer < uiDiff)
{
if (DoCastSpellIfCan(pTarget, SPELL_SULFURAS_SMASH) == CAST_OK)
{
DoScriptText(SAY_TARESGOSA, m_creature);
m_uiSulfurasSmashTimer = urand(21000,25000);
}
}
else
m_uiSulfurasSmashTimer -= uiDiff;
}
// Engulfing Flames
if (m_uiEngulfingFlamesTimer < uiDiff)
{
if (DoCastSpellIfCan(m_creature->getVictim(), SPELL_ENGULFING_FLAMES) == CAST_OK)
m_uiEngulfingFlamesTimer = urand(55000, 67000);
}
else
m_uiEngulfingFlamesTimer -= uiDiff;
// TODO this actually should select _any_ enemy in melee range, not only the tank
// Range check for melee target, if nobody is found in range, then cast magma blast on random
// If we are within range melee the target
if (m_creature->IsNonMeleeSpellCasted(false) || !m_creature->getVictim())
return;
if (m_creature->CanReachWithMeleeAttack(m_creature->getVictim()))
{
// Make sure our attack is ready
if (m_creature->isAttackReady())
{
m_creature->AttackerStateUpdate(m_creature->getVictim());
m_creature->resetAttackTimer();
m_bHasYelledMagmaBurst = false;
}
}
else
{
// Magma Burst Timer
if (m_uiMagmaBlastTimer < uiDiff)
{
if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0))
{
if (DoCastSpellIfCan(pTarget, SPELL_MAGMA_BLAST) == CAST_OK)
{
if (!m_bHasYelledMagmaBurst)
{
DoScriptText(SAY_SUMMON, m_creature);
m_bHasYelledMagmaBurst = true;
}
m_uiMagmaBlastTimer = 1000; // Spamm this!
}
}
}
else
m_uiMagmaBlastTimer -= uiDiff;
}
}
};
CreatureAI* GetAI_boss_ragnaros_firelands(Creature* pCreature)
{
return new boss_ragnaros_firelandsAI(pCreature);
}
void AddSC_boss_ragnaros_firelands()
{
Script* pNewScript;
pNewScript = new Script;
pNewScript->Name = "boss_ragnaros_firelands";
pNewScript->GetAI = &GetAI_boss_ragnaros_firelands;
pNewScript->RegisterSelf();
}
Перевод на английский язык:
Hello I decided to try to write a script on Ragnaros of the Firelands. Well, more precisely alter. Frankly, that's taken as a basis for the script and decided to remake it.The only manual for me is code P2. Just read the book, can not understand anything honestly. All copyrights retained, Rsa said modifications (processing) does not change the author of the code, I'm going to the same principle.Please do not swear,I'm new to this. Code for certain curves were obtained, but there is no progress without errors. Mainly for use EventAI scripts. Most want to try to implement. Texts are not changed. Happy New Year and Merry Christmas! All the best to you!
P.S:Шикарный босс,так он того стоит.
- Code:
INSERT INTO `script_texts` (`entry`,`content_default`,`sound`,`type`,`language`,`emote`,`comment`) VALUES
(-7000001, 'Mortal Insects! You dare trespass into MY domain? Your arrogance will be purged in living flame.',24517,1,0,0,'Ragnaros SAY_INTRO'),
(-7000002, 'Too soon...',24528,1,0,0,'Ragnaros SAY_UNKNOWN'),
(-7000003, 'Die, insect!',24531,1,0,0,'Ragnaros SAY_KILL'),
(-7000004, 'Deathwing has prepared me to face the vessel of Tarecgosa, your fools journey ends here!',25162,1,0,0,'Ragnaros SAY_TARESGOSA'),
(-7000005, 'Arise, servants of fire, consume their flesh!',24516,1,0,0,'Ragnaros SAY_SUMMON'),
(-7000006, 'I will see you all burn.',24534,1,0,0,'Ragnaros SAY_AGGRO'),
(-7000007, 'When I finish this, your pathetic mortal world will burn with my vengeance!',24526,1,0,0,'UNKNOWN2'),
Last edited by Ulduar on Sat Jan 12 2013, 05:44; edited 4 times in total