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

[Movement Script] Boots +30% and effect on each movement please!

Blood BlvD Ot

Member
Joined
Jun 12, 2010
Messages
243
Reaction score
7
I've got no experience with movement scripts and I was wondering if someone could make me a script so that on equip of a sertain pair of boots.

The character will get +30% movement speed.
Onstep, create effect 2 on creatures position. for every step.

and of course, the de equip canceling it all :D

I would be extremly greature full and would Rep++ my as$ off for u!
 
Code:
local event = {}

local transformOnEquip = 9932
local transformOnDeEquip = 9933

local function effect(cid, itemid, slot, pos)
	if isPlayer(cid) and (pos.x == 0 or getPlayerSlotItem(cid, slot).itemid == itemid) then
		local v = getThingPos(cid)
		if v.x ~= pos.x or v.y ~= pos.y or v.z ~= pos.z then
			doSendMagicEffect(v, CONST_ME_POFF)
		end
		event[cid] = addEvent(effect, 100, cid, itemid, slot, v)
	else
		event[cid] = nil
	end
end

function onEquip(cid, item, slot)
	doTransformItem(item.uid, transformOnEquip)
	effect(cid, transformOnEquip, slot, {x=0, y=0, z=0})
	doChangeSpeed(cid, 50)
	return true
end

function onDeEquip(cid, item, slot)
	doChangeSpeed(cid, -50)
	doTransformItem(item.uid, transformOnDeEquip)
	return true
end
 
.

it works properly for me :p

did u change
Code:
local transformOnEquip = 9932
local transformOnDeEquip = 9933
?

No, i used the script exactly as you would have used to to make sure it was a fully working script.
Maybe i just messed up the movements.xml part of it.
What did you put into yours? ^_^
 
Code:
local event = {}

local function effect(cid, itemid, slot, pos)
	if isPlayer(cid) and (pos.x == 0 or getPlayerSlotItem(cid, slot).itemid == itemid) then
		local v = getThingPos(cid)
		if v.x ~= pos.x or v.y ~= pos.y or v.z ~= pos.z then
			doSendMagicEffect(v, CONST_ME_POFF)
		end
		event[cid] = addEvent(effect, 100, cid, itemid, slot, v)
	else
		event[cid] = nil
	end
end

function onEquip(cid, item, slot)
	effect(cid, item.itemid, slot, {x=0, y=0, z=0})
	doChangeSpeed(cid, getCreatureBaseSpeed * 0.3)
	return true
end

function onDeEquip(cid, item, slot)
	doChangeSpeed(cid, -(getCreatureBaseSpeed * 0.3))
	return true
end
 
Code:
local event = {}

local function effect(cid, itemid, slot, pos)
	if isPlayer(cid) and (pos.x == 0 or getPlayerSlotItem(cid, slot).itemid == itemid) then
		local v = getThingPos(cid)
		if v.x ~= pos.x or v.y ~= pos.y or v.z ~= pos.z then
			doSendMagicEffect(v, CONST_ME_POFF)
		end
		event[cid] = addEvent(effect, 100, cid, itemid, slot, v)
	else
		event[cid] = nil
	end
end

function onEquip(cid, item, slot)
	effect(cid, item.itemid, slot, {x=0, y=0, z=0})
	doChangeSpeed(cid, getCreatureBaseSpeed * 0.3)
	return true
end

function onDeEquip(cid, item, slot)
	doChangeSpeed(cid, -(getCreatureBaseSpeed * 0.3))
	return true
end

Hmm, is this right?
Movements Entry :

Code:
	<movevent event="Equip" itemid="11113" slot="feet" function="script" script="cloudwalker.lua" />
	<movevent event="DeEquip" itemid="11113" slot="feet" function="script" script="cloudwalker.lua" />
 
Code:
[02/08/2010 02:43:20] [Warning - Event::loadScript] Event onDeEquip not found (data/movements/scripts/cloudwalker.lua)

[02/08/2010 02:44:46] [Error - MoveEvents Interface] 
[02/08/2010 02:44:47] data/movements/scripts/cloudwalker.lua:onEquip
[02/08/2010 02:44:47] Description: 
[02/08/2010 02:44:47] data/movements/scripts/cloudwalker.lua:17: attempt to perform arithmetic on global 'getCreatureBaseSpeed' (a function value)
[02/08/2010 02:44:47] stack traceback:
[02/08/2010 02:44:48] 	data/movements/scripts/cloudwalker.lua:17: in function <data/movements/scripts/cloudwalker.lua:15>
 
ok, it's Basespeed
Code:
local event = {}

local function effect(cid, itemid, slot, pos)
	if isPlayer(cid) and (pos.x == 0 or getPlayerSlotItem(cid, slot).itemid == itemid) then
		local v = getThingPos(cid)
		if v.x ~= pos.x or v.y ~= pos.y or v.z ~= pos.z then
			doSendMagicEffect(v, CONST_ME_POFF)
		end
		event[cid] = addEvent(effect, 100, cid, itemid, slot, v)
	else
		event[cid] = nil
	end
end

function onEquip(cid, item, slot)
	effect(cid, item.itemid, slot, {x=0, y=0, z=0})
	doChangeSpeed(cid, getCreatureBasespeed * 0.3)
	return true
end

function onDeEquip(cid, item, slot)
	doChangeSpeed(cid, -(getCreatureBasespeed * 0.3))
	return true
end
 
Back
Top