SphereCommunity
Custom AI Events - Printable Version

+- SphereCommunity (https://forum.spherecommunity.net)
+-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d)
+--- Forum: Script Submissions (/Forum-Script-Submissions)
+--- Thread: Custom AI Events (/Thread-Custom-AI-Events)

Pages: 1 2


RE: Custom AI Events - Extreme - 08-22-2012 06:49 AM

(08-22-2012 06:30 AM)Skul Wrote:  
(08-21-2012 03:30 PM)admin phoenix Wrote:  very nice
one idea from me aboot laying eggs.
one day the world will be over spawn with eggs.
maybe the chicken will lay a new egg if the old one was pickup from ground?
or maybe the chick lay 3 eggs and then if a player pick up one of the egg the chicken will lay another one after x seconds.

Decay timer? <serv.decaytimer>, pretty sure it's set to 15 for 15 minutes
Code:
serv.newitem=i_eggs_fresh
new.attr |= attr_decay
new.p=<p>
new.timer=<eval <serv.decaytimer> *60>
emote lay eggs
I fixed it, set timerf 120~180 to remove
And the chickens and snakes will lay eggs in the same time, 120~180 seconds
Its okay now.


RE: Custom AI Events - Skul - 08-22-2012 09:06 AM

timerf is ok Extreme, but what if a player picks up the eggs (for cooking purposes?), it is then removed, should use TIMER and attr_decay to simulate 'server decay'. Just a heads up.

also, here's a simple code to add to all npcs and players to 'crush the eggs' when stepped on
Code:
[events e_eggshells]
on=@itemstep
if (<act.baseid>==i_eggs_fresh)
  emote crush <act.name>
  act.sound 01c3 //skeletal crush sound
  act.dispid=i_eggshells
  act.update
endif



RE: Custom AI Events - Extreme - 08-22-2012 10:43 AM

Updated! 21/08/2012 21:41PM
Script updated in main post.

@Skul
I did the changes that you suggested.
Thank you.


RE: Custom AI Events - htid4life - 08-23-2012 08:50 AM

u could add a check to see if its tamed b4 the function works on them.... as if the animal gets tammed it goes wild it dont listen to its owner..


RE: Custom AI Events - RanXerox - 08-23-2012 10:25 AM

You probably also ought to check if the REGION that it is in has the region_flag_nodecay turned on, and if so, don't drop anything on the ground...


RE: Custom AI Events - Pollo - 11-05-2012 11:33 PM

wow, great script , perfect for RP servs