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

Spell [Mod] Sanity's Eclipse

Summ

(\/)(;,,;)(\/) Y not?
Staff member
Global Moderator
Joined
Oct 15, 2008
Messages
4,152
Solutions
12
Reaction score
1,107
Location
Germany :O
Sanityseclipse.gif

Sanity's Eclipse
Author/Credits: Me
Idea: Dota - Hero: Obsidian Destroyer (Harbringer) Ultimate Spell
Type: MOD Script
Note: This spell isn't suitable for RPG servers and such. It should only be used in FUN Server/Events because of a big imbalancement due mage have much more mana than knights and will kill them easily. Also monster won't take any damage by this.


Mod contains:Sanity's Eclipse Spell as rune and as instant spell (RuneID: 2297)

Script:
Part 1:
Create a "Sanity's Eclipse.xml" file in your server's mod folder and copy that in:
HTML:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="Sanity's Eclipse by Summ" version="1.0" author="Summ/Rhux" contact="otland.net/open-tibia.de" enabled="yes">
	<instant name="Sanity's Eclipse" words="eclipse" lvl="80" mana="600" exhaustion="2000" needlearn="0" event="script" value="eclipse.lua">
		<vocation id="1"/>
		<vocation id="5"/>
	</instant>
	<rune name="Thunderstorm" id="2297" allowfaruse="1" charges="1" lvl="80" maglv="4" exhaustion="2000" event="script" value="eclipse.lua"/>
	<item id="2297" article="a" name="sanity's eclipse rune" override="yes">
		<attribute key="runeSpellName" value="?!?!?" /> 
		<attribute key="weight" value="120" />
		<attribute key="charges" value="1" />
	</item> 
</mod>


Part 2:
Now in your mods folder create another folder called "scripts" (if it doesn't exist) and in that folder create a "eclipse.lua" file and copy that in:
PHP:
--=====Dota - Obsidian Destroyer (Harbringer) - Sanity's Eclipse Spell (Ultimate)======--
--[[Credits to Summ/Rhux]]--

--=====CONFIG======--
local config = {
	diffMethod = "normal",
	normalInt = 13,
	intMultiplier = 3,
	dmgMultiplier = 5,
	saveHealth = 0,
	manaPercent = 75
}
--=================--
local function getIntDiff(cid,target,method)
	local int = method == "normal" and (function(cid) return math.floor(getPlayerMaxMana(cid)/config.normalInt) end) or method == "mana" and (function(cid) return getPlayerMaxMana(cid) end) or method == "level" and (function(cid) return getPlayerLevel(cid) end)
	return (int(cid) - int(target))*config.intMultiplier
end

local combat = {createCombatObject(),createCombatObject()}
local param = {
	[combat[1]] = {{setCombatCallback, CALLBACK_PARAM_TARGETTILE, "onTargetTile"},{setCombatParam, COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE}, {setCombatParam, COMBAT_PARAM_EFFECT, CONST_ME_FIREAREA}, {setCombatParam, COMBAT_PARAM_AGGRESSIVE, true}},
	[combat[2]] = {{setCombatParam, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE}, {setCombatParam, COMBAT_PARAM_EFFECT, CONST_ME_BIGCLOUDS}, {setCombatParam, COMBAT_PARAM_AGGRESSIVE, true}}
}

function onTargetTile(cid, pos)
	pos.stackpos = 253
	local creature = getThingFromPos(pos)
	if isPlayer(creature.uid) == true and cid ~= creature.uid then
		local dmg, manaPercent = getIntDiff(cid,creature.uid, config.diffMethod) * config.dmgMultiplier * 2, math.ceil((getCreatureMana(creature.uid)*config.manaPercent)/100)
		local combat = dmg > config.saveHealth and (doTargetCombatHealth(cid, creature.uid, COMBAT_FIREDAMAGE, -dmg, -dmg, 10) and doSendAnimatedText(getPlayerPosition(creature.uid), text, COLOR_RED)) or dmg <= config.saveHealth and doTargetCombatMana(cid, creature.uid, -manaPercent, -manaPercent, 10) or 0
	end
end

local area = {

	createCombatArea( --Fire Area
	{{0, 0, 1, 1, 1, 0, 0},
	{0, 1, 1, 1, 1, 1, 0},
	{1, 1, 1, 1, 1, 1, 1},
	{1, 1, 1, 3, 1, 1, 1},
	{1, 1, 1, 1, 1, 1, 1},
	{0, 1, 1, 1, 1, 1, 0},
	{0, 0, 1, 1, 1, 0, 0}}),

	createCombatArea( --Cloud Area (Outline)
	{{0, 0, 1, 1, 1, 0, 0},
	{0, 1, 1, 0, 1, 1, 0},
	{1, 1, 0, 0, 0, 1, 1},
	{1, 0, 0, 3, 0, 0, 1},
	{1, 1, 0, 0, 0, 1, 1},
	{0, 1, 1, 0, 1, 1, 0},
	{0, 0, 1, 1, 1, 0, 0}})

}

for combat, params in pairs(param) do
	for i = 1,#params do
	params[i][1](combat, params[i][2],params[i][3])
	end
end

for i = 1,#area do
	setCombatArea(combat[i], area[i])
end

function onCastSpell(cid, var)
	return doCombat(cid, combat[2], var) and doCombat(cid, combat[1], var)
end

Explanation of the spell:
The damage of the spell is based on the difference of the intelligence of the caster and each target in the spell area.
Due the fact that there is no intelligence attribut in Tibia you have the possibilty to set different methods to calculate the intelligence of a player.(look down in "explanation of config")
Also there is a dmgMultiplier in config, with which the difference of intelligence will be multiplied before it is dealt to the target.
Extras: If the damage is lower than the value entered in saveHealth (config) then the player won't take any damage, the player will just loose a certain part of his current mana points.
If the target has more intelligence the spell won't harm that target.
>> You can also look at: (dota description of the spell at bottom)
Obsidian Destroyer - DotA Hero Details

Explanation of config:
config = {
•diffMethod, -> The method with which the intelligence is calculated ("normal","mana" or "level")
=> "normal" -> The intelligence of a player is equal to his mana points divided with the value set for "normalInt"
=> "mana" -> The intelligence equals a players mana points (nearly the same as "normal", but the difference will be higher)
=> "level" -> The intelligence equals the level of a player (this method is more balanced)

•normalInt -> This is only needed if diffMethod = "normal", this is how many mana points are 1 intelligence point
•intMultiplier -> I didn't think about that when making the spell, it is not needed. Just set it to 1
•dmgMultiplier -> The damage is multiplied with this value, this way the damage can be increased or decreased (3,0.2)
•saveHealth -> If the player takes less damage than this value he won't take any damage and he will just loose a part of his mana
•manaPercent -> The part of mana the player will loose (look saveHealth)
}

Screenshots:
Dota:
user15533pic75311257981.jpg


Tibia:
eclipser.jpg


Just a fun spell. ;d

~Rhux
 
Last edited:
Bump
72 Views 2 Comments :d?
 
Back
Top