[Guide]More LUA ascent 2.3 scripts menu

User Tag List

Page 1 of 2 12 LastLast
Results 1 to 15 of 28
  1. #1
    Pragma's Avatar Contributor
    Reputation
    261
    Join Date
    Feb 2007
    Posts
    630
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [Guide]More LUA ascent 2.3 scripts

    Illidan1 made this previous guide found here: http://www.mmowned.com/forums/emulat...-updating.html and I am continuing it.

    This will be updated as I learn more.

    -={Make it play a sound when you attack an NPC}=-

    Below is the basic template for this type of script:
    Code:
    function Name_Event (pUnit, Event)
        pUnit:PlaySoundToSet (Sound ID)
    end
    RegisterUnitEvent (NPC ID,When, "Name_Event")

    Everything that is red will be changed

    Step 1: Open up textpad, notepad, wordpad, whatever and copy and paste the above template
    Step 2:
    function Name_Event (pUnit, Event) = The name of your npc (Doesnt really matter what you put there as long as there are no spaces)
    Step 3:
    function Name_Event (pUnit, Event) = When it happend i.e. OnCombat(it also doesnt matter what you put here like above)

    Step 4: pUnit:PlaySoundToSet (Sound ID) = Put in here the sound ID you want it to play
    Step 5:
    RegisterUnitEvent (NPC ID,When, "Name_Event") = Put in the ID of the NPC you want to play the sound
    Step 6:
    RegisterUnitEvent (NPC ID,When, "Name_Event") = When it will play the sound, use the codes from below \/
    Code:
    
    
    1 = Enter Combat
    2 = Leave Combat
    3 = Killed Target
    4 = Died
    5 = AI Tick
    6 = Spawn
    7 = Gossip Talk
    8 = Reach Waypoint
    9 = On Leave Limbo
    10 = Player Enters Range

    Step 7:
    RegisterUnitEvent (NPC ID,When, "Name_Event") = Make sure its exactly the same as from step 2 and 3
    Step 8: You can save the file name as anything you want just make file type a .lua file i.e. yourface.lua

    -={Make an NPC spawn when the other dies}=-
    Use this as the template for your lua script
    Code:
    function Name_Event(pUnit, Event)
        
        x = pUnit:GetX();
        y = pUnit:GetY();
        z = pUnit:GetZ();
        o = pUnit:GetO();
        
        pUnit:SpawnCreature(NPC ID that will be spawned, x, y, z, o,Faction,Time in milliseconds the npc will remain spawned for);
    end
    RegisterUnitEvent(NPC ID that spawns the other,When, "Name_Event")

    Everything that is red will be changed

    Step 1: Open up textpad, notepad, wordpad, whatever and copy and paste the above template
    Step 2:
    function Name_Event(pUnit, Event) = The name of the mob (there must be no spaces)
    Step 3:
    function Name_Event(pUnit, Event) = when it happens, it doesnt really matter but i.e. OnCombat
    Step 4:
    pUnit:SpawnCreature(NPC ID that will be spawned, x, y, z, o,Time in milliseconds the npc will remain spawned for); = The id of the NPC you want to be spawned
    Step 5:
    pUnit:SpawnCreature(NPC ID that will be spawned, x, y, z, o,Time in milliseconds the npc will remain spawned for); = How much time (in milliseconds) you want the npc to be spawned for (1000 = one second)
    Step 6: RegisterUnitEvent(NPC ID that spawns the other,When, "Name_Event") = The ID of the NPC that spawns the other
    Step 7:
    RegisterUnitEvent(NPC ID that spawns the other,When, "Name_Event") = When the npc will be spawned. Use the code from above in the thread
    Step 8:
    RegisterUnitEvent(NPC ID that spawns the other,When, "Name_Event") = Same thing from step 2 and 3
    Step 9:
    You can save the file name as anything you want just make file type a .lua file i.e. yourface.lua make it something youll remember



    For Greatdrak:
    Heres an example script of what you wanted the npc to do:
    p.s. his flags should be set to 7 or 2 in creature_proto

    Code:
    function npc_Sigh(pUnit)
    x = pUnit:GetX()
    y = pUnit:GetY()
    z = pUnit:GetZ()
    o = pUnit:GetO()
    
    x = x + 5
    
    pUnit:Emote(sigh emote ID)
    pUnit:MoveTo(x,y,z,o)
    end
    
    
    function npc_Guy(pUnit)
    pUnit:SendChatMessage(11,0,"Your chat message here.")
    pUnit:Emote(1)
    pUnit:RegisterEvent("npc_Sigh",16000,1)  --this Waits 16 seconds then activates the function above a maximum of 1 times
    end
    
    RegisterUnitEvent(npc ID,7,"npc_Guy")
    Last edited by Pragma; 12-31-2007 at 02:30 AM. Reason: for Greatdrak


    [Guide]More LUA ascent 2.3 scripts
  2. #2
    Pragma's Avatar Contributor
    Reputation
    261
    Join Date
    Feb 2007
    Posts
    630
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: [Guide]More LUA ascent 2.3 scripts

    Anything, anyone? ...=P


  3. #3
    Matis02's Avatar Contributor CoreCoins Purchaser
    Reputation
    154
    Join Date
    Mar 2007
    Posts
    378
    Thanks G/R
    2/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: [Guide]More LUA ascent 2.3 scripts

    Now im an expert on C++ and Lua but that is just a littel confusing for first timers.

    p.s. i can understand what your trying to do.


  4. #4
    Pragma's Avatar Contributor
    Reputation
    261
    Join Date
    Feb 2007
    Posts
    630
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: [Guide]More LUA ascent 2.3 scripts

    You use the scripts to script what happens to an npc or gameobject when it has interaction with a player or even creature to creature

    and GameMonkey scripting was droped since the newer revisions, now you have to use LUA scripting
    Last edited by Pragma; 12-03-2007 at 11:21 PM.


  5. #5
    aliscion25's Avatar Member
    Reputation
    22
    Join Date
    Jul 2007
    Posts
    140
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: [Guide]More LUA ascent 2.3 scripts

    Insane u rock thx again for your awsome work +rep
    A Dynamic Dns from dyndns.com hits Hamachi LogMeOn in the face....Hamachi Dies! Dynnds Ftw!

  6. #6
    umandez's Avatar Member
    Reputation
    6
    Join Date
    May 2007
    Posts
    53
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    lol i am ok at C++ but this is confuesing i cant work out how to do this;

    when a NPC is on a certain hp he will play a sound to the server/grow in scale/cast a spell/say something/spawn some mobs on his position and cast a spell of this self.

    Please if u could help me with this and i think many other people are looking for this also thanks :P

  7. #7
    Fronix's Avatar Banned
    Reputation
    1
    Join Date
    Sep 2007
    Posts
    16
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well u need Lua enabled if u want .lua scripts. But how do you enable lua on your server????? :S

  8. #8
    Pragma's Avatar Contributor
    Reputation
    261
    Join Date
    Feb 2007
    Posts
    630
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You need the latest ascent rev, you can find it at ascentemu.com or emupadia


  9. #9
    phantomphreak241's Avatar Member
    Reputation
    1
    Join Date
    Jan 2007
    Posts
    36
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    very nice lol

  10. #10
    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)
    very nice i really needed this +rep

    World best PvP Paladin=Me? GG ;D


  11. #11
    Pragma's Avatar Contributor
    Reputation
    261
    Join Date
    Feb 2007
    Posts
    630
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks alot guys =)


  12. #12
    Greatdrak's Avatar Contributor
    Reputation
    99
    Join Date
    Sep 2007
    Posts
    445
    Thanks G/R
    1/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Insane! havent caught you online in a while but when you get the time whip up a guide on how to make one big Lua script in which the NPC will perform these example actions upon right click: "Send Chat message" while performing emote 1 (talk) PAUSE (heres where I fail) (Sigh emote) (walk forward) etc.

    You get the idea, I dont know how to make multiple functions be performed after one another upon activation of the script, I can easily get the one done where he'll send a chat message and move, but stacking more than one on with a pause in between = hard

    so basically need to know if its possible to make more than one function per NPC
    Roses are Blue, Violets are Red, I'm crap with colors, but killer in Bed.

  13. #13
    Pragma's Avatar Contributor
    Reputation
    261
    Join Date
    Feb 2007
    Posts
    630
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    yes, ill do it now


  14. #14
    zerohero's Avatar Member
    Reputation
    3
    Join Date
    May 2007
    Posts
    30
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Well. how can i make this work?

    ok so i was wandering around google LUA and ive managed to come about this, its sopposedly the illidan event, but im afraid to try it in the /scripts folder couse idk what it'l do, so can anyone tell me if this is right, or is anything missing, or it it just wrong overall

    #include "StdAfx.h"
    #include "Setup.h"
    // --- Instance_BlackTemple.cpp Script --- //
    // --- Script made by M4ksiu --- //
    // --- Illidan Encounter Event --- //
    /* Global Variables */
    // Additional stuff
    uint32 m_phase;
    uint32 WayStart;
    uint32 FoADeaths;
    uint32 MaievDialog;
    // Events
    uint32 DoorEvent; // we can take it as private var, but I will keep it for now (to keep everything in one place - cleaner)
    uint32 BladesEvent;
    uint32 DeathEvent;
    // NPCs/Mobs/Creatures Pointers
    Unit* Illidan;
    Unit* Akama;
    Unit* Maiev;
    // Illidan's position
    float IposX;
    float IposY;
    float IposZ;
    // Akama's position
    float AposX;
    float AposY;
    float AposZ;
    // Maiev's position
    float MposX;
    float MposY;
    float MposZ;
    float MposO;
    #define WALK 0
    #define RUN 256
    #define FLY 768
    // Global definitions - comment to disable
    #define USE_SHADOW_PRISON // aggroes a lot of mobs/NPCs if they are not friendly to Illidan

    /* Flame of Azzinoth AI - Creature AI Class */
    #define CN_FLAME_OF_AZZINOTH 22997
    #define FA_MORTAL_STRIKE 37335
    #define FA_TAUNT 37486
    class FlameOfAzzinothAI : public CreatureAIScript
    {
    public:
    ADD_CREATURE_FACTORY_FUNCTION(FlameOfAzzinothAI);
    SP_AI_Spell spells[2];
    bool m_spellcheck[2];
    FlameOfAzzinothAI(Creature* pCreature) : CreatureAIScript(pCreature)
    {
    nrspells = 2;
    for(int i=0;i<nrspells;i++)
    {
    m_spellcheck[i] = false;
    }
    spells[0].info = dbcSpell.LookupEntry(FA_MORTAL_STRIKE);
    spells[0].targettype = TARGET_ATTACKING;
    spells[0].instant = true;
    spells[0].cooldown = -1;
    spells[0].perctrigger = 8.0f;
    spells[0].attackstoptimer = 1000;
    spells[1].info = dbcSpell.LookupEntry(FA_TAUNT);
    spells[1].targettype = TARGET_ATTACKING;
    spells[1].instant = true;
    spells[1].cooldown = -1;
    spells[1].perctrigger = 7.0f;
    spells[1].attackstoptimer = 1000;
    }

    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();
    FoADeaths--;
    }
    void AIUpdate()
    {
    float val = (float)sRand.rand(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;
    }
    if (spells[i].speech != "")
    {
    _unit->SendChatMessage(CHAT_MSG_MONSTER_YELL, LANG_UNIVERSAL, spells[i].speech.c_str());
    _unit->PlaySoundToSet(spells[i].soundid);
    }
    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;
    };
    /* Akama AI - Creature Gossip Class */

    #define SendQuickMenu(textid) objmgr.CreateGossipMenuForPlayer(&Menu, pCreature->GetGUID(), textid, plr); \
    Menu->SendTo(plr);

    class SCRIPT_DECL AkamaGossip : public GossipScript
    {
    public:
    void GossipHello(Object* pObject, Player* plr, bool AutoSend)
    {
    GossipMenu *Menu;
    objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 1, plr);

    Menu->AddItem( 0, "Let's free Outland!", 1);

    if(AutoSend)
    Menu->SendTo(plr);
    }

    void GossipSelectOption(Object* pObject, Player* plr, uint32 Id, uint32 IntId, const char * EnteredCode)
    {
    switch (IntId)
    {
    case 0:
    GossipHello(pObject, plr, true);
    break;

    case 1:
    {
    pObject->SetUInt32Value(UNIT_NPC_FLAGS,0);
    WayStart = 0;
    }break;
    }
    }

    void Destroy()
    {
    delete this;
    }
    };
    /* Akama AI - Creature AI Class */
    #define CN_AKAMA 22990
    #define HEALING_POTION 40535
    #define BLESSING_OF_KINGS 20217
    #define AKAMA_DESPAWN 41242
    // Door Event Spells /* I couldn't find even animation for those o_O */
    #define AKAMA_DOOR_FAIL 41271
    #define AKAMA_DOOR_OPEN 41268
    #define DEATHSWORN_DOOR_OPEN 41269
    struct Coords
    {
    float x;
    float y;
    float z;
    float o;
    };
    static Coords ToIllidan[] =
    {
    { },
    { 661.563171f, 305.711304f, 271.689148f, 6.273761f },
    { 660.248596f, 330.695679f, 271.688110f, 1.243284f },
    { 671.172241f, 353.273193f, 271.689453f, 1.022600f },
    { 694.227783f, 379.461365f, 271.792145f, 6.232135f },
    { 724.159973f, 373.263275f, 282.614349f, 5.324218f },
    { 747.034973f, 335.668274f, 307.047150f, 4.972365f },
    { 755.477234f, 304.194580f, 312.167328f, 6.276120f },
    { 771.809753f, 303.744873f, 313.563507f, 6.265894f },
    { 778.550232f, 304.515198f, 318.818542f, 0.002354f },
    { 789.564697f, 304.493652f, 319.759583f, 6.248631f },
    { 799.598389f, 295.776642f, 319.760040f, 4.687257f },
    { 799.054016f, 288.826660f, 320.030334f, 4.563174f },
    { 794.595459f, 262.302856f, 341.463715f, 4.500343f },
    { 794.396973f, 256.420471f, 341.463715f, 4.557680f },
    { 783.355957f, 250.460892f, 341.463776f, 3.746361f },
    { 764.988098f, 238.561462f, 353.646484f, 3.324606f },
    { 749.337463f, 236.288681f, 352.997223f, 1.633631f },
    { 751.941528f, 304.626221f, 352.996124f, 3.128243f },
    { 747.236511f, 304.922913f, 352.996155f, 6.278462f },
    { 747.834106f, 362.513977f, 352.996155f, 1.604554f },
    { MposX, MposY, MposZ, MposO } // Illidan death event waypoint <-- a bit hack way, but I don't have time for that
    };
    class AkamaAI : public CreatureAIScript
    {
    public:
    ADD_CREATURE_FACTORY_FUNCTION(AkamaAI);
    SP_AI_Spell spells[3];
    bool m_spellcheck[3];
    AkamaAI(Creature* pCreature) : CreatureAIScript(pCreature)
    {
    for (int i = 1; i < 21; i++)
    {
    if (i == 17)
    _unit->GetAIInterface()->addWayPoint(CreateWaypoint(i, 5000, RUN));
    if (i == 1
    _unit->GetAIInterface()->addWayPoint(CreateWaypoint(i, 0, WALK));
    else
    _unit->GetAIInterface()->addWayPoint(CreateWaypoint(i, 0, RUN));
    }
    nrspells = 1;
    for(int i=0;i<nrspells;i++)
    {
    m_spellcheck[i] = false;
    }
    spells[0].info = dbcSpell.LookupEntry(BLESSING_OF_KINGS);
    spells[0].targettype = TARGET_SELF;
    spells[0].instant = true;
    spells[0].cooldown = -1;
    spells[0].perctrigger = 7.5f;
    spells[0].attackstoptimer = 1000;
    spells[1].info = dbcSpell.LookupEntry(HEALING_POTION);
    spells[1].targettype = TARGET_SELF;
    spells[1].instant = true;
    spells[1].cooldown = -1;
    spells[1].perctrigger = 0.0f;
    spells[1].attackstoptimer = 1000;
    spells[2].info = dbcSpell.LookupEntry(AKAMA_DESPAWN);
    spells[2].targettype = TARGET_SELF;
    spells[2].instant = false;
    spells[2].cooldown = -1;
    spells[2].perctrigger = 0.0f;
    spells[2].attackstoptimer = 1000;
    _unit->SetUInt64Value(UNIT_FIELD_FLAGS, U_FIELD_FLAG_UNIT_UNTACKABLE_SELECT);
    _unit->GetAIInterface()->setMoveType(MOVEMENTTYPE_DONTMOVEWP);
    _unit->GetAIInterface()->SetAllowedToEnterCombat(false);
    _unit->GetAIInterface()->setCurrentAgent(AGENT_NULL);
    _unit->GetAIInterface()->SetAIState(STATE_IDLE);
    _unit->GetAIInterface()->m_moveRun = true;
    RegisterAIUpdateEvent(1000);
    if (!DeathEvent)
    _unit->SetUInt32Value(UNIT_NPC_FLAGS, 1);
    else _unit->SetUInt32Value(UNIT_NPC_FLAGS, 0);
    MaievDialog = 0;
    AkamaDialog = 0;
    AkamaRun = 0;
    WayStart = 2;
    m_phase = 0;
    }

    void OnCombatStart(Unit* mTarget)
    {
    _unit->SetUInt32Value(UNIT_FIELD_BYTES_2, 1);
    SoundLimiter = 0;
    //RegisterAIUpdateEvent(_unit->GetUInt32Value(UNIT_FIELD_BASEATTACKTIME));
    }
    void OnCombatStop(Unit *mTarget)
    {
    if (m_phase > 0)
    _unit->GetAIInterface()->SetAllowedToEnterCombat(false);
    //_unit->GetAIInterface()->SetAIState(STATE_IDLE);
    _unit->SetUInt32Value(UNIT_FIELD_BYTES_2, 0);
    //RemoveAIUpdateEvent();
    AkamaDialog = 0;
    //AkamaRun = 0;
    WayStart = 2;
    //_unit->GetAIInterface()->setCurrentAgent(AGENT_NULL);
    }
    void OnTargetDied(Unit* mTarget)
    {
    if (_unit->GetHealthPct() > 0)
    {
    int RandomSpeach;
    sRand.randInt(1000);
    RandomSpeach=rand()%2;
    switch (RandomSpeach)
    {
    case 0:
    _unit->SendChatMessage(CHAT_MSG_MONSTER_YELL, LANG_UNIVERSAL, "Illidan will pay!");
    _unit->PlaySoundToSet(11381);
    break;
    case 1:
    _unit->SendChatMessage(CHAT_MSG_MONSTER_YELL, LANG_UNIVERSAL, "One step closer!");
    _unit->PlaySoundToSet(11382);
    break;
    }
    }
    }
    void OnDied(Unit * mKiller)
    {
    _unit->SendChatMessage(CHAT_MSG_MONSTER_YELL, LANG_UNIVERSAL, "Fight on friends! Kill him and end the curse on my people!"); // not sure
    _unit->PlaySoundToSet(11391);
    RemoveAIUpdateEvent();
    AkamaDialog = 0;
    AkamaRun = 0;
    WayStart = 2;
    }
    void OnSpawn()
    {
    if (DeathEvent)
    {
    _unit->SetUInt64Value(UNIT_FIELD_FLAGS, U_FIELD_FLAG_UNIT_UNTACKABLE_SELECT);
    _unit->GetAIInterface()->SetAllowedToEnterCombat(false);
    _unit->SetUInt32Value(UNIT_FIELD_BYTES_2, 1);
    _unit->SetUInt32Value(UNIT_NPC_FLAGS, 0);
    }
    RegisterAIUpdateEvent(1000);
    AkamaDialog = 0;
    AkamaRun = 0;
    WayStart = 2;
    }
    void OnDespawn()
    {
    RemoveAIUpdateEvent();
    AkamaDialog = 0;
    AkamaRun = 0;
    WayStart = 2;
    }
    void AIUpdate()
    {
    SoundLimiter++;
    if (_unit->GetHealthPct() <= 15)
    {
    int RandomSpeach = rand()%2;
    if (SoundLimiter >= 15)
    {
    switch (RandomSpeach)
    {
    case 0:
    _unit->SendChatMessage(CHAT_MSG_MONSTER_YELL, LANG_UNIVERSAL, "I will not last much longer!");
    _unit->PlaySoundToSet(11385);
    break;
    case 1:
    _unit->SendChatMessage(CHAT_MSG_MONSTER_YELL, LANG_UNIVERSAL, "No! Not yet!");
    _unit->PlaySoundToSet(11386);
    break;
    }
    SoundLimiter = 0;
    }
    if (m_phase == 1)
    _unit->CastSpell(_unit, spells[1].info, spells[1].instant);
    }
    if (!m_phase && !WayStart && MaievDialog < 30)
    {
    _unit->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "Stay close to me, my friends." );
    _unit->GetAIInterface()->StopMovement(0);
    _unit->GetAIInterface()->SetAIState(STATE_SCRIPTMOVE);
    _unit->GetAIInterface()->setMoveType(MOVEMENTTYPE_WANTEDWP);
    _unit->GetAIInterface()->setWaypointToMove(1);

    DoorEvent = 0;
    WayStart = 2;
    }
    if (WayStart == 1)
    {/* We can't make it in blizzlike way so we will keep it just coded in the way we need it to get to Illidan */
    GameObject* Gate = _unit->GetMapMgr()->GetInterface()->GetGameObjectNearestCoords(774.7f, 304.6f, 314.85f, 185905);
    if (!Gate)
    {
    _unit->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "It's strange that Illidan doesn't protect himself against intruders." );
    _unit->GetAIInterface()->setMoveType(MOVEMENTTYPE_WANTEDWP);
    _unit->GetAIInterface()->setWaypointToMove(;
    _unit->SetFacing(6.248631f);
    WayStart = 2;
    return;
    }
    switch (DoorEvent)
    {
    case 1:
    {
    _unit->SetFacing(6.248631f);
    }break;
    case 5:
    {
    _unit->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "The door is all that stands between us and the Betrayer. Stand aside, friends." );
    _unit->Emote(EMOTE_ONESHOT_TALK);
    }break;
    case 8: // here will be first try to break door (Akama himself only)
    {
    _unit->CastSpellAoF(750.949463f, 278.589417f, 356.99651f, dbcSpell.LookupEntry(AKAMA_DOOR_FAIL), false);
    }break;
    case 17: // here we will stop casting spell on door
    {
    //_unit->RemoveAura();
    }break;
    case 18:
    {
    _unit->Emote(EMOTE_ONESHOT_NO);
    _unit->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "I cannot do this alone..." );
    }break;
    case 24: // summoning two spirits to help Akama with breaking doors
    {
    Udalo = _unit->GetMapMgr()->GetInterface()->SpawnCreature(23410, 751.884705f, 311.270050f, 312.121185f, 0.047113f, true, false, 0, 0);
    Olum = _unit->GetMapMgr()->GetInterface()->SpawnCreature(23411, 751.687744f, 297.408600f, 312.124817f, 0.054958f, true, false, 0, 0);
    if (Udalo)
    {
    Udalo->GetAIInterface()->SetAllowedToEnterCombat(false);
    Udalo->SetUInt64Value(UNIT_FIELD_FLAGS, U_FIELD_FLAG_UNIT_UNTACKABLE_SELECT);
    }

    if (Olum)
    {
    Olum->GetAIInterface()->SetAllowedToEnterCombat(false);
    Olum->SetUInt64Value(UNIT_FIELD_FLAGS, U_FIELD_FLAG_UNIT_UNTACKABLE_SELECT);
    }


    OK NVM ITS WAYYYY TO LONG
    Last edited by zerohero; 12-31-2007 at 07:00 PM. Reason: too long

  15. #15
    Pragma's Avatar Contributor
    Reputation
    261
    Join Date
    Feb 2007
    Posts
    630
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    that right there looks to be C++ not lua, what you do is have someone compile that into a DLL for ya

    p.s. put all that in code tags to make it in a scroll box


Page 1 of 2 12 LastLast

Similar Threads

  1. [GUIDE] More Advanced Lua
    By Scubast3ve in forum WoW EMU Guides & Tutorials
    Replies: 7
    Last Post: 06-18-2012, 11:29 PM
  2. [Guide] Another LUA Scripting Guide
    By Bapes in forum WoW EMU Guides & Tutorials
    Replies: 13
    Last Post: 05-08-2008, 05:01 PM
  3. [Guide] Explaination of Ascent Files: Ascent.conf
    By [ Prototype ] in forum WoW EMU Guides & Tutorials
    Replies: 1
    Last Post: 12-10-2007, 06:34 PM
  4. Lua Ascent Script Documentation
    By latruwski in forum World of Warcraft Emulator Servers
    Replies: 0
    Last Post: 11-26-2007, 12:42 PM
  5. [Guide] Gastricpenguin's Ascent Repack
    By Gastricpenguin in forum WoW EMU Guides & Tutorials
    Replies: 39
    Last Post: 11-14-2007, 03:03 PM
All times are GMT -5. The time now is 11:17 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search