Kage Thunder
Advanced User
- Joined
- Sep 30, 2012
- Messages
- 184
- Reaction score
- 3
Siema, mam taki problem, zrobi?em sobie skrypt kt?ry sam w sobie dzia?a, ale nie dzia?a to, ?e nie mo?emy tego spella u?y? na potworku kt?rego wpiszemy do skryptu, mianowicie nadal da si? go tym atakowa?, kto? mo?e co? mi poradzi? w tym?
[LUA]local config = {
tempo = 5,
effect = 61 --- efekt spella
}
local exceptions = {'Train Log', 'Training Log', 'Monk'} --- mooby ktorych sie nie atakowac
function onCastSpell(cid, var)
addEvent(doSetCreatureOutfit, 1, variantToNumber(var), getCreatureOutfit(cid), (config.tempo * 1000) - 1)
doSetCreatureOutfit(cid, getCreatureOutfit(variantToNumber(var)), config.tempo * 1000)
doSendMagicEffect(getThingPos(cid), config.effect)
addEvent(doSendMagicEffect, 1, getThingPos(variantToNumber(var)), config.effect)
addEvent(doTeleportThing, 1, variantToNumber(var), getThingPos(cid))
doTeleportThing(cid, getThingPos(variantToNumber(var)))
if isCreature(getCreatureTarget(cid)) then
target = getCreatureTarget(cid)
for i = 1, #exceptions do
if getCreatureName(target):lower() == exceptions then
doPlayerSendCancel(cid, "You can't use this on ".. getCreatureName(target) .." to Swap.")
return false
end
end
local mob = getTopCreature(tPos).uid
if canEffect (tPos) and mob ~= 0 and (isMonster(mob) or isPlayer(mob)) then
for i = 1, #exceptions do
if getCreatureName(mob):lower() == exceptions then
checker = 1
break
end
end
return true
end
end
end[/LUA]
[LUA]local config = {
tempo = 5,
effect = 61 --- efekt spella
}
local exceptions = {'Train Log', 'Training Log', 'Monk'} --- mooby ktorych sie nie atakowac
function onCastSpell(cid, var)
addEvent(doSetCreatureOutfit, 1, variantToNumber(var), getCreatureOutfit(cid), (config.tempo * 1000) - 1)
doSetCreatureOutfit(cid, getCreatureOutfit(variantToNumber(var)), config.tempo * 1000)
doSendMagicEffect(getThingPos(cid), config.effect)
addEvent(doSendMagicEffect, 1, getThingPos(variantToNumber(var)), config.effect)
addEvent(doTeleportThing, 1, variantToNumber(var), getThingPos(cid))
doTeleportThing(cid, getThingPos(variantToNumber(var)))
if isCreature(getCreatureTarget(cid)) then
target = getCreatureTarget(cid)
for i = 1, #exceptions do
if getCreatureName(target):lower() == exceptions then
doPlayerSendCancel(cid, "You can't use this on ".. getCreatureName(target) .." to Swap.")
return false
end
end
local mob = getTopCreature(tPos).uid
if canEffect (tPos) and mob ~= 0 and (isMonster(mob) or isPlayer(mob)) then
for i = 1, #exceptions do
if getCreatureName(mob):lower() == exceptions then
checker = 1
break
end
end
return true
end
end
end[/LUA]