comparison CensusPlusPVP.lua @ 0:edfa01041183

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