wc3edit.net

United Warcraft 3 map hacking!
It is currently August 8th, 2020, 5:03 pm

All times are UTC




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: [IN⁴]Jass
PostPosted: July 20th, 2020, 11:29 pm 
Offline
Member
User avatar

Joined: February 22nd, 2016, 1:56 am
Posts: 76
it is not really a map that I need information with, but more about jass it is about a function:
Code:
trigger gg_trg_SeiseDeath=null

function Trig_SeiseDeathConditions takes nothing returns boolean
return((IsUnitType(GetDyingUnit(),UNIT_TYPE_HERO)==true))
endfunction

function InitTrig_SeiseDeath takes nothing returns nothing
    set gg_trg_SeiseDeath=CreateTrigger()
    call TriggerRegisterAnyUnitEventBJ(gg_trg_SeiseDeath,EVENT_PLAYER_UNIT_DEATH)
    call TriggerAddCondition(gg_trg_SeiseDeath,Condition(function Trig_SeiseDeathConditions))
    call TriggerAddAction(gg_trg_SeiseDeath,function Trig_SeiseDeathActions)
endfunction

call InitTrig_SeiseDeath()

It is when a hero kills or dies and an event is generated reproducing sound because I already know how to do it with the heroes and their IDs but I would like to know if there is any way that the event happens not with the hero's ID but for example if a hero It is controlled by a player with a special name, either any hero that player controls will only reproduce the sound if it has the special name. for example, but only the sound of death will be generated if the player uses the name of Madara with any hero but if he does not use the name of Madara, won't the sound sound after killing an enemy hero if they understand me? I hope you can help me by giving me that event I will leave you an example of when one hero kills another

Code:
if((GetUnitTypeId(GetDyingUnit())=='H022')and(GetUnitTypeId(GetKillingUnitBJ())=='H0FX'))then
call psnd("war3mapImported\\KVSH.mp3")
else
endif


When a hero dies

Code:
if((GetUnitTypeId(GetDyingUnit())=='H02S')and(IsUnitIllusionBJ(GetDyingUnit())==false))then
call psnd("war3mapImported\\JeanneAltdeath.mp3")
else
endif


and when a hero kills but it has a random death sound and these are 4 sounds it plays 1 of 4

Code:
if(GetUnitTypeId(GetKillingUnit())=='H01R')then
call psnd4("war3mapImported\\AizenKill1.mp3","war3mapImported\\AizenKill2.mp3","war3mapImported\\AizenKill3.mp3","war3mapImported\\AizenKill4.mp3")
endif


Top
 Profile  
 
 Post subject: Re: [IN⁴]Jass
PostPosted: July 21st, 2020, 1:06 am 
Offline
Also Not an Admin, but closer than devoltz
User avatar

Joined: February 14th, 2018, 5:35 am
Posts: 1411
Title: Just Another S.Mod
Wrong section. If you want that kind of help, post in Map Editing.

Btw, you would need to use this simple call:
Code:
GetPlayerName( GetOwningPlayer( GetDyingUnit( ) ) ) == "Name here"



Code:
if GetUnitTypeId( GetDyingUnit( ) ) == 'H022' and GetUnitTypeId( GetKillingUnitBJ( ) ) == 'H0FX' and GetPlayerName( GetOwningPlayer( GetDyingUnit( ) ) ) == "Madara" then
   call psnd( "war3mapImported\\KVSH.mp3" )
endif


Top
 Profile  
 
 Post subject: Re: [IN⁴]Jass
PostPosted: July 21st, 2020, 3:59 am 
Offline
Member
User avatar

Joined: February 22nd, 2016, 1:56 am
Posts: 76
First, Thanks sensei!! you are the best!!! second im sorry i dont know where put this, now i know dont will be reply again,third this who i need!!

Code:
GetPlayerName( GetOwningPlayer( GetDyingUnit( ) ) ) == "Madara" then
   call psnd( "war3mapImported\\KVSH.mp3" )
endif

Code:
"GetDyingUnit"

that's for when he dies right? I need when it kills how this

Code:
"GetKillingUnitBJ"


Top
 Profile  
 
 Post subject: Re: [IN⁴]Jass
PostPosted: July 21st, 2020, 4:10 am 
Offline
Also Not an Admin, but closer than devoltz
User avatar

Joined: February 14th, 2018, 5:35 am
Posts: 1411
Title: Just Another S.Mod
It's ok. You're welcome.

Use GetKillingUnit( ) instead of GetDyingUnit( ).


Top
 Profile  
 
 Post subject: Re: [IN⁴]Jass
PostPosted: July 21st, 2020, 6:07 am 
Offline
Member
User avatar

Joined: February 22nd, 2016, 1:56 am
Posts: 76
:D! Sensei! U Are The Best!!!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 8 guests


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® Forum Software © phpBB Group

phpBB SEO


Privacy Policy Statement
Impressum (German)