• 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 [Semi-Adv] Evolving spell. (Exana-type example)

Guitar Freak

_LüA_n☺b_
Joined
Dec 27, 2008
Messages
831
Reaction score
13
Location
Caracas, Venezuela
Hello.

Today I have been playing around with the stuff I have been learning from my Lua Questions thread and other sites aswell, and I decided to test my knowledge on a single script, that ended in this spell.

After hours of work and plenty of silly (very silly) mistakes, I finally got it working correctly.

It might be a silly and not-so-useful spell, but could lead to something better from others, but as I said it was mostly to test myself :p

· Credits:

~ kokokoko, Syntax and all the people that has helped me on the thread or on PMs, thanks guys.

~ Guitar Freak (me) for the scripting, made from scratch! Havent made many like that so Im proud of it ^_^

· Compatibility:

Tested and working with TFS 0.3.5 and 0.3.5pl1.
Untested on others but probably works with any 0.3+.

· Description:

This is some sort of an "evolving spell". It consists in a spell with 2 stages (or more), where you can reach the best stage of it only after meeting certain conditions.

For this Im using an exana-type of spell as an example, but maybe you guys can get it for an idea for something better.

· How it works:

Basically it is an "exana pox" spell that, when you say the words (in this case Exana), it dispels Poison, Drunk and Paralyze conditions on it's first stage, but then when the player gets his promotion (and only if player is from the vocations you allow in the spell's config), the spell will "evolve" to second stage for him, so when he does "Exana", the spell will now dispel some extra conditions which in this case are Fire and Energy. Meaning that at the second and final stage, the spell will dispel Poison, Drunk, Paralyze, Fire and Energy conditions, for those who met the requirements.

So leaving the default configuration, means that any player from any vocation can use the first stage of the spell, even knights can use Exana to dispel Poison, Drunk and Paralyze conditions, but when knights get promoted they wont be able to use the second stage, the spell will remain in first stage for them. But for the other vocations, after promoting the spell will go to second stage.

It might be a little confusing but test it yourself and you'll get the hang of it! :)

· Script:

First, add this to your /data/spells.xml folder:

PHP:
<instant name="Exana" words="exana" lvl="10" mana="20" exhaustion="2000" needlearn="0" event="script" value="exana.lua"/>

Configure to however you desire, of course.

Then create exana.lua in your /data/spells/scripts folder and add this:

Lua:
-- Evolving Spell scripted by Guitar Freak.
-- More info on: [url]http://otland.net/f82/0-3-5-advanced-evolving-spell-exana-type-example-47933/[/url]

local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0)

	local pos = getCreaturePosition(cid)
	local PromotionLevel = 1 	-- Default PromotionLevel is 1, but if you have a second promotion and want the spell to evolve at that point, put 2.
	local config = {		-- Go to your /data/lib/constant.lua for better information on conditions in case you want to modify something, etc.

	vocations = {		-- Vocations that will be able to use the EVOLVED spell (NOT the normal spell, this is configured in spells.xml).
		1,	-- Sorcerer
		2,	-- Druid
		3,	-- Paladin
		5,	-- Master Sorcerer
		6,	-- Elder Druid
		7	-- Royal Paladin
	},

	conditions = {		-- Initial conditions it removes, before it evolves.
		CONDITION_POISON,
		CONDITION_DRUNK,
		CONDITION_PARALYZE
	},

	extras = {		-- Extra conditions it removes after it evolves.
		CONDITION_FIRE,
		CONDITION_ENERGY
	},

	effects = {		-- Animations to be randomized.
		CONST_ME_MAGIC_BLUE,
		CONST_ME_MAGIC_RED,
		CONST_ME_MAGIC_GREEN
	},

	}

	------------------------------------
	-- Dont modify anything from here: --
	
	function ConditionRemove()
		for _, c in pairs(config.conditions) do
			doRemoveCondition(cid, c)
		end
	end

	function AddExtras()
		for _, e in pairs(config.extras) do
			table.insert(config.conditions,e)
			ConditionRemove()
		end
	end
	
	-- To here. --
	--------------

function onCastSpell(cid, var)
	
	if getPlayerPromotionLevel(cid) >= PromotionLevel and isInArray(config.vocations, getPlayerVocation(cid)) then
		AddExtras()
	else
		ConditionRemove()
	end
	doSendMagicEffect(pos, config.effects[math.random(1,#config.effects)])
	return doCombat(cid, combat, var)
end

I was having fun with the stuff Im learning so bare with me if it is still n0b scripted. You can also remove the random animations, I just like it that way :p

As I said it might be useless for some, but maybe with a similar "system" you could make more useful evolving spells :)

Since you can configure almost everything on the script, or also make a different one yourself with stages depending on the lvl of the player, or using storagevalues so after doing "x" quest the spell evolves (or so it evolves for VIPs, etc).

I think it can be useful for some stuff like that, I hope you like it :)
If you find any bugs, tell me!

Cheerz.
 
Last edited:
Very simple, but useful.

Good job

__________________

Are you tired of the customer neglect of TibiaBotNG? Do you think LoW needs to add more updates? Are you tired of using a crappy bot because its a cheap alternative to Elf? Well, dont be tired anymore! Check out my blog!
 
Last edited:
Very nice! I'd suggest using constant names instead of numbers though, as numbers might change in the future and that will screw your scripts.
 
didn't get it :/

How so :eek:

Its just a spell that "evolves" to a better phase after some conditions are met, read the "how it works" part I tried to explain it as detailed as possible.

It would be more useful to use it for example with promotions (as the example of the thread) or premiums/VIPs etc as those conditions.. like if you get promoted then that spell works better than non-promoted, but its the same spell anyways it just evolved after you promoted. Same as if you do it for VIPs and such, when the player gets the status the spell automatically gets better just because of it.

Kinda confusing :p

Btw I loved your rep system script :thumbup: hope you manage to finish it for 0.3.5pl1!

Regards.
 
@up ok! smart code
rep for 0.3: hmm I'm on it, just need to make a function to work :) the best rep sys ever made
 
very cool idea rep++ ill keep this script in mind when making new spells
 
Back
Top