Creature adding an item to all players in 50 yard range question. menu

Shout-Out

User Tag List

Results 1 to 3 of 3
  1. #1
    DaynNight's Avatar Private
    Reputation
    1
    Join Date
    Jan 2012
    Posts
    12
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Creature adding an item to all players in 50 yard range question.

    Hello Ownedcore so I was thinking of making a cinematic with a boss fight after it but one thing that I need for my idea is that an npc gives and item (lets say item ID 59000) to every player within 50 yards, currently I have this:

    Item script:
    Code:
    local Item = 59000
    local race = {}
    
    race[1] = 1
    race[2] = 2
    race[3] = 1
    race[4] = 1
    race[5] = 2
    race[6] = 2
    race[7] = 1
    race[8] = 2
    race[10] = 2
    race[11] = 1
    
    function Item_Trigger(item, event, player)
    	Item_menu(item, player)
    end
    
    function Item_menu(item, player)
    	if (player:IsInCombat() == true) then
    		player:SendAreaTriggerMessage("You can't disguise yourself while in combat!") 
    			else 
    				Item:GossipCreateMenu(3543, player, 0)
    				Item:GossipMenuAddItem(4, "Morph me into a Necromancer!", 22222, 0)
    				Item:GossipSendMenu(player)
    	end
    end
    
    function OnSelect(item, event, player, id, intid, code )
    	if (intid == 22222) then
    		player:SetModel(11163)
    		player:GossipComplete()
    	end
    end
    
    
    RegisterItemGossipEvent(59000, 1, "Item_Trigger")
    RegisterItemGossipEvent(59000, 2, "OnSelect")
    Cinematic Script (giving the item to players):
    Code:
    function Cinematic1(pUnit, event)
    		Jaina:SetMoveRunFlag(1)
    				local x, y, z, o = Jaina:GetX(), Jaina:GetY(), Jaina:GetZ(), Jaina:GetO()
            Jaina:MoveTo(-133.344, -386.428, 26.589, 0.0)
    		Jaina:RegisterEvent("Cinematic2", 7000, 1)
    end
    
    function Cinematic2(pUnit, event)
    		Jaina:SendChatMessage(12, 0, "Alright listen up, this is what we are going to do.")
    		Jaina:RegisterEvent("Cinematic3", 3000, 1)
    end
    
    function Cinematic3(pUnit, event)
    		Jaina:SendChatMessage(12, 0, "Use the necklace to disguise yourself into a Necromancer and stop their ceremony.")
    		Jaina:SetFacing(0.00)
    		Jaina:GetInRangePlayers()
    		Jaina:AddItem(59000)
    		Jaina:RegisterEvent("Cinematic4", 1, 1)
    end
    So what I have here doesnt work and I dont know how to give every player within 50 yards of boss the item they need for the boss fight, any suggestions?

    Kind regards, DaynNight

    Creature adding an item to all players in 50 yard range question.
  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)
    Psuedocode:

    Code:
    for _,plrs in pairs(pUnit:GetInRangePlayers()) do
        if plrs:GetDistanceYards(pUnit) < 50 then
            plrs:AddItem(59000, 1)
        end
    end

  3. #3
    DaynNight's Avatar Private
    Reputation
    1
    Join Date
    Jan 2012
    Posts
    12
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks +rep

Similar Threads

  1. Item Sheath Display - An override for Ranged to show for all players?
    By KinkyKing in forum WoW ME Questions and Requests
    Replies: 0
    Last Post: 08-17-2009, 12:14 PM
  2. Replies: 9
    Last Post: 12-27-2007, 12:52 AM
  3. Replies: 2
    Last Post: 12-05-2007, 01:42 PM
  4. How To Play sounds to all players of the server! read it here !
    By latruwski in forum World of Warcraft Emulator Servers
    Replies: 17
    Last Post: 11-30-2007, 03:33 AM
  5. Adding items to new players
    By Koksy in forum World of Warcraft Emulator Servers
    Replies: 12
    Last Post: 09-02-2007, 09:03 AM
All times are GMT -5. The time now is 05:00 AM. 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