Jump to content
  • 0
mR L

script npc error getmapxy

Question

Hello rAthena, anyone can help me about my script PvP dotasound
I got an error about getmapxy invisible / not on map
so the map not appear when you kill / killed someone at pvp zone
thank you very much ~

Spoiler

//===== eAthena Script =======================================================
//= Dota Allstars announcement ( TXT & SQL )
//===== By: ==================================================================
//= ~AnnieRuru~
//===== Current Version: =====================================================
//= 1.8
//===== Compatible With: =====================================================
//= eAthena 12322 Trunk
//===== Description: =========================================================
//= Dota Announcement script
//= with a lot configurations, and anti-sit-killer feature
//= http://www.eathena.ws/board/index.php?s=&showtopic=175136&view=findpost&p=999446
//============================================================================
-    script    DOTAPVP    -1,{
OnInit:
// Config
set .sound, 1; // soundeffect : 0 - disable, 1 - play soundeffect to all players on map, 2 - play soundeffect to an area around the killer, 3 - play soundeffect to killer only
set .ownage, 2; // ownage announcement : 0 - disable, 1 - party owns, 2 - guild owns
set .announce, 0; // make announce to : 0 - global, 1 - map
set .announcemap, 1; // announce the map name in the announcement ? : 0 - off, 1 - on

set .announcekill, 1; // announce who pawn who's head : 0 - off, 1- on
set .msg_die, 0; // show message who kill you when die : 0 - off, 1- on
set .msg_kill, 0; // show message you kill who when killed someone : 0 - off, 1- on

set .gmnokill, 0; // GMs are not suppose to kill players. A GM with <this number> level or higher will do nothing. IF set to 60, GM60 and above kill any player will not get anything : 0 - off

set .killingspree, 3;
set .dominating, 4;
set .megakill, 5;
set .unstoppable, 6;
set .wickedsick, 7;
set .monsterkill, 8;
set .godlike, 9;
set .holyshit, 10;
set .continue, 1; // after beyond-godlike, every <this number> kills will make announcement again

set .owned, 5; // how many times the party/guild has to kill to announce ownage
set .owncontinue, 1; // after ownage, every <this number> party/guild cumulative kills will make ownage announce again

//    *NEW* anti-sit-killer system
// a player must kill another player with this minimum <this number> level to get the announcement and in the ladder.
// Otherwise only have streak ended announcement and killed player's streak reset.
// Its possible for a level 1 novice to kill a level 55 player and he/she will still get in the ladder
// but a level 55 kill a level 1 player will get nothing
// 0 - off this system ( default is 55, pk setting )
set .lvltokill, 0;

// when a player kill another same player <this number> times in a row, the player is warp back to save point.
// and the player's streak and ownage count will deduct accordingly
// 0 - off this system
set .counttopunish, 6;

// minimum level range to kill another player
// eg. when set to 20, player level 99 needs to kill another player with minimum level of 79 to get announcement and increase the kill rank.
// but a player with base level 50 kills a level 99 will also get the announcement
// higher base level cannot kill lower level, but lower level can kill higher level
// 0 - off this system
set .minlvlrange, 0;

// Config ends ------------------------------------------------------------------------------------------

//    to prevent bug happen
if ( .ownage < 0 || .ownage > 2 ) set .ownage, 0;
if ( .announce < 0 || .announce > 1 ) set .announce,0;
if ( .continue < 1 ) set .continue, 1;
if ( .owncontinue < 1 ) set .owncontinue, 1;
if ( .gmnokill <= 0 ) set .gmnokill, 100;
if ( .lvltokill <= 1 ) set .lvltokill, 0;
if ( .counttopunish <= 1 ) set .counttopunish, 0;
end;

//    script start
OnPCKillEvent:
if ( getgmlevel() >= .gmnokill ) end;
getmapxy [email protected]$,[email protected],[email protected],0;
if ( !attachrid(killedrid) ) end;
 if ( killerrid != getcharid(3) && ( .msg_die || .msg_kill ) ) {
     if ( .msg_die ) message strcharinfo(0),"You have been killed by "+ rid2name(killerrid);
     if ( .msg_kill ) message rid2name(killerrid),"You just killed "+ strcharinfo(0);
 }
 if ( @PlayersKilledStreak >= .holyshit )
     set [email protected]$,"Beyond Godlike";
 else if ( @PlayersKilledStreak >= .godlike )
     set [email protected]$,"Godlike";
 else if ( @PlayersKilledStreak >= .monsterkill )
     set [email protected]$,"Monster Kill";
 else if ( @PlayersKilledStreak >= .wickedsick )
     set [email protected]$,"Wicked Sick";
 else if ( @PlayersKilledStreak >= .unstoppable )
     set [email protected]$,"Unstoppable";
 else if ( @PlayersKilledStreak >= .megakill )
     set [email protected]$,"Mega-kill";
 else if ( @PlayersKilledStreak >= .dominating )
     set [email protected]$,"Dominating";
 else if ( @PlayersKilledStreak >= .killingspree )
     set [email protected]$,"Killing Spree";
if ( @PlayersKilledStreak >= .killingspree && killerrid == getcharid(3) )
 announce strcharinfo(0) +" has ended "+( (sex)?"him":"her" )+" own "+ [email protected]$ +"["+ @PlayersKilledStreak +"] streak "+( (.announcemap)?("at "+ [email protected]$):""),16|.announce;
else if ( @PlayersKilledStreak >= .killingspree )
 announce rid2name(killerrid) +" has ended "+ strcharinfo(0) +"'s "+ [email protected]$ +"["+ @PlayersKilledStreak +"] streak "+( (.announcemap)?("at "+ [email protected]$):""),16|.announce;
else if ( .announcekill )
 announce rid2name(killerrid) +" has pawned "+ strcharinfo(0) +"'s head "+( (.announcemap)?("at "+ [email protected]$):""),16|.announce;
set @PlayersKilledStreak,0;
set @dota_multikills,0;
if ( .ownage && getcharid(.ownage) ) {
 setd ".dotaown_"+ getcharid(.ownage), 0;
 set [email protected], getcharid(.ownage);
}
if ( killerrid == getcharid(3) || baselevel < .lvltokill ) end;
if ( .minlvlrange ) set [email protected], baselevel;
if ( !attachrid(killerrid) ) end;
if ( .minlvlrange && [email protected] + .minlvlrange < baselevel ) end;
if ( .counttopunish ) {
 for ( set [email protected],0; [email protected] < 60; set [email protected], [email protected] +1 ) {
     if ( [email protected] == gettime(2) ) continue;
     deletearray getd("@sitkillid"+ [email protected]), 128;
     deletearray getd("@sitkilltimes"+ [email protected]), 128;
 }
 for ( set [email protected],0; [email protected] < getarraysize( getd("@sitkillid"+ gettime(2)) ); set [email protected], [email protected] +1 ) {
     if ( getd("@sitkillid"+ gettime(2) +"["+ [email protected] +"]") != killedrid ) 
   continue;
     else {
   set [email protected], 1;
   setd "@sitkilltimes"+ gettime(2) +"["+ [email protected] +"]", getd("@sitkilltimes"+ gettime(2) +"["+ [email protected] +"]") +1;
   if ( getd("@sitkilltimes"+ gettime(2) +"["+ [email protected] +"]") >= .counttopunish ) {
       warp "SavePoint",0,0;
       announce strcharinfo(0) +" , Stop killing "+ rid2name(killedrid) + " !!!",0;
       debugmes strcharinfo(0) +" is sit-killing "+ rid2name(killedrid) +" for "+ getd("@sitkilltimes"+ gettime(2) +"["+ [email protected] +"]") + " times";
       logmes "is sit-killing "+ rid2name(killedrid) +" for "+ getd("@sitkilltimes"+ gettime(2) +"["+ [email protected] +"]") +" times";
       set @PlayersKilledStreak, @PlayersKilledStreak +1 - .counttopunish;
       if ( .ownage && getcharid(.ownage) )
     setd ".dotaown_"+ getcharid(.ownage), getd(".dotaown_"+ getcharid(.ownage) ) +1 - .counttopunish;
       end;
   }
     }
 }
 if ( [email protected] ) {
     setd "@sitkillid"+ gettime(2) +"["+ [email protected] +"]", killedrid;
     setd "@sitkilltimes"+ gettime(2) +"["+ [email protected] +"]", 1;
 }
}
set @PlayersKilledStreak, @PlayersKilledStreak + 1;
set PlayersKilled, PlayersKilled + 1;
 if ( @PlayersKilledStreak == .killingspree )
     setarray [email protected]$,"killingspree.wav","on a KILLING SPREE",".";
 else if ( @PlayersKilledStreak == .dominating )
     setarray [email protected]$,"dominating.wav","DOMINATING!",".";
 else if ( @PlayersKilledStreak == .megakill )
     setarray [email protected]$,"megakill.wav","on a MEGA Spree!",".";
 else if ( @PlayersKilledStreak == .unstoppable )
     setarray [email protected]$,"unstoppable.wav","UNSTOPPABLE!",".";
 else if ( @PlayersKilledStreak == .wickedsick )
     setarray [email protected]$,"wickedsick.wav","WICKED SICK!",".";
 else if ( @PlayersKilledStreak == .monsterkill )
     setarray [email protected]$,"monsterkill.wav","on a MONSTER Spree!",".";
 else if ( @PlayersKilledStreak == .godlike )
     setarray [email protected]$,"godlike.wav","GODLIKE!",". Will someone ever stop "+( (sex)?"him":"her" ) +"?";
 else if ( @PlayersKilledStreak >= .holyshit && ( (@PlayersKilledStreak - .holyshit) % .continue == 0 ) )
     setarray [email protected]$,"holyshit.wav","BEYOND GODLIKE!",". Someone kill "+( (sex)?"him":"her" ) +"!";
if ( [email protected]$[1] != "" ) {
 announce strcharinfo(0) +" "+ [email protected]$[1] +"["+ @PlayersKilledStreak +"] "+( (.announcemap)?("at "+ [email protected]$):"") + [email protected]$[2],16|.announce;
 if ( .sound == 1 ) soundeffectall [email protected]$[0],0,[email protected]$;
 else if ( .sound == 2 ) soundeffectall [email protected]$[0],0;
 else if ( .sound == 3 ) soundeffect [email protected]$[0],0;
}
set @dota_multikills, @dota_multikills + 1;
deltimer "DOTAPVP::OnStreakReset";
addtimer 11500,"DOTAPVP::OnStreakReset";
if ( .ownage ) {
 set [email protected], getcharid(.ownage);
 if ( [email protected] != [email protected] ) setd ".dotaown_"+ [email protected], getd(".dotaown_"+ [email protected] ) + 1;
}
set [email protected]_multikills, @dota_multikills;
set [email protected], getcharid(3);
sleep 1500;
if ( [email protected] && .ownage && [email protected] != [email protected] && getd(".dotaown_"+ [email protected]) >= .owned && ( ( getd(".dotaown_"+ [email protected]) - .owned ) % .owncontinue == 0 ) ) {
 if ( .announce ) mapannounce [email protected]$, "The "+( (.ownage == 1)?"party":"guild" )+" ["+( (.ownage == 1)?getpartyname([email protected]):getguildname([email protected]) )+"] is OWNING["+ getd(".dotaown_"+ [email protected]) +"] !!!",16;
 else announce "The "+( (.ownage == 1)?"party":"guild" )+" ["+( (.ownage == 1)?getpartyname([email protected]):getguildname([email protected]) )+"] is OWNING["+ getd(".dotaown_"+ [email protected]) +"] !!!",16;
 if ( .sound == 1 ) soundeffectall "ownage.wav",0,[email protected]$;
 else if ( .sound == 2 ) soundeffectall "ownage.wav",0;
 else if ( .sound == 3 && attachrid([email protected]) ) soundeffect "ownage.wav",0;
}
sleep 1250;
if ( !attachrid([email protected]) ) end;
if ( [email protected]_multikills == 2 ) {
 if ( .announce ) mapannounce [email protected]$, strcharinfo(0) +" just got a Double Kill !",16;
 else announce strcharinfo(0) +" just got a Double Kill !",16;
 if ( .sound == 1 ) soundeffectall "doublekill.wav",0,[email protected]$;
 else if ( .sound == 2 ) soundeffectall "doublekill.wav",0;
 else if ( .sound == 3 ) soundeffect "doublekill.wav",0;
}
else if ( [email protected]_multikills == 3 ) {
 if ( .announce ) mapannounce [email protected]$, strcharinfo(0) +" just got a TRIPLE KILL !!!!!!",16;
 else announce strcharinfo(0) +" just got a TRIPLE KILL !!!!!!",16;
 if ( .sound == 1 ) soundeffectall "triplekill.wav",0,[email protected]$;
 else if ( .sound == 2 ) soundeffectall "triplekill.wav",0;
 else if ( .sound == 3 ) soundeffect "triplekill.wav",0;
}
else if ( [email protected]_multikills == 4 ) {
 if ( .announce ) mapannounce [email protected]$, strcharinfo(0) +" just got a ULTRA KILL !!!!!!",16;
 else announce strcharinfo(0) +" just got a ULTRA KILL !!!!!!",16;
 if ( .sound == 1 ) soundeffectall "ultrakill.wav",0,[email protected]$;
 else if ( .sound == 2 ) soundeffectall "ultrakill.wav",0;
 else if ( .sound == 3 ) soundeffect "ultrakill.wav",0;
}
else if ( [email protected]_multikills >= 5 ) {
 if ( .announce ) mapannounce [email protected]$, strcharinfo(0) +" just got a RAMPAGE !!!!!!",16;
 else announce strcharinfo(0) +" just got a RAMPAGE !!!!!!",16;
 if ( .sound == 1 ) soundeffectall "rampage.wav",0,[email protected]$;
 else if ( .sound == 2 ) soundeffectall "rampage.wav",0;
 else if ( .sound == 3 ) soundeffect "rampage.wav",0;
}
end;
OnWhisperGlobal:
dispbottom "Your current Streak : "+ @PlayersKilledStreak;
dispbottom "Your total Kills    : "+ PlayersKilled;
if ( .ownage && getcharid(.ownage) )
 dispbottom "Your "+( (.ownage ==1)?"party":"guild" )+" Own  : "+ getd(".dotaown_"+ getcharid(.ownage) );
end;
OnStreakReset:
set @dota_multikills,0;
end;
}

 

Edited by lChyztl
  • Love 1
Link to comment
Share on other sites

7 answers to this question

Recommended Posts

  • 0

can't help but give a rep for posting 1 of my old script
I've been searching this for years 😍

with this script in hand, I think I can make an update soon

Edited by AnnieRuru
  • Upvote 1
Link to comment
Share on other sites

  • 0
4 hours ago, AnnieRuru said:

can't help but give a rep for posting 1 of my old script
I've been searching this for years 😍

with this script in hand, I think I can make an update soon

haha, I use old script
because some old script work perfectly at rAthena :))

Link to comment
Share on other sites

  • 0
12 hours ago, AnnieRuru said:

can't help but give a rep for posting 1 of my old script
I've been searching this for years 😍

with this script in hand, I think I can make an update soon

ill waiting for this 😄

 

Link to comment
Share on other sites

  • 0
On 3/17/2019 at 6:53 AM, melv0 said:

Sorry, may I ask
what the difference between 2 option above ?
because in another server, the script work perfectly using getmapxy [email protected]$,[email protected],[email protected],0;
but I don't know why in my server can't use this script

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

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.