Random C++ boss[Dark Knight] menu

User Tag List

Page 1 of 2 12 LastLast
Results 1 to 15 of 19
  1. #1
    mager1794's Avatar Member
    Reputation
    356
    Join Date
    Feb 2008
    Posts
    703
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Random C++ boss[Dark Knight]

    this is a boss script i made im studyin C++ and this is my work [some of what i dont understand i had to take from moon++ so creds there XD]

    Code:
    #include "StdAfx.h"
    #include "Setup.h"
    /************************************************************************/
    /* DarkKnight.cpp Script                                       */
    /************************************************************************/
    #define NPCID [your NPC ID]
     
    #define DARK_DECAY 33129
    #define SHADOW_BLAST 41078
     
    class DARKKNIGHTAI : public CreatureAIScript
    {
    public:
        ADD_CREATURE_FACTORY_FUNCTION(DARKKNIGHTAI);
       SP_AI_Spell spells[2];
       bool m_spellcheck[2];
         CHRONOLORDDEJAAI(Creature* pCreature) : CreatureAIScript(pCreature)
        {
          nrspells = 2;
          for(int i=0;i<nrspells;i++)
          {
             m_spellcheck[i] = false;
          }
            spells[0].info = dbcSpell.LookupEntry(DARK_DECAY);
          spells[0].targettype = TARGET_ATTACKING;
          spells[0].instant = true;
          spells[0].cooldown = 10;
          spells[0].perctrigger = 0.0f;
          spells[0].attackstoptimer = 1000;
     
          spells[1].info = dbcSpell.LookupEntry(SHADOW_BLAST);
          spells[1].targettype = TARGET_ATTACKING;
          spells[1].instant = false;
          spells[1].cooldown = 14;
          spells[1].perctrigger = 0.0f;
          spells[1].attackstoptimer = 1000;
        }
        void OnCombatStart(Unit* mTarget)
        {
          CastTime();
          _unit->SendChatMessage(CHAT_MSG_MONSTER_YELL, LANG_UNIVERSAL, "Prepare to taste the wrath of the night");
          RegisterAIUpdateEvent(_unit->GetUInt32Value(UNIT_FIELD_BASEATTACKTIME));
        }
      void CastTime()
       {
          for(int i=0;i<nrspells;i++)
             spells[i].casttime = spells[i].cooldown;
       }
       void OnTargetDied(Unit* mTarget)
        {
          if(_unit->GetHealthPct() > 0)
          {
             uint32 sound = 0;
             char *text;
             switch(RandomUInt(1))
             {
             case 0:
                text = "AHAHAHAHA NONE CAN AMOUNT TO MY POWER!!!!!";
                break;
             case 1:
                text = "Fool you honestly thought you could defeat me ahahaha!";
                break;
             }
             _unit->SendChatMessage(CHAT_MSG_MONSTER_YELL, LANG_UNIVERSAL, text);
          }
        }
        void OnCombatStop(Unit *mTarget)
        {
          CastTime();
            _unit->GetAIInterface()->setCurrentAgent(AGENT_NULL);
            _unit->GetAIInterface()->SetAIState(STATE_IDLE);
            RemoveAIUpdateEvent();
        }
       void OnDied(Unit * mKiller)
        {
          CastTime();
          _unit->SendChatMessage(CHAT_MSG_MONSTER_YELL, LANG_UNIVERSAL, "H..ho..how did you...");
           RemoveAIUpdateEvent();
        }
        void AIUpdate()
       {
          float val = (float)RandomFloat(100.0f);
          SpellCast(val);
        }
       void SpellCast(float val)
       {
            if(_unit->GetCurrentSpell() == NULL && _unit->GetAIInterface()->GetNextTarget())
            {
             float comulativeperc = 0;
              Unit *target = NULL;
             for(int i=0;i<nrspells;i++)
             {
                spells[i].casttime--;
     
                if (m_spellcheck[i])
                {               
                   spells[i].casttime = spells[i].cooldown;
                   target = _unit->GetAIInterface()->GetNextTarget();
                   switch(spells[i].targettype)
                   {
                      case TARGET_SELF:
                      case TARGET_VARIOUS:
                         _unit->CastSpell(_unit, spells[i].info, spells[i].instant); break;
                      case TARGET_ATTACKING:
                         _unit->CastSpell(target, spells[i].info, spells[i].instant); break;
                      case TARGET_DESTINATION:
                         _unit->CastSpellAoF(target->GetPositionX(),target->GetPositionY(),target->GetPositionZ(), spells[i].info, spells[i].instant); break;
                   }
     
                   m_spellcheck[i] = false;
                   return;
                }
                if ((val > comulativeperc && val <= (comulativeperc + spells[i].perctrigger)) || !spells[i].casttime)
                {
                   _unit->setAttackTimer(spells[i].attackstoptimer, false);
                   m_spellcheck[i] = true;
                }
                comulativeperc += spells[i].perctrigger;
             }
          }
       }
    protected:
       int nrspells;
    };
    void SetupMagerScript(ScriptMgr * mgr)
    {
       mgr->register_creature_script(NPCID, &DARKKNIGHTAI::Create);
    }
    its not tested sorry but i dont have visual C++ on this comp so anyone mind runnin a test of it for me and telling me if it works
    Last edited by mager1794; 07-06-2008 at 04:00 PM.
    Lunar Gaming - Reaching For The Stars

    Random C++ boss[Dark Knight]
  2. #2
    Arthas117's Avatar Knight-Champion
    Reputation
    151
    Join Date
    Mar 2007
    Posts
    483
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    nvm, was just trying to make people happy lol

    cody says:
    Dude you even realise you will look like a moron when people see that?
    arthas117(knarkfarfar) says:
    Gosh thank you, another guy to remove from my msn
    Last edited by Arthas117; 07-06-2008 at 03:48 PM.

    World best PvP Paladin=Me? GG ;D


  3. #3
    mager1794's Avatar Member
    Reputation
    356
    Join Date
    Feb 2008
    Posts
    703
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    dude....im not even close lol im just learning it
    Lunar Gaming - Reaching For The Stars

  4. #4
    2dgreengiant's Avatar ★ Elder ★


    Reputation
    1192
    Join Date
    Feb 2007
    Posts
    7,129
    Thanks G/R
    1/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Very nice indeed +rep
    If you need me you have my skype, if you don't have my skype then you don't need me.

  5. #5
    mager1794's Avatar Member
    Reputation
    356
    Join Date
    Feb 2008
    Posts
    703
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    im sorry arthas
    Last edited by mager1794; 07-06-2008 at 04:10 PM.
    Lunar Gaming - Reaching For The Stars

  6. #6
    Gastricpenguin's Avatar Legendary
    Reputation
    980
    Join Date
    Feb 2007
    Posts
    2,236
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    [/code]#define NPCID [your NPC ID][/code]

    I would define that first if i were you.
    Life Puzzler WoW - Website | Forums

  7. #7
    mager1794's Avatar Member
    Reputation
    356
    Join Date
    Feb 2008
    Posts
    703
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    its asking you to define it i didn't make the npc so i let oyu choose the NPC ID
    look at it
    Code:
     
    #define NPCID [your NPC ID]
    then when registering it

    Code:
    mgr->register_creature_script(NPCID, &DARKKNIGHTAI::Create);
    it says NPCID so that way you only have to edit the top little part instead of finding the part at the bottom
    i planned it out Gastric XD
    Lunar Gaming - Reaching For The Stars

  8. #8
    doublehex's Avatar Member
    Reputation
    34
    Join Date
    Mar 2007
    Posts
    385
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    its a good start. +rep


  9. #9
    jay08's Avatar Member
    Reputation
    4
    Join Date
    Jun 2008
    Posts
    39
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    nice Arthas +Rep

  10. #10
    BrantX's Avatar Contributor
    Reputation
    205
    Join Date
    Jul 2007
    Posts
    899
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hmm seems i should start on C++ T_T. Everyone noz lua! +Rep



  11. #11
    mager1794's Avatar Member
    Reputation
    356
    Join Date
    Feb 2008
    Posts
    703
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i advise you learn it brant its twice as fun as LUA and like 100x as powerful
    Lunar Gaming - Reaching For The Stars

  12. #12
    Kiyoshi's Avatar Member
    Reputation
    28
    Join Date
    Jun 2008
    Posts
    192
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yeah I got a C++ book but mager here says that that isn't the way to start =/ Now I'm confused...

  13. #13
    doublehex's Avatar Member
    Reputation
    34
    Join Date
    Mar 2007
    Posts
    385
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    lol cloud, you gotta learn the basics first, like with everything else, your not gonna join in some soccer team and play a game with out practicing and learning the basics.


  14. #14
    Kiyoshi's Avatar Member
    Reputation
    28
    Join Date
    Jun 2008
    Posts
    192
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    So I should read some books on C++ first then learn the WoW scripting branch of it right?

  15. #15
    mager1794's Avatar Member
    Reputation
    356
    Join Date
    Feb 2008
    Posts
    703
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks for all of zee comments guys XD
    Lunar Gaming - Reaching For The Stars

Page 1 of 2 12 LastLast

Similar Threads

  1. Skip a few bosses in random herioc dungeon (works well as tank and healer)
    By drastickog in forum World of Warcraft Exploits
    Replies: 6
    Last Post: 01-19-2010, 01:38 AM
  2. Dark Blood knight Realms 3.1.3 Hamachi
    By XDoombladeX in forum WoW Emulator Server Listings
    Replies: 0
    Last Post: 06-11-2009, 05:46 PM
  3. dark knight
    By TheXero in forum World of Warcraft General
    Replies: 3
    Last Post: 09-24-2008, 06:33 AM
  4. Review of "The Dark Knight"
    By berryman13 in forum Community Chat
    Replies: 3
    Last Post: 06-28-2008, 04:20 PM
  5. [Release] Death Knight LUA Boss
    By TheSpidey in forum World of Warcraft Emulator Servers
    Replies: 5
    Last Post: 03-14-2008, 12:00 PM
All times are GMT -5. The time now is 08:24 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search