Jump to content

Magekiller


Lazarus.

Recommended Posts

I was planning on writing a script where an enemy would target whatever pc had the most priest skill, and put anti-magic clouds on that pc. Obviously this would eliminate the party's ability to heal.....

 

The framework for this script would be magekiller (by *i and edited by Kel). None of the three versions of this script that I have tested worked quite how I hoped. Namely; whenever a warrior gets close to the monster, it starts focusing on the melee fighters, not the casters. Since this monster will be shooting anti-magic clouds, this would pretty much ruin its effectiveness.

 

So this is my question, is there a way to stop my script from changing targets? Also, is there a call like get_target_location to find the target's (x,y) coordinates?

Link to comment
Share on other sites

You can use char_loc_x(get_target()) and char_loc_y(get_target())

to find out the x and y coordinates of the target. I would recommend that you just have it check its target just before shooting fields to make sure that it is really aiming at a magic user. I have myself encountered some weird targeting difficulties, such as creatures temporarily targeting themselves. You can get around this kind of problem pretty well by storing the target in a variable of your own and making sure that the creature continues targeting the same target by using set_target to reset the target to your stored value.

Link to comment
Share on other sites

Those are Walker White's modifications, by the way. I was just the one who posted the scripts on the Codex, because WW was gone by that point.

 

I'm guessing that the reason that the monster is changing targets is the who_hit_me part of the targeting state. Find this code in the script and delete it:

 

Code:
 // Have I been hit by nearby living creature? Strike back!        if (who_hit_me() >= 0) {                if (dist_to_char(who_hit_me()) <= 2 &&                        char_ok(who_hit_me()) == TRUE) {                                set_target(ME,who_hit_me());                                set_state_continue(3);                }        } 
Link to comment
Share on other sites

I had already tried taking out the who_hit_me part of the script, but I tried again and it still isn't working. The weird thing is that my pc isn't even attacking the monster, I just march him next to the monster and stand there.

 

I've used several different archer, ray, and breath type monsters, all of them decide to stop attacking the mage, and attack the melee fighter. They never refocus their attack back on the mage, which is pretty much the entire purpose of the edits in magekiller2.

 

Evidently the editor is just being, as *i said, fickle. I'll probably just take Niemand's solution and make a variable with the correct targets number in it. Don't be surprised if I have more questions on this script.

Link to comment
Share on other sites

So you want them to completely disregard any pummeling and only focus on the magic users? Maybe you already explained this, but I am guessing that your monster will have a nice ranged attack so that it can kill the magic users while they are in the antimagic cloud. But your wording seems to suggest that its only purpose is to create these clouds.

 

If the latter case is true, then it is completely fine to have the monster have separate targets; one for antimagic clouds and one for normal attacking. If the former is true, have you tried setting its strategy to 11?

Link to comment
Share on other sites

The point is that when melee targets got close to it, it forgot all about its antimagic cloud attack.

 

This problem has been pretty much cleared up. I'm now using Kel's fieldshooter script (I think thats what it's called, I'm not on my normal computer.) The script uses variables to save targets like Niemand suggested, and with a few small changes it does what I want. Now I just have to get around to doing dialog for my scenario, I've been avoiding it.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...