Request: 2 v 2 dueling script menu

User Tag List

Results 1 to 6 of 6
  1. #1
    Pieterkii's Avatar Member
    Reputation
    7
    Join Date
    Jan 2009
    Posts
    89
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Request: 2 v 2 dueling script

    Hey there, i was wondering if someone could help me out with a script to enable 2 party members to duel another party of 2, doesnt sound too hard?
    thanx

    Request: 2 v 2 dueling script
  2. #2
    stoneharry's Avatar Moderator Harry


    Reputation
    1618
    Join Date
    Sep 2007
    Posts
    4,564
    Thanks G/R
    151/150
    Trade Feedback
    0 (0%)
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    If you know basic Lua you can take this script template and edit it:

    Code:
    --- Definitions --------------------------------------------------------------------------------------------------
    
    local NPC_STARTER = 400001
    local NPC_ENDER = 400000
    
    local EVENT_GUY = nil
    local Count = 0 
    local PlayerA = nil 
    local PlayerB = nil 
    local zEvent = 10 
    local zzEvent = 25
    
    local mapid, x, y, z = 0, -2375, -4213, 129
    local SCALE = 2
    local PLR_SPEED = 22
    local two_map, two_x, two_y, two_z = 0, -1819, -3792, 179
    local KNOCKBACK_SPELL = 49398
    
    --- The Event Starter ---------------------------------------------------------------------------------------------
    
    function zzz_Random_Event_OnGossip(pUnit, event, player)
            pUnit:GossipCreateMenu(1515151, player, 0)
            pUnit:GossipMenuAddItem(0, "Add me to the queue for the event.", 4, 0)
            pUnit:GossipMenuAddItem(0, "Nevermind.", 3, 0)
            pUnit:GossipSendMenu(player)
    end
    
    function zzz_Random_Event_Submenus(pUnit, event, player, id, intid, code)
            if(intid == 4) then
            --Count = Count + 1
                    --if Count == 1 then
                    if PlayerA ~= nil and PlayerB ~= nil then
                    player:SendBroadcastMessage("|cFFFF0000The Event is in progress - Please try again in a few minutes.")
                    player:SendAreaTriggerMessage("|cFFFF0000The Event is in progress - Please try again in a few minutes.")
                    end
                            if PlayerA == nil and player ~= PlayerB then
                            PlayerA = player
                            PlayerA:LearnSpell(KNOCKBACK_SPELL) 
                            PlayerA:SendBroadcastMessage("|cFFFF0000You are now in the queue to start the event!")
                            PlayerA:SendAreaTriggerMessage("|cFFFF0000You are now in the queue to start the event!")
                            player:GossipComplete()
                            else
                            --if Count == 2 then
                                    if player ~= PlayerA then
                                    PlayerB = player
                                    --Count = 0
                                    PlayerB:LearnSpell(KNOCKBACK_SPELL) 
                                    PlayerB:SendBroadcastMessage("|cFFFF0000You are now in the queue to start the event!")
                                    PlayerB:SendAreaTriggerMessage("|cFFFF0000You are now in the queue to start the event!")
                                    player:GossipComplete()
                                    else
                                    --Count = 1
                                    PlayerA:SendBroadcastMessage("|cFFFF0000You are already in the queue!")
                                    PlayerA:SendAreaTriggerMessage("|cFFFF0000You are already in the queue!")                       
                                    end
                            end
                            player:GossipComplete()
                    --end
            end
            if(intid == 3) then
            player:GossipComplete()
            end
    end
    
    RegisterUnitGossipEvent(NPC_STARTER, 1, "zzz_Random_Event_OnGossip")
    RegisterUnitGossipEvent(NPC_STARTER, 2, "zzz_Random_Event_Submenus")
    
    --- The Event ---------------------------------------------------------------------------------------------------
    
    function zzz_Random_Event_Controller(pUnit, Event)
            pUnit:RegisterEvent("zzz_CHECK_PLAYERS_TEHEzzzggz", 1000, 1)
            pUnit:RegisterEvent("zzz_CHECK_PLAYERS_TEHE", 5000, 0)
    end
    
    function zzz_CHECK_PLAYERS_TEHEzzzggz(pUnit, Event)
            EVENT_GUY = pUnit
    end
    
    RegisterUnitEvent(NPC_STARTER, 18, "zzz_Random_Event_Controller")
    
    function zzz_CHECK_PLAYERS_TEHE(pUnit, Event)
            if PlayerA ~= nil then
                    if PlayerB ~= nil then
                            if PlayerA == PlayerB then
                            PlayerA = nil
                            PlayerB = nil
                            else
                            pUnit:RemoveEvents()
                            PlayerA:SendBroadcastMessage("|cFFFF0000You're about to be teleported!")
                            PlayerA:SendAreaTriggerMessage("|cFFFF0000You're about to be teleported!")
                            PlayerB:SendBroadcastMessage("|cFFFF0000You're about to be teleported!")
                            PlayerB:SendAreaTriggerMessage("|cFFFF0000You're about to be teleported!")
                            pUnit:RegisterEvent("zzz_CHECK_PLAYERS_TEHEzz_Count", 1000, 0)
                            end
                    end
            end
    end
    
    function zzz_CHECK_PLAYERS_TEHEzz_Count(pUnit, Event)
            --if zEvent == 0 then
            --zEvent = 10
            --else
            zEvent = zEvent - 1
                    if PlayerA ~= nil then
                            if PlayerB ~= nil then
                                    if zEvent == -1 then
                                    zEvent = 10
                                    pUnit:RemoveEvents()
                                    PlayerA:Teleport(mapid, x, y, z)
                                    PlayerB:Teleport(mapid, x, y, z)
                                    PlayerA:SetScale(SCALE)
                                    PlayerB:SetScale(SCALE)
                                    PlayerA:SetPlayerSpeed(PLR_SPEED)
                                    PlayerB:SetPlayerSpeed(PLR_SPEED)
                                    pUnit:RegisterEvent("olawd_evnet_has_started_woot", 1000, 1)
                                    else
                                    PlayerA:SendBroadcastMessage("|cFFFF0000You will be teleported in "..zEvent.." seconds!")
                                    PlayerA:SendAreaTriggerMessage("|cFFFF0000You will be teleported "..zEvent.." seconds!")
                                    PlayerB:SendBroadcastMessage("|cFFFF0000You will be teleported "..zEvent.." seconds!")
                                    PlayerB:SendAreaTriggerMessage("|cFFFF0000You will be teleported "..zEvent.." seconds!")
                                    end
                            else
                            pUnit:RemoveEvents()
                            PlayerB = nil
                            PlayerA:SendBroadcastMessage("|cFFFF0000The other player has left the event!")
                            PlayerA:SendAreaTriggerMessage("|cFFFF0000The other player has left the event!")
                            pUnit:RegisterEvent("zzz_CHECK_PLAYERS_TEHE", 5000, 0)
                            end
                    else
                            if PlayerB ~= nil then
                            PlayerB:SendBroadcastMessage("|cFFFF0000The other player has left the event!")
                            PlayerB:SendAreaTriggerMessage("|cFFFF0000The other player has left the event!")
                            end
                    pUnit:RemoveEvents()
                    PlayerA = nil
                    pUnit:RegisterEvent("zzz_CHECK_PLAYERS_TEHE", 5000, 0)
                    end
            --end
    end
    
    function olawd_evnet_has_started_woot(pUnit, Event)
            pUnit:RemoveEvents() -- Just to make sure...
            PlayerA:SetPlayerLock(1)
            PlayerB:SetPlayerLock(1)
            pUnit:RegisterEvent("Root_At_Start_So_Players_Can_Get_READY", 1000, 0)
    end
    
    function Root_At_Start_So_Players_Can_Get_READY(pUnit, Event)
            zzEvent = zzEvent - 1
            if PlayerA ~= nil then
                    if PlayerB ~= nil then
                            if zzEvent == -1 then
                            zzEvent = 25
                            pUnit:RemoveEvents()
                            PlayerA:SetPlayerLock(0)
                            PlayerB:SetPlayerLock(0)
                            pUnit:RegisterEvent("zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz_CHECK_PLAYERS_TEHE", 10000, 0)
                            else
                                    if zzEvent == 19 then
                                    PlayerA:SendBroadcastMessage("|cFFFF0000If you meet a player of the same faction you need to duel your opponent to start the event. If you meet one of the opposite faction you're ready to go.")
                                    PlayerB:SendBroadcastMessage("|cFFFF0000If you meet a player of the same faction you need to duel your opponent to start the event. If you meet one of the opposite faction you're ready to go.")
                                    end
                                    if zzEvent == 9 then
                                    PlayerA:SendBroadcastMessage("|cFFFF0000If you wish to leave the event, talk to Dunkan Lefty and leave. He is stationed at the bottom and at the top. By leaving, you reset the event and you will be teleported back. You may then requeue to join again.")
                                    PlayerB:SendBroadcastMessage("|cFFFF0000If you wish to leave the event, talk to Dunkan Lefty and leave. He is stationed at the bottom and at the top. By leaving, you reset the event and you will be teleported back. You may then requeue to join again.")
                                    end
                            --PlayerA:SendBroadcastMessage("|cFFFF0000Please place the knockback spell on your action bar and do not use any other ability. The event will start in "..zzEvent.." seconds!")
                            PlayerA:SendAreaTriggerMessage("|cFFFF0000Please place the knockback spell on your action bar and do not use any other ability. The event will start in "..zzEvent.." seconds!")
                            --PlayerB:SendBroadcastMessage("|cFFFF0000Please place the knockback spell on your action bar and do not use any other ability. The event will start in "..zzEvent.." seconds!")
                            PlayerB:SendAreaTriggerMessage("|cFFFF0000Please place the knockback spell on your action bar and do not use any other ability. The event will start in "..zzEvent.." seconds!")
                            end
                    else
                    pUnit:RemoveEvents()
                    PlayerB = nil
                    PlayerA:SendBroadcastMessage("|cFFFF0000The other player has left the event!")
                    PlayerA:SendAreaTriggerMessage("|cFFFF0000The other player has left the event!")
                    pUnit:RegisterEvent("zzz_CHECK_PLAYERS_TEHE", 5000, 0)
                    end
            else
                    if PlayerB ~= nil then
                    PlayerB:SendBroadcastMessage("|cFFFF0000The other player has left the event!")
                    PlayerB:SendAreaTriggerMessage("|cFFFF0000The other player has left the event!")
                    end
            pUnit:RemoveEvents()
            PlayerA = nil
            pUnit:RegisterEvent("zzz_CHECK_PLAYERS_TEHE", 5000, 0)
            end
    end
    
    function zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz_CHECK_PLAYERS_TEHE(pUnit, Event)
            if PlayerA == nil then
            pUnit:RemoveEvents()
            Count = 0
            pUnit:RegisterEvent("zzz_CHECK_PLAYERS_TEHE", 5000, 0)
                    if PlayerB ~= nil then
                    PlayerB:Teleport(two_map, two_x, two_y, two_z)
                    PlayerB = nil
                    end
            else
                    if PlayerB == nil then
                    pUnit:RemoveEvents()
                    Count = 0
                    pUnit:RegisterEvent("zzz_CHECK_PLAYERS_TEHE", 5000, 0)
                            if PlayerA ~= nil then
                            PlayerA:Teleport(two_map, two_x, two_y, two_z)
                            PlayerA = nil
                            end
                    end
            end
    end
    
    --- The Event Starter ---------------------------------------------------------------------------------------------
    
    function zzzz_Random_Event_OnGossip(pUnit, event, player)
            pUnit:GossipCreateMenu(1515152, player, 0)
            pUnit:GossipMenuAddItem(0, "Let me leave this event.", 5, 0)
            pUnit:GossipMenuAddItem(0, "Nevermind.", 3, 0)
            pUnit:GossipSendMenu(player)
    end
    
    function zzzz_Random_Event_Submenus(pUnit, event, player, id, intid, code)
            if(intid == 5) then
            --[[--Count = 0
            print("'Let me leave this event' pressed.")
                    if player == PlayerA then
                    print("PlayerA is the person using the guy")
                            if PlayerB ~= nil then
                            print("PlayerB is not nil")
                                    if EVENT_GUY ~= nil then
                                    print("Teleporting player B out!")
                                    PlayerB:UnlearnSpell(KNOCKBACK_SPELL)
                                    PlayerB:SetScale(1)
                                    PlayerB:SetPlayerSpeed(7)
                                    PlayerB:Teleport(two_map, two_x, two_y, two_z)
                                    PlayerB = nil
                                    local name = PlayerB:GetName()
                                    end
                            end
                    print("Teleporting player A out!")
                    PlayerA:UnlearnSpell(KNOCKBACK_SPELL)
                    PlayerA:SetScale(1)
                    PlayerA:SetPlayerSpeed(7)
                    PlayerA:Teleport(two_map, two_x, two_y, two_z)
                            if EVENT_GUY ~= nil then
                                    if name ~= nil then
                                    EVENT_GUY:SendChatMessage(14,0,"The event has just been won by "..name.."!")
                                    end
                            end
                    PlayerA = nil
                    PlayerB = nil
                    EVENT_GUY:RegisterEvent("zzz_CHECK_PLAYERS_TEHE", 5000, 0)
                    else
                    print("Player is not PlayerA")
                            if player == PlayerB then
                            print("Player is PlayerB")
                                    if PlayerA ~= nil then
                                    PlayerA:UnlearnSpell(KNOCKBACK_SPELL)
                                    PlayerA:SetScale(1)
                                    PlayerA:SetPlayerSpeed(7)
                                    PlayerA:Teleport(two_map, two_x, two_y, two_z)
                                            if EVENT_GUY ~= nil then
                                            local name = PlayerA:GetName()
                                            EVENT_GUY:SendChatMessage(14,0,"The event has just been won by "..name.."!")
                                            end
                                    print("Teleporting player B out!")
                                    PlayerB:UnlearnSpell(KNOCKBACK_SPELL)
                                    PlayerB:SetScale(1)
                                    PlayerB:SetPlayerSpeed(7)
                                    PlayerB:Teleport(two_map, two_x, two_y, two_z)
                                    PlayerA = nil
                                    PlayerB = nil
                                            if EVENT_GUY ~= nil then
                                            EVENT_GUY:RegisterEvent("zzz_CHECK_PLAYERS_TEHE", 5000, 0)
                                            end
                                    else
                                    print("Teleporting player B out!")
                                    PlayerB:UnlearnSpell(KNOCKBACK_SPELL)
                                    PlayerB:SetScale(1)
                                    PlayerB:SetPlayerSpeed(7)
                                    PlayerB:Teleport(two_map, two_x, two_y, two_z)
                                    PlayerA = nil
                                    PlayerB = nil
                                            if EVENT_GUY ~= nil then
                                            EVENT_GUY:RegisterEvent("zzz_CHECK_PLAYERS_TEHE", 5000, 0)
                                            end
                                    end
                            end
                    end
                    print("gossip complete")
            player:GossipComplete()]]
                    if PlayerA ~= nil then
                    PlayerA:UnlearnSpell(KNOCKBACK_SPELL)
                    PlayerA:SetScale(1)     
                    PlayerA:SetPlayerSpeed(7)
                    PlayerA:Teleport(two_map, two_x, two_y, two_z)
                            if PlayerA == player then
                                    if EVENT_GUY ~= nil and PlayerB ~= nil then
                                    local name = PlayerB:GetName()
                                    EVENT_GUY:SendChatMessage(42,0,"The event has just been won by "..name.."!")
                                    end
                            end
                    end
                    if PlayerB ~= nil then
                            if PlayerB == player then
                                    if EVENT_GUY ~= nil and PlayerA ~= nil then
                                    local name = PlayerA:GetName()
                                    EVENT_GUY:SendChatMessage(42,0,"The event has just been won by "..name.."!")
                                    end
                            end
                    end
                    PlayerB:UnlearnSpell(KNOCKBACK_SPELL)
                    PlayerB:SetScale(1)     
                    PlayerB:SetPlayerSpeed(7)
                    PlayerB:Teleport(two_map, two_x, two_y, two_z)
                    PlayerB = nil
                    PlayerA = nil
                            if EVENT_GUY ~= nil then
                            EVENT_GUY:RegisterEvent("zzz_CHECK_PLAYERS_TEHE", 5000, 0)
                            end
                    player:GossipComplete()
            end
            if(intid == 3) then
            player:GossipComplete()
            end
    end
    
    RegisterUnitGossipEvent(NPC_ENDER, 1, "zzzz_Random_Event_OnGossip")
    RegisterUnitGossipEvent(NPC_ENDER, 2, "zzzz_Random_Event_Submenus")
    
    --- The Spell System -----------------------------------------------------------------------------------------------
    
    --[[function KNOCKBACK_spell_CAST(effectIndex, Spell)
            local Caster = Spell:GetCaster()
            if Caster == PlayerA or PlayerB then
            Spell:Cast(1) -- FullCastSpell
            else
            local plr = Spell:GetCaster()
                    if plr ~= nil then
                    plr:SendBroadcastMessage("You are not in the event!")
                    plr:SendAreaTriggerMessage("You are not in the event!")
                    end
            Spell:Cancel() -- Were not in the event
            end
    end
    
    RegisterDummySpell(KNOCKBACK_SPELL, "KNOCKBACK_spell_CAST")]] -- Not needed
    
    --------------------------------------------------------------------------------------------------------------------
    But it's a terrible, terrible script with no collision. Which means you can only have 1 at once.

  3. #3
    Pieterkii's Avatar Member
    Reputation
    7
    Join Date
    Jan 2009
    Posts
    89
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    yeah, thanx harry, 1 at once wont be fun /:
    thats why i think c++ would be better

  4. #4
    stoneharry's Avatar Moderator Harry


    Reputation
    1618
    Join Date
    Sep 2007
    Posts
    4,564
    Thanks G/R
    151/150
    Trade Feedback
    0 (0%)
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Lua can do it perfectly as well. I just gave that script as reference, I made it a while ago and it may have been useful if you needed help making the script.

    I can't be bothered to actually write the script, in C++ or Lua, to be frank. :/ I doubt anyone else can either.

  5. #5
    Pieterkii's Avatar Member
    Reputation
    7
    Join Date
    Jan 2009
    Posts
    89
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    its ok, just thought i would include such a script in my server, seeing as there are like hundreds of 2v2 teams

  6. #6
    Envoke's Avatar Contributor
    Reputation
    105
    Join Date
    Jan 2009
    Posts
    201
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I could do this but not for free : /

Similar Threads

  1. [C++] Zone Dueling Script Errors
    By AngelSandy in forum WoW EMU Questions & Requests
    Replies: 5
    Last Post: 10-10-2009, 06:06 AM
  2. [Request] Could someone test a script for me?
    By sheepking in forum WoW EMU Questions & Requests
    Replies: 4
    Last Post: 07-01-2009, 06:14 AM
  3. [Request] Gnome Fury Warrior duel wielding two Armageddon.
    By ff760725 in forum Art & Graphic Design
    Replies: 0
    Last Post: 12-17-2008, 05:13 AM
  4. Force start a duel script
    By soholy in forum World of Warcraft Emulator Servers
    Replies: 1
    Last Post: 04-09-2008, 06:10 AM
  5. [Request] Ascent Revision with LUA scripts enabled
    By Greatdrak in forum World of Warcraft Emulator Servers
    Replies: 12
    Last Post: 12-30-2007, 06:04 PM
All times are GMT -5. The time now is 08:18 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