Matheus Vieira
Member
- Joined
- Apr 11, 2015
- Messages
- 102
- Reaction score
- 6
0.4
Hello everybody, im here to ask for help.
I was trying to do a normal attack spell, but if the player has a storage, the creature would target him, like exeta res.
Here's the code I worked so far:
There is no errors in console, but if the player, that have the storage, uses the spell, the creature don't turn on him
Hello everybody, im here to ask for help.
I was trying to do a normal attack spell, but if the player has a storage, the creature would target him, like exeta res.
Here's the code I worked so far:
C++:
local outfit = 425
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, 0)
setCombatParam(combat, COMBAT_PARAM_USECHARGES, true)
local area = createCombatArea(AREA_SQUARE1X1)
setCombatArea(combat, area)
function onGetFormulaValues(cid, level, skill, attack, factor)
skill = getPlayerSkill(cid, SKILL_FIST)
return
- (skill * 1),
- (skill * 1.1)
end
setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, 'onGetFormulaValues')
function onCastSpell(cid, var)
if getPlayerStorageValue(cid, 27133) == 1 then
if isCreature(target) then
doChallengeCreature(cid, target)
end
else
end
if getCreatureOutfit(cid).lookType == outfit then
return doCombat(cid, combat, var)
else
doPlayerSendCancel(cid, "")
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
end
end
There is no errors in console, but if the player, that have the storage, uses the spell, the creature don't turn on him