function OnModGameStart_Player_texture_pack()
Game.texturepack = true --enables mod referencing
MagicAvailable("ALL_PLAYERS","TEXTURE_PACK",true,true)
end
------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------
Game.Player_texture_changer = {}
Game.disable_texture_mod    = {}

function Texture_pack_function(player,power_kind,power_level,stl_x,stl_y,thing,is_free)
local p = tostring(player)
if Game.Player_texture_changer[p] == nil then Game.Player_texture_changer[p] = 1 end

Game.Player_texture_changer[p] = Game.Player_texture_changer[p] + 1

    if Game.disable_texture_mod == 1 then
    Game.disable_texture_mod = 0
    if Game.faction[player] == 1 then   SetTexture(player,16+1)end
    if Game.faction[player] == 2 then   SetTexture(player,17+1)end
    if Game.faction[player] == 3 then   SetTexture(player,18+1)end
    if Game.faction[player] == 4 then   SetTexture(player,19+1)end
    if Game.faction[player] == 5 then   SetTexture(player,20+1)end
	if Game.faction[player] == 6 then   SetTexture(player,21+1)end
    return 0
    end

ClearMessage(1)
if Game.Player_texture_changer[p] == 1 or Game.Player_texture_changer[p] > 21 then Game.Player_texture_changer[p] = 2 end
if Game.Player_texture_changer[p] == 2 then   SetTexture(player,1) QuickMessage("Standard")end
if Game.Player_texture_changer[p] == 3 then   SetTexture(player,2) QuickMessage("Ancient")end
if Game.Player_texture_changer[p] == 4 then   SetTexture(player,3) QuickMessage("Winter")end
if Game.Player_texture_changer[p] == 5 then   SetTexture(player,4) QuickMessage("Snake Key")end
if Game.Player_texture_changer[p] == 6 then   SetTexture(player,5) QuickMessage("Stone Face")end
if Game.Player_texture_changer[p] == 7 then   SetTexture(player,6) QuickMessage("Voluptuous")end
if Game.Player_texture_changer[p] == 8 then   SetTexture(player,7) QuickMessage("Rough Ancient")end
if Game.Player_texture_changer[p] == 9 then   SetTexture(player,8) QuickMessage("Skull Relief")end
if Game.Player_texture_changer[p] == 10 then   SetTexture(player,9) QuickMessage("Desert Tomb")end
if Game.Player_texture_changer[p] == 11 then   SetTexture(player,10) QuickMessage("Gypsum")end
if Game.Player_texture_changer[p] == 12 then   SetTexture(player,11) QuickMessage("Lilac Stone")end
if Game.Player_texture_changer[p] == 13 then   SetTexture(player,12) QuickMessage("Swamp Serpent")end
if Game.Player_texture_changer[p] == 14 then   SetTexture(player,13) QuickMessage("Lava Cavern")end
if Game.Player_texture_changer[p] == 15 then   SetTexture(player,14) QuickMessage("Laterite Cavern")end
    if Game.Player_texture_changer[p] == 16 then   SetTexture(player,16+1) QuickMessage("Custom : Keeper Enhanced")end
    if Game.Player_texture_changer[p] == 17 then   SetTexture(player,17+1) QuickMessage("Custom : Heroes")end
    if Game.Player_texture_changer[p] == 18 then   SetTexture(player,18+1) QuickMessage("Custom : DK2 Keeper")end
    if Game.Player_texture_changer[p] == 19 then   SetTexture(player,19+1) QuickMessage("Custom : DK2 Heroes")end
    if Game.Player_texture_changer[p] == 20 then   SetTexture(player,20+1) QuickMessage("Custom : Silent Hill")end
    if Game.Player_texture_changer[p] == 21 then   SetTexture(player,21+1) QuickMessage("Custom : Cultists")end
return 0
end