• 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!

Super UH delays spells and can't be used in Protection Zone!

L

LordVissie

Guest
Hey guys, I got the 2 problems with my script as the title says.

here is the script:

Code:
local combat = createCombatObject()
pzprotected = true,
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_HEALING)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, 1)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0)
setCombatParam(combat, COMBAT_PARAM_DISPEL, CONDITION_PARALYZE)
function onGetFormulaValues(cid, level, maglevel)
min = (level * 2.9 + maglevel * 1)
max = (level * 4.2 + maglevel * 1)
return min, max
end

setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")

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

Hope someone can help me.

Kr,
LordVissie

btw. I use cryingdamson 0.3.6 (8.60) V8.2.
 
change this
Code:
pzprotected = true
to this
Code:
pzprotected = false

if pzprotected does anything at all, then it is a global variable where your server specifically looks for this value to limit the use of potions and runes in pz zones.
 
change this
Code:
pzprotected = true
to this
Code:
pzprotected = false

if pzprotected does anything at all, then it is a global variable where your server specifically looks for this value to limit the use of potions and runes in pz zones.

I changed it but doesn't work and I've no idea what you said on the last sentence I'm quite new into making ots :confused:
Still thanks for helping, do you have another solution? btw. I added the pzprotected line myself to test if it worked.

~Edit~ I added a Mana Rune script before and I can use that one in PZ.
 
oh, well then what does the server say to you when you use the rune or spell in a pz zone?
I'm sure there is some kind of message you get.
 
I checked the sources and it says when this is executed
This action is not permitted in a protection zone.
The spell is aggressive

Just to be 100% sure, try this.
Code:
    local aggressive = false -- set it to true if you don't want this spell to be used in a protection zone
 
    local combat = createCombatObject()
    setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_HEALING)
    setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
    setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, 1)
    setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, aggressive)
    setCombatParam(combat, COMBAT_PARAM_DISPEL, CONDITION_PARALYZE)
 
    function onGetFormulaValues(cid, level, maglevel)
        min = (level * 2.9 + maglevel * 1)
        max = (level * 4.2 + maglevel * 1)
        return min, max
    end

    setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")

    function onCastSpell(cid, var)
        return doCombat(cid, combat, var)
    end
 
I checked the sources and it says when this is executed

The spell is aggressive

Just to be 100% sure, try this.
Code:
    local aggressive = false -- set it to true if you don't want this spell to be used in a protection zone

    local combat = createCombatObject()
    setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_HEALING)
    setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
    setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, 1)
    setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, aggressive)
    setCombatParam(combat, COMBAT_PARAM_DISPEL, CONDITION_PARALYZE)

    function onGetFormulaValues(cid, level, maglevel)
        min = (level * 2.9 + maglevel * 1)
        max = (level * 4.2 + maglevel * 1)
        return min, max
    end

    setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")

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

I used your script but still doesn't work still the same Error. I also tried it on "local aggressive = true" but also doesn't work. Really weird. I use Spell rune id: 2275 but does that matter? Still Thanks for the effort you put in to help me :)

Someone know a solution?
 
Last edited by a moderator:
comment out this, like this and re-load spells
Code:
-- setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, aggressive)
When in doubt.. comment it out :)
 
There may be a chance that the item ID of the rune your using doesn't have the correct item attributes in your items.xml file. Check your items.xml (just CTRL+F to search for "2275") and make sure it has the item attributes of the other runes around it. Most runes have item attributes like

<attribute key="type" value="rune" />
<attribute key="runeSpellName" value="adori mas frigo" />
<attribute key="weight" value="52" />
<attribute key="charges" value="4" />
 
There may be a chance that the item ID of the rune your using doesn't have the correct item attributes in your items.xml file. Check your items.xml (just CTRL+F to search for "2275") and make sure it has the item attributes of the other runes around it. Most runes have item attributes like

<attribute key="type" value="rune" />
<attribute key="runeSpellName" value="adori mas frigo" />
<attribute key="weight" value="52" />
<attribute key="charges" value="4" />

</item>
<item fromid="2275" toid="2276" article="a" name="Super UH">
<attribute key="weight" value="120" />

But this is for every "Spell Rune".

And when I remove
-- setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, aggressive) or set 2 -- before the line it says still the same nothing changed.
 
</item>
<item fromid="2275" toid="2276" article="a" name="Super UH">
<attribute key="weight" value="120" />

I'm not too sure of any changes that may have been made in how items.xml is read by the server since the last time I messed around with this type of stuff was in an 8.6 distro of TFS 0.3/0.4 of different revs.

Though I do think that you need to have the rune be "itemid="2275"" and can't have a rune have two item ids for one script that only affects one itemid. Also, the item (being the rune) needs to have an attribute that deems it as a "rune" in items.xml rather than just an item.

EDIT

"But this is for every "Spell Rune"."
If you mean that the "spell runes" that aren't used in the server all don't have rune attributes, most likely the runes that the server actually does use do have item attributes making it a rune.
 
Back
Top