Jump to content

  •  

newbieppl

Member Since 01 Jul 2015
Offline Last Active Aug 05 2015 09:59 PM
-----

Topics I've Started

Black tiles with lightmap

04 August 2015 - 02:05 PM

I want help with this issue:

 

As shown in the picture, when I turn on /lightmap, there are a lot of black tiles on some maps.

Does anyone know how to remove these annoying tiles?

 

Attached File  20150804100502.jpg   255.48K   32 downloads

 

I am using the latest kro client + 20140205b


New Formula for Dragon Breath

22 July 2015 - 05:12 PM

As you may know, iRO implemented the new dragon breath formula, which is stated in the iro wiki as:

 

Damage = [(CurrHP ÷ 50) + (MaxSP ÷ 4)] × (SkillLv × BaseLv ÷ 150) × (95 + DragonTraining_Lv × 5)% × (100 + Ranged Damage Modifers)% x (Elemental Modifiers)% x (100 + Racial Modifiers)%

 

So I think the difference is the new formula takes these range, elemental and racial modifiers into account.

 

It seems this formula was recently implemented in rathena (BF_WEAPON TYPE), while hercules is still using the old formula (BF_MISC TYPE).

I have tried to merge rathena's new formula into Hercules, but encountered several problems.

 

The changes I have made in code are:

"/src/map/skill.c" ​, changed BF_MISC to BF_WEAPON


		/**		 * Rune Knight		 **/		case RK_DRAGONBREATH_WATER:		case RK_DRAGONBREATH:		{			struct status_change *tsc = NULL;			if( (tsc = status->get_sc(bl)) && (tsc->data[SC_HIDING] )) {				clif->skill_nodamage(src,src,skill_id,skill_lv,1);			} else				skill->attack(BF_WEAPON,src,src,bl,skill_id,skill_lv,tick,flag);		}

 

"/src/map/battle.c", delete the original formula in misc type, add the new formula in weapon type

old:

struct Damage battle_calc_misc_attack(struct block_list *src,struct block_list *target,uint16 skill_id,uint16 skill_lv,int mflag) {...	    case RK_DRAGONBREATH:	case RK_DRAGONBREATH_WATER:		md.damage = ((status_get_hp(src) / 50) + (status_get_max_sp(src) / 4)) * skill_lv;		RE_LVL_MDMOD(150);		if (sd) md.damage = md.damage * (95 + 5 * pc->checkskill(sd,RK_DRAGONTRAINING)) / 100;		md.flag |= BF_LONG|BF_WEAPON;		break;...}

new:

struct Damage battle_calc_weapon_attack(struct block_list *src,struct block_list *target,uint16 skill_id,uint16 skill_lv,int wflag){...			case RK_DRAGONBREATH:			case RK_DRAGONBREATH_WATER:			{				int damagevalue = (sstatus->hp / 50 + status_get_max_sp(src) / 4) * skill_lv;				if (status->get_lv(src) > 100)					damagevalue = damagevalue * status->get_lv(src) / 150;				if (sd)					damagevalue = damagevalue * (100 + 5 * (pc->checkskill(sd, RK_DRAGONTRAINING) - 1)) / 100;				ATK_ADD(damagevalue);				wd.flag |= BF_LONG;			}			break;...}

I have also changed the nk (skill type?) of dragonbreath in skill_db to 0x62, thus the skill ignores target's DEF and has no miss.

 

 

However, after these changes, the dragon breath seems neutral attack (in skill_db it is still set as fire, or water for the breath water), there is no elemental fix involved in the damage.

 

It would be greatly appreciated if someone could help me to add the elemental modifier, or pointed out where I have missed for merging this new formula.

 

 

 


question about __64BPRTSIZE

18 July 2015 - 05:47 AM

Hello guys,

I am trying to merge the "getunitdata" and "setunitdata" script commands to Hercules

 

I am pretty new, so encountered a lot of questions.

One of the most urgent is 

There is a pointer "__64BPRTSIZE" used in the rathena code

#define getunitdata_sub(idx__,var__) setd_sub(st,sd,name,(idx__),(void *)__64BPRTSIZE((int)(var__)),script_getref(st,3))

They have it defined in the const.h

#ifdef __64BIT__	#define __64BPRTSIZE(y) (intptr)y#else	#define __64BPRTSIZE(y) y#endif

But there is no such definition in Hercules.

So I am wandering what is the replacement of this pointer?

Any suggestions will be appreciated.

 



Figured it out

it's h64BPTRSIZE instead.


New item bonuses

17 July 2015 - 04:55 PM

When I tried  to implement the Sarah Card (itemid 4610)

I found there is no proper item bonus for that effect.

 

I have some development experience, but I am not very familiar with Hercules code.

Could some one point out which part of the code should I look into to add some new item bonus?

I am willing to share the work if I figured out how to implement it without any bugs.

 

Thank you!