//*************************************************************************** //* //* Custom Script Code //* //*************************************************************************** function H2I takes handle h returns integer return h return 0 endfunction // =========================== function LocalVars takes nothing returns gamecache return InitGameCache("jasslocalvars.w3v") endfunction function SetHandleHandle takes handle subject, string name, handle value returns nothing if value==null then call FlushStoredInteger(LocalVars(),I2S(H2I(subject)),name) else call StoreInteger(LocalVars(), I2S(H2I(subject)), name, H2I(value)) endif endfunction function SetHandleInt takes handle subject, string name, integer value returns nothing if value==0 then call FlushStoredInteger(LocalVars(),I2S(H2I(subject)),name) else call StoreInteger(LocalVars(), I2S(H2I(subject)), name, value) endif endfunction function SetHandleReal takes handle subject, string name, real value returns nothing if value==0 then call FlushStoredReal(LocalVars(), I2S(H2I(subject)), name) else call StoreReal(LocalVars(), I2S(H2I(subject)), name, value) endif endfunction function SetHandleString takes handle subject, string name, string value returns nothing if value==null then call FlushStoredString(LocalVars(), I2S(H2I(subject)), name) else call StoreString(LocalVars(), I2S(H2I(subject)), name, value) endif endfunction function GetHandleHandle takes handle subject, string name returns handle return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name) return null endfunction function GetHandleInt takes handle subject, string name returns integer return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name) endfunction function GetHandleReal takes handle subject, string name returns real return GetStoredReal(LocalVars(), I2S(H2I(subject)), name) endfunction function GetHandleString takes handle subject, string name returns string return GetStoredString(LocalVars(), I2S(H2I(subject)), name) endfunction function GetHandleUnit takes handle subject, string name returns unit return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name) return null endfunction function GetHandleTimer takes handle subject, string name returns timer return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name) return null endfunction function GetHandleTrigger takes handle subject, string name returns trigger return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name) return null endfunction function GetHandleEffect takes handle subject, string name returns effect return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name) return null endfunction function FlushHandleLocals takes handle subject returns nothing call FlushStoredMission(LocalVars(), I2S(H2I(subject)) ) endfunction //*************************************************************************** //* //* Triggers //* //*************************************************************************** //=========================================================================== // Trigger: Init Weaopons //=========================================================================== function Trig_Untitled_Trigger_001_Func001A takes nothing returns nothing local effect e = AddSpecialEffectTargetUnitBJ( "hand, right", GetEnumUnit(), "Firearm_2H_Rifle_A_01.mdx" ) call SetHandleHandle(GetEnumUnit(), "e", e) endfunction function Trig_Untitled_Trigger_001_Actions takes nothing returns nothing call ForGroupBJ( GetUnitsInRectAll(GetPlayableMapRect()), function Trig_Untitled_Trigger_001_Func001A ) endfunction //=========================================================================== function InitTrig_Init_Weaopons takes nothing returns nothing set gg_trg_Init_Weaopons = CreateTrigger( ) call TriggerRegisterTimerEventSingle( gg_trg_Init_Weaopons, 0.10 ) call TriggerAddAction( gg_trg_Init_Weaopons, function Trig_Untitled_Trigger_001_Actions ) endfunction //=========================================================================== // Trigger: Attacking Anims //=========================================================================== function Trig_Untitled_Trigger_002_Actions takes nothing returns nothing local unit u = GetAttacker() if GetUnitTypeId(u) == 'h000' then call TriggerSleepAction( 0.80 ) call SetUnitAnimationByIndex(u, 7) call TriggerSleepAction( 1.00 ) call SetUnitAnimationByIndex(u, 9) call TriggerSleepAction( 1.00 ) call SetUnitAnimationByIndex(u, 10) endif set u = null endfunction //=========================================================================== function InitTrig_Attacking_Anims takes nothing returns nothing set gg_trg_Attacking_Anims = CreateTrigger( ) call TriggerRegisterAnyUnitEventBJ( gg_trg_Attacking_Anims, EVENT_PLAYER_UNIT_ATTACKED ) call TriggerAddAction( gg_trg_Attacking_Anims, function Trig_Untitled_Trigger_002_Actions ) endfunction //=========================================================================== // Trigger: Dying Anims //=========================================================================== function Trig_Untitled_Trigger_003_Actions takes nothing returns nothing local unit u = GetDyingUnit() local effect e = GetHandleEffect(u, "e") call SetUnitTimeScalePercent( u, 200.00 ) call TriggerSleepAction( 0.50 ) call SetUnitTimeScalePercent( u, 100.00 ) call TriggerSleepAction( 3.00 ) call SetUnitTimeScalePercent( u, 3000.00 ) call SetUnitAnimationByIndex(u, 3) call SetUnitTimeScalePercent( u, 100.00 ) call TriggerSleepAction(2.00) call DestroyEffect(e) set e = null set u = null endfunction //=========================================================================== function InitTrig_Dying_Anims takes nothing returns nothing set gg_trg_Dying_Anims = CreateTrigger( ) call TriggerRegisterAnyUnitEventBJ( gg_trg_Dying_Anims, EVENT_PLAYER_UNIT_DEATH ) call TriggerAddAction( gg_trg_Dying_Anims, function Trig_Untitled_Trigger_003_Actions ) endfunction //=========================================================================== function InitCustomTriggers takes nothing returns nothing call InitTrig_Init_Weaopons( ) call InitTrig_Attacking_Anims( ) call InitTrig_Dying_Anims( ) endfunction //*************************************************************************** //* //* Players //* //*************************************************************************** function InitCustomPlayerSlots takes nothing returns nothing // Player 0 call SetPlayerStartLocation( Player(0), 0 ) call SetPlayerColor( Player(0), ConvertPlayerColor(0) ) call SetPlayerRacePreference( Player(0), RACE_PREF_HUMAN ) call SetPlayerRaceSelectable( Player(0), true ) call SetPlayerController( Player(0), MAP_CONTROL_USER ) endfunction function InitCustomTeams takes nothing returns nothing // Force: TRIGSTR_002 call SetPlayerTeam( Player(0), 0 ) endfunction //*************************************************************************** //* //* Main Initialization //* //*************************************************************************** //=========================================================================== function main takes nothing returns nothing call SetCameraBounds( -1280.0 + GetCameraMargin(CAMERA_MARGIN_LEFT), -1536.0 + GetCameraMargin(CAMERA_MARGIN_BOTTOM), 1280.0 - GetCameraMargin(CAMERA_MARGIN_RIGHT), 1024.0 - GetCameraMargin(CAMERA_MARGIN_TOP), -1280.0 + GetCameraMargin(CAMERA_MARGIN_LEFT), 1024.0 - GetCameraMargin(CAMERA_MARGIN_TOP), 1280.0 - GetCameraMargin(CAMERA_MARGIN_RIGHT), -1536.0 + GetCameraMargin(CAMERA_MARGIN_BOTTOM) ) call SetDayNightModels( "Environment\\DNC\\DNCAshenvale\\DNCAshenvaleTerrain\\DNCAshenvaleTerrain.mdl", "Environment\\DNC\\DNCAshenvale\\DNCAshenvaleUnit\\DNCAshenvaleUnit.mdl" ) call NewSoundEnvironment( "Default" ) call SetAmbientDaySound( "AshenvaleDay" ) call SetAmbientNightSound( "AshenvaleNight" ) call SetMapMusic( "Music", true, 0 ) call CreateAllUnits( ) call InitBlizzard( ) call InitGlobals( ) call InitCustomTriggers( ) endfunction //*************************************************************************** //* //* Map Configuration //* //*************************************************************************** function config takes nothing returns nothing call SetMapName( "Just another Warcraft III map" ) call SetMapDescription( "Nondescript" ) call SetPlayers( 1 ) call SetTeams( 1 ) call SetGamePlacement( MAP_PLACEMENT_USE_MAP_SETTINGS ) call DefineStartLocation( 0, -256.0, 384.0 ) // Player setup call InitCustomPlayerSlots( ) call SetPlayerSlotAvailable( Player(0), MAP_CONTROL_USER ) call InitGenericPlayerSlots( ) endfunction