Magic spells are passing through sentinels (Citizens)
Blamo27 opened this issue · 16 comments
Hello,
It seems that sentinels are not considered as valid entities able to
take damages by your plugin.
All information about the issue are available by clicking this link :
mcmonkeyprojects/Sentinel#242
Magic version : 6.9.20
Can you check that ?
Thanks.
Not getting a whole lot of help over there, so I’d suggest you just make NPCs targetable. Add this to your spells.yml:
default:
parameters:
target_npc: true
I take that back, he turned out to be extremely helpful!
You can hold off on adding target_npc if you want, I'll improve my Citizens integration.
@NathanWolf sorry to bump this, but there are actually still a few important issues with citizens/sentinel integration :
With the "target_npc" option set to true, the spell does affect sentinels... But normal citizens as well ! As a result, spells like "push", "pull" or spells that moves the target in general allow the player to move a static NPC from one place to another... They can push the citizens out of a town, for instance.
Also, a player can farm SkillPoints by spamming spells on a static, invincible, NPC.
An ideal solution would be for the spells to only work on sentinels, and to only reward SPs when they hit a Sentinel. But that's not all : some sentinels are allies of the player, who should therefore not be able to harm them. With spells that becomes entirely possible : the player just as to poison the friendly sentinel or set it on fire with a spell.
Which is why we can't simply disallow NPC targetting for the spells like push etc, because there would still be that issue.
To sum it up, it would be perfect if it were possible to only use spells on non-friendly, Sentinel-only, NPCs.
If that's possible, that would be great !
The latest dev build fixes most of these problems- and as a bonus, you also now have the option of creating Sentinels that can cast spells.
I do not have support in place for recognizing "friendly" sentinels, if there is an API method to do that I can look into it, though.
Really ? I didn't see it, that's very nice ! We'll try that as soon as possible.
As for the friendly sentinels, okay, we will try to find a way to protect them as much as we can in the mean time (if you can have a look sometime).
Yup! Unfortunately though I thought I had fixed this a while ago, I had not. I recently installed Sentinel and used it for the first time, and realized I still couldn't target them.
Spellcasting works by applying a magic mob template to the Sentinel, so you could make him cast spells on an interval, on death, or a few other triggers.
I will see what I can do about the friendly ones, but I'm not really familiar with Sentinel, I'd prefer not to build directly against it, but maybe there's a Citizens API that'll get me there.
Unfortunately this is not part of the Citizens NPC API.
I don't have any plans to build directly against Sentinel any time soon- I will rename and leave this issue open until I either do it or decide for sure that I am not going to do it. In the meantime I think you will have to work around it, sorry!
Also keep in mind that a player will always be able to hurt their sentinel if they try hard enough. Lighting them on fire, like you mentioned, for instance- there's no way to prevent that, the player is lighting a block on fire, the block is lighting the NPC on fire. Same with something like using Blob to suffocate them, any sort of indirect damage is impossible to prevent.
We did a bit of testing and can confirm that you can still gain SpellPoints by firing spells like magic missiles at standard NPCs, thus allowing players to farm skillpoints on static NPCs.
Oh okay I didn't understand that we could disable this and still be able to hit sentinels !
Yes indeed we don't win SPs anymore when casting spells on static NPCs.
The main issue regarding this is now that we can still target friendly sentinels to win SPs, so we'll wait on some developpment on Sentinel's side I guess ?
I did open a separate issue to track that, referenced above, but it’s on me to implement, not Sentinels. I don’t expect I’ll get to it anytime soon though, so unfortunately you will have to plan to work around it in the meantime. Tell players to aim carefully I guess? 😄
Yes I saw, however the issue is not exactly as you see it ! On our server, friendly sentinels can't be hit by players (it's a config option from Sentinel : sentinels who ignore the player can't be hit by the player). That means that players can spam spells on town guards for instance, which will not receive any damage, but the player will still gain the SPs.
I don't think of a way we could really work around this unfortunately, so we'll just have to say it's forbidden and hope they do not exploit it too much...!