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

Solved Need help to solve bugs on two monsterspells

Status
Not open for further replies.

Sentielo

Advanced OT User
Joined
Feb 3, 2008
Messages
2,388
Reaction score
226
Location
I am from Holland, where the fack you from :)
Hello,

I have got some spells which aren't working (properly).
I hope somebody would be able to help me fixing them.

Info
-The bold letters tells what the spells should do
-Between code tags shows the current script
-Italic letter shows what it currently do

Sharpshooter Smoke Wave (reduces your Distance Skill 60%-75% for 20 seconds)
Code:
local condition, combat = {}, {}

for i = -75, -60 do
	combat[i] = createCombatObject()
	setCombatParam(combat[i], COMBAT_PARAM_EFFECT, CONST_ME_POFF)
	condition[i] = createConditionObject(CONDITION_ATTRIBUTES)
	setConditionParam(condition[i], CONDITION_PARAM_TICKS, 20000)
	setConditionParam(condition[i], CONDITION_PARAM_SKILL_DISTANCEPERCENT, i)
	setCombatCondition(combat[i], condition[i])
	setCombatArea(combat[i], createCombatArea(AREA_SQUAREWAVE5, AREADIAGONAL_SQUAREWAVE5))
end

function onCastSpell(cid, var)
	return doCombat(cid, combat[-math.random(60, 75)], var)
end
It works, but it removes between 60 or 75 skill insteed of percentage.

Summons 8 Slimes at once
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_BLUESHIMMER)
setCombatArea(combat, area)

local maxsummons = 8

function onCastSpell(cid, var)
	local summoncount = getCreatureSummons(cid)
	if #summoncount < 8 then
		for i = 1, maxsumons - #summoncount do
			doConvinceCreature(cid, doSummonCreature("Slime", getCreaturePosition(cid)))
		end
	end
	return doCombat(cid, combat, var)
end
Containing this error report:
gPQcI.png
 
Last edited by a moderator:
2nd
Code:
local maxsummons = 8


function onCastSpell(cid, var)
	if table.getn(getCreatureSummons(cid)) >= maxsummons then
		return false
	end
	
	for i = 1, maxsummons do
		local mid = doCreateMonster("Slime", getThingPos(cid))
		if isCreature(mid) then
			doConvinceCreature(cid, mid)
			doSendMagicEffect(getThingPos(mid), CONST_ME_BLUESHIMMER)
		end
	end	
	return true
end
 
CONDITION_PARAM_SKILL_DISTANCEPERCENT 100 <- this will set your dist to 100% of actual
120 <- this will increasa actual skill by 20%
math.random(25, 40) <- this will reduce your dist skill by 60-75%
 
Status
Not open for further replies.
Back
Top