SphereCommunity
What Command Would I Use For "If My Character Is Damaged/Attacked?" - Printable Version

+- SphereCommunity (https://forum.spherecommunity.net)
+-- Forum: Expired/Outdated Versions (/Forum-Expired-Outdated-Versions)
+--- Forum: Sphere 51a Help (/Forum-Sphere-51a-Help)
+--- Thread: What Command Would I Use For "If My Character Is Damaged/Attacked?" (/Thread-What-Command-Would-I-Use-For-If-My-Character-Is-Damaged-Attacked)



What Command Would I Use For "If My Character Is Damaged/Attacked?" - Admin Drew - 07-04-2013 11:22 AM

Hi guys, I know to use ontrigger=damage if you want something to happen while attacking something but what would I use if I want something to happen to the other person if they are attacking me? For example I make a ring my character wears and if my character tests that he parried a blow I want a trigger for something to happen to the person attacking me. Kind of like reactive armor spell does but want to use it on various items.
Thanks!


RE: What Command Would I Use For "If My Character Is Damaged/Attacked?" - evening - 07-04-2013 12:51 PM

@HitTry
@HitMiss
@Hit
@GetHit
@Attack

on=@attack
if (<src.act.hits> = <src.act.str>) && (<src.act.action> == -1) && (<src.act.obody> == 065)
src.act.go=<src.p>
endif

//动物园
if (<valstr(strlen(<SRC.REGION.name>))>=3) && (<SRC.REGION.FLAGS> == 028aa)
src.go 4291 954 10
//src.action -1
endif


//矿洞名称计算公式
if ((<valstr(strlen(<SRC.REGION.name>))>=10) || (<valstr(strlen(<SRC.REGION.name>))>=11) || (<valstr(strlen(<SRC.REGION.name>))>=13) || (<valstr(strlen(<SRC.REGION.name>))>=17)) && (<SRC.REGION.FLAGS> & 04000)
if (<src.findlayer(1).id> > 0)
src.findlayer(1).unequip
endif

if (<src.findlayer(2).id> > 0)
src.findlayer(2).unequip
endif
endif
return 0

on=@gethit
//speaku <actarg1>
if (<valstr(strlen(<SRC.REGION.name>))>=3) && (<SRC.REGION.FLAGS> == 028aa)
if (<src.npc>) && (!(<serial> = <src.MemoryFindType.0002.LINK>)) && (<src.MemoryFindType.0002.LINK> > 0)
src.remove
endif
endif

if ((<valstr(strlen(<SRC.REGION.name>))>=10) || (<valstr(strlen(<SRC.REGION.name>))>=11) || (<valstr(strlen(<SRC.REGION.name>))>=13) || (<valstr(strlen(<SRC.REGION.name>))>=17)) || (<SRC.REGION.FLAGS> & 04000)
if (<src.npc> == 1)// && (!(<serial> = <src.MemoryFindType.0002.LINK>))
var.ffgs=<flags>
src.remove
//src.MemoryFindType.0002.LINK.criminal
flags=<var.ffgs>
endif
endif
//if (<findlayer(33).id> > 0)// && (<act.DISTANCE> < 2)
// EFFECT=3,FX_CURSE_EFFECT,6,15,1
//endif
return 0


RE: What Command Would I Use For "If My Character Is Damaged/Attacked?" - Admin Drew - 07-04-2013 02:56 PM

For 51a? Allot of that doesn't look like it's for 51a.. Also was just looking for one line to test if my player is being attacked.


RE: What Command Would I Use For "If My Character Is Damaged/Attacked?" - evening - 07-04-2013 03:29 PM

sphere 0.51a


RE: What Command Would I Use For "If My Character Is Damaged/Attacked?" - sus - 10-02-2013 08:43 PM

(07-04-2013 03:29 PM)evening Wrote:  sphere 0.51a

But with lil.
Without lil it wouldn't work.


RE: What Command Would I Use For "If My Character Is Damaged/Attacked?" - evening - 10-03-2013 10:19 PM

lil has released the source code, I have the new update it, so I will be more trigger events