SphereCommunity
Online Reward - Printable Version

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



Online Reward - Trofan - 01-07-2013 01:54 PM

Hi all.I have a problem. Any player enter the britain, every 5 min win 10k gold. how do I make ? Thanks


Sorry for my bad english Sad


RE: Online Reward - Onirim - 01-07-2013 05:35 PM

You can make it with a timer in an event.
This link can help: http://wiki.sphere.torfo.org/index.php/Chapter_6#The_.40Timer_Event


RE: Online Reward - Trofan - 01-07-2013 07:59 PM

i make it but player can logout timer not remove


RE: Online Reward - Sharlenwar - 01-07-2013 08:40 PM

With that timer idea, you can add in something using the @Logout trigger on players. Just do a check for the timer item, and if it is present, then just remove it if the player logs out.

http://wiki.sphere.torfo.org/index.php/Characters#Triggers


RE: Online Reward - Trofan - 01-07-2013 09:05 PM

yes i'm fix it
look the script its true ?

Code:
[itemdef i_safepoint]
name point timer
id i_memory
type t_eq_script
weight 0

on=@create
attr attr_invis | attr_decay

on=@equip
timer 300

on=@unequip
if !(strmatch('<region.name>', 'Safe Region'))
else
newitem i_gold,1000
new.bounce

on=@timer
attr attr_decay
remove


[itemdef i_pvppoint]
name point timer
id i_memory
type t_eq_script
weight 0

on=@create
attr attr_invis | attr_decay

on=@equip
timer 300

on=@unequip
if !(strmatch('<region.group>', 'Serpent's Hold')) && !(strmatch('<region.group>', 'Cove'))
else
newitem i_gold,5000
new.bounce

on=@timer
attr attr_decay
remove



RE: Online Reward - Mordaunt - 01-08-2013 02:39 AM

Personally I'd put it under an f_onserver_timer function for ease of adding new regions or expanding it server wide should you so wish

Code:
[Defname lotto_settings]
winchance 500  // 1 in <def.winchance> of winning

[Function Lottery]
if (<isplayer>)
    if (<isonline>)
        if !(strmatch ("<region.name>","Serpent's Hold")) || !(strmatch ("<region.name>","Cove"))
                if !(RAND(<eval <def.winchance>>))
                          serv.newitem i_gold,5000
                         new.bounce
            endif
        elif !(strmatch ("<region.name>","Britain"))
                if !(RAND(<eval <def.winchance>>))
                          serv.newitem i_gold,1000
                         new.bounce
            endif
        endif
    endif
endif

If you're wanting to keep it on the timers you are going to need to add region events to the areas in which you want the lottery to run so that the timers are added when the player enters and removed when they leave.


RE: Online Reward - Trofan - 01-08-2013 12:31 PM

thanks dude Smile