How can NPCS heal friendly units in Trinity Core? menu

User Tag List

Results 1 to 5 of 5
  1. #1
    Badcobra10's Avatar Member
    Reputation
    5
    Join Date
    Mar 2008
    Posts
    85
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How can NPCS heal friendly units in Trinity Core?

    Hey,

    I've got my npcs scripted in C++ and now when we have npcs that cast damaging spells, we need healer npcs. I've tried to figure it out from the other scripts, I've tried to find out from the internet but I just cannot find any information about targetting a friendly unit
    Because if I use this:
    Code:
    if (Renew_Timer <= diff)
                {
                    if (Unit *pHealTarget = SelectTarget(SELECT_TARGET_RANDOM,0))
                        DoCast(pHealTarget, SPELL_RENEW);
    
                    Renew_Timer = 8000;
                } else Renew_Timer -= diff;
    It will probably heal ANY unit (even enemies). When ever I tried different things, it responded with some errors like "...not defined", "... cannot be used with..." etc.

    And if I would use
    Code:
    if (Renew_Timer <= diff)
                {
    DoCast(me, SPELL_RENEW);
     Renew_Timer = 8000;
                } else Renew_Timer -= diff;
    It will only cast it on self.


    So if anybody knows a way to do it I would really appreciate it.
    Thanks.
    Last edited by Badcobra10; 06-05-2011 at 03:29 AM.

    How can NPCS heal friendly units in Trinity Core?
  2. #2
    Scapee's Avatar Member
    Reputation
    5
    Join Date
    Oct 2009
    Posts
    15
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Would like to know also

  3. #3
    Druzil's Avatar Corporal
    Reputation
    6
    Join Date
    Oct 2010
    Posts
    27
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Perhaps a check to see if pHealTarget is of hostile faction or not?

  4. #4
    Scapee's Avatar Member
    Reputation
    5
    Join Date
    Oct 2009
    Posts
    15
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Could you give an example on how to do that Druzil possibley?

  5. #5
    4BOLTMAIN's Avatar Sergeant
    Reputation
    2
    Join Date
    Dec 2010
    Posts
    63
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    if (me->IsFriendlyTo(target))
    {
    //cast heal spell
    }
    else
    {
    //cast fireball or w/e
    }

Similar Threads

  1. [Lua Script] how can I use more "Unit"s in one LUA file
    By Gix85 in forum WoW EMU Questions & Requests
    Replies: 5
    Last Post: 06-27-2011, 02:00 AM
  2. [Trinity] .npc delete make permenant in Trinity core
    By macmac in forum WoW EMU Questions & Requests
    Replies: 2
    Last Post: 01-02-2011, 07:50 AM
  3. [Lua]How does the kill command work ? or how can i make an npc do suicide.
    By Wheeze201 in forum WoW EMU Questions & Requests
    Replies: 6
    Last Post: 08-18-2009, 06:50 PM
  4. [Guide] How to Create Healing NPC's
    By Fiegn in forum WoW EMU Guides & Tutorials
    Replies: 5
    Last Post: 06-23-2008, 09:57 AM
  5. I messed up my NPC! How can I reset it's attack/health to original!?
    By willkill in forum World of Warcraft Emulator Servers
    Replies: 5
    Last Post: 05-11-2008, 05:46 PM
All times are GMT -5. The time now is 03:24 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