Advertisement
Combreal

BansheeWarLtd2.lua

Jan 8th, 2015
772
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 5.97 KB | None | 0 0
  1. -- Test Banshee firering rockets - Slayer only --
  2. -- Thanks a bunch Wizard for your nice tutorial and the additional information on how use .ent o Phasor --
  3.  
  4. function GetRequiredVersion()
  5.     return 200
  6. end
  7.  
  8. function OnScriptLoad(process, game, persistent) end
  9.  
  10. function OnNewGame(map)
  11.     LoadTags()
  12.     local tag_address = gettagaddress(banshee_gun_tag_id)
  13.     local address_tag_data = readdword(tag_address, 0x14)
  14.     local number_of_triggers = readdword(address_tag_data, 0x4FC)
  15.     local triggers_address = readdword(address_tag_data, 0x4FC + 0x4)
  16.     for i = 0,number_of_triggers-1 do
  17.         writebit(triggers_address + 0x1, 5, 0)
  18.         writebit(triggers_address, 12, 0)  -- Projectiles Have Identical Error
  19.         writebit(triggers_address, 5, 0)  -- Projectiles Use Weapon Origin
  20.         --writebit(triggers_address, 13, 0)  -- Projectile is Client-Side Only
  21.         writebit(triggers_address, 3, 1)  -- Does Not Repeat Automatically
  22.         writefloat(triggers_address + 0x4, 0,5)  -- rateOfFireFrom (Round per Sec)
  23.         writefloat(triggers_address + 0x8, 0,5)  -- rateOfFireTo (Rounds per Sec -To)
  24.         writefloat(triggers_address + 0xC, 0)  -- Acceleration Time
  25.         writefloat(triggers_address + 0x10, 0)  -- Deceleration Time
  26.         --writeword(address_triggers + 0x24, 0)
  27.         --writeword(address_triggers + 0x26, 0)
  28.         writedword(triggers_address + 0x94 + 0xC, rocket_tag_id)  -- +0xC for the MapId
  29.     end
  30. end
  31.  
  32. function OnPlayerSpawnEnd(player, m_objectId)
  33.     local m_player = getplayerobjectid(player)
  34.     if m_player then
  35.         putinvehicle = registertimer(300, "PutPlayerInVehicle", player)
  36.     end
  37. end
  38.  
  39. --[[function OnVehicleEject(player, forceEjected)  -- not avable on this version of phasor
  40.     return false
  41. end--]]
  42.  
  43. function PutPlayerInVehicle(id, count, player)
  44.     if count == 1 then
  45.         local m_player = getplayerobjectid(player)
  46.         local x,y,z = getobjectcoords(m_player)
  47.         if m_player then
  48.             local m_vehicleId = createobject(banshee_tag_id, 0, 15, false, x,y,z+0.4)
  49.             entervehicle(player, m_vehicleId, 0)
  50.         end
  51.     end
  52.     return false
  53. end
  54.  
  55. function OnObjectCreationAttempt(mapId, parentId, player)
  56.     return checkObject(mapId)
  57. end
  58.  
  59. function OnDamageLookup(receiving, causing, mapId, tagdata)
  60.     if mapId == global_fallingId then
  61.         writefloat(tagdata, 0x1D0, 500)
  62.         writefloat(tagdata, 0x1D4, 500)
  63.         writefloat(tagdata, 0x1D8, 500)
  64.     end
  65. end
  66.  
  67. function checkObject(mapId)
  68.     if mapId == "nil" then
  69.         return false
  70.     end
  71.     return banshee_tag_id
  72. end
  73.  
  74. function OnClientUpdate(player)
  75.     local m_playerObjId = getplayerobjectid(player)
  76.     if m_playerObjId and isinvehicle(player) and readbit(getobject(m_playerObjId) + 0x208, 11) then
  77.         registertimer(300, "TrackPrimTriger", player)
  78.     end
  79. end
  80.  
  81. function TrackPrimTriger(id, count, player)
  82.     local m_playerObjId = getplayerobjectid(player)
  83.     if m_playerObjId and isinvehicle(player) and readbit(getobject(m_playerObjId) + 0x208, 11) then
  84.         exitvehicle(player)
  85.     end
  86. end
  87.  
  88. function LoadTags()
  89.     -- Vehicles
  90.     banshee_tag_id = gettagid("vehi", "vehicles\\banshee\\banshee_mp")
  91.     turret_tag_id = gettagid("vehi", "vehicles\\c gun turret\\c gun turret_mp")
  92.     ghost_tag_id = gettagid("vehi", "vehicles\\ghost\\ghost_mp")
  93.     rwarthog_tag_id = gettagid("vehi", "vehicles\\rwarthog\\rwarthog")
  94.     scorpion_tag_id = gettagid("vehi", "vehicles\\scorpion\\scorpion_mp")
  95.     warthog_tag_id = gettagid("vehi", "vehicles\\warthog\\mp_warthog")
  96.     wraith_tag_id = gettagid("vehi", "vehicles\\wraith\\wraith")
  97.     pelican_tag_id = gettagid("vehi", "vehicles\\pelican\\pelican")
  98.     -- Weapons
  99.     banshee_gun_tag_id = gettagid("weap", "vehicles\\banshee\\mp_banshee gun")
  100.     assaultrifle_tag_id = gettagid("weap", "weapons\\assault rifle\\assault rifle")
  101.     oddball_tag_id = gettagid("weap", "weapons\\ball\\ball")
  102.     flag_tag_id = gettagid("weap", "weapons\\flag\\flag")
  103.     flamethrower_tag_id = gettagid("weap", "weapons\\flamethrower\\flamethrower")
  104.     gravityrifle_tag_id = gettagid("weap", "weapons\\gravity rifle\\gravity rifle")
  105.     needler_tag_id = gettagid("weap", "weapons\\needler\\mp_needler")
  106.     pistol_tag_id = gettagid("weap", "weapons\\pistol\\pistol")
  107.     plasmapistol_tag_id = gettagid("weap", "weapons\\plasma pistol\\plasma pistol")
  108.     plasmarifle_tag_id = gettagid("weap", "weapons\\plasma rifle\\plasma rifle")
  109.     plasmacannon_tag_id = gettagid("weap", "weapons\\plasma_cannon\\plasma_cannon")
  110.     rocketlauncher_tag_id = gettagid("weap", "weapons\\rocket launcher\\rocket launcher")
  111.     shotgun_tag_id = gettagid("weap", "weapons\\shotgun\\shotgun")
  112.     sniper_tag_id = gettagid("weap", "weapons\\sniper rifle\\sniper rifle")
  113.     energysword_tag_id = gettagid("weap", "weapons\\energy sword\\energy sword")
  114.     -- Projectiles
  115.     bansheebolt_tag_id = gettagid("proj", "vehicles\\banshee\\banshee bolt")
  116.     bansheeblast_tag_id = gettagid("proj", "vehicles\\banshee\\mp_banshee fuel rod")
  117.     turretfire_tag_id = gettagid("proj", "vehicles\\c gun turret\\mp gun turret")
  118.     ghostbolt_tag_id = gettagid("proj", "vehicles\\ghost\\ghost bolt")
  119.     tankshot_tag_id = gettagid("proj", "vehicles\\scorpion\\bullet")
  120.     tankblast_tag_id = gettagid("proj", "vehicles\\scorpion\\tank shell")
  121.     warthogshot_tag_id = gettagid("proj", "vehicles\\warthog\\bullet")
  122.     rifleshot_tag_id = gettagid("proj", "weapons\\assault rifle\\bullet")
  123.     flame_tag_id = gettagid("proj", "weapons\\flamethrower\\flame")
  124.     needlerfire_tag_id = gettagid("proj", "weapons\\needler\\mp_needle")
  125.     pistolshot_tag_id = gettagid("proj", "weapons\\pistol\\bullet")
  126.     plasmapistolbolt_tag_id = gettagid("proj", "weapons\\plasma pistol\\bolt")
  127.     plasmariflebolt_tag_id = gettagid("proj", "weapons\\plasma rifle\\bolt")
  128.     plasmarifleblast_tag_id = gettagid("proj", "weapons\\plasma rifle\\charged bolt")
  129.     plasmacannonshot_tag_id = gettagid("proj", "weapons\\plasma_cannon\\plasma_cannon")
  130.     rocket_tag_id = gettagid("proj", "weapons\\rocket launcher\\rocket")
  131.     shotgunshot_tag_id = gettagid("proj", "weapons\\shotgun\\pellet")
  132.     snipershot_tag_id = gettagid("proj", "weapons\\sniper rifle\\sniper bullet")
  133.     -- Globals
  134.     global_distanceId = gettagid("jpt!", "globals\\distance")
  135.     global_fallingId = gettagid("jpt!", "globals\\falling")
  136. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement