zbizu
Legendary OT User
http://tibia.wikia.com/wiki/Hot_Cuisine_Quest/Spoiler#Reward
feathures:
- working speed adjustment underwater, without helmet of the deep requirement, based on storage
- all hot cuisine dishes scripted
- improved underwater script
this script lets you use those dishes, values may be different than rl
- I was too lazy to apply custom conditions for demonic candy balls so I used existing ones
- I used math.random instead of actionid in pot of blackjack to avoid recharging it using market
- underwater speed buff time saved in storage is more stable than saving it on helmet of the deep
actions.xml:
food_special.lua:
http://pastebin.com/rHu5VRmP
movements.xml:
drowning.lua (replace it's content for this code):
feathures:
- working speed adjustment underwater, without helmet of the deep requirement, based on storage
- all hot cuisine dishes scripted
- improved underwater script
this script lets you use those dishes, values may be different than rl
- I was too lazy to apply custom conditions for demonic candy balls so I used existing ones
- I used math.random instead of actionid in pot of blackjack to avoid recharging it using market
- underwater speed buff time saved in storage is more stable than saving it on helmet of the deep
actions.xml:
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/rHu5VRmP
movements.xml:
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"/>
drowning.lua (replace it's content for this code):
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(cid, item, position, fromPosition)
local slotItem = getPlayerSlotItem(cid, CONST_SLOT_HEAD)
if isPlayer(cid) then
if Player(cid):getCondition(CONDITION_DROWN,CONDITIONID_COMBAT) == nil then
doAddCondition(cid, condition)
end
if getPlayerStorageValue(cid,17100) > os.time() then
if getPlayerStorageValue(cid,17101) < 1 then
doChangeSpeed(cid, 600)
setPlayerStorageValue(cid,17101,1)
end
end
end
if(math.random(1, 10) == 1) then
doSendMagicEffect(position, CONST_ME_BUBBLES)
end
return true
end
local underWater = {5405, 5406, 5407, 5408, 5409, 5410, 5743, 5744, 5764, 9671, 9672, 9673, 10019}
function onStepOut(cid, item, pos)
if isPlayer(cid) then
if(isInArray(underWater, getThingfromPos({x = getThingPos(cid).x, y = getThingPos(cid).y, z = getThingPos(cid).z, stackpos = 0}).itemid)) then
return true
else
doRemoveCondition(cid, CONDITION_DROWN)
if getPlayerStorageValue(cid,17101) == 1 then
doChangeSpeed(cid, 600 * (-1))
setPlayerStorageValue(cid,17101,0)
end
end
end
return true
end
Last edited: