Modcraft - The community dedicated to quality WoW modding!

Wrath of the Lich King Modding => Serverside Modding => Topic started by: glararan on April 21, 2011, 04:02:13 pm

Title: Talents
Post by: glararan on April 21, 2011, 04:02:13 pm
Hi...how i can delete RequiredTalents point?Or change number of needed?Let's see here...http://www.wowhead.com/talent#00b (http://www.wowhead.com/talent#00b" onclick="window.open(this.href);return false;)

I use Cataclysm Talent calc only..for example..

So what i want?When i have Nature's Majesty and under spell is Balance of Power...Balance of Power(BoP) need 5 Talent points in Balance...how i can change number 5 to 2 so BoP need only 2 talents in Balance?Where can be it?
Title: Re: Talents
Post by: schlumpf on April 21, 2011, 08:22:29 pm
As far as I know its fixed to 5*tier. Therefore, you mst likely can't change it. You may want to place the second spell on the same tier and make the first one a prereq. for the second one.

http://madx.dk/wowdev/wiki/index.php?title=Talent.dbc (http://madx.dk/wowdev/wiki/index.php?title=Talent.dbc" onclick="window.open(this.href);return false;)
Title: Re: Talents
Post by: glararan on April 21, 2011, 09:51:05 pm
http://madx.dk/wowdev/wiki/index.php?title=Talent.dbc (http://madx.dk/wowdev/wiki/index.php?title=Talent.dbc" onclick="window.open(this.href);return false;) is now Supported for Cataclysm not for WotLK

I have structure from Core:
Code: [Select]
struct TalentEntry
{
    uint32    TalentID;                                     // 0
    uint32    TalentTab;                                    // 1 index in TalentTab.dbc (TalentTabEntry)
    uint32    Row;                                          // 2
    uint32    Col;                                          // 3
    uint32    RankID[MAX_TALENT_RANK];                      // 4-8
                                                            // 9-12 not used, always 0, maybe not used high ranks
    uint32    DependsOn;                                    // 13 index in Talent.dbc (TalentEntry)
                                                            // 14-15 not used
    uint32    DependsOnRank;                                // 16
                                                            // 17-18 not used
    //uint32  needAddInSpellBook;                           // 19  also need disable higest ranks on reset talent tree
    //uint32  unk2;                                         // 20, all 0
    //uint64  allowForPet;                                  // 21 its a 64 bit mask for pet 1<<m_categoryEnumID in CreatureFamily.dbc
};

struct TalentTabEntry
{
    uint32  TalentTabID;                                    // 0
    //char* name[16];                                       // 1-16, unused
    //uint32  nameFlags;                                    // 17, unused
    //unit32  spellicon;                                    // 18
                                                            // 19 not used
    uint32  ClassMask;                                      // 20
    uint32  petTalentMask;                                  // 21
    uint32  tabpage;                                        // 22
    //char* internalname;                                   // 23
};

Must be some path how it change hmm?
Title: Re: Talents
Post by: schlumpf on April 21, 2011, 10:28:38 pm
Actually, the structs are identical while the one I added to the wiki is more accurate and even using Blizzard's variable names.
This file did not change with Cataclysm. And also, the wiki is not updated for Cataclysm and still on WotLK state mostly.

So, just do as I said and set the tier to the same for both and add hte first one as prereq for the second one.
Title: Re: Talents
Post by: glararan on April 21, 2011, 11:36:44 pm
But on Row 1 can be only 4 columm :/ and when i give it on row 2 it's need 5 talent points...
Title: Re: Talents
Post by: schlumpf on April 22, 2011, 12:41:19 am
Then you may need to remove an item from the first tier.
Title: Re: Talents
Post by: glararan on April 22, 2011, 10:19:03 am
Look i have unlocking next tier when i buy 2 talents

So let's look here is image:
[attachment=0:1ns6di4r]WoWScrnShot_042211_101648.jpg[/attachment:1ns6di4r]

Now i need Required Talent points delete...
Title: Re: Talents
Post by: schlumpf on April 22, 2011, 11:26:38 am
You may want to tell people how you did that.
Title: Re: Talents
Post by: glararan on April 22, 2011, 12:03:28 pm
As you wish...so i extract from Patch-enGB2.MPQ

FrameXML >> TalentFrameBase.lua

Now editing:
Code: [Select]
PLAYER_TALENTS_PER_TIER = NUMBER TO UNLOCK NEXT TIER;
I have
Code: [Select]
PLAYER_TALENTS_PER_TIER = 2;
So need 2 talents to open next tier, but i don't know how delete Required Talent points

Maybe some in this?
Code: [Select]
MAX_TALENT_GROUPS = 2;
MAX_TALENT_TABS = 4;
MAX_NUM_TALENT_TIERS = 15;
NUM_TALENT_COLUMNS = 4;
MAX_NUM_TALENTS = 40;
PLAYER_TALENTS_PER_TIER = 2;
PET_TALENTS_PER_TIER = 3;

DEFAULT_TALENT_SPEC = "spec1";
DEFAULT_TALENT_TAB = 1;

TALENT_BUTTON_SIZE = 32;
MAX_NUM_BRANCH_TEXTURES = 30;
MAX_NUM_ARROW_TEXTURES = 30;
INITIAL_TALENT_OFFSET_X = 35;
INITIAL_TALENT_OFFSET_Y = 20;

TALENT_HYBRID_ICON = "Interface\Icons\Ability_DualWieldSpecialization";

TALENT_BRANCH_TEXTURECOORDS = {
up = {
[1] = {0.12890625, 0.25390625, 0 , 0.484375},
[-1] = {0.12890625, 0.25390625, 0.515625 , 1.0}
},
down = {
[1] = {0, 0.125, 0, 0.484375},
[-1] = {0, 0.125, 0.515625, 1.0}
},
left = {
[1] = {0.2578125, 0.3828125, 0, 0.5},
[-1] = {0.2578125, 0.3828125, 0.5, 1.0}
},
right = {
[1] = {0.2578125, 0.3828125, 0, 0.5},
[-1] = {0.2578125, 0.3828125, 0.5, 1.0}
},
topright = {
[1] = {0.515625, 0.640625, 0, 0.5},
[-1] = {0.515625, 0.640625, 0.5, 1.0}
},
topleft = {
[1] = {0.640625, 0.515625, 0, 0.5},
[-1] = {0.640625, 0.515625, 0.5, 1.0}
},
bottomright = {
[1] = {0.38671875, 0.51171875, 0, 0.5},
[-1] = {0.38671875, 0.51171875, 0.5, 1.0}
},
bottomleft = {
[1] = {0.51171875, 0.38671875, 0, 0.5},
[-1] = {0.51171875, 0.38671875, 0.5, 1.0}
},
tdown = {
[1] = {0.64453125, 0.76953125, 0, 0.5},
[-1] = {0.64453125, 0.76953125, 0.5, 1.0}
},
tup = {
[1] = {0.7734375, 0.8984375, 0, 0.5},
[-1] = {0.7734375, 0.8984375, 0.5, 1.0}
},
};

TALENT_ARROW_TEXTURECOORDS = {
top = {
[1] = {0, 0.5, 0, 0.5},
[-1] = {0, 0.5, 0.5, 1.0}
},
right = {
[1] = {1.0, 0.5, 0, 0.5},
[-1] = {1.0, 0.5, 0.5, 1.0}
},
left = {
[1] = {0.5, 1.0, 0, 0.5},
[-1] = {0.5, 1.0, 0.5, 1.0}
},
};


local min = min;
local max = max;
local huge = math.huge;
local rshift = bit.rshift;


function TalentFrame_Load(TalentFrame)
TalentFrame.TALENT_BRANCH_ARRAY={};
for i=1, MAX_NUM_TALENT_TIERS do
TalentFrame.TALENT_BRANCH_ARRAY[i] = {};
for j=1, NUM_TALENT_COLUMNS do
TalentFrame.TALENT_BRANCH_ARRAY[i][j] = {id=nil, up=0, left=0, right=0, down=0, leftArrow=0, rightArrow=0, topArrow=0};
end
end
end

function TalentFrame_Update(TalentFrame)
if ( not TalentFrame ) then
return;
end

if ( TalentFrame.updateFunction ) then
TalentFrame.updateFunction();
end

local talentFrameName = TalentFrame:GetName();
local selectedTab = PanelTemplates_GetSelectedTab(TalentFrame);
local preview = GetCVarBool("previewTalents");

-- get active talent group
local isActiveTalentGroup;
if ( TalentFrame.inspect ) then
-- even though we have inspection data for more than one talent group, we're only showing one for now
isActiveTalentGroup = true;
else
isActiveTalentGroup = TalentFrame.talentGroup == GetActiveTalentGroup(TalentFrame.inspect, TalentFrame.pet);
end
-- Setup Frame
local base;
local name, icon, pointsSpent, background, previewPointsSpent = GetTalentTabInfo(selectedTab, TalentFrame.inspect, TalentFrame.pet, TalentFrame.talentGroup);
if ( name ) then
base = "Interface\TalentFrame\"..background.."-";
else
-- temporary default for classes without talents poor guys
base = "Interface\TalentFrame\MageFire-";
end
-- desaturate the background if this isn't the active talent group
local backgroundPiece = _G[talentFrameName.."BackgroundTopLeft"];
backgroundPiece:SetTexture(base.."TopLeft");
SetDesaturation(backgroundPiece, not isActiveTalentGroup);
backgroundPiece = _G[talentFrameName.."BackgroundTopRight"];
backgroundPiece:SetTexture(base.."TopRight");
SetDesaturation(backgroundPiece, not isActiveTalentGroup);
backgroundPiece = _G[talentFrameName.."BackgroundBottomLeft"];
backgroundPiece:SetTexture(base.."BottomLeft");
SetDesaturation(backgroundPiece, not isActiveTalentGroup);
backgroundPiece = _G[talentFrameName.."BackgroundBottomRight"];
backgroundPiece:SetTexture(base.."BottomRight");
SetDesaturation(backgroundPiece, not isActiveTalentGroup);

local numTalents = GetNumTalents(selectedTab, TalentFrame.inspect, TalentFrame.pet);
-- Just a reminder error if there are more talents than available buttons
if ( numTalents > MAX_NUM_TALENTS ) then
message("Too many talents in talent frame!");
end
-- get unspent talent points
local unspentPoints = TalentFrame_UpdateTalentPoints(TalentFrame);
-- compute tab points spent if any
local tabPointsSpent;
if ( TalentFrame.pointsSpent and TalentFrame.previewPointsSpent ) then
tabPointsSpent = TalentFrame.pointsSpent + TalentFrame.previewPointsSpent;
else
tabPointsSpent = 0;
end

TalentFrame_ResetBranches(TalentFrame);
local talentFrameTalentName = talentFrameName.."Talent";
local forceDesaturated, tierUnlocked;
for i=1, MAX_NUM_TALENTS do
local buttonName = talentFrameTalentName..i;
local button = _G[buttonName];
if ( i <= numTalents ) then
-- Set the button info
local name, iconTexture, tier, column, rank, maxRank, isExceptional, meetsPrereq, previewRank, meetsPreviewPrereq =
GetTalentInfo(selectedTab, i, TalentFrame.inspect, TalentFrame.pet, TalentFrame.talentGroup);
if ( name ) then
local displayRank;
if ( preview ) then
displayRank = previewRank;
else
displayRank = rank;
end

_G[buttonName.."Rank"]:SetText(displayRank);
SetTalentButtonLocation(button, tier, column);
TalentFrame.TALENT_BRANCH_ARRAY[tier][column].id = button:GetID();

-- If player has no talent points or this is the inactive talent group then show only talents with points in them
if ( (unspentPoints <= 0 or not isActiveTalentGroup) and displayRank == 0 ) then
forceDesaturated = 1;
else
forceDesaturated = nil;
end

-- is this talent's tier unlocked?
if ( ((tier - 1) * (TalentFrame.pet and PET_TALENTS_PER_TIER or PLAYER_TALENTS_PER_TIER) <= tabPointsSpent) ) then
tierUnlocked = 1;
else
tierUnlocked = nil;
end

SetItemButtonTexture(button, iconTexture);

-- Talent must meet prereqs or the player must have no points to spend
local prereqsSet =
TalentFrame_SetPrereqs(TalentFrame, tier, column, forceDesaturated, tierUnlocked, preview,
GetTalentPrereqs(selectedTab, i, TalentFrame.inspect, TalentFrame.pet, TalentFrame.talentGroup));
if ( prereqsSet and ((preview and meetsPreviewPrereq) or (not preview and meetsPrereq)) ) then
SetItemButtonDesaturated(button, nil);

if ( displayRank < maxRank ) then
-- Rank is green if not maxed out
_G[buttonName.."Slot"]:SetVertexColor(0.1, 1.0, 0.1);
_G[buttonName.."Rank"]:SetTextColor(GREEN_FONT_COLOR.r, GREEN_FONT_COLOR.g, GREEN_FONT_COLOR.b);
else
_G[buttonName.."Slot"]:SetVertexColor(1.0, 0.82, 0);
_G[buttonName.."Rank"]:SetTextColor(NORMAL_FONT_COLOR.r, NORMAL_FONT_COLOR.g, NORMAL_FONT_COLOR.b);
end
_G[buttonName.."RankBorder"]:Show();
_G[buttonName.."Rank"]:Show();
else
SetItemButtonDesaturated(button, 1, 0.65, 0.65, 0.65);
_G[buttonName.."Slot"]:SetVertexColor(0.5, 0.5, 0.5);
if ( rank == 0 ) then
_G[buttonName.."RankBorder"]:Hide();
_G[buttonName.."Rank"]:Hide();
else
_G[buttonName.."RankBorder"]:SetVertexColor(0.5, 0.5, 0.5);
_G[buttonName.."Rank"]:SetTextColor(GRAY_FONT_COLOR.r, GRAY_FONT_COLOR.g, GRAY_FONT_COLOR.b);
end
end
button:Show();
else
button:Hide();
end
else
button:Hide();
end
end

-- Draw the prereq branches
local node;
local textureIndex = 1;
local xOffset, yOffset;
local texCoords;
-- Variable that decides whether or not to ignore drawing pieces
local ignoreUp;
local tempNode;
TalentFrame_ResetBranchTextureCount(TalentFrame);
TalentFrame_ResetArrowTextureCount(TalentFrame);
for i=1, MAX_NUM_TALENT_TIERS do
for j=1, NUM_TALENT_COLUMNS do
node = TalentFrame.TALENT_BRANCH_ARRAY[i][j];

-- Setup offsets
xOffset = ((j - 1) * 63) + INITIAL_TALENT_OFFSET_X + 2;
yOffset = -((i - 1) * 63) - INITIAL_TALENT_OFFSET_Y - 2;

if ( node.id ) then
-- Has talent
if ( node.up ~= 0 ) then
if ( not ignoreUp ) then
TalentFrame_SetBranchTexture(i, j, TALENT_BRANCH_TEXTURECOORDS["up"][node.up], xOffset, yOffset + TALENT_BUTTON_SIZE, TalentFrame);
else
ignoreUp = nil;
end
end
if ( node.down ~= 0 ) then
TalentFrame_SetBranchTexture(i, j, TALENT_BRANCH_TEXTURECOORDS["down"][node.down], xOffset, yOffset - TALENT_BUTTON_SIZE + 1, TalentFrame);
end
if ( node.left ~= 0 ) then
TalentFrame_SetBranchTexture(i, j, TALENT_BRANCH_TEXTURECOORDS["left"][node.left], xOffset - TALENT_BUTTON_SIZE, yOffset, TalentFrame);
end
if ( node.right ~= 0 ) then
-- See if any connecting branches are gray and if so color them gray
tempNode = TalentFrame.TALENT_BRANCH_ARRAY[i][j+1];
if ( tempNode.left ~= 0 and tempNode.down < 0 ) then
TalentFrame_SetBranchTexture(i, j-1, TALENT_BRANCH_TEXTURECOORDS["right"][tempNode.down], xOffset + TALENT_BUTTON_SIZE, yOffset, TalentFrame);
else
TalentFrame_SetBranchTexture(i, j, TALENT_BRANCH_TEXTURECOORDS["right"][node.right], xOffset + TALENT_BUTTON_SIZE + 1, yOffset, TalentFrame);
end

end
-- Draw arrows
if ( node.rightArrow ~= 0 ) then
TalentFrame_SetArrowTexture(i, j, TALENT_ARROW_TEXTURECOORDS["right"][node.rightArrow], xOffset + TALENT_BUTTON_SIZE/2 + 5, yOffset, TalentFrame);
end
if ( node.leftArrow ~= 0 ) then
TalentFrame_SetArrowTexture(i, j, TALENT_ARROW_TEXTURECOORDS["left"][node.leftArrow], xOffset - TALENT_BUTTON_SIZE/2 - 5, yOffset, TalentFrame);
end
if ( node.topArrow ~= 0 ) then
TalentFrame_SetArrowTexture(i, j, TALENT_ARROW_TEXTURECOORDS["top"][node.topArrow], xOffset, yOffset + TALENT_BUTTON_SIZE/2 + 5, TalentFrame);
end
else
-- Doesn't have a talent
if ( node.up ~= 0 and node.left ~= 0 and node.right ~= 0 ) then
TalentFrame_SetBranchTexture(i, j, TALENT_BRANCH_TEXTURECOORDS["tup"][node.up], xOffset , yOffset, TalentFrame);
elseif ( node.down ~= 0 and node.left ~= 0 and node.right ~= 0 ) then
TalentFrame_SetBranchTexture(i, j, TALENT_BRANCH_TEXTURECOORDS["tdown"][node.down], xOffset , yOffset, TalentFrame);
elseif ( node.left ~= 0 and node.down ~= 0 ) then
TalentFrame_SetBranchTexture(i, j, TALENT_BRANCH_TEXTURECOORDS["topright"][node.left], xOffset , yOffset, TalentFrame);
TalentFrame_SetBranchTexture(i, j, TALENT_BRANCH_TEXTURECOORDS["down"][node.down], xOffset , yOffset - 32, TalentFrame);
elseif ( node.left ~= 0 and node.up ~= 0 ) then
TalentFrame_SetBranchTexture(i, j, TALENT_BRANCH_TEXTURECOORDS["bottomright"][node.left], xOffset , yOffset, TalentFrame);
elseif ( node.left ~= 0 and node.right ~= 0 ) then
TalentFrame_SetBranchTexture(i, j, TALENT_BRANCH_TEXTURECOORDS["right"][node.right], xOffset + TALENT_BUTTON_SIZE, yOffset, TalentFrame);
TalentFrame_SetBranchTexture(i, j, TALENT_BRANCH_TEXTURECOORDS["left"][node.left], xOffset + 1, yOffset, TalentFrame);
elseif ( node.right ~= 0 and node.down ~= 0 ) then
TalentFrame_SetBranchTexture(i, j, TALENT_BRANCH_TEXTURECOORDS["topleft"][node.right], xOffset , yOffset, TalentFrame);
TalentFrame_SetBranchTexture(i, j, TALENT_BRANCH_TEXTURECOORDS["down"][node.down], xOffset , yOffset - 32, TalentFrame);
elseif ( node.right ~= 0 and node.up ~= 0 ) then
TalentFrame_SetBranchTexture(i, j, TALENT_BRANCH_TEXTURECOORDS["bottomleft"][node.right], xOffset , yOffset, TalentFrame);
elseif ( node.up ~= 0 and node.down ~= 0 ) then
TalentFrame_SetBranchTexture(i, j, TALENT_BRANCH_TEXTURECOORDS["up"][node.up], xOffset , yOffset, TalentFrame);
TalentFrame_SetBranchTexture(i, j, TALENT_BRANCH_TEXTURECOORDS["down"][node.down], xOffset , yOffset - 32, TalentFrame);
ignoreUp = 1;
end
end
end
end
-- Hide any unused branch textures
for i=TalentFrame_GetBranchTextureCount(TalentFrame), MAX_NUM_BRANCH_TEXTURES do
_G[talentFrameName.."Branch"..i]:Hide();
end
-- Hide and unused arrowl textures
for i=TalentFrame_GetArrowTextureCount(TalentFrame), MAX_NUM_ARROW_TEXTURES do
_G[talentFrameName.."Arrow"..i]:Hide();
end
end

function TalentFrame_SetArrowTexture(tier, column, texCoords, xOffset, yOffset, TalentFrame)
local talentFrameName = TalentFrame:GetName();
local arrowTexture = TalentFrame_GetArrowTexture(TalentFrame);
arrowTexture:SetTexCoord(texCoords[1], texCoords[2], texCoords[3], texCoords[4]);
arrowTexture:SetPoint("TOPLEFT", talentFrameName.."ArrowFrame", "TOPLEFT", xOffset, yOffset);
end

function TalentFrame_SetBranchTexture(tier, column, texCoords, xOffset, yOffset, TalentFrame)
local talentFrameName = TalentFrame:GetName();
local branchTexture = TalentFrame_GetBranchTexture(TalentFrame);
branchTexture:SetTexCoord(texCoords[1], texCoords[2], texCoords[3], texCoords[4]);
branchTexture:SetPoint("TOPLEFT", talentFrameName.."ScrollChildFrame", "TOPLEFT", xOffset, yOffset);
end

function TalentFrame_GetArrowTexture(TalentFrame)
local talentFrameName = TalentFrame:GetName();
local arrowTexture = _G[talentFrameName.."Arrow"..TalentFrame.arrowIndex];
TalentFrame.arrowIndex = TalentFrame.arrowIndex + 1;
if ( not arrowTexture ) then
message("Not enough arrow textures");
else
arrowTexture:Show();
return arrowTexture;
end
end

function TalentFrame_GetBranchTexture(TalentFrame)
local talentFrameName = TalentFrame:GetName();
local branchTexture = _G[talentFrameName.."Branch"..TalentFrame.textureIndex];
TalentFrame.textureIndex = TalentFrame.textureIndex + 1;
if ( not branchTexture ) then
--branchTexture = CreateTexture("TalentFrameBranch"..TalentFrame.textureIndex);
message("Not enough branch textures");
else
branchTexture:Show();
return branchTexture;
end
end

function TalentFrame_ResetArrowTextureCount(TalentFrame)
TalentFrame.arrowIndex = 1;
end

function TalentFrame_ResetBranchTextureCount(TalentFrame)
TalentFrame.textureIndex = 1;
end

function TalentFrame_GetArrowTextureCount(TalentFrame)
return TalentFrame.arrowIndex;
end

function TalentFrame_GetBranchTextureCount(TalentFrame)
return TalentFrame.textureIndex;
end

function TalentFrame_SetPrereqs(TalentFrame, buttonTier, buttonColumn, forceDesaturated, tierUnlocked, preview, ...)
local requirementsMet = tierUnlocked and not forceDesaturated;
for i=1, select("#", ...), 4 do
local tier, column, isLearnable, isPreviewLearnable = select(i, ...);
if ( forceDesaturated or
(preview and not isPreviewLearnable) or
(not preview and not isLearnable) ) then
requirementsMet = nil;
end
TalentFrame_DrawLines(buttonTier, buttonColumn, tier, column, requirementsMet, TalentFrame);
end
return requirementsMet;
end


function TalentFrame_DrawLines(buttonTier, buttonColumn, tier, column, requirementsMet, TalentFrame)
if ( requirementsMet ) then
requirementsMet = 1;
else
requirementsMet = -1;
end

-- Check to see if are in the same column
if ( buttonColumn == column ) then
-- Check for blocking talents
if ( (buttonTier - tier) > 1 ) then
-- If more than one tier difference
for i=tier + 1, buttonTier - 1 do
if ( TalentFrame.TALENT_BRANCH_ARRAY[i][buttonColumn].id ) then
-- If there's an id, there's a blocker
message("Error this layout is blocked vertically "..TalentFrame.TALENT_BRANCH_ARRAY[buttonTier][i].id);
return;
end
end
end

-- Draw the lines
for i=tier, buttonTier - 1 do
TalentFrame.TALENT_BRANCH_ARRAY[i][buttonColumn].down = requirementsMet;
if ( (i + 1) <= (buttonTier - 1) ) then
TalentFrame.TALENT_BRANCH_ARRAY[i + 1][buttonColumn].up = requirementsMet;
end
end

-- Set the arrow
TalentFrame.TALENT_BRANCH_ARRAY[buttonTier][buttonColumn].topArrow = requirementsMet;
return;
end
-- Check to see if they're in the same tier
if ( buttonTier == tier ) then
local left = min(buttonColumn, column);
local right = max(buttonColumn, column);

-- See if the distance is greater than one space
if ( (right - left) > 1 ) then
-- Check for blocking talents
for i=left + 1, right - 1 do
if ( TalentFrame.TALENT_BRANCH_ARRAY[tier][i].id ) then
-- If there's an id, there's a blocker
message("there's a blocker "..tier.." "..i);
return;
end
end
end
-- If we get here then we're in the clear
for i=left, right - 1 do
TalentFrame.TALENT_BRANCH_ARRAY[tier][i].right = requirementsMet;
TalentFrame.TALENT_BRANCH_ARRAY[tier][i+1].left = requirementsMet;
end
-- Determine where the arrow goes
if ( buttonColumn < column ) then
TalentFrame.TALENT_BRANCH_ARRAY[buttonTier][buttonColumn].rightArrow = requirementsMet;
else
TalentFrame.TALENT_BRANCH_ARRAY[buttonTier][buttonColumn].leftArrow = requirementsMet;
end
return;
end
-- Now we know the prereq is diagonal from us
local left = min(buttonColumn, column);
local right = max(buttonColumn, column);
-- Don't check the location of the current button
if ( left == column ) then
left = left + 1;
else
right = right - 1;
end
-- Check for blocking talents
local blocked = nil;
for i=left, right do
if ( TalentFrame.TALENT_BRANCH_ARRAY[tier][i].id ) then
-- If there's an id, there's a blocker
blocked = 1;
end
end
left = min(buttonColumn, column);
right = max(buttonColumn, column);
if ( not blocked ) then
TalentFrame.TALENT_BRANCH_ARRAY[tier][buttonColumn].down = requirementsMet;
TalentFrame.TALENT_BRANCH_ARRAY[buttonTier][buttonColumn].up = requirementsMet;

for i=tier, buttonTier - 1 do
TalentFrame.TALENT_BRANCH_ARRAY[i][buttonColumn].down = requirementsMet;
TalentFrame.TALENT_BRANCH_ARRAY[i + 1][buttonColumn].up = requirementsMet;
end

for i=left, right - 1 do
TalentFrame.TALENT_BRANCH_ARRAY[tier][i].right = requirementsMet;
TalentFrame.TALENT_BRANCH_ARRAY[tier][i+1].left = requirementsMet;
end
-- Place the arrow
TalentFrame.TALENT_BRANCH_ARRAY[buttonTier][buttonColumn].topArrow = requirementsMet;
return;
end
-- If we're here then we were blocked trying to go vertically first so we have to go over first, then up
if ( left == buttonColumn ) then
left = left + 1;
else
right = right - 1;
end
-- Check for blocking talents
for i=left, right do
if ( TalentFrame.TALENT_BRANCH_ARRAY[buttonTier][i].id ) then
-- If there's an id, then throw an error
message("Error, this layout is undrawable "..TalentFrame.TALENT_BRANCH_ARRAY[buttonTier][i].id);
return;
end
end
-- If we're here we can draw the line
left = min(buttonColumn, column);
right = max(buttonColumn, column);
--TALENT_BRANCH_ARRAY[tier][column].down = requirementsMet;
--TALENT_BRANCH_ARRAY[buttonTier][column].up = requirementsMet;

for i=tier, buttonTier-1 do
TalentFrame.TALENT_BRANCH_ARRAY[i][column].up = requirementsMet;
TalentFrame.TALENT_BRANCH_ARRAY[i+1][column].down = requirementsMet;
end

-- Determine where the arrow goes
if ( buttonColumn < column ) then
TalentFrame.TALENT_BRANCH_ARRAY[buttonTier][buttonColumn].rightArrow =  requirementsMet;
else
TalentFrame.TALENT_BRANCH_ARRAY[buttonTier][buttonColumn].leftArrow =  requirementsMet;
end
end



-- Helper functions

function TalentFrame_UpdateTalentPoints(TalentFrame)
local talentPoints = GetUnspentTalentPoints(TalentFrame.inspect, TalentFrame.pet, TalentFrame.talentGroup);
local unspentPoints = talentPoints - GetGroupPreviewTalentPointsSpent(TalentFrame.pet, TalentFrame.talentGroup);
local talentFrameName = TalentFrame:GetName();
_G[talentFrameName.."TalentPointsText"]:SetFormattedText(UNSPENT_TALENT_POINTS, HIGHLIGHT_FONT_COLOR_CODE..unspentPoints..FONT_COLOR_CODE_CLOSE);
TalentFrame_ResetBranches(TalentFrame);
_G[talentFrameName.."ScrollFrameScrollBarScrollDownButton"]:SetScript("OnClick", _G[talentFrameName.."DownArrow_OnClick"]);
return unspentPoints;
end

function SetTalentButtonLocation(button, tier, column)
column = ((column - 1) * 63) + INITIAL_TALENT_OFFSET_X;
tier = -((tier - 1) * 63) - INITIAL_TALENT_OFFSET_Y;
button:SetPoint("TOPLEFT", button:GetParent(), "TOPLEFT", column, tier);
end

function TalentFrame_ResetBranches(TalentFrame)
for i=1, MAX_NUM_TALENT_TIERS do
for j=1, NUM_TALENT_COLUMNS do
TalentFrame.TALENT_BRANCH_ARRAY[i][j].id = nil;
TalentFrame.TALENT_BRANCH_ARRAY[i][j].up = 0;
TalentFrame.TALENT_BRANCH_ARRAY[i][j].down = 0;
TalentFrame.TALENT_BRANCH_ARRAY[i][j].left = 0;
TalentFrame.TALENT_BRANCH_ARRAY[i][j].right = 0;
TalentFrame.TALENT_BRANCH_ARRAY[i][j].rightArrow = 0;
TalentFrame.TALENT_BRANCH_ARRAY[i][j].leftArrow = 0;
TalentFrame.TALENT_BRANCH_ARRAY[i][j].topArrow = 0;
end
end
end

local sortedTabPointsSpentBuf = { };
function TalentFrame_UpdateSpecInfoCache(cache, inspect, pet, talentGroup)
-- initialize some cache info
cache.primaryTabIndex = 0;
cache.totalPointsSpent = 0;

local preview = GetCVarBool("previewTalents");

local highPointsSpent = 0;
local highPointsSpentIndex;
local lowPointsSpent = huge;
local lowPointsSpentIndex;

local numTabs = GetNumTalentTabs(inspect, pet);
cache.numTabs = numTabs;
for i = 1, MAX_TALENT_TABS do
cache[i] = cache[i] or { };
if ( i <= numTabs ) then
local name, icon, pointsSpent, background, previewPointsSpent = GetTalentTabInfo(i, inspect, pet, talentGroup);

local displayPointsSpent = pointsSpent + previewPointsSpent;

-- cache the info we care about
cache[i].name = name;
cache[i].pointsSpent = displayPointsSpent;
cache[i].icon = icon;

-- update total points
cache.totalPointsSpent = cache.totalPointsSpent + displayPointsSpent;

-- update the high and low points spent info
if ( displayPointsSpent > highPointsSpent ) then
highPointsSpent = displayPointsSpent;
highPointsSpentIndex = i;
end
if ( displayPointsSpent < lowPointsSpent ) then
lowPointsSpent = displayPointsSpent;
lowPointsSpentIndex = i;
end

-- initialize the points spent buffer element
sortedTabPointsSpentBuf[i] = 0;
-- insert the points spent into our buffer in ascending order
local insertIndex = i;
for j = 1, i, 1 do
local currPointsSpent = sortedTabPointsSpentBuf[j];
if ( currPointsSpent > displayPointsSpent ) then
insertIndex = j;
break;
end
end
for j = i, insertIndex + 1, -1 do
sortedTabPointsSpentBuf[j] = sortedTabPointsSpentBuf[j - 1];
end
sortedTabPointsSpentBuf[insertIndex] = displayPointsSpent;
else
cache[i].name = nil;
end
end

if ( highPointsSpentIndex and lowPointsSpentIndex ) then
-- now that our points spent buffer is filled, we can compute the mid points spent
local midPointsSpentIndex = rshift(numTabs, 1) + 1;
local midPointsSpent = sortedTabPointsSpentBuf[midPointsSpentIndex];
-- now let's use our crazy formula to determine which tab is the primary one
if ( 3*(midPointsSpent-lowPointsSpent) < 2*(highPointsSpent-lowPointsSpent) ) then
cache.primaryTabIndex = highPointsSpentIndex;
end
end
end


Or it's need upgrade Core or DBC, but i don't know where :(( Please help
Title: Re: Talents
Post by: glararan on April 23, 2011, 02:26:48 pm
Hmm i reworked it and now i have four collums ...see
[attachment=1:qjqujeto]WoWScrnShot_042311_142453.jpg[/attachment:qjqujeto]

I create four talent tree for Druid and Hunter + Priest but i don't know why i have this screen
[attachment=0:qjqujeto]WoWScrnShot_042311_142434.jpg[/attachment:qjqujeto]
Title: Re: Talents
Post by: SirFranc on April 23, 2011, 07:22:55 pm
Cheer you up! if you manage to do that stuff we'll be really grateful, not much people actually bothered to venture into changing talents so far, learning this would be really good (example: making all spells learned with talents, would be a good idea)
keep up working :D
Title: Re: Talents
Post by: glararan on April 23, 2011, 09:31:23 pm
I don't how to fix the background and working with 4 talent tress :/
Title: Re: Talents
Post by: SirFranc on April 24, 2011, 01:25:32 am
Quote from: "glararan"
I don't how to fix the background and working with 4 talent tress :/
Try editing the texture files? are under LOCALE/INTERFACE/GLUES if i recall correctly
Title: Re: Talents
Post by: glararan on April 24, 2011, 11:54:01 am
So you think editing Talent.....lua + xml?
Title: Re: Talents
Post by: SirFranc on April 24, 2011, 12:00:49 pm
Quote from: "glararan"
So you think editing Talent.....lua + xml?
lua + xml + dbc  should do?

Talent are client-sided, you pick a talent, you ask a spell to be learned from the server, the server learns you that spell, at least on Trinity which is frameworked it should not count the actual data on the core, that would be useless, but the data requested by the client, but this is just my theory
Title: Re: Talents
Post by: glararan on April 24, 2011, 01:26:46 pm
Ok when i got four talent trees i go to DBC TalentTab.dbc on Columm 24 is Name WarriorArms RogueAssasins...now when i searching in MPQ i will search in TALENTFRAME Pictures i create new pictures with my name of name in Columm 24 so...HunterTroll i create four images ...
Code: [Select]
HunterTroll-BottomLeft.blp
HunterTroll-BottomRight.blp
HunterTroll-TopLeft.blp
HunterTroll-TopRight.blp
Now i go to WoW and i receive error:
Code: [Select]
Date: 2011-04-24 13:00:26
ID: 1
Error occured in: Global
Count: 1
Message: ..FrameXMLUIPanelTemplates.lua line 20:
   attempt to index local 'tab' (a nil value)
Debug:
   [C]: ?
   ..FrameXMLUIPanelTemplates.lua:20: PanelTemplates_UpdateTabs()
   ..FrameXMLUIPanelTemplates.lua:8: PanelTemplates_SetTab()
   ...rfaceAddOnsBlizzard_TalentUIBlizzard_TalentUI.lua:997: PlayerSpecTab_OnClick()
   ...rfaceAddOnsBlizzard_TalentUIBlizzard_TalentUI.lua:296:
      ...rfaceAddOnsBlizzard_TalentUIBlizzard_TalentUI.lua:287
   [C]: Show()
   ..FrameXMLUIParent.lua:1580: SetUIPanel()
   ..FrameXMLUIParent.lua:1424: ShowUIPanel()
   ..FrameXMLUIParent.lua:1311:
      ..FrameXMLUIParent.lua:1307
   [C]: SetAttribute()
   ..FrameXMLUIParent.lua:1974: ShowUIPanel()
   ...rfaceAddOnsBlizzard_TalentUIBlizzard_TalentUI.lua:102: PlayerTalentFrame_Toggle()
   ..FrameXMLUIParent.lua:366: ToggleTalentFrame()
   [string "TOGGLETALENTS"]:1:
      [string "TOGGLETALENTS"]:1

UIPanelTemplates.liua:
Code: [Select]
function PanelTemplates_SetTab(frame, id)
frame.selectedTab = id;
PanelTemplates_UpdateTabs(frame);       [color=#00FF00]/// LINE 8[/color]
end




function PanelTemplates_UpdateTabs(frame)
if ( frame.selectedTab ) then
local tab;
for i=1, frame.numTabs, 1 do
tab = _G[frame:GetName().."Tab"..i];
if ( tab.isDisabled ) then                [color=#00FF00] // LINE 20[/color]
PanelTemplates_SetDisabledTabState(tab);
elseif ( i == frame.selectedTab ) then
PanelTemplates_SelectTab(tab);
else
PanelTemplates_DeselectTab(tab);
end
end
end
end

Blizzard_TalentUI:
Code: [Select]
function PlayerTalentFrame_OnShow(self)        [color=#00FF00]// LINE 286[/color]
-- Stop buttons from flashing after skill up
SetButtonPulse(TalentMicroButton, 0, 1);

PlaySound("TalentScreenOpen");
UpdateMicroButtons();

if ( not selectedSpec ) then
-- if no spec was selected, try to select the active one
PlayerSpecTab_OnClick(activeSpec and specTabs[activeSpec] or specTabs[DEFAULT_TALENT_SPEC]);       [color=#00FF00] // LINE 296[/color]
else
PlayerTalentFrame_Refresh();
end




if ( not PanelTemplates_GetSelectedTab(PlayerTalentFrame) ) then
PanelTemplates_SetTab(PlayerTalentFrame, PlayerTalentTab_GetBestDefaultTab(specIndex));       [color=#00FF00] // LINE 997[/color]
end



function PlayerTalentFrame_Toggle(pet, suggestedTalentGroup)
local hidden;
local talentTabSelected = PanelTemplates_GetSelectedTab(PlayerTalentFrame) ~= GLYPH_TALENT_TAB;
if ( not PlayerTalentFrame:IsShown() ) then
ShowUIPanel(PlayerTalentFrame);        [color=#00FF00] // LINE 102[/color]
hidden = false;
else
local spec = selectedSpec and specs[selectedSpec];
if ( spec and talentTabSelected ) then
-- if a talent tab is selected then toggle the frame off
HideUIPanel(PlayerTalentFrame);
hidden = true;
else
hidden = false;
end
end


UIParent.lua:
Code: [Select]
if ( frame ) then
frame:Show();                  [color=#00FF00] // LINE 1580[/color]
-- Hide all child windows
securecall("CloseChildWindows");
end
end



local leftFrame = self:GetUIPanel("left");
if ( not leftFrame ) then
self:SetUIPanel("left", frame);              [color=#00FF00]// LINE 1424[/color]
return;
end
local leftPushable = GetUIPanelWindowInfo(leftFrame, "pushable") or 0;







local function FramePositionDelegate_OnAttributeChanged(self, attribute) [color=#00FF00]// LINE 1307[/color]
if ( attribute == "panel-show" ) then
local force = self:GetAttribute("panel-force");
local frame = self:GetAttribute("panel-frame");
self:ShowUIPanel(frame, force);               [color=#00FF00]// LINE 1311[/color]
elseif ( attribute == "panel-hide" ) then
local frame = self:GetAttribute("panel-frame");
local skipSetPoint = self:GetAttribute("panel-skipSetPoint");
self:HideUIPanel(frame, skipSetPoint);
elseif ( attribute == "panel-update" ) then
local frame = self:GetAttribute("panel-frame");
self:UpdateUIPanelPositions(frame);
elseif ( attribute == "uiparent-manage" ) then
self:UIParentManageFramePositions();
end
end



-- Dispatch to secure code
FramePositionDelegate:SetAttribute("panel-force", force);
FramePositionDelegate:SetAttribute("panel-frame", frame);
FramePositionDelegate:SetAttribute("panel-show", true);    [color=#00FF00]// LINE 1974[/color]
end




TalentFrame_LoadUI();
if ( PlayerTalentFrame_Toggle ) then
PlayerTalentFrame_Toggle(false, GetActiveTalentGroup());    [color=#00FF00] // LINE 366[/color]
end
end
Title: Re: Talents
Post by: schlumpf on April 24, 2011, 11:42:02 pm
The only relevant part is "tab = _G[frame:GetName().."Tab"..i];". This needs to be existing, which is not. You need to have a frame called like that, which you don't.
Title: Re: Talents
Post by: glararan on April 25, 2011, 12:14:57 am
Can you write me full script?Please. I'm n00b in Lua.
Title: Re: Talents
Post by: schlumpf on April 25, 2011, 12:33:27 am
No, I can't.
Title: Re: Talents
Post by: glararan on April 25, 2011, 01:17:17 am
:( Can anyone?
Title: Re: Talents
Post by: SirFranc on June 05, 2011, 12:07:10 pm
Trying to edit a file from FRAMExml makes the exe close the program on login saying "it's corrupt" so i need to remove the signature check on the FrameXML as well? i can't manage to do it  :/
Title: Re: Talents
Post by: Steff on June 11, 2011, 10:14:51 am
Yes you need. Interfac is protected.
Title: Re: Talents
Post by: SirFranc on June 13, 2011, 01:20:33 pm
Got them, so basically i can add now whatever spell i want on the Talent.dbc, linking it to an existing talent tab, using the coordinate (which tier and which row) and its icon, it's not that hard :D
Title: Re: Talents
Post by: Buddhist on June 15, 2013, 03:11:47 am
Hey, I'm trying to change the locations of talents in the talent trees (not editing the structure of the trees). So for example, swapping the tier 3, 3rd column talent in the combat tree to the 2nd tier 3rd column in subtlety.

I have successfully done this server side, but when I patch the client side, the UI is all messed up, as you can see in the attached image.

I know it works server side because, even without changing the client, the talent that *appears* to be camouflage (in the subtlety tree) actually requires 10 points in combat and gives the close quarters combat effects. So that should all work fine. My only issue is all of those talents disappearing from the talent trees.

All I did was change the talenttab, tier, column, and prerequisite fields in the talent.dbc file for camouflage and close quarters combat. I didn't touch any other talent. This is a 3.3.5a emulator on mangos.

Any ideas?

edit: I tested swapping two talents in the same tree, and that seems to work perfectly both server and client side. So clearly there is some issue with changing the talents between trees that I am missing.

edit2: I've done some more experimentation and got some more information. I tried removing blade flurry, which is the prerequisite of weapon expertise. When I did this by replacing every field in the talent.dbc for id223(bladeflurry), the UI broke (every talent up to and including blade flurry was missing). However, when I put the talenttab number back in (the number indicating which tree blade flurry belongs to) the talent tree looks and behaves perfectly. So now it's clear that it's specifically the talenttab field which is breaking the UI when changed -- there must be something else corresponding that needs a change, I just don't know what it is yet.

edit3: A functional work around is to swap the spell IDs in two talents in different trees to switch the trees, and then freely move the tier/column/prereqs/etc. It would be nice to know why directly changing the talenttab number messes everything up though.
Title: Re: Talents
Post by: XxXGenesisXxX on June 19, 2013, 12:26:36 pm
I am extremely tired and haven't done this in ages, but the reason you get this image:

download/file.php?id=77 (http://modcraft.io/download/file.php?id=77" onclick="window.open(this.href);return false;)

Is due to the fact the Talent tree is trying to find more buttons than the XML file holds. If you go into the relative xml file (which I honestly don't remember which it is, and I don't have an extracted install to check). But when you find it you will know what it is.

Basically it will have 3 sections that are distinctive and need changing, one relates to the button, one to the arrows and one for something else. You need to just copy paste enough of them that you have an equal amount of buttons/arrows as required, and then just change the numbers to the next ascending number (40 -> 41 -> 42 etc...)

Sorry I am not very precise, but I don't have an extracted interface folder atm and can't check myself. But I know you will be able to find it yourself, you seem to manage on your own very well anyway.

EDIT: Added attached file of a talent tree I did. It is honestly pissing me off that I can't remember the details of it, and the server it was for is now closed so I can't get the file either. But is it somewhat of the desired thing you want?