SphereCommunity
Playful Minions and Snowballs - Printable Version

+- SphereCommunity (https://forum.spherecommunity.net)
+-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d)
+--- Forum: Script Requests (/Forum-Script-Requests)
+--- Thread: Playful Minions and Snowballs (/Thread-Playful-Minions-and-Snowballs)



Playful Minions and Snowballs - Saint - 08-05-2015 05:50 PM

Looking for a snowball script basically white ball when thrown interrupts actions and causes loss of stam.

And is there anyway to give certain items to npcs and then when seeing a player in LOS will use said items.

Ideally

I'm looking to make playful ice mongbats and give them x snowballs and then they will throw these at players while snickering.

bonus points if you can make a snow effect on being hit. just the gheal animation recolored.

I've been through a few the scripting for dummies which I clearly am and this is what I have so far Sad
Quote:[ITEMDEF i_snowball]
[ITEMDEF i_snowball]
Name=Snowball
ID=i_fruit_coconut
TYPE=t_script

ON=@CREATE
COLOR=0481

ON=@DCLICK
////Check to see if its in your bag
IF (in bag)
Target
Else
(can't use where its at)

ON=@TARGET
(Throw snowball)

PS if anyone want to make a video tutorial making interesting little items I'd definitely subscribe and it would make learning much easier.


RE: Playful Minions and Snowballs - JohnVeritas - 08-08-2015 09:00 PM

Hi I can help you for some of them;

Code:
on=@dclick
if (<topobj> != <src>)
src.sysmessage @,,1 You can't use where its at.
return 1
else
src.target
return 1
endif

on=@targon_char // I put return 1 in every check for avoid more than 1 error in same time
IF (<src.targ.uid>==<src.uid>)
src.sysmessage @,,1 You can't shoot a snowball yourself
return 1
elseif !(<src.targ.canseelos>)
src.sysmessage @,,1 You can't see the target.
return 1
else
src.anim 11 // animation
src.stam -= < your choise >
src.consume 1 i_snowball
src.targ.skill fail
src.targ.emote argh
src.targ.effect 0,0f27,10
src.targ.anim 20
src.targ.newitem=i_fx_smoke
src.targ.act.p=<src.targ.p>
endif



RE: Playful Minions and Snowballs - XuN - 08-09-2015 01:46 AM

Code:
03-01-2014, Ben
Fixed #2256: Reworked NPC object throwing..
->canseelos checks now applies to overrides
->changed tag.override.rock to NPC variable THROWOBJ (can take numerical or string ID now)
->changed tag.override.dam to NPC varialbe THROWDAM min,max (can also be "THROWDAM max" for non variating damage)
->added THROWRANGE min,max  (can also be "THROWRANGE max" with a min of 2 by default)
->All 3 variables are available on dynamic npc or in CHARDEF

Using this will make NPCs to throw the THROWOBJ item like ogres throws rocks.