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

[SOLVED] Ice Field (LUA)

Exoltes

Novia OTserv Developer
Joined
Jul 2, 2009
Messages
563
Reaction score
47
Location
Belgium
I'm working on a 8.54 Open Tibia Server using The Forgotten Server - Version 0.2.7 (Mystic Spirit).

I want to balance out my vocations and my elements and there for a I need to create an ice field. Since the item.xml file does not recognize any other fields then fire, poison, drown and energy. I will be needing a movement script for this field.

I already gave it a try but I ain't great at making scripts myself.

This is what I got already:
Code:
local condition = createConditionObject(CONDITION_FREEZING)
setConditionParam(condition, CONDITION_PARAM_PERIODICDAMAGE, -10)
setConditionParam(condition, CONDITION_PARAM_TICKS, 7)
setConditionParam(condition, CONDITION_PARAM_DURATION, 200)
setConditionParam(condition, CONDITION_PARAM_TICKINTERVAL, 2000)

function onStepIn(cid, item, pos)
if isPlayer(cid) == TRUE then
doAddCondition(cid, condition)
end
end

My final idea is just to make this field exactly as the fire fields first stage with the only difference being ice dmg instead of fire.


So if anyone, with the right knowledge, finds some spare time to fix this. Then I would be very grateful.

Thanks in advance.
 
I'm sorry, I would help you but I'm plenty busy right now.
But I can tell you this, change "conation" to like "ice_field_condition" so you don't happen end up having the script reading something else that's too named "condition".

making a unique name for functions and stuffs is No:1 to make sure you don't create bugs and issue while you're coding.
And you could do like you said, fire field, find a script for it, replace all fire-damage and stuffs with ice-similar codes that you could find in global.lua by search for the fire damage condition..

Hope you understand me :)
 
Your No1 is quite great thanks, I'll keep it in mind while scripting.

And I did try and find a script for a fire field but they don't seem to exist since they are implanted into the servers from the start orso.
 
Your No1 is quite great thanks, I'll keep it in mind while scripting.

And I did try and find a script for a fire field but they don't seem to exist since they are implanted into the servers from the start orso.
see if you can find anything similar, with poison or anything really..
There's a trap similar plant used in Port Hope, that one cause posion damage and the script may be similar depending on what version and how the damage works.

Some servers prefer 1 hit only from it, while others want 1 hit + poison condition afterwards :p
 
1.
Code:
setConditionParam(condition, CONDITION_PARAM_DURATION, 200)
Duration 0.2 sec?

2.
Without return true scripts wont work!
 
Changed it.
Code:
local condition = createConditionObject(CONDITION_FREEZING)
setConditionParam(condition, CONDITION_PARAM_PERIODICDAMAGE, -10)
setConditionParam(condition, CONDITION_PARAM_TICKS, 7)
setConditionParam(condition, CONDITION_PARAM_DURATION, 20000000)
setConditionParam(condition, CONDITION_PARAM_TICKINTERVAL, 2000)


function onStepIn(cid, item, pos)
    if isPlayer(cid) == TRUE then
        doAddCondition(cid, condition)
    end
return true
end

Still only getting 1 time dmg and the freezing icon for just a sec.
 
Changed it.
Code:
local condition = createConditionObject(CONDITION_FREEZING)
setConditionParam(condition, CONDITION_PARAM_PERIODICDAMAGE, -10)
setConditionParam(condition, CONDITION_PARAM_TICKS, 7)
setConditionParam(condition, CONDITION_PARAM_DURATION, 20000000)
setConditionParam(condition, CONDITION_PARAM_TICKINTERVAL, 2000)


function onStepIn(cid, item, pos)
    if isPlayer(cid) == TRUE then
        doAddCondition(cid, condition)
    end
return true
end

Still only getting 1 time dmg and the freezing icon for just a sec.
Change 7 to 7000
 
Back
Top