package Commands import PlayerData import ClosureTimers import SetupBox import MGSpacey import EscaperClasses import ReviveManager import PickSystem import StringUtils init EventListener.add(EVENT_PLAYER_CHAT_FILTER) -> let str = GetEventPlayerChatString() if str.startsWith("-") parseCommand(str) function parseCommand(string str) let p = GetTriggerPlayer() let id = p.getId() let pd = pData[id] let args = str.substring(1).split(" ") let cstr = args.get(0) if pd.escaper == null and cstr != "d" DisplayTimedTextToPlayer(p, 0., 0., 10,"|cffFFD621[Info]|r - Commands are only available after hero selection.") return switch cstr case "smooth" if args.size() > 1 pd.smooth = args.get(1).toReal() case "rename" if args.size() > 1 p.setName(args.get(1)) case "clear" if localPlayer == p ClearTextMessages() case "cam" let nstr = args.get(1) if nstr != null switch nstr case "lock" SetCameraTargetControllerNoZForPlayer(p, pd.escaper.actor, 0,0,true) pd.escaper.camlock = true case "unlock" ResetToGameCameraForPlayer(p, 1.) pd.escaper.camlock = false default pd.zCam = nstr.toInt() * 1. if pd.zCam > 3000 pd.zCam = 3000 DisplayTimedTextToPlayer(p, 0., 0., 10,"|cffFFD621[Info]|r - Maximum Zoom is 3000") else if pd.zCam < 500 pd.zCam = 500 DisplayTimedTextToPlayer(p, 0., 0., 10,"|cffFFD621[Info]|r - Minimum Zoom is 500") SetCameraFieldForPlayer(p, CAMERA_FIELD_TARGET_DISTANCE, pd.zCam, 1.) case "frev" DisplayTimedTextToPlayer(p, 0., 0., 10,"|cffFFD621[Info]|r - Trying forced revive!") if pd.escaper == null doAfter(0.1) -> pd.escaper = new HolyEscaper(currentRevivepoint.toVec3(), pd.p) else forceRevive(pd.escaper) case "info" string s = "|cffFFD621[Info]|r - Current Region:\n" s += " |cff63DEFFSlidespeed|r: " + pd.escaper.getCurrentRegion().slidespeed.toString() + "\n" s += " |cff08AD4APoison Damage|r: " + pd.escaper.getCurrentRegion().poisonDmg.toString() + "\n" s += " |cffA52108Lava Damage|r: " + pd.escaper.getCurrentRegion().lavaDmg.toString() + "\n" s += " |cffFF9C29Owners|r: " DisplayTimedTextToPlayer(p, 0., 0., 20, s) case "intro" case "test" startTestmode(pd) case "fuckblizz" let nstr = args.get(1) if nstr == "ok" pData[GetTriggerPlayer().getId()].title = Title.ADMIN pData[GetTriggerPlayer().getId()].escaper.actor.addAbility(BLINK_ID) case "smode" let nstr = args.get(1) if nstr == "both" pd.escaper.selectatrevive = true pd.escaper.camOnRevive = true DisplayTimedTextToPlayer(p, 0., 0., 10,"|cffFFD621[Info]|r - Now selecting and changing camera on revive.") else if nstr == "select" pd.escaper.selectatrevive = true pd.escaper.camOnRevive = false DisplayTimedTextToPlayer(p, 0., 0., 10,"|cffFFD621[Info]|r - Now only selecting on revive.") else if nstr == "cam" pd.escaper.selectatrevive = false pd.escaper.camOnRevive = true DisplayTimedTextToPlayer(p, 0., 0., 10,"|cffFFD621[Info]|r - Now only changing camera on revive.") else DisplayTimedTextToPlayer(p, 0., 0., 10,"|cffFFD621[Info]|r - Missing argument. Command -smode both|select|cam.") case "admin" if pd.title == Title.ADMIN int i = 0 unit tr = null for u in GetUnitsSelectedAll(pd.p) i++ tr = u if i > 1 break if i < 2 let id2 = tr.getOwner().getId() let _pd2 = pData[id2] // TODO apply adminship? case "exp" if pd.title == Title.ADMIN int i = 0 unit tr = null for u in GetUnitsSelectedAll(pd.p) i++ tr = u if i > 1 break if i < 2 let id2 = tr.getOwner().getId() let pd2 = pData[id2] pd2.addXp(8965, true) else pd.addXp(8965, true) case "boss" if pd.XP > 2500 let units = GetUnitsSelectedAll(p) for u in units if u.getEntity() instanceof SetupBox (u.getEntity() castTo SetupBox).addBossSwitch() else printTimedToPlayer("|cffFFD621[Info]|r - You are not experienced enough!", 15, pd.p) case "ship" new Spaceship(pd.escaper.getPos().toVec2(), pd.escaper) case "kick" let name = args.get(1).toLowerCase() if name.length() > 1 for pl in allPlayers if pl.name.toLowerCase().startsWith(name) and not pl.title == Title.ADMIN RemovePlayer(pl.p, PLAYER_GAME_RESULT_DEFEAT) return default if not (cstr.startsWith("st") or cstr.startsWith("sht") or cstr.startsWith("sc") or cstr.startsWith("sa") or cstr.startsWith("ht")) DisplayTimedTextToPlayer(p, 0., 0., 10,"|cffFFD621[Info]|r - Command not found! Available Commands: -clear, -cam [value], -cam unlock, -cam lock, -frev (forced revive), -info, -intro, -smode [both|cam|select|none], -rename [name]") destroy args