It doesn't work because you didn't have a condition. I am not in my computer right now so...
First of all, put call 'TriggerRegisterPlayerChatEvent(trgGodly,GetTriggerPlayer(),"-godly all",true)' into a new function or something that returns boolean so you'll make that as condition. So whenever it returns true it will call function GodlyItem. Which creates the items and such.
[EDIT: This should work, please do test it:]
After endglobals:
Code: Select all
function GI_Conditions takes nothing returns boolean
if GetEventPlayerChatString() == "-godly all" then
return true
endif
return false
endfunction
function GI_Actions takes nothing returns nothing
call UnitAddItemByIdSwapped('I02Z',GetTriggerUnit())
call UnitAddItemByIdSwapped('I047',GetTriggerUnit())
call UnitAddItemByIdSwapped('I046',GetTriggerUnit())
call UnitAddItemByIdSwapped('I04N',GetTriggerUnit())
call UnitAddItemByIdSwapped('I04O',GetTriggerUnit())
call UnitAddItemByIdSwapped('I04P',GetTriggerUnit())
call UnitAddItemByIdSwapped('I05H',GetTriggerUnit())
call UnitAddItemByIdSwapped('I05G',GetTriggerUnit())
call UnitAddItemByIdSwapped('I05F',GetTriggerUnit())
endfunction
And this is at the function main part: (AFTER LOCALS!)
Code: Select all
local trigger t = CreateTrigger()
local integer i = 0
loop
exitwhen i>11
call TriggerRegisterPlayerChatEvent( t, Player(i), "-godly all", true)
set i = i+1
endloop
call TriggerAddCondition(t, Condition(function GI_Conditions))
call TriggerAddAction(t, function GI_Actions)
It should work with all players but I didn't tested it really. But well it should work.