Skip to content

Instantly share code, notes, and snippets.

@HorlogeSkynet
Created September 11, 2016 00:19
Show Gist options
  • Save HorlogeSkynet/30738e8826bf1905977a0a9c0e343624 to your computer and use it in GitHub Desktop.
Save HorlogeSkynet/30738e8826bf1905977a0a9c0e343624 to your computer and use it in GitHub Desktop.
buyMenu.lua file modified (Just Cause 2 Multiplayer)
class 'BuyMenu'
class 'BuyMenuEntry'
function BuyMenuEntry:__init( model_id, price, entry_type )
self.model_id = model_id
self.price = price
self.entry_type = entry_type
end
function BuyMenuEntry:GetPrice()
return self.price
end
function BuyMenuEntry:GetModelId()
return self.model_id
end
function BuyMenuEntry:GetListboxItem()
return self.listbox_item
end
function BuyMenuEntry:SetListboxItem( item )
self.listbox_item = item
end
class 'VehicleBuyMenuEntry' (BuyMenuEntry)
function VehicleBuyMenuEntry:__init( model_id, price )
BuyMenuEntry.__init( self, model_id, price, 1 )
end
function VehicleBuyMenuEntry:GetName()
return Vehicle.GetNameByModelId( self.model_id )
end
class 'WeaponBuyMenuEntry' (BuyMenuEntry)
function WeaponBuyMenuEntry:__init( model_id, price, slot, name )
BuyMenuEntry.__init( self, model_id, price, 2 )
self.slot = slot
self.name = name
end
function WeaponBuyMenuEntry:GetSlot()
return self.slot
end
function WeaponBuyMenuEntry:GetName()
return self.name
end
class 'ModelBuyMenuEntry' (BuyMenuEntry)
function ModelBuyMenuEntry:__init( model_id, price, name )
BuyMenuEntry.__init( self, model_id, price, 2 )
self.name = name
end
function ModelBuyMenuEntry:GetName()
return self.name
end
function BuyMenu:CreateItems()
self.types = {
["Vehicle"] = 1,
["Weapon"] = 2,
["Model"] = 3
}
self.id_types = {}
for k, v in pairs(self.types) do
self.id_types[v] = k
end
self.items = {
[self.types.Vehicle] = {
{ "Land", "Air", "Sea" },
["Land"] = {
VehicleBuyMenuEntry( 2, 0),
VehicleBuyMenuEntry( 4, 0),
VehicleBuyMenuEntry( 11, 0),
VehicleBuyMenuEntry( 13, 0),
VehicleBuyMenuEntry( 18, 0),
VehicleBuyMenuEntry( 21, 0),
VehicleBuyMenuEntry( 22, 0),
VehicleBuyMenuEntry( 35, 0),
VehicleBuyMenuEntry( 43, 0),
VehicleBuyMenuEntry( 46, 0),
VehicleBuyMenuEntry( 54, 0),
VehicleBuyMenuEntry( 56, 0),
VehicleBuyMenuEntry( 72, 0),
VehicleBuyMenuEntry( 76, 0),
VehicleBuyMenuEntry( 77, 0),
VehicleBuyMenuEntry( 78, 0),
VehicleBuyMenuEntry( 79, 0),
VehicleBuyMenuEntry( 87, 0),
VehicleBuyMenuEntry( 89, 0),
VehicleBuyMenuEntry( 91, 0),
-- DLC
VehicleBuyMenuEntry( 20, 0),
VehicleBuyMenuEntry( 58, 0),
VehicleBuyMenuEntry( 75, 0),
VehicleBuyMenuEntry( 82, 0)
},
["Sea"] = {
VehicleBuyMenuEntry( 5, 0),
VehicleBuyMenuEntry( 16, 0),
VehicleBuyMenuEntry( 25, 0),
VehicleBuyMenuEntry( 27, 0),
VehicleBuyMenuEntry( 28, 0),
VehicleBuyMenuEntry( 69, 0),
VehicleBuyMenuEntry( 80, 0),
VehicleBuyMenuEntry( 88, 0),
-- DLC
VehicleBuyMenuEntry( 53, 0)
},
["Air"] = {
VehicleBuyMenuEntry( 3, 0),
VehicleBuyMenuEntry( 30, 0),
VehicleBuyMenuEntry( 34, 0),
VehicleBuyMenuEntry( 64, 0),
VehicleBuyMenuEntry( 65, 0),
VehicleBuyMenuEntry( 81, 0),
VehicleBuyMenuEntry( 85, 0),
-- DLC
VehicleBuyMenuEntry( 24, 0)
}
},
[self.types.Weapon] = {
{ "One-handed", "Two-handed" },
["One-handed"] = {
WeaponBuyMenuEntry( Weapon.Handgun, 0, 1, "Pistol" ),
WeaponBuyMenuEntry( Weapon.Revolver, 0, 1, "Revolver" ),
WeaponBuyMenuEntry( Weapon.SMG, 0, 1, "SMG" ),
WeaponBuyMenuEntry( Weapon.SawnOffShotgun, 0, 1, "Sawn-off Shotgun" )
},
["Two-handed"] = {
WeaponBuyMenuEntry( Weapon.Assault, 0, 2, "Assault Rifle" ),
WeaponBuyMenuEntry( Weapon.Shotgun, 0, 2, "Shotgun" ),
WeaponBuyMenuEntry( Weapon.MachineGun, 0, 2, "Machine Gun" ),
WeaponBuyMenuEntry( Weapon.Sniper, 0, 2, "Sniper Rifle" ),
WeaponBuyMenuEntry( Weapon.RocketLauncher, 0, 2, "Rocket Launcher" )
}
},
[self.types.Model] = {
{ "Roaches", "Ular Boys", "Reapers", "Government", "Agency", "Misc" },
["Roaches"] = {
ModelBuyMenuEntry( 2, 0, "Razak Razman" ),
ModelBuyMenuEntry( 5, 0, "Elite" ),
ModelBuyMenuEntry( 32, 0, "Technician" ),
ModelBuyMenuEntry( 85, 0, "Soldier 1" ),
ModelBuyMenuEntry( 59, 0, "Soldier 2" )
},
["Ular Boys"] = {
ModelBuyMenuEntry( 38, 0, "Sri Irawan" ),
ModelBuyMenuEntry( 87, 0, "Elite" ),
ModelBuyMenuEntry( 22, 0, "Technician" ),
ModelBuyMenuEntry( 27, 0, "Soldier 1" ),
ModelBuyMenuEntry( 103, 0, "Soldier 2" )
},
["Reapers"] = {
ModelBuyMenuEntry( 90, 0, "Bolo Santosi" ),
ModelBuyMenuEntry( 63, 0, "Elite" ),
ModelBuyMenuEntry( 8, 0, "Technician" ),
ModelBuyMenuEntry( 12, 0, "Soldier 1" ),
ModelBuyMenuEntry( 58, 0, "Soldier 2" ),
},
["Government"] = {
ModelBuyMenuEntry( 74, 0, "Baby Panay" ),
ModelBuyMenuEntry( 67, 0, "Burned Baby Panay" ),
ModelBuyMenuEntry( 101, 0, "Colonel" ),
ModelBuyMenuEntry( 3, 0, "Demo Expert" ),
ModelBuyMenuEntry( 98, 0, "Pilot" ),
ModelBuyMenuEntry( 42, 0, "Black Hand" ),
ModelBuyMenuEntry( 44, 0, "Ninja" ),
ModelBuyMenuEntry( 23, 0, "Scientist" ),
ModelBuyMenuEntry( 52, 0, "Soldier 1" ),
ModelBuyMenuEntry( 66, 0, "Soldier 2" )
},
["Agency"] = {
ModelBuyMenuEntry( 9, 0, "Karl Blaine" ),
ModelBuyMenuEntry( 65, 0, "Jade Tan" ),
ModelBuyMenuEntry( 25, 0, "Maria Kane" ),
ModelBuyMenuEntry( 30, 0, "Marshall" ),
ModelBuyMenuEntry( 34, 0, "Tom Sheldon" ),
ModelBuyMenuEntry( 100, 0, "Black Market Dealer" ),
ModelBuyMenuEntry( 83, 0, "White Tiger" ),
ModelBuyMenuEntry( 51, 0, "Rico Rodriguez" )
},
["Misc"] = {
ModelBuyMenuEntry( 70, 0, "General Masayo" ),
ModelBuyMenuEntry( 11, 0, "Zhang Sun" ),
ModelBuyMenuEntry( 84, 0, "Alexander Mirikov" ),
ModelBuyMenuEntry( 19, 0, "Chinese Businessman" ),
ModelBuyMenuEntry( 36, 0, "Politician" ),
ModelBuyMenuEntry( 78, 0, "Thug Boss" ),
ModelBuyMenuEntry( 71, 0, "Saul Sukarno" ),
ModelBuyMenuEntry( 79, 0, "Japanese Veteran" ),
ModelBuyMenuEntry( 96, 0, "Bodyguard" ),
ModelBuyMenuEntry( 80, 0, "Suited Guest 1" ),
ModelBuyMenuEntry( 95, 0, "Suited Guest 2" ),
ModelBuyMenuEntry( 60, 0, "Race Challenge Girl" ),
ModelBuyMenuEntry( 15, 0, "Male Stripper 1" ),
ModelBuyMenuEntry( 17, 0, "Male Stripper 2" ),
ModelBuyMenuEntry( 86, 0, "Female Stripper" ),
ModelBuyMenuEntry( 16, 0, "Panau Police" ),
ModelBuyMenuEntry( 18, 0, "Hacker" ),
ModelBuyMenuEntry( 64, 1000, "Bom Bom Bohilano" ),
ModelBuyMenuEntry( 40, 1000, "Factory Boss" ),
ModelBuyMenuEntry( 1, 0, "Thug 1" ),
ModelBuyMenuEntry( 39, 0, "Thug 2" ),
ModelBuyMenuEntry( 61, 0, "Soldier" ),
ModelBuyMenuEntry( 26, 0, "Boat Captain" ),
ModelBuyMenuEntry( 21, 0, "Paparazzi" ),
}
}
}
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment