so far :
included in skills.inl :
Code: Select all
// ****************************************
// Elf`s Shadowmeld
// ****************************************
public Skill_Shadowmeld(id)
{
if ( p_data[id][P_RACE]==RACE_ELF && p_data[id][P_LEVEL]>=6) {
new clipamount = 0, ammoamount = 0, weaponnum = 0
weaponnum = get_user_weapon(id,clipamount,ammoamount)
#if MOD == 0
if (weaponnum==CSW_KNIFE){
#endif
#if MOD == 1
if (weaponnum==DODW_AMERKNIFE || weaponnum==DODW_GERKNIFE || weaponnum==DODW_SPADE){
#endif
if(p_data[id][P_TIME]>=400) {
if(task_exists(id))
remove_task(id)
}
if(p_data[id][P_TIME]<=400) {
new origin[3]
get_user_origin(id,origin)
p_data[id][P_LOCATIONX]=origin[0]
Create_ScreenFade(id, (1<<15), (1<<10), (1<<12), 0, 0, 255, 150)
set_user_rendering(id,kRenderFxNone, 0,0,0, kRenderTransTexture,0)
set_task(1.0,"shadow_move",id,"",0,"b")
set_task(0.01,"shadowmeld",id,"",0,"b")
}
}
else{
set_user_rendering(id,kRenderFxNone, 0,0,0, kRenderTransTexture,255)
Create_ScreenFade(id, (1<<15), (1<<10), (1<<12), 255, 255, 255, 0)
remove_task(id)
}
}
}
public shadow_move(id)
{
new origin[3]
get_user_origin(id,origin)
p_data[id][P_LOCATIONX]=origin[0]
p_data[id][P_LOCATIONY]=origin[2]
p_data[id][P_LOCATIONZ]=origin[2]
}
public shadowmeld(id)
{
new oldOrigin[3];
new minus,plus
new time_remaining=400
get_user_origin(id,oldOrigin)
minus = oldOrigin[0]
plus = oldOrigin[0]
minus-=2
plus+=2
time_remaining=400-p_data[id][P_TIME]
p_data[id][P_TIME]+=1
if(p_data[id][P_TIME]<=400) {
set_user_rendering(id,kRenderFxNone, 0,0,0, kRenderTransTexture,0)
set_hudmessage(255, 255, 255, -1.0, -1.0, 0, 6.0, 0.08)
show_hudmessage(id, "SHADOWMELD ACTIVE^remaining : %i",time_remaining)
Create_ScreenFade(id, (1<<15), (1<<10), (1<<12), 0, 0, 255, 90)
if(p_data[id][P_LOCATIONX]<minus || p_data[id][P_LOCATIONX]>plus){
set_user_rendering(id,kRenderFxNone, 0,0,0, kRenderTransTexture,255)
Create_ScreenFade(id, (1<<15), (1<<10), (1<<12), 255, 255, 255, 0)
remove_task(id)
}
if(p_data[id][P_TIME]>=400) {
set_user_rendering(id,kRenderFxNone, 0,0,0, kRenderTransTexture,255)
Create_ScreenFade(id, (1<<15), (1<<10), (1<<12), 255, 255, 255, 0)
remove_task(id)
set_hudmessage(255, 255, 255, -1.0, -1.0, 0, 6.0, 1.0)
show_hudmessage(id, "No more shadowmeld this round...")
}
}
}
in events.inl
onCurWeapon : initialise on change to knife the function
Code: Select all
//Check Shadowmeld
Skill_Shadowmeld(id)
on_ResetHud to set things straight agan after a new round :
if ( endround )
{
// have "fake" ultimate delay
iUltimateDelay = iCvar[FT_ULTIMATE_DELAY];
new parm[1];
parm[0] = 0;
_Ultimate_Delay(parm);
remove_task(id) <-
p_data[id][P_TIME]=0 <-
}
cstrike.inl on_endRound :
remove_task(id)
p_data[id][P_TIME]=0 ( dunno if that one here actually changes something or not....
and of course in constants.inl defining some of the variables
now, I know that the code could be far better... out of lazyness and testing I used "CreateScreenFade" just to see how it works...
had a problem with the tasks : whenever i wanted to assign a proper name to the task, other than "id" it would not pass the id on to the function, even tho it was declared ( to the best of my knowledge ) correctly.
What I havent done yet, checking the movement properly, X Y Z ... but fot the moment the check, the way it is, will do ....
Still, the problem with orcs and elf`s landing a shot on u stil exists... for 0.01 seconds u become visible again...
...and stil need to add a c_var for the sm length... but as u can see, all of it stil is very very... well ? just playing with it and seeing how it works ? took me 100 times more time to work myself through your code than actually putting this together
THX for havin a peak at it ! really appreciate this !
and please dont mind my bad coding... more used to php and hings like that
