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

okay, I want to learn to script!

cake

Banned User
Joined
Jul 24, 2010
Messages
838
Reaction score
58
Location
good or bad,
really ^_^
never thought I would, but I really want to make unique systems in me, collz' & hawars' upcoming server.

First of all, I know absolutely nothing about scripting.
Is there any tutorials explaining the basics?
Also I saw in tutorials something about C/C++, is that what Tibia-scripting uses?

Thanks!
 
o.o I did it

23:31 New record: 1 players are logged in.

now I just need to add my new thing script. hmm.


Thanks everybody :D!
 
Last edited:
I get this error when loading:

[02/09/2010 09:46:11] [Error - LuaScriptInterface::loadFile] data/actions/scripts/liquids/mastermind_potion.lua:19: ')' expected near 'then'
[02/09/2010 09:46:11] [Warning - Event::loadScript] Cannot load script (data/actions/scripts/liquids/mastermind_potion.lua)
[02/09/2010 09:46:11] data/actions/scripts/liquids/mastermind_potion.lua:19: ')' expected near 'then'
 
a bracket was missing :S
Code:
local condition = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(condition, CONDITION_PARAM_TICKS, 10 * 60 * 1000) -- 10 minutes
setConditionParam(condition, CONDITION_PARAM_STAT_MAGICLEVEL, 10)
setConditionParam(condition, CONDITION_PARAM_SKILL_SHIELD, -20)
 
local outfit = createConditionObject(CONDITION_OUTFIT)
setConditionParam(outfit, CONDITION_PARAM_TICKS, -1)
addOutfitCondition(outfit, {lookType = 35})
 
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_FIREAREA)
setAttackFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 5, 5, 7, 14)
 
local area = createCombatArea(AREA_CROSS5X5)
setCombatArea(combat, area)
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if(not isSorcerer(cid)[B][COLOR="red"])[/COLOR][/B] then
		doCreatureSay(cid, "Your elemental power is too low..", TALKTYPE_ORANGE_1, cid)
		return true
	end
 
	if(doAddCondition(cid, condition)) then
		doAddCondition(cid, outfit)
		doSendMagicEffect(fromPosition, CONST_ME_MAGIC_RED)
		doRemoveItem(item.uid)
		doCreatureSay(cid, "You have unleashed the demon inside your soul!", TALKTYPE_ORANGE_1, cid)
	end
 
	return true
end
 
Last edited:
Now it says:

[02/09/2010 09:53:49] [Error - LuaScriptInterface::loadFile] data/actions/scripts/quests/annihilator.lua:5: '}' expected (to close '{' at line 1) near 'entry'
[02/09/2010 09:53:49] [Warning - Event::loadScript] Cannot load script (data/actions/scripts/quests/annihilator.lua)
[02/09/2010 09:53:49] data/actions/scripts/quests/annihilator.lua:5: '}' expected (to close '{' at line 1) near 'entry'

[02/09/2010 09:53:49] [Error - Action Interface]
[02/09/2010 09:53:49] data/actions/scripts/liquids/mastermind_potion.lua
[02/09/2010 09:53:50] Description:
[02/09/2010 09:53:50] (luaSetCombatArea) Area not found
 
[02/09/2010 09:53:49] [Error - Action Interface]
[02/09/2010 09:53:49] data/actions/scripts/liquids/mastermind_potion.lua
[02/09/2010 09:53:50] Description:
[02/09/2010 09:53:50] (luaSetCombatArea) Area not found

that's impossible.
 
Oh, it's because it's an action and not a spell. :p
Lua:
local condition = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(condition, CONDITION_PARAM_TICKS, 10 * 60 * 1000) -- 10 minutes
setConditionParam(condition, CONDITION_PARAM_STAT_MAGICLEVEL, 10)
setConditionParam(condition, CONDITION_PARAM_SKILL_SHIELD, -20)
 
local outfit = createConditionObject(CONDITION_OUTFIT)
setConditionParam(outfit, CONDITION_PARAM_TICKS, -1)
addOutfitCondition(outfit, {lookType = 35})
 
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_FIREAREA)
setAttackFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 5, 5, 7, 14)
 
local area = createCombatArea({
	{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
	{0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0},
	{0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0},
	{0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0},
	{0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0},
	{1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1},
	{0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0},
	{0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0},
	{0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0},
	{0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0},
	{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0}
})
setCombatArea(combat, area)

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if(not isSorcerer(cid)) then
		doCreatureSay(cid, "Your elemental power is too low..", TALKTYPE_ORANGE_1, cid)
		return true
	end
 
	if(doCombat(cid, combat, numberToVariant(cid))) then
		doAddCondition(cid, outfit)
		doAddCondition(cid, condition)
		doSendMagicEffect(fromPosition, CONST_ME_MAGIC_RED)
		doRemoveItem(item.uid)
		doCreatureSay(cid, "You have unleashed the demon inside your soul!", TALKTYPE_ORANGE_1, cid)
	end
 
	return true
end
 
Last edited:
Ok so far following works:

+ magic level
- shielding
transforms into a demon

But what does not work:
The combat area with hell's core.

Picture:
9hntbc.png
 
Back
Top