Sphereserver / Source-X

Ultima Online server emulator
Apache License 2.0
57 stars 45 forks source link

Block spelleffect on ridden chars and other fixes #1220

Closed DavideRei closed 5 months ago

DavideRei commented 6 months ago

If you place multiple fire field spell on the ground, go over it while riding an horse and .serv.save @spelleffect is triggered on the horse. To solve this problem i blocked spelleffect and gethit blocked on ridden chars. Don't know why during saves ridden chars could be affected but i think that while ridden they shouldn't be get hitted by spell or damage. Fix duration of hallucination spell. Fix wrong layer for potion delay

Tolokio commented 6 months ago

The mount fix should be done by script while we find whats going on. In my case I need to be able to damage mounts.

DavideRei commented 6 months ago

The problem is that the offline mount is teleported on the p of the owner when you save. I don't understand why an offline mount should take damage, especially from magic fields. I mean, if your offline mount is on the other side of the map and another player put fire fields over it, should the mount take damage? I think is nonsense @Tolokio can i ask why do you need mount damage? for DOT?

Jhobean commented 6 months ago

ON 55i mounted mount was teleported to 1,1 Now on X, mount follow you but on save I think they are place directly on you that why save create this bug.

Jhobean commented 6 months ago

The mount fix should be done by script while we find whats going on. In my case I need to be able to damage mounts.

Do you have a script fix to propose? We could add it to script pack. We could add it on e_horses

Nefrelius suggest that:


On=@SpellEffect
if (<flags>&statf_ridden)// || !(<isonline>) <<-- it's optional
return 1
Endif```
DavideRei commented 6 months ago

We could block spelleffect on ridden char if the spell has spellflag_field or spellflag_area

Jhobean commented 6 months ago

We could block spelleffect on ridden char if the spell has spellflag_field or spellflag_area

This option seem interesting. That mean if pet is poisoned, it will take damage.

xwerswoodx commented 6 months ago

Honestly I am not sure about blocking every hit while Horse is riding, because if it's poisoned, it has to get damage from the poison until die or poison removed, but I agree about field, we may found better solutions for it because I think any ticking damage like poison shouldn't be blocked when player ride the mount.

DavideRei commented 6 months ago

I removed the block on getHit for ridden chars and blocked the spelleffect on ridden chars only for spells with SPELLFLAG_FIELD or SPELLFLAG_AREA. Also i changed NpcActFollow to take the fight target only if the npc is in combat, maybe is related to #1215

I don't why github put in the pull request old commits

Jhobean commented 6 months ago

I think you roolback some PR 🤣 you should merge master ti your branch or redo your PR from a clean branch