-- Test Banshee firering rockets - Slayer only --
-- Thanks a bunch Wizard for your nice tutorial and the additional information on how use .ent o Phasor --
function GetRequiredVersion()
return 200
end
function OnScriptLoad(process, game, persistent) end
function OnNewGame(map)
LoadTags()
local tag_address = gettagaddress(banshee_gun_tag_id)
local address_tag_data = readdword(tag_address, 0x14)
local number_of_triggers = readdword(address_tag_data, 0x4FC)
local triggers_address = readdword(address_tag_data, 0x4FC + 0x4)
for i = 0,number_of_triggers-1 do
writebit(triggers_address + 0x1, 5, 0)
writebit(triggers_address, 12, 0) -- Projectiles Have Identical Error
writebit(triggers_address, 5, 0) -- Projectiles Use Weapon Origin
--writebit(triggers_address, 13, 0) -- Projectile is Client-Side Only
writebit(triggers_address, 3, 1) -- Does Not Repeat Automatically
writefloat(triggers_address + 0x4, 0,5) -- rateOfFireFrom (Round per Sec)
writefloat(triggers_address + 0x8, 0,5) -- rateOfFireTo (Rounds per Sec -To)
writefloat(triggers_address + 0xC, 0) -- Acceleration Time
writefloat(triggers_address + 0x10, 0) -- Deceleration Time
--writeword(address_triggers + 0x24, 0)
--writeword(address_triggers + 0x26, 0)
writedword(triggers_address + 0x94 + 0xC, rocket_tag_id) -- +0xC for the MapId
end
end
function OnPlayerSpawnEnd(player, m_objectId)
local m_player = getplayerobjectid(player)
if m_player then
putinvehicle = registertimer(300, "PutPlayerInVehicle", player)
end
end
--[[function OnVehicleEject(player, forceEjected) -- not avable on this version of phasor
return false
end--]]
function PutPlayerInVehicle(id, count, player)
if count == 1 then
local m_player = getplayerobjectid(player)
local x,y,z = getobjectcoords(m_player)
if m_player then
local m_vehicleId = createobject(banshee_tag_id, 0, 15, false, x,y,z+0.4)
entervehicle(player, m_vehicleId, 0)
end
end
return false
end
function OnObjectCreationAttempt(mapId, parentId, player)
return checkObject(mapId)
end
function OnDamageLookup(receiving, causing, mapId, tagdata)
if mapId == global_fallingId then
writefloat(tagdata, 0x1D0, 500)
writefloat(tagdata, 0x1D4, 500)
writefloat(tagdata, 0x1D8, 500)
end
end
function checkObject(mapId)
if mapId == "nil" then
return false
end
return banshee_tag_id
end
function OnClientUpdate(player)
local m_playerObjId = getplayerobjectid(player)
if m_playerObjId and isinvehicle(player) and readbit(getobject(m_playerObjId) + 0x208, 11) then
registertimer(300, "TrackPrimTriger", player)
end
end
function TrackPrimTriger(id, count, player)
local m_playerObjId = getplayerobjectid(player)
if m_playerObjId and isinvehicle(player) and readbit(getobject(m_playerObjId) + 0x208, 11) then
exitvehicle(player)
end
end
function LoadTags()
-- Vehicles
banshee_tag_id = gettagid("vehi", "vehicles\\banshee\\banshee_mp")
turret_tag_id = gettagid("vehi", "vehicles\\c gun turret\\c gun turret_mp")
ghost_tag_id = gettagid("vehi", "vehicles\\ghost\\ghost_mp")
rwarthog_tag_id = gettagid("vehi", "vehicles\\rwarthog\\rwarthog")
scorpion_tag_id = gettagid("vehi", "vehicles\\scorpion\\scorpion_mp")
warthog_tag_id = gettagid("vehi", "vehicles\\warthog\\mp_warthog")
wraith_tag_id = gettagid("vehi", "vehicles\\wraith\\wraith")
pelican_tag_id = gettagid("vehi", "vehicles\\pelican\\pelican")
-- Weapons
banshee_gun_tag_id = gettagid("weap", "vehicles\\banshee\\mp_banshee gun")
assaultrifle_tag_id = gettagid("weap", "weapons\\assault rifle\\assault rifle")
oddball_tag_id = gettagid("weap", "weapons\\ball\\ball")
flag_tag_id = gettagid("weap", "weapons\\flag\\flag")
flamethrower_tag_id = gettagid("weap", "weapons\\flamethrower\\flamethrower")
gravityrifle_tag_id = gettagid("weap", "weapons\\gravity rifle\\gravity rifle")
needler_tag_id = gettagid("weap", "weapons\\needler\\mp_needler")
pistol_tag_id = gettagid("weap", "weapons\\pistol\\pistol")
plasmapistol_tag_id = gettagid("weap", "weapons\\plasma pistol\\plasma pistol")
plasmarifle_tag_id = gettagid("weap", "weapons\\plasma rifle\\plasma rifle")
plasmacannon_tag_id = gettagid("weap", "weapons\\plasma_cannon\\plasma_cannon")
rocketlauncher_tag_id = gettagid("weap", "weapons\\rocket launcher\\rocket launcher")
shotgun_tag_id = gettagid("weap", "weapons\\shotgun\\shotgun")
sniper_tag_id = gettagid("weap", "weapons\\sniper rifle\\sniper rifle")
energysword_tag_id = gettagid("weap", "weapons\\energy sword\\energy sword")
-- Projectiles
bansheebolt_tag_id = gettagid("proj", "vehicles\\banshee\\banshee bolt")
bansheeblast_tag_id = gettagid("proj", "vehicles\\banshee\\mp_banshee fuel rod")
turretfire_tag_id = gettagid("proj", "vehicles\\c gun turret\\mp gun turret")
ghostbolt_tag_id = gettagid("proj", "vehicles\\ghost\\ghost bolt")
tankshot_tag_id = gettagid("proj", "vehicles\\scorpion\\bullet")
tankblast_tag_id = gettagid("proj", "vehicles\\scorpion\\tank shell")
warthogshot_tag_id = gettagid("proj", "vehicles\\warthog\\bullet")
rifleshot_tag_id = gettagid("proj", "weapons\\assault rifle\\bullet")
flame_tag_id = gettagid("proj", "weapons\\flamethrower\\flame")
needlerfire_tag_id = gettagid("proj", "weapons\\needler\\mp_needle")
pistolshot_tag_id = gettagid("proj", "weapons\\pistol\\bullet")
plasmapistolbolt_tag_id = gettagid("proj", "weapons\\plasma pistol\\bolt")
plasmariflebolt_tag_id = gettagid("proj", "weapons\\plasma rifle\\bolt")
plasmarifleblast_tag_id = gettagid("proj", "weapons\\plasma rifle\\charged bolt")
plasmacannonshot_tag_id = gettagid("proj", "weapons\\plasma_cannon\\plasma_cannon")
rocket_tag_id = gettagid("proj", "weapons\\rocket launcher\\rocket")
shotgunshot_tag_id = gettagid("proj", "weapons\\shotgun\\pellet")
snipershot_tag_id = gettagid("proj", "weapons\\sniper rifle\\sniper bullet")
-- Globals
global_distanceId = gettagid("jpt!", "globals\\distance")
global_fallingId = gettagid("jpt!", "globals\\falling")
end
Comments
0 B
|👍
/👎