S
shadowvzs
Guest
i want learn jass, but i dont know object oriental language, i read the instruction but i dont understand really, i use some anti leak custom script but i want improve my map speed but i dont know what i must fix inside the normal trigger, exemple i have item drop trigger, this:
in jass (i dont know how can i convert and now i do a error but i removed the bad line)
how do it jass the item droping trigger to faster
Code:
Double Item Dropping
Events
Unit - A unit Acquires an item
Conditions
(Item-type of (Item being manipulated)) Not equal to Chocobo Food
(Item-class of (Item being manipulated)) Not equal to Purchasable
Actions
Set Tempory_nr[6] = 0
For each (Integer A) from 1 to 6, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Item-type of (Item being manipulated)) Equal to (Item-type of (Item carried by (Hero manipulating item) in slot (Integer A)))
Then - Actions
Set Tempory_nr[6] = (Tempory_nr[6] + 1)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Tempory_nr[6] Equal to 2
Then - Actions
Hero - Drop (Item being manipulated) from (Hero manipulating item)
Set PlayerGroup = (Player group((Owner of (Triggering unit))))
Game - Display to PlayerGroup the text: You can't hold in y...
Custom script: call DestroyForce (udg_PlayerGroup)
Else - Actions
Set Tempory_nr[6] = 0
For each (Integer A) from 1 to 10, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Hero manipulating item) has an item of type SaveLoad_Items[(Integer A)]) Equal to True
Then - Actions
Set Tempory_nr[6] = (Tempory_nr[6] + 1)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Tempory_nr[6] Greater than 1
Then - Actions
Hero - Drop (Item being manipulated) from (Hero manipulating item)
Set PlayerGroup = (Player group((Owner of (Triggering unit))))
Game - Display to PlayerGroup the text: You can't use two w...
Custom script: call DestroyForce (udg_PlayerGroup)
Else - Actions
JASS:
//===========================================================================
// Trigger: Double Item Dropping
//===========================================================================
function Trig_Double_Item_Dropping_Conditions takes nothing returns boolean
if ( not ( GetItemTypeId(GetManipulatedItem()) != 039;I00X039; ) ) then
return false
endif
if ( not ( GetItemType(GetManipulatedItem()) != ITEM_TYPE_PURCHASABLE ) ) then
return false
endif
return true
endfunction
function Trig_Double_Item_Dropping_Func004Func001Func001C takes nothing returns boolean
if ( not ( udg_Tempory_nr[6] == 2 ) ) then
return false
endif
return true
endfunction
function Trig_Double_Item_Dropping_Func004Func001C takes nothing returns boolean
if ( not ( GetItemTypeId(GetManipulatedItem()) == GetItemTypeId(UnitItemInSlotBJ(GetManipulatingUnit(), GetForLoopIndexA())) ) ) then
return false
endif
return true
endfunction
function Trig_Double_Item_Dropping_Func006Func001C takes nothing returns boolean
if ( not ( UnitHasItemOfTypeBJ(GetManipulatingUnit(), udg_SaveLoad_Items[GetForLoopIndexA()]) == true ) ) then
return false
endif
return true
endfunction
function Trig_Double_Item_Dropping_Func007C takes nothing returns boolean
if ( not ( udg_Tempory_nr[6] > 1 ) ) then
return false
endif
return true
endfunction
function Trig_Double_Item_Dropping_Actions takes nothing returns nothing
set udg_Tempory_nr[6] = 0
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = 6
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
if ( Trig_Double_Item_Dropping_Func004Func001C() ) then
set udg_Tempory_nr[6] = ( udg_Tempory_nr[6] + 1 )
else
if ( Trig_Double_Item_Dropping_Func004Func001Func001C() ) then
call UnitRemoveItemSwapped( GetManipulatedItem(), GetManipulatingUnit() )
set udg_PlayerGroup = GetForceOfPlayer(GetOwningPlayer(GetTriggerUnit()))
call DisplayTextToForce( udg_PlayerGroup, "TRIGSTR_2706" )
call DestroyForce (udg_PlayerGroup)
else
endif
endif
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
set udg_Tempory_nr[6] = 0
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = 10
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
if ( Trig_Double_Item_Dropping_Func006Func001C() ) then
set udg_Tempory_nr[6] = ( udg_Tempory_nr[6] + 1 )
else
endif
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
if ( Trig_Double_Item_Dropping_Func007C() ) then
call UnitRemoveItemSwapped( GetManipulatedItem(), GetManipulatingUnit() )
set udg_PlayerGroup = GetForceOfPlayer(GetOwningPlayer(GetTriggerUnit()))
call DisplayTextToForce( udg_PlayerGroup, "TRIGSTR_2939" )
call DestroyForce (udg_PlayerGroup)
else
endif
endfunction
//===========================================================================
function InitTrig_Double_Item_Dropping takes nothing returns nothing
set gg_trg_Double_Item_Dropping = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Double_Item_Dropping, EVENT_PLAYER_UNIT_PICKUP_ITEM )
call TriggerAddCondition( gg_trg_Double_Item_Dropping, Condition( function Trig_Double_Item_Dropping_Conditions ) )
call TriggerAddAction( gg_trg_Double_Item_Dropping, function Trig_Double_Item_Dropping_Actions )
endfunction
how do it jass the item droping trigger to faster