Jump to content
  • 0

@ECALL Delay


ccjosh

Question


  • Group:  Members
  • Topic Count:  13
  • Topics Per Day:  0.00
  • Content Count:  66
  • Reputation:   6
  • Joined:  11/13/12
  • Last Seen:  

Hi, 

 

Can anyone modify this script? I need to set it to 3minute delay

 

- script at_ecall -1,{
OnInit:
bindatcmd("@ec","at_ecall::OnEcall");
bindatcmd("@ecall","at_ecall::OnEcall");
end;
OnEcall:
if( !getcharid(2) ){dispbottom "You are not apart of a guild."; end;}
if( getguildmasterid( getcharid(2) ) != getcharid(0) ){dispbottom "Can only be used by guild leader."; end;}
if( gettimetick(2) < getd(".guild"+ getcharid(2) +"") ){dispbottom "Command Failed. Still on cooldown."; end;}
progressbar "0x00FF00",5; //5 seconds is how the skill acts.
getmapxy(.@m$,.@x,.@y,0);
warpguild .@m$,.@x,.@y,getcharid(2);
setd ".guild"+ getcharid(2) +"", gettimetick(2) + 300000;
end;
}

 

Link to comment
Share on other sites

8 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  48
  • Topics Per Day:  0.01
  • Content Count:  1125
  • Reputation:   236
  • Joined:  07/30/12
  • Last Seen:  

Change 300000 to 180000.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  13
  • Topics Per Day:  0.00
  • Content Count:  66
  • Reputation:   6
  • Joined:  11/13/12
  • Last Seen:  

Thanks! But for some reason, that doesn't work.

I used

 

gettime(2) + 3
 

instead.

 

Solved.

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

It may be because of your big delay.

 

gettimetick(2) is in secs so your delay 300000 is in secs. 300000 secs = 5000 mins ~ 4 days

180000 secs = 3000 mins ~ 2 days

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  13
  • Topics Per Day:  0.00
  • Content Count:  66
  • Reputation:   6
  • Joined:  11/13/12
  • Last Seen:  

It may be because of your big delay.

 

gettimetick(2) is in secs so your delay 300000 is in secs. 300000 secs = 5000 mins ~ 4 days

180000 secs = 3000 mins ~ 2 days

 

I see.. Is there by any chance you know how to reload this script when the player logs out?

Thanks

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

What do you mean?

This script save the guild id of the leader in a variable attached to the npc (variable reseted when @reload script)

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  13
  • Topics Per Day:  0.00
  • Content Count:  66
  • Reputation:   6
  • Joined:  11/13/12
  • Last Seen:  

What do you mean?

This script save the guild id of the leader in a variable attached to the npc (variable reseted when @reload script)

What I meant was, when a guild master disconnects after he/she casts an e-call. The variable will reset and he can use e-call again. Is this possible?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  39
  • Topics Per Day:  0.01
  • Content Count:  254
  • Reputation:   72
  • Joined:  07/10/13
  • Last Seen:  

I am not sure whether I understood your demand properly.

Nevertheless - if any guild master logs out, this will reset the cooldown for his or her guild:

OnPCLogoutEvent:
if( getcharid( 2 ) != 0 && getguildmasterid( getcharid( 2 ) ) == getcharid( 0 ) && getd( ".guild" + getcharid( 2 ) ) != 0 )
	setd ".guild" + getcharid( 2 ), 0;
end;
Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

or

-	script	at_ecall	-1,{
OnInit:
	bindatcmd("@ec","at_ecall::OnEcall");
	bindatcmd("@ecall","at_ecall::OnEcall");
	end;
OnEcall:
	if( !getcharid(2) ){dispbottom "You are not apart of a guild."; end;}
	if( getguildmasterid( getcharid(2) ) != getcharid(0) ){dispbottom "Can only be used by guild leader."; end;}
	if( gettimetick(2) < @delay_ecall ){dispbottom "Command Failed. Still on cooldown."; end;}
	progressbar "0x00FF00",5; //5 seconds is how the skill acts.
	getmapxy(.@m$,.@x,.@y,0);
	warpguild .@m$,.@x,.@y,getcharid(2);
	@delay_ecall = gettimetick(2) + 180;
	end;
}

if he logs out log in, he can use @ecall again without delay

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