need help with save code trigger

General talk about editing, cheating, and deprotecting maps.

Moderator: Cheaters

grand
Member
Posts: 67
Joined: January 6th, 2008, 10:05 pm

need help with save code trigger

Post by grand »

After looking at the script and testing some data, I figured I found the right trigger to edit so that the save and load properly works. The max stats saved is either 999 or 1000 so I was wondering what to edit from this part of the script so that if I saved with 10k stats, and I load it, I will get back the 10k stats.
Spoiler:
function Km takes nothing returns boolean
return GetItemTypeId(GetManipulatedItem())=='I004' or GetItemTypeId(GetManipulatedItem())=='I047'
endfunction
function lm takes nothing returns nothing
local unit u=GetTriggerUnit()
local player p=GetOwningPlayer(u)
local integer id=GetPlayerId(p)
local integer i=0
local integer QL
local integer x1
local integer x2
local integer x3
local integer x4
local integer x5
if GetItemTypeId(GetManipulatedItem())!='I004' then
set HB=true
endif
if Rl(u)==false then
call yl(p,"Saving Error: You cannot save with certain buffs you currently have")
set u=null
return
endif
call ql(u)
set EB=0
set EB=(EB+1)
set FB=u
set NB[EB]=IK(FB)
call nl(u)
set EB=(EB+1)
set NB[EB]=GetHeroLevel(u)
set EB=(EB+1)
set NB[EB]=(GetHeroInt(u,false)*0xF4240)+(GetHeroAgi(u,false)*1000)+GetHeroStr(u,false)
set QL=NB[EB]
set x2=QL/ 1000
set x1=QL-1000*x2
set x3=x2/ 1000
set x2=x2-1000*x3
set EB=(EB+1)
set NB[EB]=(qN[id]*1000)+PN[id]
set QL=NB[EB]
set x2=QL/ 1000
set x1=QL-1000*x2
set EB=(EB+1)
set NB[EB]=GetPlayerState(p,PLAYER_STATE_RESOURCE_GOLD)
set EB=(EB+1)
set NB[EB]=GetPlayerState(p,PLAYER_STATE_RESOURCE_LUMBER)
set EB=(EB+1)
set NB[EB]=(UN[id]*10000)+(wN[id]*1000)+(WN[id]*'d')+(yN[id]*10)+YN[id]
set QL=NB[EB]
set x4=QL/ 10
set x5=QL-(10*x4)
set x3=x4/ 10
set x4=x4-(10*x3)
set x2=x3/ 10
set x3=x3-(10*x2)
set x1=x2/ 10
set x2=x2-(10*x1)
set EB=(EB+1)
set NB[EB]=UnitInventoryCount(u)
call Uk()
loop
exitwhen i>5
if IsItemOwned(UnitItemInSlot(u,i)) then
set EB=(EB+1)
set cB=UnitItemInSlot(u,i)
call SetItemUserData(cB,(1+GetPlayerId(p)))
set NB[EB]=NK(cB)
endif
set i=i+1
endloop
set i=1
loop
exitwhen i>XB
if GetUnitAbilityLevel(u,AB)>0 then
set EB=(EB+1)
set NB[EB]=i
endif
set i=i+1
endloop
set DB=jK()
call Vl(u)
if GetItemTypeId(GetManipulatedItem())=='I004' then
call QuestMessageBJ(Sj(p),8,"|cffF6A8B6This is your code, take a screenshot (Prnt scrn) or write it down!|r")
call DisplayTimedTextToPlayer(p,0,0,60.,DB)
call DisplayTimedTextToPlayer(p,0,0,60.," ")
call DisplayTimedTextToPlayer(p,0,0,60.,"Legend: |cffffcc000123456789|r")
call DisplayTimedTextToPlayer(p,0,0,60.,"|cffAAAAFFabcdefghijklmnopqrstuvwxyz|r")
call DisplayTimedTextToPlayer(p,0,0,60.,"|cff33FF33ABCDEFGHIJKLMNOPQRSTUVWXYZ|r")
else
call OL(u,id,-6576,-12585,'d')
call TransmissionFromUnitWithNameBJ(Sj(p),null,"Take a screenshot now (press Prnt Scrn)",null,VK(DB),0,10,true)
call cL(u,id)
endif
set HB=false
if SP[id]>0 then
call DisplayTimedTextToPlayer(p,0,0,10.,"|cffFF2400Warning, you haven't used up your SP, SP will NOT be saved so you better use your SP and save again|r")
endif
set u=null
endfunction
function Lm takes nothing returns boolean
return SubStringBJ(GetEventPlayerChatString(),1,6)==GetEventPlayerChatStringMatched()and StringLength(GetEventPlayerChatString())>6 and YA[GetPlayerId(GetTriggerPlayer())]
endfunction


heres the load trigger
Spoiler:
function mm takes nothing returns nothing
local player p=GetTriggerPlayer()
local integer id=GetPlayerId(p)
local integer i
local integer QL
local integer x1
local integer x2
local integer x3
local integer x4
local integer x5
local integer Mm
local integer j=0
if qB==false then
call yl(p,"Don't stress, try in a few seconds again...")
return
endif
set YA[id]=false
set DB=SubStringBJ(GetEventPlayerChatString(),7,StringLength(GetEventPlayerChatString()))
set VB=JK(DB)
if VB==false then
call yl(p,"Invalid code, try again...")
set YA[id]=true
return
endif
set IB=EB
set EB=1
set gB=AK(NB[EB])
set Gb[id]=CreateUnit(p,gB,-6477,-12675,270)
set EB=(EB+1)
call DisableTrigger(XE)
call SetHeroLevelBJ(Gb[id],NB[EB],false)
set JC[id]=GetHeroLevel(Gb[id])
call EnableTrigger(XE)
set EB=(EB+1)
set QL=NB[EB]
set x2=QL/ 1000
set x1=QL-1000*x2
set x3=x2/ 1000
set x2=x2-1000*x3
call SetHeroStr(Gb[id],x1,true)
call SetHeroAgi(Gb[id],x2,true)
call SetHeroInt(Gb[id],x3,true)
set LN[id]=GetHeroStr(Gb[id],false)
set mN[id]=GetHeroAgi(Gb[id],false)
set MN[id]=GetHeroInt(Gb[id],false)
set EB=(EB+1)
set QL=NB[EB]
set x2=QL/ 1000
set x1=QL-1000*x2
set qN[id]=x2
set PN[id]=x1
set EB=(EB+1)
call SetPlayerStateBJ(p,PLAYER_STATE_RESOURCE_GOLD,NB[EB])
set eC[id]=GetPlayerState(p,PLAYER_STATE_RESOURCE_GOLD)
set EB=(EB+1)
call SetPlayerStateBJ(p,PLAYER_STATE_RESOURCE_LUMBER,NB[EB])
set xC[id]=GetPlayerState(p,PLAYER_STATE_RESOURCE_LUMBER)
set EB=(EB+1)
set QL=NB[EB]
set x4=QL/ 10
set x5=QL-(10*x4)
set x3=x4/ 10
set x4=x4-(10*x3)
set x2=x3/ 10
set x3=x3-(10*x2)
set x1=x2/ 10
set x2=x2-(10*x1)
set UN[id]=x1
set wN[id]=x2
set WN[id]=x3
set yN[id]=x4
set YN[id]=x5
set sN[id]=UN[id]+wN[id]+WN[id]+yN[id]+YN[id]
if sN[id]==0 then
set sN[id]=1
set SP[id]=1
call MultiboardSetItemValueBJ(Tb,SN[id],15,"|CFF82CA9C"+I2S(SP[id])+"|r")
endif
set QN[id]=kk(id)
call DisableTrigger(hO)
call DisableTrigger(CO)
set EB=(EB+1)
set i=1
set Mm=NB[EB]
loop
exitwhen i>Mm
set EB=(EB+1)
set CB=bK(NB[EB])
call UnitAddItemByIdSwapped(CB,Gb[id])
call SetItemUserData(bj_lastCreatedItem,(1+GetPlayerId(p)))
set i=i+1
endloop
set i=0
loop
exitwhen i==Rb
loop
exitwhen j>5
if GetItemTypeId(UnitItemInSlot(Gb[id],j))==Cbthen
set zA[id]=true
endif
set j=j+1
endloop
set j=0
set i=i+1
endloop
call EnableTrigger(hO)
call EnableTrigger(CO)
set EB=(EB+1)
loop
exitwhen EB>IB
set i=1
loop
exitwhen i>NB[(EB+1)]
call UnitAddAbility(Gb[id],AB[NB[EB]])
set i=i+1
endloop
set EB=EB+1
endloop
set i=1
loop
exitwhen i>XB
if GetUnitAbilityLevel(Gb[id],AB)>0 then
set lN[id]=lN[id]+1
endif
set i=i+1
endloop
set hb[id]=CreateUnit(p,'h001',-6477,-12675,270)
call ShowUnit(hb[id],false)
if GetUnitTypeId(Gb[id])=='U005' or GetUnitTypeId(Gb[id])=='U00C' then
set Qb[id]="ReplaceableTextures\\CommandButtons\\BTNHeroDreadLord.blp"
call UnitAddAbility(Gb[id],'A002')
elseif GetUnitTypeId(Gb[id])=='U007' or GetUnitTypeId(Gb[id])=='U00D' then
set Qb[id]="ReplaceableTextures\\CommandButtons\\BTNHeroDeathKnight.blp"
call UnitAddAbility(Gb[id],'A00K')
elseif GetUnitTypeId(Gb[id])=='U009' or GetUnitTypeId(Gb[id])=='U00F' then
set Qb[id]="ReplaceableTextures\\CommandButtons\\BTNLichVersion2.blp"
call UnitAddAbility(Gb[id],'A00G')
elseif GetUnitTypeId(Gb[id])=='U00A' or GetUnitTypeId(Gb[id])=='U00G' then
set Qb[id]="ReplaceableTextures\\CommandButtons\\BTNKelThuzad.blp"
call UnitAddAbility(Gb[id],'A01A')
elseif GetUnitTypeId(Gb[id])=='U008' or GetUnitTypeId(Gb[id])=='U00E' then
set Qb[id]="ReplaceableTextures\\CommandButtons\\BTNPitLord.blp"
call UnitAddAbility(Gb[id],'A012')
endif
call MultiboardSetItemIconBJ(Tb,SN[id],2,Qb[id])
call MultiboardSetItemValueBJ(Tb,SN[id],15,"|CFF82CA9C0|r")
if UN[id]>3 then
call MultiboardSetItemValueBJ(Tb,SN[id],10,"|cffF0F0F0MASTER|r")
set FC[id]=true
else
call MultiboardSetItemValueBJ(Tb,SN[id],10,"|cffF0F0F0"+I2S(UN[id])+"|r")
endif
if wN[id]>3 then
call MultiboardSetItemValueBJ(Tb,SN[id],11,"|cff9400D3MASTER|r")
set FC[id]=true
else
call MultiboardSetItemValueBJ(Tb,SN[id],11,"|cff9400D3"+I2S(wN[id])+"|r")
endif
if WN[id]>3 then
call MultiboardSetItemValueBJ(Tb,SN[id],12,"|cff7FFFD4MASTER|r")
set FC[id]=true
else
call MultiboardSetItemValueBJ(Tb,SN[id],12,"|cff7FFFD4"+I2S(WN[id])+"|r")
endif
if yN[id]>3 then
call MultiboardSetItemValueBJ(Tb,SN[id],13,"|cffBCD2EEMASTER|r")
set FC[id]=true
else
call MultiboardSetItemValueBJ(Tb,SN[id],13,"|cffBCD2EE"+I2S(yN[id])+"|r")
endif
if YN[id]>3 then
call MultiboardSetItemValueBJ(Tb,SN[id],14,"|cffFFF68FMASTER|r")
set FC[id]=true
else
call MultiboardSetItemValueBJ(Tb,SN[id],14,"|cffFFF68F"+I2S(YN[id])+"|r")
endif
call PlaySoundBJ(wr)
call DisplayTimedTextToForce(PG,10,wk(p)+" has arisen from the dead, ready to serve the scourge!")
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Other\\Awaken\\Awaken.mdl",Gb[id],"origin"))
call SetUnitVertexColor(hb[0],255,0,0,255)
call SetUnitVertexColor(hb[1],0,0,255,255)
call SetUnitVertexColor(hb[2],0,255,170,255)
call SetUnitVertexColor(hb[3],178,58,238,255)
call SetUnitVertexColor(hb[4],255,255,0,255)
set gb=Gb[GetPlayerId(jb)]
set jB=jB+1
call TriggerSleepAction(1)
if jB==gN then
loop
exitwhen Pc==false
call TriggerSleepAction(1)
endloop
call em()
endif
endfunction
function pm takes nothing returns nothing
call CameraSetupApplyForPlayer(true,Mx,GetEnumPlayer(),0)
call SetCameraTargetControllerNoZForPlayer(GetEnumPlayer(),xI,0,0,false)
endfunction


Edit: Script is from Dark Invasion.
User avatar
Aero
Forum Staff
Posts: 829
Joined: January 28th, 2007, 8:10 pm
Title: JASS Programmer
Location: Canada

Re: need help with save code trigger

Post by Aero »

You're missing a ton of functions.

Also, 10k stats might not be possible. It has to do with the charset used and the number of characters allocated to store stats.
grand
Member
Posts: 67
Joined: January 6th, 2008, 10:05 pm

Re: need help with save code trigger

Post by grand »

Ok, so how can I change the charset and number of characters used for the codes.

I uploaded the whole script if you want to see it as I have no idea what else is related to the trigger.

Couldn't upload the file with .j extension.
You do not have the required permissions to view the files attached to this post.
User avatar
Aero
Forum Staff
Posts: 829
Joined: January 28th, 2007, 8:10 pm
Title: JASS Programmer
Location: Canada

Re: need help with save code trigger

Post by Aero »

You can't change the charset used or the amount of characters allocated to the save code without modifying the map itself; which means you can't load that code in the original map.
grand
Member
Posts: 67
Joined: January 6th, 2008, 10:05 pm

Re: need help with save code trigger

Post by grand »

I see, but I got no intention in loading it in the original map.
User avatar
Ozzapoo
The Flying Cow!
Posts: 2196
Joined: November 2nd, 2007, 10:34 pm
Location: Melbourne

Re: need help with save code trigger

Post by Ozzapoo »

grand wrote:I see, but I got no intention in loading it in the original map.
What....?
Visit Ozzapoo.net, my blog and the home of AutoCP and Cheatpack Detector!
AutoCP3 now available for free!
User avatar
Aero
Forum Staff
Posts: 829
Joined: January 28th, 2007, 8:10 pm
Title: JASS Programmer
Location: Canada

Re: need help with save code trigger

Post by Aero »

If you have no intention of loading it into the original map then why not just insert a cheatpack?
grand
Member
Posts: 67
Joined: January 6th, 2008, 10:05 pm

Re: need help with save code trigger

Post by grand »

Yes, I could add cheat packs to it but I also want to make sure that having 1k or more stats can be saved.
User avatar
Ozzapoo
The Flying Cow!
Posts: 2196
Joined: November 2nd, 2007, 10:34 pm
Location: Melbourne

Re: need help with save code trigger

Post by Ozzapoo »

Why would you want to make sure you can save it, yet you won't load it in the map..? That makes no sense... And I doubt anyone would do it at all, since it's just a waste of time :?
Visit Ozzapoo.net, my blog and the home of AutoCP and Cheatpack Detector!
AutoCP3 now available for free!
grand
Member
Posts: 67
Joined: January 6th, 2008, 10:05 pm

Re: need help with save code trigger

Post by grand »

Ah yes, its true that it would be worthless to make sure I can save it but won't be able to load it in the map. I forgot to mention to change the load trigger too.

Edit: Nevermind, I found another way to do this without changing any part of the map besides the script.