SphereCommunity

Full Version: Skill delay
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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?
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
Thank you Skul.
I like March ^.^
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.
Reference URL's