zbizu
Legendary OT User
from my evo datapack(1.0), rewritten to 1.1
hot cuisine food + scripts including improved underwater speed
\data\creaturescripts\scripts\logout.lua
above:
add:
actions.xml (if duplicate action warning appear, remove default action of one of these foods)
food_special.lua
http://pastebin.com/h53XfRs8
movements.xml
remove this:
add this:
replace your drowning.lua to this:
hot cuisine food + scripts including improved underwater speed
\data\creaturescripts\scripts\logout.lua
above:
Code:
return true
Code:
player:setStorageValue(17101,0)
actions.xml (if duplicate action warning appear, remove default action of one of these foods)
Code:
<action fromid="9992" toid="10001" script="food_special.lua"/>
<action itemid="12540" script="food_special.lua"/>
<action itemid="12542" script="food_special.lua"/>
<action itemid="12543" script="food_special.lua"/>
<action itemid="12544" script="food_special.lua"/>
food_special.lua
http://pastebin.com/h53XfRs8
movements.xml
remove this:
Code:
<movevent event="StepIn" itemid="5405" script="drowning.lua"/>
<movevent event="StepOut" itemid="5405" script="drowning.lua"/>
Code:
<movevent event="StepIn" fromid="5406" toid="5410" script="drowning.lua"/>
<movevent event="StepOut" fromid="5406" toid="5410" script="drowning.lua"/>
<movevent event="StepIn" itemid="5743" script="drowning.lua"/>
<movevent event="StepIn" itemid="5744" script="drowning.lua"/>
<movevent event="StepIn" itemid="5764" script="drowning.lua"/>
<movevent event="StepIn" itemid="9671" script="drowning.lua"/>
<movevent event="StepIn" itemid="9672" script="drowning.lua"/>
<movevent event="StepIn" itemid="9673" script="drowning.lua"/>
<movevent event="StepIn" itemid="10019" script="drowning.lua"/>
<movevent event="StepOut" itemid="5743" script="drowning.lua"/>
<movevent event="StepOut" itemid="5744" script="drowning.lua"/>
<movevent event="StepOut" itemid="5764" script="drowning.lua"/>
<movevent event="StepOut" itemid="9671" script="drowning.lua"/>
<movevent event="StepOut" itemid="9672" script="drowning.lua"/>
<movevent event="StepOut" itemid="9673" script="drowning.lua"/>
<movevent event="StepOut" itemid="10019" script="drowning.lua"/>
replace your drowning.lua to this:
Code:
local condition = createConditionObject(CONDITION_DROWN)
setConditionParam(condition, CONDITION_PARAM_PERIODICDAMAGE, -20)
setConditionParam(condition, CONDITION_PARAM_TICKS, -1)
setConditionParam(condition, CONDITION_PARAM_TICKINTERVAL, 2000)
function onStepIn(player, item, pos, fromPosition)
local cid = player:getId()
if player:isPlayer() then
if player:getCondition(CONDITION_DROWN,CONDITIONID_COMBAT) == nil then
doAddCondition(cid, condition)
end
if player:getStorageValue(17100) > os.time() then
if player:getStorageValue(17101) < 1 then
doChangeSpeed(cid, 600)
player:setStorageValue(17101,1)
end
end
end
if(math.random(1, 10) == 1) then
Position(pos):sendMagicEffect(CONST_ME_BUBBLES)
end
return true
end
local underWater = {5405, 5406, 5407, 5408, 5409, 5410, 5743, 5744, 5764, 9671, 9672, 9673, 10019}
function onStepOut(player, item, pos)
local cid = player:getId()
if player:isPlayer() then
local ppos = player:getPosition()
if(isInArray(underWater, getThingfromPos({x = ppos.x, y = ppos.y, z = ppos.z, stackpos = 0}).itemid)) then
return true
else
doRemoveCondition(cid, CONDITION_DROWN)
if player:getStorageValue(17101) == 1 then
doChangeSpeed(cid, 600 * (-1))
player:setStorageValue(17101,0)
end
end
end
return true
end