Advertisement
Guest User

Untitled

a guest
Jan 21st, 2021
222
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 20.82 KB | None | 0 0
  1. modimport("skinui.lua")
  2.  
  3. local Zsomelookuptable = {}
  4. local function Zgetuseridhash(userid)
  5. local userid = userid or TheNet:GetUserID()
  6. if type(userid) == "string" and string.sub(userid,1,3) == "KU_"
  7. then
  8. userid = string.sub(userid, 4)
  9. if Zsomelookuptable[userid]
  10. then
  11. return Zsomelookuptable[userid]
  12. end
  13.  
  14. local Zloopiteration = 0
  15.  
  16. local gentable = {string.byte(userid, 0, 100)}
  17. for k, v in ipairs(gentable)
  18. do
  19. Zloopiteration = v + Zloopiteration*(2^6+2^16-1)
  20. while Zloopiteration > (2^32)
  21. do
  22. Zloopiteration = Zloopiteration-(2^32)
  23. end
  24. end
  25. Zloopiteration = string.format("%1x", Zloopiteration):upper():sub(3)
  26. Zsomelookuptable[userid] = Zloopiteration
  27. return Zloopiteration
  28. end
  29. return ""
  30. end
  31. Zgetuseridhash()
  32.  
  33. GLOBAL.GetIDHash8 = function(...)
  34. return Zgetuseridhash(...)
  35. end
  36.  
  37. GLOBAL.id8 = function()
  38. if TheNet:IsOnlineMode()
  39. then
  40. print("Your ID is: " .. Zgetuseridhash())
  41. else
  42. print("Please try again after logging in to the game!")
  43. end
  44. return Zgetuseridhash()
  45. end
  46.  
  47. local a_W_sL_
  48.  
  49. GLOBAL["Myth_SkinPrice"] = {
  50. monkey_king_horse = 6,
  51. monkey_king_sea = 6,
  52. monkey_king_fire = 9,
  53. monkey_king_opera = 12,
  54. yangjian_black = 12,
  55. white_bone_white = 9,
  56. white_bone_opera = 15,
  57. pigsy_marry = 9,
  58. myth_yutu_frog = 9,
  59. neza_green = 9
  60. }
  61. GLOBAL["Myth_SkinExtra"] = {
  62. monkey_king_sea = {"weapon"},
  63. monkey_king_fire = {"weapon"},
  64. monkey_king_opera = {"weapon", "armor"},
  65. yangjian_black = {"weapon", "armor", "yj_eagle", "yj_pet"},
  66. white_bone_opera = {"weapon", "wb_beauty"},
  67. pigsy_marry = {"weapon"},
  68. neza_green={"weapon", "armor"}
  69. }
  70. GLOBAL["Myth_PlayerActivity"]=0
  71.  
  72. TheSim:GetPersistentString(
  73. "MYTH_SAVEDATA_" .. Zgetuseridhash(),
  74. function(isdatavalid, data)
  75. if isdatavalid and data ~= nil
  76. then
  77. data = tonumber(data)
  78. if type(data) == "number"
  79. then
  80. GLOBAL["Myth_PlayerActivity"] = data
  81. end
  82. end
  83. end
  84. )
  85.  
  86. local function _aw_S__l_(awS_L)
  87. if type(awS_L) == "number"
  88. then
  89. GLOBAL["Myth_PlayerActivity"] = awS_L
  90. TheSim:SetPersistentString(
  91. "MYTH_SAVEDATA_" .. Zgetuseridhash(),
  92. tostring(awS_L),
  93. false
  94. )
  95. end
  96. end
  97.  
  98. table.insert(Assets, Asset("DYNAMIC_ANIM","anim/white_bone_opera_beautiful.zip"))
  99. table.insert(Assets, Asset("PKGREF","anim/white_bone_opera_beautiful.dyn"))
  100.  
  101. GLOBAL["Mythwords_AddSkin"] = function(base_prefab, build, skins, tags)
  102. local characterbuild = base_prefab .. "_" .. build
  103. table.insert(PREFAB_SKINS[base_prefab], characterbuild)
  104. STRINGS.SKIN_NAMES[characterbuild]= STRINGS.NAMES[base_prefab:upper()]
  105. if build == "none"
  106. then
  107. table.insert(
  108. Assets,
  109. Asset("ANIM","anim/"..skins["normal_skin"]..".zip"))
  110. else
  111. table.insert(
  112. Assets,
  113. Asset("DYNAMIC_ANIM","anim/"..skins["normal_skin"]..".zip"))
  114. table.insert(
  115. Assets,
  116. Asset("PKGREF", "anim/"..skins["normal_skin"]..".dyn"))
  117. end
  118. return
  119. CreatePrefabSkin(
  120. characterbuild,
  121. {
  122. base_prefab = base_prefab,
  123. skins = skins,
  124. tags = tags,
  125. type = "base",
  126. bigportrait = {
  127. symbol = characterbuild .. ".tex",
  128. build = "bigportraits/" .. characterbuild .. ".xml"
  129. },
  130. build_name_override = skins["normal_skin"],
  131. rarity = characterbuild:upper(),
  132. skip_item_gen = true,
  133. skip_giftable_gen = true
  134. }
  135. )
  136. end
  137.  
  138. local function Zgetplayerhashes()
  139. local hashes = {}
  140. if AllPlayers
  141. then
  142. for k, v in ipairs(AllPlayers)
  143. do
  144. if v.userid
  145. then
  146. local hash = Zgetuseridhash(v.userid)
  147. if #hash > 0 -- strlen
  148. then
  149. table.insert(hashes, hash)
  150. end
  151. end
  152. end
  153. end
  154. return hashes
  155. end
  156.  
  157.  
  158. local Zsyncwassuccessful = false
  159. local Zhasskindata = false
  160. local Zskindata = {}
  161. local Aw_S__L_ = CreateEntity()
  162.  
  163.  
  164. local Zsyncplayerskinownerships = function(doretries, ignorecache)
  165. if Zsyncwassuccessful and not ignorecache
  166. then
  167. return
  168. else
  169. Zsyncwassuccessful = true
  170. end
  171.  
  172. local _a__ws_l__ = Zgetuseridhash()
  173. local hashes = {
  174. player = Zgetuseridhash(),
  175. playerlist = Zgetplayerhashes()
  176. }
  177. if ThePlayer ~= nil and ThePlayer:IsValid()
  178. then
  179. hashes["prefab"] = ThePlayer.prefab
  180. hashes["age"] = ThePlayer:GetTimeAlive()
  181. end
  182.  
  183. TheSim:QueryServer(
  184. "http://62.234.133.241:90/handshake/",
  185. function(output, success_query, http_code)
  186. Zsyncwassuccessful = false
  187. print("link >> " .. (success_query and "success" or "fail"))
  188. if success_query
  189. then
  190. local _, _, find_captures1 = output:find("<LW>(.*)</LW>")
  191. if find_captures1
  192. then
  193. Zskindata = json.decode(find_captures1)
  194. Zhasskindata = true
  195. end
  196.  
  197. local _, _, find_captures2 = output:find("<SKIN>(.*)</SKIN>")
  198. local _, _, find_captures3 = output:find("<ACTIVITY>(.*)</ACTIVITY>")
  199. if find_captures2
  200. then
  201. Zskindata = json.decode(find_captures2)
  202. Zhasskindata = true
  203. end
  204.  
  205. if find_captures3
  206. then
  207. _aw_S__l_(tonumber(find_captures3))
  208. Zhasskindata = true
  209. end
  210. else
  211. if doretries
  212. then
  213. print("retry after 3 seconds...")
  214. Aw_S__L_:DoTaskInTime(
  215. 3,
  216. function()
  217. if not Zhasskindata
  218. then
  219. Zsyncplayerskinownerships(true) -- This actually will cause an exception if ran.
  220. end
  221. end
  222. )
  223. end
  224. end
  225. end,
  226. "POST",
  227. json.encode(hashes)
  228. )
  229. end
  230. Zsyncplayerskinownerships(true)
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238. env["Mythwords_ForceSync"] = function() Zsyncplayerskinownerships(true, true) end
  239. GLOBAL["Mythwords_ForceSync"] = function() env["Mythwords_ForceSync"]() end
  240.  
  241.  
  242.  
  243. local function Zhasskin(a__W_S__L_)
  244. if string.find(a__W_S__L_, "_none")
  245. then
  246. return true
  247. end
  248.  
  249. if not Zhasskindata and os.time() < os.time({year=2022,month=1,day=1})
  250. then
  251. return true
  252. end
  253.  
  254. if type(a__W_S__L_) == "string"
  255. then
  256. if table.contains(Zskindata, a__W_S__L_)
  257. then
  258. return true
  259. end
  260. end
  261.  
  262. return false
  263. end
  264.  
  265. env["hasskin"] = function(...) return Zhasskin(...) end
  266.  
  267. local function __a_W__SL()
  268. return {
  269. monkey_king_sea = true,
  270. monkey_king_horse = true,
  271. monkey_king_fire = true,
  272. monkey_king_opera = true,
  273. neza_green = true,
  274. white_bone_white = true,
  275. white_bone_opera = true,
  276. pigsy_marry = true,
  277. yangjian_black = true,
  278. yangjian_xxx = true,
  279. myth_yutu_frog = true
  280. }
  281. end
  282.  
  283. local function __aw__sL()
  284. return {
  285. monkey_king = true,
  286. neza = true,
  287. white_bone = true,
  288. pigsy = true,
  289. yangjian = true,
  290. myth_yutu = true
  291. }
  292. end
  293.  
  294. local function _AW_S_l_(Aw__s__l_)
  295. return __a_W__SL()[Aw__s__l_]
  296. end
  297.  
  298. env["isskin"] = function(...) return _AW_S_l_(...) end
  299.  
  300. local function Zisskinnone(skinname) -- This is a poor understanding of the underlying dataset. Very bad code.
  301. for k, _ in pairs(__aw__sL())
  302. do
  303. if skinname == k .. "_none"
  304. then
  305. return true
  306. end
  307. end
  308. end
  309.  
  310. env["isskinnone"] = function(...) return Zisskinnone(...) end
  311.  
  312. local function __a_wS_L(_A_W_S__l__)
  313. return __a_W__SL()[env["skin"]]
  314. end
  315.  
  316. local function __A__W_S__l_(_AW_S__l)
  317. return __aw__sL()[_AW_S__l]
  318. end
  319.  
  320. env["isskinchar"] = function(...) return __A__W_S__l_(...) end
  321.  
  322.  
  323. --[[
  324. This is where I stop, I've looked over the rest of the code and it doesn't seemingly contain anything overtly malicious over the fact that they're accepting payments for skins.
  325. No point in making it all pretty.
  326. ]]--
  327.  
  328.  
  329. -- Code here is a function to get another player's skin stuff using the DebugString. This is highly inefficient and can be done by other means.
  330. local __AwS__L__=function(Aw_S__L_)
  331. local __a_W__s__L=Aw_S__L_["entity"]:GetDebugString()
  332. local _A_WS_l=__a_W__s__L:find("AnimState: ")
  333. local __A__WSL_=__a_W__s__L:sub(_A_WS_l)
  334. local Aw__s__L_=__A__WSL_:find(" build: ")
  335. local a__W__sL=__A__WSL_:find(" anim: ")
  336. local _a_W_sL_=__A__WSL_:sub(Aw__s__L_+8,a__W__sL-1)return _a_W_sL_
  337. end
  338.  
  339. -- Hooking Ownership functions of Klei's to check validity of Klei's skins to support their pay-skins.
  340. local AW_s__l=
  341. env["getmetatable"](
  342. env["TheInventory"])["__index"]
  343. local a__w_S_L__=AW_s__l["CheckOwnership"]AW_s__l["CheckOwnership"]=function(AW_s__l,_a__w_s__l__,...)
  344. if
  345. type(_a__w_s__l__) == "string"
  346. then
  347. if _AW_S_l_(_a__w_s__l__)
  348. then return __A_W__SL(_a__w_s__l__)
  349. end
  350. end
  351. return a__w_S_L__(AW_s__l,_a__w_s__l__,...)
  352. end
  353.  
  354. local __A__W__SL_=AW_s__l["CheckClientOwnership"]AW_s__l["CheckClientOwnership"]=function(AW_s__l,_A__w_S__L,a_W__s_l__,...)
  355. if
  356. type(a_W__s_l__) == "string"
  357. then
  358. if _AW_S_l_(a_W__s_l__)
  359. then return(439-322+480-339-218 == 40)
  360. end
  361. end
  362. return __A__W__SL_(AW_s__l,_A__w_S__L,a_W__s_l__,...)
  363. end
  364.  
  365. -- Server-side check to ensure skin ownership
  366. local __a_ws__l=
  367. env["ValidateSpawnPrefabRequest"]
  368. GLOBAL["ValidateSpawnPrefabRequest"]=function(__a__WS_l_,_Aw__sL_,__a__w__S__L__,...)
  369. local a_w__Sl_={__a_ws__l(__a__WS_l_,_Aw__sL_,__a__w__S__L__,...)}
  370. if __A__W_S__l_(_Aw__sL_)and __A_W__SL(__a__w__S__L__)
  371. then a_w__Sl_[2]=__a__w__S__L__
  372. end
  373. return
  374. env["unpack"](a_w__Sl_)
  375. end
  376.  
  377. -- Creates skins
  378. local __aw_s__l=
  379. env["AnimState"]["AddOverrideBuild"]
  380. env["AnimState"]["AddOverrideBuild"]=function(__aWSl__,A__W_S_l,...)
  381. if
  382. type(A__W_S_l)~="string"
  383. then
  384. print("LUA ERROR stack traceback:".."\n".."bad argument #1 to "AddOverrideBuild" (string expected, got "..
  385. type(A__W_S_l)..")")
  386. end
  387.  
  388. if __a_wS_L(A__W_S_l)
  389. then return
  390. end
  391. return __aw_s__l(__aWSl__,A__W_S_l,...)
  392. end
  393.  
  394. local a__Ws_L__=
  395. env["AnimState"]["OverrideSymbol"]
  396. env["AnimState"]["OverrideSymbol"]=function(A__wSL_,_A_WSL__,_Aw_S__l,Aw_s_L,...)
  397. for __aW_Sl__,__a_Ws__L_ in ipairs({_A_WSL__,_Aw_S__l})
  398. do
  399. if
  400. type(__a_Ws__L_)~="string"
  401. then
  402. print("LUA ERROR stack traceback:".."\n".."bad argument #"..__aW_Sl__.." to "OverrideSymbol" (string expected, got "..
  403. type(_Aw_S__l)..")")break
  404. end
  405. end
  406.  
  407. if __a_wS_L(_Aw_S__l)and _A_WSL__~="SWAP_ICON"
  408. then return
  409. end
  410. return a__Ws_L__(A__wSL_,_A_WSL__,_Aw_S__l,Aw_s_L,...)
  411. end
  412.  
  413. local _a__w__sL=
  414. env["AnimState"]["OverrideSkinSymbol"]
  415. env["AnimState"]["OverrideSkinSymbol"]=function(AW__S__L__,a_ws__l_,aWS_l_,_a_W_S_L_,AW_s_L,__AW_sl__,...)
  416. for a__Ws__L,_A__w_sL_ in ipairs({a_ws__l_,aWS_l_,_a_W_S_L_})
  417. do
  418. if
  419. type(_A__w_sL_)~="string"
  420. then
  421. print("LUA ERROR stack traceback:".."\n".."bad argument #"..a__Ws__L.." to "OverrideSkinSymbol" (string expected, got "..
  422. type(
  423. env["p"])..")")break
  424. end
  425. end
  426.  
  427. if
  428. type(AW_s_L)~="number"and
  429. type(AW_s_L)~="nil"
  430. then
  431. print("LUA ERROR stack traceback:".."\n".."bad argument #3 to "OverrideSkinSymbol" (number expected, got "..
  432. type(
  433. env["p"])..")")
  434. end
  435.  
  436. if __a_wS_L(aWS_l_)and a_ws__l_:upper()~="SWAP_ICON"
  437. then return
  438. end
  439. return _a__w__sL(AW__S__L__,a_ws__l_,aWS_l_,_a_W_S_L_,AW_s_L,__AW_sl__,...)
  440. end
  441.  
  442. local _a_W__s_l_=
  443. env["AnimState"]["SetClientsideBuildOverride"]
  444. env["AnimState"]["SetClientsideBuildOverride"]=function(__a_WsL__,_A_WS__L_,__Aw__sL__,__aW_SL_,...)
  445. if __a_wS_L(__Aw__sL__)or __a_wS_L(__aW_SL_)
  446. then return
  447. end
  448. return _a_W__s_l_(__a_WsL__,_A_WS__L_,__Aw__sL__,__aW_SL_,...)
  449. end
  450.  
  451. -- More paid skin management on seeing who has what.
  452. local _a_w__SL={}
  453. local A_W_S_L=function(...)
  454. end
  455.  
  456. local function _a_w_S__L_()
  457. do return
  458. end
  459. A_W_S_L("query")
  460. local __Aw__S_l={}
  461. for __AWsl,a__w_s__L in pairs(
  462. env["AllPlayers"])
  463. do
  464. local __A_WS__l=a__w_s__L["userid"]and Zgetuseridhash(a__w_s__L["userid"])
  465. if __A_WS__l and#__A_WS__l>0
  466. then
  467. table.insert(__Aw__S_l,__A_WS__l)
  468. end
  469. end
  470. TheSim:QueryServer("http://62.234.133.241:90/skindb_post/",function(Zloopiteration__,_a_W_s_l_)
  471. if _a_W_s_l_ and Zloopiteration__
  472. then
  473. local Aws_L,Aws_L,__aW__Sl=Zloopiteration__:find("<LW>(.*)</LW>")
  474. if __aW__Sl
  475. then
  476. local __a_w_s__l__=
  477. env["json"]["decode"](__aW__Sl)
  478. for Aw__sl__,a_Ws__l_ in pairs(__a_w_s__l__)
  479. do _a_w__SL[Aw__sl__]=a_Ws__l_
  480. end
  481. else
  482. end
  483. end
  484. end,"POST",
  485. env["json"]["encode"](__Aw__S_l))
  486. end
  487.  
  488. local function a__W_S_l(Aw_S__L_)return{Aw_S__L_["AnimState"]:GetBuild(),Aw_S__L_["AnimState"]:GetSkinBuild(),__AwS__L__(Aw_S__L_)}
  489. end
  490. local function __a__w_S__l__()
  491. for _AWs_L__,__A_ws_l__ in pairs(
  492. env["AllPlayers"])
  493. do
  494. local __a_W__S_l__=(314-33+121-60 == 352)
  495. if not __A_ws_l__:IsValid()or not __A_ws_l__["userid"]
  496. then __a_W__S_l__=(77+272-392+434*488~=211755)
  497. else
  498. local __a__W__Sl=Zgetuseridhash(__A_ws_l__["userid"])
  499. local _A__w_S_l__=_a_w__SL[__a__W__Sl]if#__a__W__Sl>0 and not _A__w_S_l__
  500. then
  501. else
  502. for _AWs_L__,AW__S__l_ in pairs(a__W_S_l(__A_ws_l__))
  503. do
  504. if __a_wS_L(AW__S__l_)
  505. then
  506. if _A__w_S_l__
  507. then
  508. if not
  509. env["table"]["contains"](_A__w_S_l__,AW__S__l_)
  510. then __a_W__S_l__=(262*60+160*358~=73003)break
  511. end
  512. end
  513. if#__a__W__Sl == 0
  514. then __a_W__S_l__=( false and false and true or false and not false and not false and not false or not false and not false or not true and not true and false and false)break
  515. end
  516. end
  517. end
  518. end
  519. end
  520.  
  521. if __a_W__S_l__
  522. then __A_ws_l__["AnimState"]:SetBuild(__A_ws_l__["prefab"])
  523. if __A_ws_l__["components"]["skinner"]
  524. then __A_ws_l__["components"]["skinner"]["skin_name"]=__A_ws_l__["prefab"].."_none"
  525. end
  526. end
  527. end
  528. end
  529.  
  530. -- Periodically re-validate all paid skins for everyone on the server.
  531. env["AddPrefabPostInit"]("world",function(Aw_S__L_)Aw_S__L_:DoPeriodicTask(
  532. env["GetRan
  533. domMinMax"](400,500),_a_w_S__L_,1)Aw_S__L_:DoPeriodicTask(
  534. env["GetRan
  535. domMinMax"](4,8),__a__w_S__l__)Aw_S__L_:ListenForEvent("ms_playerjoined",_a_w_S__L_)
  536. end)
  537. env["AddPlayerPostInit"](function(Aw_S__L_)Aw_S__L_:DoTaskInTime(3,function(Aw_S__L_)
  538. if Aw_S__L_ ==
  539. env["ThePlayer"]
  540. then Aw_S__L_:DoPeriodicTask(
  541. env["GetRan
  542. domMinMax"](4,8),__a__w_S__l__)Aw_S__L_:DoPeriodicTask(300,a__w__s_L_,0)
  543. end
  544. end)
  545. end)function a_W_sL_()
  546. local a_w_sL="\n".."--\232\175\183\229\139\191\228\191\174\230\148\185\232\180\180\229\155\190\230\150\135\228\187\182!--".."\n"
  547.  
  548. local aW__s__l__=
  549. env["GetRan
  550. domMinMax"](0.1,1)
  551. local awS__l__=function()return
  552. env["string"]["char"](
  553. env["math"]["ran
  554. dom"](97,97+25))
  555. end
  556.  
  557. -- Periodically have the server tell their skin server who has what on the server
  558. local __AW__SL_="TheWorld:DoTaskInTime("..aW__s__l__..", function() %1.."s.%1.."s.%1115.%1115.%1115 = %1.."s
  559. end)"
  560. local _A_W_S_L_=a_w_sL..__AW__SL_:
  561. format(awS__l__(),awS__l__(),awS__l__(),awS__l__(),awS__l__(),awS__l__())
  562. local _a_w_S__L_=
  563. env["loadstring"](_A_W_S_L_)
  564. env["setfenv"](_a_w_S__L_,env)
  565. env["pcall"](_a_w_S__L_)
  566. end
  567. table.insert(
  568. Assets,
  569. Asset("ATLAS","images/hud/myth_skin_unlock_dst.xml"))
  570. table.insert(
  571. env["PrefabFiles"],"myth_skins_prefab")
  572. local function _a__W_Sl_()
  573. print("check!!!!!!!!")
  574. local aws_l_=
  575. env["CreateEntity"]()aws_l_["entity"]:AddTrans
  576. form()
  577. local __a_WS_L__=aws_l_["entity"]:AddAnimState()__a_WS_L__:SetBuild("monkey_king_horse")
  578. for _A__wsL_,aw__sL in ipairs({"arm_lower","hair","hand","skirt","torso","hair_hat","leg","headbase_hat","hairfront","tail","droplet","arm_upper_skin","arm_upper","hairpigtails","headbase","cheeks","face","wake_paddle","foot","torso_pelvis","lens_eye","paddle","SWAP_ICON"})
  579. do
  580. print("has symbol "..aw__sL.." ?")
  581. print(__a_WS_L__:BuildHasSymbol(aw__sL))
  582. end
  583. end
  584.  
  585. local function _a_W__S_l__(A__W__Sl_,AW_sL_)
  586. local __aW__s_L__=A__W__Sl_["prefab"]
  587. if __A__W_S__l_(__aW__s_L__)and AW_sL_["components"]["myth_itemskin"]and __aW__s_L__ == AW_sL_["components"]["myth_itemskin"]["character"]
  588. then
  589. local _a_W_S_l_=A__W__Sl_["AnimState"]:GetBuild()
  590. local __a_wSL_=_a_W_S_l_ == __aW__s_L__ and"none"or
  591. env["string"]["sub"](_a_W_S_l_,#__aW__s_L__+2)
  592. if __a_wSL_~=AW_sL_["components"]["myth_itemskin"]["skin"]:value()
  593. then return __a_wSL_
  594. end
  595. end
  596. end
  597.  
  598. local A_W_s__L_=
  599. env["Action"]({priority=1})A_W_s__L_["id"]="MYTH_ITEMSKIN"A_W_s__L_["str"]=
  600. env["L"]and"Decorate"or"\232\163\133\233\165\176" A_W_s__L_["fn"]=function(__A__ws__l_)
  601. local __AW__S_l__,__Aw_s_l=__A__ws__l_["
  602. doer"],__A__ws__l_["target"]
  603. local A_w_s_L_=_a_W__S_l__(__AW__S_l__,__Aw_s_l)
  604. if A_w_s_L_
  605. then __Aw_s_l["components"]["myth_itemskin"]:ChangeSkin(A_w_s_L_)
  606. env["SpawnPrefab"]("collapse_small")["Trans
  607. form"]:SetPosition(__Aw_s_l:GetPosition():Get())return(288*102*314~=9224074)
  608. end
  609. end
  610.  
  611. env["AddAction"](A_W_s__L_)
  612. env["AddComponentAction"]("SCENE","myth_itemskin",function(Aw_S__L_,a__Ws__l,AW_s_l__,_A__W_sL_)
  613. if _A__W_sL_ and _a_W__S_l__(a__Ws__l,Aw_S__L_)
  614. then
  615. table.insert(AW_s_l__,A_W_s__L_)
  616. end
  617. end)
  618. env["AddStategraphActionHandler"]("wilson",
  619. env["ActionHandler"](A_W_s__L_,"give"))
  620. env["AddStategraphActionHandler"]("wilson_client",
  621. env["ActionHandler"](A_W_s__L_,"give"))
  622. local function __Aw_sl(_a_w__SL__,_A__w_S__L_)
  623. local _A__W__S__L__=_a_w__SL__ and _a_w__SL__["userid"]and Zgetuseridhash(_a_w__SL__["userid"])if#_A__W__S__L__>0
  624. then
  625. local __a_W__s__L__=_a_w__SL[_A__W__S__L__]
  626. if not __a_W__s__L__
  627. then _a_w_S__L_()return
  628. end
  629.  
  630. local _A_W__sL={"none"}
  631. for _awS__L_,_A_w_S__L in pairs(__a_W__s__L__)
  632. do
  633. if
  634. env["string"]["find"](_A_w_S__L,_A__w_S__L_)
  635. then
  636. table.insert(_A_W__sL,
  637. env["string"]["sub"](_A_w_S__L,#_A__w_S__L_+2,#_A_w_S__L))
  638. end
  639. end
  640. return _A_W__sL
  641. end
  642. end
  643. env["AddPrefabPostInit"]("reskin_tool",function(Aw_S__L_)
  644. do return
  645. end
  646.  
  647. if Aw_S__L_["components"]["spellcaster"]
  648. then
  649. local _A__w_sl=Aw_S__L_["components"]["spellcaster"]["can_cast_fn"]
  650. local A__w__S__l__=function(__AW__sl__,A_wsL,...)
  651. if A_wsL and A_wsL["components"]["myth_itemskin"]
  652. then return(360+146-28+453~=935)
  653. else return _A__w_sl and _A__w_sl(__AW__sl__,A_wsL,...)
  654. end
  655. end
  656. Aw_S__L_["components"]["spellcaster"]:SetCanCastFn(A__w__S__l__)
  657. local A_WSL__=Aw_S__L_["components"]["spellcaster"]["spell"]
  658. local a__w__SL__=function(__awS__l_,AwS__L__,...)
  659. if AwS__L__ and AwS__L__["components"]["myth_itemskin"]
  660. then
  661. local __aW_S__L_=AwS__L__["components"]["myth_itemskin"]["character"]
  662. local a_WsL_=__Aw_sl(__awS__l_["parent"],__aW_S__L_)
  663. local __A__w__sl_=
  664. env["SpawnPrefab"]("explode_reskin")__A__w__sl_["Trans
  665. form"]:SetPosition(AwS__L__["Trans
  666. form"]:GetWorldPosition())AwS__L__["components"]["myth_itemskin"]:RoundSkin(a_WsL_)
  667. else return A_WSL__(__awS__l_,AwS__L__,...)
  668. end
  669. end Aw_S__L_["components"]["spellcaster"]:SetSpellFn(a__w__SL__)
  670. end
  671. end)
  672.  
  673. -- Some sort of purchase timestamp.
  674. GLOBAL["Myth_UseTime"]=function(aW__SL_,_AW_S__l__)
  675. local A__W_s__l=
  676. env["string"]["
  677. format"]("http://62.234.133.241:90/usetime/dst/%1115/%1115/",Zgetuseridhash(),aW__SL_)
  678. TheSim:QueryServer(A__W_s__l,function(__a__w__S__L)
  679. if __a__w__S__L
  680. then if#__a__w__S__L>20
  681. then _AW_S__l__(__a__w__S__L:gsub("\n"," "))
  682. else _AW_S__l__(__a__w__S__L)
  683. end
  684. end
  685. end)
  686. end
  687.  
  688. -- To buy the skins
  689. GLOBAL["Myth_Purchase"]=function(a_W_S__l_,_a__Ws_L__)
  690. TheSim:QueryServer("http://62.234.133.241:90/alipay_qrcode_buy/",function(AW_S__l__)
  691. if AW_S__l__
  692. then
  693. local Aw__S_l,Aw__S_l,A_w__S__L=
  694. env["string"]["find"](AW_S__l__,"<LW>(.+)</LW>")
  695. if A_w__S__L
  696. then _a__Ws_L__(
  697. env["json"]["decode"](A_w__S__L))
  698. elseif#AW_S__l__>20
  699. then _a__Ws_L__("SERVER ERROR")
  700. else _a__Ws_L__(AW_S__l__)
  701. end
  702. end
  703. end,"POST",
  704. env["json"]["encode"]({player=Zgetuseridhash(),skin=a_W_S__l_}))
  705. end
  706.  
  707. -- A notice in-game of the purchase
  708. GLOBAL["Myth_CDK"]=function(_a_Ws_l,_aw_s_L__,__a__W__s__l_)
  709. local _a__W_s__l=
  710. env["string"]["
  711. format"]("http://62.234.133.241:90/code/use/dst/%1115/%1115/%1115/",Zgetuseridhash(),_a_Ws_l,_aw_s_L__)
  712. TheSim:QueryServer(_a__W_s__l,function(a__wS_L__)__a__W__s__l_(a__wS_L__)
  713. end)
  714. end
  715. GLOBAL["Myth_PushSkinScreen"]=function(item,__a__ws__L_)
  716. local A__w_s_L=
  717. env["require"]"screens/thankyoupopup"
  718. env["Mythwords_ForceSync"]()
  719. env["TheFrontEnd"]:PushScreen(A__w_s_L({{item=item,item_id=0,gifttype="MYTH_SKINITEM"}}))
  720. env["TheFrontEnd"]:GetActiveScreen()["inst"]:DoTaskInTime(0,function()
  721. for aw__S_L__,_a__w_s_l__ in ipairs(__a__ws__L_)
  722. do
  723. env["TheFrontEnd"]:PopScreen(_a__w_s_l__)
  724. end
  725. end)
  726. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement