- Joined
- Nov 13, 2006
- Messages
- 1,814
[UPDATED]
Seems the problem is somewhere in converted code, thats break the trigger, totally
Seems the problem is somewhere in converted code, thats break the trigger, totally
Last edited:
It should compile if you have the required variables.
Try DisplayTextToPlayer(Player(0), ...)
call DisplayTextToPlayer(Player(0),0, 0, "89")
set itm = null
set u = null
set s = null
set mbitem = null
endfunction
Download a Jass New Gen Pack World Editor Experemental - nice program for check Jass syntax
function Trig_Equip_Copy_Actions takes nothing returns nothing
local integer p = GetConvertedPlayerId(GetTriggerPlayer())
local item itm = GetManipulatedItem()
local unit u = GetTriggerUnit()
local string s = null
local integer ilv = GetItemLevel(itm)
local integer ic1 = itemclass(0,ilv)
local integer ic2 = itemclass(1,ilv)
local integer ic3 = itemclass(2,ilv)
local integer att1 = GetHeroStr(u, true)
local integer att2 = GetHeroAgi(u, true)
local integer att3 = GetHeroInt(u, true)
local integer req1 = udg_Item_Lv[ilv] * 1 + 5
local integer req2 = udg_Item_Lv[ilv] * 2 + 5
local integer req3 = udg_Item_Lv[ilv] * 3 + 5
local integer req4 = udg_Item_Lv[ilv] * 4 + 5
local integer it1
local integer it2
local integer a
local multiboarditem mbitem = null
set udg_hp = 0
set udg_mp = 0
if ( ilv >= 50 ) then
set a = 0
if ( GetHeroLevel(u) >= udg_Item_Lv[ilv] ) then
if ( ilv < 100 ) then
if ( udg_Tome == 0 ) then
set a = 1
else
set a = 2
set it1 = udg_Tome
endif
set udg_Tome = ilv
set udg_TempNr4 = 11
else
if ( ilv < 250 ) then
set udg_TempNr4 = 3
if ( ilv < 150 ) then
if ( statreq(att1,req3,att2,req1) ) then
if ( udg_Armor == 0 ) then
set a = 1
else
set a = 2
set it1 = udg_Armor
endif
set udg_Armor = ilv
else
set s= ( "|cff7777aa" + GetItemName(itm) + "|r need |cffffcc00" + I2S( req3 ) + "|r strength and |cffffcc00" + I2S( req1 ) + "|r agility." )
call UnitAddItemById( u, udg_Item_Type[ilv] )
endif
else
if ( ic1==2 ) then
if ( statreq(att2,req3,att1,req1) ) then
if ( udg_Armor == 0 ) then
set a = 1
else
set a = 2
set it1 = udg_Armor
endif
set udg_Armor = ilv
else
set s= ( "|cff7777aa" + GetItemName(itm) + "|r need |cffffcc00" + I2S( req3 ) + "|r agility and |cffffcc00" + I2S( req1 ) + "|r strength." )
call UnitAddItemById( u, udg_Item_Type[ilv] )
endif
else
if ( statreq(att3,req3,att1,req1) ) then
if ( udg_Armor == 0 ) then
set a = 1
else
set a = 2
set it1 = udg_Armor
endif
set udg_Armor = ilv
else
set s= ( "|cff7777aa" + GetItemName(itm) + "|r need |cffffcc00" + I2S( req3 ) + "|r intelligence and |cffffcc00" + I2S( req1 ) + "|r strength." )
call UnitAddItemById( u, udg_Item_Type[ilv] )
endif
endif
endif
endif
endif
if ( ic2==2 ) then
set udg_TempNr4 = 2
if ( ilv < 300 ) then
if ( statreq(att1,req3,att2,req1) ) then
if ( udg_Helm == 0 ) then
set a = 1
else
set a = 2
set it1 = udg_Helm
endif
set udg_Helm = ilv
else
set s= ( "|cff7777aa" + GetItemName(itm) + "|r need |cffffcc00" + I2S( req3 ) + "|r strength and |cffffcc00" + I2S( req1 ) + "|r agility." )
call UnitAddItemById( u, udg_Item_Type[ilv] )
endif
else
if ( ic1==5 ) then
if ( statreq(att2,req3,att1,req1) ) then
if ( udg_Helm == 0 ) then
set a = 1
else
set a = 2
set it1 = udg_Helm
endif
set udg_Helm = ilv
else
set s=( "|cff7777aa" + GetItemName(itm) + "|r need |cffffcc00" + I2S( req3 ) + "|r agility and |cffffcc00" + I2S( req1 ) + "|r strength." )
call UnitAddItemById( u, udg_Item_Type[ilv] )
endif
else
if ( statreq(att3,req3,att1,req1) ) then
if ( udg_Helm == 0 ) then
set a = 1
else
set a = 2
set it1 = udg_Helm
endif
set udg_Helm = ilv
else
set s= ( "|cff7777aa" + GetItemName(itm) + "|r need |cffffcc00" + I2S( req3 ) + "|r intelligence and |cffffcc00" + I2S( req1 ) + "|r strength." )
call UnitAddItemById( u, udg_Item_Type[ilv] )
endif
endif
endif
else
endif
if ( ic2==5 ) then
set udg_TempNr4 = 5
if ( ilv < 450 ) then
if ( statreq(att1,req3,att2,req1) ) then
if ( udg_Boot == 0 ) then
set a = 1
else
set a = 2
set it1 = udg_Boot
endif
set udg_Boot = ilv
else
set s= ( "|cff7777aa" + GetItemName(itm) + "|r need |cffffcc00" + I2S( req3 ) + "|r strength and |cffffcc00" + I2S( req1 ) + "|r agility." )
call UnitAddItemById( u, udg_Item_Type[ilv] )
endif
else
if ( ic1==8 ) then
if ( statreq(att2,req3,att1,req1) ) then
if ( udg_Boot == 0 ) then
set a = 1
else
set a = 2
set it1 = udg_Boot
endif
set udg_Boot = ilv
else
set s= ( "|cff7777aa" + GetItemName(itm) + "|r need |cffffcc00" + I2S( req3 ) + "|r agility and |cffffcc00" + I2S( req1 ) + "|r strength." )
call UnitAddItemById( u, udg_Item_Type[ilv] )
endif
else
if ( ilv < 550 ) then
if ( statreq(att3,req3,att1,req1) ) then
if ( udg_Boot == 0 ) then
set udg_Boot = ilv
set a = 1
else
set a = 2
set it1 = udg_Boot
endif
set udg_Boot = ilv
else
set s= ( "|cff7777aa" + GetItemName(itm) + "|r need |cffffcc00" + I2S( req3 ) + "|r intelligence and |cffffcc00" + I2S( req1 ) + "|r strength." )
call UnitAddItemById( u, udg_Item_Type[ilv] )
endif
else
endif
endif
endif
else
endif
if ( ic1==10 ) then
set udg_TempNr4 = 10
if ( udg_Wings == 0 ) then
set a = 1
else
set a = 2
set it1 = udg_Wings
endif
set udg_Wings = ilv
endif
if ( ic1==11 ) then
if ( udg_Ring1 == 0 ) then
set udg_TempNr4 = 7
set a = 1
set udg_Ring1 = ilv
else
if ( udg_Ring2 == 0 ) then
set udg_TempNr4 = 8
set a = 1
set udg_Ring2 = ilv
else
if ( udg_Ring1 >= udg_Ring2 ) then
set udg_TempNr4 = 8
set a = 2
set it1 = udg_Ring2
set udg_Ring2 = ilv
else
set udg_TempNr4 = 7
set a = 2
set it1 = udg_Ring1
set udg_Ring1 = ilv
endif
endif
endif
endif
if ( ic1==12 ) then
set udg_TempNr4 = 9
if ( udg_Amulet == 0 ) then
set a = 1
else
set a = 2
set it1 = udg_Amulet
endif
set udg_Amulet = ilv
endif
if ( ic1==13 ) then
if ( statreq(att1,req3,att2,req2) ) then
set udg_WeaponClass = 1
set udg_TempNr4 = 6
if ( udg_Shield == 0 ) then
if ( udg_Weapon > 799 ) then
set a = 2
set it1 = udg_Weapon
set udg_Weapon = 0
set mbitem = MultiboardGetItem(udg_Multiboard, 3, 5)
call MultiboardSetItemValue(mbitem, "....................")
call MultiboardReleaseItem(mbitem)
else
set a = 1
endif
else
set a = 2
set it1 = udg_Shield
endif
set udg_Shield = ilv
set udg_Attack_Int = 1
else
set s= ( "|cff7777aa" + GetItemName(itm) + "|r need |cffffcc00" + I2S( req3 ) + "|r strength and |cffffcc00" + I2S( req2 ) + "|r agility." )
call UnitAddItemById( u, udg_Item_Type[ilv] )
set a = 0
endif
else
endif
if ( ic1==14 ) then
if ( statreq(att1,req3,att2,req2) ) then
set udg_WeaponClass = 1
set udg_TempNr4 = 4
set udg_Attack_Int = 1
if ( udg_Weapon == 0 ) then
set a = 1
else
set a = 2
set it1 = udg_Weapon
endif
set udg_Weapon = ilv
else
set s= ( "|cff7777aa" + GetItemName(itm) + "|r need |cffffcc00" + I2S( req3 ) + "|r strength and |cffffcc00" + I2S( req2 ) + "|r agility." )
call UnitAddItemById( u, udg_Item_Type[ilv] )
set a = 0
endif
else
endif
if ( ic3==2 ) then
set mbitem = MultiboardGetItem(udg_Multiboard, 3, 7)
call MultiboardSetItemValue(mbitem, "....................")
call MultiboardReleaseItem(mbitem)
set udg_TempNr4 = 4
if ( ic1==15 ) then
if ( statreq(att1,req4,att2,req1) ) then
set a = 1
set udg_Attack_Int = 2
set udg_WeaponClass = 2
else
set s= ( "|cff7777aa" + GetItemName(itm) + "|r need |cffffcc00" + I2S( req4 ) + "|r strength and |cffffcc00" + I2S( req1 ) + "|r agility." )
call UnitAddItemById( u, udg_Item_Type[ilv] )
endif
else
if ( ic1==16 ) then
if ( statreq(att1,req4,att2,req1) ) then
set a = 1
set udg_Attack_Int = 3
set udg_WeaponClass = 3
else
set s= ( "|cff7777aa" + GetItemName(itm) + "|r need |cffffcc00" + I2S( req4 ) + "|r strength and |cffffcc00" + I2S( req1 ) + "|r agility." )
call UnitAddItemById( u, udg_Item_Type[ilv] )
endif
else
if ( ic1==17 ) then
if ( statreq(att2,req4,att1,req1) ) then
set a = 1
set udg_Attack_Int = 4
set udg_WeaponClass = 4
else
set s= ( "|cff7777aa" + GetItemName(itm) + "|r need |cffffcc00" + I2S( req4 ) + "|r agility and |cffffcc00" + I2S( req1 ) + "|r strength." )
call UnitAddItemById( u, udg_Item_Type[ilv] )
endif
else
if ( ic1==18 ) then
if ( statreq(att2,req4,att1,req1) ) then
set a = 1
set udg_Attack_Int = 5
set udg_WeaponClass = 5
else
set s= ( "|cff7777aa" + GetItemName(itm) + "|r need |cffffcc00" + I2S( req4 ) + "|r agility and |cffffcc00" + I2S( req1 ) + "|r strength." )
call UnitAddItemById( u, udg_Item_Type[ilv] )
endif
else
if ( ic1==19 ) then
if ( statreq(att3,req3,att1,req2) ) then
set a = 1
set udg_Attack_Int = 6
set udg_WeaponClass = 6
else
set s= ( "|cff7777aa" + GetItemName(itm) + "|r need |cffffcc00" + I2S( req3 ) + "|r intelligence and |cffffcc00" + I2S( req2 ) + "|r strength." )
call UnitAddItemById( u, udg_Item_Type[ilv] )
endif
else
if ( ic1==20 ) then
if ( statreq(att3,req4,att1,req1) ) then
set a = 1
set udg_Attack_Int = 6
set udg_WeaponClass = 7
else
set s= ( "|cff7777aa" + GetItemName(itm) + "|r need |cffffcc00" + I2S( req4 ) + "|r intelligence and |cffffcc00" + I2S( req1 ) + "|r strength." )
call UnitAddItemById( u, udg_Item_Type[ilv] )
endif
endif
endif
endif
endif
endif
endif
if ( a > 0 ) then
set a = 2
if ( udg_Weapon >= 750 ) then
set it1 = udg_Weapon
endif
if ( udg_Shield > 0 ) then
set it2 = udg_Shield
set udg_Shield = 0
endif
set udg_Shield = 0
set udg_Weapon = ilv
endif
if (it2 > 0) then
if (it1 == 0) then
set it1 = it2
set it2 = 0
endif
endif
endif
else
call DisplayTextToForce( GetPlayersAll(), ("a=" + I2S(a) +"row=" + I2S(udg_TempNr4) + "ic2=" + I2S(ic2) + "ic1=" + I2S(ic1)))
set s=( "For this item, the level requiment is |cffffcc00" + I2S(udg_Item_Lv[ilv]) + "|r" )
call UnitAddItemById( u, udg_Item_Type[ilv] )
endif
call DisplayTextToForce( GetPlayersAll(), "it1=" + I2S(it1) + "it2=" + I2S(it2)+ "a=" + I2S(a)+"hp=" + I2S(udg_hp))
if ( a > 0 ) then
call DisplayTextToForce( GetPlayersAll(), "it1=" + I2S(it1) + "it2=" + I2S(it2)+ "a=" + I2S(a)+"hp=" + I2S(udg_hp))
set mbitem = MultiboardGetItem(udg_Multiboard, 3, (udg_TempNr4 + 1))
call MultiboardSetItemValue(mbitem, GetItemName(itm))
call MultiboardReleaseItem(mbitem)
set udg_Attachment_Unit = u
call TriggerExecute( gg_trg_Remove_all_attachment )
call TriggerExecute( gg_trg_Create_all_attachment )
if ( a > 0 ) then
if ( it1 != 0 ) then
call stat(false, it1, udg_TempNr4,p)
endif
if ( it2 != 0 ) then
call stat(false, it2, udg_TempNr4,p)
endif
call stat(true, ilv, udg_TempNr4,p)
endif
call AddHPMP(true, udg_hp, u)
call AddHPMP(false, udg_mp, u)
call AddDMG(false, u)
call AddDMG(true, u)
else
if (s != null) then
call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, s)
endif
endif
endif
call DisplayTextToPlayer(Player(0),0, 0, "89")
set itm = null
set u = null
set s = null
set mbitem = null
endfunction
its not Jass NewGen Pack v5d?
Its JNGP WE v5d.
its already solved problem was when i used a local variable (it1/it2) and variable not was definied, i thou........................
local integer req1 = udg_Item_Lv[ilv] * 1 + 5
403 strings code... I can optimize it, but need time
JASS:local integer req1 = udg_Item_Lv[ilv] * 1 + 5
variable * 1 ????
ahhaha
coz dont work at all
(p must be good since for player 1 multiboard[1] was attached, and when i try in game the p is 1)
function Trig_Equip_Copy_Actions takes nothing returns nothing
...you code...
...you code...
...you code...
...you code...
//clean leaks
call DestroyTimer(GetExpiredTimer())
endfunction
//===========================================================================
function InitTrig_ATM takes nothing returns nothing
call TimerStart(CreateTimer(),1.,false,function Trig_Equip_Copy_Actions)
endfunction
nothing Trig_Equip_Copy_Actions (nothing) {
...you code...
...you code...
...you code...
...you code...
//clean leaks
DestroyTimer(GetExpiredTimer())
}
//===========================================================================
nothing InitTrig_ATM (nothing) {
TimerStart(CreateTimer(),1.,false,function Trig_Equip_Copy_Actions)
}
if your trigger run on start game(init time), then that not work.
Create trigger ATM and:
1. Run your function Trig_Equip_Copy_Actions so:
JASS:function Trig_Equip_Copy_Actions takes nothing returns nothing ...you code... ...you code... ...you code... ...you code... //clean leaks call DestroyTimer(GetExpiredTimer()) endfunction //=========================================================================== function InitTrig_ATM takes nothing returns nothing call TimerStart(CreateTimer(),1.,false,function Trig_Equip_Copy_Actions) endfunction
function Trig_Equip_Copy_Actions should be executed after multiboard create moment
(sorry for bad english)
function Trig_Equip_Copy_Conditions takes nothing returns boolean
if ( not ( GetTriggerUnit() == udg_Hero[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))]) ) then
return false
endif
if ( not ( GetItemLevel(GetManipulatedItem()) >= 50 ) ) then
return false
endif
return true
endfunction
JASS:function Trig_Equip_Copy_Conditions takes nothing returns boolean if ( not ( GetTriggerUnit() == udg_Hero[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))]) ) then return false endif if ( not ( GetItemLevel(GetManipulatedItem()) >= 50 ) ) then return false endif return true endfunction
function Trig_Equip_Copy_Conditions takes nothing returns boolean
if GetTriggerUnit() == udg_Hero[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] then
return GetItemLevel(GetManipulatedItem()) > 49
endif
return false
endfunction
// or
boolean Trig_Equip_Copy_Conditions (nothing) {
if GetTriggerUnit() == udg_Hero[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] {
return GetItemLevel(GetManipulatedItem()) > 49
}
return false
}
->JASS:function Trig_Equip_Copy_Conditions takes nothing returns boolean if GetTriggerUnit() == udg_Hero[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] then return GetItemLevel(GetManipulatedItem()) > 49 endif return false endfunction
function Trig_Equip_Copy_Conditions takes nothing returns boolean
return GetTriggerUnit() == udg_Hero[GetConvertedPlayerId(GetTriggerPlayer())] and GetItemLevel(GetManipulatedItem()) > 49
endfunction
->
JASS:function Trig_Equip_Copy_Conditions takes nothing returns boolean return GetTriggerUnit() == udg_Hero[GetConvertedPlayerId(GetTriggerPlayer())] and GetItemLevel(GetManipulatedItem()) > 49 endfunction
function Trig_Equip_Copy_Conditions takes nothing returns boolean
return GetTriggerUnit() == udg_Hero[GetConvertedPlayerId(GetTriggerPlayer())] and GetItemLevel(GetManipulatedItem()) > 49
endfunction
boolean Trig_Equip_Copy_Conditions (nothing) {
return GetTriggerUnit() == udg_Hero[GetConvertedPlayerId(GetTriggerPlayer())] \
and GetItemLevel(GetManipulatedItem()) > 49
}
... my mistake is due to the fact that I tired)
Optimize yur condition for EYES)):
JASS:function Trig_Equip_Copy_Conditions takes nothing returns boolean return GetTriggerUnit() == udg_Hero[GetConvertedPlayerId(GetTriggerPlayer())] and GetItemLevel(GetManipulatedItem()) > 49 endfunction
to
JASS:boolean Trig_Equip_Copy_Conditions (nothing) { return GetTriggerUnit() == udg_Hero[GetConvertedPlayerId(GetTriggerPlayer())] \ and GetItemLevel(GetManipulatedItem()) > 49 }
\ is cJass Symbol
In new map its code save without errors2nd dont work, but 1st work.
unit array udg_Hero
boolean Trig_Equip_Copy_Conditions (nothing) {
return GetTriggerUnit() == udg_Hero[GetConvertedPlayerId(GetTriggerPlayer())] \
and GetItemLevel(GetManipulatedItem()) > 49
}
In new map its code save without errors
JASS:unit array udg_Hero boolean Trig_Equip_Copy_Conditions (nothing) { return GetTriggerUnit() == udg_Hero[GetConvertedPlayerId(GetTriggerPlayer())] \ and GetItemLevel(GetManipulatedItem()) > 49 }
for me if i replace the condition to this then i get 2037 error
example: expected end of line(==============)
expected ']'(return GetTriggerUnit() == udg_Hero[GetConvertedPlayerId(GetTriggerPlayer())] \)
expected code statment(and GetItemLevel(GetManipulatedItem()) > 49)
Maybe your WE version is not experemental JNGP.
code under the cjass rules (visit http://cjass.xgm.ru/ for more)
cJass manual in english:
- http://cjass.xgm.ru/manual-en
Link to download JNGP experemental version:
- http://xgm.ru/p/wc3/jass_new_gen_pack-exp/download
Programm is not in russian language
what is the difference between normal jngp?
GetSpellTargetX
GetSpellTargetY
only few function/operator was made like in c and dont need set/call?
Read the article and don't ask stupid questions