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

Lua Script Question

TibiaGameHost

Hello!
Joined
Feb 25, 2009
Messages
255
Reaction score
0
Location
Canadá
This is script is possible crash my server? lock accounts login? in ubuntu

Code:
local weaponpar = {2377, 2378, 2379, 2380} -- id dos items que darão paralize
local chancepar = 5 -- chance de ocorrer o paralize (10 = 10%, 20 = 20%, 30 = 30%, 1 = 1%, 5 = 5%) e assim por diante

local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, 1)
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatFormula(combat, COMBAT_FORMULA_SKILL, 1, 0, 1, 0) -- aqui edita os valores pro dano de paralize, vai mudando ae e testando até achar o desejado

local condition = createConditionObject(CONDITION_PARALYZE)
setConditionParam(condition, CONDITION_PARAM_TICKS, 10000) -- aqui vai o tempo de paralyze, 1000 = 1 segundo
setConditionParam(condition, CONDITION_PARAM_SPEED, -400) -- velocidade que o monstro irá perder
setConditionFormula(condition, 0, 0, 0, 0)
setCombatCondition(combat, condition)

function onAttack(cid, target)
if ((getCreaturePosition(target).x == getCreaturePosition(cid).x or getCreaturePosition(target).x == getCreaturePosition(cid).x+1 or getCreaturePosition(target).x == getCreaturePosition(cid).x-1) and (getCreaturePosition(target).y == getCreaturePosition(cid).y or getCreaturePosition(target).y == getCreaturePosition(cid).y+1 or getCreaturePosition(target).y == getCreaturePosition(cid).y-1)) then
for i=0, #weaponpar do
if (getPlayerSlotItem(cid, 5).itemid == weaponpar or getPlayerSlotItem(cid, 6).itemid == weaponpar) then	 if (math.random(1,100) > (100 - chancepar)) then
doPlayerSendTextMessage(cid, 23, getCreatureName(target).." has paralized.")
doAddCondition(target, condition)
return true
else
return true
end
end
end
end
return true
end
 
Back
Top