• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

TalkAction Transforming with walkingEffects

Zyntax

*WannaBe Scripter*
Joined
Jan 27, 2010
Messages
533
Reaction score
40
Location
Lua & XML Section
The outcome of a misunderstood request must not always be for nothing.
I'm releasing this code just for the lulz of it, no usefull or hyper-cypher code, just for fun.
I misunderstood the request of a user for a script and that was the outcome...

What does it do?
Transforms you into a monster and sends effect for each step you take.

Dragon Animation
259lh5w.gif



Witch Animation
5e8gt0.gif



Again, there's no serious coding behind it, I'm just sharing it because I thought someone may need it sometime...

Implemenation

talkactions.xml
XML:
<talkaction words="!change" event="script" value="change.lua"/>

talkactions/scripts/ change.lua
LUA:
local seconds = 20 --how long the transform effect lasts

--Conditions (dragon, dragonlord, add what you want)
local dragon = createConditionObject(CONDITION_OUTFIT)
setConditionParam(dragon, CONDITION_PARAM_TICKS, 1000*seconds)
addOutfitCondition(dragon, 0, 34, 0, 0, 0, 0) --34 = outfitID of a dragon

local dragonLord = createConditionObject(CONDITION_OUTFIT)
setConditionParam(dragonLord, CONDITION_PARAM_TICKS, 1000*seconds)
addOutfitCondition(dragonLord, 0, 39, 0, 0, 0, 0) --39 = outfitID of a dragonlord

local witch = createConditionObject(CONDITION_OUTFIT)
setConditionParam(witch, CONDITION_PARAM_TICKS, 1000*seconds)
addOutfitCondition(witch, 0, 54, 0, 0, 0, 0) --54 = outfitID of a witch
--End Conditions

local outfits = {
	["dragon"] = {effect = CONST_ME_EXPLOSIONHIT, text = "Rrrrooaarr!", condition = dragon, look = 34},
	["dragonlord"] = {effect = CONST_ME_EXPLOSIONHIT, text = "Ggrraahh!", condition = dragonLord, look = 39},
	["witch"] = {effect = CONST_ME_BATS, text = "Hihihihih!", condition = witch, look = 54}
	}

function effect(cid, u, pos)
	if u.look == getCreatureOutfit(cid).lookType then
		local k = getThingPos(cid)
		if k.x ~= pos.x or k.y ~= pos.y or k.z ~= pos.z then
			doSendMagicEffect(k, u.effect)
		end
		addEvent(effect, 100, cid, u, k)
	end
end

function onSay(cid, words, param)
	if param == '' then
		return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have to define a valid monstername.")
	end
	local u = outfits[string.lower(param)]
	if u then
		doPlayerSay(cid, u.text, 19)
		doAddCondition(cid, u.condition)
		effect(cid, u, {x=0, y=0, z=0})
	else
		return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "This monster outfit is not available.")
	end
return true
end

Should be selfexplaining...

I don't know if anyone would need that...
 
THe script is nice, but i asked that monster which is not player get fire behind that menas movement :) i hope you could make me one of that xD
 
Could you make so the script makes you totaly invisble instead of just transforming you to an outfit.
 
Could you make so the script makes you totaly invisble instead of just transforming you to an outfit.

Make a request in the "Reuqest" section with a reference link to this thread.
If noone helps you out I'm going to script that for you, but please visit the request board first.
 
Zyntax, there is no way to script that. There is no outfit that is totally invisible. You could source edit.
 
sure, utana vid?
I'll just use the utana vid script and implement it ;)
But I'm at work right now so I can't script it properly.
 
Code:
function onSay(cid, words, param)
local outfits = {
	["dragon"] = {seg = 20,effect = 6, text = {"GROOAAARRR","Rrrrooaarr"},out = 34},
	["ghost"] = {seg = 20,effect = 12, text = {"Shhhhhh!","Buuuuuh"}, out = 48},
	["witch"] = {seg = 20,effect = 66, text = {"Hahahahahaha!","Hihihihih!"},out = 54}
	}
	if param == '' then
		return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have to define a valid monstername.")
	end
	local u = outfits[string.lower(param)]
	if u then    
                function effect(cid, u, pos)
                if getCreatureOutfit(cid).lookType == u.out then
		local k = getThingPos(cid)
		if k.x ~= pos.x or k.y ~= pos.y or k.z ~= pos.z then
			doSendMagicEffect(k, u.effect)
		end
		addEvent(effect, 100, cid, u, k)
               end               
                 end
		doPlayerSay(cid, u.text[math.random(1, #u.text)], 19)
		doSetCreatureOutfit(cid, {lookType = u.out}, u.seg*1000)
                effect(cid, u, {x=0, y=0, z=0})
	else
		return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "This monster outfit is not available.")
	end
return true
end
 
Maybe I can use the /ghost command from GMs.
If that's not possible then I'll lookup the sources and find a way to do it, simple as that ;)
 
Back
Top