fyalhed
Member
- Joined
- Nov 18, 2017
- Messages
- 156
- Reaction score
- 20
I wanna make fair to paladins play without bots in my server..
Wanna use a script to when assassin star go to 0, auto it auto recharge
But idk how to do and dont find in anywhere here...
Is anybody here could help me to finish it?
Wanna use a script to when assassin star go to 0, auto it auto recharge
But idk how to do and dont find in anywhere here...
Is anybody here could help me to finish it?
Code:
local function autoRecharge(cid)
-- CHECK IF HAVE 1 GOING TO 0 ASSASSIN STAR ON ONE OF 2 HANDS
local ammobalance = getPlayerItemCount(cid, ammoID) - 1
if(ammobalance >= 100) then ammobalance = 100 end
addEvent (
function ()
print("RECHARGE")
doPlayerRemoveItem(cid, ammoID, ammobalance)
doPlayerAddItem(cid, ammoID, ammobalance)
-- BUT FORCE IT TO GO TO HANDS
end, 1
)
return true
end
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, 1)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, 18)
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
function onGetFormulaValues(cid, level, skill, attack, factor)
-- get attack mode
local damagebase_min = wbdmg_distance_min
local damagebase_max = wbdmg_distance_max
if factor == 1.0 then -- player_fight_mode = offensive
damagebase_min = damagebase_min * 3
damagebase_max = damagebase_max * 3
elseif factor == 2.0 then -- player_fight_mode = defensive
damagebase_min = damagebase_min * 1
damagebase_max = damagebase_max * 1
else -- player_fight_mode = balanced
damagebase_min = damagebase_min * 2
damagebase_max = damagebase_max * 2
end
min = ((damagebase_min) * (attack * 12) * (skill * 3)) * -0.10
max = ((damagebase_max) * (attack * 12) * (skill * 3)) * -1.00
return min, max
end
setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")
function onUseWeapon(cid, var)
autoRecharge(cid)
return doCombat(cid, combat, var)
end