Shadowsong
Game Developer & Graphic Designer
- Joined
- Feb 23, 2010
- Messages
- 3,446
- Solutions
- 21
- Reaction score
- 3,001
- Location
- Bosnia & Herzegovina
- YouTube
- ShivaShadowsong
Thought I should contribute something, so here's a couple of simple, yet useful scripts I use on my server.
Compatible with 0.3.6+ (if you face any difficulties, leave a post).
It is a healing fountain which can heal both mana and HP, and has a definable exhaustion so it can't be spammed (if you don't want it to). If you want it to heal something else, like soul, or % of HP/mana, write it in a reply.
(actions/scripts/fountain.lua):
(actions/actions.xml):
This bow will, upon being used (right click on it), paralyze your target. It has a configurable amount of time between its usages, you can also play with the values of paralyze to get the right intensity, etc. Pretty nice for boosting paladins' PvP.
(actions/scripts/parabow.lua):
(actions/actions.xml):
Compatible with 0.3.6+ (if you face any difficulties, leave a post).
Healing Fountain
┌───────────────────────────────┐
┌───────────────────────────────┐
It is a healing fountain which can heal both mana and HP, and has a definable exhaustion so it can't be spammed (if you don't want it to). If you want it to heal something else, like soul, or % of HP/mana, write it in a reply.
(actions/scripts/fountain.lua):
Code:
local exhaustionStorage = [COLOR=#FF0000]2555[/COLOR] [COLOR=#FF0000]-- Storage value for exhastion[/COLOR]
local HPamount = [COLOR=#008000]50[/COLOR] -- [COLOR=#008000]amount of HP healed[/COLOR]
local MPamount = [COLOR=#800080]50[/COLOR] -- [COLOR=#800080]amount of mana healed[/COLOR]
local time = [COLOR=#FF0000]180[/COLOR] -- [COLOR=#FF0000]Time of exhaustion (in seconds)[/COLOR]
function onUse(cid, item, frompos, topos)
if not(exhaustion.check(cid,exhaustionStorage)) then
doCreatureAddHealth(cid, HPamount)
doCreatureAddMana(cid, MPamount)
doSendMagicEffect(getCreaturePosition(cid),1)
exhaustion.set(cid,exhaustionStorage,time)
doSendAnimatedText(getPlayerPosition(cid), "Gulp.", TEXTCOLOR_TEAL)
return true
else
doPlayerSendCancel(cid, "[COLOR=#FF8C00]Can't drink any more water for now.[/COLOR]")
doSendMagicEffect(getCreaturePosition(cid),2)
end
return false
end
(actions/actions.xml):
Code:
<action itemid="6390" event="script" value="fountain.lua"/>
Paralyzer Bow
┌───────────────────────────────┐
┌───────────────────────────────┐
This bow will, upon being used (right click on it), paralyze your target. It has a configurable amount of time between its usages, you can also play with the values of paralyze to get the right intensity, etc. Pretty nice for boosting paladins' PvP.
(actions/scripts/parabow.lua):
Code:
local condition2 = createConditionObject(CONDITION_PARALYZE)
setConditionParam(condition2, CONDITION_PARAM_TICKS, [COLOR=#00FF00]6500[/COLOR]) --- duration of paralyze
setConditionFormula(condition2, [COLOR=#00FF00]-0.4, 0, -0.7, 0[/COLOR]) --- strength of paralyze
function onUse(cid, item, fromPosition, itemEx, toPosition)
local tPos = getCreaturePosition(getCreatureTarget(cid))
[COLOR=#006400]--- CONFIG ---
local levelReq = [COLOR=#00FF00]50[/COLOR] -- level required to use this effect
local vocID = [COLOR=#00FF00]4[/COLOR] -- ID of vocation that can use this effect
local exhStorage =[COLOR=#00FF00] 5450[/COLOR] -- storage for exhaustion between usages
local exhTime = [COLOR=#00FF00]50[/COLOR] -- time of exhaustion (in seconds)
--- CONFIG ---[/COLOR]
if getPlayerSlotItem(cid, CONST_SLOT_LEFT).itemid == 8858 or getPlayerSlotItem(cid, CONST_SLOT_RIGHT).itemid == 8858 then
if getPlayerLevel(cid) >= levelReq then
if getPlayerVocation(cid) == vocID then
if getCreatureTarget(cid) ~= 0 then
if not(exhaustion.check(cid,exhStorage)) then
exhaustion.set(cid, exhStorage, exhTime)
doSendDistanceShoot(fromPosition, tPos, 34)
doCreatureSay(cid, "Freeze!", 19)
doSendMagicEffect(tPos, 43)
doAddCondition(getCreatureTarget(cid), condition2)
doSendMagicEffect(fromPosition, 14)
else
doPlayerSendCancel(cid, "You need to wait "..exhaustion.get(cid, exhStorage).." seconds before you can use it again.")
end
else
doPlayerSendCancel(cid, "You need a target.")
end
else
doPlayerSendCancel(cid, "Your vocation can not use this item.")
end
else
doPlayerSendCancel(cid, "Your level is too low to use this item.")
end
else
doPlayerSendCancel(cid, "You must equip this item first.")
end
end
(actions/actions.xml):
Code:
<action itemid="8858" event="script" value="parabow.lua"/>