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

Magic Wall request...

kito2

www.masteria.net
Joined
Mar 9, 2009
Messages
3,764
Solutions
1
Reaction score
227
Location
Chile, Santiago
Hi there, I would like to modify the magic wall and make it like:
If you use it, you can enter to protection zone, but you will get X of attacking monsters (not players).


PD: agressive = "0" doesn't works like that.
 
You must edit sources. http://otland.net/f16/magic-wall-63953/index2.html
Code:
void Combat::combatTileEffects(const SpectatorVec& list, Creature* caster, Tile* tile, const CombatParams& params)
{
	if(params.itemId)
	{
		Player* player = NULL;
		if(caster)
		{
			if(caster->getPlayer())
				player = caster->getPlayer();
			else if(caster->isPlayerSummon())
				player = caster->getPlayerMaster();
		}

		uint32_t itemId = params.itemId;
		if(player)
		{
			bool [B][COLOR="Red"]pzLock[/COLOR][/B] = false;
			if(g_game.getWorldType() == WORLD_TYPE_NO_PVP || tile->hasFlag(TILESTATE_NOPVPZONE))
			{
				switch(itemId)
				{
					case ITEM_FIREFIELD:
						itemId = ITEM_FIREFIELD_SAFE;
						break;
					case ITEM_POISONFIELD:
						itemId = ITEM_POISONFIELD_SAFE;
						break;
					case ITEM_ENERGYFIELD:
						itemId = ITEM_ENERGYFIELD_SAFE;
						break;
					case ITEM_MAGICWALL:
						itemId = ITEM_MAGICWALL_SAFE;
						break;
					case ITEM_WILDGROWTH:
						itemId = ITEM_WILDGROWTH_SAFE;
						break;
					default:
						break;
				}
			}
			else if(params.isAggressive && !Item::items[itemId].blockPathFind)
				[B][COLOR="Red"]pzLock[/COLOR][/B] = true;

			player->addInFightTicks([COLOR="Red"][B]pzLock[/B][/COLOR]);
		}

		if(Item* item = Item::CreateItem(itemId))
		{
			if(caster)
				item->setOwner(caster->getID());

			if(g_game.internalAddItem(caster, tile, item) == RET_NOERROR)
				g_game.startDecay(item);
			else
				delete item;
		}
	}

	if(params.tileCallback)
		params.tileCallback->onTileCombat(caster, tile);

	if(params.effects.impact != MAGIC_EFFECT_NONE && (!caster || !caster->isGhost()
		|| g_config.getBool(ConfigManager::GHOST_SPELL_EFFECTS)))
		g_game.addMagicEffect(list, tile->getPosition(), params.effects.impact);
}
I doubt it's this, though.
 
maybe he tried /i magic wall :p (it gets removed then because of movement)
LUA:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGY)

function onCastSpell(cid, var)
	doDecayItem(doCreateItem(1497, 1, variantToPosition(var)))
	return doCombat(cid, combat, var)
end
 
maybe he tried /i magic wall :p (it gets removed then because of movement)
LUA:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGY)

function onCastSpell(cid, var)
	doDecayItem(doCreateItem(1497, 1, variantToPosition(var)))
	return doCombat(cid, combat, var)
end

True....:$
 
I changed it, but it still gives you the red X :S

dibujoifx.jpg


PS: Also reloaded spells.
 
Using rev? 0.4 8.6? which items.otb? Which item editor?

Could you give me the link for the item editor, cause I have one that f*ck up server when try to run.
 
Last edited:
Back
Top