Need Assistance!! Finding Trigger in JASS!

General discussion of Warcraft 3. Threads may may be posted here if they don't fit into the other sections.

Moderator: Cheaters

User avatar
[Blade]
Member
Posts: 90
Joined: August 18th, 2013, 4:48 pm
Title: The Day Walker
Location: Vampire Hunting

Need Assistance!! Finding Trigger in JASS!

Post by [Blade] »

i play rpgs quite a bit, (particularly korean ones) however not always are items blatantly clear in how to craft if there is a crafting system, so i'd like to know how to find the triggers in jass.

For Example , say player 1 said "-create" and had item A + B in inventory this gives him item C
and later item C + D then he said "-create" again made item E
how would one find this in jass? (if i can, if not any alternatives?)



*Thanks to anyone whom can help*
User avatar
Syre
Forum Staff
Posts: 506
Joined: November 17th, 2008, 3:49 pm

Re: Need Assistance!! Finding Trigger in JASS!

Post by Syre »

The way i go about it is searching the jass for the -create command. For korean maps though, the command may not be completely in english and jasscraft cant search unicode. In that case start the search with PlayerChatEvent till you come across the command. What you're looking for should be right under, or pretty close to that line. You're mainly looking for the lines that remove and add items.

For an example, here is what it looks like for Greed RPG.
Spoiler:

Code: Select all

function InitTrig_roon10 takes nothing returns nothing
set gg_trg_roon10=CreateTrigger()
call TriggerRegisterPlayerChatEvent(gg_trg_roon10,Player(0),"-ì¡°í•©",true)
call TriggerRegisterPlayerChatEvent(gg_trg_roon10,Player(1),"-ì¡°í•©",true)
call TriggerRegisterPlayerChatEvent(gg_trg_roon10,Player(2),"-ì¡°í•©",true)
call TriggerRegisterPlayerChatEvent(gg_trg_roon10,Player(3),"-ì¡°í•©",true)
call TriggerRegisterPlayerChatEvent(gg_trg_roon10,Player(4),"-ì¡°í•©",true)
call TriggerRegisterPlayerChatEvent(gg_trg_roon10,Player(5),"-ì¡°í•©",true)
call TriggerRegisterPlayerChatEvent(gg_trg_roon10,Player(6),"-ì¡°í•©",true)
call TriggerRegisterPlayerChatEvent(gg_trg_roon10,Player(7),"-ì¡°í•©",true)
call TriggerRegisterPlayerChatEvent(gg_trg_roon10,Player(8),"-ì¡°í•©",true)
call TriggerAddAction(gg_trg_roon10,function Trig_roon10_Actions)
endfunction
function Trig_roon9_Func001C takes nothing returns boolean
if(not(UnitHasItemOfTypeBJ(udg_unitUserHero[GetConvertedPlayerId(GetTriggerPlayer())],'ciri')==true))then
return false
endif
if(not(UnitHasItemOfTypeBJ(udg_unitUserHero[GetConvertedPlayerId(GetTriggerPlayer())],'I01B')==true))then
return false
endif
return true
endfunction
function Trig_roon9_Actions takes nothing returns nothing
if(Trig_roon9_Func001C())then
call RemoveItem(GetItemOfTypeFromUnitBJ(udg_unitUserHero[GetConvertedPlayerId(GetTriggerPlayer())],'ciri'))
call RemoveItem(GetItemOfTypeFromUnitBJ(udg_unitUserHero[GetConvertedPlayerId(GetTriggerPlayer())],'I01B'))
call UnitAddItemByIdSwapped('I01M',udg_unitUserHero[GetConvertedPlayerId(GetTriggerPlayer())])
call DisplayTimedTextToPlayer(GetTriggerPlayer(),0,0,3.00,"[조합]9급룬을 조합하였습니다.")
else
endif
endfunction
Near the bottom there are three lines that remove two items and add one. In this case it removes items with the rawcode ciri and I01B and replaces them with I01M. Every system is a little different but you should be able to find what you're looking for like that.

The problem now is that you have three items but no idea which ones they are just by the rawcode. You can try looking in the rawcodes for the map, but for korean maps it doesn't help much unless you understand the language.
Spoiler:

Code: Select all

[ciri\1667854953]|CFF87CEFA[Normal]10급 신성한 룬|R
[I01B\1227895106][Mix]9급 룬의 조각
[I01M\1227895117]|CFF87CEFA[Normal]9급 신성한 룬|R
Now if Warcraft displays the name of the item and you understand korean, you should be fine but that's probably not the case. Let's say you picked up an item in the game but have no idea what to combine it with. This is where JJCP comes in. JJCP has a very useful command to help in this situation called -itemid. It's just as it sounds, its able to give you a rawcode of the item in the top-left of your inventory. After getting the rawcode search the Jass again using it till you get to the trigger where its removed. Copy down the second item needed and go back to the game and this time use the -spawn code for the other item. You should have both items needed now and the -create command should work fine. I can't really give any tips how to find the second item in game though, so thats up to you to find out. I hope this answers everything.
Image
User avatar
[Blade]
Member
Posts: 90
Joined: August 18th, 2013, 4:48 pm
Title: The Day Walker
Location: Vampire Hunting

Re: Need Assistance!! Finding Trigger in JASS!

Post by [Blade] »

thank you very much,
one question though,
if in a game instead of a command you walk somewhere to create an item, what would it be near rather than the chatevent of "-create"??
User avatar
Syre
Forum Staff
Posts: 506
Joined: November 17th, 2008, 3:49 pm

Re: Need Assistance!! Finding Trigger in JASS!

Post by Syre »

Off the top of my head im not quite sure. EnterRect would work but that would take a very long time to search through everything. Point me in the direction of a map that has that kind of system and ill take a look.
Image
User avatar
[Blade]
Member
Posts: 90
Joined: August 18th, 2013, 4:48 pm
Title: The Day Walker
Location: Vampire Hunting

Re: Need Assistance!! Finding Trigger in JASS!

Post by [Blade] »

this map here - http://www.makemehost.com/ShareMaps/new ... ..3.41.w3x
has a system like that and im kinda stuck on items myself
if you could take a look and find anything helpful it would be much appreciated.
User avatar
Syre
Forum Staff
Posts: 506
Joined: November 17th, 2008, 3:49 pm

Re: Need Assistance!! Finding Trigger in JASS!

Post by Syre »

Alright, well probably searching for RemoveItem and AddItem are your best bets to find em. I found a small number of recipes in the map but ive got no way to test them out, unless I get a hold of a cheated map. Apparently for this map the items use a different numbering than others like Greed for instance but the rawcodes still give the spawning code.
Spoiler:

Code: Select all

function Gx takes nothing returns boolean
return(UnitHasItemOfTypeBJ(GetTriggerUnit(),1227894834))and(UnitHasItemOfTypeBJ(GetTriggerUnit(),1227894849))and(UnitHasItemOfTypeBJ(GetTriggerUnit(),1227894841))
endfunction
function Hx takes nothing returns nothing
if(Gx())then
call RemoveItem(GetItemOfTypeFromUnitBJ(GetEnteringUnit(),1227894834))
call RemoveItem(GetItemOfTypeFromUnitBJ(GetEnteringUnit(),1227894841))
call RemoveItem(GetItemOfTypeFromUnitBJ(GetEnteringUnit(),1227894849))
call UnitAddItemByIdSwapped(1227894836,GetTriggerUnit())
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,6.,("|c0000ffff"+(GetItemName(bj_lastCreatedItem)+"|c00ffff00을(를) 조합하였습니다.|r")))
endif
endfunction
Spoiler:

Code: Select all

[I002\1227894834]소원의 돌 파편
[I009\1227894841]노말 왕초보 기사
[I00A\1227894849]울프의 어금니

[I004\1227894836]매직|r 나도 기사다
Image
User avatar
[Blade]
Member
Posts: 90
Joined: August 18th, 2013, 4:48 pm
Title: The Day Walker
Location: Vampire Hunting

Re: Need Assistance!! Finding Trigger in JASS!

Post by [Blade] »

thanks, appreciated
but how did u compare the long codes to a raw code list to find what item it corresponded to?
User avatar
Syre
Forum Staff
Posts: 506
Joined: November 17th, 2008, 3:49 pm

Re: Need Assistance!! Finding Trigger in JASS!

Post by Syre »

Im not exactly even sure what the long string of numbers for that map represent so maybe i got lucky in that regard, but basicly i ripped the rawcodes from the map using RMPQEx and then i used Haxorizer and cleaned them up. It ended up in that format. I looked over the uncleaned rawcode list but those numbers aren't shown, so im not really sure. Perhaps someone else can shed some light on that.
Image
User avatar
[Blade]
Member
Posts: 90
Joined: August 18th, 2013, 4:48 pm
Title: The Day Walker
Location: Vampire Hunting

Re: Need Assistance!! Finding Trigger in JASS!

Post by [Blade] »

can u post that list of cleaned codes?
User avatar
Syre
Forum Staff
Posts: 506
Joined: November 17th, 2008, 3:49 pm

Re: Need Assistance!! Finding Trigger in JASS!

Post by Syre »

Sure
You do not have the required permissions to view the files attached to this post.
Image