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

Simple Trap System

What if I need this for TFS 0.2? ;)
Would be perfect for my Human Hunter Class in Race Wars.

Kind Regards,
Eldin.
 
It should work just fine, I don't think I'm using any 0.3/0.4 specific functions or events, so the only possible bugs are stuff like different method names and such, which should easily be fixed :)

The library itself is pretty simple because the idea itself is simple and easy to do, the traps however can be as complicated as you want :)
 
Great, will then use it for sure! You just made my Hunter Class more unique (if it works).
And thank you for the fast answer. ;)

Kind Regards,
Eldin.
 
If it doesn't work or if you need some sort of help in doing the traps, feel free to reply or PM me(if you don't want the ideas to be public)
 
Just saying that it's not working won't help..
Did you added everything correctly? are any bugs showing? what happens when you try to place a trap?
 
Code:
    [1] = function(cid, pos) --Fire Trap
                        doCombatAreaHealth(cid, COMBAT_FIREDAMAGE, pos, nil, 100, 200, CONST_ME_FIREAREA)
                        return true
                    end,
        [2] = function(cid, pos) --Energy Trap
                        doCombatAreaHealth(cid, COMBAT_ENERGYDAMAGE, pos, nil, 100, 200, CONST_ME_ENERGYHIT)
                        return true
                    end,
        [3] = function(cid, pos) --Ice Trap
                        doCombatAreaHealth(cid, COMBAT_ICEDAMAGE, pos, nil, 100, 200, CONST_ME_ICEATTACK)
                        return true
                    end,
        [4] = function(cid, pos) --Earth Trap
                        doCombatAreaHealth(cid, COMBAT_EARTHDAMAGE, pos, nil, 100, 200, CONST_ME_CARNIPHILA)

i think you need to change that to negative damage number values or else it wont do damage... i can be wrong tho i am rlly noob at this

tested and yup, if you think it is not working try changing those, it worked for me.

- - - Updated - - -

Btw: i would love some traps ideas i was trying to add conditions and stuff but i dont manage to get the target u.u i am doing something like this

local targt1 = getThingFromPos(pos)
doCreatureSetNoMove(targt1, cannotMove)

or

local targt1 = getThingFromPos(pos)
doAddCondition(cid, mycondition)

and in both cases it says it canot find the creature :/ , also whit dotargetcombathealth() some help whit ideas or examples would be nice, this spell has a lot of potential, at least i think it has... i would like to make something creative like slow, para multi condition, or countdown explosion in big AOE, something like that, i can try doing stuff but not whidout the hability to define my target u.u, do i have to add "target" param on the function?
 
minor problem that I probably overlooked xD

the cid in the trap functions is the player that originally placed them, pos is the position the trap is
wouldn't you need to add a stackpos to be able to get the player? like:
Lua:
function newTrap(cid, pos)  //Using the example you said
    pos.stackpos = 253
    local targt1 = getThingFromPos(pos)
    doCreatureSetNoMove(targt1, cannotMove)
end

Glad that you think this has lots of potential :D
 
Awwwwwwsome! i hope it is working, going to try in a sec n.n and yeah, just think about it for a couple seconds... anyone whit a lil bit of grey matter will realize this spell combined whit a bit of creativity is serious bussines GL & HF!

- - - Updated - - -
Lua:
[7] = function(cid, pos) --Custom1
			pos.stackpos = 253
			local creature = getTopCreature(pos).uid
			local lvl, skill = getPlayerLevel(cid), getPlayerSkillLevel(cid, sword)
			local minTD, maxTD = (((lvl + skill) * 2) + 20 + (20 / lvl)), (((lvl + skill) * 2) + 30 + (40 / lvl))
			if lvl >= 10 and lvl <= 14 then
                                doCreatureSetNoMove(creature, true)
				addEvent(moveAgain, 3000)
			elseif lvl >= 15 and lvl <= 19 then
                                doCreatureSetNoMove(creature, true)
				addEvent(moveAgain, 3000)
			elseif lvl == 20 then
                                doCreatureSetNoMove(creature, true)
				addEvent(moveAgain, 3000)
			end
			doCombatAreaHealth(cid, COMBAT_POISONDAMAGE, pos, nil, -minTD, -maxTD, CONST_ME_HITBYPOISON)
			return true
                    end,





------------- now add a function at the end of the lib--------------
function moveAgain (cid)
	if isCreature(creature) then
		doCreatureSetNoMove(creature, false)
		return true
	else 
		return false
	end
end
this trap will make damage based on sword skill lvl and damage and inmovilize the creature for 3 seconds, you can change the amount of time depending on your lvl pretty easly so you can make stages, like lvl 20 = 2 secs slow lvl 40 = 4 etc etc, first thing that came to mind... just to show 1 more example.

Btw how to make bigger areas? tried and failed horribly... tried whit:
doCombatAreaHealth(cid, COMBAT_FIREDAMAGE, pos, (AREA_SQUARE1X1), -100, -200, CONST_ME_FIREAREA)

no luck at all...
 
Last edited:
edited ur post to use lua tags and use correct indentation

exactly, this system is very versatile, you can do amazing things with it, you just have to use your imagination :)
 
Back
Top