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

selfGoToPosition, rem corpse

Dominik ms

Member
Joined
Jan 20, 2010
Messages
424
Reaction score
6
1.hello, is possible this script for monster and players?? Look like this:

PHP:
function onUse(cid, item, fromPosition, itemEx, toPos)
pos = {x=getCreaturePosition(cid).x +3, y=getCreaturePosition(cid).y, z=getCreaturePosition(cid).z}
selfGoToPosition(cid, pos)

2. How to remove corpse for my summons?? If my summon is dying then dont have corpse
 
PHP:
  In static member function `static bool InstantSpell::SummonMonster(const InstantSpell*, Creature*, const std::string&)': 
'const class InstantSpell' has no member named 'postSpell' 
[Build Error]  [obj-console//spells.o] Error 1

nope ;/
 
PHP:
  In static member function `static bool InstantSpell::SummonMonster(const InstantSpell*, Creature*, const std::string&)': 
'const class InstantSpell' has no member named 'postSpell' 
[Build Error]  [obj-console//spells.o] Error 1

nope ;/
Code:
bool InstantSpell::SummonMonster(const InstantSpell* spell, Creature* creature, const std::string& param)
{
	Player* player = creature->getPlayer();
	if(!player)
		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->[B][COLOR="Red"]postCast[/COLOR][/B]Spell(player, (uint32_t)manaCost, (uint32_t)spell->getSoulCost());
		g_game.addMagicEffect(player->getPosition(), MAGIC_EFFECT_WRAPS_BLUE);
		creature->registerCreatureEvent("NoCorpse");
		return true;
	}

	player->sendCancelMessage(ret);
	g_game.addMagicEffect(player->getPosition(), MAGIC_EFFECT_POFF);
	return false;
}
 
Back
Top