Fiz um script simples para quando o player andar em baixo da água. O script troca a Outfit do personagem para o de mergulhador e altera a velocidade do mesmo.
Adicione em data/movements/movements.xml
<movevent type="StepIn" fromid="5405" toid="5410" event="script" value="diving.lua"/> <movevent type="StepOut" fromid="5405" toid="5410" event="script" value="diving.lua"/>
Agora vá em data/movements/scripts, crie o arquivo diving.lua e adicione:
function onStepIn(cid, item, position, fromPosition) if getPlayerStorageValue(cid, 30211) == 1 then return true end if isPlayer(cid) then local outfit = getCreatureOutfit(cid) local out = getPlayerSex(cid) == 0 and 1035 or 1034 setPlayerStorageValue(cid, 30211, 1) doChangeSpeed(cid, -getCreatureSpeed(cid)) doChangeSpeed(cid, 1000) doSetCreatureOutfit(cid, {lookType = out, lookHead = outfit.lookHead, lookBody = outfit.lookBody, lookLegs = outfit.lookLegs, lookFeet = outfit.lookFeet}, -1) endendfunction onStepOut(cid, item, position, fromPosition) if isPlayer(cid) then setPlayerStorageValue(cid, 30211, -1) doChangeSpeed(cid, -getCreatureSpeed(cid)) doRegainSpeed(cid) doRemoveCondition(cid, CONDITION_OUTFIT) endend
OBS: Testado no DxP.