• Vote in November Mapping Competition to select a winner!
  • 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!

TFS 0.X boost spell hp/mp/storage

samandriel

Active Member
Joined
Oct 19, 2016
Messages
195
Reaction score
44
How to create a boost spell (like utito tempo) who sets temporally player hp to 50%, mp to 50% but set a storage for this time?

Like utito tempo
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false)

local condition = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(condition, CONDITION_PARAM_TICKS, 10000)
setConditionParam(condition, CONDITION_PARAM_SKILL_MELEEPERCENT, 135)
setConditionParam(condition, CONDITION_PARAM_SKILL_SHIELDPERCENT, -100)
setConditionParam(condition, CONDITION_PARAM_BUFF, true)
setCombatCondition(combat, condition)

function onCastSpell(cid, var)
return doCombat(cid, combat, var)
end
 
Solution
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false)

local condition = createConditionObject(CONDITION_ATTRIBUTES)...

Ralumbi

apt install nubmod
Content Editor
Premium User
Joined
Jun 8, 2011
Messages
180
Solutions
6
Reaction score
65
Location
Netherlands
GitHub
Ralumbi
How to create a boost spell (like utito tempo) who sets temporally player hp to 50%, mp to 50% but set a storage for this time?

Like utito tempo
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false)

local condition = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(condition, CONDITION_PARAM_TICKS, 10000)
setConditionParam(condition, CONDITION_PARAM_SKILL_MELEEPERCENT, 135)
setConditionParam(condition, CONDITION_PARAM_SKILL_SHIELDPERCENT, -100)
setConditionParam(condition, CONDITION_PARAM_BUFF, true)
setCombatCondition(combat, condition)

function onCastSpell(cid, var)
return doCombat(cid, combat, var)
end

Since you're asking this in the support section I will lead you into the right direction, if you're not asking support but requesting the script please checkout: Requests (https://otland.net/forums/requests.132)

You should take a look at the Health potion and Mana potion scripts and check how they are built.
Now for the percentage you should need to find out the max health and mana. This might need a source edit. By looking at the code I found here: Jak wysyłać HP i manę w procentach (https://otland.net/threads/jak-wysylac-hp-i-mane-w-procentach.181560/) and not looking at the polish language it should give you a great headstart.

I hope this was the answer you were looking for :)
 
OP
samandriel

samandriel

Active Member
Joined
Oct 19, 2016
Messages
195
Reaction score
44
there is a setCreatureMaxHealth(cid, health) and setCreatureMaxMana(cid, mana)

i could get take the % by getCreatureMaxHealth(cid) and getCreatureMana(cid)

i would like a way to make it, but if anyone send a script would be amazing too

my main problem isn't deal with max health, its set it temporally as a buff
 

Ralumbi

apt install nubmod
Content Editor
Premium User
Joined
Jun 8, 2011
Messages
180
Solutions
6
Reaction score
65
Location
Netherlands
GitHub
Ralumbi
there is a setCreatureMaxHealth(cid, health) and setCreatureMaxMana(cid, mana)

i could get take the % by getCreatureMaxHealth(cid) and getCreatureMana(cid)

i would like a way to make it, but if anyone send a script would be amazing too

my main problem isn't deal with max health, its set it temporally as a buff
That's great!

Now all you will have to checkout is how "Utani hur" and Utani gran hur" are made :) Those are temporally spells.
 
OP
samandriel

samandriel

Active Member
Joined
Oct 19, 2016
Messages
195
Reaction score
44
That's great!

Now all you will have to checkout is how "Utani hur" and Utani gran hur" are made :) Those are temporally spells.

I don't get
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_GREEN)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false)

local condition = createConditionObject(CONDITION_HASTE)
setConditionParam(condition, CONDITION_PARAM_TICKS, 33000)
setConditionFormula(condition, 0.3, -24, 0.3, -24)
setCombatCondition(combat, condition)

function onCastSpell(cid, var)
    return doCombat(cid, combat, var)
end

There is a way to put that thing in like gran hur?
 
OP
samandriel

samandriel

Active Member
Joined
Oct 19, 2016
Messages
195
Reaction score
44
setConditionParam(condition, CONDITION_PARAM_STAT_MAXHEALTHPERCENT, 50)

setConditionParam(condition, CONDITION_PARAM_STAT_MAXMANAPERCENT, 150)

Did u know how to setandadd HP

I tried this, but not work
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false)

local condition = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(condition, CONDITION_PARAM_TICKS, 10000)

setConditionParam(condition, CONDITION_PARAM_SKILL_MELEEPERCENT, 50)
setConditionParam(condition, CONDITION_PARAM_SKILL_SHIELDPERCENT, 25)
setConditionParam(condition, CONDITION_PARAM_STAT_MAXMANAPERCENT, 50)

local addHpPercent = 50
function setMaxHPAddHP(cid)
    print(maxHP)
    local maxHP = getCreatureMaxHealth(cid)
    local addHpValue = maxHP / 100 / addHpPercent
    doCreatureAddHealth(cid, addHpValue)
end
setConditionParam(condition, CONDITION_PARAM_STAT_MAXHEALTHPERCENT, 100+addHpPercent)
setCombatCallback(combat, 0, "setMaxHPAddHP")

setConditionParam(condition, CONDITION_PARAM_BUFF, true)
setCombatCondition(combat, condition)

function onCastSpell(cid, var)
    doCombat(cid, combat, var)
    return true
end
 

Perwers

NNStory Dev.
Joined
Jul 6, 2016
Messages
48
Solutions
7
Reaction score
23
Location
Poland
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false)

local condition = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(condition, CONDITION_PARAM_TICKS, 10000)
setConditionParam(condition, CONDITION_PARAM_SKILL_MELEEPERCENT, 50)
setConditionParam(condition, CONDITION_PARAM_SKILL_SHIELDPERCENT, 25)
setConditionParam(condition, CONDITION_PARAM_STAT_MAXMANAPERCENT, 50)
setConditionParam(condition, CONDITION_PARAM_STAT_MAXHEALTHPERCENT, 150)
setConditionParam(condition, CONDITION_PARAM_BUFF, true)
setCombatCondition(combat, condition)

function onCastSpell(cid, var)
    doCombat(cid, combat, var)
    doCreatureAddHealth(cid, getCreatureMaxHealth(cid)*0.5, false)
    doCreatureAddMana(cid, 1, false)
    return true
end
??
 
Solution
OP
samandriel

samandriel

Active Member
Joined
Oct 19, 2016
Messages
195
Reaction score
44
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false)

local condition = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(condition, CONDITION_PARAM_TICKS, 10000)
setConditionParam(condition, CONDITION_PARAM_SKILL_MELEEPERCENT, 50)
setConditionParam(condition, CONDITION_PARAM_SKILL_SHIELDPERCENT, 25)
setConditionParam(condition, CONDITION_PARAM_STAT_MAXMANAPERCENT, 50)
setConditionParam(condition, CONDITION_PARAM_STAT_MAXHEALTHPERCENT, 150)
setConditionParam(condition, CONDITION_PARAM_BUFF, true)
setCombatCondition(combat, condition)

function onCastSpell(cid, var)
    doCombat(cid, combat, var)
    doCreatureAddHealth(cid, getCreatureMaxHealth(cid)*0.5, false)
    doCreatureAddMana(cid, 1, false)
    return true
end
??

It works!!!!!

Thank you!
 
Top