Welcome to the MMOtop - Arcemu, Mangos, Trinity.
+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    yvo
    Status : yvo is offline
    Join Date : Jul 2009
    Location : Under a roof
    Posts : 304
    Thanks: 10
    Thanked 11 Times in 10 Posts
    Rep Power : 3
    Reputation:71yvo will become famous soon enough

    Default How to script a boss in c++

    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 :)

    Code:
    /*
    Razor script for mmotop
    */
    
    //basic define's
    #include "StdAfx.h"
    #include "Setup.h"
    #include "Base.h"
    
    //old razor ^^
    #define razor 1234
    
    //spells
    #define uberheal 1908
    #define hod 5
    #define frostbolt 11
    #define laugh 43873
    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);
    2.
    Code:
    AddSpell(frostbolt, Target_RandomPlayer, 60, 2, 20);
    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,

    Code:
    void SetupRazor(ScriptMgr* pScriptMgr)
    {
            pScriptMgr->register_creature_script(Razor, &RazorAI::Create);
    }
    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. ]

    Goodluck!

    --yvoms

  2. #2
    Dreadkiller's Avatar
    Status : Dreadkiller is offline
    Join Date : Oct 2010
    Location : Germany
    Posts : 279
    Thanks: 1
    Thanked 12 Times in 10 Posts
    Rep Power : 2
    Reputation:26Dreadkiller is on a distinguished road

    Default

    for which core surely not for trinity. the kind of script let me expect its arcemu ?
    [Only registered and activated users can see links. ]

  3. #3
    yvo
    Status : yvo is offline
    Join Date : Jul 2009
    Location : Under a roof
    Posts : 304
    Thanks: 10
    Thanked 11 Times in 10 Posts
    Rep Power : 3
    Reputation:71yvo will become famous soon enough

    Default

    yupp,


 

Visitors found this page by searching for:

trinity boss script c

scripting a boss

trinity scripting a boss with c

basic scripting boss trinity

how to script wow bosses c

mmotop

trinity c boss scripten

c scripting boss trinity guide

basic guide to script boss in wow

scripting boss trinity

how to scripting npc

howto script boss mangos

How to script a Boss in C trinity

how to script trinity boss

Exemple de script C trinity

complete guide to script boss in wow

c code example for casting spells in mmo

c boss tutorial

how to scripting npc trinity

how to script bosses in trinity

exemple script boss c

c boss script trinity

how to script bosses c

trinity script boss

how to script boss c wow

SEO Blog

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts