SphereCommunity
Skill delay - Printable Version

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



Skill delay - Russian - 11-20-2012 04:59 PM

Hello all.
I want try to set skills delay if charter is gm:

Code:
ON=@SKILLSTART
IF <SRC.ISGM>
IF <SERV.SKILL.<ARGN1>.NAME>=Magery
SERV.SKILL.Magery.DELAY=1
ENDIF
ENDIF
But script set a delay for all server, for all charters. How i can set delay repsonally for gms?


RE: Skill delay - Skul - 11-20-2012 05:53 PM

Code:
on=@skillstart
if (<serv.skill.<action>.key>==magery)
  local.old_delay=<serv.skill.<action>.delay>
  if (<isgm>)
    serv.skill.<action>.delay=1
  else
    serv.skill.<action>.delay=<local.old_delay>
  endif
endif



RE: Skill delay - Russian - 11-20-2012 06:09 PM

Thank you Skul.
I like March ^.^


RE: Skill delay - Skul - 11-20-2012 06:24 PM

Wait, looking at it now I don't think that code will work, it will reduce the delay to 1 anytime a GM uses magery and never restore it. Here, this code should do the trick:
Code:
on=@spellcast
if (<isgm>)
  if (<isempty <var.old_magery_delay>>)
    var.old_magery_delay=<serv.skill.<action>.delay>
  endif
  serv.skill.<action>.delay=1
endif

on=@skillstart
if !(<isempty <var.old_magery_delay>>)
  serv.skill.<action>.delay=<var0.old_magery_delay>
  var.old_magery_delay=
endif

Then again, maybe the above won't work either. This is the best I can think of, unless someone else has a better idea:
Code:
on=@skillstart
if (<serv.skill.<action>.key>==magery)
  if (<isgm>)
    if !(<var0.magery_delay>)
      var.magery_delay=1
      timerf 0, serv.skill.<action>.delay=<serv.skill.<action>.delay>
      timerf 0, var.magery_delay=
    endif
    serv.skill.<action>.delay=500
  endif
endif
It works but I fear it will probably effect other players if there is any heavy use of magery. Try it out, least u can do is remove it if it doesn't work.