Jump to content
  • 0

Damage ghost element


tecno

Question


  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  10
  • Reputation:   0
  • Joined:  07/14/13
  • Last Seen:  

I would like to increase the damage the skill Acid Demonstration on ghost property (Ghostring card), I'm using the script:  bonus2 bAddEle,Ele_Ghost,30; but is not altered. How should I do to work?

Link to comment
Share on other sites

7 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  94
  • Reputation:   0
  • Joined:  11/26/11
  • Last Seen:  

are you referring to custom items or skill edit ?

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  57
  • Reputation:   16
  • Joined:  09/26/16
  • Last Seen:  

battle_attr_fix (map/battle.c)

struct map_session_data *sd;
..
//after damage calc
..
if( battle_getcurrentskill(src) == CR_ACIDDEMONSTRATION && def_type == ELE_GHOST )
{
    damage += damage * ( sd->right_weapon.addele[ELE_GHOST ] / 100 );
}

quick and dirty solution, havent tested yet, but the idea is already there

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  162
  • Topics Per Day:  0.04
  • Content Count:  740
  • Reputation:   47
  • Joined:  03/12/14
  • Last Seen:  

battle_attr_fix (map/battle.c)

struct map_session_data *sd;
..
//after damage calc
..
if( battle_getcurrentskill(src) == CR_ACIDDEMONSTRATION && def_type == ELE_GHOST )
{
    damage += damage * ( sd->right_weapon.addele[ELE_GHOST ] / 100 );
}
quick and dirty solution, havent tested yet, but the idea is already there
what about when creator Linker can bypass GHOST Elemental ?

sample the paladin using Ghostring Card ACid Demo Dmg only 3k+

if creator Linked Acid Demo can bypass the gr card

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  57
  • Reputation:   16
  • Joined:  09/26/16
  • Last Seen:  

 

battle_attr_fix (map/battle.c)

struct map_session_data *sd;
..
//after damage calc
..
if( battle_getcurrentskill(src) == CR_ACIDDEMONSTRATION && def_type == ELE_GHOST )
{
    damage += damage * ( sd->right_weapon.addele[ELE_GHOST ] / 100 );
}
quick and dirty solution, havent tested yet, but the idea is already there
what about when creator Linker can bypass GHOST Elemental ?

sample the paladin using Ghostring Card ACid Demo Dmg only 3k+

if creator Linked Acid Demo can bypass the gr card

 

before damage calc

if( sd->sc.data[SC_SPIRIT] && sd->sc.data[SC_SPIRIT]->val2 == SL_ALCHEMIST && def_type == ELE_GHOST )
    ratio = 100;

not yet tested

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  162
  • Topics Per Day:  0.04
  • Content Count:  740
  • Reputation:   47
  • Joined:  03/12/14
  • Last Seen:  

 

 

battle_attr_fix (map/battle.c)

struct map_session_data *sd;
..
//after damage calc
..
if( battle_getcurrentskill(src) == CR_ACIDDEMONSTRATION && def_type == ELE_GHOST )
{
    damage += damage * ( sd->right_weapon.addele[ELE_GHOST ] / 100 );
}
quick and dirty solution, havent tested yet, but the idea is already there
what about when creator Linker can bypass GHOST Elemental ?

sample the paladin using Ghostring Card ACid Demo Dmg only 3k+

if creator Linked Acid Demo can bypass the gr card

 

before damage calc

if( sd->sc.data[SC_SPIRIT] && sd->sc.data[SC_SPIRIT]->val2 == SL_ALCHEMIST && def_type == ELE_GHOST )
    ratio = 100;

not yet tested

 

can you post it full what line i need to paste that code

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  57
  • Reputation:   16
  • Joined:  09/26/16
  • Last Seen:  

src/map/battle.c
along wih thte lines

int64 battle_attr_fix

paste the code before:

#ifdef RENEWAL
	//In renewal, reductions are always rounded down so damage can never reach 0 unless ratio is 0
	damage = damage - (int64)((damage * (100 - ratio)) / 100);
#else
	damage = (int64)((damage*ratio)/100);
#endif

and also, the 'code' i made is just to give you an "idea" how to make it work, if it doesn't work, then you have to fix it on your own.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  162
  • Topics Per Day:  0.04
  • Content Count:  740
  • Reputation:   47
  • Joined:  03/12/14
  • Last Seen:  

src/map/battle.c

along wih thte lines

int64 battle_attr_fix

paste the code before:

#ifdef RENEWAL
	//In renewal, reductions are always rounded down so damage can never reach 0 unless ratio is 0
	damage = damage - (int64)((damage * (100 - ratio)) / 100);
#else
	damage = (int64)((damage*ratio)/100);
#endif

and also, the 'code' i made is just to give you an "idea" how to make it work, if it doesn't work, then you have to fix it on your own.

 

this code?

int64 battle_attr_fix(struct block_list *src, struct block_list *target, int64 damage,int atk_elem,int def_type, int def_lv)
{
	struct status_change *sc = NULL, *tsc = NULL;
	int ratio;

	if (src) sc = status_get_sc(src);
	if (target) tsc = status_get_sc(target);

	if (!CHK_ELEMENT(atk_elem))
		atk_elem = rnd()%ELE_ALL;

	if (!CHK_ELEMENT(def_type) || !CHK_ELEMENT_LEVEL(def_lv)) {
		ShowError("battle_attr_fix: unknown attribute type: atk=%d def_type=%d def_lv=%d\n",atk_elem,def_type,def_lv);
		return damage;
	}

	ratio = attr_fix_table[def_lv-1][atk_elem][def_type];
	if (sc && sc->count) { //increase dmg by src status
		switch(atk_elem){
			case ELE_FIRE:
				if (sc->data[SC_VOLCANO])
					ratio += sc->data[SC_VOLCANO]->val3;
				break;
			case ELE_WIND:
				if (sc->data[SC_VIOLENTGALE])
					ratio += sc->data[SC_VIOLENTGALE]->val3;
				break;
			case ELE_WATER:
				if (sc->data[SC_DELUGE])
					ratio += sc->data[SC_DELUGE]->val3;
				break;
			case ELE_GHOST:
				if (sc->data[SC_TELEKINESIS_INTENSE])
					ratio += sc->data[SC_TELEKINESIS_INTENSE]->val3;
				break;
		}
	}

	if( target && target->type == BL_SKILL ) {
		if( atk_elem == ELE_FIRE && battle_getcurrentskill(target) == GN_WALLOFTHORN ) {
			struct skill_unit *su = (struct skill_unit*)target;
			struct skill_unit_group *sg;
			struct block_list *src2;

			if( !su || !su->alive || (sg = su->group) == NULL || !sg || sg->val3 == -1 ||
			   (src2 = map_id2bl(sg->src_id)) == NULL || status_isdead(src2) )
				return 0;

			if( sg->unit_id != UNT_FIREWALL ) {
				int x,y;
				x = sg->val3 >> 16;
				y = sg->val3 & 0xffff;
				skill_unitsetting(src2,su->group->skill_id,su->group->skill_lv,x,y,1);
				sg->val3 = -1;
				sg->limit = DIFF_TICK(gettick(),sg->tick)+300;
			}
		}
	}

	if (tsc && tsc->count) { //increase dmg by target status
		switch(atk_elem) {
			case ELE_FIRE:
				if (tsc->data[SC_SPIDERWEB]) {
					tsc->data[SC_SPIDERWEB]->val1 = 0; // free to move now
					if (tsc->data[SC_SPIDERWEB]->val2-- > 0)
						ratio += 100; // double damage
					if (tsc->data[SC_SPIDERWEB]->val2 == 0)
						status_change_end(target, SC_SPIDERWEB, INVALID_TIMER);
				}
				if (tsc->data[SC_THORNSTRAP])
					status_change_end(target, SC_THORNSTRAP, INVALID_TIMER);
				if (tsc->data[SC_CRYSTALIZE] && target->type != BL_MOB)
					status_change_end(target, SC_CRYSTALIZE, INVALID_TIMER);
				if (tsc->data[SC_EARTH_INSIGNIA])
					ratio += 50;
				if (tsc->data[SC_ASH])
					ratio += 50;
				break;
			case ELE_HOLY:
				if (tsc->data[SC_ORATIO])
					ratio += tsc->data[SC_ORATIO]->val1 * 2;
				break;
			case ELE_POISON:
				if (tsc->data[SC_VENOMIMPRESS])
					ratio += tsc->data[SC_VENOMIMPRESS]->val2;
				break;
			case ELE_WIND:
				if (tsc->data[SC_CRYSTALIZE] && target->type != BL_MOB)
					ratio += 50;
				if (tsc->data[SC_WATER_INSIGNIA])
					ratio += 50;
				break;
			case ELE_WATER:
				if (tsc->data[SC_FIRE_INSIGNIA])
					ratio += 50;
				break;
			case ELE_EARTH:
				if (tsc->data[SC_WIND_INSIGNIA])
					ratio += 50;
				status_change_end(target, SC_MAGNETICFIELD, INVALID_TIMER); //freed if received earth dmg
				break;
			case ELE_NEUTRAL:
				if (tsc->data[SC_ANTI_M_BLAST])
					ratio += tsc->data[SC_ANTI_M_BLAST]->val2;
				break;
		}
	}

	if (ratio < 100)
		damage = damage - (damage * (100 - ratio) / 100);
	else
		damage = damage + (damage * (ratio - 100) / 100);

	return i64max(damage,0);
}
Link to comment
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.   Paste as plain text instead

  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.

×
×
  • Create New...