Jump to content
  • 0

NPC_SELFDESTRUCTION source edit...


Question

Posted (edited)

I'm trying to edit the NPC_SELFDESTRUCTION skill to not hurt friendly players/mobs. However, I don't want to cause anymore unnessary errors since I don't currently have a test server going? Will just removing the BCT_ALL make it only affect the enemy or is there more to it? Should I just make the a NPC_SELFDESTRUCTION2 and modifty that?

case NPC_SELFDESTRUCTION:
 //Self Destruction hits everyone in range (allies+enemies)
 //Except for Summoned Marine spheres on non-versus maps, where it's just enemy.
 i = ((!md || md->special_state.ai == 2) && !map_flag_vs(src->m))?
  BCT_ENEMY:BCT_ALL;
 clif_skill_nodamage(src, src, skillid, -1, 1);
 map_delblock(src); //Required to prevent chain-self-destructions hitting back.
 map_foreachinrange(skill_area_sub, bl,
  skill_get_splash(skillid, skilllv), splash_target(src),
  src, skillid, skilllv, tick, flag|i,
  skill_castend_damage_id);
 map_addblock(src);
 status_damage(src, src, sstatus->max_hp,0,0,1);
 break;

Peopleperson49

Edited by peopleperson49

10 answers to this question

Recommended Posts

Posted

just make variable i to BCT_ENEMY or change every variable i to BCT_ENEMY..

however

Except for Summoned Marine spheres on non-versus maps, where it's just enemy.
will be default...
Posted (edited)

Does it really matter about the marine spheres? Since I am changing it to BCT_ENEMY only does it need that section for marine spheres?

Peopleperson49

Thanks Malufett that works good. I just replaced the i with BCT_ENEMY and recompiled. Before I was trying to remove the BCT_ALL from the 'BCT_ENEMY:BCT_ALL' and I would get an error. Again thanks.

Peopleperson49

Edited by peopleperson49
Posted

I can leave the normal skill alone so the marine spheres and stuff work fine. The skill is for my custom bomb porings anyway. That way I can modify it anyway I want. Besides its just copying the previous code and pasting it below with under SELFDESTRUCTION2. Then just update the skill_db and assicalated db files. Not a hard edit.

Peopleperson49

Posted

That sounds like a good idea, however, I have added custom skills. Adding that condition is new to me. I'm sure it is easier, but if I screw it up not knowing what I'm doing then I'm not really making any progress. Is there a guild to exactly what I need to put?

Peopleperson49

Posted

Just a side note :

map_delblock(src); //Required to prevent chain-self-destructions hitting back.

and

map_addblock(src);

seem like a hack for me, it would be better if we could use BCT_SELF for this; like

flag |= BCY_ALL; //ok we want to affect all

flag &= ~BCT_SELF; //except ourself

unfortunatly this doesn't work atm since battle_check_target doesn't handle properly BCT_SELF and if you add a simple check it will break some other mapforeach skill.

Still remove and add block it's ugly !

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.

  • Recently Browsing   0 members

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