Thread Tools Display Modes
02-04-08, 11:01 PM   #1
whitefire
A Kobold Labourer
Join Date: Feb 2008
Posts: 1
Exclamation Titan - Help with EotS math

Here is my Problem with updating this code and im not sure what I'm doing wrong can one of you greater guru's take a look at this and let me know what you think. Please also keep in mind that all the battleground's work as intended except for EotS (aka anything with EOS in it)

here is the important information from both the localization.en.lua file and the TitanHonorGrindFanUpdate.lua file

localization.en.lua
Code:
TITAN_HGRIND_BG_AV = "Alterac Valley";
TITAN_HGRIND_BG_AB = "Arathi Basin";
TITAN_HGRIND_BG_WS = "Warsong Gulch";
TITAN_HGRIND_BG_EOS = "Eye of the Storm";



TitanHonorGrindFanUpdate.lua
Code:
	-- BG stats
	local bg, honorArr, avgHonor, avgTime, bgSession, dataPoints, bgstats, avEst, abEst, wsgEst, eosEst;

	bgstats = "";
	avEst = 0;
	abEst = 0;
	wsgEst = 0;
	eosEst = 0;

	
	for bg, honorArr in pairs(TITAN_HGRIND_CFG[TITAN_HGRIND_PLAYER].BGHonorHistory) do
		avgHonor = 0;
		avgTime = 0;

		dataPoints = table.getn(honorArr);
		
		for _, bgSession in pairs(honorArr) do
			avgHonor = avgHonor + bgSession.honor;
			avgTime = avgTime + bgSession.time;
		end
	
		avgHonor = math.floor(avgHonor / dataPoints);
		avgTime = math.floor(avgTime / dataPoints);

		--Added by Tidan of Thorium Brotherhood
		--Calculation to estimate number of BG's needed to acheive GoalHonor
		if(bg == TITAN_HGRIND_BG_AV) then
			avEst = math.ceil((TITAN_HGRIND_CFG[TITAN_HGRIND_PLAYER].GoalHonor - ehc) / avgHonor);
		elseif(bg == TITAN_HGRIND_BG_AB) then
			abEst = math.ceil((TITAN_HGRIND_CFG[TITAN_HGRIND_PLAYER].GoalHonor - ehc) / avgHonor);
		elseif(bg == TITAN_HGRIND_BG_WS) then
			wsgEst = math.ceil((TITAN_HGRIND_CFG[TITAN_HGRIND_PLAYER].GoalHonor - ehc) / avgHonor);
		elseif(bg == TITAN_HGRIND_BG_EOS) then
			eosEst = math.ceil((TITAN_HGRIND_CFG[TITAN_HGRIND_PLAYER].GoalHonor - ehc) / avgHonor);
		end
		
		

		bgstats =	bgstats.."\n"..TitanUtils_GetHighlightText(bg.." stats:").."\n"..
				TITAN_HGRIND_AVEH..": \t"..TitanUtils_GetHighlightText(avgHonor).."\n"..
				TITAN_HGRIND_AVET..": \t"..TitanUtils_GetHighlightText(avgTime).."\n"..
				TITAN_HGRIND_AVEHPH..": \t"..TitanUtils_GetHighlightText(math.floor((avgHonor/avgTime)*60)).."\n"..
				"";
Not sure if there is anything else you might need to see. however it you want to see the complete code just let me know and i will get it to you.


any and all help will be greatly appreciated
Thanks
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Titan - Help with EotS math


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