Skip to content
This repository has been archived by the owner on May 11, 2023. It is now read-only.

poison gas #6

Closed
ghost opened this issue Jan 25, 2019 · 5 comments
Closed

poison gas #6

ghost opened this issue Jan 25, 2019 · 5 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@ghost
Copy link

ghost commented Jan 25, 2019

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

@Ezzz-dev Ezzz-dev added enhancement New feature or request good first issue Good for newcomers labels Jan 25, 2019
@mr0lo
Copy link

mr0lo commented Apr 15, 2019

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

@ghost
Copy link
Author

ghost commented Apr 16, 2019

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)

@andreaslif
Copy link

andreaslif commented Jul 6, 2020

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!

@ghost ghost closed this as completed Jul 16, 2021
@waqmaz93
Copy link

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

@waqmaz93
Copy link

waqmaz93 commented Feb 11, 2022

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

This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

4 participants