[C++ Release] Fire Elemental menu

User Tag List

Results 1 to 15 of 15
  1. #1
    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)

    [C++ Release] Fire Elemental

    Ohai guys as a part of mah new instance thing i making for something secret, i would like to present a simple small AI script for a Fire Elemental that i made.

    Tested using a female dwarf warrior with 90k hp (i modded it ofc lawl) basically he casts fireball and fire blast at you every so often, wouldnt say hes hard but hes not easy if hes too hard for your server then just edit the spells.

    NOTE: For Aspire, tested using the 3.1 branch.


    Code:
    /*
     * FireElemental.cpp Scripts for MMOwned by 2dgreengiant
     * Copyright (C) 2008-2009 MMOwned 2dgreengiant
     */
    
    #include "StdAfx.h"
    #include "Setup.h"
    
    /************************************************************************/
    /* Instance_ElementalHell.cpp Script                                    */
    /************************************************************************/
    
    // Fire Elemental
    
    #define FIRE_ELEMENTAL 1337133
    
    #define FIRE_BLAST 13342 //Edit the number to the spell number and change FIRE_BLAST to the new spell, make sure its in caps and has a _ if it has spaces
    #define FIRE_BALL 54095
    
    class FireElementalAI : public CreatureAIScript
    {
    public:
        ADD_CREATURE_FACTORY_FUNCTION(FireElementalAI);
        SP_AI_Spell spells[2];
        bool m_spellcheck[2];
    
        FireElementalAI(CreaturePointer pCreature) : CreatureAIScript(pCreature)
        {
            nrspells = 2;
    
            for(int i=0;i<nrspells;i++)
            {
                m_spellcheck[i] = false;
            }
            
            spells[0].info = dbcSpell.LookupEntry(FIRE_BLAST);  // As said before if changing the spell change FIRE_BLAST to the new name, make sure its i ncaps and has a _ for spaces.
            spells[0].targettype = TARGET_ATTACKING;
            spells[0].instant = true; // if the spell is a cast spell change to false 
            spells[0].perctrigger = 0.0f;
            spells[0].attackstoptimer = 1000;
    
            spells[1].info = dbcSpell.LookupEntry(FIRE_BALL);
            spells[1].targettype = TARGET_ATTACKING;
            spells[1].instant = true;
            spells[1].perctrigger = 5.0f;
            spells[1].attackstoptimer = 2000;
    
        }
        
        void OnCombatStart(Unit* mTarget)
        {
            RegisterAIUpdateEvent(_unit->GetUInt32Value(UNIT_FIELD_BASEATTACKTIME));
        }
    
        void OnCombatStop(Unit *mTarget)
        {
            _unit->GetAIInterface()->setCurrentAgent(AGENT_NULL);
            _unit->GetAIInterface()->SetAIState(STATE_IDLE);
            RemoveAIUpdateEvent();
        }
    
        void OnDied(Unit * mKiller)
        {
           RemoveAIUpdateEvent();
        }
    
        void AIUpdate()
        {
            float val = (float)RandomFloat(100.0f);
            SpellCast(val);
    
        }
    
        void OnCombatStart(UnitPointer mTarget)
        {
            RegisterAIUpdateEvent(_unit->GetUInt32Value(UNIT_FIELD_BASEATTACKTIME));
            _unit->SendChatMessage(CHAT_MSG_MONSTER_YELL, LANG_UNIVERSAL, "My flames will burn you mortal fool!");
        }
        void OnDamageTaken(UnitPointer mAttacker, float fAmount)
        {
        RegisterAIUpdateEvent(_unit->GetUInt32Value(UNIT_FIELD_BASEATTACKTIME));
            
        _unit->CastSpell(_unit, spells[0].info, spells[0].instant);
        }
    
        void OnCombatStop(UnitPointer mTarget)
        {
            _unit->GetAIInterface()->setCurrentAgent(AGENT_NULL);
            _unit->GetAIInterface()->SetAIState(STATE_IDLE);
            RemoveAIUpdateEvent();
        }
    
        void OnDied(UnitPointer  mKiller)
        {
           RemoveAIUpdateEvent();
        }
    
        void SpellCast(float val)
        {
            if(_unit->GetCurrentSpell() == NULL && _unit->GetAIInterface()->GetNextTarget())
            {
                float comulativeperc = 0;
                UnitPointer target = NULLUNIT;
                for(int i=0;i<nrspells;i++)
                {
                    if(!spells[i].perctrigger) continue;
                    
                    if(m_spellcheck[i])
                    {
                        if (!spells[i].instant)
                            _unit->GetAIInterface()->StopMovement(1);
    
                        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))
                    {
                        _unit->setAttackTimer(spells[i].attackstoptimer, false);
                        m_spellcheck[i] = true;
                    }
                    comulativeperc += spells[i].perctrigger;
                }
            }
        }
    
        void Destroy()
        {
            delete this;
        };
    
    protected:
    
        int nrspells;
    };
    
    void SetupFireElemental(ScriptMgr * mgr)
    {
        mgr->register_creature_script(FIRE_ELEMENTAL, &FireElementalAI::Create);
    }
    C++ pastebin - collaborative debugging tool

    Download (if your THAT lazy) : CLICK ME
    Last edited by 2dgreengiant; 06-28-2009 at 01:50 PM.
    If you need me you have my skype, if you don't have my skype then you don't need me.

    [C++ Release] Fire Elemental
  2. #2
    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)
    EDIT: heres the sql for it:

    Code:
    insert  into `creature_names`(`entry`,`name`,`subname`,`info_str`,`Flags1`,`type`,`family`,`rank`,`unk4`,`spelldataid`,`male_displayid`,`female_displayid`,`male_displayid2`,`female_displayid2`,`unknown_float1`,`unknown_float2`,`civilian`,`leader`) values (1337133,'Fire Elemental','The Destroyer','',0,6,16,0,0,0,18244,0,0,0,1,1,0,0);
    insert  into `creature_proto`(`entry`,`minlevel`,`maxlevel`,`faction`,`minhealth`,`maxhealth`,`mana`,`scale`,`npcflags`,`attacktime`,`attacktype`,`mindamage`,`maxdamage`,`rangedattacktime`,`rangedmindamage`,`rangedmaxdamage`,`Item1`,`Item2`,`Item3`,`respawntime`,`resistance1`,`resistance2`,`resistance3`,`resistance4`,`resistance5`,`resistance6`,`resistance7`,`combat_reach`,`bounding_radius`,`auras`,`boss`,`money`,`invisibility_type`,`death_state`,`walk_speed`,`run_speed`,`fly_speed`,`extra_a9_flags`,`auraimmune_flag`,`vehicle_entry`,`CanMove`) values (1337133,80,80,17,40000,40000,0,1,0,1500,0,56,200,0,0,0,0,0,0,360000,0,0,0,0,0,0,0,1,0.462,'0',0,6,0,0,2.5,8,14,0,0,-1,7);
    If you need me you have my skype, if you don't have my skype then you don't need me.

  3. #3
    Bunster's Avatar Active Member
    Reputation
    19
    Join Date
    May 2008
    Posts
    553
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Nice lool forget the important part xD

  4. #4
    svedin's Avatar Contributor
    Reputation
    124
    Join Date
    Jun 2008
    Posts
    557
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Nice ^^ i want to see that instance that you maybe will make

    But +rep x2 for this one only cuz this will be yours 990's rep

  5. #5
    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)
    No1 pointed out my spelling error haha.
    If you need me you have my skype, if you don't have my skype then you don't need me.

  6. #6
    Hunterplay's Avatar Contributor
    Reputation
    158
    Join Date
    Jun 2008
    Posts
    927
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Have some rep :P

    edit:Need to spread
    Former News Team Member

  7. #7
    Xcynic's Avatar Contributor
    Reputation
    252
    Join Date
    Jul 2007
    Posts
    359
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    nice 2d, but you have to become better :P xD

  8. #8
    Choices's Avatar Member
    Reputation
    94
    Join Date
    Apr 2008
    Posts
    231
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by 2dgreengiant View Post
    [COLOR=White]Ohai guys as a part of mah new instance thing i making for something secret, i would like to present a
    Isnt this the same as what u labelled as Crystalcore.cpp (lol)

    Also, i think i know that secret thing!

  9. #9
    Hellgawd's Avatar Member
    Reputation
    710
    Join Date
    Jun 2007
    Posts
    2,480
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    GRTZ 2ddddddddd

  10. #10
    alj03's Avatar Contributor
    Reputation
    91
    Join Date
    Feb 2008
    Posts
    1,103
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Nice, have some repzorz!

    Edit: Got to spread.
    Death to all but Metal.

  11. #11
    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)
    Originally Posted by PaulB View Post
    Isnt this the same as what u labelled as Crystalcore.cpp (lol)

    Also, i think i know that secret thing!

    Nah it was sorta named like that lawl but new name is more fitting, and you don't know what it is
    If you need me you have my skype, if you don't have my skype then you don't need me.

  12. #12
    Linkn's Avatar Contributor
    Reputation
    90
    Join Date
    Mar 2009
    Posts
    296
    Thanks G/R
    0/0
    Trade Feedback
    1 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    nice, +Rep of course.

  13. #13
    Link_S's Avatar Member
    Reputation
    125
    Join Date
    Dec 2008
    Posts
    293
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Nice, you lazy one xD, you edited a core one :P.
    Why do I need a signature?

  14. #14
    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)
    I knew some1 would say that but funny thing is i actually didnt xD
    If you need me you have my skype, if you don't have my skype then you don't need me.

  15. #15
    PinkiPan's Avatar Active Member

    Reputation
    55
    Join Date
    Jan 2008
    Posts
    494
    Thanks G/R
    0/4
    Trade Feedback
    4 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks .

Similar Threads

  1. Bastion Of Twilight, Negate Exploding Fire Elementals (Warlock)
    By squee666 in forum World of Warcraft Exploits
    Replies: 11
    Last Post: 03-20-2011, 09:56 PM
  2. [Model Swap] Druid (Force of Nature) Treants -> Fire elementals
    By pewpewboltz in forum WoW ME Questions and Requests
    Replies: 3
    Last Post: 07-19-2010, 08:22 PM
  3. AR Elements of the worlds release 0.1
    By jarmale6 in forum World of Warcraft Emulator Servers
    Replies: 1
    Last Post: 05-08-2008, 02:10 PM
  4. [Creature Edit] Voidwalker -> Fire Elemental
    By *ChAoS* in forum World of Warcraft Model Editing
    Replies: 12
    Last Post: 04-12-2008, 03:03 PM
  5. [Shaman] Refund mana while keeping fire elemental
    By Gastricpenguin in forum WoW EMU Exploits & Bugs
    Replies: 4
    Last Post: 02-04-2008, 07:20 PM
All times are GMT -5. The time now is 06:41 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