Hey, guys... I saw this script below, from @Nova, and wondered if was possible to turn it into a command, similar to @duel, where players will bet their characters.
//===== rAthena Script =======================================
//= Character Deletion on Death Script
//===== By: ==================================================
//= Nova http://www.novaragnarok.com
//============================================================
- script PERMANENTDEATH -1,{
end;
OnPCDieEvent:
set .@deadplayer,getcharid(0);
message strcharinfo(0),"Game Over";
atcommand "@kick "+strcharinfo(0);
set .@j, getarraysize( .char_delete$ );
for (.@i = 0; .@i < .@j; .@i++) {
query_sql("DELETE FROM `"+ .char_delete$[.@i] +"` WHERE `char_id` = '"+ .@deadplayer +"'");
}
query_sql "DELETE FROM `party` WHERE `leader_char` = '"+.@deadplayer+"'";
end;
OnInit:
setarray .char_delete$[0],"bonus_script","char","cart_inventory","elemental","friends","global_reg_value","guild","guild_member","homunculus","hotkey","inventory","memo","mercenary","mercenary_owner","pet","quest","sc_data","skill","skillcooldown";
end;
}
- script Duel_Death-1,{OnCommand:if(.duel){
message strcharinfo(0),"There is a duel going on right now. Wait for it to finish.";}elseif(.duel_delay > gettimetick(2)){
message strcharinfo(0),"There's a global delay between duels. You have to wait "+Time2Str(.duel_delay)+".";}elseif(@wait_duelaid){
message strcharinfo(0),"You're already waiting for a confirmation. Relog to cancel.";}else{set.@player$,strcharinfo(0);set.@oid,getcharid(3);set.@enemy$,implode(.@atcmd_parameters$," ");set.@aid,getcharid(3,.@enemy$);set.@cid,getcharid(0,.@enemy$);if(!.@aid){
message strcharinfo(0),"That character is not online.";}elseif(getvar(@duel,.@cid)){
message strcharinfo(0),"That character is already in a duel.";}elseif(.@oid==.@aid){
message strcharinfo(0),"You can't duel yourself.";}else{set@duel_creator,1;set@wait_duelaid,.@aid;set@wait_duelaid,.@cid;
message strcharinfo(0),"Proposition sent. Wait for him/her to accept or reject.";
attachrid .@aid;set@wait_duelaid,.@oid;set@wait_duelcid,getcharid(0,.@player$);
message strcharinfo(0),.@player$+" wants to have a Death Duel with you. Use @acceptdd to accept it or @rejectdd to reject it.";}}
end;OnAccept:if(@duel){
message strcharinfo(0),"You're already in a duel.";}elseif(@duel_creator){
message strcharinfo(0),"You are the creater of the duel. Wait for the other player's answer.";}elseif(@wait_duelaid){set.@oid,getcharid(3);set.@cid,getcharid(0);if(isloggedin(@wait_duelaid,@wait_duelcid)){// Player 2.
mes "Are you really sure about this duel? ^ff0000Your character will be deleted^000000";if(prompt("No.","Yes.")==2){
message strcharinfo(0),"You accepted the duel. Prepare yourself.";
close2;
attachrid @wait_duelaid;// Player 1.
mes "Are you really sure about this duel? ^ff0000Your character will be deleted^000000";if(prompt("No","Yes")==2){if(isloggedin(.@oid,.@cid)){if(!.duel){
message strcharinfo(0),rid2name(.@oid)+" has accepted the duel.";
announce strcharinfo(0)+" e "+rid2name(.@oid)+" gonna make a Death Duel where the loser get's his character deleted!",bc_all|bc_blue;
announce "If you want to spectate use @spectatedd",bc_all|bc_blue;set.duel,true;set.cancel,false;
removemapflag .duel_map$,mf_pvp;
removemapflag .duel_map$,mf_pvp_nocalcrank;
setmapflag .duel_map$,mf_restricted,9;set.@first_id,getcharid(3);
explode .@xy$,.duel_xy$,",";set.@r,rand(2);set@duel,.@oid;
warp .duel_map$,atoi(.@xy$[2*.@r]),atoi(.@xy$[2*.@r+1]);
setoption 0x40,0;
pcblockmove .@first_id,1;
message strcharinfo(0),"You will not be able to move until the duel starts.";
attachrid .@oid;set@duel,.@first_id;set.@r,!.@r;
warp .duel_map$,atoi(.@xy$[2*.@r]),atoi(.@xy$[2*.@r+1]);
setoption 0x40,0;
pcblockmove .@oid,1;
message strcharinfo(0),"You will not be able to move until the duel starts.";
detachrid;set.@i,30;while(.@i>0&&!.cancel){if(!(.@i%10)||.@i<6)
announce .@i+" seconds for the duel between "+rid2name(.@first_id)+" vs "+rid2name(.@oid)+"!",bc_all|bc_blue;
sleep 1000;set.@i,.@i-1;}
pcblockmove .@first_id,0;
pcblockmove .@oid,0;
removemapflag .duel_map$,mf_restricted,9;if(.@i||.cancel){
announce "The Death Duel has been cancelled!",bc_all|bc_blue;}else{
announce "The Death Duel has just started!",bc_all|bc_blue;
setmapflag .duel_map$,mf_pvp;
setmapflag .duel_map$,mf_pvp_nocalcrank;set.@i,0;while(.@i<.time &&!.cancel &&.duel){
sleep 5000;set.@i,.@i+5;}if(.@i>=.time)
announce "Death Duel time is over. There was no winner.",bc_all|bc_blue;}
sleep 1000;if(.logout &&.duel){
announce "One of the participants logged out.",bc_all|bc_blue;set.logout,false;}if(.cancel)set.cancel,false;set.duel,false;
removemapflag .duel_map$,mf_pvp;
removemapflag .duel_map$,mf_pvp_nocalcrank;
addrid 5,0,.duel_map$;
setoption 0x40,0;if(!@duel){
atcommand "@rmvperm disable_pvp";}else{set@duel,0;set@duel_creator,0;set@wait_duelaid,0;set@wait_duelcid,0;}set.@i,5;while(.@i){
message strcharinfo(0),.@i+" second"+((.@i>1)?"s":"")+" to warp you out.";
sleep2 1000;set.@i,.@i-1;}
warp "prontera",156,161;
pcblockskill getcharid(3),0;
end;}else{
message strcharinfo(0),"I'm sorry but a duel started a few moments ago.";
message strcharinfo(0,.@cid),"I'm sorry but a duel started a few moments ago.";
end;}}else{
message strcharinfo(0),"The other player disconnected.";}}else{
message strcharinfo(0,.@cid),"The challenger changed his mind. The Death Duel is cancelled.";}}else{
message strcharinfo(0,@wait_duelcid),strcharinfo(0)+" has rejected the duel.";}set.duel,false;set.cancel,false;if(playerattached()){
message strcharinfo(0),"The duel has been cancelled.";if(isloggedin(@wait_duelaid,@wait_duelcid)){
message strcharinfo(0,@wait_duelcid),"The duel has been cancelled.";set@duel_creator,0,@wait_duelcid;set@wait_duelaid,0,@wait_duelcid;set@wait_duelcid,0,@wait_duelcid;set@duel,0,@wait_duelcid;}set@duel_creator,0;set@wait_duelaid,0;set@wait_duelcid,0;set@duel,0;
close;}}else{
message strcharinfo(0),"The character who challenged you is now offline.";set@wait_duelaid,0;set@wait_duelcid,0;}}else{
message strcharinfo(0),"There is no death duel invite for you right now.";}
end;OnReject:if(@duel){
message strcharinfo(0),"You're already in a duel.";}elseif(@duel_creator){
message strcharinfo(0),"You have to wait for your opponent to choose.";}elseif(@wait_duelaid){
message strcharinfo(0),"You rejected the duel.";if(isloggedin(@wait_duelaid,@wait_duelcid)){
message strcharinfo(0,@wait_duelcid),strcharinfo(0)+" has rejected the duel.";set.@id,@wait_duelaid;}set@wait_duelaid,0;set@wait_duelcid,0;if(.@id){
attachrid .@id;set@wait_duelaid,0;set@wait_duelcid,0;}set.cancel,true;
awake "Duel_Death";}else{
message strcharinfo(0),"You haven't been challenged to a duel.";}
end;OnSpectate:if(@duel){
message strcharinfo(0),"You're part of the duel.";}elseif(.duel){if(strcharinfo(3)==.duel_map$){
message strcharinfo(0),"You're already in the map.";}else{
setoption 0x40,1;
atcommand "@addperm disable_pvp";
pcblockskill getcharid(3),1;
warp .duel_map$,0,0;}}else{
message strcharinfo(0),"There isn't a duel right now.";}
end;OnFixDuel:set.duel,false;set.cancel,false;set.logout,false;set.duel_delay,false;
message strcharinfo(0),"Every variable has been cleared successfully.";
addrid 0;set@duel,0;set@wait_duelaid,0;set@wait_duelcid,0;set@duel_creator,0;
end;OnPCKillEvent:if(@duel&& killedrid ==@duel){set.duel_delay,gettimetick(2)+5*60;set.duel,false;set.@oid,getcharid(3);
announce strcharinfo(0)+" has won a Death Duel against "+rid2name(@duel)+"!",bc_all|bc_blue;
announce rid2name(@duel)+" was deleted.",bc_all|bc_blue;
attachrid @duel;
setarray .@char_delete$[0],"bonus_script","char","cart_inventory","elemental","friends","global_reg_value","guild","guild_member","homunculus","hotkey","inventory","memo","mercenary","mercenary_owner","pet","quest","sc_data","skill","skillcooldown";set.@deadplayer,getcharid(0);
message strcharinfo(0),"Game Over";
atcommand "@kick "+strcharinfo(0);set.@j, getarraysize(.@char_delete$);for(.@i=0;.@i<.@j;.@i++){
query_sql("DELETE FROM `"+.@char_delete$[.@i]+"` WHERE `char_id` = '"+.@deadplayer+"'");}
query_sql "DELETE FROM `party` WHERE `leader_char` = '"+.@deadplayer+"'";}
end;OnPCLogoutEvent:if(@wait_duelaid){
message strcharinfo(0,@wait_duelcid),"The other player disconnected.";set@wait_duelaid,0,@wait_duelcid;set@creator_duel,0,@wait_duelcid;set@wait_duelcid,0,@wait_duelcid;}if(@duel){set.cancel,true;set.logout,true;
awake "Duel_Death";}
end;OnPCLoginEvent:if(checkoption(0x40)&& getgmlevel()<60)
setoption 0x40,0;
end;OnInit:// Mapset.duel_map$,"map";//insert the map name// Coordinatesset.duel_xy$,"x,y,"+// x,y first player"x,y";// x,y second player
bindatcmd "deathduel","Duel_Death::OnCommand";
bindatcmd "acceptdd","Duel_Death::OnAccept";
bindatcmd "rejectdd","Duel_Death::OnReject";
bindatcmd "spectatedd","Duel_Death::OnSpectate";
bindatcmd "fixduel","Duel_Death::OnFix",60;// Max duration of a duel (seconds).set.time,20;
end;}// change "map" to the same map you've insert abovemap mapflag pvp
map mapflag pvp_nocalcrank
map mapflag noreturnmap mapflag nowarp
map mapflag nocommand 99map mapflag nowarpto
map mapflag nosave SavePointmap mapflag nomemo
map mapflag notrade
map mapflag nodrop
map mapflag nobranch
map mapflag nochat
map mapflag novending
map mapflag restricted 9
To forbid the use of some skills during the countdown (i asked for movement ones), you should add this to your db/import/skill_nocast_db.txt:
//----------------------------------------------------------------------------// Zone 9 - Death Duel//----------------------------------------------------------------------------150,8192//TF_BACKSLIDING426,8192//TK_HIGHJUMP
if it doesn't work, maybe you need to do this:
Edited by LucianoCP Script release made by @n0tttt
Question
LucianoCP
Hey, guys... I saw this script below, from @Nova, and wondered if was possible to turn it into a command, similar to @duel, where players will bet their characters.
//===== rAthena Script ======================================= //= Character Deletion on Death Script //===== By: ================================================== //= Nova http://www.novaragnarok.com //============================================================ - script PERMANENTDEATH -1,{ end; OnPCDieEvent: set .@deadplayer,getcharid(0); message strcharinfo(0),"Game Over"; atcommand "@kick "+strcharinfo(0); set .@j, getarraysize( .char_delete$ ); for (.@i = 0; .@i < .@j; .@i++) { query_sql("DELETE FROM `"+ .char_delete$[.@i] +"` WHERE `char_id` = '"+ .@deadplayer +"'"); } query_sql "DELETE FROM `party` WHERE `leader_char` = '"+.@deadplayer+"'"; end; OnInit: setarray .char_delete$[0],"bonus_script","char","cart_inventory","elemental","friends","global_reg_value","guild","guild_member","homunculus","hotkey","inventory","memo","mercenary","mercenary_owner","pet","quest","sc_data","skill","skillcooldown"; end; }
Thanks.
@edit:
Here's the final code by @n0tttt:
To forbid the use of some skills during the countdown (i asked for movement ones), you should add this to your db/import/skill_nocast_db.txt:
if it doesn't work, maybe you need to do this:
Script release made by @n0tttt
Link to comment
Share on other sites
Top Posters For This Question
32
30
5
2
Popular Days
Nov 29
25
Nov 30
17
Nov 28
16
Nov 26
5
Top Posters For This Question
LucianoCP 32 posts
n0tttt 30 posts
IsabelaFernandez 5 posts
Mael 2 posts
Popular Days
Nov 29 2018
25 posts
Nov 30 2018
17 posts
Nov 28 2018
16 posts
Nov 26 2018
5 posts
Popular Posts
LucianoCP
it does: i'll test this last code and update this post soon. @edit: i'm still able to use backsliding @edit2: it's the group_id. tried to use with a normal account and it
n0tttt
- script Duel_Death -1,{ OnCommand: if(.duel) { message strcharinfo(0),"There is a duel going on right now. Wait for it to finish."; } else if(.duel_delay > gettimetick(2)) { message strcha
n0tttt
What about now? - script Duel_Death -1,{ OnCommand: if(.duel) { message strcharinfo(0),"There is a duel going on right now. Wait for it to finish."; } else if(.duel_delay > gettimetick(2)
Posted Images
69 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.