Originally Posted by
Soulance
Eh, it 'kinda' works here and there but I think you're right about it just being a timing thing. By the time it's doing what it is supposed to do the person is already out of the stun. Seems like it would start to prepare the spell, then miscast, then prepare it again, miscast. I'll have to go back and test a little more again because I stopped using it. It was nice for bandits though.
Hmm, try reducing the pause and see if that works. If not I can look at the code again.
Originally Posted by
Iovan
I'm guessing the way this script is written, that the first npc that it finds that is on the list at all will become the target. Is a smart targeting setup outside the scope of this tutorial? I'm thinking that a better way would be to make a loop that will check all npcs for the first item on the list before checking for the second.
Code:
target_names = [ "rolton", "squirrel", "kobold", "orc" ]
$my_target = nil
target_names.each{ |i|
$my_target = GameObj.npcs.find{ |npc| npc.name =~ /#{i}/ && npc.type =~ /aggressive/ && npc.status !~ /dead/ }
break if $my_target
}
Originally Posted by
Soulance
Something to possibly tack on to this if you're not already saying it, but something I always thought would be good for ;bigshot would be the ability to make an order you want things killed. It seems pretty random, but let's say you're fighting the Shan in Sol and want to take out those Rangers first that always spike you in the head...
Yup, the above code would do that. Just list the critters in the order you want to kill them.
Of course this is just when you first run the script it will find and kill the first thing listed, if you start the script then a more dangerous critter enters the room while you're killing your current target and you would rather kill the new more dangerous critter before you finish killing your current target then that would require some additional coding.