Jump to content
  • 0
Sign in to follow this  
xVec

About woe rank in eAmod in Hercules

Question

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...

Share this post


Link to post
Share on other sites

11 answers to this question

Recommended Posts

  • 0

(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.

Share this post


Link to post
Share on other sites
  • 0
36 minutes ago, Myriad said:
 

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. :/

 

42 minutes ago, AnnieRuru said:

this one ?

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

Share this post


Link to post
Share on other sites
  • 0

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

Share this post


Link to post
Share on other sites
  • 0

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

Share this post


Link to post
Share on other sites
  • 0
Spoiler

#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

Share this post


Link to post
Share on other sites
  • 0

unit->bl2ud some times may return NULL, and plugin may crash because this

Share this post


Link to post
Share on other sites
  • 0
On 5/31/2018 at 6:48 AM, 4144 said:

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 ?

Spoiler

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 ...

 

Edited by AnnieRuru

Share this post


Link to post
Share on other sites
  • 0
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

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.