EmFor@0: --[[ EmFor@0: CensusPlus for World of Warcraft(tm). EmFor@0: EmFor@0: Copyright 2005 - 2006 Cooper Sellers and WarcraftRealms.com EmFor@0: EmFor@0: License: EmFor@0: This program is free software; you can redistribute it and/or EmFor@0: modify it under the terms of the GNU General Public License EmFor@0: as published by the Free Software Foundation; either version 2 EmFor@0: of the License, or (at your option) any later version. EmFor@0: EmFor@0: This program is distributed in the hope that it will be useful, EmFor@0: but WITHOUT ANY WARRANTY; without even the implied warranty of EmFor@0: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the EmFor@0: GNU General Public License for more details. EmFor@0: EmFor@0: You should have received a copy of the GNU General Public License EmFor@0: along with this program(see GLP.txt); if not, write to the Free Software EmFor@0: Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. EmFor@0: ]] EmFor@0: EmFor@0: EmFor@0: ------------------------------------------------------------------------------------ EmFor@0: -- EmFor@0: -- CensusPlus - PVP section EmFor@0: -- A WoW UI customization by Cooper Sellers EmFor@0: -- EmFor@0: -- EmFor@0: ------------------------------------------------------------------------------------ EmFor@0: EmFor@0: local damagedTable = { }; EmFor@0: EmFor@0: ----------------------------------------------------------------------------------- EmFor@0: -- EmFor@0: -- CensusPlus_PVPDeath -- Someone dies EmFor@0: -- EmFor@0: ----------------------------------------------------------------------------------- EmFor@0: function CensusPlus_PVPDeath( msg ) EmFor@0: EmFor@0: EmFor@0: -- CensusPlus_Msg( "Msg = " .. msg ); EmFor@0: -- local value = string.sub( msg, 0, index-1 ); EmFor@0: end EmFor@0: EmFor@0: ----------------------------------------------------------------------------------- EmFor@0: -- EmFor@0: -- CensusPlus_PVPDamage -- Damage is done EmFor@0: -- EmFor@0: ----------------------------------------------------------------------------------- EmFor@0: function CensusPlus_PVPDamage( victim, dmg ) EmFor@0: local dealer = "player"; EmFor@0: local vict = "target"; EmFor@0: if( victim == "player" ) then EmFor@0: -- Hit us instead EmFor@0: end EmFor@0: end EmFor@0: EmFor@0: EmFor@0: ----------------------------------------------------------------------------------- EmFor@0: -- EmFor@0: -- CensusPlus_ProcefssHonorInpsect -- Process honor inspect EmFor@0: -- EmFor@0: ----------------------------------------------------------------------------------- EmFor@0: function CensusPlus_ProcessHonorInpsect() EmFor@0: local todayHK, todayDK, EmFor@0: yesterdayHK, yesterdayDK, EmFor@0: thisweekHK, thisweekHonor, EmFor@0: lastweekHK, lastweekHonor, lastweekStanding, EmFor@0: lifetimeHK, lifetimeDK, lifetimeHighestRank = GetInspectHonorData() EmFor@0: EmFor@0: if( g_CensusPlusLastTarget ~= nil ) then EmFor@0: g_CensusPlusLastTarget[4] = lifetimeHK; EmFor@0: g_CensusPlusLastTarget[5] = CensusPlus_DetermineServerDate() .. "&" .. lastweekHonor .. "&" .. lastweekStanding; EmFor@0: g_CensusPlusLastTarget[6] = lifetimeHighestRank; EmFor@0: EmFor@0: g_CensusPlusLastTarget[7] = CensusPlus_DetermineServerDate() .. ""; EmFor@0: end EmFor@0: EmFor@0: local unit = InspectFrame.unit; EmFor@0: EmFor@0: -- ClearInspectPlayer(); EmFor@0: g_CensusPlusLastTargetName = nil; EmFor@0: g_CensusPlusLastTarget = nil; EmFor@0: -- InspectFrame.unit = nil; EmFor@0: end EmFor@0: EmFor@0: ----------------------------------------------------------------------------------- EmFor@0: -- EmFor@0: -- CensusPlus_ProcessMyHonor -- Process player honor EmFor@0: -- EmFor@0: ----------------------------------------------------------------------------------- EmFor@0: function CensusPlus_ProcessMyHonor() EmFor@0: -- EmFor@0: -- Get the portion of the database for this server EmFor@0: -- EmFor@0: local realmName = g_CensusPlusLocale .. GetCVar("realmName"); EmFor@0: local realmDatabase = CensusPlus_Database["Servers"][realmName]; EmFor@0: if (realmDatabase == nil) then EmFor@0: CensusPlus_Database["Servers"][realmName] = {}; EmFor@0: realmDatabase = CensusPlus_Database["Servers"][realmName]; EmFor@0: end EmFor@0: EmFor@0: -- EmFor@0: -- Get the portion of the database for this faction EmFor@0: -- EmFor@0: local factionGroup = UnitFactionGroup("player"); EmFor@0: local factionDatabase = realmDatabase[factionGroup]; EmFor@0: if (factionDatabase == nil) then EmFor@0: realmDatabase[factionGroup] = {}; EmFor@0: factionDatabase = realmDatabase[factionGroup]; EmFor@0: end EmFor@0: EmFor@0: -- EmFor@0: -- Get racial database EmFor@0: -- EmFor@0: local raceGroup = UnitRace("player"); EmFor@0: local raceDatabase = factionDatabase[raceGroup]; EmFor@0: if (raceDatabase == nil) then EmFor@0: factionDatabase[raceGroup] = {}; EmFor@0: raceDatabase = factionDatabase[raceGroup]; EmFor@0: end EmFor@0: EmFor@0: -- EmFor@0: -- Get class database EmFor@0: -- EmFor@0: local classGroup = UnitClass( "player" ); EmFor@0: local classDatabase = raceDatabase[classGroup]; EmFor@0: if (classDatabase == nil) then EmFor@0: raceDatabase[classGroup] = {}; EmFor@0: classDatabase = raceDatabase[classGroup]; EmFor@0: end EmFor@0: EmFor@0: -- EmFor@0: -- Get this player's entry EmFor@0: -- EmFor@0: local playerName = UnitName( "player" ); EmFor@0: local entry = classDatabase[playerName]; EmFor@0: if (entry == nil) then EmFor@0: classDatabase[playerName] = {}; EmFor@0: entry = classDatabase[playerName]; EmFor@0: end EmFor@0: EmFor@0: local honorableKills, dishonorableKills, highestRank = GetPVPLifetimeStats(); EmFor@0: local lwhk, lwdk, lwcontribution, lwrank = GetPVPLastWeekStats() EmFor@0: EmFor@0: -- EmFor@0: -- Update the information EmFor@0: -- EmFor@0: EmFor@0: entry[1] = UnitLevel("player"); EmFor@0: entry[2], rank, index = GetGuildInfo("player"); EmFor@0: entry[3] = CensusPlus_DetermineServerDate() .. ""; EmFor@0: entry[4] = honorableKills; EmFor@0: EmFor@0: EmFor@0: entry[5] = CensusPlus_DetermineServerDate() .. "&" .. lwcontribution .. "&" .. lwrank; EmFor@0: -- entry[5] = dishonorableKills; EmFor@0: entry[6] = highestRank; EmFor@0: EmFor@0: entry[7] = CensusPlus_DetermineServerDate() .. ""; EmFor@0: EmFor@0: if( entry ~= nil ) then EmFor@0: rankNumber = UnitPVPRank("player"); EmFor@0: if( rankNumber ~= 0 ) then EmFor@0: -- rankName= GetPVPRankInfo( rankNumber ) EmFor@0: entry[8] = rankNumber; -- slot 8 will be current rank EmFor@0: else EmFor@0: entry[8] = 0; -- slot 8 will be current rank EmFor@0: end EmFor@0: end EmFor@0: end