PvP stats
Hello,
I'm sorry to bother you with the PvP but is it possible to add some stats when a Player kills an other Player? How I would see that: - New table in the DB called: PvPstats - Fields: Pwinner (the killer's name) Pwinguild (the killer's guild) Pwinlevel (level of the winner) Plooser (the looser) Ploosguild (the looser's guild) Plooslvl(level of the looser) Nkills (number of kills). -> When player1(guild: Goodies) kills player2(guild: Shorties), it adds an entrie in the PvPstats table: - players1|goodies|51|players2|shorties|51|1 This way, it would become possible to make some pvp stats :) Thx, Mag |
This kind of implements would be nice to add for any PvP server. I m not sure of how much work it requires, but it seems than adding a simple query adding a row in a table when a player dies from another one might not be that hard. Exploiting that table from an external website, to make PvP rosters will be really valuable !
Tho, i would suggest a different table from Mag's one, instead of cumulating kills on the same record, i would just add 1 row per kill, with the date, so it could allow to make periodic stats instead of global ones! |
Hello there,
I'm sorry to bump my old post but I would like to know if it would be possible to add this feature? Thx by advance, Mag |
anything is possible, but its not gunna get written by the core developers right now, we have a lot of higher priorities.
|
Ok fnw, no probs.
I'll just wait then. Mag |
I've learned c++ and coded it, so I don't need it anymore.
It's working well even if the code might be crappy :D If anyone is interested by the code changes, I can give them np. Mag |
"I've learned c++ and coded it, so I don't need it anymore."
Well Hello Albert Einstein! That was quick learning! |
I would be interested in seeing the code. I'm curious if maybe it could be modified to count all kills a player does that way we could make a site similar to eq2's player profiling... number kills each player did, and what not...
just an idea... vRandom |
Quote:
Quick yeah, but i dunno about how good is the code :D Vrandom, once a player kills an other player , it add an entrie in the pvpstats table, in that way: killID|Killername|killerlevel|killerguild|Looserna me|Looserlevel|Looserguild|PvPpoints|Timestamp So you can see (using php by example): - Daily, Weekly, Monthly: who is the best killer, which's the best guild, how many kills does have a player, who is the best target of a player, etc... Also pvppoints are calculated depending of the levels and it also works for group kills. Once I'll get to home, I'll show the code i've made. Mag |
Last line of database.cpp
Code:
bool Database::UpdatePVPPoints(const char* killername, int klevel, int kguildid, const char* loosername, int llevel, int lguildid, int pvppoints) add this in database.h: Code:
bool UpdatePVPPoints(const char* killername, int klevel, int kguildid, const char* loosername, int llevel, int lguildid, int pvppoints); Code:
// if(!IsLD())//Todo: make it so an LDed client leaves corpse if its enabled Code:
if(GetGM() || !IsBecomeNPC() && other != NULL && other->IsClient()) You will can notice that all pvppoints are previously declared. (it's what i wanted to do on empire). You can change them, or add a formula for the points check. You will have to create a new table in your db called "pvpstats" with the columns: id(int(11)auto_increment), killername(varchar(64)),klevel(int(11)),kguilid(in t(11)),loosername(varchar(64)),llevel(int(11)),lgu ildid(int(11)),pvppoints(int(11)),date(timestamp(C URRENT_TIMESTAMP on update CURRENT_TIMESTAMP)). Mag |
Quote:
Thanks for sharing, I'll see what I come up with later, got called to the office :( I hate the office.... Good job on the code Mag. vRandom |
OT but I bet my office is worse than yours :P One of my users somehow removed the root user from their Linux server. I told them not use root. I told them they would break it.... LOL
|
Quote:
vRandom |
All times are GMT -4. The time now is 08:57 AM. |
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.