[Trinity] Getting Friendly/Unfriendly Units in Range. menu

User Tag List

Results 1 to 1 of 1
  1. #1
    controlsx2's Avatar Member
    Reputation
    16
    Join Date
    Jun 2007
    Posts
    223
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [Trinity] Getting Friendly/Unfriendly Units in Range.

    I want an NPC to get all Friendly/unfriendly units around him/her i took the following from the Hodir.cpp

    Code:
     std::list<Unit*> TargetList;
                    Trinity::AnyUnfriendlyUnitInObjectRangeCheck checker(me, me, 100.0f);
                    Trinity::UnitListSearcher<Trinity::AnyUnfriendlyUnitInObjectRangeCheck> searcher(me, TargetList, checker);
                    me->VisitNearbyObject(100.0f, searcher);
                    for (std::list<Unit*>::iterator itr = TargetList.begin(); itr != TargetList.end(); ++itr)
                    {
                        Unit* target = *itr;
                     //Do stuff here
                        }
    Am i right in thinking the above code gets all unfriendly units in 100 yards of the Unit and runs through them in the for loop as target. Do i can put things where i put the comment to do to targets?

    If the above is true i'm assuming switching AnyUnfriendlyUnitInObjectRangeCheck to AnyFriendlyUnitInObjectRangeCheck
    would do the same but with un friendly targets. What about Neutral targets (Yellow but attackable. Like those found in starting areas so they dont auto attack you) What would they fall under seen as AnyNeutalUnitInObjectRangeCheck doesn't exist?

    [Trinity] Getting Friendly/Unfriendly Units in Range.

Similar Threads

  1. Leeching brawlers guild (every class/skill)- or may get friends help
    By Pdey in forum World of Warcraft Exploits
    Replies: 76
    Last Post: 06-07-2013, 09:59 PM
  2. [C++ Script] How can NPCS heal friendly units in Trinity Core?
    By Badcobra10 in forum WoW EMU Questions & Requests
    Replies: 4
    Last Post: 08-20-2011, 09:49 PM
  3. Getting a character power levelled, what do I say to my friends?
    By MagellanFreet in forum World of Warcraft General
    Replies: 34
    Last Post: 11-23-2007, 06:27 PM
  4. Friends can't get on
    By Detected in forum World of Warcraft Emulator Servers
    Replies: 0
    Last Post: 09-24-2007, 05:37 PM
All times are GMT -5. The time now is 04:50 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