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

TalkAction Animated Emoticons!

Narzerus

Full-stack developer and old OT Developer
Joined
Oct 29, 2007
Messages
202
Reaction score
11
Fully animated emoticons for your OTServer!

- Knowledge needed:
* Basic compiling (no programming skills whatsoever)
* Knowing how to edit tibia.dat and tibia.spr


The function displays emoticons triggered by talk actions
Example: saying /... would show the dots animation (lower left corner in uploaded preview) over your head.

You will need:
- A Tibia.dat editor (Recommended NoxItems)
- A Tibia.spr editor (Recommended Noxitu spr editor)
- A working c++ compiler (Devcpp etc.)



Step 1 (Adding the sprites):
- Open your Tibia.spr editor and add all the animations (they MUST be 64x64 divided in 4 different 32x32 sprites)
- Add an empty sprite (a 32x32 sprite fully colored in 255,0,255 RGB which is Tibia's transparent color)

Step 2 (Adding the animations)
- Open your Tibia.dat
- Add the animations in 64x64 format, the sprite must be on the most upper right corner
- You must use the empty sprite to fill the empty spaces on your 64x64 animation.
- If the animation is too short repeat it so it is 10 frames long

Step 3 (Compiling new animations)
- Open the source code of your OTServer and search for "MAGIC_EFFECT"
- Select any line that shows MAGIC_EFFECT_[ANYTHING]=[HEX]
- Add your new animations to the list and their respective new HEX values (use a converter to know the values)
- Replace MAGIC_EFFECT_LAST = MAGIX_EFFECT_[ANYTHING] for your last magic effect
*Ex:
Code:
MAGIC_EFFECT_SLASH2		= 0x46, //70
	MAGIC_EFFECT_EMOXX		= 0x47, //71
	MAGIC_EFFECT_EMOCRY		= 0x48, //72
	MAGIC_EFFECT_EMODOT		= 0x49, //73
	MAGIC_EFFECT_EMODROP	= 0x4A, //74
	MAGIC_EFFECT_LAST		= MAGIC_EFFECT_EMODROP,

- Search for "|| !canSee(pos)"
- Change the number to your last new animation value (Ex: (type > 74 || !canSee(pos) in my case)
* Ex:
Code:
 if(type > 74 || !canSee(pos))
		return;
- Compile

Step 4 (Editing constants)
- Open your constants files (Ex: Server/lib/000-const)
- Add your new animations there and replace CONST_ME_LAST = CONST_ME_[ANYTHING] for your last animation there.
*EX:
Code:
   CONST_ME_BATS = 66
CONST_ME_SMOKE = 67
CONST_ME_INSECTS = 68
CONST_ME_SLASH = 69
CONST_ME_SLASH2 = 70
CONST_ME_EMOXX = 71
CONST_ME_EMOCRY = 72
CONST_ME_EMODOT = 73
CONST_ME_EMODROP = 74
CONST_ME_NONE = 255
CONST_ME_LAST = CONST_ME_EMODROP

Step 5 (Adding scripts)
- add to talkactions.xml your emoticons
*Ex:
Code:
<talkaction words="/dot" event="script" value="emoticons/dots.lua"/>
<talkaction words="/cry" event="script" value="emoticons/cry.lua"/>
- create a .lua file for every emoticon you add
*Ex:
emoticons/cry.lua:
Code:
function onSay(cid, words, param, channel)
	lastemo = getPlayerStorageValue(cid, 3001)
	now = os.time()
	playerpos = getThingPosition(cid)
	if (now - lastemo) >= 2 then
		doSendMagicEffect(playerpos, CONST_ME_EMOCRY)
		setPlayerStorageValue(cid, 3001, now)
	end
	return true
end
emoticons/dots.lua:
Code:
function onSay(cid, words, param, channel)
	lastemo = getPlayerStorageValue(cid, 3001)
	now = os.time()
	playerpos = getThingPosition(cid)
	if (now - lastemo) >= 2 then
		doSendMagicEffect(playerpos, CONST_ME_EMODOT)
		setPlayerStorageValue(cid, 3001, now)
	end
	return true
end

- Step 5:
Replace your .dat and .spr files in your Tibia client for the ones you created.





Boilá that's it, you can now use emoticons!



Credits to:
Me (Idea, Scripts, etc)
Ragnarok Online (Because I stole his emoticons)


PD: Long time I haven't been on OTServ developing, this is a gift for you people!

REP++ FTW!
 

Attachments

Good job.
This could be called "[TUTORIAL] How to add new effects/animations"
 
Good job.
This could be called "[TUTORIAL] How to add new effects/animations"

Yeah, it's like both things I guess, i couldn't just post the scripts lol
 
@Tibiamakers
dude, don't hate, the guy made a very well explained tutorial.
@Narzerus
Good Job!, Rep++ and Welcome Back, "2007 OTLanders Devision" FTW!!!
 
Last edited:
yeh, pokemon online
 
Thanks for the comments people, hope this helps somebody, it's preety cool using them in-game :)
 
Back
Top