SphereCommunity
NPC/Pet Spawn - Printable Version

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



NPC/Pet Spawn - Lano - 10-09-2012 07:21 PM

Hi, i am trying to make a script that works like this:

ON=@hit
random chance of 10%
Summon for example a skelleton knight that is tame/belongs to the player
after 60 sec. the skeleton dies
while skeleton is active, player can not trigger another summon


I am at work right now, so i do not have the script i am working on handy, but it does not matter, i am failing utterly anyway.

The random chance of summoning and all that is no biggie, i can also get the server to spawn a new pet next to the player, its just not tame/belongs to him/her, and getting the timers equipped right, also seems to confuse me, please help Smile


RE: NPC/Pet Spawn - Anarch Cassius - 10-10-2012 04:08 AM

Two options functions for you.

This first is a dispel-able summoning. The second makes an existing creature the pet of a player.

Code:
[function summon_pet]
SRC.newnpc=<ARGS>
SRC.act.p=<src.p>
SRC.act.tag.owner=<src.uid>
SRC.ACT.FIX
VAR.SUID=<ACT.UID>
SRC.act.flags=00c000000
SRC.act.newitem=i_memory
SRC.ACT.ACT.COLOR=02
SRC.act.act.cont=<VAR.SUID>
SRC.act.act.link=<SRC.uid>
SRC.act.act.more2=<SRC.uid>
SRC.act.act.timer=-1
SRC.ACT.NEWITEM=i_rune_summon_creature
SRC.ACT.ACT.LAYER=41
SRC.ACT.ACT.TYPE=t_spell
SRC.ACT.ACT.MORE2=1
SRC.ACT.ACT.MOREP=40,816
SRC.ACT.ACT.CONT=<VAR.SUID>
SRC.ACT.ACT.LINK=<SRC.UID>
SRC.ACT.ACT.TIMER=-1
SRC.ACT.ACT.ATTR=attr_decay


// <pet uid>.f_MakePetOf <owner uid>
[function f_MakePetOf]
serv.newitem i_memory
new.color = memory_ipet
new.more1 = 04
new.more2 = <serv.time>
new.morep = <p>
new.link = <args>
new.cont = <uid>



RE: NPC/Pet Spawn - Lano - 10-10-2012 04:58 PM

Thanks, thats easy to work with
i'd never been able to figure that one out myself Wink