SphereCommunity
src.spelleffect - Printable Version

+- SphereCommunity (https://forum.spherecommunity.net)
+-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d)
+--- Forum: Script Help (/Forum-Script-Help)
+--- Thread: src.spelleffect (/Thread-src-spelleffect)



src.spelleffect - Osi - 02-01-2015 11:03 AM

on=@death

SRC.SPELLEFFECT s_earthquake , <MAGERY>
src.newitem i_gold { 300 400 }


why its not working Cry I tried cast 57 and something diffrent too but its not working. my first scp failed CryCry


RE: src.spelleffect - Jim - 02-01-2015 05:19 PM

in the part of "on=@death" , the "src" is the npc(death) too.

and because you are using "<MAGERY>" , so be sure the npc(death) have the "MAGERY" property with value,
otherwise you must use a number directly.
//
on=@death
ref1=<attacker.uid>
ref1.spelleffect s_earthquake,100.0 // the spelleffect will be performed on the player(who kill the npc)
serv.newitem i_gold {300 400}
ref1.bounce <new> // there are some gold put into the backpack of the player(who kill the npc)


RE: src.spelleffect - Osi - 02-02-2015 12:17 AM

Code:
16:48:ERROR:(test.scp,38)Undefined keyword 'ref1.spelleffect'
16:48:ERROR:(test.scp,40)Undefined keyword 'ref1.bounce'
ERROR:GC: 1 unplaced object deleted
ERROR:UID=040001b42, id=0eed 'gold coin', Invalid code=3202 (Object not placed in the world)
problem is if you die before npc u cant get loot and sphere giving error like this.

Code:
17:08:ERROR:(test.scp,35)Undefined symbol 'uid'
ref1=<attacker.uid> and I did ref1=<attacker.last>
thanks for helping

and how I can use this?
Code:
[FUNCTION npccast]
// Determine spell and skill used to cast
LOCAL.SPELL = <EVAL <ARGV[0]> &~ 0ff000000>
LOCAL.SKILL = <EVAL (<STREAT <SERV.SPELL.<LOCAL.SPELL>.SKILLREQ>>) &~ 0ff000000>
IF !(<LOCAL.SKILL>)
    LOCAL.SKILL = 25
ENDIF

// Set spell target
IF (<ARGV> > 2)
    ACT = 0
    ACTP = <ARGV[1]>, <ARGV[2]>, <ARGV[3]>, <ARGV[4]>
ELSE
    REF1 = <ARGV[1]>
    IF !(<REF1.UID>)
        REF1 = <ACT.UID>
        IF !(<REF1.UID>)
            REF1 = <UID>
        ENDIF
    ENDIF
    ACT = <REF1.UID>
    ACTP = <REF1.P>
ENDIF

// Set character action
ACTPRV = <UID>
ACTARG1 = <LOCAL.SPELL>
ACTION = <LOCAL.SKILL>
RETURN 1

and 1 more thing ^^

Code:
on=@gethit  // here simple
if (<act.baseid> == c_vortex) // what's act? and why need use (<..> == why 2 time )
effect=3,i_fx_heal_effect,6,35,1 // efect=3 is spell but i_fx_heal_effect,6,35,1 what's this?
src.remove // ??
endif // we closed if thing



RE: src.spelleffect - Jim - 02-02-2015 10:44 AM

about the function, i found some explain from the author:
//
// This function can be used to force a character to cast a specific
// spell. Works on both players and NPCs. Two arguments can be given:
//
// "NpcCast <spell>, <target>"
// spell --> spell id to cast
// target --> target (optional, default: previous action's target)
// - can be a uid or map location
//

about the "act","<..>" an effect..
can get the information from "spherewiki" :
"http://wiki.sphere.torfo.org/index.php/Main_Page", there are some Tutorials and Reference Compendium.
for exampe the EFFECT, : "http://wiki.sphere.torfo.org/index.php/EFFECT"