Skryp na Transformacje
Info: playerVocation - tutaj wstawiasz ID profesji które mogą tego użyć playerNewVocation - ID nowej profesji w którą się transformujesz playerNewLookType - ID nowego outfitu playerLevel - wymagany level manaCost - wymagana ilość many soulCost - wymagana ilość souli timeActive - czas działania w sekundach
Installation:
Do Talkaction.xml dodajesz:
<talkaction words="!transform" script="transform.lua"/>
Folder data/talkaction/scripts/tranform.lua
-- Transformation System by Karas local configuration = { playerVocation = {1, 2, 5, 6}, playerNewVocation = 9, playerNewLookType = 12, playerLevel = 10, manaCost = 100, soulCost = 2, timeActive = 10 } local VOCATION_STORAGE = 10000 local outfit = {lookType = configuration.playerNewLookType, lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0, lookAddons = 0} function onSay(cid, words, param) if(isInArray(configuration.playerVocation, getPlayerVocation(cid)) == TRUE) then if(getPlayerLevel(cid) >= configuration.playerLevel) then if(getPlayerMana(cid) >= configuration.manaCost) then if(getPlayerSoul(cid) >= configuration.soulCost) then setPlayerStorageValue(cid, VOCATION_STORAGE, getPlayerVocation(cid)) doPlayerSetVocation(cid, configuration.playerNewVocation) doPlayerAddMana(cid, - configuration.manaCost) doPlayerAddSoul(cid, - configuration.soulCost) doSetCreatureOutfit(cid, outfit, configuration.timeActive * 1000) addEvent(transformBack, configuration.timeActive * 1000, cid) else doPlayerSendCancel(cid, "Sorry, you don\'t have required soul points.") end else doPlayerSendCancel(cid, "Sorry, you don\'t have required mana points.") end else doPlayerSendCancel(cid, "Sorry, you don\'t have required level.") end else doPlayerSendCancel(cid, "Sorry, you don\'t have required vocation.") end end function transformBack(cid) doPlayerSetVocation(cid, getPlayerStorageValue(cid, VOCATION_STORAGE)) setPlayerStorageValue(cid, VOCATION_STORAGE, 0) end
W creaturescritps/scripts podmień login.lua na to:
local VOCATION_STORAGE = 10000 function onLogin(cid) if(getPlayerStorageValue(cid, VOCATION_STORAGE) > 0) then doPlayerSetVocation(cid, getPlayerStorageValue(cid, VOCATION_STORAGE)) setPlayerStorageValue(cid, VOCATION_STORAGE, 0) end return TRUE end
Mam nadzieję, że się przyda
|