wc3edit.net

United Warcraft 3 map hacking!
It is currently January 6th, 2009, 9:57 am

 

All times are UTC




Post new topic Reply to topic  [ 64 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6, 7  Next
Author Message
 Post subject: Re: >> JASS/GUI requests/questions in here <<
PostPosted: August 11th, 2008, 7:14 pm 
Offline
Member

Joined: January 6th, 2008, 10:05 pm
Posts: 43
The trigger worked now, thank you. I was thinking, does this trigger cause memory leak or lag? If yes, how do I fix it?
1st part:
Spoiler:
trigger gg_trg_Backtrack =null

2nd part:
Spoiler:
function Trig_Backtrack_Conditions takes nothing returns boolean
if ( not ( UnitHasBuffBJ(GetTriggerUnit(), 'B03S') == true ) ) then
return false
endif
return true
endfunction

function Backtrack_Main takes nothing returns nothing
local unit lfo=GetTriggerUnit()
local real lf7=GetEventDamage()
if(lf7>0)then
if(GetRandomInt(1,100)<=(10+(15*GetUnitAbilityLevel(lfo,'A0KP'))))then
call SetUnitState(lfo,UNIT_STATE_LIFE,GetUnitState(lfo,UNIT_STATE_LIFE)+lf7)
endif
endif
endfunction

function Trig_Backtrack_Actions takes nothing returns nothing
local trigger ltt
if GetUnitAbilityLevel(GetTriggerUnit(),'A0KP')==1 then
set ltt=CreateTrigger()
call TriggerRegisterUnitEvent(ltt,GetTriggerUnit(),EVENT_UNIT_DAMAGED)
call TriggerAddAction(ltt,function Backtrack_Main)
endif
endfunction

function StartTrig_Backtrack takes nothing returns nothing
set gg_trg_Backtrack=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(gg_trg_Backtrack,EVENT_PLAYER_UNIT_ATTACKED)
call TriggerAddCondition(gg_trg_Backtrack,Condition(function Trig_Backtrack_Conditions))
call TriggerAddAction(gg_trg_Backtrack,function Trig_Backtrack_Actions)
endfunction

last part:
Spoiler:
call StartTrigger_Backtrack()


Top
 Profile  
 
 Post subject: Re: >> JASS/GUI requests/questions in here <<
PostPosted: August 12th, 2008, 1:25 am 
Offline
Co-Admin
User avatar

Joined: January 28th, 2007, 8:10 pm
Posts: 729
Location: Canada
Title: JASS Programmer
Yes there are memory leaks.
There is also a coding problem.
Use this:

Code:
function Trig_Backtrack_Conditions takes nothing returns boolean
return GetUnitAbilityLevel(GetTriggerUnit(), 'B03S')>0
endfunction

function Backtrack_Main takes nothing returns nothing
local unit lfo=GetTriggerUnit()
local real lf7=GetEventDamage()
if(lf7>0)then
if(GetRandomInt(1,100)<=(10+(15*GetUnitAbilityLevel(lfo,'A0KP'))))then
call SetWidgetLife(lfo,GetWidgetLife(lfo)+lf7)
endif
endif
call DestroyTrigger(GetTriggeringTrigger())
endfunction

function Trig_Backtrack_Actions takes nothing returns nothing
local trigger ltt=CreateTrigger()
if GetUnitAbilityLevel(GetTriggerUnit(),'A0KP')>=1 then
call TriggerRegisterUnitEvent(ltt,GetTriggerUnit(),EVENT_UNIT_DAMAGED)
call TriggerAddAction(ltt,function Backtrack_Main)
else
call DestroyTrigger(ltt)
endif
set ltt=null
endfunction


By the looks of this, when a unit is attacked, it has a chance to negate the damage received.
Only a few flaws:

If the negated damage is greater than your max HP, you'll die (Even if it was "blocked").
If you negate damage but your HP is full, you will take the damage.

_________________
Image


Top
 Profile  
 
 Post subject: Re: >> JASS/GUI requests/questions in here <<
PostPosted: August 13th, 2008, 2:52 am 
Offline
Super Moderator
User avatar

Joined: June 8th, 2007, 5:08 am
Posts: 996
Location: Malaysia
Title: Not a Hacker
is that possible I edit the spells/items' tooltips without deprotecting a map?
I searched a few files but failed to get any tooltips text.
I guess I should at least have WE or WEU to do it?

_________________
ImageImageImage


Top
 Profile  
 
 Post subject: Re: >> JASS/GUI requests/questions in here <<
PostPosted: August 15th, 2008, 2:07 am 
Offline
Co-Admin
User avatar

Joined: January 28th, 2007, 8:10 pm
Posts: 729
Location: Canada
Title: JASS Programmer
I assume you mean a non-widgetized map (This is even easier to edit, just change the tooltip in the .txt file).

To do this, extract the following files into a dummy map:

war3map.w3u
war3map.w3a
war3map.w3t
war3map.wts

Then edit away, save, and re-import those files.

_________________
Image


Top
 Profile  
 
 Post subject: Re: >> JASS/GUI requests/questions in here <<
PostPosted: August 18th, 2008, 8:32 am 
Offline
Member
User avatar

Joined: January 25th, 2008, 5:20 pm
Posts: 80
Title: Lazy
I need help with a trigger
I recovered gui from a map and stole the trigger but it doesn't work and i have no idea how to get it working.
Spoiler:
Attachment:
Unbenannt.jpg

The tooltip is: Deals a small ammount of damage and magically holds enemies in their place, unable to move or attack.
Please answer in my topic: gui-triggers-f6/psionic-disturbance-help-t6692.html

_________________
Image Image
Image


Top
 Profile  
 
 Post subject: Re: >> JASS/GUI requests/questions in here <<
PostPosted: August 21st, 2008, 2:42 am 
Offline
Super Moderator
User avatar

Joined: June 8th, 2007, 5:08 am
Posts: 996
Location: Malaysia
Title: Not a Hacker
Question for Aero:
What does SetMapName actually do?
I changed the map title which is above the initial small preview icon with a hex editor, I edit the maps' filename, yet let the map name on the function config unchanged. Yet the map still running well.
So my question is, what does SetMapName really do? Since it works too even though name set by SetMapName didn't match the map's actuall name on the w3x. file.
What happens iif we didn't have SetMapName in the function config?

_________________
ImageImageImage


Top
 Profile  
 
 Post subject: Re: >> JASS/GUI requests/questions in here <<
PostPosted: August 23rd, 2008, 3:34 pm 
Offline
Co-Admin
User avatar

Joined: January 28th, 2007, 8:10 pm
Posts: 729
Location: Canada
Title: JASS Programmer
It doesn't set the file name (....w3x) it sets the actual map name.

_________________
Image


Top
 Profile  
 
 Post subject: Re: >> JASS/GUI requests/questions in here <<
PostPosted: September 3rd, 2008, 12:08 pm 
Offline
Super Moderator
User avatar

Joined: June 8th, 2007, 5:08 am
Posts: 996
Location: Malaysia
Title: Not a Hacker
Code:
local unit u=GetEnumUnit()

how to avoid memory leaks by above local?
I can't just RemoveUnit(u), becasue it will remove all units and they will be disappear.
I just wanna remove the memory leakings.
anyway doing it?
wait, does native that extends widget leaks?

_________________
ImageImageImage


Top
 Profile  
 
 Post subject: Re: >> JASS/GUI requests/questions in here <<
PostPosted: September 4th, 2008, 7:32 pm 
Offline
Co-Admin
User avatar

Joined: January 28th, 2007, 8:10 pm
Posts: 729
Location: Canada
Title: JASS Programmer
Just set u=null at the bottom of the function or after you have used it

_________________
Image


Top
 Profile  
 
 Post subject: Re: >> JASS/GUI requests/questions in here <<
PostPosted: September 5th, 2008, 10:39 am 
Offline
Super Moderator
User avatar

Joined: June 8th, 2007, 5:08 am
Posts: 996
Location: Malaysia
Title: Not a Hacker
thanks. I didn't think it was that simple.

all right here is code taken from SgGuy's cheat menu:
Code:
function hec7 takes integer bj_forLoopAIndex returns nothing
local force Fo7=GetForceOfPlayer(Player(GetForLoopIndexA()-1))
call DisplayTimedTextToForce(Fo7,10.00,(((udg_cstring[GetPlayerId(GetTriggerPlayer())+1]+(GetPlayerName(GetTriggerPlayer())+"|R"))+(" : "+GetEventPlayerChatString()))))
call DestroyForce(Fo7)
set Fo7=null
endfunction

I optimize it a bit to the following. Could you just take a look and check if there are errors or leaks?
Code:
function hec7 takes integer bj_forLoopAIndex returns nothing
local  integer Fo7=GetForLoopIndexA()-1
call DisplayTextToPlayer(Player(Fo7),0,0,(((udg_cstring[GetPlayerId(GetTriggerPlayer())+1]+(GetPlayerName(GetTriggerPlayer())+"|R"))+(" : "+GetEventPlayerChatString()))))
endfunction

_________________
ImageImageImage


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 64 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6, 7  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group

Privacy Policy Statement
Impressum (German)