Jump to content
  • 0

Simple @effect timer script


Olrox

Question


  • Group:  Members
  • Topic Count:  87
  • Topics Per Day:  0.02
  • Content Count:  1335
  • Reputation:   932
  • Joined:  10/26/11
  • Last Seen:  

Hello.

I'm trying to add effects to a map via scripting. By using this script that recalls a effect with a sleep2 timer I found:

Thats why, I'm using some of them directly by Script :

-	script	EP7_lightanim	-1,{

OnLight:
donpcevent "#ep7effectAby1::OnAction";

sleep2 1000;
donpcevent "EP7_lightanim::OnLight";
end;
}
//===============
ars_fild58,95,103,0	script	#ep7effectAby1	139,{
OnAction:specialeffect 14;end;
}

I'm trying this script with no luck, and nothing happens. (allready changed the map name, and coordinates, for ex. actually testing "prontera,157,179,0". But no luck.

On map console doesnt shows any error. Maybe someone can give me a tip? or maybe they have another quick script?

Also In advance I would ask ( if possible ), how the script would look if I want to activate it only on certain hours with the OnHour script label variable? I believe that it will be like a few lines more.

Great thanks in advance.

Link to comment
Share on other sites

15 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  224
  • Reputation:   22
  • Joined:  03/23/12
  • Last Seen:  

-       script  EP7_lightanim   -1,{

OnInit:
       initnpctimer;
       end;

OnTimer2000:
       donpcevent "EP7_lightanim::OnLight";
       stopnpctimer;
       end;

OnLight:
       donpcevent "#ep7effectAby1::OnAction";
       end;

OnClock0100: //change timers to whatever you'd like
OnClock0200:
OnClock0300:
       donpcevent "#ep7effectAby1::OnAction";
       end;

}
//===============
ars_fild58,95,103,0     script  #ep7effectAby1  139,{

OnAction:
       specialeffect 14;
       end;

}

Something like this?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  87
  • Topics Per Day:  0.02
  • Content Count:  1335
  • Reputation:   932
  • Joined:  10/26/11
  • Last Seen:  

Weird I loaded that script (changing to prontera map coordinates of course) and nothing happens o__o

I changed the OnClock hours too. For testing I removed those labels too, but in any case, I can't see any effect.

How weird

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  224
  • Reputation:   22
  • Joined:  03/23/12
  • Last Seen:  

Oh yeah...that effect command certainly wont load the effect where you want it to, its normally centered on the map...try looking around the middle of the map while reloading scripts.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  87
  • Topics Per Day:  0.02
  • Content Count:  1335
  • Reputation:   932
  • Joined:  10/26/11
  • Last Seen:  

Oh my bad. I didn't know that.

But certainly I need the effect to be loaded on exact coordinates.

Maybe a script that calls the at command @effect and # on a certain invisible NPC that by walking nearly of it would activate, would work better?

If someone has an example I can try myself. Sorry for disturbing

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  224
  • Reputation:   22
  • Joined:  03/23/12
  • Last Seen:  

That's possible and simple :P

There's no need for the atcommand tho, it can be attached to the npc if it's a physical npc, you can set it out of player's vision even...inside a nearby house with sprite ID 111, with 15 cells range or so...

If you give me details I can make you something like that /ok

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  87
  • Topics Per Day:  0.02
  • Content Count:  1335
  • Reputation:   932
  • Joined:  10/26/11
  • Last Seen:  

I think that 15 cells of range will be quite enough!

Dont know about the sprite ID 111, but I want the NPC invisible, I mean, if possible no clickable? because the effect will load on a clear view floor. I only want that the users that walk near of that invisible npc, will see the effect.

For testing I would ask the script to load on this coordinate: prontera 157,179

Also I forgot, if it is not a big change... if possible that the effects will load only on a hour range. for example from: 18:00 to 06:00

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  224
  • Reputation:   22
  • Joined:  03/23/12
  • Last Seen:  

prontera,157,179,4	script   	  ::effecttest123	139,15,15,{

OnInit:
disablenpc "effecttest123";
end;

OnTouch:
specialeffect 410;
end;

}
-	script	effecttest123onoff	-1,{

OnClock1800:
enablenpc "effecttest123";
hideonnpc "effecttest123";
end;
OnClock0600:
disablenpc "effecttest123";
end;

}

Kay here, it'll trigger on that exact spot as soon as the player comes withing 15 cells range, its off by default and turns on at 18:00, its unclickable and invisible and turns off at 06:00 :P

*Forgot to change the npc ID, fixed now*

Edited by F0xxy
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  87
  • Topics Per Day:  0.02
  • Content Count:  1335
  • Reputation:   932
  • Joined:  10/26/11
  • Last Seen:  

Thanks! but one question, I think that there is left one thing... the loop time? sorry if I forgot to mention it, but it is quite necessary that the effect loads endless times every let say 2 seconds for ex.

Or maybe it is my mistake because I'm on my way to testing it still right now, though, If I think that on the previous script the Sleep2 was the one that made this possible.

Thanks really thanks and sorry for taking your time with this

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  224
  • Reputation:   22
  • Joined:  03/23/12
  • Last Seen:  

Oh...I think I know what you mean...

prontera,157,179,4    script   	  ::effecttest123    139,15,15,{

OnInit:
    disablenpc "effecttest123";
    end;

OnEffect:
   initnpctimer;
   end;

OnTimer2000:
   specialeffect 14;
   initnpctimer;
   end;

}
-    script    effecttest123onoff    -1,{

OnClock1800:
   enablenpc "effecttest123";
   donpcevent "effecttest123::OnEffect";
   end;
OnClock0600:
   disablenpc "effecttest123";
   end;

}}

:P

*woops fixed something*

Edited by F0xxy
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  87
  • Topics Per Day:  0.02
  • Content Count:  1335
  • Reputation:   932
  • Joined:  10/26/11
  • Last Seen:  

Imma try now, I will update right now :D!

WOAHH!!! IT WORKS!!!! THANKS A LOT!!!

This is what I needed to make something really new on a map I'm trying! I will give your credits of course at the time I'm done with it.

Thank you very much!!!

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  224
  • Reputation:   22
  • Joined:  03/23/12
  • Last Seen:  

Happy it worked out ^^

If you need anything else related feel free to pm or ask me /no1

Glad I've been of help (;

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  87
  • Topics Per Day:  0.02
  • Content Count:  1335
  • Reputation:   932
  • Joined:  10/26/11
  • Last Seen:  

Oh one question... seems like the NPC doesnt stops at the "disablenpc" at 0600 (changed the hours for testing purposes)

I'm not sure why... everything else works like a charm, but it doesn't stops at the end time.

Though it activates exactly at the enabled time. It is just the disable thing

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  224
  • Reputation:   22
  • Joined:  03/23/12
  • Last Seen:  

prontera,157,179,4      script            ::effecttest123       139,{

OnInit:
       disablenpc "effecttest123";
       end;

OnEffect:
    initnpctimer;
    end;

OnTimer2000:
    specialeffect 14;
    initnpctimer;
    end;

OnDisable:
       stopnpctimer;
  	 disablenpc "effecttest123";
  	 end;

}
-    script    effecttest123onoff    -1,{

OnClock1800:
  	 enablenpc "effecttest123";
  	 donpcevent "effecttest123::OnEffect";
  	 end;
OnClock0600:
  	 donpcevent "effecttest123::OnDisable";
  	 end;

}

Here

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  87
  • Topics Per Day:  0.02
  • Content Count:  1335
  • Reputation:   932
  • Joined:  10/26/11
  • Last Seen:  

Now it works great!!!

Thank youuu x1000000!!!!

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  224
  • Reputation:   22
  • Joined:  03/23/12
  • Last Seen:  

Good thing you pointed it out actually, cause I forgot about stopping the timer >.< that's why.

Oh well, /no1

Link to comment
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
Answer this question...

×   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...