Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Immured Setup for CE Map: immured - DL link http://www.mediafire.com/file/9i78q49ynun78pf/immured.zip
- -- by H® Shaft
- -- Sets up Multi-Bipeds based on FFA/Team games:
- -- Team Games:
- -- Red Team are Grunts
- -- Blue Team are Cyborgs
- -- FFA Games: Random Player Selection of Cyborg, Grunt or Flood
- -- Zombies (team): Use your favorite zombie script, this script will set the Zombie Biped based on your gametype name/mode (see line 176)
- -- Editable defaults: see Line 124: LoadDefaults() section
- -- don't edit below --
- api_version = "1.9.0.0"
- function OnScriptLoad()
- register_callback(cb['EVENT_OBJECT_SPAWN'], "OnObjectSpawn")
- register_callback(cb['EVENT_GAME_START'], "OnNewGame")
- register_callback(cb['EVENT_GAME_END'], "OnGameEnd")
- if get_var(0, "$gt") ~= "n/a" then
- OnNewGame()
- end
- end
- function OnNewGame()
- map_name = get_var(0,"$map")
- if map_name ~= "immured" then return end
- LoadDefaults()
- team_play = getteamplay()
- end
- function OnGameEnd()
- OnScriptUnload()
- end
- function OnScriptUnload()
- DEFAULT_BIPED = nil
- end
- function OnObjectSpawn(PlayerIndex, MapID, ParentID, ObjectID)
- if not player_present(PlayerIndex) then return true end
- if map_name ~= "immured" then return true end
- if (DEFAULT_BIPED == nil) then
- local tag_array = read_dword(0x40440000)
- for i=0,read_word(0x4044000C)-1 do
- local tag = tag_array + i * 0x20
- if(read_dword(tag) == 1835103335 and read_string(read_dword(tag + 0x10)) == "globals\\globals") then
- local tag_data = read_dword(tag + 0x14)
- local mp_info = read_dword(tag_data + 0x164 + 4)
- for j=0,read_dword(tag_data + 0x164)-1 do
- DEFAULT_BIPED = read_dword(mp_info + j * 160 + 0x10 + 0xC)
- end
- end
- end
- end
- if (MapID == DEFAULT_BIPED) then
- local team = get_var(PlayerIndex,"$team")
- local game_mode = get_var(0, "$mode")
- if team_play then
- if game_mode ~= Zombie_Gametype_Name then
- if team == "red" then
- return true, grunt_mp_id
- else
- return true, cyborg_mp_id
- end
- else
- if team == "red" then
- return true, altis_flood_id
- else
- return true, grunt_mp_id
- end
- end
- else
- local randbiped = rand(1,4)
- if randbiped == 1 then
- return true, grunt_mp_id
- elseif randbiped == 2 then
- return true, cyborg_mp_id
- elseif randbiped == 3 and get_var(0, "$gt") ~= "oddball" and get_var(0, "$gt") ~= "ctf" then
- return true, altis_flood_id
- else
- return true, cyborg_mp_id
- end
- end
- end
- if get_var(0, "$gt") == "race" then
- if not team_play then
- -- FFA RACE
- -- replace chain_hog_id with with default vehicle (chain hog slot) for FFA Race
- if MapID == chain_hog_id then
- return true, default_ffa_race_vehicle_1
- end
- --replace ghost_id with with default vehicle (ghost slot) for FFA Race
- if MapID == ghost_id then
- return true, default_ffa_race_vehicle_2
- end
- -- replace rocket_hog_id with with default vehicle (rocket hog slot) for FFA Race
- if MapID == rocket_hog_id then
- return true, default_ffa_race_vehicle_3
- end
- elseif team_play then
- -- TEAM RACE
- -- replace chain_hog_id with with default vehicle (chain hog slot) for TEAM Race
- if MapID == chain_hog_id then
- return true, default_team_race_vehicle_1
- end
- --replace ghost_id with with default vehicle (ghost slot) for TEAM Race
- if MapID == ghost_id then
- return true, default_team_race_vehicle_2
- end
- -- replace rocket_hog_id with with default vehicle (rocket hog slot) for TEAM Race
- if MapID == rocket_hog_id then
- return true, default_team_race_vehicle_3
- end
- end
- end
- return true
- end
- function LoadDefaults()
- --Vehicles:
- chain_hog_id = get_tag_info("vehi", "vehicles\\warthog\\mp_warthog")
- ghost_id = get_tag_info("vehi", "vehicles\\ghost\\ghost_mp")
- rocket_hog_id = get_tag_info("vehi", "vehicles\\rwarthog\\rwarthog")
- wasp_id = get_tag_info("vehi", "vehicles\\wasp\\wasp_mp")
- turret_id = get_tag_info("vehi", "vehicles\\laag_turret\\laag_turret")
- hoverboard_id = get_tag_info("vehi", "vehicles\\hoverboard\\hoverboard")
- banshee_id = get_tag_info("vehi", "vehicles\\banshee\\banshee_mp")
- --Bipeds:
- cyborg_mp_id = get_tag_info("bipd", "nervebooger\\cyborg\\cyborg_mp")
- grunt_mp_id = get_tag_info("bipd", "nervebooger\\grunt\\grunt_mp")
- altis_flood_id = get_tag_info("bipd", "altis\\characters\\flood_human\\altis_flood")
- -- VEHICLE IDS: RACE vehicle setup: set the vehicle ID's you prefer for FFA Race and Team Race from these ID's
- -- chain_hog_id, ghost_id, rocket_hog_id, wasp_id, turret_id, hoverboard_id, banshee_id
- -- Note: hoverboard_id, banshee_id (hoverboard/banshee don't spawn by gametype, only by script) flood cannot drive hoverboard
- -- Vehicle replacement slots for gametype setup in the lobby:
- -- Warthog: Spawns Chain Hog
- -- Ghost: Spawns a Wasp
- -- Scorpion: Spawns a Ghost
- -- Banshee: Spawns a Banshee
- -- Turret: Spawns a Human Turret (Chain-gun)
- -- Rocket hog: Spawns a Rocket Hog
- -- Note: This replaces vehicle 1, 2 or 3 with the vehicle you specify, it does NOT re-order their spawn order
- -- set to nil to disable replacing the specified vehicle
- -- ----- FFA RACE -----
- -- default FFA race vehicle 1 (normally the chain hog slot)
- default_ffa_race_vehicle_1 = wasp_id
- -- default FFA race vehicle 2 (normally the ghost slot)
- default_ffa_race_vehicle_2 = wasp_id
- -- default FFA race vehicle 3 (normally the rocket hog slot)
- default_ffa_race_vehicle_3 = ghost_id
- -- ----- TEAM RACE -----
- -- default TEAM race vehicle 1 (normally the chain hog slot)
- default_team_race_vehicle_1 = chain_hog_id
- -- default TEAM race vehicle 2 (normally the ghost slot)
- default_team_race_vehicle_2 = wasp_id
- -- default TEAM race vehicle 3 (normally the rocket hog slot)
- default_team_race_vehicle_3 = rocket_hog_id
- -- Enter your zombie gametype/mode name (CASE sensitive) - only for Zombie biped selection, nothing else, (use your own zombie script)
- Zombie_Gametype_Name = "ZOMBIES"
- end
- function get_tag_info(tagclass,tagname) -- Thanks to 002, return metaid
- local tagarray = read_dword(0x40440000)
- for i=0,read_word(0x4044000C)-1 do
- local tag = tagarray + i * 0x20
- local class = string.reverse(string.sub(read_string(tag),1,4))
- if (class == tagclass) then
- if (read_string(read_dword(tag + 0x10)) == tagname) then
- return read_dword(tag + 0xC)
- end
- end
- end
- return nil
- end
- function getteamplay()
- if get_var(0,"$ffa") == "0" then
- return true
- else
- return false
- end
- end
- function OnError(Message)
- print(debug.traceback())
- end
- -- Created by H® Shaft
- -- Visit http://halorace.org/forum/index.php
- -- The player -db-GoNe/Juhleek - a well spoken liar, cheat.
- -- -db- is: "diverging from the believable" - How ironic. A race clan where admins use rcon to favor themselves to win.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement