annotate CensusPlusPVP.lua @ 8:c4f065a2b520

push error resolve
author EmFor
date Fri, 10 Dec 2010 17:18:56 +0100
parents 10c85be19b56
children
rev   line source
EmFor@6 1 --[[
EmFor@6 2 CensusPlus for World of Warcraft(tm).
EmFor@6 3
EmFor@6 4 Copyright 2005 - 2006 Cooper Sellers and WarcraftRealms.com
EmFor@6 5
EmFor@6 6 License:
EmFor@6 7 This program is free software; you can redistribute it and/or
EmFor@6 8 modify it under the terms of the GNU General Public License
EmFor@6 9 as published by the Free Software Foundation; either version 2
EmFor@6 10 of the License, or (at your option) any later version.
EmFor@6 11
EmFor@6 12 This program is distributed in the hope that it will be useful,
EmFor@6 13 but WITHOUT ANY WARRANTY; without even the implied warranty of
EmFor@6 14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
EmFor@6 15 GNU General Public License for more details.
EmFor@6 16
EmFor@6 17 You should have received a copy of the GNU General Public License
EmFor@6 18 along with this program(see GLP.txt); if not, write to the Free Software
EmFor@6 19 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
EmFor@6 20 ]]
EmFor@6 21
EmFor@6 22
EmFor@6 23 ------------------------------------------------------------------------------------
EmFor@6 24 --
EmFor@6 25 -- CensusPlus - PVP section
EmFor@6 26 -- A WoW UI customization by Cooper Sellers
EmFor@6 27 --
EmFor@6 28 --
EmFor@6 29 ------------------------------------------------------------------------------------
EmFor@6 30
EmFor@6 31 local damagedTable = { };
EmFor@6 32
EmFor@6 33 -----------------------------------------------------------------------------------
EmFor@6 34 --
EmFor@6 35 -- CensusPlus_PVPDeath -- Someone dies
EmFor@6 36 --
EmFor@6 37 -----------------------------------------------------------------------------------
EmFor@0 38 function CensusPlus_PVPDeath( msg )
EmFor@0 39
EmFor@0 40
EmFor@0 41 -- CensusPlus_Msg( "Msg = " .. msg );
EmFor@6 42 -- local value = string.sub( msg, 0, index-1 );
EmFor@6 43 end
EmFor@6 44
EmFor@6 45 -----------------------------------------------------------------------------------
EmFor@6 46 --
EmFor@6 47 -- CensusPlus_PVPDamage -- Damage is done
EmFor@6 48 --
EmFor@6 49 -----------------------------------------------------------------------------------
EmFor@6 50 function CensusPlus_PVPDamage( victim, dmg )
EmFor@6 51 local dealer = "player";
EmFor@6 52 local vict = "target";
EmFor@6 53 if( victim == "player" ) then
EmFor@6 54 -- Hit us instead
EmFor@6 55 end
EmFor@6 56 end
EmFor@6 57
EmFor@6 58
EmFor@6 59 -----------------------------------------------------------------------------------
EmFor@6 60 --
EmFor@6 61 -- CensusPlus_ProcefssHonorInpsect -- Process honor inspect
EmFor@6 62 --
EmFor@6 63 -----------------------------------------------------------------------------------
EmFor@6 64 function CensusPlus_ProcessHonorInpsect()
EmFor@0 65 local todayHK, todayDK,
EmFor@0 66 yesterdayHK, yesterdayDK,
EmFor@0 67 thisweekHK, thisweekHonor,
EmFor@0 68 lastweekHK, lastweekHonor, lastweekStanding,
EmFor@0 69 lifetimeHK, lifetimeDK, lifetimeHighestRank = GetInspectHonorData()
EmFor@0 70
EmFor@0 71 if( g_CensusPlusLastTarget ~= nil ) then
EmFor@6 72 g_CensusPlusLastTarget[4] = lifetimeHK;
EmFor@6 73 g_CensusPlusLastTarget[5] = CensusPlus_DetermineServerDate() .. "&" .. lastweekHonor .. "&" .. lastweekStanding;
EmFor@6 74 g_CensusPlusLastTarget[6] = lifetimeHighestRank;
EmFor@6 75
EmFor@6 76 g_CensusPlusLastTarget[7] = CensusPlus_DetermineServerDate() .. "";
EmFor@6 77 end
EmFor@6 78
EmFor@0 79 local unit = InspectFrame.unit;
EmFor@6 80
EmFor@6 81 -- ClearInspectPlayer();
EmFor@6 82 g_CensusPlusLastTargetName = nil;
EmFor@6 83 g_CensusPlusLastTarget = nil;
EmFor@6 84 -- InspectFrame.unit = nil;
EmFor@6 85 end
EmFor@6 86
EmFor@6 87 -----------------------------------------------------------------------------------
EmFor@6 88 --
EmFor@6 89 -- CensusPlus_ProcessMyHonor -- Process player honor
EmFor@6 90 --
EmFor@6 91 -----------------------------------------------------------------------------------
EmFor@6 92 function CensusPlus_ProcessMyHonor()
EmFor@6 93 --
EmFor@6 94 -- Get the portion of the database for this server
EmFor@6 95 --
EmFor@6 96 local realmName = g_CensusPlusLocale .. GetCVar("realmName");
EmFor@6 97 local realmDatabase = CensusPlus_Database["Servers"][realmName];
EmFor@6 98 if (realmDatabase == nil) then
EmFor@6 99 CensusPlus_Database["Servers"][realmName] = {};
EmFor@6 100 realmDatabase = CensusPlus_Database["Servers"][realmName];
EmFor@6 101 end
EmFor@6 102
EmFor@6 103 --
EmFor@6 104 -- Get the portion of the database for this faction
EmFor@6 105 --
EmFor@6 106 local factionGroup = UnitFactionGroup("player");
EmFor@6 107 local factionDatabase = realmDatabase[factionGroup];
EmFor@6 108 if (factionDatabase == nil) then
EmFor@6 109 realmDatabase[factionGroup] = {};
EmFor@6 110 factionDatabase = realmDatabase[factionGroup];
EmFor@6 111 end
EmFor@6 112
EmFor@6 113 --
EmFor@6 114 -- Get racial database
EmFor@6 115 --
EmFor@6 116 local raceGroup = UnitRace("player");
EmFor@6 117 local raceDatabase = factionDatabase[raceGroup];
EmFor@6 118 if (raceDatabase == nil) then
EmFor@6 119 factionDatabase[raceGroup] = {};
EmFor@6 120 raceDatabase = factionDatabase[raceGroup];
EmFor@6 121 end
EmFor@6 122
EmFor@6 123 --
EmFor@6 124 -- Get class database
EmFor@6 125 --
EmFor@6 126 local classGroup = UnitClass( "player" );
EmFor@6 127 local classDatabase = raceDatabase[classGroup];
EmFor@6 128 if (classDatabase == nil) then
EmFor@6 129 raceDatabase[classGroup] = {};
EmFor@6 130 classDatabase = raceDatabase[classGroup];
EmFor@6 131 end
EmFor@6 132
EmFor@6 133 --
EmFor@6 134 -- Get this player's entry
EmFor@6 135 --
EmFor@6 136 local playerName = UnitName( "player" );
EmFor@6 137 local entry = classDatabase[playerName];
EmFor@6 138 if (entry == nil) then
EmFor@6 139 classDatabase[playerName] = {};
EmFor@6 140 entry = classDatabase[playerName];
EmFor@6 141 end
EmFor@6 142
EmFor@6 143 local honorableKills, dishonorableKills, highestRank = GetPVPLifetimeStats();
EmFor@6 144 local lwhk, lwdk, lwcontribution, lwrank = GetPVPLastWeekStats()
EmFor@6 145
EmFor@6 146 --
EmFor@6 147 -- Update the information
EmFor@6 148 --
EmFor@6 149
EmFor@6 150 entry[1] = UnitLevel("player");
EmFor@6 151 entry[2], rank, index = GetGuildInfo("player");
EmFor@6 152 entry[3] = CensusPlus_DetermineServerDate() .. "";
EmFor@6 153 entry[4] = honorableKills;
EmFor@6 154
EmFor@6 155
EmFor@6 156 entry[5] = CensusPlus_DetermineServerDate() .. "&" .. lwcontribution .. "&" .. lwrank;
EmFor@6 157 -- entry[5] = dishonorableKills;
EmFor@6 158 entry[6] = highestRank;
EmFor@6 159
EmFor@6 160 entry[7] = CensusPlus_DetermineServerDate() .. "";
EmFor@6 161
EmFor@6 162 if( entry ~= nil ) then
EmFor@0 163 rankNumber = UnitPVPRank("player");
EmFor@0 164 if( rankNumber ~= 0 ) then
EmFor@0 165 -- rankName= GetPVPRankInfo( rankNumber )
EmFor@6 166 entry[8] = rankNumber; -- slot 8 will be current rank
EmFor@0 167 else
EmFor@6 168 entry[8] = 0; -- slot 8 will be current rank
EmFor@0 169 end
EmFor@0 170 end
EmFor@6 171 end