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

7th basic attack = headshot 30% more damage

breadmaker

New Member
Joined
Jul 16, 2010
Messages
160
Reaction score
3
Hello.
I working on my custom zombie server and i have custom profession i want set him attribute like that:
After 7th shot, next shot will dealing 30% more damage after the 30% better shot "headshot" the counter is going to next 7th shot and next 30% damage and repeat - only in that profession.

Anyone can help me with that ?
 
Untested, but might work not sure never done this before.. although i set it to last 5 seconds when they get the +30% you can change that.

LUA:
function onAttack(cid, target)
 
local t = {
	profession = 1337, -- storage of profression
	statchange = 1338, -- storage to store attacks
	displayCharges = true -- display message of their charge? 
	}
 
local conditions = {
		local knight = createConditionObject(CONDITION_ATTRIBUTES),
					   setConditionParam(condition, CONDITION_PARAM_TICKS, 5000),
					   setConditionParam(condition, CONDITION_PARAM_SKILL_MELEEPERCENT, 130),
					   setConditionParam(condition, CONDITION_PARAM_BUFF, true),
 
		local paladin = createConditionObject(CONDITION_ATTRIBUTES),
					    setConditionParam(condition, CONDITION_PARAM_TICKS, 5000),
					    setConditionParam(condition, CONDITION_PARAM_SKILL_DISTANCEPERCENT, 130),
					    setConditionParam(condition, CONDITION_PARAM_BUFF, true),
 
		local mage = createConditionObject(CONDITION_ATTRIBUTES),
					 setConditionParam(condition, CONDITION_PARAM_TICKS, 5000),
				     setConditionParam(condition, CONDITION_PARAM_SKILL_MAGICPERCENT, 130),
					 setConditionParam(condition, CONDITION_PARAM_BUFF, true)
		}
 
if getPlayerStorageValue(cid, t.profression) == 1 and getPlayerStorageValue(cid, t.statchange) < 7 then
	setPlayerStorageValue(cid, t.statchange, (getPlayerStorageValue(cid, t.statchange)) + 1)
		if t.displayCharges = true then
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You currently have "..t.statchange.." charged!")
else
	return true
end
 
if getPlayerStorageValue(cid, t.statchange) > 7 then 
	if isKnight(cid) then
		setCombatCondition(combat, conditions.knight)
			setPlayerStorageValue(cid, t.statchange, 1)
	else
	if isDruid(cid) or isSorcerer(cid)
		setCombatCondition(combat, conditions.mage)
			setPlayerStorageValue(cid, t.statchange, 1)
	else
		if isPaladin(cid) then
			setCombatCondition(combat, conditions.paladin)
				setPlayerStorageValue(cid, t.statchange, 1)
					end
				end
			end
		end
	end
end
 
Last edited:
Untested, but might work not sure never done this before.. although i set it to last 5 seconds when they get the +30% you can change that.

LUA:
function onAttack(cid, target)
 
local t = {
	profession = 1337, -- storage of profression
	statchange = 1338, -- storage to store attacks
	displayCharges = true -- display message of their charge? 
	}
 
local conditions = {
		local knight = createConditionObject(CONDITION_ATTRIBUTES),
					   setConditionParam(condition, CONDITION_PARAM_TICKS, 5000),
					   setConditionParam(condition, CONDITION_PARAM_SKILL_MELEEPERCENT, 130),
					   setConditionParam(condition, CONDITION_PARAM_BUFF, true),
 
		local paladin = createConditionObject(CONDITION_ATTRIBUTES),
					    setConditionParam(condition, CONDITION_PARAM_TICKS, 5000),
					    setConditionParam(condition, CONDITION_PARAM_SKILL_DISTANCEPERCENT, 130),
					    setConditionParam(condition, CONDITION_PARAM_BUFF, true),
 
		local mage = createConditionObject(CONDITION_ATTRIBUTES),
					 setConditionParam(condition, CONDITION_PARAM_TICKS, 5000),
				     setConditionParam(condition, CONDITION_PARAM_SKILL_MAGICPERCENT, 130),
					 setConditionParam(condition, CONDITION_PARAM_BUFF, true)
		}
 
if getPlayerStorageValue(cid, t.profression) == 1 and getPlayerStorageValue(cid, t.statchange) < 7 then
	setPlayerStorageValue(cid, t.statchange, (getPlayerStorageValue(cid, t.statchange)) + 1)
		if t.displayCharges = true then
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You currently have "..t.statchange.." charged!")
else
	return true
end
 
if getPlayerStorageValue(cid, t.statchange) > 7 then 
	if isKnight(cid) then
		setCombatCondition(combat, conditions.knight)
			setPlayerStorageValue(cid, t.statchange, 1)
	else
	if isDruid(cid) or isSorcerer(cid)
		setCombatCondition(combat, conditions.mage)
			setPlayerStorageValue(cid, t.statchange, 1)
	else
		if isPaladin(cid) then
			setCombatCondition(combat, conditions.paladin)
				setPlayerStorageValue(cid, t.statchange, 1)
					end
				end
			end
		end
	end
end
Why don't you use elfeif's instead :p
 
[Error - CreatureScript Interface]
data/creaturescripts/scripts/test.lua:onAttack
Description:
(luaSetConditionParam) This function can only be used while loading the script.

When I trying attack without required vocation and if i attack on required vocation.
 
Back
Top