Jump to content
  • 0
Sign in to follow this  
Valna

Battle Log System

Question

Hallo Hercules Community,

I have changed from rathena to hercules and need a little help ;)

The HDM is realy cool, but i can't convert my rathena script to a nice HDM Plugin, can someone help me?

 

On rathena i have write a small battle log Script, this script have log the Damage/Heal in a SQL Table.

Bsp:

Player A castet Heal-> Log to SQL -> "CharID"-"SkillID"-"Heal amount" - "amount of Skill use"- "Last Heal" -"Highest Heal ever"#

My First try look like this in the battle.c on rathena:

	    if (sd) {                char skilldmgnow[128]; // Total Damage                 char skilldmglast[128]; // LastDamage                char skilldmgcount[128]; // Total skill count                sprintf(skilldmgnow,"@%s",skill_get_name(skill_id)); // Get the Name of current sklll                sprintf(skilldmglast,"@%s_last",skill_get_name(skill_id)); // Get the Name ofthe current last sklll                sprintf(skilldmgcount,"@%s_count",skill_get_name(skill_id)); // Get the Name of the current skill counter                                pc_setreg( sd, add_str(skilldmgnow),damage+pc_readreg(sd, add_str(skilldmgnow))); //add current skill damage to total damage                pc_setreg( sd, add_str(skilldmglast),damage); //save the last damage                pc_setreg( sd, add_str(skilldmgcount),1+pc_readreg(sd, add_str(skilldmgcount))); //Skillcounter +1                                sprintf(skilldmgnow,"@%s : %d",skill_get_name(skill_id),pc_readreg(sd, add_str(skilldmgnow))); //Debug message total damge                sprintf(skilldmglast,"@%s_last : %d",skill_get_name(skill_id),pc_readreg(sd, add_str(skilldmglast))); //Debug message last damge                sprintf(skilldmgcount,"@%s_count : %d",skill_get_name(skill_id),pc_readreg(sd, add_str(skilldmgcount))); //Debug message skill counter                            if (pc_readreg(sd, add_str("@debugskill"))==1){ //Debug messages            clif_displaymessage(sd->fd, skilldmgnow); //"Duel: Can't use %s in duel."            clif_displaymessage(sd->fd, skilldmglast); //"Duel: Can't use %s in duel."            clif_displaymessage(sd->fd, skilldmgcount); //"Duel: Can't use %s in duel."            }            };

After every kill the i have convert the local player variables to SQL tables with a npc script.

(Unfortunately I have lost this npc script, but thats not a Problem)

 

A Picture says more than 1000 word ;)

 

ergebniss.png

Edited by Valna

Share this post


Link to post
Share on other sites

2 answers to this question

Recommended Posts

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.