SphereCommunity
Hello can i have some spell script? - Printable Version

+- SphereCommunity (https://forum.spherecommunity.net)
+-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d)
+--- Forum: Script Requests (/Forum-Script-Requests)
+--- Thread: Hello can i have some spell script? (/Thread-Hello-can-i-have-some-spell-script)



Hello can i have some spell script? - Mimosa - 08-12-2018 11:37 PM

Hello, how are you guys?
I like to have some script that you click in your tammed monster and apears for you a target. When you set the target your monster will attack this target with a fireball.
I'm trying to make something like this, but is not working.

PHP Code:
ON=@CLICK
    
IF(<OBODY>==statf_pet)
    
        
         
SRC.SPELL S_FIREBALL
        TARGET     Who you wants to attack
?
            
    ENDIF        
    RETURN 




RE: Hello can i have some spell script? - Coruja - 08-13-2018 11:21 AM

SPELL function doesn't exist, probably you're looking for NPCCAST function

so you must use an target with callback function and then call NPCCAST

Code:
[EVENTS e_npc_cast]   //add this event on the NPC, or copy the @DClick trigger directly into chardef
ON=@DClick
IF (<ISMYPET>)
  SRC.CTAG.NPCCast.Src=<UID>
  SRC.TARGETF f_npc_cast_callback Who you wants to attack?
  return 1
ENDIF

[FUNCTION f_npc_cast_callback]
IF (<ARGO.ISCHAR>)
  REF1=<CTAG0.NPCCast.Src>
  IF (<REF1.ISMYPET>)
    REF1.NPCCAST <DEF0.s_fireball>,<ARGO>
  ENDIF
ENDIF
CTAG.NPCCast.Src=



RE: Hello can i have some spell script? - Mimosa - 08-14-2018 06:19 AM

Thanks Coruja. But is not working properly.
When the monster trying to attack, the spell is canceled and some error apears in the sphere log:
"ERROR:(sphere_backward_compatibility.scp,779)Undefined symbol '' [') &~ 0ff000000']"

Other thing, I'm Brazilam too, i don't know if there can be speak in portuguese.


RE: Hello can i have some spell script? - fabiohvp - 08-14-2018 12:53 PM

Offtopic: Coruja look your pm inbox