Svira
Active Member
- Joined
- Jan 27, 2008
- Messages
- 269
- Solutions
- 11
- Reaction score
- 37
Some time ago I was looking for a potiona or mana regenerating run of hp and MP. Search results are a waste of time because nothing worked on the TFS 1.2 mentioned in the topic
I wrote my own and deprived myself of my goal.
actions/scripts/others create unstablepot.lua
in actions.xml
Have fun.
I wrote my own and deprived myself of my goal.
actions/scripts/others create unstablepot.lua
Code:
-- realmap.pl
local healthPot = 12328
local exhaust = Condition(CONDITION_EXHAUST_HEAL)
exhaust:setParameter(CONDITION_PARAM_TICKS, (configManager.getNumber(configKeys.EX_ACTIONS_DELAY_INTERVAL) - 200))
-- 1000 - 100 due to exact condition timing. -100 doesn't hurt us, and players don't have reminding ~50ms exhaustion.
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
if player:getCondition(CONDITION_EXHAUST_HEAL) then
player:sendTextMessage(MESSAGE_STATUS_SMALL, Game.getReturnMessage(RETURNVALUE_YOUAREEXHAUSTED))
return true
end
local itemId = item:getId()
player:addCondition(exhaust)
player:say("uhhh...", TALKTYPE_MONSTER_SAY)
if itemId == healthPot then
if not doTargetCombatMana(0, player, 75, 525, CONST_ME_MAGIC_BLUE) then
if not doTargetCombatHealth(0, player, COMBAT_HEALING, 125, 575, CONST_ME_MAGIC_BLUE) then
return false
end
return true
end
end
end
in actions.xml
Code:
<action itemid="12328" script="other/unstablepot.lua" />
Have fun.