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

SCRIPT: Basic question [SOLVED]

Xapuur

New Member
Joined
Sep 15, 2009
Messages
157
Reaction score
0
Location
Chile
Hello. I have doubts about basic scripting:

Where i can see ALL the functions of my server? (actions, movements, spells, etc)
Where i can see the words that i have to use for actions.xml, talkactions.xml, movement.xml, etc?

This is my first script (when you inside on X, you dead)
Code:
function onStepIn(cid, item, position, fromPosition)
	if item.actionid = 10500 then
		doCreatureAddHealth(cid,-10000)
	end
end

movements.xml
Code:
<movevent event="StepIn" actionid="10500" script="inqdead.lua"/>

And not works. What i am doing bad?

Thanks !
 
Last edited:
Try with this on movements.xml:
<movevent type="StepIn" actionid="10500" event="script" value="inqdead.lua"/>

And I make your script better, cause with yours, if a player has more than 10.000 hp, he will not die:
Code:
function onStepIn(cid, item, position, fromPosition)
	if item.actionid = 10500 then
		doCreatureAddHealth(cid,-(getCreatureHealth(cid)))
	end
end
 
Yep, try with this:
Code:
function onStepIn(cid, item, position, fromPosition)
	if item.actionid = 10500 then
		doCreatureAddHealth(cid,-(getCreatureHealth(cid)))
                doSendMagicEffect(getCreaturePosition(cid), CONST_ME_DRAWBLOOD)
	end
end
 
Isn't that effect. When you step in a hole (id1512) it takes away a bit of life to you with a blood hit, that's the effect I'm talking about. Because when you stand on the square of the actionid 10500, remove the life as if nothing ..
 
Lua:
function onStepIn(cid, item, position, fromPosition)
	local h = -getCreatureHealth(cid)
	doTargetCombatHealth(0, cid, COMBAT_PHYSICALDAMAGE, h, h, CONST_ME_NONE)
end
 
Aff.. i find a bug. If a druid enters with utamo vita, only takes the amount of life to your mana, without killing.

Regards..
 
Mmm... Yep...
So this should work, but will lose mana too:
Code:
function onStepIn(cid, item, position, fromPosition)
	local h = -getCreatureHealth(cid)
        local m = -getCreatureMana(cid)
	doTargetCombatHealth(0, cid, COMBAT_PHYSICALDAMAGE, h + m, h + m, CONST_ME_NONE)
end
 
I don't appears the effect of the blood hit
03.jpg
14.jpg

7.jpg
jh3.jpg
 
Thanks Dantarrix. It's works fine, this is the final script:
Code:
function onStepIn(cid, item, position, fromPosition)
	local h = -getCreatureHealth(cid)
        local m = -getPlayerMaxMana(cid)
	doTargetCombatHealth(0, cid, COMBAT_PHYSICALDAMAGE, h + m, h + m, CONST_ME_NONE)
end
 
Back
Top