Hey Judas,
I had the same idea (for WoE statistics) some time ago. And I solved it by just incrementing character variables at the specific src positions:
➜ src git:(master) ✗ grep -nr "WoE Statistik"
map/intif.c:286: if( agit_flag || agit2_flag ) pc_setglobalreg(sd,add_str("woestat_chat"), pc_readglobalreg(sd,add_str("woestat_chat"))+1);// [Jey] WoE Statistik
map/unit.c:400: if( bl->type == BL_PC && (agit_flag || agit2_flag) ) pc_setglobalreg(sd,add_str("woestat_walked"), pc_readglobalreg(sd,add_str("woestat_walked"))+1);// [Jey] WoE Statistik
map/unit.c:1911: if( map_flag_woe(sd->bl.m) ) pc_setglobalreg(sd,add_str("woestat_skilluse"), pc_readglobalreg(sd,add_str("woestat_skilluse"))+1);// [Jey] WoE Statistik
map/clif.c:10760: if( agit_flag || agit2_flag ) pc_setglobalreg(sd,add_str("woestat_chat"), pc_readglobalreg(sd,add_str("woestat_chat"))+1); // [Jey] WoE Statistik
map/clif.c:11047: if(agit_flag || agit2_flag ) pc_setglobalreg(sd,add_str("woestat_chat"), pc_readglobalreg(sd,add_str("woestat_chat"))+1); // [Jey] WoE Statistik
map/pc.c:5060: if( map_flag_woe(sd->bl.m) ) pc_setglobalreg(sd,add_str("woestat_potuse"), pc_readglobalreg(sd,add_str("woestat_potuse"))+1); // [Jey] WoE Statistik
map/pc.c:5449: if( sd->vars_ok && (agit_flag || agit2_flag) ) pc_setglobalreg(sd,add_str("woestat_warpcount"), pc_readglobalreg(sd,add_str("woestat_warpcount"))+1);// [Jey] WoE Statistik
map/pc.c:7586: // [Jey] WoE Statistik
map/pc.c:8418: if( map_flag_woe(sd->bl.m) ) pc_setglobalreg(sd,add_str("woestat_itemheal"), pc_readglobalreg(sd,add_str("woestat_itemheal"))+hp);// [Jey] WoE Statistik
map/party.c:938: if(agit_flag || agit2_flag ) pc_setglobalreg(sd,add_str("woestat_chat"), pc_readglobalreg(sd,add_str("woestat_chat"))+1);// [Jey] WoE Statistik
map/skill.c:564: if( sd != NULL && map_flag_woe(sd->bl.m) ) pc_setglobalreg(sd,add_str("woestat_heal"), pc_readglobalreg(sd,add_str("woestat_heal"))+heal);// [Jey] WoE Statistik
map/skill.c:2584: if( map_flag_woe(sd->bl.m) ) pc_setglobalreg(sd,add_str("woestat_broken"), pc_readglobalreg(sd,add_str("woestat_broken"))+1);// [Jey] WoE Statistik
map/skill.c:8564: if( sd != NULL && map_flag_woe(sd->bl.m) ) pc_setglobalreg(sd,add_str("woestat_heal"), pc_readglobalreg(sd,add_str("woestat_heal"))+hp);// [Jey] WoE Statistik
map/skill.c:8754: if ((dstsd = g->member[i].sd) != NULL && sd != dstsd && !dstsd->state.autotrade && !pc_isdead(dstsd) && pc_readglobalreg(dstsd,add_str("nowoe")) == 0) {// [Jey] WoE Statistik
map/guild.c:1049: if( agit_flag || agit2_flag ) pc_setglobalreg(sd,add_str("woestat_chat"), pc_readglobalreg(sd,add_str("woestat_chat"))+1);// [Jey] WoE Statistik
And a NPC which showed the player stats and resets them on ever woe start:
prontera,218,87,5 script WoE Statistik 833,{
OnWhisperGlobal:
callfunc "CheckWoEStatReset";
mes "Deine letzte WoE Statistik:";
mes "Kills: "+woestat_kills;
mes "Tode: "+woestat_deaths;
if( woestat_deaths > 0 )
mes "KDA: "+callfunc("GetPercentage",(woestat_kills*100)/woestat_deaths);
else
mes "KDA: Perfekt";
mes "Maximale Killcombo: "+woestat_killcombo;
mes "Heilung gewirkt: "+callfunc("ThousandPoints",woestat_heal);
mes "Itemheilung gewirkt: "+callfunc("ThousandPoints",woestat_itemheal);
mes "Schaden: "+callfunc("ThousandPoints",woestat_dmgdealt);
mes "Schaden erlitten: "+callfunc("ThousandPoints",woestat_tanked);
mes "Skills genutzt: "+callfunc("ThousandPoints",woestat_skilluse);
mes "Potions genutzt: "+callfunc("ThousandPoints",woestat_potuse);
mes "Zerbrochene Rüstung: "+woestat_broken;
mes "Chat Kommunikation: "+callfunc("ThousandPoints",woestat_chat);
mes "Strecke zurückgelegt: "+callfunc("ThousandPoints",woestat_walked);
mes "Höchste AFK-Zeit in Sek.: "+callfunc("ThousandPoints",woestat_idle);
mes "Emps gebrochen: "+woestat_empbreak;
mes "Gewarpt: "+callfunc("ThousandPoints",woestat_warpcount);
close;
}
//if( map_flag_woe(sd->bl.m) ) pc_setglobalreg(sd,"woestat_heal", pc_readglobalreg(sd,"woestat_heal")+heal);
//if( map_flag_woe(sd->bl.m) ) pc_setglobalreg(sd,"woestat_chat", pc_readglobalreg(sd,"woestat_chat")+1);
//if( agit_flag || agit2_flag ) pc_setglobalreg(sd,"woestat_chat", pc_readglobalreg(sd,"woestat_chat")+1);
// return pc_setpos((TBL_PC*)bl, map_id2index(m), x, y, type);
function script CheckWoEStatReset {
if( playerattached() && woestat_id != $LastWoEID )
{
set woestat_id,$LastWoEID; //Day of the Year
woestat_kills = 0;
woestat_deaths = 0;
woestat_killcombo = 0;
woestat_killcombo_tmp = 0;
woestat_heal = 0;
woestat_itemheal = 0;
woestat_dmgdealt = 0;
woestat_tanked = 0;
woestat_skilluse = 0;
woestat_potuse = 0;
woestat_broken = 0;
woestat_chat = 0;
woestat_walked = 0;
woestat_idle = 0;
woestat_empbreak = 0;
woestat_warpcount = 0;
}
return;
}
- script WoEStats -1,{
end;
OnAgitStart:
OnAgitStart2:
OnAgitNStartBE:
OnAgitNStartTE:
initnpctimer;
$LastWoEID++;
addrid(0);
OnPCLoginEvent:
callfunc "CheckWoEStatReset";
end;
OnPCKillEvent:
if( callfunc("onActiveGuildCastle") )
{
woestat_kills++;
woestat_killcombo_tmp++;
if( woestat_killcombo_tmp > woestat_killcombo ) set woestat_killcombo,woestat_killcombo_tmp;
}
end;
OnPCDieEvent:
if( callfunc("onActiveGuildCastle") )
{
woestat_deaths++;
woestat_killcombo_tmp = 0;
}
end;
OnAgitEnd:
OnAgitEnd2:
OnAgitNEndBE:
OnAgitNEndTE:
stopnpctimer;
OnTimer30000: //Alle 30 Sekunden Idletimecheck (Relativ ungenau, aber egal.)
addrid(0);
set .@idle,checkidle();
if( .@idle > woestat_idle ) set woestat_idle,.@idle;
end;
}
It likely isn't the best approach, but at least it worked fine
To answer your question properly:
1. Simple OnPCKillEvent script.
2. SRC edit by comparing the character variable
3. same as 2.
4. SRC edit incrementing the character variable