I've currently got two files, skill.inl which calls the function and bug.inl which the function is currently loaded there.
The issue I'm having is that new SKILL:iSkillReturn isn't returning any values at all, I'm not sure why, I've spend quite some time and I resort to forum helpers.
Do I need to do anything else with SKILL:Absorb(id, skill, prop)?
SKILL.INL:
Code:
#include "bug.inl"
enum
{
SKILL_1,
SKILL_2,
};
stock DelayedCallSkill(Float:time, id, skill, prop)
{
new parm[3];
parm[0] = id;
parm[1] = skill;
parm[2] = prop;
set_task(time, "task_CallSkill", SKILLCALL_TASK + (skill * MAX_PLAYERS) + id, parm, 3);
}
public task_CallSkill( parm[] ){
CallSkill( parm[0], parm[1], parm[2] );
}
CallSkill(id, skill, prop)
{
new SKILL:iSkillReturn;
switch(skill)
{
case SKILL_1: iSkillReturn = Absorb(id, skill, prop);
case SKILL_2: iSkillReturn = Acid(id, skill, prop);
}
if ( ValidPlayer(id) )
{
switch ( iSkillReturn )
{
case SKILL_USED, SKILL_READY:
{
if( prop & SI_BIND )
bind_used( id, skill );
else {
#if ONE_SKILL_USE == 0
parm[0] = id;
parm[1] = skill;
set_task(0.0, "delayed_bind_used", 0, parm, 2);
#else
bind_used( id, skill );
#endif
}
}
}
}
return iSkillReturn;
}
BUG.INL:
Code:
SKILL:Absorb(id, skill, prop)
{
new victim = PokeSkillTarget(id)
if( !ValidPlayer(victim) || !Pokemod_Alive(victim) )
return SKILL_READY;
new armor = get_user_armor(victim)
new level = SkillLevel(id, skill)
new totake = (armor*level)/(TotalLevels+1)
if(level < armor)
clamp(totake, level, armor)
else
totake = armor
Pokemod_Repair(id, totake)
set_user_armor(victim, armor-totake)
sound_hit(id)
sound_hit(victim)
MakeLine_Ent(0,id,victim,SPRITE_INDEX[SPR_ROPE],1,1,10,5,10,0,255,200,255,0)
return SKILL_USED;
}
__________________