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

[Request] A wand to summon a Monster

Black_Mamba

Dance To the Mamba
Joined
May 8, 2011
Messages
3
Reaction score
0
hey there i am trying to make a want to summon a monster that attack with the play for x amount of time the wand change of summoning the the monster should be mlvl/1.5 any one can help would be appreciated
 
XML:
<wand id="7735" level="100" mana="50" event="script" value="spellwand.lua"/>
LUA:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_HOLYDAMAGE)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_HOLY)

local t = {
	name = 'Water Elemental',
	max = 2,
	time = 30
}

local f = function(cid)
	if isCreature(cid) then
		doSendMagicEffect(getThingPos(cid), CONST_ME_ENERGYHIT)
		doRemoveCreature(cid)
	end
end

function onGetFormulaValues(cid, level, maglevel)
	if math.random(100) <= maglevel / 1.5 then
		local n = #getCreatureSummons(cid)
		if n < t.max and doSummonMonster(cid, t.name) == RETURNVALUE_NOERROR then
			addEvent(f, t.time * 1000, getCreatureSummons(cid)[n + 1])
		end
	end
	return -105, -133
end
setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, 'onGetFormulaValues')

function onUseWeapon(cid, var)
	return doCombat(cid, combat, var)
end
 
Back
Top