False.Genesis a3ae8273ba * auto-load all .def files in ./scripts/ directory after executing _startup.def
* fixed exception at DefScript:substr when called with empty string
* added 3 new functions: uppercase, lowercase, random[,<min>] <max>.
* added some better debug output when an incorrect script is loaded
2007-04-02 22:41:33 +00:00

36 lines
900 B
Modula-2

// purpose: let a player fly. (at least works on MaNGOS)
// args: @def: player name
// returns: guid of the targeted player, else false. empty string if we are not in the world.
#permission=100
// we can use this script only if we are in the world
if ?{not ${@inworld}}
logerror Can't slap anything if i am not in the world!
return
endif
// normalize player name. first char uppercased, rest lowercased.
set,name ?{uppercase ?{substr,1 ${@def}}}
out name1: ${name}
set,len ?{strlen ${@def}}
out strlen: ${len}
sub,len 1
out len: ${len}
append,name ?{lowercase ?{substr,${len},1 ${@def}}}
out name2: ${name}
// target the player. if targeting was successful, cast spell "Knockback 500".
set,t ?{target ${name}}
if ${t}
logdebug slapping player '${name}'
castspell 11027
target 0
else
logerror Can't target player '${name}'
endif
unset name
return ${t}