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