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

Spell Perfect Kage Mane no Jutsu (Shadow Imitation Technique) updated,now possess monsters!

hodleo

Formerly cbrm -Crypto enthusiast, Retired scripter
Staff member
Global Moderator
Joined
Jan 6, 2009
Messages
6,598
Solutions
3
Reaction score
955
Location
Caribbean Sea
I updated this good script from here: [Requested Script]Kage Mane no Jutsu! where the author is huggen

Updated: Deleted that stupid target condition and now spell can possess monsters! Too bad I can't use storages on monsters.

If you've watched Naruto and you know who Shikamaru is, this is his jutsu. It takes control of a player's body temporaly, so that player will move in the dir you move or will turn in the dir you turn. The possessed player will be unable to move during the possession.

YOUTUBE: YouTube - kage mane no jutsu opentibia.wmv

Conditions
-> Cool Effects for Possession
-> Possesion may last around 10 seconds
-> You may not possess a possessed victim(only player) by another player
-> If caster gets too far or stops pointing the possessed player his jutsu will cancel.
-> If possessed player gets to a PZ the technique will cancel.
-> Possessed creature walks as fast as the caster.
-> Possessed creature won't walk to houses.
-> Possessed creature moves in the direction you move, won't pierce through objects neither will walk over water
-> Possessed creature will stop if he can't walk on an unwalkable tile
-> Possessed creature won't walk if you go to a higher/lower floor and the technique will be canceled.
-> If possessed creature gets to a different floor you are,
the technique will be canceled.
-> The onLogin script is there in case of server crashes or script gets bugged and you can't possess again

add to LOGIN.LUA:
Lua:
setPlayerStorageValue(cid, 14755, -1)

add to SPELLS.XML:
Lua:
<instant name="Kagemane No Jutsu" words="kagemane" lvl="40" mana="300" exhaustion="2000" blockwalls="1" needlearn="0" event="script" value="kagemane.lua"></instant>

create KAGEMANE.LUA @ spells/scripts:
Lua:
  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, "FREE!", 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
end

Have a small taste of Naruto in your OTS:peace:
 
Last edited:
yay
where's cykes?
 
can you make this as a spell.lua script?
like jutso.lua
for tfs 0.3.5 pl1
why the heck for??:p mods makes our lives easier

Lua:
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 newtargetpos = getCreaturePosition(cid)
            local x = newtargetpos.x-playerpos.x
            local y = newtargetpos.y-playerpos.y
            local z = newtargetpos.z-playerpos.z
            newtargetpos = getCreaturePosition(target)
            newtargetpos.x = newtargetpos.x+x
            newtargetpos.y = newtargetpos.y+y
            newtargetpos.z = newtargetpos.z+z    
            if queryTileAddThing(target, newtargetpos) == RETURNVALUE_NOERROR and getCreaturePosition(cid).z == getCreaturePosition(target).z then
                doMoveCreature(target, getCreatureLookDirection(cid))
            end
        end
    end
    local playerpos = getCreaturePosition(cid)
    local targetpos = getCreaturePosition(target)
    local times = times+1
    if times < 10 then
        addEvent(move, 1000, cid, target, playerpos, targetpos, times)
        doSendMagicEffect(getCreaturePosition(target), CONST_ME_SMALLCLOUDS)
    else
        doCreatureSetNoMove(target, 0)
        doSendDistanceShoot(targetpos, playerpos, 31)
        doSendAnimatedText(targetpos, "FREE!", math.random(1,255))
        doChangeSpeed(target, getCreatureBaseSpeed(target))
        doPlayerSendCancel(target, "You've been freed from "..getPlayerName(cid).."'s Shadow Possesion Jutsu.")
        setPlayerStorageValue(target, 14755, -1)
    end
end

function onCastSpell(cid, var)
    local target = getCreatureTarget(cid) 
    if isPlayer(target) == TRUE then
        if getPlayerStorageValue(target, 14755) == -1 then
            doCreatureSetNoMove(target, 1)
            doChangeSpeed(target, getCreatureSpeed(cid))
            doPlayerSendCancel(target, "You have been possessed by "..getPlayerName(cid)..".")
            doSendAnimatedText(getCreaturePosition(target), "POSSESSED!", math.random(1,255))
            local playerpos,playerdir,targetpos = getCreaturePosition(cid), getPlayerLookDir(cid), getCreaturePosition(target)
            doSendDistanceShoot(playerpos, targetpos, 31)
            local times = 1
            addEvent(move, 1000, cid, target, playerpos, targetpos, times)
            setPlayerStorageValue(target, 14755, 1)
        else
            doPlayerSendCancel(cid, "Your shadow possession jutsu isn't worn out yet.")
        end
    end
end

add to login.lua:
Lua:
setPlayerStorageValue(cid, 14755, -1)
 
this is my login.lua:

Lua:
local config = {
	loginMessage = getConfigValue('loginMessage')
}

function onLogin(cid)
	local loss = getConfigValue('deathLostPercent')
	if(loss ~= nil) then
		doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, loss * 10)
	end

	local accountManager = getPlayerAccountManager(cid)
	if(accountManager == MANAGER_NONE) then
		local lastLogin, str = getPlayerLastLoginSaved(cid), config.loginMessage
		if(lastLogin > 0) then
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
			str = "Your last visit was on " .. os.date("%a %b %d %X %Y", lastLogin) .. "."
		else
			str = str .. " Please choose your outfit."
			doPlayerSendOutfitWindow(cid)
		end

		doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
	elseif(accountManager == MANAGER_NAMELOCK) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, it appears that your character has been namelocked, what would you like as your new name?")
	elseif(accountManager == MANAGER_ACCOUNT) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to manage your account and if you want to start over then type 'cancel'.")
	else
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to create an account or type 'recover' to recover an account.")
	end

	if(not isPlayerGhost(cid)) then
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
	end

	registerCreatureEvent(cid, "Mail")
	registerCreatureEvent(cid, "GuildMotd")
	registerCreatureEvent(cid, "Idle")
	registerCreatureEvent(cid, "SkullCheck")
	registerCreatureEvent(cid, "ReportBug")
	registerCreatureEvent(cid, "onPrepareDeath")
	registerCreatureEvent(cid, "repKill")  
    registerCreatureEvent(cid, "repLook")  
    registerCreatureEvent(cid, "repDeath")
	return true
end

where should i add that storage value?
 
lol anywhere!

before

Lua Code:
return true
end
 
you probably forgot this, in case you are not using the mod:
Lua:
<instant name="Kage Mane no jutsu" words="shadow" lvl="10" mana="1" prem="1" exhaustion="2000" needlearn="0" enabled="1" event="script" value="kagemane.lua"></instant>

but I have tested it in MOD and in luas and they work 100%
 
lol it is you
it only works on human 'cid'players
reload everything and ensure you are not doing something bad

but wht'heck you dont'use the mod instead?
 
use it as ur puppet :)
you walk, he walks
you turn, he turns
he will be unable to move while he is possessed, haven't you ever watched naruto?
 
ye i watch naruto but not everyday
lol
when i dont got school i watch it
on school days i cant becuz i'm at school =S
 
oh i see what it does =p
rox
rep++ for you =D

EDIT:

ffs look the pic =(
dhfmzm.jpg
 
For me, this is perfect!
then rep me =p ppl rep me, I release new scripts, that's how it works
I currently have an unique pvp event too bad I don't want to release it now:peace:
@lava, try now, I reped you back
 
hmm reping another person then reping me back? let me try..
 
Hum .. yes I also got to do the Kage Mane no Jutsu with that script hugen also, my was very different, as when the player taking the jutsu was over the target, also about the time I put him to stay by taking mana per 5 sec player and when the player has 0 mana Seems the jutsu, the topic of help I had forgotten the problem solved more aprece that its got better ... well I will test here. Thanks for helping me = D
 
Back
Top