SphereCommunity
Criminal to the thrower. - Printable Version

+- SphereCommunity (https://forum.spherecommunity.net)
+-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d)
+--- Forum: Script Help (/Forum-Script-Help)
+--- Thread: Criminal to the thrower. (/Thread-Criminal-to-the-thrower)



Criminal to the thrower. - Lazarus - 09-27-2012 03:50 AM

When I create a item with a target_ground target; Like an trap of explotion, that works on=@step; How can I do CRIMINAL to the thrower of the potion to the ground when someone with +karma and non pk get the explosion?


Thanks!


RE: Criminal to the thrower. - Skul - 09-27-2012 04:13 AM

store the uid of the 'tosser' somehow, either by linking the explosion (if it's not already linked) and use 'damage' to trigger the default behaviour of the criminal system:
Code:
on=@step
src.damage <damage> 01 <link.uid> //assuming link if the uid of the 'tosser'



RE: Criminal to the thrower. - Lazarus - 09-28-2012 02:56 AM

(09-27-2012 04:13 AM)Skul Wrote:  store the uid of the 'tosser' somehow, either by linking the explosion (if it's not already linked) and use 'damage' to trigger the default behaviour of the criminal system:
Code:
on=@step
src.damage <damage> 01 <link.uid> //assuming link if the uid of the 'tosser'

I didn't get it Sad
This is a example of the script
Mbe should this help more

Code:
[ITEMDEF i_trampa_prueba] ....
ON=@DClick
if (<src.tag.trampasprueba> == 00)
TARGETG src.sysmessage @055 Donde quieres poner la trampa?
else
src.sysmessage @055 Ya pusiste este tipo de trampa
endif
RETURN 1

ON=@TargOn_Ground
IF !<SRC.CANSEELOS <SRC.TARGP>>
SRC.SYSMESSAGE El objetivo no esta a la vista.
ELSE
SERV.NEWITEM=i_trampa_prueba2
SERV.NEW.ATTR=attr_decay|attr_move_never
SERV.NEW.TIMER=10
[ITEMDEF i_trampa_prueba2]
...
on=@step if !(<src>==<tag.duenioprueba>)
src.sysmessage @0481 Explota la trampa
src.effect 3,i_fx_explode,70,15,0,0
src.damage <damage> 01 <link.tag.duenioprueba.uid>
REMOVE
endif

Thanks anyways!


Lazarus.


RE: Criminal to the thrower. - RanXerox - 09-28-2012 03:31 AM

When using NEW as a reference, you do not need to prefix it with SERV... so change this:

Code:
SERV.NEW.ATTR=attr_decay|attr_move_never
SERV.NEW.TIMER=10

...to this:

Code:
NEW.ATTR=attr_decay|attr_move_never
NEW.TIMER=10

Now, to reference the thrower in i_trampa_prueba2 you need to set its LINK... so change this:

Code:
NEW.ATTR=attr_decay|attr_move_never
NEW.TIMER=10

...to this:

Code:
NEW.ATTR=attr_decay|attr_move_never
NEW.TIMER=10
NEW.LINK=<SRC>

Now in the i_trampa_prueba2 item, you need to use that LINK as the source of the damage, so change this:

Code:
src.damage <damage> 01 <link.tag.duenioprueba.uid>

...to this:

Code:
src.damage <damage> 01 <LINK>



RE: Criminal to the thrower. - Lazarus - 09-28-2012 05:17 AM

(09-28-2012 03:31 AM)RanXerox Wrote:  sadsad


Hi! thanks! rly!

I have a problem here with the damage:

6:14:ERROR:(Trampas.scp,397)Can't resolve <damage>
in
src.damage <damage> 01 <LINK>

Any idea :|?


and this: <damage>
not works with the damage of the link. I'll try uid maybe.


RE: Criminal to the thrower. - RanXerox - 09-28-2012 05:22 AM

You didn't include the full i_trampa_prueba2 ITEMDEF, so the only idea I have is that this object type doesn't have (or is incapable of having) a DAMAGE property...


RE: Criminal to the thrower. - Lazarus - 09-28-2012 05:24 AM

(09-28-2012 05:22 AM)RanXerox Wrote:  You didn't include the full i_trampa_prueba2 ITEMDEF, so the only idea I have is that this object type doesn't have (or is incapable of having) a DAMAGE property...

Code:
[ITEMDEF i_trampa_prueba2]
DEFNAME=i_tram_prueba2
ID=3795
NAME=Trampa Prueba
WEIGHT=30
skillmake=blacksmithing 90.0
RESOURCES=100 i_ingot_iron
CATEGORY=News
SUBSECTION=Savage Items
DESCRIPTION=Trampa Prueba 2

on=@step
if !(<src>==<tag.duenioprueba>)
src.sysmessage  @0481 Explota la trampa
src.effect 3,i_fx_explode,70,15,0,0
src.sfx 0054
src.damage 20 <LINK>

REMOVE
endif


Sorry for that, this is a script of a friend that is asking to me to post it in the forums and help ^_^

Thanks!

Oh i imss it

src.damage {1 5} 01 <LINK>

Shock


RE: Criminal to the thrower. - RanXerox - 09-28-2012 06:03 AM

DAMAGE amount, type, source

so maybe try this example (which does 15 to 25 physical damage from LINK to SRC):

Code:
SRC.DAMAGE <R15,25> <DEF.dam_physical> <LINK>



RE: Criminal to the thrower. - Lazarus - 09-28-2012 08:29 AM

Thanks RanXerox and Skul!

Big Grin