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

Remove mana without message

The text will only showup if you add something like

Code:
doSendAnimatedText(playerPos, 'You loose 100 mana.', TEXTCOLOR_GOLD)

So no text should showup unless your script has this inside, if it does remove that line.


//Massen
 
PHP:
	if param.noHits == 0 then
		doPlayerAddMana(param.cid, param.manacost)
		doCombat(param.cid, param.combat, param.var)
		param.noHits = param.noHits+1
		addEvent(divineVolley, param.shootInterval, param)

Is my code. There is no doSendText :(
I'm using Mystic Spirit if that helps.
 
PHP:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, 39)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, 30)

function finalDamage(cid)
	local isPlayer = isPlayer(getCreatureTarget(cid))
    local magicLevel = getPlayerMagLevel(cid)
	local level = getPlayerLevel(cid)
	local distSkill = getPlayerSkill(cid, 4)
    local damage = -(distSkill+magicLevel+level)/2 -- Damage formula
	if isPlayer == 1 then damage = damage*0.50 end -- 75% damage against players
    return damage*0.7, damage
end

setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, "finalDamage")

function divineVolley(param)
	local nowHit = 0
	local randomId = 0
	local currentPos = getCreaturePosition(param.cid)
	local pzd = getTilePzInfo(currentPos)
	
	if pzd == 0 and getPlayerMana(param.cid) ~= 0 then
	if param.noHits == 0 then
		doPlayerAddMana(param.cid, param.manacost)
		doCombat(param.cid, param.combat, param.var)
		param.noHits = param.noHits+1
		addEvent(divineVolley, param.shootInterval, param)
		
	elseif (#param.otherTargets ~= 0 and param.noHits <param.maxHits) then
		randomId = math.random(1,#param.otherTargets)
		nowHit = param.otherTargets[randomId]
		
		doPlayerAddMana(param.cid, param.manacost)
		doCombat(param.cid, param.combat, numberToVariant(nowHit))
		param.noHits = param.noHits+1
		addEvent(divineVolley, param.shootInterval, param)
	end
	end
	
end
	
	
function onCastSpell(cid, var)
	local storevalue = 2900 -- value where exhausted is saved
	local exhausttime = 7 -- exhaustion 
	
	local maxHits = 40 --Shots that will be fired
	local noHits = 0
	local shootInterval = 200 --Time between shots in milliseconds
	
	local radiusx = 4 --Radius
	local radiusy = 4 --Radius
	local manacost = (getPlayerMaxMana(cid)*0.75)*(1/maxHits) -- 75% of max mana to complete all shots
	local hitplayers = 0
	
	local target = getCreatureTarget(cid)	

	
	if (target ~=0) then
		if (isPlayer(target) == TRUE) then
			hitplayers = 1
		end
	end
	
	local otherTargets = getCreaturesInRange(getCreaturePosition(cid), radiusx, radiusy, 1, hitplayers)
		
	local param = {	maxHits = maxHits,
								noHits = noHits,
								shootInterval = shootInterval,
								manacost = manacost,
								target = target,
								otherTargets = otherTargets,
								cid = cid,
								combat = combat,
								var = var }
								
	if #otherTargets > 0 then
		if(exhaust(cid, storevalue, exhausttime) == 1) then
			addEvent(divineVolley, 0, param)
		else
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_SMALL, "Spirit volley is cooling down!")
		return 1
		end
	else
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_SMALL, "No targets in range!")
	end

end

Oh I updated to the new Mystic Spirit. Talaturen mentioned something about changing the mana function. Would that help?
 
Yes, because he added new parameter 'animationOnLoss', which you are looking for.

so

doPlayerAddMana(param.cid, param.manacost, FALSE)
 
Back
Top