[Help] i need Lua help with this script... menu

Shout-Out

User Tag List

Page 2 of 2 FirstFirst 12
Results 16 to 26 of 26
  1. #16
    Ellenor's Avatar Active Member
    Reputation
    18
    Join Date
    Jan 2008
    Posts
    281
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    no...
    i want him to be stealth when it start

    and when he reach less than 50% of hes/her hp to cast stun thats all lol

    [Help] i need Lua help with this script...
  2. #17
    Snailz's Avatar Contributor Authenticator enabled
    Reputation
    239
    Join Date
    Nov 2007
    Posts
    941
    Thanks G/R
    2/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    K.. ill se what i can dooo
    Cheese Cake?

  3. #18
    Snailz's Avatar Contributor Authenticator enabled
    Reputation
    239
    Join Date
    Nov 2007
    Posts
    941
    Thanks G/R
    2/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    kk all done try this one.

    Save as LUA :
    Code:
    function Boss_Phase1(pUnit, event)
        if pUnit:GetHealthPct() < 50 then
            pUnit:RemoveEvents()
            pUnit:GetClosestPlayer(1)
            pUnit:CastSpell(22427)
            pUnit:SendChatMessage(12, 0, "You Gonna Die %N")
        end
    end
    
    
    function Boss_OnCombat(pUnit, event)
        pUnit:CastSpell(10032)
        pUnit:RegisterEvent("Boss_Phase1",1000, 0)
    end
    
    
    RegisterpUnitEvent(104, 1, "Boss_OnCombat")
    Cheese Cake?

  4. #19
    Ellenor's Avatar Active Member
    Reputation
    18
    Join Date
    Jan 2008
    Posts
    281
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    its not a correct lua...

    here is what it say RogueRogue.lua (could not run)
    scripts\RogueRogue .lua :17:attempt to call global 'RegisterpUnit event' <a nil value>

  5. #20
    Ellenor's Avatar Active Member
    Reputation
    18
    Join Date
    Jan 2008
    Posts
    281
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    snailz ur lua script is not correct..... .... ...not working

    i manage to fix that somehow but still got another big prob.....


    function Boss_Phase1111(pUnit, event)
    if pUnit:GetHealthPct() < 50 then
    pUnit:RemoveEvents()
    pUnit:GetClosestPlayer(1)
    pUnit:CastSpell(22427)
    pUnit:SendChatMessage(12, 0, "You Gonna Die $N")
    end
    end


    function Rogue_start1(pUnit, Event)
    pUnit:RegisterEvent("Boss_Phase1111",1000, 0)
    pUnit:FullCastSpell(10032)
    end
    RegisterUnitEvent(104, 6, "Rogue_start1")


    This time the boss target only him self! i mean he cast the spell to himself/herself lol....

    can someone help me fix it so it can target player ?

  6. #21
    Snailz's Avatar Contributor Authenticator enabled
    Reputation
    239
    Join Date
    Nov 2007
    Posts
    941
    Thanks G/R
    2/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yeah sorry about that
    Code:
    function Boss_Phase1(pUnit, event)
        if pUnit:GetHealthPct() < 50 then
            pUnit:RemoveEvents()
            pUnit:GetClosestPlayer(1)
            pUnit:CastSpell(22427)
            pUnit:SendChatMessage(12, 0, "You Gonna Die &#37;N")
        end
    end
    
    
    function Boss_OnCombat(pUnit, event)
        pUnit:CastSpell(10032)
        pUnit:RegisterEvent("Boss_Phase1",1000, 0)
    end
    Register pUnitEvent(104, 1, "Boss_OnCombat")
    Is Right

    or

    RegisterpUnit Event
    Cheese Cake?

  7. #22
    Snailz's Avatar Contributor Authenticator enabled
    Reputation
    239
    Join Date
    Nov 2007
    Posts
    941
    Thanks G/R
    2/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Also Try

    pUnit:GetMainTank()
    Cheese Cake?

  8. #23
    Ellenor's Avatar Active Member
    Reputation
    18
    Join Date
    Jan 2008
    Posts
    281
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ammm same thing happen like last time....

    ur sql is incorect or smething and cant give me the same error......

  9. #24
    Ellenor's Avatar Active Member
    Reputation
    18
    Join Date
    Jan 2008
    Posts
    281
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Snailz View Post
    Also Try

    pUnit:GetMainTank()
    Didnt work....

    It only say the words but did not cast the stun spell

  10. #25
    pepsi1x1's Avatar Member
    Reputation
    26
    Join Date
    Jul 2007
    Posts
    58
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Lua is not my thing but, heres a C++ script for it


    • save this as A_name_you_like.cpp
    • and put it in your instance scripts folder
    • open your scripts solution
    • drag the file into the instance scripts, in the solution explorer (the pane on the left of the window) in the scripts folder.
    • add the lines into your setup.cpp and setup.h files
    • compile your scripts and voila!

    Code:
    #include "StdAfx.h"
    #include "Setup.h"
    
    //--------------------------Custom Creature-----------------------------//
    //------------------------Scripted by Pepsi1x1--------------------------//
    
    #define CN_KING 104
    
    #define UBER_STEALH 10032
    #define STUN 22427
    
    class KingAI : public CreatureAIScript
    {
    public:
        ADD_CREATURE_FACTORY_FUNCTION(KingAI);
    
        KingAI(Creature* pCreature) : CreatureAIScript(pCreature)
        {
    		spells[0].info = dbcSpell.LookupEntry(UBER_STEALH);
    		spells[0].targettype = TARGET_SELF;
    		spells[0].instant = true;
    
    
    		spells[1].info = dbcSpell.LookupEntry(STUN);
    		spells[1].targettype = TARGET_RANDOM_SINGLE;
    		spells[1].instant = true;
    		spells[1].speech = "You Gonna Die";
    
        }
    	
    	void OnSpawn()
    	{
    		_unit->CastSpell(_unit, spells[0].info, spells[0].instant); break;
    	}
        
        void OnCombatStart(Unit* mTarget)
        {
    		RegisterAIUpdateEvent(1500);
        }
    
    	void OnTargetDied(Unit* mTarget)
        {
        }
    
        void OnCombatStop(Unit *mTarget)
        {
            _unit->GetAIInterface()->setCurrentAgent(AGENT_NULL);
            _unit->GetAIInterface()->SetAIState(STATE_IDLE);
    
            RemoveAIUpdateEvent();
        }
    
        void OnDied(Unit * mKiller)
        {
    		_unit->SendChatMessage(CHAT_MSG_MONSTER_YELL, LANG_UNIVERSAL, "Im...dead!");
    
           RemoveAIUpdateEvent();
        }
    
        void AIUpdate()
        {
    		if(_unit->GetHealthPct() < 50)
    		{
       			target = _unit->GetAIInterface()->GetNextTarget();
    			_unit->CastSpell(target, 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);
    						}
                             RemoveAIUpdateEvent();
    				}
        }
    
    };
    
    
    void SetupCustomCreature(ScriptMgr * mgr)
    {
    	mgr->register_creature_script(CN_KING, &KingAI::Create);
    
    }

    add this line in to your setup.cpp

    Code:
    SetupCustomCreature(mgr);
    and this line into your setup.h

    Code:
    void SetupCustomCreature(ScriptMgr * mgr);
    then compile
    Last edited by pepsi1x1; 03-01-2008 at 02:56 AM.

  11. #26
    Ellenor's Avatar Active Member
    Reputation
    18
    Join Date
    Jan 2008
    Posts
    281
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    well man great thx for u guide but i am still learning lua...

    I am not that Exceprt or smart or intellect like u to do the guide

    Anyway big thx! And once i am done with that i will try ur code C++!

    +rep pepsi and again thx

Page 2 of 2 FirstFirst 12

Similar Threads

  1. Need help with this LUA script, please.
    By Eliteplague in forum WoW Bots Questions & Requests
    Replies: 6
    Last Post: 11-18-2011, 01:27 PM
  2. [Lua Script] Need help with this lua gossip script
    By diviee3 in forum WoW EMU Questions & Requests
    Replies: 1
    Last Post: 06-21-2010, 07:52 PM
  3. Need help with my script [lua]
    By Satzen in forum World of Warcraft Emulator Servers
    Replies: 5
    Last Post: 05-18-2008, 05:19 PM
  4. Help with this LUA script
    By jordash in forum World of Warcraft Emulator Servers
    Replies: 7
    Last Post: 03-08-2008, 04:19 PM
  5. [Need help] What's wrong with this script?
    By Arthas117 in forum World of Warcraft Emulator Servers
    Replies: 4
    Last Post: 01-10-2008, 02:04 PM
All times are GMT -5. The time now is 05:10 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