Jump to content

(Resolvido)Script Bugado.


Go to solution Solved by Storm,

Recommended Posts

Olá uso esse script, como uma arma de exercício no meu otserver.

Porem se player der alguma magia para aumenta o skill a mesma bug, dando 1% a cada hit e até mais 1skill a cada hit...
Como poderia por pra bloquear uso de magias quando estão usando ela?! Ou até mesmo se pessoa estiver com uso de buff não poder usa a arma?!
 

local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_HITAREA)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ETHEREALSPEAR)
 
function onUseWeapon(cid, var)
	local skill = getPlayerRequiredSkillTries(cid, SKILL_DISTANCE, getPlayerSkillLevel(cid, SKILL_DISTANCE))
	local target = getCreatureTarget(cid)
	local crit = math.random(1, 100)
	
    if getCreatureName(target) == "Exercise Dummy" then
		if getPlayerSkillLevel(cid, SKILL_DISTANCE) >= 0 and getPlayerSkillLevel(cid, SKILL_DISTANCE) <= 19 then
			if crit <= 5 then
				doPlayerAddSkillTry(cid, SKILL_DISTANCE, math.ceil(skill*0.7), false) -- 70%
				doSendAnimatedText(getPlayerPosition(cid),"CRIT+ 70%", TEXTCOLOR_RED)
				doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
				return doCombat(cid, combat, var)
			else
				doPlayerAddSkillTry(cid, SKILL_DISTANCE, math.ceil(skill*0.5), false) -- 50%
				doSendAnimatedText(getPlayerPosition(cid),"+ 50%", TEXTCOLOR_RED)
				doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
				return doCombat(cid, combat, var)
			end
			
		elseif getPlayerSkillLevel(cid, SKILL_DISTANCE) >= 20 and getPlayerSkillLevel(cid, SKILL_DISTANCE) <= 29 then
			if crit <= 5 then
				doPlayerAddSkillTry(cid, SKILL_DISTANCE, math.ceil(skill*0.5), false) -- 60%
				doSendAnimatedText(getPlayerPosition(cid),"CRIT+ 50%", TEXTCOLOR_RED)
				doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
				return doCombat(cid, combat, var)
			else
				doPlayerAddSkillTry(cid, SKILL_DISTANCE, math.ceil(skill*0.3), false) -- 40%
				doSendAnimatedText(getPlayerPosition(cid),"+ 30%", TEXTCOLOR_RED)
				doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
				return doCombat(cid, combat, var)
			end
			
		elseif getPlayerSkillLevel(cid, SKILL_DISTANCE) >= 30 and getPlayerSkillLevel(cid, SKILL_DISTANCE) <= 39 then
			if crit <= 5 then
				doPlayerAddSkillTry(cid, SKILL_DISTANCE, math.ceil(skill*0.4), false) -- 50%
				doSendAnimatedText(getPlayerPosition(cid),"CRIT+ 40%", TEXTCOLOR_RED)
				doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
				return doCombat(cid, combat, var)
			else
				doPlayerAddSkillTry(cid, SKILL_DISTANCE, math.ceil(skill*0.2), false) -- 30%
				doSendAnimatedText(getPlayerPosition(cid),"+ 20%", TEXTCOLOR_RED)
				doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
				return doCombat(cid, combat, var)
			end
			
		elseif getPlayerSkillLevel(cid, SKILL_DISTANCE) >= 40 and getPlayerSkillLevel(cid, SKILL_DISTANCE) <= 49 then
			if crit <= 5 then
				doPlayerAddSkillTry(cid, SKILL_DISTANCE, math.ceil(skill*0.3), false) -- 50%
				doSendAnimatedText(getPlayerPosition(cid),"CRIT+ 30%", TEXTCOLOR_RED)
				doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
				return doCombat(cid, combat, var)
			else
				doPlayerAddSkillTry(cid, SKILL_DISTANCE, math.ceil(skill*0.15), false) -- 25%
				doSendAnimatedText(getPlayerPosition(cid),"+ 15%", TEXTCOLOR_RED)
				doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
				return doCombat(cid, combat, var)
			end
			
		elseif getPlayerSkillLevel(cid, SKILL_DISTANCE) >= 50 and getPlayerSkillLevel(cid, SKILL_DISTANCE) <= 59 then
			if crit <= 5 then
				doPlayerAddSkillTry(cid, SKILL_DISTANCE, math.ceil(skill*0.1), false) -- 40%
				doSendAnimatedText(getPlayerPosition(cid),"CRIT+ 10%", TEXTCOLOR_RED)
				doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
				return doCombat(cid, combat, var)
			else
				doPlayerAddSkillTry(cid, SKILL_DISTANCE, math.ceil(skill*0.05), false) -- 20%
				doSendAnimatedText(getPlayerPosition(cid),"+ 5%", TEXTCOLOR_RED)
				doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
				return doCombat(cid, combat, var)
			end
			
		elseif getPlayerSkillLevel(cid, SKILL_DISTANCE) >= 60 and getPlayerSkillLevel(cid, SKILL_DISTANCE) <= 69 then
			if crit <= 5 then
				doPlayerAddSkillTry(cid, SKILL_DISTANCE, math.ceil(skill*0.03), false) -- 30%
				doSendAnimatedText(getPlayerPosition(cid),"CRIT+ 3%", TEXTCOLOR_RED)
				doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
				return doCombat(cid, combat, var)
			else
				doPlayerAddSkillTry(cid, SKILL_DISTANCE, math.ceil(skill*0.015), false) -- 15%
				doSendAnimatedText(getPlayerPosition(cid),"+ 1.5%", TEXTCOLOR_RED)
				doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
				return doCombat(cid, combat, var)
			end
			
		elseif getPlayerSkillLevel(cid, SKILL_DISTANCE) >= 70 and getPlayerSkillLevel(cid, SKILL_DISTANCE) <= 79 then
			if crit <= 5 then
				doPlayerAddSkillTry(cid, SKILL_DISTANCE, math.ceil(skill*0.02), false) -- 20%
				doSendAnimatedText(getPlayerPosition(cid),"CRIT+ 2%", TEXTCOLOR_RED)
				doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
				return doCombat(cid, combat, var)
			else
				doPlayerAddSkillTry(cid, SKILL_DISTANCE, math.ceil(skill*0.01), false) -- 10%
				doSendAnimatedText(getPlayerPosition(cid),"+ 1%", TEXTCOLOR_RED)
				doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
				return doCombat(cid, combat, var)
			end
		
		elseif getPlayerSkillLevel(cid, SKILL_DISTANCE) >= 80 and getPlayerSkillLevel(cid, SKILL_DISTANCE) <= 89 then
			if crit <= 5 then
				doPlayerAddSkillTry(cid, SKILL_DISTANCE, math.ceil(skill*0.01), false) -- 10%
				doSendAnimatedText(getPlayerPosition(cid),"CRIT+ 1%", TEXTCOLOR_RED)
				doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
				return doCombat(cid, combat, var)
			else
				doPlayerAddSkillTry(cid, SKILL_DISTANCE, math.ceil(skill*0.005), false) -- 5%
				doSendAnimatedText(getPlayerPosition(cid),"+ 0.5%", TEXTCOLOR_RED)
				doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
				return doCombat(cid, combat, var)
			end
		
		elseif getPlayerSkillLevel(cid, SKILL_DISTANCE) >= 90 and getPlayerSkillLevel(cid, SKILL_DISTANCE) <= 99 then
			if crit <= 5 then
				doPlayerAddSkillTry(cid, SKILL_DISTANCE, math.ceil(skill*0.005), false) -- 3%
				doSendAnimatedText(getPlayerPosition(cid),"CRIT+ 0.5%", TEXTCOLOR_RED)
				doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
				return doCombat(cid, combat, var)
			else
				doPlayerAddSkillTry(cid, SKILL_DISTANCE, math.ceil(skill*0.0025), false) -- 1.5%
				doSendAnimatedText(getPlayerPosition(cid),"+ 0.25%", TEXTCOLOR_RED)
				doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
				return doCombat(cid, combat, var)
			end
			
		elseif getPlayerSkillLevel(cid, SKILL_DISTANCE) >= 100 and getPlayerSkillLevel(cid, SKILL_DISTANCE) <= 109 then
			if crit <= 5 then
				doPlayerAddSkillTry(cid, SKILL_DISTANCE, math.ceil(skill*0.0025), false) -- 1.4%
				doSendAnimatedText(getPlayerPosition(cid),"CRIT+ 0.25%", TEXTCOLOR_RED)
				doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
				return doCombat(cid, combat, var)
			else
				doPlayerAddSkillTry(cid, SKILL_DISTANCE, math.ceil(skill*0.0015), false) -- 0.7%
				doSendAnimatedText(getPlayerPosition(cid),"+ 0.15%", TEXTCOLOR_RED)
				doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
				return doCombat(cid, combat, var)
			end
			
		elseif getPlayerSkillLevel(cid, SKILL_DISTANCE) >= 110 and getPlayerSkillLevel(cid, SKILL_DISTANCE) <= 119 then
			if crit <= 5 then
				doPlayerAddSkillTry(cid, SKILL_DISTANCE, math.ceil(skill*0.001), false) -- 0.6%
				doSendAnimatedText(getPlayerPosition(cid),"CRIT+ 0.1%", TEXTCOLOR_RED)
				doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
				return doCombat(cid, combat, var)
			else
				doPlayerAddSkillTry(cid, SKILL_DISTANCE, math.ceil(skill*0.0005), false) -- 0.3%
				doSendAnimatedText(getPlayerPosition(cid),"+ 0.05%", TEXTCOLOR_RED)
				doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
				return doCombat(cid, combat, var)
			end
			
		elseif getPlayerSkillLevel(cid, SKILL_DISTANCE) >= 120 and getPlayerSkillLevel(cid, SKILL_DISTANCE) <= 129 then
			if crit <= 5 then
				doPlayerAddSkillTry(cid, SKILL_DISTANCE, math.ceil(skill*0.0005), false) -- 0.5%
				doSendAnimatedText(getPlayerPosition(cid),"CRIT+ 0.05%", TEXTCOLOR_RED)
				doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
				return doCombat(cid, combat, var)
			else
				doPlayerAddSkillTry(cid, SKILL_DISTANCE, math.ceil(skill*0.00025), false) -- 0.25%
				doSendAnimatedText(getPlayerPosition(cid),"+ 0.025%", TEXTCOLOR_RED)
				doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
				return doCombat(cid, combat, var)
			end
			
		elseif getPlayerSkillLevel(cid, SKILL_DISTANCE) >= 130 then
			if crit <= 5 then
				doPlayerAddSkillTry(cid, SKILL_DISTANCE, math.ceil(skill*0.0003), false) -- 0.25%
				doSendAnimatedText(getPlayerPosition(cid),"CRIT+ 0.03%", TEXTCOLOR_RED)
				doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
				return doCombat(cid, combat, var)
			else
				doPlayerAddSkillTry(cid, SKILL_DISTANCE, math.ceil(skill*0.00015), false) -- 0.15%
				doSendAnimatedText(getPlayerPosition(cid),"+ 0.015%", TEXTCOLOR_RED)
				doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
				return doCombat(cid, combat, var)
			end
		end
    else
		return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Você só pode usar o exercise weapon no 'Exercise Dummy'.")
    end
end

 

Link to post
Share on other sites

Agora, Storm disse:

@Pifafa A magia que aumenta a skill é uma condition?

 

Acredito que sejá qual quer magia que altere o skill..... Teria que por pra ele não ataca até volta ao normal kkk
 

<instant name="Sharpshooter" words="utito tempo san" lvl="60" mana="450" prem="0" aggressive="0" selftarget="1" exhaustion="1500" groups="1,0" icon="135" needlearn="0" event="script" value="support/sharpshooter.lua">
	
<instant name="Protector" words="utamo tempo" lvl="55" mana="200" prem="0" aggressive="0" selftarget="1" exhaustion="1500" groups="1,0" icon="132" needlearn="0" event="script" value="support/protector.lua">

<instant name="Blood Rage" words="utito tempo" lvl="60" mana="290" prem="0" aggressive="0" selftarget="1" exhaustion="1500" groups="1,0" icon="133" needlearn="0" event="script" value="support/blood rage.lua">

 

Link to post
Share on other sites

Essa seria a do paladino aumenta skill...
No caso seria bom, ele não consegui usa a magia quando equipado com a arma hahahaha de treinar skill que no caso é um 

19:01 You see a exercise bow that has 100 charges left.
It can only be wielded properly by royal paladins of level 8 or higher.
ItemID: [12691].
DecayTo: [7729].
Position: [X: 2055] [Y: 2041] [Z: 6].

 local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false)

local condition = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(condition, CONDITION_PARAM_TICKS, 10000)
setConditionParam(condition, CONDITION_PARAM_SKILL_DISTANCEPERCENT, 160)
setConditionParam(condition, CONDITION_PARAM_BUFF, true)
setCombatCondition(combat, condition)

local speed = createConditionObject(CONDITION_PARALYZE)
setConditionParam(speed, CONDITION_PARAM_TICKS, 10000)
setConditionFormula(speed, -0.5, 50, -0.5, 50)
setCombatCondition(combat, speed)

local exhaust = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaust, CONDITION_PARAM_SUBID, 2)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, 10000)
setCombatCondition(combat, exhaust)

function onCastSpell(cid, var)
    return doCombat(cid, combat, var)
end 

 

Não teria como por aqui uma condição que não se pode usa ela com spell?!
 

	<!-- EXERCISE WEAPONS -->
	<melee id="12688" level="8" unproperly="1" event="script" value="exercise_sword.lua">
		<vocation name="Elite Knight"/>
		<vocation id="8" showInDescription="0"/>
	</melee>
	<melee id="12689" level="8" unproperly="1" event="script" value="exercise_axe.lua">
		<vocation name="Elite Knight"/>
		<vocation id="8" showInDescription="0"/>
	</melee>
	<melee id="12690" level="8" unproperly="1" event="script" value="exercise_club.lua">
		<vocation name="Elite Knight"/>
		<vocation id="8" showInDescription="0"/>
	</melee>
	<distance id="12691" level="8" swing="true" event="script" value="exercise_distance.lua">
		<vocation name="Royal Paladin"/>
		<vocation id="7" showInDescription="0"/>
	</distance>
	<wand id="12692" level="8" event="script" value="exercise_staff.lua">
		<vocation name="Master Sorcerer"/>
		<vocation name="Elder Druid"/>
		<vocation name="Royal Paladin"/>
		<vocation name="Elite Knight"/>
		<vocation id="5;6;7;8" showInDescription="0"/>
	</wand>

 

Link to post
Share on other sites

@Pifafa Adiciona na linha embaixo de:

	local crit = math.random(1, 100)

O seguinte escopo:

if getCreatureCondition(cid, CONDITION_ATTRIBUTES) then
	doPlayerSendTextMessage(cid, 27, "Voce nao pode usar o Exercise Bow com um buff ativo.")
	doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
	return false
end

 

Link to post
Share on other sites

Ficando assim?!
 

local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_HITAREA)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ETHEREALSPEAR)
 
function onUseWeapon(cid, var)
	local skill = getPlayerRequiredSkillTries(cid, SKILL_DISTANCE, getPlayerSkillLevel(cid, SKILL_DISTANCE))
	local target = getCreatureTarget(cid)
	local crit = math.random(1, 100)
	
	if getCreatureCondition(cid, CONDITION_ATTRIBUTES) then
	doPlayerSendTextMessage(cid, 27, "Voce nao pode usar o Exercise Bow com um buff ativo.")
	doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
	return false
end
	
    if getCreatureName(target) == "Exercise Dummy" then
		if getPlayerSkillLevel(cid, SKILL_DISTANCE) >= 0 and getPlayerSkillLevel(cid, SKILL_DISTANCE) <= 19 then
			if crit <= 5 then
				doPlayerAddSkillTry(cid, SKILL_DISTANCE, math.ceil(skill*0.7), false) -- 70%
				doSendAnimatedText(getPlayerPosition(cid),"CRIT+ 70%", TEXTCOLOR_RED)
				doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
				return doCombat(cid, combat, var)
			else
				doPlayerAddSkillTry(cid, SKILL_DISTANCE, math.ceil(skill*0.5), false) -- 50%
				doSendAnimatedText(getPlayerPosition(cid),"+ 50%", TEXTCOLOR_RED)
				doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
				return doCombat(cid, combat, var)
			end
			
		elseif getPlayerSkillLevel(cid, SKILL_DISTANCE) >= 20 and getPlayerSkillLevel(cid, SKILL_DISTANCE) <= 29 then
			if crit <= 5 then
				doPlayerAddSkillTry(cid, SKILL_DISTANCE, math.ceil(skill*0.5), false) -- 60%
				doSendAnimatedText(getPlayerPosition(cid),"CRIT+ 50%", TEXTCOLOR_RED)
				doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
				return doCombat(cid, combat, var)
			else
				doPlayerAddSkillTry(cid, SKILL_DISTANCE, math.ceil(skill*0.3), false) -- 40%
				doSendAnimatedText(getPlayerPosition(cid),"+ 30%", TEXTCOLOR_RED)
				doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
				return doCombat(cid, combat, var)
			end
			
		elseif getPlayerSkillLevel(cid, SKILL_DISTANCE) >= 30 and getPlayerSkillLevel(cid, SKILL_DISTANCE) <= 39 then
			if crit <= 5 then
				doPlayerAddSkillTry(cid, SKILL_DISTANCE, math.ceil(skill*0.4), false) -- 50%
				doSendAnimatedText(getPlayerPosition(cid),"CRIT+ 40%", TEXTCOLOR_RED)
				doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
				return doCombat(cid, combat, var)
			else
				doPlayerAddSkillTry(cid, SKILL_DISTANCE, math.ceil(skill*0.2), false) -- 30%
				doSendAnimatedText(getPlayerPosition(cid),"+ 20%", TEXTCOLOR_RED)
				doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
				return doCombat(cid, combat, var)
			end
			
		elseif getPlayerSkillLevel(cid, SKILL_DISTANCE) >= 40 and getPlayerSkillLevel(cid, SKILL_DISTANCE) <= 49 then
			if crit <= 5 then
				doPlayerAddSkillTry(cid, SKILL_DISTANCE, math.ceil(skill*0.3), false) -- 50%
				doSendAnimatedText(getPlayerPosition(cid),"CRIT+ 30%", TEXTCOLOR_RED)
				doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
				return doCombat(cid, combat, var)
			else
				doPlayerAddSkillTry(cid, SKILL_DISTANCE, math.ceil(skill*0.15), false) -- 25%
				doSendAnimatedText(getPlayerPosition(cid),"+ 15%", TEXTCOLOR_RED)
				doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
				return doCombat(cid, combat, var)
			end
			
		elseif getPlayerSkillLevel(cid, SKILL_DISTANCE) >= 50 and getPlayerSkillLevel(cid, SKILL_DISTANCE) <= 59 then
			if crit <= 5 then
				doPlayerAddSkillTry(cid, SKILL_DISTANCE, math.ceil(skill*0.1), false) -- 40%
				doSendAnimatedText(getPlayerPosition(cid),"CRIT+ 10%", TEXTCOLOR_RED)
				doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
				return doCombat(cid, combat, var)
			else
				doPlayerAddSkillTry(cid, SKILL_DISTANCE, math.ceil(skill*0.05), false) -- 20%
				doSendAnimatedText(getPlayerPosition(cid),"+ 5%", TEXTCOLOR_RED)
				doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
				return doCombat(cid, combat, var)
			end
			
		elseif getPlayerSkillLevel(cid, SKILL_DISTANCE) >= 60 and getPlayerSkillLevel(cid, SKILL_DISTANCE) <= 69 then
			if crit <= 5 then
				doPlayerAddSkillTry(cid, SKILL_DISTANCE, math.ceil(skill*0.03), false) -- 30%
				doSendAnimatedText(getPlayerPosition(cid),"CRIT+ 3%", TEXTCOLOR_RED)
				doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
				return doCombat(cid, combat, var)
			else
				doPlayerAddSkillTry(cid, SKILL_DISTANCE, math.ceil(skill*0.015), false) -- 15%
				doSendAnimatedText(getPlayerPosition(cid),"+ 1.5%", TEXTCOLOR_RED)
				doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
				return doCombat(cid, combat, var)
			end
			
		elseif getPlayerSkillLevel(cid, SKILL_DISTANCE) >= 70 and getPlayerSkillLevel(cid, SKILL_DISTANCE) <= 79 then
			if crit <= 5 then
				doPlayerAddSkillTry(cid, SKILL_DISTANCE, math.ceil(skill*0.02), false) -- 20%
				doSendAnimatedText(getPlayerPosition(cid),"CRIT+ 2%", TEXTCOLOR_RED)
				doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
				return doCombat(cid, combat, var)
			else
				doPlayerAddSkillTry(cid, SKILL_DISTANCE, math.ceil(skill*0.01), false) -- 10%
				doSendAnimatedText(getPlayerPosition(cid),"+ 1%", TEXTCOLOR_RED)
				doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
				return doCombat(cid, combat, var)
			end
		
		elseif getPlayerSkillLevel(cid, SKILL_DISTANCE) >= 80 and getPlayerSkillLevel(cid, SKILL_DISTANCE) <= 89 then
			if crit <= 5 then
				doPlayerAddSkillTry(cid, SKILL_DISTANCE, math.ceil(skill*0.01), false) -- 10%
				doSendAnimatedText(getPlayerPosition(cid),"CRIT+ 1%", TEXTCOLOR_RED)
				doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
				return doCombat(cid, combat, var)
			else
				doPlayerAddSkillTry(cid, SKILL_DISTANCE, math.ceil(skill*0.005), false) -- 5%
				doSendAnimatedText(getPlayerPosition(cid),"+ 0.5%", TEXTCOLOR_RED)
				doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
				return doCombat(cid, combat, var)
			end
		
		elseif getPlayerSkillLevel(cid, SKILL_DISTANCE) >= 90 and getPlayerSkillLevel(cid, SKILL_DISTANCE) <= 99 then
			if crit <= 5 then
				doPlayerAddSkillTry(cid, SKILL_DISTANCE, math.ceil(skill*0.005), false) -- 3%
				doSendAnimatedText(getPlayerPosition(cid),"CRIT+ 0.5%", TEXTCOLOR_RED)
				doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
				return doCombat(cid, combat, var)
			else
				doPlayerAddSkillTry(cid, SKILL_DISTANCE, math.ceil(skill*0.0025), false) -- 1.5%
				doSendAnimatedText(getPlayerPosition(cid),"+ 0.25%", TEXTCOLOR_RED)
				doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
				return doCombat(cid, combat, var)
			end
			
		elseif getPlayerSkillLevel(cid, SKILL_DISTANCE) >= 100 and getPlayerSkillLevel(cid, SKILL_DISTANCE) <= 109 then
			if crit <= 5 then
				doPlayerAddSkillTry(cid, SKILL_DISTANCE, math.ceil(skill*0.0025), false) -- 1.4%
				doSendAnimatedText(getPlayerPosition(cid),"CRIT+ 0.25%", TEXTCOLOR_RED)
				doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
				return doCombat(cid, combat, var)
			else
				doPlayerAddSkillTry(cid, SKILL_DISTANCE, math.ceil(skill*0.0015), false) -- 0.7%
				doSendAnimatedText(getPlayerPosition(cid),"+ 0.15%", TEXTCOLOR_RED)
				doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
				return doCombat(cid, combat, var)
			end
			
		elseif getPlayerSkillLevel(cid, SKILL_DISTANCE) >= 110 and getPlayerSkillLevel(cid, SKILL_DISTANCE) <= 119 then
			if crit <= 5 then
				doPlayerAddSkillTry(cid, SKILL_DISTANCE, math.ceil(skill*0.001), false) -- 0.6%
				doSendAnimatedText(getPlayerPosition(cid),"CRIT+ 0.1%", TEXTCOLOR_RED)
				doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
				return doCombat(cid, combat, var)
			else
				doPlayerAddSkillTry(cid, SKILL_DISTANCE, math.ceil(skill*0.0005), false) -- 0.3%
				doSendAnimatedText(getPlayerPosition(cid),"+ 0.05%", TEXTCOLOR_RED)
				doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
				return doCombat(cid, combat, var)
			end
			
		elseif getPlayerSkillLevel(cid, SKILL_DISTANCE) >= 120 and getPlayerSkillLevel(cid, SKILL_DISTANCE) <= 129 then
			if crit <= 5 then
				doPlayerAddSkillTry(cid, SKILL_DISTANCE, math.ceil(skill*0.0005), false) -- 0.5%
				doSendAnimatedText(getPlayerPosition(cid),"CRIT+ 0.05%", TEXTCOLOR_RED)
				doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
				return doCombat(cid, combat, var)
			else
				doPlayerAddSkillTry(cid, SKILL_DISTANCE, math.ceil(skill*0.00025), false) -- 0.25%
				doSendAnimatedText(getPlayerPosition(cid),"+ 0.025%", TEXTCOLOR_RED)
				doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
				return doCombat(cid, combat, var)
			end
			
		elseif getPlayerSkillLevel(cid, SKILL_DISTANCE) >= 130 then
			if crit <= 5 then
				doPlayerAddSkillTry(cid, SKILL_DISTANCE, math.ceil(skill*0.0003), false) -- 0.25%
				doSendAnimatedText(getPlayerPosition(cid),"CRIT+ 0.03%", TEXTCOLOR_RED)
				doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
				return doCombat(cid, combat, var)
			else
				doPlayerAddSkillTry(cid, SKILL_DISTANCE, math.ceil(skill*0.00015), false) -- 0.15%
				doSendAnimatedText(getPlayerPosition(cid),"+ 0.015%", TEXTCOLOR_RED)
				doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
				return doCombat(cid, combat, var)
			end
		end
    else
		return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Você só pode usar o exercise weapon no 'Exercise Dummy'.")
    end
end

 

Link to post
Share on other sites

1 minuto atrás, Storm disse:

@Pifafa Isso mesmo. Funcionou ou deu algo errado?

 

Não deu certo ele consegue usa a magia.

Link to post
Share on other sites

  • Solution

@Pifafa Mas ele consegue usar o Exercise Bow quando está com a magia ativa? Se conseguir, tenta assim:

 

if getCreatureCondition(cid, CONDITION_ATTRIBUTES, 1) then
	doPlayerSendTextMessage(cid, 27, "Voce nao pode usar o Exercise Bow com um buff ativo.")
	doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
	return false
end

 

Link to post
Share on other sites

58 minutos atrás, Storm disse:

@Pifafa Mas ele consegue usar o Exercise Bow quando está com a magia ativa? Se conseguir, tenta assim:

 


if getCreatureCondition(cid, CONDITION_ATTRIBUTES, 1) then
	doPlayerSendTextMessage(cid, 27, "Voce nao pode usar o Exercise Bow com um buff ativo.")
	doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
	return false
end

 

 

Obrigado deu certo.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

Confirmação de Termo