eso es algo mas avanzado, tal vez con la funcion getdistancebetween se haga
How to make so its only works on Monsters
function onLogin(cid)
registerCreatureEvent(cid, "PlayerKill")
if (InitArenaScript ~= 0) then
InitArenaScript = 1
-- make arena rooms free
for i = 42300, 42309 do
setGlobalStorageValue(i, 0)
setGlobalStorageValue(i+100, 0)
end
end
-- if he did not make full arena 1 he must start from zero
if getPlayerStorageValue(cid, 42309) < 1 then
for i = 42300, 42309 do
setPlayerStorageValue(cid, i, 0)
end
end
-- if he did not make full arena 2 he must start from zero
if getPlayerStorageValue(cid, 42319) < 1 then
for i = 42310, 42319 do
setPlayerStorageValue(cid, i, 0)
end
end
-- if he did not make full arena 3 he must start from zero
if getPlayerStorageValue(cid, 42329) < 1 then
for i = 42320, 42329 do
setPlayerStorageValue(cid, i, 0)
end
end
if getPlayerStorageValue(cid, 42355) == -1 then
setPlayerStorageValue(cid, 42355, 0) -- did not arena level
end
setPlayerStorageValue(cid, 42350, 0) -- time to kick 0
setPlayerStorageValue(cid, 42352, 0) -- is not in arena
doPlayerPopupFYI(cid, message)
registerCreatureEvent(cid, "PlayerDeath")
--registerCreatureEvent(cid, "MEDALS") This is Nahruto's Metal System for killing someone, Dont add this unless you use it.--
registerCreatureEvent(cid, "KilledMonstersCounter")
registerCreatureEvent(cid, "playeradvance")
return TRUE
end
registerCreatureEvent(cid, "kawarimi")
setPlayerStorageValue(cid, 14755, -1)
I added it on my login.lua, look:
what's wrong?? tell me srry for noob xDDCode:function onLogin(cid) registerCreatureEvent(cid, "PlayerKill") if (InitArenaScript ~= 0) then InitArenaScript = 1 -- make arena rooms free for i = 42300, 42309 do setGlobalStorageValue(i, 0) setGlobalStorageValue(i+100, 0) end end -- if he did not make full arena 1 he must start from zero if getPlayerStorageValue(cid, 42309) < 1 then for i = 42300, 42309 do setPlayerStorageValue(cid, i, 0) end end -- if he did not make full arena 2 he must start from zero if getPlayerStorageValue(cid, 42319) < 1 then for i = 42310, 42319 do setPlayerStorageValue(cid, i, 0) end end -- if he did not make full arena 3 he must start from zero if getPlayerStorageValue(cid, 42329) < 1 then for i = 42320, 42329 do setPlayerStorageValue(cid, i, 0) end end if getPlayerStorageValue(cid, 42355) == -1 then setPlayerStorageValue(cid, 42355, 0) -- did not arena level end setPlayerStorageValue(cid, 42350, 0) -- time to kick 0 setPlayerStorageValue(cid, 42352, 0) -- is not in arena doPlayerPopupFYI(cid, message) registerCreatureEvent(cid, "PlayerDeath") --registerCreatureEvent(cid, "MEDALS") This is Nahruto's Metal System for killing someone, Dont add this unless you use it.-- registerCreatureEvent(cid, "KilledMonstersCounter") registerCreatureEvent(cid, "playeradvance") return TRUE end registerCreatureEvent(cid, "kawarimi") setPlayerStorageValue(cid, 14755, -1)
no that only happens with mind transfer jutsu. the jutsu ino uses.[*] Or, make so any damage taken upon victim, also goes to the one who casts the spell. (Like Naruto, if you punch the victim, you will also get the same strength of punch at yourself unless you dispel it).[/list]
[12/06/2010 20:03:44] [Error - Spell Interface]
[12/06/2010 20:03:44] data/spells/scripts/custom/kagemane.luanCastSpell
[12/06/2010 20:03:44] Description:
[12/06/2010 20:03:44] (luaAddEvent) Callback parameter should be a function.
[12/06/2010 20:03:46] [Error - Spell Interface]
[12/06/2010 20:03:46] data/spells/scripts/custom/kagemane.luanCastSpell
[12/06/2010 20:03:46] Description:
[12/06/2010 20:03:46] (luaAddEvent) Callback parameter should be a function.
local function move(cid, target, playerpos, targetpos, times)
if playerdir ~= getCreatureLookDirection(cid) then
doCreatureSetLookDirection(target, getCreatureLookDirection(cid))
end
if playerpos ~= getCreaturePosition(cid) then
if playerpos.z == getCreaturePosition(cid).z then
local ntpos = getCreaturePosition(cid)
local x,y,z = ntpos.x-playerpos.x,ntpos.y-playerpos.y,ntpos.z-playerpos.z
ntpos = getCreaturePosition(target)
ntpos.x, ntpos.y, ntpos.z = ntpos.x+x,ntpos.y+y,ntpos.z+z
if queryTileAddThing(target, ntpos) == RETURNVALUE_NOERROR and getCreaturePosition(cid).z == getCreaturePosition(target).z then
doMoveCreature(target, getCreatureLookDirection(cid))
end
end
end
local playerpos, targetpos = getCreaturePosition(cid), getCreaturePosition(target)
local times = times+1
if times < 100 then
addEvent(move, 1, cid, target, playerpos, targetpos, times)
else
doCreatureSetNoMove(target, 0)
doSendDistanceShoot(targetpos, playerpos, 31)
doSendAnimatedText(targetpos, "Lost Effect!", math.random(1,255))
doPlayerSendCancel(cid, "You have lost control of "..getCreatureName(target)..".")
if (isPlayer(target)) then
doPlayerSendCancel(cid, "You've been freed from "..getPlayerName(cid).."'s Shadow Imitation Technique.")
setPlayerStorageValue(target, 14755, -1)
end
end
end
function onCastSpell(cid, var)
local target = getCreatureTarget(cid)
if (isPlayer(target)) or (isMonster(target)) then
if getPlayerStorageValue(cid, 14755) == -1 then
doCreatureSetNoMove(target, 1)
doPlayerSendCancel(cid, "You have possessed "..getCreatureName(target)..".")
if (isPlayer(target)) then
doPlayerSendCancel(target, "You have been possessed by "..getPlayerName(cid)..".")
setPlayerStorageValue(target, 14755, 1)
end
doSendAnimatedText(getCreaturePosition(target), "POSSESSED!", math.random(1,255))
local playerpos,playerdir,targetpos = getCreaturePosition(cid), getPlayerLookDir(cid), getCreaturePosition(target)
doSendDistanceShoot(playerpos, targetpos, 31)
doSendMagicEffect(getCreaturePosition(target), CONST_ME_SMALLCLOUDS)
local times = 1
addEvent(move, 1000, cid, target, playerpos, targetpos, times)
else
doPlayerSendCancel(cid, "Your Shadow Imitation Technique isn't worn out yet.")
end
end
return TRUE
end