[Trinity] Help target nearest anything menu

User Tag List

Results 1 to 1 of 1
  1. #1
    romerboy55's Avatar Private
    Reputation
    1
    Join Date
    Oct 2010
    Posts
    1
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [Trinity] Help target nearest anything

    so I'm working on a script for the spell Necrotic plague and I'm stuck, basically the spell works like this: if the spell kills its target or it expires it will jump to the closest unit within 10 yards and gain a stack, if Necrotic Plague is dispelled it will jump to the closest unit but lose a stack, but will never have fewer then one stack. after some time working at the script i came up with

    Code:
    void OnRemove(AuraEffect* const aurEff, AuraApplication const* aurApp, AuraEffectHandleModes /*mode*/)
    {
    	if(aurApp->GetRemoveMode() == AURA_REMOVE_BY_EXPIRE || aurApp->GetRemoveMode() == AURA_REMOVE_BY_DEATH)
    	{
    		uint32 Stacks = this->GetAura()->GetStackAmount();
    		if(this->GetOwner())
    		{
    			if(Creature* nextTarget = this->GetOwner()->FindNearestCreature(this->GetOwner()->GetEntry(),10))
    			{
    				if(Aura* Plague = nextTarget->AddAura(this->GetId(),nextTarget))
    				{
    					Plague->SetStackAmount(Stacks+1);
    				}
    			}
    		}		
    	}
    	else if(aurApp->GetRemoveMode() == AURA_REMOVE_BY_ENEMY_SPELL)
    	{
    		uint32 Stacks = this->GetAura()->GetStackAmount() - 1;
    		if((Stacks <= 1))
    			Stacks == 1;
    		else
    			Stacks -= 1;
    
    		if(this->GetOwner())
    		{
    			if(Creature* nextTarget = this->GetOwner()->FindNearestCreature(this->GetOwner()->GetEntry(),10))
    			{
    				if(Aura* Plague = nextTarget->AddAura(this->GetId(),nextTarget))
    				{
    					Plague->SetStackAmount(Stacks);
    				}
    			}
    		}	
    	}
    }
    the problem is that the plague only jumps to creatures with the same entry. sure I could make a statement for each creature i expect to be infected(there's only 8 ) but this still doesnt solve the problem with going from a creature to a player of vise verse.
    Last edited by romerboy55; 11-11-2010 at 02:21 PM.

    [Trinity] Help target nearest anything

Similar Threads

  1. [Trinity] Help Connecting on LAN
    By ttay24 in forum WoW EMU Questions & Requests
    Replies: 7
    Last Post: 06-30-2014, 06:30 PM
  2. Target nearest friend problem
    By Starwarsftw in forum World of Warcraft General
    Replies: 2
    Last Post: 09-23-2012, 04:22 AM
  3. [Trinity] Help! paying 100$ !
    By 323122tm in forum WoW EMU Questions & Requests
    Replies: 2
    Last Post: 09-24-2010, 03:41 PM
  4. Arcemu vs. Trinity - Help
    By singoe in forum WoW EMU Questions & Requests
    Replies: 3
    Last Post: 05-16-2010, 08:33 PM
  5. Need GLider help (Not installation or anything like that)
    By TehGoggles in forum World of Warcraft General
    Replies: 7
    Last Post: 03-29-2007, 04:15 PM
All times are GMT -5. The time now is 06:39 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