SphereCommunity
Checking for Loss of Sight - Printable Version

+- SphereCommunity (https://forum.spherecommunity.net)
+-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d)
+--- Forum: Script Help (/Forum-Script-Help)
+--- Thread: Checking for Loss of Sight (/Thread-Checking-for-Loss-of-Sight)



Checking for Loss of Sight - mlyon83 - 06-25-2013 08:57 AM

How would you reference loss of sight to be checked in a later event that wouldn't use <CANSEE>?


RE: Checking for Loss of Sight - RanXerox - 06-25-2013 10:23 AM

Need a better (more specific) use case of what you are trying to achive...


RE: Checking for Loss of Sight - mlyon83 - 06-25-2013 01:04 PM

Code:
[FUNCTION castfs]
IF !(<RESTEST 1 i_scroll_flamestrike>)
    SYSMESSAGE @00 You have no flamestrike scroll to use that command.
ELSEIF (<SRC.MAGERY> < 70.0)
    SYSMESSAGE @00 You have insufficient Magery to use that command.
ELSEIF (<SRC.INSCRIPTION> < 70.0)
    SYSMESSAGE 200 You have insufficient Inscription to use that command.
ELSEIF (<MANA> < 20)
    SYSMESSAGE @00 You have insufficiant mana to use that command.
ELSE
    NEWITEM=i_player_cmd_castfs_memory
    ACT.EQUIP
    ACT.TARGET="Select target to cast flamestrike scroll."
ENDIF

[ITEMDEF i_player_cmd_castfs_memory]
ID=i_memory
TYPE=t_eq_script
LAYER=layer_special
NAME="Player Cmd Castfs Memory"

ON=@Equip
LINK=<UID>

ON=@Targon_Char
IF !(<LINK.TARG.CANSEE>)
    LINK.SYSMESSAGE @00 You cannot see your target.
ELSE
    CONT.SAY="Kal Vas Flam"
    SERV.NEWITEM=i_player_cmd_castfs_memory_dmg
    LINK.TARG.ACT.EQUIP
    VAR.CASTFS_UID=<LINK.TARG.UID>
ENDIF
REMOVE
RETURN 1

ON=@Targon_Item
LINK.SYSMESSAGE @00 You cannot target that item.
REMOVE
RETURN 1

ON=@Targon_Ground
LINK.SYSMESSAGE @00 You cannot target the ground.
REMOVE
RETURN 1

[ITEMDEf i_player_cmd_castfs_memory_dmg]
ID=i_memory
TYPE=t_eq_script
LAYER=layer_special
NAME="player Cmd Castfs Memory Dmg"

ON=@Equip
LINK=<VAR.CASTFS_UID>
TIMER=4

ON=@Timer
//CHECK TO SEE IF TARGET IS WITHIN LINE OF SIGHT BEFORE SPELL SETS OFF
LINK.SPELLEFFECT=s_flamestrike,{40 45},1,<LINK.UID>
REMOVE
RETURN 1



RE: Checking for Loss of Sight - Alaric - 06-27-2013 08:31 AM

I would use canseelos, not cansee. (if its just casting KVF)


RE: Checking for Loss of Sight - danielmuller - 01-11-2017 09:07 PM

(06-25-2013 01:04 PM)mlyon83 Wrote:  
Code:
[FUNCTION castfs]
IF !(<RESTEST 1 i_scroll_flamestrike>)
    SYSMESSAGE @00 You have no flamestrike scroll to use that command.
ELSEIF (<SRC.MAGERY> < 70.0)
    SYSMESSAGE @00 You have insufficient Magery to use that command.
ELSEIF (<SRC.INSCRIPTION> < 70.0)
    SYSMESSAGE 200 You have insufficient Inscription to use that command.
ELSEIF (<MANA> < 20)
    SYSMESSAGE @00 You have insufficiant mana to use that command.
ELSE
    NEWITEM=i_player_cmd_castfs_memory
    ACT.EQUIP
    ACT.TARGET="Select target to cast flamestrike scroll."
ENDIF

[ITEMDEF i_player_cmd_castfs_memory]
ID=i_memory
TYPE=t_eq_script
LAYER=layer_special
NAME="Player Cmd Castfs Memory"

ON=@Equip
LINK=<UID>

ON=@Targon_Char
IF !(<LINK.TARG.CANSEE>)
    LINK.SYSMESSAGE @00 You cannot see your target.
ELSE
    CONT.SAY="Kal Vas Flam"
    SERV.NEWITEM=i_player_cmd_castfs_memory_dmg
    LINK.TARG.ACT.EQUIP
    VAR.CASTFS_UID=<LINK.TARG.UID>
ENDIF
REMOVE
RETURN 1

ON=@Targon_Item
LINK.SYSMESSAGE @00 You cannot target that item.
REMOVE
RETURN 1

ON=@Targon_Ground
LINK.SYSMESSAGE @00 You cannot target the ground.
REMOVE
RETURN 1

[ITEMDEf i_player_cmd_castfs_memory_dmg]
ID=i_memory
TYPE=t_eq_script
LAYER=layer_special
NAME="player Cmd Castfs Memory Dmg"

ON=@Equip
LINK=<VAR.CASTFS_UID>
TIMER=4

ON=@Timer
//CHECK TO SEE IF TARGET IS WITHIN LINE OF SIGHT BEFORE SPELL SETS OFF
LINK.SPELLEFFECT=s_flamestrike,{40 45},1,<LINK.UID>
REMOVE
RETURN 1

Hail my friends... the script of flame strike scroll:

[ITEMDEF 01f5f]
DEFNAME=i_scroll_flamestrike
RESOURCES=i_scroll_blank, i_reag_spider_silk, i_reag_sulfur_ash
SKILLMAKE=INSCRIPTION 70.0, MAGERY 60.0
TYPE=T_SCROLL
WEIGHT=1
//CIRCLE=7
CATEGORY=Provisions - Alchemy & Magic
SUBSECTION=Scrolls - 7th Circle
DESCRIPTION=Flame Strike Scroll

ON=@Create
ATTR=ATTR_MAGIC
MOREX=s_flamestrike
MOREY=70 //{70 90}

ON=@DCLICK
ATTR=ATTR_MAGIC
IF (<SRC.MANA> < 35)
SRC.SYSMESSAGE Not mana for this spell! //CheckMana
Return 1
ELSE
SRC.CASTFS
Return 1
ENDIF

[FUNCTION CASTFS]
SERV.NEWITEM=i_fs_scroll
NEW.MORE1=51
NEW.EQUIP

[ITEMDEF i_fs_Scroll]
NAME=Delay Scroll FS
ID=i_handr_1
TYPE=T_EQ_SCRIPT
WEIGHT=0
LAYER=layer_special

ON=@CREATE
ATTR=002

ON=@EQUIP
TARGET=Select the target?
Return 1

ON=@TARGON_CHAR
if !( <SRC.TARG.CanSeeLos> )
SRC.ACTION=-1
SRC.sysmessage Target is not in line of sight <src.targ.name>.
return 1
ELSEIF (<MORE1>==51)
SRC.ACTION=-1
SRC.SAY @81 Kal Vas Flam [Scroll]
LINK=<SRC.TARG.SERIAL>
SRC.ANIM 10
TIMER=2
SRC.MANA=(<SRC.MANA>-35)
SRC.CHECKMANASPELL
src.consume=i_scroll_flamestrike
Return 1
ENDIF

ON=@UNEQUIP
if !( <SRC.TARG.CanSeeLos> )
MESSAGE Target is not in line of sight
ELSEIF (<MORE1>==51)
LINK.HITS=(<LINK.HITS>-22} /// CONTROL DE EFFECT SCROLL
LINK.SPELLEFFECT=s_harm 1.0 //DAMAGE
LINK.EFFECT 3,i_fire_column,6,15,1 //EFFECT
ENDIF

ON=@TIMER
REMOVE


Its work.. but you set the @START on spell Flamestrike to restest the i_fs_scroll on ACTION=-1

Bye fellows... =]


RE: Checking for Loss of Sight - Coruja - 01-12-2017 02:06 AM

maybe you're looking for CANSEELOS

it works exactly in the same way of CANSEE, but CANSEE only check distance and CANSEELOS check distance, Z, objects blocking the line of sight, etc