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

Create a custom magic wall rune that can only be used in an area

Araxicious

New Member
Joined
Sep 22, 2019
Messages
14
Reaction score
1
Hello, folks!

I've been currently looking, if someone could create a Bridge Uer Mwall. You may wonder, what that is, it is:
- When you take this rune and use it, it should spawn 3 mwalls at the same time and it can only be used on a certain location and can only be used on a certain place.

Information regarding my server:
- 0.4 TFS,
... if you require more information, feel free to ask me down below!
 
Solution
Try this one should work, local t is the players standing positions.
pos2 is where the magic wall will appear.
Lua:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGY)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, FALSE)
setCombatParam(combat, COMBAT_PARAM_CREATEITEM, 1497)


local arr = {
{ 0, 0, 0},
{ 1, 3, 1},
{ 0, 0, 0},
}

local area = createCombatArea(arr)
setCombatArea(combat, area)

local t = {
    {{x=32365, y=32212, z=7}, {x=32365, y=32213, z=7}},
    {{x=32365, y=32214, z=7}, {x=32365, y=32215, z=7}},
    {{x=32365, y=32211, z=7}, {x=32364, y=32211, z=7}}
}

function onCastSpell(cid, var)
    local pos = getThingPos(cid)
    local pos2 = {x=32360, y=32213, z=7}...
Runes can be created in data/spells/ folder.
You place the Lua file in data/spells/scripts, then register it in data/spells/spells.xml.
 
What is a Bridge Uer Mwall?

An ultimate explotion that creates lots of bridge tiles filled with magic walls? xD
 
It is a rune, which creates three walls at the same time, and it can only be used in a certain position and can only be thrown in a certain place.
 
So a rune that can only be used at position x,y,z and when used creates 3 magic walls at different x,y,z positions.

What have you tried to code thus far? Its a bit hard to support you without seeing your code.
 
So a rune that can only be used at position x,y,z and when used creates 3 magic walls at different x,y,z positions.

Well, you were correct in the beginning - The rune can only be used at position x,y,z and only thrown at position x,y,z.

Here you have a more understandable screenshot:

Screenshot_482.png

FROM - TO is where you can only use the rune no other locations and the rune can only be thrown at the stones (it was a example, of course).
 
Thread moved from Support to Requests.

And when you use the rune on one of the stones (when you are between "from" and "to" location), what should happen? Should magic walls appear on the stones? Or block the bridge?
 
@Znote he tries to say that when he stands on the bridge you should be able to use rune otherwise you should not be able to use it.
And you can only use the rune where the stone is so instead of 1 magic wall to be done as usual, the rune should shoot 3 magic wall at the same time.

If you will make it for him please don't do it for TFS 0.4. Do it for TFS 1.3 so people can move forward and stop use 0.4.
 
@Znote he tries to say that when he stands on the bridge you should be able to use rune otherwise you should not be able to use it.
And you can only use the rune where the stone is so instead of 1 magic wall to be done as usual, the rune should shoot 3 magic wall at the same time.

If you will make it for him please don't do it for TFS 0.4. Do it for TFS 1.3 so people can move forward and stop use 0.4.
If OP is using 0.4, why would we waste our time scripting it for 1.3?
 
Try this one
Lua:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGY)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, FALSE)
setCombatParam(combat, COMBAT_PARAM_CREATEITEM, 1497)


local arr = {
{ 0, 0, 0},
{ 1, 3, 1},
{ 0, 0, 0},
}

local area = createCombatArea(arr)
setCombatArea(combat, area)

local t = {
    {{x=32365, y=32212, z=7}, {x=32365, y=32213, z=7}},
    {{x=32365, y=32214, z=7}, {x=32365, y=32215, z=7}},
    {{x=32365, y=32211, z=7}, {x=32364, y=32211, z=7}}
}

function onCastSpell(cid, var)
    local pos = getThingPos(cid)
    for i = 1, #t do
        if isInRange(pos, unpack(t[i])) and getTileThingByPos({x=32365, y=32212, z=7, stackpos=0}).itemid == 9144 then
    return
    doCombat(cid, combat, var)
end
end
end
 
@M0ustafa

Thank you for the script, however, it doesn't seem to be working properly as it should be doing.

---

I'll try to make this more clear, if you are staying between the positions (FROM - TO), you should be able to throw a 'Bridge Uer Mwall' at those stones, only at the stones position, no where else.

Screenshot_482.png
 
I guess its better to solve things here so you guys can post the solution here and maybe it will help someone in the future.
Also you can do it with an action script.
 
Try this one should work, local t is the players standing positions.
pos2 is where the magic wall will appear.
Lua:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGY)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, FALSE)
setCombatParam(combat, COMBAT_PARAM_CREATEITEM, 1497)


local arr = {
{ 0, 0, 0},
{ 1, 3, 1},
{ 0, 0, 0},
}

local area = createCombatArea(arr)
setCombatArea(combat, area)

local t = {
    {{x=32365, y=32212, z=7}, {x=32365, y=32213, z=7}},
    {{x=32365, y=32214, z=7}, {x=32365, y=32215, z=7}},
    {{x=32365, y=32211, z=7}, {x=32364, y=32211, z=7}}
}

function onCastSpell(cid, var)
    local pos = getThingPos(cid)
    local pos2 = {x=32360, y=32213, z=7}
    for i = 1, #t do
        if isInRange(pos, unpack(t[i])) and isCreature(cid) then
    return
    doCombat(cid, combat, positionToVariant(pos2))
end
end
end
 
Solution
Back
Top