[RELEASE] Fullversion: Kostümsystem .Minton™

02/27/2013 15:57 .Minton™#1
Guten Tag, ich veröffentliche hier die offizielle Fullversion des Kostümsystems

Official Costume System


Costume System Quest


Quote:
----------------------------------------------
-- Datei: costume_system.quest
-- FullVersion: FullVersion
-- Erstellt von: Paylasici
-- Aktualisiert von: .Minton™
----------------------------------------------

quest costume_system begin
state start begin
function get_real_hair_id(id)
return ({
[45001] = 5001,
[45002] = 5001,
[45003] = 5002,
[45004] = 5002,
[45005] = 5003,
[45006] = 5003,
[45007] = 5004,
[45008] = 5004,
[45009] = 5005,
[45010] = 5005
})[id] or 0
end

when login begin
loop_timer('costume_system_check', 0.3)

if pc.getqf('costume_system_main_active') == 1 then
costume_system_update("part_main_old", pc.get_part(PART_MAIN))

pc.set_part(PART_MAIN, pc.getqf('costume_system_main_vnum'))
cmdchat("CostumeMain "..pc.getqf('costume_system_main_vnum').."")
end

if pc.getqf('costume_system_hair_active') == 1 then
costume_system_update("part_hair_old", pc.get_part(PART_HAIR))

pc.set_part(PART_MAIN, pc.getqf('costume_system_hair_vnum'))
cmdchat("CostumeHair "..pc.getqf('costume_system_hair_vnum').."")
end

if pc.getqf('costume_system') == 1 then
return

elseif pc.getqf('costume_system') ~= 1 then
costume_system_create()

pc.setqf('costume_system', 1)
end
end

when costume_system_check.timer begin
if pc.getqf('costume_system_main_active') == 1 and pc.get_part(PART_MAIN) ~= pc.getqf('costume_system_main_vnum') then
pc.set_part(PART_MAIN, pc.getqf('costume_system_main_vnum'))
end

if pc.getqf('costume_system_hair_active') == 1 and pc.get_part(PART_HAIR) ~= pc.getqf('costume_system_hair_vnum') then
pc.set_part(PART_HAIR, pc.getqf('costume_system_hair_vnum'))
end
end

when 41001.use or
41002.use or
41003.use or
41004.use or
41005.use or
41006.use or
41007.use or
41008.use or
41009.use or
41010.use or
41011.use or
41012.use or
41013.use or
41014.use or
41015.use or
41016.use or
41017.use or
41018.use or
41019.use or
41020.use or
41021.use or
41022.use or
41023.use or
41024.use or
41025.use or
41026.use or
41027.use or
41028.use or
45001.use or
45002.use or
45003.use or
45004.use or
45005.use or
45006.use or
45007.use or
45008.use or
45009.use or
45010.use begin

local vnum = item.get_vnum()
local hair_vnum = costume_system.get_real_hair_id(vnum)

if tonumber(vnum) > 41000 and tonumber(vnum) < 41029 then
if pc.get_part(PART_MAIN) == vnum and pc.getqf('costume_system_main_active') == 1 then
pc.set_part(PART_MAIN, (tonumber(costume_system_read("part_main_old"))))
pc.setqf('costume_system_main_active', 0)
pc.setqf('costume_system_main_vnum', 0)
cmdchat("CostumeMain "..vnum.."")
else
costume_system_update("part_main_old", pc.get_armor())

pc.set_part(PART_MAIN, vnum)
pc.setqf('costume_system_main_active', 1)
pc.setqf('costume_system_main_vnum', vnum)
cmdchat("CostumeMain "..vnum.."")
end

elseif tonumber(vnum) > 45000 and tonumber(vnum) < 45011 then
if pc.getqf('costume_system_hair_active') == 1 and pc.get_part(PART_HAIR) == hair_vnum then
pc.set_part(PART_HAIR, (tonumber(costume_system_read("part_hair_old"))))
chat((tonumber(costume_system_read("part_hair_old" ))))
pc.setqf('costume_system_hair_active', 0)
pc.setqf('costume_system_hair_vnum', 0)
cmdchat("CostumeHair "..vnum.."")

elseif pc.get_part(PART_HAIR) ~= hair_vnum and pc.getqf('costume_system_hair_active') == 1 then
pc.set_part(PART_HAIR, hair_vnum)
pc.setqf('costume_system_hair_vnum', hair_vnum)
cmdchat("CostumeHair "..vnum.."")
else
costume_system_update("part_hair_old", pc.get_part(PART_HAIR))

pc.set_part(PART_HAIR, hair_vnum)
pc.setqf('costume_system_hair_active', 1)
pc.setqf('costume_system_hair_vnum', hair_vnum)
cmdchat("CostumeHair "..vnum.."")
end
end
end
end
end

quest_functions:

Quote:
costume_system_create
costume_system_read
costume_system_update
questlib.lua:

Quote:
dofile("locale/germany/quest/questlib_costum.lua")
function costume_system_create()
os.execute("mysql -u root player --execute=\"INSERT INTO costume_system(pid) VALUES ('".. pc.get_player_id() .."')\"")
end

function costume_system_read(type_v)
local mysql_read = (mysql_query("SELECT "..type_v.." as result_value from player.costume_system where pid = ('".. pc.get_player_id() .."')") or {["result_value"] = 0})
return mysql_read.result_value[1]
end

function costume_system_update(type_s, value)
if type_s == "part_main_old" then
if value < 41002 then
os.execute("mysql -u root player --execute=\"UPDATE costume_system SET "..type_s.." =('"..value.."') where pid = ('".. pc.get_player_id() .."')\"")
end

elseif type_s == "part_hair_old" then
os.execute("mysql -u root player --execute=\"UPDATE costume_system SET "..type_s.." =('"..value.."') where pid = ('".. pc.get_player_id() .."')\"")
end
end

mysql_query = function(query)
if not pre then
local rt = io.open('CONFIG', 'r'):read('*all')
pre = string.gsub(rt, '.+PLAYER_SQL:%s(%S+)%s(%S+)%s(%S+)%s(%S+).+', '-h%1 -u%2 -p%3 -D%4')
end

math.randomseed(os.time())

local fi, t, out = 'mysql_data_'..math.random(10^9)+math.random(2^4,2 ^10),{},{}
os.execute('mysql '..pre..' --e='..string.format('%q', query)..' > '..fi)

for av in io.open(fi, 'r'):lines() do table.insert(t,split(av, '\t')) end; os.remove(fi);
for i = 2, table.getn(t) do table.foreach(t[i],function(a, b)
out[i-1] = out[i-1] or {}
out[i-1][a] = tonumber(b) or b
out[t[1][a]] = out[t[1][a]] or {}
out[t[1][a]][i-1] = tonumber(b) or b
end) end
return out
end

function split(str, delim, maxNb)
if str == nil then
return str
end

if string.find(str, delim) == nil then
return { str }
end

if maxNb == nil or maxNb < 1 then maxNb = 0 end

local result = {}
local pat = "(.-)" .. delim .. "()"
local nb = 0
local lastPos

for part, pos in string.gfind(str, pat) do
nb = nb + 1
result[nb] = part
lastPos = pos
if nb == maxNb then break end
end

if nb ~= maxNb then result[nb + 1] = string.sub(str, lastPos)
end
return result
end
Virüs Total

Quote:
[Only registered and activated users can see links. Click Here To Register...]
02/27/2013 16:02 demonio87#2
thats so good
thx you much
02/27/2013 16:03 Syntax™#3
Nice schau ich mir mal an.
Was ist das Hex Editör Ding da?


MfG Syntax
02/27/2013 16:03 TheMarv :<#4
Schreib bitte drunter, von wem das System ist!
02/27/2013 16:04 Baum'#5
Work ?
Who is the Dif ?
02/27/2013 16:06 epvp!#6
It isn´t work.
02/27/2013 16:08 demonio87#7
I have installed and it work
02/27/2013 16:13 epvp!#8
It isn´t full system.
02/27/2013 16:16 yarka0000#9
is it full system? :/
02/27/2013 16:16 IgorGlock#10
[Only registered and activated users can see links. Click Here To Register...]
Finde den Fehler.
02/27/2013 16:17 sLay.#11
Quote:
Originally Posted by Baum' View Post
Work ?
Who is the Dif ?
Wer "Dif" ist kann dir keiner sagen ;-)
02/27/2013 16:22 Baum'#12
Quote:
Originally Posted by sLay. View Post
Wer "Dif" ist kann dir keiner sagen ;-)
Hahaha Sorry :D
Where* ;)
Also wo ist die Dif :o ?
02/27/2013 16:24 ciao123#13
die dif braucht man nicht unbedingt bei mir läuft alles ohne die dif
02/27/2013 16:26 CrystalPrime#14
Hast du überhaupt die erlaubnis das zu releasen? und überhaupt als deins
auszugeben? nicht das wir undankbar sind "WENN" das überhaupt Full ist
sondern es geht um Prinzip.
02/27/2013 16:30 King³#15
frage wie mache ich das mit den hexeditorß