• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

Spell [TFS 1.x] Unsummon

BboyChaos

Member
Joined
May 20, 2014
Messages
10
Reaction score
7
Code:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
combat:setParameter(COMBAT_PARAM_AGGRESSIVE, 0)

function onCastSpell(cid, var)

  local player = Player(cid)
  local player_summons = player:getSummons()

  if not next(player_summons) then
    player:getPosition():sendMagicEffect(CONST_ME_POFF)
    player:sendCancelMessage("You don't have any summons.")
    return false
  end

  for i = 1, #player_summons do
    local target_summon = player_summons[i] -- targetSummons
    target_summon:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
    target_summon:remove()
    player:sendCancelMessage("Your summon has been unsummoned.")
  end

  return combat:execute(cid, var)
end
 
Back
Top