JASS:
call TriggerAddCondition(this.eventTrigger, Condition(function this.IsObjectTarget))
If i'll write
JASS:
call TriggerAddCondition(this.eventTrigger, Condition(this.IsObjectTarget))
and the error sends to this line:
JASS:
call TriggerAddCondition(s__Quest_eventTrigger[this] , Condition(Quest.getMethod(IsObjectTarget,this)))
So how can i do what i want? If u r don't understand what i want look:
JASS:
///////QUEST SYSTEM///////////////////////////////////
struct Quest
integer EVENT_KILL = 1 //on kill
integer EVENT_SPEAK = 2//speak with npc
integer EVENT_PICK = 3//pick an item
integer rewardXP = 0//xp to heroes
integer rewardGold = 0//gold to players
boolean repeatable = false//can bestarted again
integer eventType = 0//what must hero do
trigger eventTrigger = CreateTrigger()
unitevent eventEvent//event for trigger
widget eventTarget//item/unit/etc
method IsObjectTarget takes widget u returns boolean
if(u == this.eventTarget) then
return true
endif
return false
endmethod
method IsObjectTargetAndOrderAttack takes widget u, integer order returns boolean
if(this.IsObjectTarget(u) == false) then
return false
elseif(order == OrderId("attack")) then
return true
else
return false
endif
endmethod
method GetEvent takes nothing returns nothing
if(this.eventType == 1) then
set this.eventEvent = EVENT_UNIT_DEATH
call TriggerAddCondition(this.eventTrigger, Condition(this.IsObjectTarget))
elseif(this.eventType == 2) then
set this.eventEvent = EVENT_UNIT_ISSUED_TARGET_ORDER
call TriggerAddCondition(this.eventTrigger, Condition(this.IsObjectTargetAndOrderAttack))
elseif(this.eventType == 3) then
set this.eventEvent = EVENT_UNIT_ISSUED_TARGET_ORDER
call TriggerAddCondition(this.eventTrigger, Condition(this.IsObjectTarget))
endif
endmethod
method Create takes nothing returns nothing
if(this.eventType == 0) then
BJDebugMsg("Event error: eventType == 0")
return
endif
call this.GetEvent()
call TriggerRegisterUnitEvent(eventTrigger, eventTarget, eventEvent)
endmethod
method Destroy takes nothing returns nothing
set this.eventEvent = null
set this.eventTarget = null
call DestroyTrigger(this.eventTrigger)
set this.eventTrigger = null
endmethod
endstruct
-hexing