Question for Xantan: How to set mp to certain %?

General talk about editing, cheating, and deprotecting maps.

Moderator: Cheaters

initialD
Some Honorary Title
Posts: 1713
Joined: June 8th, 2007, 5:08 am
Title: Angry Bird

Question for Xantan: How to set mp to certain %?

Post by initialD »

Obviously this code will set hero mana to 50% but it won't regens normally.

call SetUnitManaPercentBJ( GetTriggerUnit(), 50 )

Could you show me the code where I got set hero's mp to >50%, instead of just 50%?
Just like what you do on your cheat pack.
If it's hard then neverminded.
Thanks
User avatar
Xantan
Honorary wc3edit.net Traitor
Posts: 2507
Joined: February 1st, 2007, 4:11 pm
Location: NEVADA

Re: Question for Xantan: How to set mp to certain %?

Post by Xantan »

Do you mean on -nocd or on -mp

like you want

-nocd on #

then it sets it to the number only when its below it?


or do you want

-mp #

sets mp to # specified?

or do you want... let me know I'll help out. its good to ask questions, don't be afraid.
initialD
Some Honorary Title
Posts: 1713
Joined: June 8th, 2007, 5:08 am
Title: Angry Bird

Re: Question for Xantan: How to set mp to certain %?

Post by initialD »

Actually the the code I mentioned was on dota cheat menu. It will set hero mana to 100% when someone use it.
I just want it to set player's mp to 40% when player's mp is below 40%, so it wont be obvious.

I edit the code to call SetUnitManaPercentBJ( GetTriggerUnit(), 50 )
Yet it doesn't work, hero mp just stuck there at 50%, mp wont regenerate. So it you could help me fix it I would appreciate it.
I the mp to work like in your cheat pack. It will regenerate normally until mp is below 50%. It will only set it back to 50% if the mp is below 50%.
Note: NoCd and mp setting is serepated in dota cheat menu, so can you just teach me how to do the mp thing? thanks
User avatar
Xantan
Honorary wc3edit.net Traitor
Posts: 2507
Joined: February 1st, 2007, 4:11 pm
Location: NEVADA

Re: Question for Xantan: How to set mp to certain %?

Post by Xantan »

You probably don't know jass on this, so its ok to GUI, then if you really want you can just optimize it with vex...

Ok so

if/then/else

If - REAL - Mana % of - random unit - of hero type owned by player triggering player less then 50%

(probably a AND, boolean and whatever else, or whatever, just pick every unit if you want, but I figure only go for the hero)

Then - set triggering units mana to 50%
Else - Do nothing

something like that would do it, yea?

I still am not 100% sure youre talking about nocd or w/e but yeah, that..
initialD
Some Honorary Title
Posts: 1713
Joined: June 8th, 2007, 5:08 am
Title: Angry Bird

Re: Question for Xantan: How to set mp to certain %?

Post by initialD »

Yes that's what I want.
Could you show me the Jass code?
User avatar
Xantan
Honorary wc3edit.net Traitor
Posts: 2507
Joined: February 1st, 2007, 4:11 pm
Location: NEVADA

Re: Question for Xantan: How to set mp to certain %?

Post by Xantan »

sure:


  • Globals
    Spoiler:
    globals
    integer array udg_integer_array_test_xantan_nocd
    trigger gg_trg_nocdxantanexample=null
    trigger gg_trg_nocdxantanexample2=null
    endglobals

  • Functions
    Spoiler:
    function Trig_nocdxantanexample_Actions takes nothing returns nothing
    set udg_integer_array_test_xantan_nocd[(1+GetPlayerId(GetTriggerPlayer()))]=S2I(SubStringBJ(GetEventPlayerChatString(),6,20))
    endfunction
    function Trig_nocdxantanexample2_F takes nothing returns boolean
    return(GetUnitManaPercent(GetTriggerUnit())<I2R(udg_integer_array_test_xantan_nocd[(1+GetPlayerId(GetTriggerPlayer()))]))
    endfunction
    function Trig_nocdxantanexample2_Actions takes nothing returns nothing
    if(Trig_nocdxantanexample2_F())then
    call SetUnitManaPercentBJ(GetTriggerUnit(),I2R(udg_integer_array_test_xantan_nocd[(1+GetPlayerId(GetTriggerPlayer()))]))
    endif
    endfunction

  • Function Main
    Spoiler:
    local integer i
    set i=0
    set i=0
    loop
    exitwhen(i>1)
    set udg_integer_array_test_xantan_nocd=0
    set i=i+1
    endloop
    set gg_trg_nocdxantanexample=CreateTrigger()
    call TriggerRegisterPlayerChatEvent(gg_trg_nocdxantanexample,Player(0),"-nocd",false)
    call TriggerAddAction(gg_trg_nocdxantanexample,function Trig_nocdxantanexample_Actions)
    set gg_trg_nocdxantanexample2=CreateTrigger()
    call TriggerRegisterAnyUnitEventBJ(gg_trg_nocdxantanexample2,EVENT_PLAYER_UNIT_ATTACKED)
    call TriggerRegisterAnyUnitEventBJ(gg_trg_nocdxantanexample2,EVENT_PLAYER_UNIT_SPELL_FINISH)
    call TriggerRegisterAnyUnitEventBJ(gg_trg_nocdxantanexample2,EVENT_PLAYER_UNIT_ISSUED_ORDER)
    call TriggerRegisterAnyUnitEventBJ(gg_trg_nocdxantanexample2,EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER)
    call TriggerRegisterAnyUnitEventBJ(gg_trg_nocdxantanexample2,EVENT_PLAYER_UNIT_ISSUED_POINT_ORDER)
    call TriggerAddAction(gg_trg_nocdxantanexample2,function Trig_nocdxantanexample2_Actions)

So -nocd #
then when your units are below that number it sets it to that

but you'll want trigger turn on, turn off, maybe a unit group variable, and you'll want to finish it for all players instead of just red, play around with that though or ask for more help.
initialD
Some Honorary Title
Posts: 1713
Joined: June 8th, 2007, 5:08 am
Title: Angry Bird

Re: Question for Xantan: How to set mp to certain %?

Post by initialD »

tahnks xantan, that's really helpful.

One last thing. Dota cheat menu will show the amount gold you have cheated in the resourse bar on the end game menu. I think there is a way to hide it, just as in your cheat pack.

Here is the code for gold hacked in dota-cheat menu, could you probably add a few jass trigger inside so the cheated gold resourses wouldn't be shown in the end game menu? thanks man.

Code: Select all

 

set i = 0
    loop
        exitwhen (i > 13)
        set udg_gold_lvl[i] = 0
        set i = i + 1
    endloop

    set i = 0
    loop
        exitwhen (i > 13)
        set udg_gold_prev[i] = -1
        set i = i + 1
    endloop


//==================================================

function Trig_Gold_Hack_Func001Func003001 takes nothing returns boolean
    return ( udg_gold_prev[GetConvertedPlayerId(GetTriggerPlayer())] == -1 )
endfunction

function Trig_Gold_Hack_Func001C takes nothing returns boolean
    if ( not ( GetPlayerState(GetTriggerPlayer(), PLAYER_STATE_RESOURCE_GOLD) > udg_gold_prev[GetConvertedPlayerId(GetTriggerPlayer())] ) ) then
        return false
    endif
    return true
endfunction

function Trig_Gold_Hack_Actions takes nothing returns nothing
    if ( Trig_Gold_Hack_Func001C() ) then
        call DisableTrigger( GetTriggeringTrigger() )
        if ( Trig_Gold_Hack_Func001Func003001() ) then
            call DoNothing(  )
        else
            call AdjustPlayerStateBJ( ( ( udg_gold_lvl[GetConvertedPlayerId(GetTriggerPlayer())] * ( GetPlayerState(GetTriggerPlayer(), PLAYER_STATE_RESOURCE_GOLD) - udg_gold_prev[GetConvertedPlayerId(GetTriggerPlayer())] ) ) / 2 ), GetTriggerPlayer(), PLAYER_STATE_RESOURCE_GOLD )
        endif
        call EnableTrigger( GetTriggeringTrigger() )
        set udg_gold_prev[GetConvertedPlayerId(GetTriggerPlayer())] = GetPlayerState(GetTriggerPlayer(), PLAYER_STATE_RESOURCE_GOLD)
    else
        set udg_gold_prev[GetConvertedPlayerId(GetTriggerPlayer())] = GetPlayerState(GetTriggerPlayer(), PLAYER_STATE_RESOURCE_GOLD)
    endif
endfunction

//===========================================================================
function InitTrig_Gold_Hack takes nothing returns nothing
    set gg_trg_Gold_Hack = CreateTrigger(  )
    call TriggerRegisterPlayerStateEvent( gg_trg_Gold_Hack, Player(1), PLAYER_STATE_RESOURCE_GOLD, GREATER_THAN_OR_EQUAL, 0.00 )
    call TriggerRegisterPlayerStateEvent( gg_trg_Gold_Hack, Player(2), PLAYER_STATE_RESOURCE_GOLD, GREATER_THAN_OR_EQUAL, 0.00 )
    call TriggerRegisterPlayerStateEvent( gg_trg_Gold_Hack, Player(3), PLAYER_STATE_RESOURCE_GOLD, GREATER_THAN_OR_EQUAL, 0.00 )
    call TriggerRegisterPlayerStateEvent( gg_trg_Gold_Hack, Player(4), PLAYER_STATE_RESOURCE_GOLD, GREATER_THAN_OR_EQUAL, 0.00 )
    call TriggerRegisterPlayerStateEvent( gg_trg_Gold_Hack, Player(5), PLAYER_STATE_RESOURCE_GOLD, GREATER_THAN_OR_EQUAL, 0.00 )
    call TriggerRegisterPlayerStateEvent( gg_trg_Gold_Hack, Player(7), PLAYER_STATE_RESOURCE_GOLD, GREATER_THAN_OR_EQUAL, 0.00 )
    call TriggerRegisterPlayerStateEvent( gg_trg_Gold_Hack, Player(8), PLAYER_STATE_RESOURCE_GOLD, GREATER_THAN_OR_EQUAL, 0.00 )
    call TriggerRegisterPlayerStateEvent( gg_trg_Gold_Hack, Player(9), PLAYER_STATE_RESOURCE_GOLD, GREATER_THAN_OR_EQUAL, 0.00 )
    call TriggerRegisterPlayerStateEvent( gg_trg_Gold_Hack, Player(10), PLAYER_STATE_RESOURCE_GOLD, GREATER_THAN_OR_EQUAL, 0.00 )
    call TriggerRegisterPlayerStateEvent( gg_trg_Gold_Hack, Player(11), PLAYER_STATE_RESOURCE_GOLD, GREATER_THAN_OR_EQUAL, 0.00 )
    call TriggerAddAction( gg_trg_Gold_Hack, function Trig_Gold_Hack_Actions )
endfunction
User avatar
Xantan
Honorary wc3edit.net Traitor
Posts: 2507
Joined: February 1st, 2007, 4:11 pm
Location: NEVADA

Re: Question for Xantan: How to set mp to certain %?

Post by Xantan »

That trigger is worthless... what is that, a screwed up way thats for sure, sets it as a variable and does math for no reason just for a -gold hack!

you need better code just for that before Ill show you how..


But its just player -> property -> gold accumulated or something in gui. find it =/