Thread Tools Display Modes
10-28-14, 12:15 PM   #1
skytez
A Defias Bandit
Join Date: Oct 2014
Posts: 2
Question Combat Points script/addon

Can anyone share script for CP frame moving and stick to player's frame (and not fade out without having a target), not a target (blizzard should do this by default with the change of CP mechanics).
I know some addons already can do this, but i dont like addons with custom frames, textures, etc., i want to do this with default CP frame. Is it possible?
Thanks for advance.
  Reply With Quote
10-28-14, 01:30 PM   #2
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,879
Blizzard is using GetComboPoints which will return zero when not in combat.
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.

Last edited by Fizzlemizz : 10-28-14 at 01:43 PM.
  Reply With Quote
10-28-14, 01:54 PM   #3
semlar
A Pyroguard Emberseer
 
semlar's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 1,060
You can use UnitPower('player', 4) to return the number of combo points the player has.
  Reply With Quote
10-29-14, 01:25 AM   #4
skytez
A Defias Bandit
Join Date: Oct 2014
Posts: 2
Originally Posted by semlar View Post
You can use UnitPower('player', 4) to return the number of combo points the player has.
Thank you, but if you can share some script example i would be very appreciate.
  Reply With Quote
10-29-14, 06:49 AM   #5
Saintvallen
An Aku'mai Servant
Join Date: Feb 2007
Posts: 33
Originally Posted by skytez View Post
Thank you, but if you can share some script example i would be very appreciate.
Script for what? WeakAuras?
If we just paste a script, ou will have to run the script every time you load UI.
You can just download any of the newest combo point addons, they have changed over to the new way of tracking - or you can do it in weakauras.

I suggest playing with Weakauras and KGpanels to make something you like, or slicecommander.
  Reply With Quote
10-29-14, 07:30 AM   #6
Vrul
A Scalebane Royal Guard
 
Vrul's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2007
Posts: 404
This is what I'm currently using but haven't tested it with a vehicle yet:
Code:
local comboPoints = ComboFrame
comboPoints:SetParent(PlayerFrame)
comboPoints:UnregisterAllEvents()

for index = 1, MAX_COMBO_POINTS do
	local point = _G['ComboPoint' .. index]
	point.highlight = _G['ComboPoint' .. index .. 'Highlight']
	point.mode = 'IN'
	point.timeToFade = COMBOFRAME_HIGHLIGHT_FADE_IN
	point.finishedFunc = ComboPointShineFadeIn
	point.finishedArg1 = _G['ComboPoint' .. index .. 'Shine']
	comboPoints[index] = point
end

comboPoints[5]:SetSize(comboPoints[1]:GetSize())

local comboPointsShown, comboPointsUnit = 0, 'player'
comboPoints:SetScript('OnEvent', function(self, event)
	if event == 'UNIT_ENTERED_VEHICLE' then
		if comboPointsUnit == 'vehicle' then return end
		comboPointsUnit = 'vehicle'
	elseif event == 'UNIT_EXITED_VEHICLE' then
		if comboPointsUnit == 'player' then return end
		comboPointsUnit = 'player'
	end

	local numComboPoints = UnitPower(comboPointsUnit, 4)
	if numComboPoints > 0 then
		if comboPointsShown == 0 then
			comboPoints:Show()
			UIFrameFadeIn(comboPoints, COMBOFRAME_FADE_IN)
		end
		for index = comboPointsShown + 1, numComboPoints do
			UIFrameFade(comboPoints[index].highlight, comboPoints[index])
		end
		for index = numComboPoints + 1, MAX_COMBO_POINTS do
			comboPoints[index].highlight:SetAlpha(0)
			comboPoints[index].finishedArg1:SetAlpha(0)
		end
	else
		comboPoints[1].highlight:SetAlpha(0)
		comboPoints[1].finishedArg1:SetAlpha(0)
		comboPoints:Hide()
	end
	comboPointsShown = numComboPoints
end)
comboPoints:RegisterEvent('PLAYER_ENTERING_WORLD')
comboPoints:RegisterUnitEvent('UNIT_COMBO_POINTS', 'player', 'vehicle')
comboPoints:RegisterUnitEvent('UNIT_ENTERED_VEHICLE', 'player')
comboPoints:RegisterUnitEvent('UNIT_EXITED_VEHICLE', 'player')

local function Reanchor(start, stop, point, relFrame, relPoint)
	local prevFrame = relFrame
	for index = start, stop, start < stop and 1 or -1 do
		local frame = _G['ComboPoint' .. index]
		frame:ClearAllPoints()
		frame:SetPoint(point, prevFrame, relPoint)
		prevFrame = frame
	end
end

comboPoints[3]:ClearAllPoints()
comboPoints[3]:SetPoint('TOP', PlayerFrameManaBar, 'BOTTOM', 0, -2)

Reanchor(2, 1, 'RIGHT', comboPoints[3], 'LEFT')
Reanchor(4, 5, 'LEFT', comboPoints[3], 'RIGHT')
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Search/Requests » Combat Points script/addon


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