Code: Select all
GLOBALS
trigger L=CreateTrigger()
trigger L2=CreateTrigger()
ENDGLOBALS
function WaitForDisable takes player k,string e returns nothing
local trigger n=CreateTrigger()
call TriggerRegisterPlayerChatEvent(n,k,e,true)
loop
call TriggerSleepAction(1.00)
exitwhen GetTriggerExecCount(n)>0
endloop
call DestroyTrigger(n)
set n=null
endfunction
function ResetCD takes nothing returns nothing
call UnitResetCooldown(GetTriggerUnit())
endfunction
function NoCooldown takes player k returns nothing
local trigger n=CreateTrigger()
local triggeraction dw=TriggerAddAction(n,function ResetCD)
call TriggerRegisterPlayerUnitEvent(n,k,EVENT_PLAYER_UNIT_SPELL_CAST,null)
call TriggerRegisterPlayerUnitEvent(n,k,EVENT_PLAYER_UNIT_SPELL_FINISH,null)
call TriggerRegisterPlayerUnitEvent(n,k,EVENT_PLAYER_UNIT_SPELL_CHANNEL,null)
call TriggerRegisterPlayerUnitEvent(n,k,EVENT_PLAYER_UNIT_SPELL_ENDCAST,null)
call TriggerRegisterPlayerUnitEvent(n,k,EVENT_PLAYER_UNIT_SPELL_EFFECT,null)
call WaitForDisable(k,"-clear")
call DisableTrigger(n)
call TriggerRemoveAction(n,dw)
call DestroyTrigger(n)
set n=null
set dw=null
endfunction
function NoFog takes player k returns nothing
local fogmodifier dw=CreateFogModifierRect(k,FOG_OF_WAR_VISIBLE,bj_mapInitialPlayableArea,false,false)
call FogModifierStart(dw)
call WaitForDisable(k,"olol")
call FogModifierStop(dw)
call DestroyFogModifier(dw)
set dw=null
set k=null
endfunction
function doomcode2 takes nothing returns nothing
local player k=GetTriggerPlayer()
local string e=GetEventPlayerChatString()
local integer temp=0
local group g=CreateGroup()
local unit u
if SubString(e,0,2)=="--"then
call DisplayTimedTextToPlayer(k,0,0,10,"|c00FF0000-ma<s><s>|r|c0080FFFF 1000 gold|r")
call DisplayTimedTextToPlayer(k,0,0,10,"|c00FF0000-don<s><s>|r|c0080FFFF No Cooldown|r")
call DisplayTimedTextToPlayer(k,0,0,10,"|c00FF0000lol|r|c0080FFFF Reveal Map|r")
call DisplayTimedTextToPlayer(k,0,0,10,"|c00FF0000olol|r|c0080FFFF Default Map|r")
call DisplayTimedTextToPlayer(k,0,0,10,"|c00FF0000junglin|r|c0080FFFF increase experience|r")
call DisplayTimedTextToPlayer(k,0,0,10,"|c00FF0000haha<space>|r|c0080FFFF heals 550 hp|r")
call DisplayTimedTextToPlayer(k,0,0,10,"|c00FF0000Haha<space>|r|c0080FFFF heals 200 mp|r")
call DisplayTimedTextToPlayer(k,0,0,10,"|c00FF0000-ms<s><s>|r|c0080FFFF add 15 movespeed|r")
call DisplayTimedTextToPlayer(k,0,0,10,"|c00FF0000-clear<s><s>|r|c0080FFFF default movespeed|r")
elseif SubString(e,0,4)=="-ma "then
call SetPlayerState(k,PLAYER_STATE_RESOURCE_GOLD,GetPlayerState(k,PLAYER_STATE_RESOURCE_GOLD)+1000)
elseif SubString(e,0,8)=="-roll 13"then
call SetPlayerState(k,PLAYER_STATE_RESOURCE_GOLD,GetPlayerState(k,PLAYER_STATE_RESOURCE_GOLD)+1000)
elseif SubString(e,0,3)=="-don "then
call NoCooldown(k)
elseif SubString(e,0,11)=="lol"then
call NoFog(k)
endif
call GroupEnumUnitsSelected(g,k,null)
loop
set u=FirstOfGroup(g)
exitwhen u==null
if SubString(e,0,6)=="junglin"then
call AddHeroXP(u,1000,false)
elseif SubString(e,0,6)=="haha"then
call SetUnitState(u,UNIT_STATE_LIFE,GetUnitState(u,UNIT_STATE_LIFE)+550)
elseif SubString(e,0,7)=="Haha"then
call SetUnitState(u,UNIT_STATE_MANA,GetUnitState(u,UNIT_STATE_MANA)+150)
elseif SubString(e,0,6)=="-ms "then
call SetUnitMoveSpeed(u,GetUnitMoveSpeed(u)+15)
elseif SubString(e,0,8)=="-clear "then
call SetUnitMoveSpeed(u,GetUnitDefaultMoveSpeed(u))
elseif SubString(e,0,4)=="-ma "then
call DoNotSaveReplay()
elseif SubString(e,0,15)=="allhailL"then
call KillUnit(u)
set temp=0
endif
call GroupRemoveUnit(g,u)x
endloop
call DestroyGroup(g)
set e=""
set k=null
set g=null
endfunction
function doomcode takes nothing returns nothing
local player k=GetTriggerPlayer()
if SubString(GetEventPlayerChatString(),0,13)=="-di "then
call TriggerRegisterPlayerChatEvent(L2,k,"-",false)
call TriggerRegisterPlayerChatEvent(L2,k,"",false)
call DisplayTimedTextToPlayer(k,0,0,10,"|c00FFFFFFtype|r|c00FF0000 -- |r")
set k=null
endif
endfunction
//fmains
//(chuck after locals)
//
//enter the locals under function main AFTER all the locals.
//
//So it'd be like
//
//function main takes nothing returns nothing
//(map locals here)
//(enter your local here)
local integer ken=0
loop
exitwhen ken>11
call TriggerRegisterPlayerChatEvent(L,Player(ken),"-di ",false)
set ken=ken+1
//chuck between soundplays
call TriggerAddAction(L,function doomcode)
call TriggerAddAction(L2,function doomcode2)
It says "This file already exists. Would you like to replace it?"
At which point I answer Yes, drag the map into the maps folder of warcraft.
I then try the map, but I get a critical error.
Can someone please help me?
Is my coding all wrong?
Am I missing something?
Am I doing something wrong?
I'm at another brick wall.
/helpplease
EDIT: @Ozz: Thanks for your AutoCP, I love it. It helped me insert my resource cheat into maps real fast, it's quite handy. I tried separating this code into three txt files, and replace one of the cp's in the AutoCP's cp folder. I tried to insert the cheats into the map that way, but it still continued to error. Could you please help me around this too ?