Jump to content
  • 0

NPC_SELFDESTRUCTION source edit...


Peopleperson49

Question


  • Group:  Members
  • Topic Count:  218
  • Topics Per Day:  0.05
  • Content Count:  1180
  • Reputation:   141
  • Joined:  01/27/12
  • Last Seen:  

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
Link to comment
Share on other sites

10 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  554
  • Reputation:   70
  • Joined:  04/04/12
  • Last Seen:  

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...
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  218
  • Topics Per Day:  0.05
  • Content Count:  1180
  • Reputation:   141
  • Joined:  01/27/12
  • Last Seen:  

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
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  554
  • Reputation:   70
  • Joined:  04/04/12
  • Last Seen:  

when you summon Marine Spheres via skill its skill won't hit master/friends in non PVP maps...because by default it hits all target in sight....

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  218
  • Topics Per Day:  0.05
  • Content Count:  1180
  • Reputation:   141
  • Joined:  01/27/12
  • Last Seen:  

ic so should I just make a NPC_SELFDESTRUCTION2?

Peopleperson49

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  554
  • Reputation:   70
  • Joined:  04/04/12
  • Last Seen:  

Why make another skill??

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  218
  • Topics Per Day:  0.05
  • Content Count:  1180
  • Reputation:   141
  • Joined:  01/27/12
  • Last Seen:  

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

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  554
  • Reputation:   70
  • Joined:  04/04/12
  • Last Seen:  

actually it is more easy if you use "md->class_" as your condition to check it the mob is Bomb Poring...

so less work.... /no1

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  218
  • Topics Per Day:  0.05
  • Content Count:  1180
  • Reputation:   141
  • Joined:  01/27/12
  • Last Seen:  

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

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  16
  • Topics Per Day:  0.00
  • Content Count:  737
  • Reputation:   216
  • Joined:  11/29/11
  • Last Seen:  

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 !

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  218
  • Topics Per Day:  0.05
  • Content Count:  1180
  • Reputation:   141
  • Joined:  01/27/12
  • Last Seen:  

I just left the original skill and make it only target enemys. Thanks for the help.

Peopleperson49

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