Ezzz-dev/Nostalrius

poison gas

Closed this issue ยท 5 comments

missing poison effect when step into the field

also for wall, bomb runes, there should only be a hit effect on the targets, not around
https://i.imgur.com/cb0qQC3.png

mr0lo commented

I fixed it.

In movements.xml change this line:

<movevent event="StepIn" itemid="2121" function="onStepInField" />
to
<movevent event="StepIn" itemid="2121" script="misc/poison_effect.lua" />

<movevent event="StepIn" itemid="2127" function="onStepInField" />
to
<movevent event="StepIn" itemid="2127" script="misc/poison_effect.lua" />

<movevent event="StepIn" itemid="2134" function="onStepInField" />
to
<movevent event="StepIn" itemid="2134" script="misc/poison_effect.lua" />

and add in misc "poison_effect.lua"

local poison = Condition(CONDITION_POISON)
poison:setTiming(100)

function onStepIn(creature, item, position)
	if item:getId() == 2134 then
		creature:addCondition(poison)
		position:sendMagicEffect(8)
	elseif item:getId() == 2121 or item:getId() == 2127 then
		creature:addCondition(poison)
		position:sendMagicEffect(9)
	end
end

it's simple, but works :P

FIX FOR THIS ISSUE

thanks to @renanluis90

combat.cpp

void MagicField::onStepInField(Creature* creature)

if (id == ITEM_POISONFIELD_PVP || id == ITEM_POISONFIELD_PERSISTENT || id == ITEM_POISONFIELD_NOPVP) {
		g_game.addMagicEffect(creature->getPosition(), CONST_ME_GREEN_RINGS);
	}

and remove from all poison runes

combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_GREEN_RINGS)

I fixed it.

In movements.xml change this line:

<movevent event="StepIn" itemid="2121" function="onStepInField" />
to
<movevent event="StepIn" itemid="2121" script="misc/poison_effect.lua" />

<movevent event="StepIn" itemid="2127" function="onStepInField" />
to
<movevent event="StepIn" itemid="2127" script="misc/poison_effect.lua" />

<movevent event="StepIn" itemid="2134" function="onStepInField" />
to
<movevent event="StepIn" itemid="2134" script="misc/poison_effect.lua" />

and add in misc "poison_effect.lua"

local poison = Condition(CONDITION_POISON)
poison:setTiming(100)

function onStepIn(creature, item, position)
	if item:getId() == 2134 then
		creature:addCondition(poison)
		position:sendMagicEffect(8)
	elseif item:getId() == 2121 or item:getId() == 2127 then
		creature:addCondition(poison)
		position:sendMagicEffect(9)
	end
end

it's simple, but works :P

Works for me, thanks!

You cannot do it in lua as lua stops the c++ code and it causes large critical bugs with getting skulls and player killing by fields in general

I fixed it.
In movements.xml change this line:
<movevent event="StepIn" itemid="2121" function="onStepInField" />
to
<movevent event="StepIn" itemid="2121" script="misc/poison_effect.lua" />
<movevent event="StepIn" itemid="2127" function="onStepInField" />
to
<movevent event="StepIn" itemid="2127" script="misc/poison_effect.lua" />
<movevent event="StepIn" itemid="2134" function="onStepInField" />
to
<movevent event="StepIn" itemid="2134" script="misc/poison_effect.lua" />
and add in misc "poison_effect.lua"

local poison = Condition(CONDITION_POISON)
poison:setTiming(100)

function onStepIn(creature, item, position)
	if item:getId() == 2134 then
		creature:addCondition(poison)
		position:sendMagicEffect(8)
	elseif item:getId() == 2121 or item:getId() == 2127 then
		creature:addCondition(poison)
		position:sendMagicEffect(9)
	end
end

it's simple, but works :P

Works for me, thanks!

lua causes bugs with player killing due to fields... you need to use c++ code