Thread Tools Display Modes
02-07-10, 07:09 PM   #1
alimjocox
A Warpwood Thunder Caller
AddOn Author - Click to view addons
Join Date: Oct 2009
Posts: 96
determining hostile n friendly

Code:
if unit == "target" and UnitIsEnemy("player", "target") then
			self.CastbarBorder:SetBackdropColor(0.65, 0.27, 0.21)
			self.CastbarBorder:SetBackdropBorderColor(0.65, 0.27, 0.21)
			else
			self.CastbarBorder:SetBackdropColor(0.55, 0.57, 0.61)
			self.CastbarBorder:SetBackdropBorderColor(0.55, 0.57, 0.61)
			end
any reason why this isnt working that I dont know about?
  Reply With Quote
02-07-10, 09:32 PM   #2
wurmfood
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Apr 2009
Posts: 122
You can't set a condition like that at creation. Probably the easiest way to do it is with a PostCastStart and PostChannelStart function.
  Reply With Quote
02-08-10, 01:28 AM   #3
nightcracker
A Molten Giant
 
nightcracker's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2009
Posts: 716
Originally Posted by alimjocox View Post
Code:
if unit == "target" and UnitIsEnemy("player", "target") then
			self.CastbarBorder:SetBackdropColor(0.65, 0.27, 0.21)
			self.CastbarBorder:SetBackdropBorderColor(0.65, 0.27, 0.21)
			else
			self.CastbarBorder:SetBackdropColor(0.55, 0.57, 0.61)
			self.CastbarBorder:SetBackdropBorderColor(0.55, 0.57, 0.61)
			end
any reason why this isnt working that I dont know about?
This is only used when starting up(initial), so only if you enter the game while targetting an enemy player the above script will trigger.
__________________
Three things are certain,
Death, taxes and site not found,
You, victim of one.
  Reply With Quote

WoWInterface » Featured Projects » oUF (Otravi Unit Frames) » determining hostile n friendly


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off