Denki Inparusu.lua

main 38 lines · 1.2 KB Raw
Alex Alex Commit Server upload 18/10/2026 23:38
1local vocationChangeTime = 120 -- Tempo em segundos (2 minutos)
2local newVocation = 2 -- Nova vocação temporária
3local originalOutfit = {lookType = 45} -- Outfit original
4local temporaryOutfit = {lookType = 44} -- Outfit temporário
5
6function onCastSpell(creature, variant)
7 if not creature or not creature:isPlayer() then
8 return false
9 end
10
11 local player = creature:getPlayer()
12 local originalVocation = player:getVocation():getId()
13
14 if originalVocation ~= 2 then
15 player:sendCancelMessage("Apenas jogadores com vocation 2 podem usar essa magia.")
16 return false
17 end
18
19 -- Altera a vocação
20 player:setVocation(Vocation(newVocation))
21 -- Altera o outfit
22 player:setOutfit(temporaryOutfit)
23
24 -- Mensagem de feedback
25 player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Sua vocação foi alterada temporariamente!")
26
27 -- Reverte a mudança após o tempo definido
28 addEvent(function()
29 if player and player:isPlayer() then
30 player:setVocation(Vocation(originalVocation))
31 player:setOutfit(originalOutfit)
32 player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Sua vocação voltou ao normal.")
33 end
34 end, vocationChangeTime * 1000)
35
36 return true
37end
38
Top