• 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 1.0 Armors Boots with magic effects.

CesarZ

Well-Known Member
Joined
Sep 20, 2012
Messages
268
Solutions
4
Reaction score
63
Im trying to put magic effects on some of my items. Like fire boots to have an "(interval) Every 4 second" effect on players like fire so people can see they are wearing that specific item. ect. is that can be Done without touching my CPP files. or do i have to dig in there?
 
Solution
Inside your data\globalevents\scripts create Lua script file and name it ITEMEffect.luaand add this to it
Lua:
function onThink(interval)
    for _, cid in ipairs(getPlayersOnline()) do
            if getPlayerSlotItem(cid, CONST_SLOT_FEET).itemid == YOURBOOTSID then
                doSendMagicEffect(getCreaturePosition(cid), CONST_ME_FIREDAMAGE)
            end
    end
    return true
end
Change YOURBOOTSIDto your weapon ID number.
and in data\globalevents\globalevents.xml add this
XML:
<globalevent name="WeaponEffect" interval="10000" script="ITEMEffect.lua"/>
interval="10000" is time in MS
You can add different items by changing slots like in here...
Inside your data\globalevents\scripts create Lua script file and name it ITEMEffect.luaand add this to it
Lua:
function onThink(interval)
    for _, cid in ipairs(getPlayersOnline()) do
            if getPlayerSlotItem(cid, CONST_SLOT_FEET).itemid == YOURBOOTSID then
                doSendMagicEffect(getCreaturePosition(cid), CONST_ME_FIREDAMAGE)
            end
    end
    return true
end
Change YOURBOOTSIDto your weapon ID number.
and in data\globalevents\globalevents.xml add this
XML:
<globalevent name="WeaponEffect" interval="10000" script="ITEMEffect.lua"/>
interval="10000" is time in MS
You can add different items by changing slots like in here
 
Solution
Back
Top