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

Linux Special area summon

Calon

Experienced Member
Joined
Feb 6, 2009
Messages
1,070
Reaction score
21
how to turn false the summons using utevo res spell in special area ? i can't find the lua spells script its hidden
is it c++ ?
 
It would require changes within "bool InstantSpell::SummonMonster(const InstantSpell* spell, Creature* creature, const std::string& param)" in spells.cpp.
 
PHP:
bool InstantSpell::SummonMonster(const InstantSpell* spell, Creature* creature, const std::string& param)
{
        Player* player = creature->getPlayer();
        if(!player)
                return false;

        if(!Position::areInRange(player->getPosition(), Position(100, 100, 7), Position(200, 200, 7)))
        {
            player->sendCancelMessage(RET_NOTPOSSIBLE);
            g_game.addMagicEffect(player->getPosition(), MAGIC_EFFECT_POFF);
            return false;
        }

        MonsterType* mType = g_monsters.getMonsterType(param);
        if(!mType)
        {
                player->sendCancelMessage(RET_NOTPOSSIBLE);
                g_game.addMagicEffect(player->getPosition(), MAGIC_EFFECT_POFF);
                return false;
        }

        int32_t manaCost = (int32_t)(mType->manaCost * g_config.getDouble(ConfigManager::RATE_MONSTER_MANA));
        if(!player->hasFlag(PlayerFlag_CanSummonAll))
        {
                if(player->getSkull() == SKULL_BLACK)
                {
                        player->sendCancelMessage(RET_NOTPOSSIBLE);
                        g_game.addMagicEffect(player->getPosition(), MAGIC_EFFECT_POFF);
                        return false;
                }

                if(!mType->isSummonable)
                {
                        player->sendCancelMessage(RET_NOTPOSSIBLE);
                        g_game.addMagicEffect(player->getPosition(), MAGIC_EFFECT_POFF);
                        return false;
                }

                if(player->getMana() < manaCost)
                {
                        player->sendCancelMessage(RET_NOTENOUGHMANA);
                        g_game.addMagicEffect(player->getPosition(), MAGIC_EFFECT_POFF);
                        return false;
                }

                if((int32_t)player->getSummonCount() >= g_config.getNumber(ConfigManager::MAX_PLAYER_SUMMONS))
                {
                        player->sendCancel("You cannot summon more creatures.");
                        g_game.addMagicEffect(player->getPosition(), MAGIC_EFFECT_POFF);
                        return false;
                }
        }

        ReturnValue ret = g_game.placeSummon(creature, param);
        if(ret == RET_NOERROR)
        {
                spell->postSpell(player, (uint32_t)manaCost, (uint32_t)spell->getSoulCost());
                g_game.addMagicEffect(player->getPosition(), MAGIC_EFFECT_WRAPS_BLUE);
                return true;
        }

        player->sendCancelMessage(ret);
        g_game.addMagicEffect(player->getPosition(), MAGIC_EFFECT_POFF);
        return false;
}
 
This script work god :D , if anyone sees any errors .. or what would be better haha can improve, but it works =)

talkactions..
<talkaction log="no" access="0-3" words="utevo res" filter="word-spaced" event="script" value="nosumon.lua"/>

local t = {
serpent = {x=115, y=123, z=7},
serpentto = {x=151, y=159, z=7},
zombie = {x=100, y=179, z=6},
zombieto = {x=128, y=208, z=6},
pacman = {x=32282, y=32886, z=6},
pacmanto = {x=32289, y=32895, z=6},
bomber = {x=32156, y=32549, z=6},
bomberto = {x=32165, y=32570, z=6},
ping = {x=32521, y=32780, z=6},
pingto = {x=32539, y=32787, z=6}
}

function onSay(cid, words, param, channel)
if isPlayer(cid) and isInRange(getThingPos(cid), t.serpent, t.serpentto) or isPlayer(cid) and isInRange(getThingPos(cid), t.zombie, t.zombieto) or isPlayer(cid) and isInRange(getThingPos(cid), t.pacman, t.pacmanto) then

if(param == "utevo res") then
doPlayerSendCancel(cid, "You can't using this spell here.")

end
return true
end
end
 
Back
Top