SphereServer BugTracker - SphereServer
View Issue Details
0002507SphereServerexecutable - genericpublic05-05-15 12:4601-10-15 23:51
Rizz 
XuN 
normalmajoralways
resolvedfixed 
 
0.56c Nightly 
Automated (specify build number)
None
None
2262
0002507: Wall of stone spell doesn't trigger @effect
From r2056 to r2262 I discovered that something has changed on Wall of Stone Spell.
Now @effect doesn't work bcuz, when you cast the spell, sphere avoid to create the blocks on chars or items.

This is a problem bcuz in this way I cannot make any cheack on a hit players to flag the caster as criminal.

The only things I can do is make a check on @success uscing act but in this way you can just target the ground to avoid the criminal status.

Plus is not possible now to cast more than one wall of stone on the same position like it was on r2056 and sphere 51a.

I tried to set the spellflag_harm on the spell but then you will be flaged as a criminal even if you cast a wall in the middle of nothing.
No tags attached.
Issue History
05-05-15 12:46RizzNew Issue
09-05-15 09:50XuNNote Added: 0002795
19-05-15 21:29RizzNote Added: 0002802
19-05-15 22:40XuNNote Added: 0002803
20-05-15 12:47RizzNote Added: 0002804
20-05-15 12:47RizzNote Edited: 0002804bug_revision_view_page.php?bugnote_id=0002804#r863
20-05-15 12:48RizzNote Edited: 0002804bug_revision_view_page.php?bugnote_id=0002804#r864
20-05-15 13:33XuNNote Added: 0002806
01-10-15 23:51XuNStatusnew => resolved
01-10-15 23:51XuNFixed in Version => 0.56c Nightly
01-10-15 23:51XuNResolutionopen => fixed
01-10-15 23:51XuNAssigned To => XuN

Notes
(0002795)
XuN   
09-05-15 09:50   
I'll add some code related to this:

Added: Field spells will fire @Create for their itemdefs/events, also @ItemCreate for characters with a 'tag.BadLoc' which will be true if they are going to be placed above any character.
    If tag keeps at 1 after the @Create trigger the field will be removed like it's been doing recently.
    Since fields will not be placed until they are allowed to (to avoid 'ghost' walls dissapearing), items will have a 'tag.pos' with the placement position.

You can test it in tomorrow's nightly or downloading from my dropbox here: https://www.dropbox.com/s/k1aqepw37wytzn9/SphereSvr.exe?dl=0 [^]
(0002802)
Rizz   
19-05-15 21:29   
it works but only with tag.BadLoc i cannot check which char i am going to hit with the wall.

I tried this script

IF (<type>==t_spell) && (<tag0.BadLoc> == 1)
    
    LOCAL.murati=0
    
    FORCLIENTS 0
        LOCAL.murati +=1
    ENDFOR
    
    IF (<LOCAL.murati> > 0)
        src.criminal
    ENDIF
    
ENDIF


But i get

(sphere_item_building_walls.scp,545)Point(-1,-1): trying to get a sector for point on map #0 out of bounds for this map(7168,4096). Defaulting to sector 0 of the map.
(0002803)
XuN   
19-05-15 22:40   
Since fields will not be placed until they are allowed to (to avoid 'ghost' walls dissapearing), items will have a 'tag.pos' with the placement position.


That means that you cannot use it to do nothing related to position, because its not placed in the world yet.
(0002804)
Rizz   
20-05-15 12:47   
(edited on: 20-05-15 12:48)
Then i suggest you to add another tag such as tag.charuid that contains the uid of the char you are going to cast the wall of stone on to.

So i can set up something like:

IF (<type>==t_spell) && (<tag0.BadLoc> == 1)
    
    IF (<serv.uid.<tag.charuid>.isplayer>) && is blue && blablabla)

       src.criminal


    ENDIF
    
ENDIF

(0002806)
XuN   
20-05-15 13:33   
field flags, by default, has spellflag_targ_xyz .. which means targetted on the ground, if you want to enable it to be targeted at players you should retrieve any character in this location.

serv.newitem=i_gold
new.attr=08090
new.p=<tag.pos>
local.chars=<new.findchars 0>
new.remove
if (<local.chars>)
 src.criminal
endif

[function findchars]
forchars <dargn>// search in the given distsance
 return 1//if any character is found, return true
endfor