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

[SOLVED] Summon

Skull for summons of monsters or summons of players?
Edit:
Which server version?
 
Last edited:
Question translation maybe.
summon monster for CID to all CID if not in nonpvpzone (regular pvp like pvp.. not protection maybe?)
I'm not a good scripter but that seems like it is what he wants.
 
if cid is XYZ pos? or anywhere? where does this command execute?
add to blank skull Summon monster with utevo res
(add to cid? "skull (Monster name?) skill"utevo res?" utevo res remake.xml In remake.xml allow summoning of IDOFSKULL?
 
In spells.cpp in function "bool InstantSpell::SummonMonster(const InstantSpell* spell, Creature* creature, const std::string& param)" add:
[cpp] if(player->getZone() == ZONE_OPTIONAL)
{
player->sendCancel("You cannot summon creatures in nopvp zones.");
g_game.addMagicEffect(player->getPosition(), MAGIC_EFFECT_POFF);
return false;
}
[/cpp]
before:
[cpp] ReturnValue ret = g_game.placeSummon(creature, param);[/cpp]

After:
[cpp] if(ret == RET_NOERROR)
{[/cpp]

Add:
[cpp] const std::list<Creature*>& summons = player->getSummons();
for(std::list<Creature*>::const_iterator it = summons.begin(); it != summons.end(); ++it)
(*it)->setSkull(SKULL_BLACK);[/cpp]
 
PHP:
bool InstantSpell::SummonMonster(const InstantSpell* spell, Creature* creature, const std::string& param) if(player->getZone() == ZONE_OPTIONAL)
	{
		player->sendCancel("You cannot summon creatures in nopvp zones.");
		g_game.addMagicEffect(player->getPosition(), MAGIC_EFFECT_POFF);
		return false;
	}

- - - Updated - - -

without edited
http://pastebin.com/dib3mSmg
 
before:
[cpp] ReturnValue ret = g_game.placeSummon(creature, param);[/cpp]

Also, you deleted the curly brace { around the function by pasting the code over it.

[cpp]bool InstantSpell::SummonMonster(const InstantSpell* spell, Creature* creature, const std::string& param)
{[/cpp]

So atleast take the time to read the instructions please..
 
Code:
[COLOR=#ff0000]if(player->getZone() == ZONE_OPTIONAL)
    {
        player->sendCancel("You cannot summon creatures in nopvp zones.");
        g_game.addMagicEffect(player->getPosition(), MAGIC_EFFECT_POFF);
        return false;
    }[/COLOR]


    ReturnValue ret = g_game.placeSummon(creature, param);
    if(ret == RET_NOERROR)
    {
[COLOR=#ff0000]        const std::list<Creature*>& summons = player->getSummons();
        for(std::list<Creature*>::const_iterator it = summons.begin(); it != summons.end(); ++it)
        (*it)->setSkull(SKULL_BLACK);[/COLOR]
    
        spell->postSpell(player, (uint32_t)manaCost, (uint32_t)spell->getSoulCost());
        g_game.addMagicEffect(player->getPosition(), MAGIC_EFFECT_WRAPS_BLUE);
        return true;
    }
 
PHP:
spells.cpp: In static member function 'static bool InstantSpell::SummonMonster(const InstantSpell*, Creature*, const std::string&)':
spells.cpp:1285:6: error: 'player' was not declared in this scope
spells.cpp:1296:47: error: 'player' was not declared in this scope
spells.cpp:1300:44: error: 'manaCost' was not declared in this scope
spells.cpp:1348:14: error: redeclaration of 'ReturnValue ret'
spells.cpp:1293:17: error: 'ReturnValue ret' previously declared here
make[1]: ** [spells.o] Erro 1

- - - Updated - - -

bump
 
Change:
[cpp]for(std::list<Creature*>::const_iterator it = summons.begin(); it != summons.end(); ++it)
(*it)->setSkull(SKULL_BLACK);[/cpp]

To:
[cpp]
for(std::list<Creature*>::const_iterator it = summons.begin(); it != summons.end(); ++it)
{
(*it)->setSkull(SKULL_BLACK);
g_game.updateCreatureSkull((*it));
}
[/cpp]
 
Back
Top