* Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* 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, see <http://www.gnu.org/licenses/>.
*/
#include "ScriptMgr.h"
#include "ScriptPCH.h"
enum Npc
{
};
enum Movie
{
};
enum Quest
{
};
class AreaTrigger_tutorial: public AreaTriggerScript
{
public:
AreaTrigger_tutorial() : AreaTriggerScript("AreaTrigger_tutorial")
{
}
};
void AddSC_tutorial()
{
new AreaTrigger_tutorial();
}
enum Npc
{
NPC_KILLCREDIT = 123,
};
enum Movie
{
MOVIE = 321,
};
enum Quest
{
QUEST_X = 12345,
};
bool OnTrigger(Player* player, AreaTriggerEntry const* trigger) {return false;}
if (player->GetQuestStatus(QUEST_X) == QUEST_STATUS_INCOMPLETE)
{
}
/*
* Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* 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, see <http://www.gnu.org/licenses/>.
*/
#include "ScriptMgr.h"
#include "ScriptPCH.h"
enum Npc
{
NPC_KILLCREDIT = 123,
};
enum Movie
{
MOVIE = 321,
};
enum Quest
{
QUEST_X = 12345,
};
class AreaTrigger_tutorial : public AreaTriggerScript
{
public:
AreaTrigger_tutorial() : AreaTriggerScript("AreaTrigger_tutorial")
{
}
bool OnTrigger(Player* player, AreaTriggerEntry const* trigger)
{
if (player->GetQuestStatus(QUEST_X) == QUEST_STATUS_INCOMPLETE)
{
player->KilledMonsterCredit(NPC_KILLCREDIT, 0);
player->SendMovieStart(MOVIE);
}
return false;
}
};
void AddSC_tutorial()
{
new AreaTrigger_tutorial();
}
DELETE FROM areatrigger_scripts WHERE entry=1234;
INSERT INTO `areatrigger_scripts`(`entry`, `ScriptName`) VALUES
(1234, 'AreaTrigger_tutorial');
&& And ó Y
|| Or ó O
! Not ó No
== Igual que
< menor que
> mayor que
<= menor o igual que
>= mayor o igual que
!= no es igual o desigual
= asignacion(no confundir con igual que)
- restar
+ sumar
* multiplicar
/ dividir
% modulus(devuelve el resto de una division)
Tipo Valores
bool true o false
float los llamados numeros con coma.(1.2f)
int numeros enteros incluye positivos y negativos.
uint32 numeros enteros solo positivos.
uint64 numeros enteros solo positivos.
uint significa unsigned int
Tipo Valores
uint8 0 a 32 768
uint16 0 a 65 535
uint32 0 a 4 294 836 225
uint64 0 a 8 589 672 450
tipo espacio variable punto y coma
uint32 timer intro; (MAL)
uint32 break; (MAL)
uint32 timer_intro; (BIEN)
uint32 timerintro; (BIEN)
timerintro = 0;
MINUTE = IN_MILLISECONDS * 60,
HOUR = MINUTE*60,
DAY = HOUR*24,
WEEK = DAY*7,
MONTH = DAY*30,
YEAR = MONTH*12,
IN_MILLISECONDS = 1000
urand(uint32 min, uint32 max);
urand(tiempo minimo, tiempo maximo);
urand(15000, 20000)
urand(15, 20) * IN_MILLISECONDS
*El evento va a ocurrir de manera randon en un tiempo entre 15 segundos y 20 segundos.enum Spell
{
SPELL_PRESENCIA_DE_ESCARCHA = 48266,
}
me->CastSpell(me, SPELL_PRESENCIA_DE_ESCARCHA, 0);
me->CastSpell(me, 48266, 0);
events.ScheduleEvent(uint32 eventId, uint32 time, uint32 groupId = 0, uint32 phase = 0);
events.ScheduleEvent(EVENT_PAIN_AND_SUFFERING, 5000, 0, PHASE_LICH_KING);
events.SetPhase(uint32 phase);
events.SetPhase(PHASE_LICH_KING);
events.IsInPhase(uint8 phase);
events.IsInPhase(PHASE_DK);
enum Npc
{
NPC_SUMMON_DK = 31325,
NPC_SUMMON_LK = 31754,
};
enum Texts
{
SAY_INTRO = 0,
SAY_PHASE_DK = 1,
SAY_SUMMON_DK = 2,
SAY_SUMMON_LK = 3,
SAY_PHASE_LICH_KING = 4,
SAY_SLAY = 5,
SAY_DEATH = 6,
};
enum Spells
{
SPELL_PRESENCIA_DE_ESCARCHA = 48266,
//DK
SPELL_EXPLOSION_AULLANTE = 61061,
SPELL_GOLPE_DE_ESCARCHA = 79895,
SPELL_INVIERNO_SIN_REMORDIMIENTO = 108200,
//LICH_KING
SPELL_SOUL_REAPER = 69409,
SPELL_PAIN_AND_SUFFERING = 72133,
};
enum Events
{
EVENT_INTRO = 1,
EVENT_SUMMON_DK = 2,
EVENT_SUMMON_LK = 3,
//DK
EVENT_EXPLOSION_AULLANTE = 4,
EVENT_GOLPE_DE_ESCARCHA = 5,
//LICH_KING
EVENT_INVIERNO_SIN_REMORDIMIENTO = 6,
EVENT_SOUL_REAPER = 7,
EVENT_PAIN_AND_SUFFERING = 8,
};
enum Phases
{
PHASE_INTRO = 1,
PHASE_DK = 2,
PHASE_LICH_KING = 3,
};
void EnterCombat(Unit* who)
{
events.SetPhase(PHASE_DK);
events.ScheduleEvent(EVENT_SUMMON_DK, 30000, 0, PHASE_DK);
events.ScheduleEvent(EVENT_EXPLOSION_AULLANTE, urand(10, 15) * IN_MILLISECONDS, 0, PHASE_DK);
events.ScheduleEvent(EVENT_GOLPE_DE_ESCARCHA, 8000, 0, PHASE_DK);
}
while (uint32 eventId = events.ExecuteEvent())
{
switch (eventId)
{
case EVENT_SUMMON_DK:
Talk(SAY_SUMMON_DK);
me->SummonCreature(NPC_SUMMON_DK, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_CORPSE_DESPAWN);
events.ScheduleEvent(EVENT_SUMMON_DK, 30000, 0, PHASE_DK);
break;
case EVENT_EXPLOSION_AULLANTE:
if (Unit * target = SelectTarget(SELECT_TARGET_RANDOM, 0, 30.0f, false))
DoCast(target, SPELL_EXPLOSION_AULLANTE);
events.ScheduleEvent(EVENT_EXPLOSION_AULLANTE, 10000, 0, PHASE_DK);
break;
case EVENT_GOLPE_DE_ESCARCHA:
DoCastVictim(SPELL_GOLPE_DE_ESCARCHA);
events.ScheduleEvent(EVENT_GOLPE_DE_ESCARCHA, 8000, 0, PHASE_DK);
break;
case EVENT_SUMMON_LK:
Talk(SAY_SUMMON_LK);
me->SummonCreature(NPC_SUMMON_LK, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_CORPSE_DESPAWN);
events.ScheduleEvent(EVENT_SUMMON_LK, 30000, 0, PHASE_LICH_KING);
break;
case EVENT_SOUL_REAPER:
DoCastVictim(SPELL_SOUL_REAPER);
events.ScheduleEvent(EVENT_SOUL_REAPER, urand(15000, 20000), 0, PHASE_LICH_KING);
break;
case EVENT_PAIN_AND_SUFFERING:
DoCastToAllHostilePlayers(SPELL_PAIN_AND_SUFFERING);
events.ScheduleEvent(EVENT_PAIN_AND_SUFFERING, 5000, 0, PHASE_LICH_KING);
break;
default:
break;
}
}
if (events.IsInPhase(PHASE_DK) && HealthBelowPct(50))
{
events.SetPhase(PHASE_LICH_KING);
Talk(SAY_PHASE_LICH_KING);
me->CastSpell(me, SPELL_INVIERNO_SIN_REMORDIMIENTO, 0);
me->SetDisplayId(30721);
events.ScheduleEvent(EVENT_SUMMON_LK, 30*IN_MILLISECONDS, 0, PHASE_LICH_KING);
events.ScheduleEvent(EVENT_SOUL_REAPER, urand(15, 20)*IN_MILLISECONDS, 0, PHASE_LICH_KING);
events.ScheduleEvent(EVENT_PAIN_AND_SUFFERING, 5000, 0, PHASE_LICH_KING);
}
if (player->GetQuestStatus(12345) == QUEST_STATUS_COMPLETE)
{
Talk(0);
}
if (player->GetQuestStatus(12345) == QUEST_STATUS_COMPLETE) && (!talk)
{
Talk(0);
talk = true;
}
std::list playerList;
GetPlayerListInGrid(playerList, me, 30.0f);
for (auto player : playerList)
{
}
std::list playerList;
GetPlayerListInGrid(playerList, me, 30.0f);
for (auto player : playerList)
{
events.Update(diff);
while (uint32 eventId = events.ExecuteEvent())
{
switch (eventId)
{
case EVENT_INTRO:
{
timerintro++;
if (timerintro == 1)
{
Talk(SAY_INTRO);
}
if (timerintro == 11)
{
me->CastSpell(me, 127511, 0);
}
if (timerintro == 12)
{
me->SetDisplayId(22235);
me->SetObjectScale(2.0f);
}
if (timerintro == 14)
{
Talk(SAY_PHASE_DK);
me->setFaction(14);
me->CastSpell(me, SPELL_PRESENCIA_DE_ESCARCHA, 0);
SetEquipmentSlots(false, 33475);
}
if (timerintro == 18)
{
AttackStart(player);
}
events.ScheduleEvent(EVENT_INTRO, 1000);
break;
}
}
}
}
void JustSummoned(Creature* summon)
{
if (summon->GetEntry() == NPC_SUMMON_DK)
{
summon->CastSpell(summon, 48265, false);
if (Unit * target = SelectTarget(SELECT_TARGET_RANDOM, 0))
summon->AI()->AttackStart(target);
}
if (summon->GetEntry() == NPC_SUMMON_LK)
{
summon->CastSpell(summon, 49222, false);
if (Unit * target = SelectTarget(SELECT_TARGET_BOTTOMAGGRO, 0))
summon->AI()->AttackStart(target);
}
}
summon->GetMotionMaster()->MovePoint(0, 966.20f, 3602.97f, 196.58f);//se mueva hacia un punto.
summon->CastSpell(summon, 49222, false);//castee una magia.
summon->DespawnOrUnsummon(10*IN_MILLISECONDS);//desaparesca en un tiempo x.
summon->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, true); //aplicar una inmunidad a la magia de tipo frio.
summon->setFaction(14);//cambiarle la faccion.
summon->SetLevel(80);// cambiarle el nivel.
summon->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);//agregarle una flag.
Talk(TEXTO);//Hablar.
void JustReachedHome()
{
ScriptedAI::Reset();
}
void Reset()
{
me->setFaction(35);
me->SetDisplayId(24949);
me->SetObjectScale(1.0f);
timerintro = 0;
SetEquipmentSlots(false, 0);
}
/*
* Copyright (C) 2008-2012 TrinityCore
*
* 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, see .
*/
#include "ScriptMgr.h"
#include "ScriptPCH.h"
//NPC_TUTORIAL
class npc_tutorial : public CreatureScript
{
public:
npc_tutorial() : CreatureScript("npc_tutorial") { }
struct npc_tutorialAI : public ScriptedAI
{
npc_tutorialAI(Creature* creature) : ScriptedAI(creature)
{
events.ScheduleEvent(EVENT_INTRO, 600);
}
uint32 timerintro;
enum Npc
{
NPC_SUMMON_DK = 31325,
NPC_SUMMON_LK = 31754,
};
enum Texts
{
SAY_INTRO = 0,
SAY_PHASE_DK = 1,
SAY_SUMMON_DK = 2,
SAY_SUMMON_LK = 3,
SAY_PHASE_LICH_KING = 4,
SAY_SLAY = 5,
SAY_DEATH = 6,
};
enum Spells
{
SPELL_PRESENCIA_DE_ESCARCHA = 48266,
//DK
SPELL_EXPLOSION_AULLANTE = 61061,
SPELL_GOLPE_DE_ESCARCHA = 79895,
SPELL_INVIERNO_SIN_REMORDIMIENTO = 108200,
//LICH_KING
SPELL_SOUL_REAPER = 69409,
SPELL_PAIN_AND_SUFFERING = 72133,
};
enum Events
{
EVENT_INTRO = 1,
EVENT_SUMMON_DK = 2,
EVENT_SUMMON_LK = 3,
//DK
EVENT_EXPLOSION_AULLANTE = 4,
EVENT_GOLPE_DE_ESCARCHA = 5,
//LICH_KING
EVENT_INVIERNO_SIN_REMORDIMIENTO = 6,
EVENT_SOUL_REAPER = 7,
EVENT_PAIN_AND_SUFFERING = 8,
};
enum Phases
{
PHASE_INTRO = 1,
PHASE_DK = 2,
PHASE_LICH_KING = 3,
};
void Reset()
{
me->setFaction(35);
me->SetDisplayId(24949);
me->SetObjectScale(1.0f);
timerintro = 0;
SetEquipmentSlots(false, 0);
}
void JustReachedHome()
{
ScriptedAI::Reset();
}
void EnterCombat(Unit* who)
{
events.SetPhase(PHASE_DK);
events.ScheduleEvent(EVENT_SUMMON_DK, 30000, 0, PHASE_DK);
events.ScheduleEvent(EVENT_EXPLOSION_AULLANTE, urand(10, 15) * IN_MILLISECONDS, 0, PHASE_DK);
events.ScheduleEvent(EVENT_GOLPE_DE_ESCARCHA, 8000, 0, PHASE_DK);
}
void KilledUnit(Unit* victim)
{
Talk(SAY_SLAY);
}
void JustDied(Unit* victim)
{
Talk(SAY_DEATH);
}
void JustSummoned(Creature* summon)
{
if (summon->GetEntry() == NPC_SUMMON_DK)
{
summon->CastSpell(summon, 48265, false);
if (Unit * target = SelectTarget(SELECT_TARGET_RANDOM, 0))
summon->AI()->AttackStart(target);
}
if (summon->GetEntry() == NPC_SUMMON_LK)
{
summon->CastSpell(summon, 48265, false);
if (Unit * target = SelectTarget(SELECT_TARGET_BOTTOMAGGRO, 0))
summon->AI()->AttackStart(target);
}
}
void UpdateAI(uint32 const diff)
{
std::list playerList;
GetPlayerListInGrid(playerList, me, 30.0f);
for (auto player : playerList)
{
events.Update(diff);
while (uint32 eventId = events.ExecuteEvent())
{
switch (eventId)
{
case EVENT_INTRO:
{
timerintro++;
if (timerintro == 1)
{
Talk(SAY_INTRO);
}
if (timerintro == 11)
{
me->CastSpell(me, 127511, 0);
}
if (timerintro == 12)
{
me->SetDisplayId(22235);
me->SetObjectScale(2.0f);
}
if (timerintro == 14)
{
Talk(SAY_PHASE_DK);
me->setFaction(14);
me->CastSpell(me, SPELL_PRESENCIA_DE_ESCARCHA, 0);
SetEquipmentSlots(false, 33475);
}
if (timerintro == 18)
{
AttackStart(player);
}
events.ScheduleEvent(EVENT_INTRO, 1000);
break;
}
}
}
}
if (!UpdateVictim())
return;
events.Update(diff);
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
if (events.IsInPhase(PHASE_DK) && HealthBelowPct(50))
{
events.SetPhase(PHASE_LICH_KING);
Talk(SAY_PHASE_LICH_KING);
me->CastSpell(me, SPELL_INVIERNO_SIN_REMORDIMIENTO, 0);
me->SetDisplayId(30721);
events.ScheduleEvent(EVENT_SUMMON_LK, 30 * IN_MILLISECONDS, 0, PHASE_LICH_KING);
events.ScheduleEvent(EVENT_SOUL_REAPER, urand(15, 20) * IN_MILLISECONDS, 0, PHASE_LICH_KING);
events.ScheduleEvent(EVENT_PAIN_AND_SUFFERING, 5000, 0, PHASE_LICH_KING);
}
while (uint32 eventId = events.ExecuteEvent())
{
switch (eventId)
{
case EVENT_SUMMON_DK:
Talk(SAY_SUMMON_DK);
me->SummonCreature(NPC_SUMMON_DK, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_CORPSE_DESPAWN);
events.ScheduleEvent(EVENT_SUMMON_DK, 30000, 0, PHASE_DK);
break;
case EVENT_EXPLOSION_AULLANTE:
if (Unit * target = SelectTarget(SELECT_TARGET_RANDOM, 0, 30.0f, false))
DoCast(target, SPELL_EXPLOSION_AULLANTE);
events.ScheduleEvent(EVENT_EXPLOSION_AULLANTE, 10000, 0, PHASE_DK);
break;
case EVENT_GOLPE_DE_ESCARCHA:
DoCastVictim(SPELL_GOLPE_DE_ESCARCHA);
events.ScheduleEvent(EVENT_GOLPE_DE_ESCARCHA, 8000, 0, PHASE_DK);
break;
case EVENT_SUMMON_LK:
Talk(SAY_SUMMON_LK);
me->SummonCreature(NPC_SUMMON_LK, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_CORPSE_DESPAWN);
events.ScheduleEvent(EVENT_SUMMON_LK, 30000, 0, PHASE_LICH_KING);
break;
case EVENT_SOUL_REAPER:
DoCastVictim(SPELL_SOUL_REAPER);
events.ScheduleEvent(EVENT_SOUL_REAPER, urand(15000, 20000), 0, PHASE_LICH_KING);
break;
case EVENT_PAIN_AND_SUFFERING:
DoCastToAllHostilePlayers(SPELL_PAIN_AND_SUFFERING);
events.ScheduleEvent(EVENT_PAIN_AND_SUFFERING, 5000, 0, PHASE_LICH_KING);
break;
default:
break;
}
}
DoMeleeAttackIfReady();
}
};
CreatureAI* GetAI(Creature* creature) const
{
return new npc_tutorialAI(creature);
}
};
void AddSC_tutorial()
{
new npc_tutorial();
}
DELETE FROM `creature_template` WHERE entry=1000000;
INSERT INTO `creature_template`(`entry`, `difficulty_entry_1`, `difficulty_entry_2`, `difficulty_entry_3`, `difficulty_entry_4`, `difficulty_entry_5`, `difficulty_entry_6`, `difficulty_entry_7`, `difficulty_entry_8`, `difficulty_entry_9`, `difficulty_entry_10`, `difficulty_entry_11`, `difficulty_entry_12`, `difficulty_entry_13`, `difficulty_entry_14`, `difficulty_entry_15`, `KillCredit1`, `KillCredit2`, `modelid1`, `modelid2`, `modelid3`, `modelid4`, `name`, `subname`, `IconName`, `gossip_menu_id`, `minlevel`, `maxlevel`, `exp`, `exp_unk`, `faction_A`, `faction_H`, `npcflag`, `npcflag2`, `speed_walk`, `speed_run`, `speed_fly`, `scale`, `rank`, `mindmg`, `maxdmg`, `dmgschool`, `attackpower`, `dmg_multiplier`, `baseattacktime`, `rangeattacktime`, `unit_class`, `unit_flags`, `unit_flags2`, `dynamicflags`, `family`, `trainer_type`, `trainer_spell`, `trainer_class`, `trainer_race`, `minrangedmg`, `maxrangedmg`, `rangedattackpower`, `type`, `type_flags`, `type_flags2`, `lootid`, `pickpocketloot`, `skinloot`, `resistance1`, `resistance2`, `resistance3`, `resistance4`, `resistance5`, `resistance6`, `spell1`, `spell2`, `spell3`, `spell4`, `spell5`, `spell6`, `spell7`, `spell8`, `PetSpellDataId`, `VehicleId`, `mingold`, `maxgold`, `AIName`, `MovementType`, `InhabitType`, `HoverHeight`, `Health_mod`, `Mana_mod`, `Mana_mod_extra`, `Armor_mod`, `RacialLeader`, `questItem1`, `questItem2`, `questItem3`, `questItem4`, `questItem5`, `questItem6`, `movementId`, `RegenHealth`, `equipment_id`, `mechanic_immune_mask`, `flags_extra`, `ScriptName`, `WDBVerified`) VALUES
(1000000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30721, 0, 0, 0, 'Tutorial', NULL, NULL, 0, 90, 90, 4, 0, 14, 14, 0, 0, 1, 1.14286, 1.14286, 1, 1, 1000, 2000, 0, 1000, 20, 2000, 2000, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1000, 2000, 1000, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '', 0, 3, 1, 100, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 'npc_tutorial', 1);
DELETE FROM `creature_text` WHERE entry=1000000;
INSERT INTO `creature_text`(`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `comment`) VALUES
(1000000, 0, 0, 'SAY_INTRO', 14, 0, 100, 1, 0, 12732, ''),
(1000000, 1, 0, 'SAY_PHASE_DK', 14, 0, 100, 15, 0, 14685, ''),
(1000000, 2, 0, 'SAY_SUMMON_DK', 14, 0, 100, 25, 0, 14693, ''),
(1000000, 3, 0, 'SAY_SUMMON_LK', 14, 0, 100, 25, 0, 17222, ''),
(1000000, 4, 0, 'SAY_PHASE_LICH_KING', 14, 0, 100, 0, 0, 17352, ''),
(1000000, 5, 0, 'SAY_SLAY', 14, 0, 100, 0, 0, 17214, ''),
(1000000, 6, 0, 'SAY_DEATH', 14, 0, 100, 0, 0, 17374, '');
# 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/tutorial.cpp
)
message(" -> Prepared: Custom")
1:
// Customs
void AddSC_npc_tutorial();
2:
void AddCustomScripts()
{
#ifdef SCRIPTS
AddSC_npc_tutorial();
#endif
}
/*
* Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* 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, see <http://www.gnu.org/licenses/>.
*/
#include "ScriptMgr.h"
#include "ScriptPCH.h"
enum Npc
{
};
enum Texts
{
};
enum Spells
{
};
enum Events
{
};
class npc_tutorial : public CreatureScript
{
public:
npc_tutorial() : CreatureScript("npc_tutorial") { }
struct npc_tutorialAI : public ScriptedAI
{
npc_tutorialAI(Creature* creature) : ScriptedAI(creature)
{
}
void Reset()
{
}
void EnterCombat(Unit* who)
{
}
void KilledUnit(Unit * victim)
{
}
void JustDied(Unit * victim)
{
}
void UpdateAI(uint32 const diff)
{
if (!UpdateVictim())
return;
events.Update(diff);
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
{
switch (eventId)
{
default:
break;
}
}
DoMeleeAttackIfReady();
}
};
CreatureAI* GetAI(Creature* creature) const
{
return new npc_tutorialAI(creature);
}
};
void AddSC_tutorial()
{
new npc_tutorial();
}
enum xxxxx
{
};
enum Npc
{
NPC_SUMMON = 32467,
};
enum Texts
{
SAY_AGGRO = 0,
SAY_SUMMON = 1,
SAY_SLAY = 2,
SAY_DEATH = 3,
};
enum Spells
{
SPELL_NUBE_ENFERMISA = 28156,
SPELL_DESGARRAR = 59239,
SPELL_RAJAR = 40504,
SPELL_TORBELLINO = 24236,
};
enum Events
{
EVENT_DESGARRAR = 1,
EVENT_RAJAR = 2,
EVENT_TORBELLINO = 3,
EVENT_SUMMON = 4,
};
void Reset()
{
}
void EnterCombat(Unit* who)
{
}
void KilledUnit(Unit * victim)
{
}
void JustDied(Unit * victim)
{
}
void EnterCombat(Unit* who)
{
Talk(SAY_AGGRO);
me->CastSpell(me, SPELL_NUBE_ENFERMISA, true);
events.ScheduleEvent(EVENT_DESGARRAR, 15000, 0);
events.ScheduleEvent(EVENT_RAJAR, 5000, 0);
events.ScheduleEvent(EVENT_TORBELLINO, 10000, 0);
events.ScheduleEvent(EVENT_SUMMON, 20000, 0);
}
void UpdateAI(uint32 const diff)
{
if (!UpdateVictim())
return;
events.Update(diff);
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
{
switch (eventId)
{
case EVENT_DESGARRAR:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 20.0f, false))
DoCast(target, (SPELL_DESGARRAR));
events.ScheduleEvent(EVENT_DESGARRAR, 15000, 0);
break;
case EVENT_RAJAR:
DoCastVictim(SPELL_RAJAR);
events.ScheduleEvent(EVENT_RAJAR, 5000, 0);
break;
case EVENT_TORBELLINO:
DoCast(me, SPELL_TORBELLINO);
events.ScheduleEvent(EVENT_TORBELLINO, 10000, 0);
break;
case EVENT_SUMMON:
me->SummonCreature(NPC_SUMMON, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_CORPSE_DESPAWN);
events.ScheduleEvent(EVENT_SUMMON, 20000, 0);
break;
default:
break;
}
}
DoMeleeAttackIfReady();
}
};
SELECT_TARGET_RANDOM //Selecciona objetivo aleatorios.
SELECT_TARGET_TOPAGGRO //Selecciona objetivo desde mayor a menos amenaza.
SELECT_TARGET_BOTTOMAGGRO //Selecciona objetivo desde menor a mayor amenaza.
SELECT_TARGET_NEAREST //Selecciona objetivo mas cerca.
SELECT_TARGET_FARTHEST //Selecciona objetivo mas lejos.
TEMPSUMMON_TIMED_OR_DEAD_DESPAWN // despawns despues de un tiempo especificado o cuando la criatura desaparesca.
TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN // despawns despues de un tiempo especificado o cuando la criatura muera.
TEMPSUMMON_TIMED_DESPAWN // despawns despues de un tiempo especificado.
TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT // despawns despues de un tiempo cuando la criatura salga de combate.
TEMPSUMMON_CORPSE_DESPAWN // despawns instantaneamente despues de morir.
TEMPSUMMON_CORPSE_TIMED_DESPAWN // despawns despues de un tiempo especificado cuando muere.
TEMPSUMMON_DEAD_DESPAWN // despawns cuando la criatura desaparece.
TEMPSUMMON_MANUAL_DESPAWN
/*
* Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* 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, see <http://www.gnu.org/licenses/>.
*/
#include "ScriptMgr.h"
#include "ScriptPCH.h"
enum Npc
{
NPC_SUMMON = 32467,
};
enum Texts
{
SAY_AGGRO = 0,
SAY_SUMMON = 1,
SAY_SLAY = 2,
SAY_DEATH = 3,
};
enum Spells
{
SPELL_NUBE_ENFERMISA = 28156,
SPELL_DESGARRAR = 59239,
SPELL_RAJAR = 40504,
SPELL_TORBELLINO = 24236,
};
enum Events
{
EVENT_DESGARRAR = 1,
EVENT_RAJAR = 2,
EVENT_TORBELLINO = 3,
EVENT_SUMMON = 4,
};
class npc_tutorial : public CreatureScript
{
public:
npc_tutorial() : CreatureScript("npc_tutorial") { }
struct npc_tutorialAI : public ScriptedAI
{
npc_tutorialAI(Creature* creature) : ScriptedAI(creature)
{
}
void Reset()
{
}
void EnterCombat(Unit* who)
{
Talk(SAY_AGGRO);
me->CastSpell(me, SPELL_NUBE_ENFERMISA, true);
events.ScheduleEvent(EVENT_DESGARRAR, 15000, 0);
events.ScheduleEvent(EVENT_RAJAR, 5000, 0);
events.ScheduleEvent(EVENT_TORBELLINO, 10000, 0);
events.ScheduleEvent(EVENT_SUMMON, 20000, 0);
}
void KilledUnit(Unit * victim)
{
Talk(SAY_SLAY);
}
void JustDied(Unit * victim)
{
Talk(SAY_DEATH);
}
void UpdateAI(uint32 const diff)
{
if (!UpdateVictim())
return;
events.Update(diff);
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
{
switch (eventId)
{
case EVENT_DESGARRAR:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 20.0f, false))
DoCast(target, (SPELL_DESGARRAR));
events.ScheduleEvent(EVENT_DESGARRAR, 15000, 0);
break;
case EVENT_RAJAR:
DoCastVictim(SPELL_RAJAR);
events.ScheduleEvent(EVENT_RAJAR, 5000, 0);
break;
case EVENT_TORBELLINO:
DoCast(me, SPELL_TORBELLINO);
events.ScheduleEvent(EVENT_TORBELLINO, 10000, 0);
break;
case EVENT_SUMMON:
Talk(SAY_SUMMON);
me->SummonCreature(NPC_SUMMON, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_CORPSE_DESPAWN);
events.ScheduleEvent(EVENT_SUMMON, 20000, 0);
break;
default:
break;
}
}
DoMeleeAttackIfReady();
}
};
CreatureAI* GetAI(Creature* creature) const
{
return new npc_tutorialAI(creature);
}
};
void AddSC_tutorial()
{
new npc_tutorial();
}
INSERT INTO `creature_template`(`entry`, `difficulty_entry_1`, `difficulty_entry_2`, `difficulty_entry_3`, `difficulty_entry_4`, `difficulty_entry_5`, `difficulty_entry_6`, `difficulty_entry_7`, `difficulty_entry_8`, `difficulty_entry_9`, `difficulty_entry_10`, `difficulty_entry_11`, `difficulty_entry_12`, `difficulty_entry_13`, `difficulty_entry_14`, `difficulty_entry_15`, `KillCredit1`, `KillCredit2`, `modelid1`, `modelid2`, `modelid3`, `modelid4`, `name`, `subname`, `IconName`, `gossip_menu_id`, `minlevel`, `maxlevel`, `exp`, `exp_unk`, `faction_A`, `faction_H`, `npcflag`, `npcflag2`, `speed_walk`, `speed_run`, `speed_fly`, `scale`, `rank`, `mindmg`, `maxdmg`, `dmgschool`, `attackpower`, `dmg_multiplier`, `baseattacktime`, `rangeattacktime`, `unit_class`, `unit_flags`, `unit_flags2`, `dynamicflags`, `family`, `trainer_type`, `trainer_spell`, `trainer_class`, `trainer_race`, `minrangedmg`, `maxrangedmg`, `rangedattackpower`, `type`, `type_flags`, `type_flags2`, `lootid`, `pickpocketloot`, `skinloot`, `resistance1`, `resistance2`, `resistance3`, `resistance4`, `resistance5`, `resistance6`, `spell1`, `spell2`, `spell3`, `spell4`, `spell5`, `spell6`, `spell7`, `spell8`, `PetSpellDataId`, `VehicleId`, `mingold`, `maxgold`, `AIName`, `MovementType`, `InhabitType`, `HoverHeight`, `Health_mod`, `Mana_mod`, `Mana_mod_extra`, `Armor_mod`, `RacialLeader`, `questItem1`, `questItem2`, `questItem3`, `questItem4`, `questItem5`, `questItem6`, `movementId`, `RegenHealth`, `equipment_id`, `mechanic_immune_mask`, `flags_extra`, `ScriptName`, `WDBVerified`) VALUES
(1000000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30721, 0, 0, 0, 'Tutorial', NULL, NULL, 0, 90, 90, 4, 0, 14, 14, 0, 0, 1, 1.14286, 1.14286, 1, 1, 1000, 2000, 0, 1000, 20, 2000, 2000, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1000, 2000, 1000, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '', 0, 3, 1, 100, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 'npc_tutorial', 1);
INSERT INTO `creature_text`(`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `comment`) VALUES
(1000000, 0, 0, 'SAY AGGRO', 14, 0, 100, 0, 0, 17223, ''),
(1000000, 1, 0, 'SAY_SUMMON', 14, 0, 100, 25, 0, 17222, ''),
(1000000, 2, 0, 'SAY_SLAY', 14, 0, 100, 21, 0, 17214, ''),
(1000000, 3, 0, 'SAY_DEATH', 14, 0, 100, 16, 0, 17374, '');
INSERT INTO creature_template (entry, modelid1, NAME, subname, gossip_menu_id, faction, npcflag, AIName) VALUES
(100000, 987, "Teleport", "Tutorial Npc Teleport", 60000, 35, 1, "SmartAI");
INSERT INTO gossip_menu_option (MenuID, OptionID, OptionText, OptionType, OptionNpcFlag) VALUES
(60000, 0, "Teleport Isla GM", 1, 1);
SET
@NpcEntry = 100000, /*ID de tu npc teleport*/
@id = 0, /*ID único agrear + 1 si añade otras coordenadas*/
@GossipMenuOption = 60000, /* "MenuID" sacado de gossip_menu_option*/
@GossipMenuID = 0, /*Id único "OptionID" sacado de gossip_menu_option, hace referencia a la opcion del teleport que creamos (Teleport Isla GM) */
@Map = 1, /* Id Mapa*/
@x = 16226.2, /* Coordenada x*/
@y = 16257, /* Coordenada y*/
@z = 13.2022, /* Coordenada z*/
@o = 1.65007, /*orientación*/
@Comentario = "IslaGM";
INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `event_type`, `event_param1`, `event_param2`, `action_type`, `action_param1`, `target_type`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
(@NpcEntry,'0',@id,'62',@GossipMenuOption,@GossipMenuID,'62',@Map,'7',@x,@y,@z,@o,@Comentario);
"token": "Token que guardaste.",
"prefix": "!",
"clientId": "ID del bot en tu servidor.",
"guildId": "ID del servidor.",
"mysql": {
"auth": {
"host": "127.0.0.1",
"user": "root",
"password": "ascent",
"database": "auth"
},
"characters": {
"host": "127.0.0.1",
"user": "root",
"password": "ascent",
"database": "characters"
}
},
"realmlist": "logon.wowregister.com"
npm install
node index.js