Jump to content

Recommended Posts

Posted

No, you need to install the differential (source mod), compile, and then configure the database file as instructed in the first post.

I wouldn't necessarily consider this intermediate, but if you're not familiar with source modifications I wouldn't use it.

Posted

@D3ath, open the file, and read thema manually..

@GM Takumirai, recheck your skill.h, I think you missed some lines from the .patch file

@PapaZola, I've implemented that script for my eA and 3CeAM, working properly (if you know how to change part, to match it with each emulator)

@joaopedrorios, maybe you can make new mapflag, "managedamage", and add the flag to manage skill damage option..

@donkeyg, of course you must add the .patch file to your server before u can enjoy your damage reduction~

Posted (edited)

Does anyone have any idea why it stopped working in the latest revisions?

I updated it from .914 to .986 and now the patch won't work anymore :(.

No errors on mapserver and yes I've re-applied the patch a couple of times

Edited by Cephaler
Posted

There was a huge change a couple revisions ago, I had over 10 conflictions... Some of which weren't even important or nothing more than white space. I haven't had issues with this patch since then... But I did a ton of the updating manually.

I'll take a look more closely this evening and let you know what I find.

Posted

There was a huge change a couple revisions ago, I had over 10 conflictions... Some of which weren't even important or nothing more than white space. I haven't had issues with this patch since then... But I did a ton of the updating manually.

I'll take a look more closely this evening and let you know what I find.

Thanks :)

Posted (edited)

Great Idea you had! I was coding something really similar using a db.txt file too. You should add some general options as battleconfigs, like general damage cap, general damage reduction or increase, etc as I did on mine.

Also.. I was looking through your code and noticed this.

md.damage = md.damage += md.damage*battle_SAD(sd, target, skill_num)/100;

Isn't the '= md.damage' redundant?

Also this.

int flag = map[sd->bl.m].flag.restricted?8*map[sd->bl.m].zone:0;
map[sd->bl.m].flag.restricted && skill_db[skill_num].flag&flag

if map[sd->bl.m].flag.restricted exists you asign 8*map[sd->bl.m].zone at flag otherwise 0, then on the other condition if map[sd->bl.m].flag.restricted exists and the bit value you asigned to flag is in skill_db[skill_num].flag it triggers the condition. that logic is redundant too, because in the case if map[sd->bl.m].flag.restricted doesn't exists, as you stated an && on the second condition would be redundant if the second condition don't triggers because of the 0. I think would be better just like this.

map[sd->bl.m].flag.restricted && skill_db[skill_num].flag&(8*map[sd->bl.m].zone)

Great contribution! Have a nice day!

I'm waiting until the Code Revision Reversion goes into effect before I update again, I just wanted to let you know.

Thanks, it still doesn't work for me :(

Open your battle.c src file.

Find this line

struct Damage battle_calc_magic_attack(struct block_list *src,struct block_list *target,int skill_num,int skill_lv,int mflag);

add before

static int battle_SAD(struct map_session_data *sd, struct block_list *target, int skill_num)
{
int dmg = 0;
int flag = map[sd->bl.m].flag.restricted?8*map[sd->bl.m].zone:0;
if((skill_db[skill_num].flag&1 && !map_flag_vs(sd->bl.m))
|| (skill_db[skill_num].flag&2 && map[sd->bl.m].flag.pvp)
|| (skill_db[skill_num].flag&4 && map_flag_gvg(sd->bl.m))
|| (skill_db[skill_num].flag&8 && map[sd->bl.m].flag.battleground)
|| (map[sd->bl.m].flag.restricted && skill_db[skill_num].flag&flag))
{
 switch(target->type)
 {
  case BL_PC:
dmg = skill_db[skill_num].pc_damage;
break;
  case BL_MOB:
if(((TBL_MOB*)target)->status.mode&MD_BOSS)
 dmg = skill_db[skill_num].boss_damage;
else
 dmg = skill_db[skill_num].mob_damage;
break;
  default:
dmg = skill_db[skill_num].other_damage;
break;
 }
}
return dmg;
}

Look for this line.

  	 if( sd )
	{
		if (skill_num && (i = pc_skillatk_bonus(sd, skill_num)))
			ATK_ADDRATE(i);

add like this

if( sd )
  	 if( sd )
	{
		ATK_ADDRATE(battle_SAD(sd, target, skill_num));
		if (skill_num && (i = pc_skillatk_bonus(sd, skill_num)))
			ATK_ADDRATE(i);

Look for this line

 if(sd) {
  //Damage bonuses

Add this

 if(sd) {
					MATK_ADDRATE(battle_SAD(sd, target, skill_num));
  //Damage bonuses

Look for this line

if (sd && (i = pc_skillatk_bonus(sd, skill_num)))
 md.damage += md.damage*i/100;

Replace like this

if (sd)
{
 if(i = pc_skillatk_bonus(sd, skill_num))
  md.damage += md.damage*i/100;

 md.damage = md.damage += md.damage*battle_SAD(sd, target, skill_num)/100;
}

On skill.c src file

Find this line

/*==========================================
 * DB reading.
 * skill_db.txt

Add before

static bool skill_parse_row_skilldamage(char* split[], int columns, int current)
{
int i = atoi(split[0]);
i = skill_get_index(i);
if( !i ) // invalid skill id
 return false;

skill_db[i].flag  = atoi(split[1]);
skill_db[i].pc_damage  = atoi(split[2]);
skill_db[i].mob_damage  = atoi(split[3]);
skill_db[i].boss_damage  = atoi(split[4]);
skill_db[i].other_damage = atoi(split[5]);
return true;
}

Find this line

sv_readdb(db_path, "skill_changematerial_db.txt"

Add after

sv_readdb(db_path, "skill_damage_db.txt"	  , ',',   5,  6, MAX_SKILL_DB, skill_parse_row_skilldamage);

On skill.h src file

Find this line

 int unit_interval;
 int unit_target;
 int unit_flag;

Add after

int flag;
int pc_damage,mob_damage,other_damage,boss_damage;

Compile and you're done. Don't forget to create your db file. It should work perfectly on the latest revision.

Edited by Random
  • 3 weeks later...
Posted

after all this procedure where can I find my db file?? I didnt understand what u said about this Don't forget to create your db file. It should work perfectly on the latest

Posted

Great Idea you had! I was coding something really similar using a db.txt file too. You should add some general options as battleconfigs, like general damage cap, general damage reduction or increase, etc as I did on mine.

Also.. I was looking through your code and noticed this.

md.damage = md.damage += md.damage*battle_SAD(sd, target, skill_num)/100;

Isn't the '= md.damage' redundant?

Also this.

int flag = map[sd->bl.m].flag.restricted?8*map[sd->bl.m].zone:0;
map[sd->bl.m].flag.restricted && skill_db[skill_num].flag&flag

if map[sd->bl.m].flag.restricted exists you asign 8*map[sd->bl.m].zone at flag otherwise 0, then on the other condition if map[sd->bl.m].flag.restricted exists and the bit value you asigned to flag is in skill_db[skill_num].flag it triggers the condition. that logic is redundant too, because in the case if map[sd->bl.m].flag.restricted doesn't exists, as you stated an && on the second condition would be redundant if the second condition don't triggers because of the 0. I think would be better just like this.

map[sd->bl.m].flag.restricted && skill_db[skill_num].flag&(8*map[sd->bl.m].zone)

Great contribution! Have a nice day!

I'm waiting until the Code Revision Reversion goes into effect before I update again, I just wanted to let you know.

Thanks, it still doesn't work for me :(

Open your battle.c src file.

Find this line

struct Damage battle_calc_magic_attack(struct block_list *src,struct block_list *target,int skill_num,int skill_lv,int mflag);

add before

static int battle_SAD(struct map_session_data *sd, struct block_list *target, int skill_num)
{
int dmg = 0;
int flag = map[sd->bl.m].flag.restricted?8*map[sd->bl.m].zone:0;
if((skill_db[skill_num].flag&1 && !map_flag_vs(sd->bl.m))
|| (skill_db[skill_num].flag&2 && map[sd->bl.m].flag.pvp)
|| (skill_db[skill_num].flag&4 && map_flag_gvg(sd->bl.m))
|| (skill_db[skill_num].flag&8 && map[sd->bl.m].flag.battleground)
|| (map[sd->bl.m].flag.restricted && skill_db[skill_num].flag&flag))
{
 switch(target->type)
 {
  case BL_PC:
dmg = skill_db[skill_num].pc_damage;
break;
  case BL_MOB:
if(((TBL_MOB*)target)->status.mode&MD_BOSS)
 dmg = skill_db[skill_num].boss_damage;
else
 dmg = skill_db[skill_num].mob_damage;
break;
  default:
dmg = skill_db[skill_num].other_damage;
break;
 }
}
return dmg;
}

Look for this line.

  	 if( sd )
	{
		if (skill_num && (i = pc_skillatk_bonus(sd, skill_num)))
			ATK_ADDRATE(i);

add like this

if( sd )
  	 if( sd )
	{
		ATK_ADDRATE(battle_SAD(sd, target, skill_num));
		if (skill_num && (i = pc_skillatk_bonus(sd, skill_num)))
			ATK_ADDRATE(i);

Look for this line

 if(sd) {
  //Damage bonuses

Add this

 if(sd) {
					MATK_ADDRATE(battle_SAD(sd, target, skill_num));
  //Damage bonuses

Look for this line

if (sd && (i = pc_skillatk_bonus(sd, skill_num)))
 md.damage += md.damage*i/100;

Replace like this

if (sd)
{
 if(i = pc_skillatk_bonus(sd, skill_num))
  md.damage += md.damage*i/100;

 md.damage = md.damage += md.damage*battle_SAD(sd, target, skill_num)/100;
}

On skill.c src file

Find this line

/*==========================================
 * DB reading.
 * skill_db.txt

Add before

static bool skill_parse_row_skilldamage(char* split[], int columns, int current)
{
int i = atoi(split[0]);
i = skill_get_index(i);
if( !i ) // invalid skill id
 return false;

skill_db[i].flag  = atoi(split[1]);
skill_db[i].pc_damage  = atoi(split[2]);
skill_db[i].mob_damage  = atoi(split[3]);
skill_db[i].boss_damage  = atoi(split[4]);
skill_db[i].other_damage = atoi(split[5]);
return true;
}

Find this line

sv_readdb(db_path, "skill_changematerial_db.txt"

Add after

sv_readdb(db_path, "skill_damage_db.txt"	  , ',',   5,  6, MAX_SKILL_DB, skill_parse_row_skilldamage);

On skill.h src file

Find this line

 int unit_interval;
 int unit_target;
 int unit_flag;

Add after

int flag;
int pc_damage,mob_damage,other_damage,boss_damage;

Compile and you're done. Don't forget to create your db file. It should work perfectly on the latest revision.

So, are all these necessary for the mod to work on the current revision, or are these just your efficiency changes? I haven't had a chance to test it but I wanted to make sure before I changed everything because I keep getting revision errors and I'm trying to avoid as many as possible.

Posted

Hello Lilith,

I got this error when i patched my SVN.

Rejected patch hunks for 'battle.c' - TortoiseUDiff

--- src/map/battle.c

+++ src/map/battle.c

@@ -4319,8 +4355,13 @@

md.damage= (int)( (int64)md.damage * cardfix / 10000 );

}

- if (sd && (i = pc_skillatk_bonus(sd, skill_num)))

- md.damage += md.damage*i/100;

+ if (sd)

+ {

+ if(i = pc_skillatk_bonus(sd, skill_num))

+ md.damage += md.damage*i/100;

+

+ md.damage = md.damage += md.damage*battle_SAD(sd, target, skill_num)/100;

+ }

if(md.damage < 0)

md.damage = 0;

Posted (edited)

Version 1.1 its working fine in rev 17058.. i will test 2.0

note: apply patch this manually

Edited by Angel
Posted (edited)

This the patch for rev 17066 and its working.

I have only one doubt, where put (int64) in this part, i put there but maybe iam wrong.

md.damage = md.damage += (int64)md.damage*battle_SAD(sd, target, skill_id)/100;

I hope Lilith clarify the doubt.

Regards.

@ emong you were right tnks. fixed

Manage Skill Damage_2.0 r17066.patch

Edited by Angel
Posted

This the patch for rev 17066 and its working.

I have only one doubt, where put (int64) in this part, i put there but maybe iam wrong.

md.damage = md.damage += (int64)md.damage*battle_SAD(sd, target, skill_id)/100;

I hope Lilith clarify the doubt.

Regards.

did you not change this line?


static int battle_SAD(struct map_session_data *sd, struct block_list *target, int skill_num)
+{
+ int dmg = 0;
+ int flag = map[sd->bl.m].flag.restricted?8*map[sd->bl.m].zone:0;
+
+ if(skill_db[skill_num].flag&1 && !map_flag_vs(sd->bl.m) ||
+ skill_db[skill_num].flag&2 && map[sd->bl.m].flag.pvp ||
+ skill_db[skill_num].flag&4 && map_flag_gvg(sd->bl.m) ||
+ skill_db[skill_num].flag&8 && map[sd->bl.m].flag.battleground ||
+ map[sd->bl.m].flag.restricted && skill_db[skill_num].flag&flag)
+ {
+ 
+ switch(target->type)
+ {
+ case BL_PC:
+ dmg = skill_db[skill_num].pc_damage;
+ break;
+ case BL_MOB:
+ if(((TBL_MOB*)target)->status.mode&MD_BOSS)
+ dmg = skill_db[skill_num].boss_damage;
+ else
+ dmg = skill_db[skill_num].mob_damage;
+ break;
+ default:
+ dmg = skill_db[skill_num].other_damage;
+ break;
+ }
+ }
+ 
+ return dmg;
+}

Posted (edited)

Random only explain how to add the mod of Lilith manually, i don´t see any change made for he.

he only said that is redundant and advised that can be better in some part of the line:

map[sd->bl.m].flag.restricted && skill_db[skill_num].flag&(8*map[sd->bl.m].zone)

But the mod of lilith work fine.

Edited by Angel
Posted (edited)

From the previous update, isn't skill_num replaced by skill_id?

Yup, i changed skill_num for skill_id, its in the patch.

Edited by Angel
Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...