So I've been having some fun playing around with clif_specialeffect by adding it to skills, but I'm having trouble adding it to things like blastmine and other unit-based attacks. I can get it to cause an animation at my location when a unit goes off, and I can get it to trigger on an enemy's location when a unit goes off, but I can't get the effect to trigger at blastmine's location when the effect goes off. I'm adding another explosion effect that I want enemies to blast away from. The code I will show you below does not actually show a script that triggers anything, but it does show you that it accepts the unit's bl (which means it can find the unit's location). I can't &unit->bl to do this magical feature in clif_specialeffect in any other place on the code where it would matter to me (because I don't know how to add the proper code elsewhere).
To show that a unit's bl works in clif_specialeffect:
case UNT_BLASTMINE:
{
int bl_flag = sg->bl_flag;
if (tsc && tsc->data[SC__MANHOLE])
break;
map_foreachinrange(skill_trap_splash, &unit->bl, skill_get_splash(sg->skill_id, sg->skill_lv), bl_flag, &unit->bl, tick);
clif_specialeffect(&unit->bl, 730, AREA);
The place where I know that the clif_specialeffect has been triggering (I see the animation) is located in skill.cpp in the skill_castend_pos2 section:
case HT_BLASTMINE:
{
skill_unitsetting(src,skill_id,skill_lv,x,y,0);
clif_specialeffect(src, 730, AREA); //This one triggers when I lay the trap, but in this case triggers on me.
break;
}
So I guess my question would be how do I add the unit bl so that it works in the skill_castend_pos2 section like it does in the skill_unit_onplace_timer section of the same file (skill.cpp)? And if that doesn't work, how can I get a special effect to happen at the unit's location or a targeted location?
Question
Humble_Bee
So I've been having some fun playing around with clif_specialeffect by adding it to skills, but I'm having trouble adding it to things like blastmine and other unit-based attacks. I can get it to cause an animation at my location when a unit goes off, and I can get it to trigger on an enemy's location when a unit goes off, but I can't get the effect to trigger at blastmine's location when the effect goes off. I'm adding another explosion effect that I want enemies to blast away from. The code I will show you below does not actually show a script that triggers anything, but it does show you that it accepts the unit's bl (which means it can find the unit's location). I can't &unit->bl to do this magical feature in clif_specialeffect in any other place on the code where it would matter to me (because I don't know how to add the proper code elsewhere).
To show that a unit's bl works in clif_specialeffect:
The place where I know that the clif_specialeffect has been triggering (I see the animation) is located in skill.cpp in the skill_castend_pos2 section:
case HT_BLASTMINE: { skill_unitsetting(src,skill_id,skill_lv,x,y,0); clif_specialeffect(src, 730, AREA); //This one triggers when I lay the trap, but in this case triggers on me. break; }
So I guess my question would be how do I add the unit bl so that it works in the skill_castend_pos2 section like it does in the skill_unit_onplace_timer section of the same file (skill.cpp)? And if that doesn't work, how can I get a special effect to happen at the unit's location or a targeted location?
Link to comment
Share on other sites
0 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.