• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

[Spell] Help

tobias89

Pikaz Liek Pikaz
Joined
Apr 24, 2010
Messages
110
Reaction score
0
Can somebody help me out ?

Cant get it to work.

PHP:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_HEALING)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false)
setCombatParam(combat, COMBAT_PARAM_DISPEL, CONDITION_PARALYZE)
setHealingFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 5, 5, 18.5, 25) 

function onCastSpell(cid, var)
addEvent(setCreatureMaxHealth, 3 * 1000, cid, getCreatureMaxHealth(cid) 
		
return doCombat(cid, combat, var)
end
 
When the caster says the spell, his HP will gain 1000 HP for 3min.
the error I get is:

PHP:
[18/07/2010 19:03:20] [Error - LuaScriptInterface::loadFile] data/spells/scripts/stoned.lua:9: ')' expected (to close '(' at line 7) near 'function'
[18/07/2010 19:03:20] [Warning - Event::loadScript] Cannot load script (data/spells/scripts/stoned.lua)
[18/07/2010 19:03:20] data/spells/scripts/stoned.lua:9: ')' expected (to close '(' at line 7) near 'function'
 
actually there is a miss bracket at the end of the add event line
.
what you men in 3 min he get 1000 hp like every sec?
or after 3 min he gets 1000hp
 
you know that spell how it is will make that extra hp permanent, right?
 
o rly?
have you tested it? because i only see an event to raise hp but not turning it back to normal
or it recovers the player's hp <.<
 
i guess he meant this
Lua:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_HEALING)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false)
setCombatParam(combat, COMBAT_PARAM_DISPEL, CONDITION_PARALYZE)
setHealingFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 5, 5, 18.5, 25) 

function onCastSpell(cid, var)
    setCreatureMaxHealth(cid, getCreatureMaxHealth(cid)+1000)
    addEvent(setCreatureMaxHealth, 3 * 1000, cid, getCreatureMaxHealth(cid)-1000)
    return doCombat(cid, combat, var)
end
prob is if player logs out or crashes, would be permanent unless if creaturescripts are used
 
improved, you won't want you rplayers getting a lot of hp
Lua:
local storage, time = 1745, 3 * 1000

local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_HEALING)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false)
setCombatParam(combat, COMBAT_PARAM_DISPEL, CONDITION_PARALYZE)
setHealingFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 5, 5, 18.5, 25) 

function onCastSpell(cid, var)
    if getCreatureStorage(cid, storage) == 1 then
        doPlayerSendCancel(cid, 'Your extra HP has not worn out yet.')
        doSendMagicEffect(getThingPos(cid), 2) 
        return false
    end
    doCreatureSetStorage(cid, storage, 1)
    setCreatureMaxHealth(cid, getCreatureMaxHealth(cid)+1000)
    addEvent(setCreatureMaxHealth, time, cid, getCreatureMaxHealth(cid)-1000)
    addEvent(doCreatureSetStorage, time, cid, storage, 0)
    return doCombat(cid, combat, var)
end
 
PHP:
[18/07/2010 22:53:07] [Error - LuaScriptInterface::loadFile] data/spells/scripts/stoned.lua:20: 'end' expected (to close 'function' at line 10) near '<eof>'
[18/07/2010 22:53:07] [Warning - Event::loadScript] Cannot load script (data/spells/scripts/stoned.lua)
[18/07/2010 22:53:07] data/spells/scripts/stoned.lua:20: 'end' expected (to close 'function' at line 10) near '<eof>'
 
This is what I need:

A spell that gives you 1000 HP more then your corrent HP. (Lets say I got 500.. that means when I take the spell it will give me 1500 HP for 3 min.
This also means that If I loose HP while I used the spell. I can heal up to 1500, intil the spell goes out.
 
dude the 3*1000 is 3 seconds so maybe when you get hit the spell time is ended
and when you heal it gets your original max again.
 
Back
Top