• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

[Fixed] [Spell] Spell that changes outift to itemid. TFS 1.0

Moj mistrz

Monster Creator
Joined
Feb 1, 2008
Messages
932
Solutions
10
Reaction score
308
Location
Poland
Hiho, can anyone make a spell which after execution will change outfit into itemid and hide health bar(if possible?)?
Thanks anyways.
 
in the onCast function in the spell simply use:
doCreatureSetHideHealth(cid, true/false)
and
doSetItemOutfit(cid, itemid, time)

not sure if these functions exist on 1.0, sorry if they do not! I am sure there are alternative functions in place of these if they do not exist though...
 
in the onCast function in the spell simply use:
doCreatureSetHideHealth(cid, true/false)
and
doSetItemOutfit(cid, itemid, time)

not sure if these functions exist on 1.0, sorry if they do not! I am sure there are alternative functions in place of these if they do not exist though...
doSetItemOutfit(cid, itemid, time) works fine, but doCreatureSetHideHealth(cid, true/false) do not exist i guess. I couldn't find any alternatives though.
 
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_NONE)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0)

function onCastSpell(cid, var)
local hp = (getCreatureHealth(cid)/getCreatureMaxHealth(cid))*100
local creature = Creature(cid)
local fields = {1490, 1496, 1500}
if (hp < 99.99) and getCreatureName(cid) == "Zavarash" then
doSetItemOutfit(cid, 1548, 15*60*1000)
creature:setHiddenHealth(not creature:isHealthHidden())
elseif isInArray({1490, 1496, 1500}, getTileItemById(getCreaturePosition(cid))) then
doSetCreatureOutfit(cid, {lookType=12,lookHead=0,lookAddons=0,lookLegs=57,lookBody=15,lookFeet=85}, -1)
    return doCombat(cid, combat, var)
    end
end
This script works, but the creature is showing up for 1 sec and goes invisible again, and it repeats for several seconds. + It don't show up permanently when poison field is under it, could someone repair it please? Thanks for any help guys.
 
Back
Top