About woe rank in eAmod in Hercules

xVec

New member
Messages
23
Points
0
Hi!

I have a question, any of you know someting about the WoE Ranking implemented in eAmod in Hercules? 

I can pay for the implementation...

 
(note: I have never used/experienced the system you're referring to)
There are two parts to the woe ranking system:

1. src writes SQL data when certain actions take place.
E.g. when a player kills somebody, perhaps the src would add 1 to kill_counter row.

2. Website has some sort of interaction with the game SQL database to display the data graphically.

Lucky for you, eAmod became open source some time ago. You can view the SQL info here: https://github.com/zephyrus-cr/eamod/blob/master/sql-addons/main-extras_eAthena.sql

A sample of what is happening in the SQL:
 

CREATE TABLE `guild_rank` (
`guild_id` int(11) NOT NULL,
`castle_id` int(11) NOT NULL,
`capture` int(11) unsigned NOT NULL default '0',
`emperium` int(11) unsigned NOT NULL default '0',
`treasure` int(11) unsigned NOT NULL default '0',
`top_eco` int(11) unsigned NOT NULL default '0',
`top_def` int(11) unsigned NOT NULL default '0',
`invest_eco` int(11) unsigned NOT NULL default '0',
`invest_def` int(11) unsigned NOT NULL default '0',
`offensive_score` int(11) unsigned NOT NULL default '0',
`defensive_score` int(11) unsigned NOT NULL default '0',
`posesion_time` int(11) unsigned NOT NULL default '0',
`zeny_eco` int(11) unsigned NOT NULL default '0',
`zeny_def` int(11) unsigned NOT NULL default '0',

`skill_battleorder` int(11) unsigned NOT NULL default '0',
`skill_regeneration` int(11) unsigned NOT NULL default '0',
`skill_restore` int(11) unsigned NOT NULL default '0',
`skill_emergencycall` int(11) unsigned NOT NULL default '0',

`off_kill` int(11) unsigned NOT NULL default '0',
`off_death` int(11) unsigned NOT NULL default '0',
`def_kill` int(11) unsigned NOT NULL default '0',
`def_death` int(11) unsigned NOT NULL default '0',
`ext_kill` int(11) unsigned NOT NULL default '0',
`ext_death` int(11) unsigned NOT NULL default '0',
`ali_kill` int(11) unsigned NOT NULL default '0',
`ali_death` int(11) unsigned NOT NULL default '0',

PRIMARY KEY (`guild_id`,`castle_id`),
KEY `castle_id` (`castle_id`)
) ENGINE=InnoDB;


And then by searching the src repo, you can find snippets of the code.

This quite complicated. To recreate it to work for Hercules would take a lot of work. of course you could just use Zephyrus' HercMod but I really don't recommend doing that.

 
 
And then by searching the src repo, you can find snippets of the code.

This quite complicated. To recreate it to work for Hercules would take a lot of work. of course you could just use Zephyrus' HercMod but I really don't recommend doing that.
I already search in that repository but the Hercules section don't have the eAmod implementations.

I just want fill the 'char_woe_log' and 'char_wstats' tables to display the char stats in woe. :/

this one ?
No, I'm referring to woe stats like kills, skills used, etc... :(

 
I never play eamod, so I don't know any of the system

you even say etc .... this doesn't work
you should elaborate more

 
Last edited by a moderator:
a lot of useless information ...

kills/deaths ... can be done with scripting

dmg vs players ... need OnPCAttackEvent: ... not recommended

dmg vs buildings ... need OnPCAttackEvent or mobevent script command ... not implemented...

support skills .... no idea what it is

Total Healing ... need OnPCHealEvent: ??

Item consumed ... curious, why it doesn't list out ASPD potion like berserk potion or how much white potion used ?
need OnPCUseItemEvent: ... I remember Emistry made this before

Conclusion:
yeah these things just make your server use up a lot more memory just to show a bunch of useless information...

not interested

 
#include "common/hercules.h"
#include "map/map.h"
#include "map/unit.h"
#include "map/script.h"
#include "common/HPMDataCheck.h"

HPExport struct hplugin_info pinfo = {
"getlastskill",
SERVER_TYPE_MAP,
"0_0",
HPM_VERSION,
};

BUILDIN(getlastskill) {
struct block_list *bl = map->id2bl( script_hasdata(st, 3)? script_getnum(st, 2) : st->rid );
if ( !bl ) {
script_pushint(st, -1);
return false;
}
script_pushint( st, unit->bl2ud(bl)->skill_id ); // always return 0
// script_pushint( st, unit->bl2ud(bl)->dir ); // works
return true;
}

HPExport void plugin_init (void) {
addScriptCommand( "getlastskill", "?", getlastskill );
}


hmm ... always shows 0 ...
still possible but ... since the previous attempt doesn't work, then has to do something like OnPCUseSkillEvent stuffs
every time someone use a skill, it will log the last skill ID used in a player variable instead, because ud->skill_id doesn't seems to work

which ... I do admire zephirus sometimes, although his code looks very messy, but he really does put in a lot of effort

 
Last edited by a moderator:
unit->bl2ud some times may return NULL, and plugin may crash because this

 
unit->bl2ud some times may return NULL, and plugin may crash because this
example ?
I only tested it with player and npc

maybe add another bl check like
BL_PC, BL_MOB, BL_HOM, BL_MER, BL_ELEM, BL_PET_, BL_NPC ?

Code:
enum bl_type {
	BL_NUL   = 0x000,
	BL_PC    = 0x001,
	BL_MOB   = 0x002,
	BL_PET   = 0x004,
	BL_HOM   = 0x008,
	BL_MER   = 0x010,
	BL_ITEM  = 0x020,
	BL_SKILL = 0x040,
	BL_NPC   = 0x080,
	BL_CHAT  = 0x100,
	BL_ELEM  = 0x200,

	BL_ALL   = 0xFFF,
};
hmm ..... maybe ...

 
Last edited by a moderator:
struct unit_data *ud = unit->bl2ud(bl);
if (ud == NULL)
return false;
script_pushint( st, ud->skill_id ); // always return 0
//script_pushint( st, ud->dir ); // works


something like this

 
Back
Top