What's wrong here? menu

Shout-Out

User Tag List

Results 1 to 4 of 4
  1. #1
    choweyiii's Avatar Contributor
    Reputation
    91
    Join Date
    Aug 2010
    Posts
    127
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    What's wrong here?

    I wanted to make a mob that shoots, but if something comes into melee range of the archer it runs back a fews steps to prepare to shoot, so I came up with this idea to fix it, but my syntax is wrong. The error I get is: "attempt to compare number with nil". I will give rep where rep is deserved.

    Code:
    function OrgrimmarGuard_Shoot(Unit, Event)
       Unit:GetMainTank() Unit:GetDistanceYards() if distance >=5 then
       Unit:FullCastSpellOnTarget(69710) --150% Shoot 5-30 yard range
       end
    end
    Last edited by choweyiii; 03-14-2011 at 05:20 PM.

    What's wrong here?
  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)
    Your code appears to be cunfuzzled.

    Code:
    function OrgrimmarGuard_Shoot(Unit, Event)
    local plr = Unit:GetMainTank()
    if Unit:GetDistanceYards(plr) >= 5 then
    Unit:FullCastSpellOnTarget(69710, plr)
    end
    end
    And you do realise ArcEmu already supports ranged attacks? Go into creature_proto table, change can_ranged column to 1 and change min_rangedamage and max_rangedamage values. Give him a bow (.npc equip3 itemid) and there you have it, your personal shooting npc (the shooting animation doesn't have projectiles for some reason).

  3. #3
    choweyiii's Avatar Contributor
    Reputation
    91
    Join Date
    Aug 2010
    Posts
    127
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That didn't work for me the npc still runs off to recast shoot; projectiles are shown with Shoot spell 69710
    Last edited by choweyiii; 03-14-2011 at 05:49 PM.

  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)
    Code:
    function OrgrimmarGuard_Shoot(Unit, Event)
    	if Unit:GetDistanceYards(Unit:GetMainTank()) >4 then
    		Unit:FullCastSpellOnTarget(69710, Unit:GetMainTank())
    		end
    end
    GetDistanceYards does have parameters, you get the distance in yards between two objects. Player and creature in your case.

    You're probably just getting warnings of unhandled spell effects or w/e.

Similar Threads

  1. whats wrong here? (lua)
    By bomsemannen in forum WoW EMU Questions & Requests
    Replies: 9
    Last Post: 09-27-2008, 07:06 AM
  2. What's wrong here?
    By Fejset in forum World of Warcraft General
    Replies: 3
    Last Post: 09-03-2008, 04:37 PM
  3. [Question] What did i do wrong here?
    By ti0r in forum WoW ME Questions and Requests
    Replies: 6
    Last Post: 04-25-2008, 08:38 AM
  4. What is wrong with mywarcraft studio?...
    By xigon in forum WoW ME Questions and Requests
    Replies: 1
    Last Post: 08-03-2007, 01:13 AM
All times are GMT -5. The time now is 05:35 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