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

Lua Magic Wall

Status
Not open for further replies.

God Iriana

Banned User
Joined
Jan 8, 2010
Messages
34
Reaction score
0
Im using tfs 0.3.6 pl1 and got a problem with magic wall, also when you use magic wall rune then it makes you pz...
anyone know how to fix this?:thumbup:
 
can you paste this script of magic wall? I have tfs 0.3.6 and I think (but I'm not sure) that magic wall doesn't make pz ;s
I know, that on real tibia it doesn't do pz

#

check in data\spells file spells.xml line magic wall rune.
if it looks so:
Code:
	<rune name="Magic Wall" id="2293" allowfaruse="1" charges="3" lvl="32" maglv="9" exhaustion="2000" blocktype="all" event="script" value="support/magic wall rune.lua"/>
i dnot think that it make pz. If you have somewhere in this line
Code:
aggressive="1"
change it to
Code:
aggressive="0"
If you dont have this and magic wall still is making pz, try add yto magic wall rune line
Code:
aggressive="0"
 
Last edited:
this is how i got it,
Code:
	<rune name="Magic Wall" id="2293" allowfaruse="1" charges="3" lvl="32" maglv="9" exhaustion="2000" aggressive="0"
 blocktype="all" event="script" value="support/magic wall rune.lua"/>

still making me pz so i cant enter pz zones...:ninja:

magicwall.lua:
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGY)
setCombatParam(combat, COMBAT_PARAM_CREATEITEM, 1497)

function onCastSpell(cid, var)
	return doCombat(cid, combat, var)
end
 
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGY)
setCombatParam(combat, COMBAT_PARAM_CREATEITEM, 1497)

function onCastSpell(cid, var)
	return doCombat(cid, combat, var)
end
 
Maybe it's in the sources [I doubt it], but try this

LUA:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGY)
setCombatParam(combat, COMBAT_PARAM_CREATEITEM, 1497)

function onCastSpell(cid, var)
	return doCombat(cid, combat, var)
        doRemoveCondition(cid, CONDITION_INFIGHT)
end
 
Maybe it's in the sources [I doubt it], but try this

LUA:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGY)
setCombatParam(combat, COMBAT_PARAM_CREATEITEM, 1497)

function onCastSpell(cid, var)
	return doCombat(cid, combat, var)
        doRemoveCondition(cid, CONDITION_INFIGHT)
end
Code:
input:7: 'end' expected (to close 'function' at line 5) near 'doRemoveCondition'
:D
You cant make functions after you already returned something in the same scope.
 
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.
 
Than the bug would be on every rune right?

Mayby it's with the blockPathFind and blocktype="all"
Code:
			else if(params.isAggressive && !Item::items[itemId].blockPathFind)
				[B][COLOR="Red"]pzLock[/COLOR][/B] = true;

Code:
	<rune name="Magic Wall" id="2293" allowfaruse="1" charges="3" lvl="32" maglv="9" exhaustion="2000" [B]blocktype="all"[/B] event="script" value="support/magic wall rune.lua"/>
 
Last edited:
Status
Not open for further replies.
Back
Top