Well,
Im here to learn you the basics of scripting a boss in c++ yet,
Ill give u some basic requierements here,
u need microsoft visual c++, (or notepad++ its also a very good scripting programme supports multiple language's)
Also you need to have a headset and a good dubstep radio for example ([Only registered and activated users can see links. ]) <- best one out here,
Okay so now lets start,
When you have tune'd in on the radio and launched ur scripting program lets start
first of we are gonna add an intro with the info u want to supply in it,
For example:
Code:
/*
Example script for mmotop!
*/
Okay that is the begin ^^ now we need to add the basic Define's to make the script actuallty work,
Its for setting the script up and compiling it without 500k error's.
if you want an error Line it will go as the following,
Code:
//Message here this line is now a comment line.
Okay so now lets add the rest :)
Code:
/*
Example script for mmotop.
*/
//basic define's
#include "StdAfx.h"
#include "Setup.h"
#include "Base.h"
//The npc itself
#define Npcname Npcid,
Change Npcname to the name of ur npc and Npcid to the Spawnid of ur npc :)
That is the basic stuff u need till now,
Wait what? do you want your npc to speak and cast spells?
Oh well we can do that i think :)
Lets continue from the basic we have right now,
Get a open line and add the following
Code:
#define spell spellid
For example we want to define hand of death with the text example,
so if we type the npc to cast example it will cast hand of death,
Code:
#define example 5
Okay that like everything we need to start actually scripting
(if you want the npc to have more spells define more and get their id from wowhead)
Now lets add the following lined to the script,
we have an npc called Razor and we are willing to make a script for razor here,
So what i am gonna do is make it like this :)
Okay that is what u need to have the npc scripted but it wont work yet o.o!
We must script the following line´s into the script :)
Code:
class RazorAI : public ArcScriptBossAI
{
ARCSCRIPT_FACTORY_FUNCTION(RazorAI, ArcScriptBossAI);
RazorAI(Creature* pCreature) : ArcScriptBossAI(pCreature)
{
//text's this is what the boss will say on combat start etc..
AddEmote(Event_OnCombatStart, "You wont stand up very long!", Text_Yell);
AddEmote(Event_Ontargetdied, "I warned you!", Text_Yell);
AddEmote(Event_OnDied, "This won't happen at any other time..", Text_Tell);
//others to make the spells work and function ^^
AddSpell(Laugh, Target_Self, 100, 6, 100);
AddSpell(frostbolt, Target_RandomPlayer, 60, 2, 20);
Addspell(hod, Target_Maintank, 35,2,22);
addspell(uberheal, Target_self, 50,25,100);
}
}
I will now explain the following lines to you,
1.
Code:
AddEmote(Event_OnCombatStart, "You wont stand up very long!", Text_Yell);
1--
It ads a text message : "You wont stand up very long!" and the npc will yell it when combat starts you can modify this message,
2--
It makes the npc cast the frostbolt we defined, Frostbolt of ages on a random player with a 60% hit chanse and he can cast it every 20 secconds,
So add everything to ur script and u should have something like this now :)
We are nearly done by the way,
Code:
/*
Example script for mmotop.
*/
//basic define's
#include "StdAfx.h"
#include "Setup.h"
#include "Base.h"
#define razor 1234
#define laugh 43873
#define hod 5
#define uberheal 1908
#define frostbolt 11
class RazorAI : public ArcScriptBossAI
{
ARCSCRIPT_FACTORY_FUNCTION(RazorAI, ArcScriptBossAI);
RazorAI(Creature* pCreature) : ArcScriptBossAI(pCreature)
{
//text's this is what the boss will say on combat start etc..
AddEmote(Event_OnCombatStart, "You wont stand up very long!", Text_Yell);
AddEmote(Event_Ontargetdied, "I warned you!", Text_Yell);
AddEmote(Event_OnDied, "This won't happen at any other time..", Text_Tell);
//others to make the spells work and function ^^
AddSpell(Laugh, Target_Self, 100, 6, 100);
AddSpell(frostbolt, Target_RandomPlayer, 60, 2, 20);
Addspell(hod, Target_Maintank, 35,2,22);
addspell(uberheal, Target_self, 50,25,100);
}
}
Now we have to add the actuall install code wich aint that big :)
U must not modify this couse it can make ur script not function in any way,
Add it to the script and u will have this :)
This is the complete basic boss script!
Code:
/*
Example script for mmotop.
*/
//basic define's
#include "StdAfx.h"
#include "Setup.h"
#include "Base.h"
#define razor 1234
#define laugh 43873
#define hod 5
#define uberheal 1908
#define frostbolt 11
class RazorAI : public ArcScriptBossAI
{
ARCSCRIPT_FACTORY_FUNCTION(RazorAI, ArcScriptBossAI);
RazorAI(Creature* pCreature) : ArcScriptBossAI(pCreature)
{
//text's this is what the boss will say on combat start etc..
AddEmote(Event_OnCombatStart, "You wont stand up very long!", Text_Yell);
AddEmote(Event_Ontargetdied, "I warned you!", Text_Yell);
AddEmote(Event_OnDied, "This won't happen at any other time..", Text_Tell);
//others to make the spells work and function ^^
AddSpell(Laugh, Target_Self, 100, 6, 100);
AddSpell(frostbolt, Target_RandomPlayer, 60, 2, 20);
Addspell(hod, Target_Maintank, 35,2,22);
addspell(uberheal, Target_self, 50,25,100);
}
}
void SetupRazor(ScriptMgr* pScriptMgr)
{
pScriptMgr->register_creature_script(Razor, &RazorAI::Create);
}
If you have any question feel free to add a reply to this post,
I meight make a video soon and make a guide on how to install scripts :)
Goodluck on scripting npc's
and if you want to learn way more about c++
I don't remember who gave me the link but u can find out alot here,
[Only registered and activated users can see links. ]
Bookmarks