Jump to content
  • 0

sanctuary heal on emperium on "1"


AinsLord

Question


  • Group:  Members
  • Topic Count:  257
  • Topics Per Day:  0.08
  • Content Count:  737
  • Reputation:   18
  • Joined:  11/21/15
  • Last Seen:  

i was trying to do some src edit for sanctuary heal on emp that can only be "1" but i got this kind of error

image.png.dbf23829809a998d704ddf9e23757b36.png

i tried the src edit i found here

case PR_SANCTUARY:
       hp = (skill_lv>6)?777:skill_lv*100;
       if (dstmd->class_ == MOBID_EMPERIUM)
            hp = 1;
       break;

thanks in advance

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 1

  • Group:  Members
  • Topic Count:  25
  • Topics Per Day:  0.01
  • Content Count:  283
  • Reputation:   76
  • Joined:  06/13/13
  • Last Seen:  

id is unit game id not mob id, the check is correct, if target is monster, then convert it to mob_data then check the target mob id if that monster is emperium. 

if(target->type == BL_MOB) {
	struct mob_data *md = BL_CAST(BL_MOB, target);
	if (md->mob_id == MOBID_EMPERIUM)
		hp = 1;
}

 

Edited by Litro Endemic
  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  31
  • Reputation:   2
  • Joined:  08/17/16
  • Last Seen:  

6 hours ago, AinsLord said:

i was trying to do some src edit for sanctuary heal on emp that can only be "1" but i got this kind of error

image.png.dbf23829809a998d704ddf9e23757b36.png

i tried the src edit i found here


case PR_SANCTUARY:
       hp = (skill_lv>6)?777:skill_lv*100;
       if (dstmd->class_ == MOBID_EMPERIUM)
            hp = 1;
       break;

thanks in advance

Shouldn't it be something like this?

case PR_SANCTUARY:
    hp = (skill_lv > 6) ? 777 : skill_lv * 100;
    if (target->id == MOBID_EMPERIUM) {
      hp = 1;
    }

At least in my case, the argument to the skill_calc_heal method describing the target of the skill is called literally target.

/**
 * Calculates heal value of skill's effect
 * @param src: Unit casting heal
 * @param target: Target of src
 * @param skill_id: Skill ID used
 * @param skill_lv: Skill Level used
 * @param heal: True if it's the heal part or false if it's the damage part of the skill
 * @return modified heal value
 */
int skill_calc_heal(struct block_list *src, struct block_list *target, uint16 skill_id, uint16 skill_lv, bool heal) {

 

EDIT: Actually I think this would be better and safer:

case PR_SANCTUARY:
    hp = (skill_lv > 6) ? 777 : skill_lv * 100;
    if (target->type == BL_MOB && target->id == MOBID_EMPERIUM) {
      hp = 1;
    }

I'm not 100% sure, but I think that it could be possible for another type of entity to have the same ID of the Emperium. So maybe checking the type of entity to ensure it's a monster is wise.

Edited by DorekoNeko
  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  257
  • Topics Per Day:  0.08
  • Content Count:  737
  • Reputation:   18
  • Joined:  11/21/15
  • Last Seen:  

On 7/6/2021 at 4:26 AM, DorekoNeko said:

...

thanks i ll try this one when i came back home

PS:  @DorekoNekoThis codes still heals 777

case PR_SANCTUARY:
    hp = (skill_lv > 6) ? 777 : skill_lv * 100;
    if (target->type == BL_MOB && target->id == MOBID_EMPERIUM) {
      hp = 1;
    }
case PR_SANCTUARY:
    hp = (skill_lv > 6) ? 777 : skill_lv * 100;
    if (target->id == MOBID_EMPERIUM) {
      hp = 1;
    }

i tried this code

case PR_SANCTUARY:
    hp = (skill_lv > 6) ? 777 : skill_lv * 100;
    if (target->type == BL_MOB && target->id == MOBID_EMPERIUM);
      hp = 1;
    break;
case PR_SANCTUARY:
    hp = (skill_lv > 6) ? 777 : skill_lv * 100;
    if (target->id == MOBID_EMPERIUM);
      hp = 1;
    break;

it heals 1 but it also heals 1 on players

 

 

yeyyyy thanks a lot it works

On 7/7/2021 at 4:05 PM, Litro Endemic said:

id is unit game id not mob id, the check is correct, if target is monster, then convert it to mob_data then check the target mob id if that monster is emperium. 

if(target->type == BL_MOB) {
	struct mob_data *md = BL_CAST(BL_MOB, target);
	if (md->mob_id == MOBID_EMPERIUM)
		hp = 1;
}

 

 

Edited by AinsLord
more infor
  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  31
  • Reputation:   2
  • Joined:  08/17/16
  • Last Seen:  

9 hours ago, AinsLord said:

yeyyyy thanks a lot it works

 

You welcome Ains Sama. Oh supereme being ~

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