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

Setting BaseSpeed and 2 Questions

ELEM3NT

LUA Status: Beginner
Joined
Mar 12, 2009
Messages
191
Reaction score
0
Location
In your room without you knowing.
How do we make it so it sets someone's basespeed once right clicked lever? Like right click lever, there basespeed stays at 100.. This is what I have, I just need it to change the basespeed to a certain number so everyone can be same speed(only need the function to put it in my script)

Lua Code:
LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition)
        local outfit = { lookType = 21, lookHead = 0, lookAddons = 0, lookLegs = 0, lookBody = 0, lookFeet = 0 }       
         if item.actionid == 6273 then
         
                doSetCreatureOutfit(cid, outfit, 10000*60*1000)
                doSendAnimatedText(getPlayerPosition(cid), "HAM!", 78)
                >doSetBaseSpeed or however you do it here or something<
                doPlayerSendTextMessage(cid,22,"Please here while the event gets started.")
                doTeleportThing(cid, {x=1742, y=2052, z=7})
end
  end

Questions:
1) How do I make it so people can walk through eachother(the tibia function)? Because my event is a maze and I don't people trapping eachother.. There are alot of 1 way paths.

2) How do I make it so people can't use spells in certain areas, like utani hur to speed them up n stuff. Like they've already been exhausted? =O




Thank you!
 
EHLO ELEM3NT here's how i handled speed in my bomberman
1)
Code:
	-- changes walk speed of all players in rooms, set to nil/false to disable
	speedChange = 300
....
	doChangeSpeed(cid, speedChange - getCreatureSpeed(cid))

2) Source edit OR make a new group that has same (custom) flags as normal players, but with custom flag "Can always walkthrough any player", check this out: http://fightingelf.net/customflags/

3) Edit the script, add if isInRange(getThingPos(cid), fromPos, toPos) then return false end before return doCombat(...) ? :p
 
Last edited:
Also I would like to add that on the lever script you could add a condition for exhaust. (to keep players from using spells) if you set the ticks to -1 it will last until logout.
 
@Cyko, thank you so much for the basespeed function ^_^! And for the walk through players, wouldn't I have to make it so like if they pull the lever then the player flags change? Is that possible? o.O And I don't really get it, what do you mean by if isInRange(getThingPos(cid), fromPos, toPos) then return false end before return doCombat(...)? Where do I put that at?

-Thank you,
ELEM3NT
 
And for the walk through players, wouldn't I have to make it so like if they pull the lever then the player flags change? Is that possible?
add in data/XML/groups.xml
Code:
	<group id="7" name="EventPlayer" customFlags="33554432"/>
and add something like this in the lever script:
Code:
doPlayerSetGroupId(cid, 7)
o.O And I don't really get it, what do you mean by if isInRange(getThingPos(cid), fromPos, toPos) then return false end before return doCombat(...)? Where do I put that at?
In your spell scripts. Yea, all :p Or you could try luvindadro's idea.
 
add in data/XML/groups.xml
Code:
	<group id="7" name="EventPlayer" customFlags="33554432"/>
and add something like this in the lever script:
Code:
doPlayerSetGroupId(cid, 7)
I did that and it didn't work, it still don't walk through players...
What I put in groups.xml
LUA:
	<group id="7" name="WalkThroughPlayers" customFlags="33554432"/>

The function in the script, Maze Lever.lua
LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local outfit = { lookType = 21, lookHead = 0, lookAddons = 0, lookLegs = 0, lookBody = 0, lookFeet = 0 }	
	 if item.actionid == 6273 then 
	 
		doSetCreatureOutfit(cid, outfit, 10000*60*1000)
		doSendAnimatedText(getPlayerPosition(cid), "HAM!", 78)
		doChangeSpeed(cid, 350 - getCreatureSpeed(cid))
		doPlayerSetGroupId(cid, 7)
		doPlayerSendTextMessage(cid,22,"Please here while the event gets started.")
		doTeleportThing(cid, {x=1742, y=2052, z=7})
end
  end

In your spell scripts. Yea, all :p Or you could try luvindadro's idea.

I still don't really understand this lol, sorry I'm just a big noob. Do I gotta put this in my spells.xml or where? T_T

PS: People say I start to get weird and annoying when I request things, hopefully this effect isn't starting to get you..:p BUMP

-Thank you,
ELEM3NT.
 
I still don't really understand this lol, sorry I'm just a big noob. Do I gotta put this in my spells.xml or where? T_T

something like this
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_FIREAREA)
setAttackFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 5, 5, 7, 14)

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

function onCastSpell(cid, var)
[B][COLOR="Red"]	if isInRange(getThingPos(cid), {x=100, y=100, z=7}, {x=200, y=200, z=7}) then
		return false
	end[/COLOR][/B]

	return doCombat(cid, combat, var)
end
?
 
Back
Top