Commandextra.lua--game command extension

Source: Internet
Author: User

1 --[[Author Information:2 Command Extra (game command extension)3 author qq:2473214534 author Email:[email protected]5 Date Modified: 2014-3-126 Features: Add additional commands, GM commands7 ]]--8 Print(">>script:command Extra.")9 Ten --[[ One . WMSG content GM sends world News A . Be view robot equipment - . Npcbot equips view robotic equipment - . RH GM Restores Life the . Reset hp GM Restore Life - . GH Teleport Home - . Go Home Teleport - . Card Transfer Home + ]]-- - Local functionShowbotequip (player)--View Robotic Equipment +     LocalGuid=player:getguidlow ()--get the player's GUID A     LocalTarget=player:getselection ()--Get player selected object at     Localtext="" -     if(target) Then -         if(Target:gettypeid () = =3) Then--the target is biology . -             LocalQ = Chardbquery ("SELECT * from Character_npcbot Where owner=".. Guid.."and entry=".. Target:getentry ()."and active=1") -             --Player:say ("Me:"). GUID: "target.".. Target:getentry (), 0) -             if(Q) Then--to find the appropriate information inText=target:getname ()."equipment: \ n" -                  forI=5, A  Do  to                     LocalItem=q:getuint32 (i)--Read Content +                     if(item andItem >0) Then -Text=text. Getitemlink (item):" " theTarget:sendunitwhisper (Getitemlink (item), player)--Whisper to Player *                     End $                 EndPanax Notoginseng                 --Target:sendunitsay (text,0) -             Else thePlayer:say ("no robots found, or no robots selected",0) +             End A         Else thePlayer:say ("Please select a robot. ",0) +         End -     Else $Player:say ("Please select a robot. ",0) $     End -     returntext - End the  - Local functionresethp (player)Wuyi     if(Player:getgmrank () >=3) Then--Judging is not GM the Player:sethealth (Player:getmaxhealth ()) -Player:sendbroadcastmessage ("has returned to life. ") Wu         return false -     Else About         return true $     End - End -  - Local functionStart (player) APlayer:castspell (Player,8690,true)     +Player:resetspellcooldown (8690,true) thePlayer:sendbroadcastmessage ("have come home") - End $  the LocalCmd={ the["Go Home"]=function(player) the Start (player) the     End, -["GH"]=function(player) in Start (player) the     End, the["Card"]=function(player) About Start (player) the     End, the["wmsg"]=function(player,msg) the         if(player) Then +             if(Player:getgmrank () >=3) Then -Sendworldmessage (String.Format("|cffff0000[System]|r|cffffff00%s|r", msg)) the             EndBayi         Else theSendworldmessage (String.Format("|cffff0000[System]|r|cffffff00%s|r", msg)) the         End -     End, -[" be"]=function(player)--Robotic Equipment the showbotequip (player) the         return false the     End, the["Npcbot equips"]=function(player)--Robotic Equipment - showbotequip (player) the         return false the     End, the["Reset HP"]=function(player)--GM restores Life94 resethp (player) the     End, the["RH"]=function(player)--GM restores Life the resethp (player)98     End, About } - 101 functionCMD. Input (event, player, command)102     LocalCmd,space,excmd=command,command:find (" ")or 0,""103     if(space>1) Then104Cmd=command:sub (1, space-1)--main command theExcmd=command:sub (space+1)--Additional command Parameters106     End107     LocalFunc=cmd[cmd]--use the input command to find the function108     if(func) Then109         returnFunc (Player,excmd)or false the     End111 End the --Player_event_on_command =-(EVENT, PLAYER, COMMAND)-Can return False113Registerplayerevent ( theCmd. Input)
View Code

Commandextra.lua--game command extension

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.