scope QuestReward
//***************************************************
globals
private constant string SFX = "Abilities\\Spells\\Human\\MassTeleport\\MassTeleportCaster.mdl"
endglobals
//****************************************************
private function con takes nothing returns boolean
return IsUnitType(GetTriggerUnit(), UNIT_TYPE_HERO) == true
endfunction
private function act takes nothing returns nothing
local unit u = GetTriggerUnit()
local player p = GetOwningPlayer(u)
local integer i = GetPlayerId(p)+1
local integer j = 1
//Nghia Quan Phan Do
if udg_Bo_banditQuestDone[i] == false then
if udg_Bo_banditBossDone[i] == true and udg_Bo_banditHeadDone[i] == true then
set udg_Bo_banditon[i] = false
set udg_Bo_banditQuestDone[i] = true
call DisplayTextToPlayer(p, 0, 0, "NhiÖm vô hoµn thµnh:|c0059c9ff NghÜa Qu©n Ph¶n §å|r")
call QuestSetCompleted(q_bandit[i], true)
call QuestSetDescription(q_bandit[i], str_completed)
call AddHeroXP(Hero[GetUnitId(u)], 600, true)
call SetPlayerState(p, PLAYER_STATE_RESOURCE_GOLD, GetPlayerState(p, PLAYER_STATE_RESOURCE_GOLD) + 400)
call SetPlayerState(p, PLAYER_STATE_RESOURCE_LUMBER, GetPlayerState(p, PLAYER_STATE_RESOURCE_LUMBER) + 4)
set bj_lastCreatedItem = CreateItem('I00S', GetUnitX(u), GetUnitY(u))
call UnitAddItem(u, bj_lastCreatedItem)
set udg_Int_Fame[i] = udg_Int_Fame[i]+10
if IsUnitAlly(u, Player(0)) then
set udg_Int_SongFame = udg_Int_SongFame+10
else
set udg_Int_JinFame = udg_Int_JinFame+10
endif
set u = null
set p = null
endif
endif
[COLOR="Red"][B]public function InitTrig takes nothing returns nothing[/B][/COLOR]
local trigger trg = CreateTrigger()
call TriggerAddAction(trg, function act)
call TriggerAddCondition(trg, Condition(function con))
call TriggerRegisterEnterRectSimple(trg, gg_rct_SongQuest)
call TriggerRegisterEnterRectSimple(trg, gg_rct_JinQuest)
call Preload(SFX)
set trg = null
endfunction
endscope