• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Lua To much mlvl-exp

vTune

KakelmästareN^
Joined
Jun 14, 2012
Messages
3,675
Reaction score
395
Location
Sweden
Hello there otlander!

So here's my problem I just finished my first spell script witch I ofcurse wanna use in my server but there's a tiny problem the spell gives too much mlvl exp or w/e its called.

So how do I change it so when you use the spell it gives less exp

Heres the script:

PHP:
[PHP]-- SpellCreator generated.

-- =============== COMBAT VARS ===============
-- Areas/Combat for 0ms
local combat0_exevo_meg_mas_san = createCombatObject()
setCombatParam(combat0_exevo_meg_mas_san, COMBAT_PARAM_EFFECT, CONST_ME_YELLOWENERGY)
setCombatParam(combat0_exevo_meg_mas_san, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SMALLHOLY)
setCombatParam(combat0_exevo_meg_mas_san, COMBAT_PARAM_TYPE, COMBAT_HOLYDAMAGE)
setCombatArea(combat0_exevo_meg_mas_san,createCombatArea({{0, 0, 0, 1, 0, 0, 0},
{0, 0, 1, 0, 1, 0, 0},
{0, 1, 0, 1, 0, 1, 0},
{1, 0, 1, 2, 1, 0, 1},
{0, 1, 0, 1, 0, 1, 0},
{0, 0, 1, 0, 1, 0, 0},
{0, 0, 0, 1, 0, 0, 0}}))
function getDmg_exevo_meg_mas_san(cid, level, maglevel)
	return (300)*-1,(800)*-1 
end
setCombatCallback(combat0_exevo_meg_mas_san, CALLBACK_PARAM_LEVELMAGICVALUE, "getDmg_exevo_meg_mas_san")
local dfcombat0_exevo_meg_mas_san = {CONST_ANI_HOLY,0,1,1,0,0,-1,-1,0,-1,2,-2,1,-2,-1,-1,-2,1,-2,1,2,2,1,2,-1,0,-3,0,3,3,0,-3,0}

-- Areas/Combat for 900ms
local combat9_exevo_meg_mas_san = createCombatObject()
setCombatParam(combat9_exevo_meg_mas_san, COMBAT_PARAM_EFFECT, CONST_ME_YELLOWENERGY)
setCombatParam(combat9_exevo_meg_mas_san, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SMALLHOLY)
setCombatParam(combat9_exevo_meg_mas_san, COMBAT_PARAM_TYPE, COMBAT_HOLYDAMAGE)
setCombatArea(combat9_exevo_meg_mas_san,createCombatArea({{0, 0, 1, 0, 0},
{0, 1, 0, 1, 0},
{1, 0, 2, 0, 1},
{0, 1, 0, 1, 0},
{0, 0, 1, 0, 0}}))
function getDmg_exevo_meg_mas_san(cid, level, maglevel)
	return (300)*-1,(800)*-1 
end
setCombatCallback(combat9_exevo_meg_mas_san, CALLBACK_PARAM_LEVELMAGICVALUE, "getDmg_exevo_meg_mas_san")
local dfcombat9_exevo_meg_mas_san = {CONST_ANI_HOLY,2,0,1,1,0,2,-1,1,-1,-1,1,-1,0,-2,-2,0}

-- =============== CORE FUNCTIONS ===============
local function RunPart(c,cid,var,dirList,dirEmitPos) -- Part
	if (isCreature(cid)) then
		doCombat(cid, c, var)
		if (dirList ~= nil) then -- Emit distance effects
			local i = 2;
			while (i < #dirList) do
				doSendDistanceShoot(dirEmitPos,{x=dirEmitPos.x-dirList[i],y=dirEmitPos.y-dirList[i+1],z=dirEmitPos.z},dirList[1])
				i = i + 2
			end		
		end
	end
end

function onCastSpell(cid, var)
	local startPos = getCreaturePosition(cid)
	RunPart(combat0_exevo_meg_mas_san,cid,var,dfcombat0_exevo_meg_mas_san,startPos)
	addEvent(RunPart,900,combat9_exevo_meg_mas_san,cid,var,dfcombat9_exevo_meg_mas_san,startPos)
	return true
end
[/PHP]

Kind regards vTune
 
I just thought that there were any better solution then the fking mana. Thats totally retarded.

Well thanks for the answer Iceroxor
 
It cost like 1200. And I got 80x magic rate.

Lowered the mana cost to 400 and it worked better but I still whant the spell to cost like 1200 but it gives way to much mlvl.

23487392.jpg


Well I guess if you spent thrice the mana you deserve to get thrice the mana spent..
If a player casts the spell thrice with 400 manacost he will get the same mana spent anyway and has much better hunting..
 
It's because of your magic rate.

Right now it's like you're wasting 96 000 mana when casting that spell if you compare it to 1x rate.
 
Did you try this yet with 1200 mana?

LUA:
function onCastSpell(cid, var) 
    local startPos = getCreaturePosition(cid) 
    RunPart(combat0_exevo_meg_mas_san,cid,var,dfcombat0_exevo_meg_mas_san,startPos) 
    addEvent(RunPart,900,combat9_exevo_meg_mas_san,cid,var,dfcombat9_exevo_meg_mas_san,startPos) 
    doPlayerAddSpentMana(cid, -800)
    return true 
end

Might work.
 
Back
Top