• Check out the results of the Techtree Contest #19!
  • Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

Add jass line

Status
Not open for further replies.
Level 37
Joined
Aug 14, 2006
Messages
7,610
Hey,

I never was good with JASS and I have code that needs a simple thing to add. Maybe you could help me to add it?

There a system when player's hero enter "Auction Hall". Now I need condition that only three specific heroes can activate the whole thing.

So I need this trigger:

Or - Any (Conditions) are true
Conditions
(Entering unit) Equal to AAAPhodom
(Entering unit) Equal to AAAFradz
(Entering unit) Equal to AAAGaleoth


To here:



//TESH.alwaysfold=0
// Values //
// Starting price //
// Bid increase //
// Set rounds //
//=====================//

// Initializes the system's variables and settings
function AH_Setup takes nothing returns nothing
local integer i = 0
local integer j = 1
local itempool AH_Itempool = CreateItemPool()

// The region of entering AH
set udg_AH_Enter_Rect = gg_rct_AHEnter
// The AH camera
set udg_AH_Enter_Cam = gg_cam_AHCamera
// Camera bounds region for AH
set udg_AH_Cam_Bounds = gg_rct_AHCamBounds
// Hero's position at AH
set udg_AH_Hero_Point = Location(GetRectCenterX(gg_rct_AHHeroPoint), GetRectCenterY(gg_rct_AHHeroPoint))

// The auctioneer
set udg_AH_Auctionists[0] = gg_unit_nemi_0431
// The auctionists
set udg_AH_Auctionists[1] = gg_unit_Ofar_0591 // Thal
set udg_AH_Auctionists[2] = gg_unit_H01L_0590 // Sannique
set udg_AH_Auctionists[3] = gg_unit_Otch_0588 // Thohor
set udg_AH_Auctionists[4] = gg_unit_Ewrd_0593 // Liliath

//*
Code:
~~~~~~~~~~~~~~~~~ Setup auctionist preferrals ~~~~~~~~~~~~~~~~~~~ */
//* ~~~~~~
0 = Weapon || 1 = Armor || 2 = Jewel || 3 = Other
Code:
~~~~~ */

set i = GetHandleId(udg_AH_Auctionists[1])
call SaveInteger(udg_AH_Hash, i, StringHash("prefers"), 3)
call SaveInteger(udg_AH_Hash, i, StringHash("dislikes"), 0)
call SaveStr(udg_AH_Hash, i, StringHash("name"), "Thal")

set i = GetHandleId(udg_AH_Auctionists[2])
call SaveInteger(udg_AH_Hash, i, StringHash("prefers"), 2)
call SaveInteger(udg_AH_Hash, i, StringHash("dislikes"), 1)
call SaveStr(udg_AH_Hash, i, StringHash("name"), "Sannique")

set i = GetHandleId(udg_AH_Auctionists[3])
call SaveInteger(udg_AH_Hash, i, StringHash("prefers"), 1)
call SaveInteger(udg_AH_Hash, i, StringHash("dislikes"), 3)
call SaveStr(udg_AH_Hash, i, StringHash("name"), "Thohor")

set i = GetHandleId(udg_AH_Auctionists[4])
call SaveInteger(udg_AH_Hash, i, StringHash("prefers"), 0)
call SaveInteger(udg_AH_Hash, i, StringHash("dislikes"), 2)
call SaveStr(udg_AH_Hash, i, StringHash("name"), "Liliath")

//* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/


//*
Code:
~~~~~~~~~~~~~~~~~~~~~ Setup items to be sold ~~~~~~~~~~~~~~~~~~~~ */

//* ~ Weapons ~ */

set i = 1
set udg_AH_Item_Types[i] = 'I60N' // Falchion
call SaveBoolean(udg_AH_Hash, udg_AH_Item_Types[i], 0, FALSE) // Is sold more than once?
call SaveInteger(udg_AH_Hash, udg_AH_Item_Types[i], 4, 0) // Item class
call SaveInteger(udg_AH_Hash, udg_AH_Item_Types[i], 1, 3000) // Default price

set i = i + 1
set udg_AH_Item_Types[i] = 'I6E3' // Tzitorin
call SaveBoolean(udg_AH_Hash, udg_AH_Item_Types[i], 0, FALSE)
call SaveInteger(udg_AH_Hash, udg_AH_Item_Types[i], 4, 0)
call SaveInteger(udg_AH_Hash, udg_AH_Item_Types[i], 1, 1000)

set i = i + 1
set udg_AH_Item_Types[i] = 'I6DL' // Apocalypse
call SaveBoolean(udg_AH_Hash, udg_AH_Item_Types[i], 0, FALSE)
call SaveInteger(udg_AH_Hash, udg_AH_Item_Types[i], 4, 0)
call SaveInteger(udg_AH_Hash, udg_AH_Item_Types[i], 1, 3000)

set i = i + 1
set udg_AH_Item_Types[i] = 'I6DM' // Greedy Bastard
call SaveBoolean(udg_AH_Hash, udg_AH_Item_Types[i], 0, FALSE)
call SaveInteger(udg_AH_Hash, udg_AH_Item_Types[i], 4, 0)
call SaveInteger(udg_AH_Hash, udg_AH_Item_Types[i], 1, 4000)

set i = i + 1
set udg_AH_Item_Types[i] = 'I66X' // Gilmax
call SaveBoolean(udg_AH_Hash, udg_AH_Item_Types[i], 0, FALSE)
call SaveInteger(udg_AH_Hash, udg_AH_Item_Types[i], 4, 0)
call SaveInteger(udg_AH_Hash, udg_AH_Item_Types[i], 1, 18000)

set i = i + 1
set udg_AH_Item_Types[i] = 'sfog' // Sceptre of Apparitions
call SaveBoolean(udg_AH_Hash, udg_AH_Item_Types[i], 0, FALSE)
call SaveInteger(udg_AH_Hash, udg_AH_Item_Types[i], 4, 0)
call SaveInteger(udg_AH_Hash, udg_AH_Item_Types[i], 1, 20000)

//* ~ Armors ~ */

set i = i + 1
set udg_AH_Item_Types[i] = 'I67W' // Damned Carapace
call SaveBoolean(udg_AH_Hash, udg_AH_Item_Types[i], 0, FALSE)
call SaveInteger(udg_AH_Hash, udg_AH_Item_Types[i], 4, 1)
call SaveInteger(udg_AH_Hash, udg_AH_Item_Types[i], 1, 2000)

set i = i + 1
set udg_AH_Item_Types[i] = 'I61G' // True Zozi
call SaveBoolean(udg_AH_Hash, udg_AH_Item_Types[i], 0, FALSE)
call SaveInteger(udg_AH_Hash, udg_AH_Item_Types[i], 4, 1)
call SaveInteger(udg_AH_Hash, udg_AH_Item_Types[i], 1, 50000)

set i = i + 1
set udg_AH_Item_Types[i] = 'I6E0' // Lucky Horseshoe
call SaveBoolean(udg_AH_Hash, udg_AH_Item_Types[i], 0, FALSE)
call SaveInteger(udg_AH_Hash, udg_AH_Item_Types[i], 4, 1)
call SaveInteger(udg_AH_Hash, udg_AH_Item_Types[i], 1, 1000)

set i = i + 1
set udg_AH_Item_Types[i] = 'ofir' // Adamantine Guard
call SaveBoolean(udg_AH_Hash, udg_AH_Item_Types[i], 0, FALSE)
call SaveInteger(udg_AH_Hash, udg_AH_Item_Types[i], 4, 1)
call SaveInteger(udg_AH_Hash, udg_AH_Item_Types[i], 1, 30000)

set i = i + 1
set udg_AH_Item_Types[i] = 'thdm' // Speedy Gloves
call SaveBoolean(udg_AH_Hash, udg_AH_Item_Types[i], 0, FALSE)
call SaveInteger(udg_AH_Hash, udg_AH_Item_Types[i], 4, 1)
call SaveInteger(udg_AH_Hash, udg_AH_Item_Types[i], 1, 7500)

//* ~ Jewels ~ */

set i = i + 1
set udg_AH_Item_Types[i] = 'nspi' // Summoner's Amulet
call SaveBoolean(udg_AH_Hash, udg_AH_Item_Types[i], 0, FALSE)
call SaveInteger(udg_AH_Hash, udg_AH_Item_Types[i], 4, 2)
call SaveInteger(udg_AH_Hash, udg_AH_Item_Types[i], 1, 30000)

set i = i + 1
set udg_AH_Item_Types[i] = 'I6BE' // Anaho Relic
call SaveBoolean(udg_AH_Hash, udg_AH_Item_Types[i], 0, FALSE)
call SaveInteger(udg_AH_Hash, udg_AH_Item_Types[i], 4, 2)
call SaveInteger(udg_AH_Hash, udg_AH_Item_Types[i], 1, 1500)

set i = i + 1
set udg_AH_Item_Types[i] = 'I6FF' // Ring of Hope
call SaveBoolean(udg_AH_Hash, udg_AH_Item_Types[i], 0, FALSE)
call SaveInteger(udg_AH_Hash, udg_AH_Item_Types[i], 4, 2)
call SaveInteger(udg_AH_Hash, udg_AH_Item_Types[i], 1, 2000)

set i = i + 1
set udg_AH_Item_Types[i] = 'I6FG' // Ring of Despair
call SaveBoolean(udg_AH_Hash, udg_AH_Item_Types[i], 0, FALSE)
call SaveInteger(udg_AH_Hash, udg_AH_Item_Types[i], 4, 2)
call SaveInteger(udg_AH_Hash, udg_AH_Item_Types[i], 1, 2000)

set i = i + 1
set udg_AH_Item_Types[i] = 'I6G7' // Orb Of Magic
call SaveBoolean(udg_AH_Hash, udg_AH_Item_Types[i], 0, FALSE)
call SaveInteger(udg_AH_Hash, udg_AH_Item_Types[i], 4, 2)
call SaveInteger(udg_AH_Hash, udg_AH_Item_Types[i], 1, 2000)

set i = i + 1
set udg_AH_Item_Types[i] = 'I6DA' // Golden Eye
call SaveBoolean(udg_AH_Hash, udg_AH_Item_Types[i], 0, FALSE)
call SaveInteger(udg_AH_Hash, udg_AH_Item_Types[i], 4, 2)
call SaveInteger(udg_AH_Hash, udg_AH_Item_Types[i], 1, 7500)

set i = i + 1
set udg_AH_Item_Types[i] = 'I6BE' // Mega Ring
call SaveBoolean(udg_AH_Hash, udg_AH_Item_Types[i], 0, FALSE)
call SaveInteger(udg_AH_Hash, udg_AH_Item_Types[i], 4, 2)
call SaveInteger(udg_AH_Hash, udg_AH_Item_Types[i], 1, 2500)

set i = i + 1
set udg_AH_Item_Types[i] = 'I60F' // Tempest Stone
call SaveBoolean(udg_AH_Hash, udg_AH_Item_Types[i], 0, FALSE)
call SaveInteger(udg_AH_Hash, udg_AH_Item_Types[i], 4, 2)
call SaveInteger(udg_AH_Hash, udg_AH_Item_Types[i], 1, 1000)

//* ~ Others ~ */

set i = i + 1
set udg_AH_Item_Types[i] = 'I65M' // Second part of Holgro
call SaveBoolean(udg_AH_Hash, udg_AH_Item_Types[i], 0, FALSE)
call SaveInteger(udg_AH_Hash, udg_AH_Item_Types[i], 4, 3)
call SaveInteger(udg_AH_Hash, udg_AH_Item_Types[i], 1, 1000)

set i = i + 1
set udg_AH_Item_Types[i] = 'I624' // Golden Shovel
call SaveBoolean(udg_AH_Hash, udg_AH_Item_Types[i], 0, FALSE)
call SaveInteger(udg_AH_Hash, udg_AH_Item_Types[i], 4, 3)
call SaveInteger(udg_AH_Hash, udg_AH_Item_Types[i], 1, 3000)

set i = i + 1
set udg_AH_Item_Types[i] = 'I6AL' // Master Key
call SaveBoolean(udg_AH_Hash, udg_AH_Item_Types[i], 0, FALSE)
call SaveInteger(udg_AH_Hash, udg_AH_Item_Types[i], 4, 3)
call SaveInteger(udg_AH_Hash, udg_AH_Item_Types[i], 1, 1500)

set i = i + 1
set udg_AH_Item_Types[i] = 'I6D3' // Chaotic Realm
call SaveBoolean(udg_AH_Hash, udg_AH_Item_Types[i], 0, FALSE)
call SaveInteger(udg_AH_Hash, udg_AH_Item_Types[i], 4, 3)
call SaveInteger(udg_AH_Hash, udg_AH_Item_Types[i], 1, 10000)

set i = i + 1
set udg_AH_Item_Types[i] = 'I639' // Greater Magic Ball
call SaveBoolean(udg_AH_Hash, udg_AH_Item_Types[i], 0, FALSE)
call SaveInteger(udg_AH_Hash, udg_AH_Item_Types[i], 4, 3)
call SaveInteger(udg_AH_Hash, udg_AH_Item_Types[i], 1, 3000)

set i = i + 1
set udg_AH_Item_Types[i] = 'I6EI' // Orb of Degeneration
call SaveBoolean(udg_AH_Hash, udg_AH_Item_Types[i], 0, FALSE)
call SaveInteger(udg_AH_Hash, udg_AH_Item_Types[i], 4, 3)
call SaveInteger(udg_AH_Hash, udg_AH_Item_Types[i], 1, 1000)

set i = i + 1
set udg_AH_Item_Types[i] = 'rej2' // Inventory
call SaveBoolean(udg_AH_Hash, udg_AH_Item_Types[i], 0, FALSE)
call SaveInteger(udg_AH_Hash, udg_AH_Item_Types[i], 4, 3)
call SaveInteger(udg_AH_Hash, udg_AH_Item_Types[i], 1, 15000)

//* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/


//*
Code:
~~~~~~~~~~~~~~~~~~~~~~~~ Don't change ~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
    
    set udg_AH_Rounds_Initial = i
    set udg_AH_Rounds = i
    
    loop
        call ItemPoolAddItemType(AH_Itempool, udg_AH_Item_Types[j], 1)
        exitwhen j == i
        set j = j + 1
    endloop
    
    call SaveItemPoolHandle(udg_AH_Hash, 0, StringHash("itempool"), AH_Itempool)
    //* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/

endfunction


function AH_Refresh_Itempool takes nothing returns nothing
local integer i = udg_AH_Rounds_Initial
local itempool ip = LoadItemPoolHandle(udg_AH_Hash, 0, StringHash("itempool"))
local integer it

loop
set it = LoadInteger(udg_AH_Hash, StringHash("items"), i)
if it != null then
if LoadBoolean(udg_AH_Hash, it, 0) == TRUE then
call ItemPoolAddItemType(ip, it, 1)
set udg_AH_Rounds = udg_AH_Rounds + 1
endif
call RemoveSavedHandle(udg_AH_Hash, StringHash("items"), i)
endif
exitwhen i == 0
set i = i - 1
endloop

set ip = null
endfunction


// Begins/ends a cinematic
function AH_Cin takes boolean stop, real fadeTime returns nothing
call ClearTextMessages()
call ShowInterface(stop, fadeTime)
call EnableOcclusion(stop)
endfunction


function AH_About takes nothing returns nothing
call AH_Cin(false, 0.3)
call TransmissionFromUnitWithNameBJ( bj_FORCE_PLAYER[0], null, null, null, "To bid write \"-X\"(X the amount you want to bid). To leave the Auction Hall press ESC.", bj_TIMETYPE_ADD, 0, true )
call TriggerSleepAction(0)
call AH_Cin(true, 0.3)
if TimerGetRemaining(udg_AH_Timer_Shout) > 0 then
call ResumeTimer(udg_AH_Timer_Shout)
endif
if TimerGetRemaining(udg_AH_Timer_Bidders) > 0 then
call ResumeTimer(udg_AH_Timer_Bidders)
endif
endfunction


function AH_Exit takes nothing returns nothing
call ResetUnitLookAt(udg_AH_Auctionists[0])
call RemoveItem(UnitItemInSlot(udg_AH_Auctionists[0], 0))
call AH_Refresh_Itempool()
// call CinematicFadeBJ( bj_CINEFADETYPE_FADEIN, 0.30, "ReplaceableTextures\\CameraMasks\\Black_mask.blp", 0, 0, 0, 0 )
// call AH_Cin(true, 0.3)
call ResetToGameCamera(2)
call SetCameraBoundsToRect(bj_mapInitialCameraBounds)
call PauseTimer(udg_AH_Timer_Shout)
call PauseTimer(udg_AH_Timer_Bidders)
call DisableTrigger(udg_AH_Trig_Next)
call DisableTrigger(udg_AH_Trig_Menu)
call DisableTrigger(udg_AH_Pause_Hero)
call DisableTrigger(udg_AH_Trig_Selection)
//call MultiboardDisplay(udg_AH_MB, false)
//call MultiboardDisplay(xxx, true)
call EnableSelect( true, true )
call EnableDragSelect( true, true )
call SelectUnit(udg_AH_Auctionists[0], false)
call SelectUnit(udg_AH_Hero, true)
call EnableTrigger(udg_AH_Trig_Enter)
endfunction


function AH_Auctioneer takes nothing returns nothing
local integer count = LoadInteger(udg_AH_Hash, 0, StringHash("shoutCount"))
local integer rounds = LoadInteger(udg_AH_Hash, 0, StringHash("rounds"))
set bj_lastCreatedTextTag = CreateTextTag()
call SetTextTagPosUnit(bj_lastCreatedTextTag, udg_AH_Auctionists[0], 0)
call SetTextTagPermanent(bj_lastCreatedTextTag, FALSE)

if count == 1 then
call SetTextTagFadepoint(bj_lastCreatedTextTag, 0.7)
call SetTextTagLifespan(bj_lastCreatedTextTag, 0.9)
call SetTextTagText(bj_lastCreatedTextTag, "Going once!", 0.022)
call SaveInteger(udg_AH_Hash, 0, StringHash("shoutCount"), count + 1)
// Speed
call TimerStart(udg_AH_Timer_Shout, GetRandomReal(4,5), false, function AH_Auctioneer)
elseif count == 2 then
call SetTextTagFadepoint(bj_lastCreatedTextTag, 0.7)
call SetTextTagLifespan(bj_lastCreatedTextTag, 0.9)
call SetTextTagText(bj_lastCreatedTextTag, "Going twice!", 0.022)
call SaveInteger(udg_AH_Hash, 0, StringHash("shoutCount"), count + 1)
// Speed
call TimerStart(udg_AH_Timer_Shout, GetRandomReal(4,5), false, function AH_Auctioneer)
else
call DisableTrigger(udg_AH_Trig_Next)
call DisableTrigger(udg_AH_Trig_PlayerBid)
call PauseTimer(udg_AH_Timer_Bidders)
if LoadUnitHandle(udg_AH_Hash, 0, StringHash("lastBidder")) == udg_AH_Hero then
if not UnitAddItem(udg_AH_Hero, LoadItemHandle(udg_AH_Hash, StringHash("lastItem"), 0)) then
call SetItemPosition(LoadItemHandle(udg_AH_Hash, StringHash("lastItem"), 0), GetUnitX(udg_AH_Hero), GetUnitY(udg_AH_Hero))
endif
call SetPlayerState(Player(0), PLAYER_STATE_RESOURCE_GOLD, GetPlayerState(Player(0), PLAYER_STATE_RESOURCE_GOLD) - udg_AH_Current_Price)
else
call RemoveItem(LoadItemHandle(udg_AH_Hash, StringHash("lastItem"), 0))
endif

if rounds != 0 then
call TimerStart(udg_AH_Timer_NewItem, 1, false, null)
call SetTextTagFadepoint(bj_lastCreatedTextTag, 0.7)
call SetTextTagLifespan(bj_lastCreatedTextTag, 0.9)
call SetTextTagText(bj_lastCreatedTextTag, "Sold!", 0.022)
call ResetUnitLookAt(udg_AH_Auctionists[0])
else
call UnitRemoveItemFromSlot(udg_AH_Auctionists[0], 0)
call UnitRemoveItemFromSlot(udg_AH_Auctionists[0], 1)
call UnitRemoveItemFromSlot(udg_AH_Auctionists[0], 2)
call UnitRemoveItemFromSlot(udg_AH_Auctionists[0], 3)
call UnitRemoveItemFromSlot(udg_AH_Auctionists[0], 4)
call UnitRemoveItemFromSlot(udg_AH_Auctionists[0], 5)

call SetTextTagFadepoint(bj_lastCreatedTextTag, 1.7)
call SetTextTagLifespan(bj_lastCreatedTextTag, 2.0)
call SetTextTagText(bj_lastCreatedTextTag, "Sold! And we will take a small break.", 0.022)
call ResetUnitLookAt(udg_AH_Auctionists[0])
call AH_Exit()
endif
endif
endfunction


function AH_Hear_Bid takes nothing returns nothing
set bj_lastCreatedTextTag = CreateTextTag()
call SetTextTagPosUnit(bj_lastCreatedTextTag, udg_AH_Auctionists[0], 0)
call SetTextTagFadepoint(bj_lastCreatedTextTag, 0.7)
call SetTextTagLifespan(bj_lastCreatedTextTag, 0.9)
call SetTextTagPermanent(bj_lastCreatedTextTag, FALSE)
call SetTextTagText(bj_lastCreatedTextTag, "I heard " + I2S(udg_AH_Current_Price) + "!", 0.022)

call SetUnitLookAt( udg_AH_Auctionists[0], "bone_chest", LoadUnitHandle(udg_AH_Hash, 0, StringHash("lastBidder")), 0, 0, 60 )
call SetUnitLookAt( udg_AH_Auctionists[0], "bone_head", LoadUnitHandle(udg_AH_Hash, 0, StringHash("lastBidder")), 0, 0, 90 )

call SaveInteger(udg_AH_Hash, 0, StringHash("shoutCount"), 1)
// Speed
call TimerStart(udg_AH_Timer_Shout, GetRandomReal(4,5), false, function AH_Auctioneer)
endfunction


// Auctionist AI
function AH_Timer_Expire takes nothing returns nothing
local integer itemtypeid = GetItemTypeId(LoadItemHandle(udg_AH_Hash, StringHash("lastItem"), 0))
local integer defaultPrice = LoadInteger(udg_AH_Hash, itemtypeid, 1)
local real maxPrice = defaultPrice * 1.25
local real bidChance
local boolean prefers = FALSE
local unit u = udg_AH_Auctionists[GetRandomInt(1,4)]
local integer unitid = GetHandleId(u)

// Is the chosen unit not the same as previous chosen unit
if u != LoadUnitHandle(udg_AH_Hash, 0, StringHash("lastChosen")) then
call SaveUnitHandle(udg_AH_Hash, 0, StringHash("lastChosen"), u)
if u != LoadUnitHandle(udg_AH_Hash, 0, StringHash("lastBidder")) then
if udg_AH_Current_Price < maxPrice then
// Check whether the bidder dislikes the item category
if udg_AH_Current_Price < defaultPrice * 0.75 then
set bidChance = 1
else
set bidChance = 1+2*(1-(0.25+I2R(udg_AH_Current_Price)/I2R(defaultPrice)))
// Check whether the bidder prefers the item category
if LoadInteger(udg_AH_Hash, itemtypeid, 4) == LoadInteger(udg_AH_Hash, unitid, StringHash("prefers")) then
set bidChance = bidChance + 0.2
set prefers = TRUE
elseif LoadInteger(udg_AH_Hash, itemtypeid, 4) == LoadInteger(udg_AH_Hash, unitid, StringHash("dislikes")) then
set bidChance = bidChance - 0.2
endif
endif
//call BJDebugMsg(R2S(bidChance))

// Does the bidder make a bid
if GetRandomReal(0,1) < bidChance then

// Bid increase
set udg_AH_Current_Price = R2I(udg_AH_Current_Price + defaultPrice * GetRandomReal(0.03, 0.08))

call MultiboardSetItemValue(MultiboardGetItem(udg_AH_MB, 1, 0), LoadStr(udg_AH_Hash, unitid, StringHash("name")) + ": " + I2S(udg_AH_Current_Price) + " Gold")

set bj_lastCreatedTextTag = CreateTextTag()
call SetTextTagPosUnit(bj_lastCreatedTextTag, u, 0)
call SetTextTagFadepoint(bj_lastCreatedTextTag, 0.7)
call SetTextTagLifespan(bj_lastCreatedTextTag, 0.9)
call SetTextTagPermanent(bj_lastCreatedTextTag, FALSE)
if prefers then
call SetTextTagText(bj_lastCreatedTextTag, "I really want this one, " + I2S(udg_AH_Current_Price) + "!", 0.022)
else
call SetTextTagText(bj_lastCreatedTextTag, I2S(udg_AH_Current_Price), 0.022)
endif
call SaveUnitHandle(udg_AH_Hash, 0, StringHash("lastBidder"), u)
call TimerStart(udg_AH_Timer_Auctioneer, GetRandomReal(0.3,0.4), false, function AH_Hear_Bid)
else
set bj_lastCreatedTextTag = CreateTextTag()
call SetTextTagPosUnit(bj_lastCreatedTextTag, u, 0)
call SetTextTagFadepoint(bj_lastCreatedTextTag, 0.7)
call SetTextTagLifespan(bj_lastCreatedTextTag, 0.9)
call SetTextTagPermanent(bj_lastCreatedTextTag, FALSE)
call SetTextTagText(bj_lastCreatedTextTag, "Hmm...", 0.022)
endif
// Speed
call TimerStart(udg_AH_Timer_Bidders, GetRandomReal(2,3), false, function AH_Timer_Expire)
else
// call BJDebugMsg("max price reached")
endif
else
call TimerStart(udg_AH_Timer_Bidders, 0.1, false, function AH_Timer_Expire)
endif
else
call TimerStart(udg_AH_Timer_Bidders, 0.1, false, function AH_Timer_Expire)
endif

set u = null
endfunction


// Make own bids
function AH_Player_Bid takes nothing returns nothing
local integer bid = S2I(SubString(GetEventPlayerChatString(), 1, 6))
if bid > GetPlayerState(Player(0), PLAYER_STATE_RESOURCE_GOLD) then
set bid = GetPlayerState(Player(0), PLAYER_STATE_RESOURCE_GOLD)
endif
if bid > udg_AH_Current_Price then
set udg_AH_Current_Price = bid
call SaveUnitHandle(udg_AH_Hash, 0, StringHash("lastBidder"), udg_AH_Hero)
call TimerStart(udg_AH_Timer_Auctioneer, GetRandomReal(0.3,0.4), false, function AH_Hear_Bid)
// Speed
call TimerStart(udg_AH_Timer_Bidders, GetRandomReal(2, 3), false, function AH_Timer_Expire)
//call MultiboardSetItemValue(MultiboardGetItem(udg_AH_MB, 1, 0), GetUnitName(udg_AH_Hero) + ": " + I2S(udg_AH_Current_Price) + " Gold")
endif
endfunction


// Creates a new item to auction
function AH_New_Item takes nothing returns nothing
local integer i = GetRandomInt(1,3)
local integer rounds = LoadInteger(udg_AH_Hash, 0, StringHash("rounds"))

call RemoveSavedHandle(udg_AH_Hash, 0, StringHash("lastBidder"))
call RemoveSavedHandle(udg_AH_Hash, 0, StringHash("lastChosen"))
call SaveInteger(udg_AH_Hash, 0, StringHash("shoutCount"), 0)
call SaveInteger(udg_AH_Hash, 0, StringHash("rounds"), rounds - 1 )

call TriggerSleepAction(1.0)

if IsTriggerEnabled(udg_AH_Trig_Enter) then
return
endif

set bj_lastCreatedTextTag = CreateTextTag()
call SetTextTagPosUnit(bj_lastCreatedTextTag, udg_AH_Auctionists[0], 0)
call SetTextTagFadepoint(bj_lastCreatedTextTag, 1.5)
call SetTextTagLifespan(bj_lastCreatedTextTag, 2.0)
call SetTextTagPermanent(bj_lastCreatedTextTag, FALSE)

if i == 1 then
call SetTextTagText(bj_lastCreatedTextTag, "And our next item is...", 0.022)
elseif i == 2 then
call SetTextTagText(bj_lastCreatedTextTag, "What have we here...", 0.022)
else
call SetTextTagText(bj_lastCreatedTextTag, "Who's ready to bid for...", 0.022)
endif

call TriggerSleepAction(2.0)

if IsTriggerEnabled(udg_AH_Trig_Enter) then
return
endif

set bj_lastCreatedItem = PlaceRandomItem(LoadItemPoolHandle(udg_AH_Hash, 0, StringHash("itempool")), GetUnitX(udg_AH_Hero), GetUnitY(udg_AH_Hero))
set i = GetItemTypeId(bj_lastCreatedItem)

call UnitAddItem(udg_AH_Auctionists[0], bj_lastCreatedItem)

// Store the removed item type so it can be added to the item pool when auction ends
call SaveInteger(udg_AH_Hash, StringHash("items"), rounds, i)
call ItemPoolRemoveItemType(LoadItemPoolHandle(udg_AH_Hash, 0, StringHash("itempool")), i)
set udg_AH_Rounds = udg_AH_Rounds - 1

call SaveItemHandle(udg_AH_Hash, StringHash("lastItem"), 0, bj_lastCreatedItem)

set bj_lastCreatedTextTag = CreateTextTag()
call SetTextTagPosUnit(bj_lastCreatedTextTag, udg_AH_Auctionists[0], 0)
call SetTextTagFadepoint(bj_lastCreatedTextTag, 1.5)
call SetTextTagLifespan(bj_lastCreatedTextTag, 2.0)
call SetTextTagPermanent(bj_lastCreatedTextTag, FALSE)
call SetTextTagText(bj_lastCreatedTextTag, GetItemName(bj_lastCreatedItem) + "!", 0.022)

// Starting price
set udg_AH_Current_Price = R2I((LoadInteger(udg_AH_Hash, i, 1) * (1 + GetRandomReal(-0.25, 0.25))) / 2.5)

call MultiboardSetItemValue(MultiboardGetItem(udg_AH_MB, 0, 0), GetItemName(bj_lastCreatedItem))
call MultiboardSetItemValue(MultiboardGetItem(udg_AH_MB, 1, 0), "Starting price: " + I2S(udg_AH_Current_Price) + " Gold")
call MultiboardSetItemValue(MultiboardGetItem(udg_AH_MB, 2, 0), LoadStr(udg_AH_Hash, i, 3))

// Timer for bidder to make bids
call TimerStart(udg_AH_Timer_Bidders, GetRandomReal(1, 2), false, function AH_Timer_Expire)

call EnableTrigger(udg_AH_Trig_PlayerBid)
call EnableTrigger(udg_AH_Trig_Next)
endfunction


function AH_Menu_Dialog_Choise takes nothing returns nothing
if LoadInteger(udg_AH_Hash, GetHandleId(GetClickedButton()), 0) == 0 then
if LoadBoolean(udg_AH_Hash, 0, StringHash("timerResumeShout")) == true then
call ResumeTimer(udg_AH_Timer_Shout)
call SaveBoolean(udg_AH_Hash, 0, StringHash("timerResumeShout"), false)
endif
if LoadBoolean(udg_AH_Hash, 0, StringHash("timerResumeBid")) == true then
call ResumeTimer(udg_AH_Timer_Bidders)
call SaveBoolean(udg_AH_Hash, 0, StringHash("timerResumeBid"), false)
endif
//call MultiboardDisplay(xxx, false)
//call MultiboardDisplay(udg_AH_MB, true)
//call MultiboardMinimize(udg_AH_MB, true)
//call MultiboardMinimize(udg_AH_MB, false)

//*
Code:
~~~~~~~~~~~~~~~~~~~~~~~~~~ Reset AH ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
        
        if LoadBoolean(udg_AH_Hash, 0, StringHash("menuPause")) != true then
            call SetUnitAnimationWithRarity( udg_AH_Auctionists[0], "stand", RARITY_FREQUENT )
            
            call MultiboardSetItemValue(MultiboardGetItem(udg_AH_MB, 0, 0), null)
            call MultiboardSetItemValue(MultiboardGetItem(udg_AH_MB, 1, 0), null)
            call MultiboardSetItemValue(MultiboardGetItem(udg_AH_MB, 2, 0), null)
            
            // Set rounds
            call SaveInteger(udg_AH_Hash, 0, StringHash("rounds"), udg_AH_Rounds)
            //call BJDebugMsg(I2S(LoadInteger(udg_AH_Hash, 0, StringHash("rounds"))))
            
            call RemoveItem(UnitItemInSlot(udg_AH_Auctionists[0], 0))
            
            call SaveInteger(udg_AH_Hash, GetHandleId(udg_AH_Auctionists[1]), StringHash("gold"), GetRandomInt(1000, 5000))
            call SaveInteger(udg_AH_Hash, GetHandleId(udg_AH_Auctionists[2]), StringHash("gold"), GetRandomInt(1000, 5000))
            call SaveInteger(udg_AH_Hash, GetHandleId(udg_AH_Auctionists[3]), StringHash("gold"), GetRandomInt(1000, 5000))
            call SaveInteger(udg_AH_Hash, GetHandleId(udg_AH_Auctionists[4]), StringHash("gold"), GetRandomInt(1000, 5000))
            
            //* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/

call AH_New_Item()
else
call SaveBoolean(udg_AH_Hash, 0, StringHash("menuPause") , false)
endif
elseif LoadInteger(udg_AH_Hash, GetHandleId(GetClickedButton()), 0) == 2 then
call PauseTimer(udg_AH_Timer_Shout)
call PauseTimer(udg_AH_Timer_Bidders)
call AH_About()
else
call AH_Exit()
endif
endfunction


// Keeps the auctioneer selected
function AH_Deselect_Auctioneer takes nothing returns nothing
// 25 == selected, 24 = deselected
call TriggerSleepAction(0.2)
if GetHandleId(GetTriggerEventId()) == 25 and GetTriggerUnit() != udg_AH_Auctionists[0] then
call SelectUnit(GetTriggerUnit(), false)
elseif GetHandleId(GetTriggerEventId()) == 24 and GetTriggerUnit() == udg_AH_Auctionists[0] then
call SelectUnit(udg_AH_Auctionists[0], true)
endif
//call DisableTrigger(udg_AH_Trig_Selection)
//call ClearSelection()
//call SelectUnit(udg_AH_Auctionists[0], true)
//call EnableTrigger(udg_AH_Trig_Selection)
endfunction

function AH_Item_Next takes nothing returns nothing
local integer rounds
call DisableTrigger(udg_AH_Trig_Next)
call RemoveItem(LoadItemHandle(udg_AH_Hash, StringHash("lastItem"), 0))
call PauseTimer(udg_AH_Timer_Shout)
call PauseTimer(udg_AH_Timer_Bidders)
set rounds = LoadInteger(udg_AH_Hash, 0, StringHash("rounds")) - 1
call SaveInteger(udg_AH_Hash, 0, StringHash("shoutCount"), 0)
call SaveInteger(udg_AH_Hash, 0, StringHash("rounds"), rounds)
call ResetUnitLookAt(udg_AH_Auctionists[0])
if rounds <= 0 then
set bj_lastCreatedTextTag = CreateTextTag()
call SetTextTagPosUnit(bj_lastCreatedTextTag, udg_AH_Auctionists[0], 0)
call SetTextTagPermanent(bj_lastCreatedTextTag, FALSE)
call SetTextTagFadepoint(bj_lastCreatedTextTag, 1.7)
call SetTextTagLifespan(bj_lastCreatedTextTag, 2.0)
call SetTextTagText(bj_lastCreatedTextTag, "That's all we have for now.", 0.022)
call AH_Exit()
else
call ResetUnitLookAt(udg_AH_Auctionists[0])
call TimerStart(udg_AH_Timer_NewItem, 1, false, null)
endif
endfunction


// Creates dialogs
function AH_Setup_Dialog takes nothing returns nothing
set udg_AH_Trig_Menu_Choise = CreateTrigger()

set bj_lastCreatedButton = DialogAddButton(udg_AH_Enter_Dialog, "|cffffcc00Y|res", 'Y')
call SaveInteger(udg_AH_Hash, GetHandleId(bj_lastCreatedButton), 0, 0)
set bj_lastCreatedButton = DialogAddButton(udg_AH_Enter_Dialog, "|cffffcc00N|ro", 'N')
call SaveInteger(udg_AH_Hash, GetHandleId(bj_lastCreatedButton), 0, 1)

set bj_lastCreatedButton = DialogAddButton(udg_AH_Exit_Dialog, "|cffffcc00Y|res", 'Y')
call SaveInteger(udg_AH_Hash, GetHandleId(bj_lastCreatedButton), 0, 1)
set bj_lastCreatedButton = DialogAddButton(udg_AH_Exit_Dialog, "|cffffcc00N|ro", 'N')
call SaveInteger(udg_AH_Hash, GetHandleId(bj_lastCreatedButton), 0, 0)
set bj_lastCreatedButton = DialogAddButton(udg_AH_Exit_Dialog, "|cffffcc00I|rnfo", 'I')
call SaveInteger(udg_AH_Hash, GetHandleId(bj_lastCreatedButton), 0, 2)

call TriggerRegisterDialogEvent(udg_AH_Trig_Menu_Choise, udg_AH_Enter_Dialog)
call TriggerRegisterDialogEvent(udg_AH_Trig_Menu_Choise, udg_AH_Exit_Dialog)

call TriggerAddAction(udg_AH_Trig_Menu_Choise, function AH_Menu_Dialog_Choise)
endfunction


// Creates multiboard
function AH_Setup_MB takes nothing returns nothing
set udg_AH_MB = CreateMultiboard()
call MultiboardSetRowCount(udg_AH_MB, 3)
call MultiboardSetColumnCount(udg_AH_MB, 1)
call MultiboardSetTitleText(udg_AH_MB, "AUCTION HALL")
call MultiboardSetTitleTextColor(udg_AH_MB, 255, 215, 0, 0)

call MultiboardSetItemsStyle(udg_AH_MB, true, false)
call MultiboardSetItemsWidth(udg_AH_MB, 0.25)
call MultiboardSetItemsValueColor(udg_AH_MB, 127, 255, 212, 0)
endfunction


// Prevents the hero from responding to orders while in AH
function AH_Stop_Hero takes nothing returns nothing
call DisableTrigger(udg_AH_Pause_Hero)
//call BJDebugMsg("not stop")
call PauseUnit(udg_AH_Hero, true)
call SetUnitPosition(udg_AH_Hero, GetUnitX(udg_AH_Hero), GetUnitY(udg_AH_Hero))
call PauseUnit(udg_AH_Hero, false)
call EnableTrigger(udg_AH_Pause_Hero)
endfunction


function AH_Menu takes nothing returns nothing
if TimerGetRemaining(udg_AH_Timer_Shout) > 0 then
call PauseTimer(udg_AH_Timer_Shout)
call SaveBoolean(udg_AH_Hash, 0, StringHash("timerResumeShout"), true)
endif
if TimerGetRemaining(udg_AH_Timer_Bidders) > 0 then
call PauseTimer(udg_AH_Timer_Bidders)
call SaveBoolean(udg_AH_Hash, 0, StringHash("timerResumeBid"), true)
endif
call SaveBoolean(udg_AH_Hash, 0, StringHash("menuPause"), true)
//call AH_Cin(false, 0.3)
//call CinematicFadeBJ( bj_CINEFADETYPE_FADEOUT, 0.30, "ReplaceableTextures\\CameraMasks\\Black_mask.blp", 0, 0, 0, 0 )
//call TriggerSleepAction(0.4)
call DialogSetMessage(udg_AH_Exit_Dialog, "Exit the Auction Hall?")
call DialogDisplay(Player(0), udg_AH_Exit_Dialog, true)
endfunction


// Enter the Auction Hall area
function AH_Enter takes nothing returns nothing
set udg_AH_Hero = GetTriggerUnit()
call DisableTrigger(udg_AH_Trig_Enter)
call AH_Cin(false, 0.5)
call CinematicFadeBJ( bj_CINEFADETYPE_FADEOUT, 0.50, "ReplaceableTextures\\CameraMasks\\Black_mask.blp", 0, 0, 0, 0 )

if udg_AH_MB == null then
call AH_Setup_MB()
endif

call SaveBoolean(udg_AH_Hash, 0, StringHash("menuPause"), false)
call SaveBoolean(udg_AH_Hash, 0, StringHash("timerResumeBid"), false)
call SaveBoolean(udg_AH_Hash, 0, StringHash("timerResumeShout"), false)

call TriggerSleepAction(0.3)

call EnableSelect( false, false )
call EnableDragSelect( false, false )
call ClearSelection()
call SelectUnit(udg_AH_Auctionists[0], true)
call SetUnitPositionLoc(udg_AH_Hero, udg_AH_Hero_Point)
call CameraSetupApplyForceDuration(udg_AH_Enter_Cam, true, 0)
call AH_Cin(true, 0.3)

//call SetCameraBoundsToRect(udg_AH_Cam_Bounds)
call SetCameraBounds(GetRectCenterX(udg_AH_Cam_Bounds), GetRectCenterY(udg_AH_Cam_Bounds), GetRectCenterX(udg_AH_Cam_Bounds), GetRectCenterY(udg_AH_Cam_Bounds), GetRectCenterX(udg_AH_Cam_Bounds), GetRectCenterY(udg_AH_Cam_Bounds),GetRectCenterX(udg_AH_Cam_Bounds), GetRectCenterY(udg_AH_Cam_Bounds))
call EnableTrigger(udg_AH_Trig_Menu)
call EnableTrigger(udg_AH_Pause_Hero)
call EnableTrigger(udg_AH_Trig_Selection)
call CinematicFadeBJ( bj_CINEFADETYPE_FADEIN, 0.30, "ReplaceableTextures\\CameraMasks\\Black_mask.blp", 0, 0, 0, 0 )

call AH_Menu_Dialog_Choise()

//call DialogSetMessage(udg_AH_Enter_Dialog, "Enter the Auction Hall?")
//call DialogDisplay(Player(0), udg_AH_Enter_Dialog, true)
endfunction

// Initialization
function InitTrig_Auction_Hall takes nothing returns nothing
local region enter = CreateRegion()

set udg_AH_Hash = InitHashtable()

call AH_Setup()
call AH_Setup_Dialog()

call RegionAddRect(enter, udg_AH_Enter_Rect)

set udg_AH_Trig_Menu = CreateTrigger()
set udg_AH_Trig_Enter = CreateTrigger()
set udg_AH_Pause_Hero = CreateTrigger()
set udg_AH_Trig_Next = CreateTrigger()
set udg_AH_Trig_NewItem = CreateTrigger()
set udg_AH_Trig_PlayerBid = CreateTrigger()
set udg_AH_Trig_Selection = CreateTrigger()

call TriggerRegisterEnterRegion(udg_AH_Trig_Enter, enter, null)
call TriggerAddAction(udg_AH_Trig_Enter, function AH_Enter)

call TriggerRegisterPlayerEvent(udg_AH_Trig_Menu, Player(0), EVENT_PLAYER_END_CINEMATIC)
call TriggerAddAction(udg_AH_Trig_Menu, function AH_Menu)

call TriggerRegisterPlayerUnitEvent(udg_AH_Pause_Hero, Player(0), EVENT_PLAYER_UNIT_ISSUED_ORDER, null)
call TriggerRegisterPlayerUnitEvent(udg_AH_Pause_Hero, Player(0), EVENT_PLAYER_UNIT_ISSUED_POINT_ORDER, null)
call TriggerRegisterPlayerUnitEvent(udg_AH_Pause_Hero, Player(0), EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER, null)
call TriggerAddAction(udg_AH_Pause_Hero, function AH_Stop_Hero)

call TriggerRegisterPlayerChatEvent(udg_AH_Trig_PlayerBid, Player(0), "-", false)
call TriggerAddAction(udg_AH_Trig_PlayerBid, function AH_Player_Bid)

call TriggerRegisterTimerExpireEvent(udg_AH_Trig_NewItem, udg_AH_Timer_NewItem)
call TriggerAddAction(udg_AH_Trig_NewItem, function AH_New_Item)

call TriggerRegisterPlayerEvent(udg_AH_Trig_Next, Player(0), EVENT_PLAYER_ARROW_RIGHT_DOWN)
call TriggerAddAction(udg_AH_Trig_Next, function AH_Item_Next)

//call TriggerRegisterPlayerUnitEvent(udg_AH_Trig_Selection, Player(0), EVENT_PLAYER_UNIT_DESELECTED, null)
//call TriggerRegisterPlayerUnitEvent(udg_AH_Trig_Selection, Player(0), EVENT_PLAYER_UNIT_SELECTED, null)
//call TriggerAddAction(udg_AH_Trig_Selection, function AH_Deselect_Auctioneer)

call DisableTrigger(udg_AH_Trig_Next)
call DisableTrigger(udg_AH_Trig_Menu)
call DisableTrigger(udg_AH_Pause_Hero)
call DisableTrigger(udg_AH_Trig_PlayerBid)
call DisableTrigger(udg_AH_Trig_Selection)

set enter = null
endfunction


Thanks for the help.

Edit: I created a notepad file. Can you edit there and post it back? So there's no formations which can cause problems.
 

Attachments

There are two main options:
  1. You can add a trigger condition (TriggerAddCondition) and a separate function to perform your condition check, OR
  2. You can check your conditions in your "actions" (AH_Enter), and then return if the conditions don't pass
For simplicity, I'll show #2. You just need to adjust AH_Enter and add your conditions to the top of the function, like so:
JASS:
// Enter the Auction Hall area
function AH_Enter takes nothing returns nothing
    // If the entering unit is not Phodom, Fradz, or Galeoth, then skip remaining actions
    if not (GetTriggerUnit() == udg_AAAPhodom or GetTriggerUnit() == udg_AAAFradz or GetTriggerUnit() == udg_AAAGaleoth) then
        return
    endif

    set udg_AH_Hero = GetTriggerUnit()
    call DisableTrigger(udg_AH_Trig_Enter)
    call AH_Cin(false, 0.5)
    call CinematicFadeBJ( bj_CINEFADETYPE_FADEOUT, 0.50, "ReplaceableTextures\\CameraMasks\\Black_mask.blp", 0, 0, 0, 0 )
    
    if udg_AH_MB == null then
        call AH_Setup_MB()
    endif
    
    call SaveBoolean(udg_AH_Hash, 0, StringHash("menuPause"), false)
    call SaveBoolean(udg_AH_Hash, 0, StringHash("timerResumeBid"), false)
    call SaveBoolean(udg_AH_Hash, 0, StringHash("timerResumeShout"), false)
    
    call TriggerSleepAction(0.3)
    
    call EnableSelect( false, false )
    call EnableDragSelect( false, false )
    call ClearSelection()
    call SelectUnit(udg_AH_Auctionists[0], true)
    call SetUnitPositionLoc(udg_AH_Hero, udg_AH_Hero_Point)
    call CameraSetupApplyForceDuration(udg_AH_Enter_Cam, true, 0)
    call AH_Cin(true, 0.3)
        
    //call SetCameraBoundsToRect(udg_AH_Cam_Bounds)
    call SetCameraBounds(GetRectCenterX(udg_AH_Cam_Bounds), GetRectCenterY(udg_AH_Cam_Bounds), GetRectCenterX(udg_AH_Cam_Bounds), GetRectCenterY(udg_AH_Cam_Bounds), GetRectCenterX(udg_AH_Cam_Bounds), GetRectCenterY(udg_AH_Cam_Bounds),GetRectCenterX(udg_AH_Cam_Bounds), GetRectCenterY(udg_AH_Cam_Bounds)) 
    call EnableTrigger(udg_AH_Trig_Menu)
    call EnableTrigger(udg_AH_Pause_Hero)
    call EnableTrigger(udg_AH_Trig_Selection)
    call CinematicFadeBJ( bj_CINEFADETYPE_FADEIN, 0.30, "ReplaceableTextures\\CameraMasks\\Black_mask.blp", 0, 0, 0, 0 )
    
    call AH_Menu_Dialog_Choise()
    
    //call DialogSetMessage(udg_AH_Enter_Dialog, "Enter the Auction Hall?")
    //call DialogDisplay(Player(0), udg_AH_Enter_Dialog, true)
endfunction

P.S. you can put the code in JASS blocks to have it display in your post, like so (just remove the "."):
[.CODE=JASS]your code here[/CODE]
 
Well actually I should have put this to request section. I just wanna have that condition thing and the whole thing is fixed. I'm not here actually to learn how JASS code works. I just want to fix this thing fast and easy as possible.

So hmm. Can you or someone here to put that condition to the code, I copy the whole code to the campaign and we'll live happy after.

That code is not made by me. I just do GUI.

Sorry if I'm too straightforward.
 
Oh yesh yesh yesh! I just copied this part of code and it seems like the whole thing works. No crash or anything. Amazing. Life is amazing! Now hopefully I never need to touch this code ever again and players are happy... and that was the last bug. Now I can release the next version of the campaign.

EDIT: It seems like the reputation system here is gone so... I just give a like or what? Oh and have to put your name to the campaign.
 
Status
Not open for further replies.
Back
Top