yuhsing

Untitled

Jun 14th, 2013
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.33 KB | None | 0 0
  1. //===== eAthena Script =======================================================
  2. //= Dota Allstars announcement ( TXT & SQL )
  3. //===== By: ==================================================================
  4. //= ~AnnieRuru~
  5. //===== Current Version: =====================================================
  6. //= 1.11
  7. //===== Compatible With: =====================================================
  8. //= eAthena 14279 Trunk
  9. //===== Topic: ===============================================================
  10. //= http://www.eathena.ws/board/index.php?showtopic=237765
  11. //===== Description: =========================================================
  12. //= Dota Announcement script
  13. //= plus anti-sit-killer feature
  14. //============================================================================
  15. - script DOTAPVP -1,{
  16. OnInit:
  17. // Config
  18. set .sound, 0; // 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
  19. set .ownage, 2; // ownage announcement : 0 - disable, 1 - party owns, 2 - guild owns
  20. set .announce, 1; // make announce to : 0 - global, 1 - map
  21. set .announcemap, 0; // announce the map name in the announcement ? : 0 - off, 1 - on
  22.  
  23. set .announcekill, 0; // announce who pawn who's head : 0 - off, 1- on
  24. set .msg_die, 1; // show message who kill you when die : 0 - off, 1- on
  25. set .msg_kill, 1; // show message you kill who when killed someone : 0 - off, 1- on
  26.  
  27. set .gmnokill, 100; // 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
  28.  
  29. set .killingspree, 7;
  30. set .dominating, 9;
  31. set .megakill, 12;
  32. set .unstoppable, 15;
  33. set .wickedsick, 18;
  34. set .monsterkill, 20;
  35. set .godlike,22;
  36. set .holyshit, 25;
  37. set .continue, 3; // after beyond-godlike, every <this number> kills will make announcement again
  38.  
  39. set .owned, 30; // how many times the party/guild has to kill to announce ownage
  40. set .owncontinue, 10; // after ownage, every <this number> party/guild cumulative kills will make ownage announce again
  41.  
  42. setarray .maptrigger$, // only these maps will trigger this script
  43. // "all", // comment this line to only trigger this script on these listed maps
  44. "turbo_roomc",
  45. "abyss_03c",
  46. "morocc_mem",
  47. "pvp_y_8-1",
  48. "pvp_y_6-2",
  49. "pvp_y_5-2";
  50.  
  51. // anti-sit-killer system
  52. // a player must kill another player with this minimum <this number> level to get the announcement and in the ladder.
  53. // Otherwise only have streak ended announcement and killed player's streak reset.
  54. // Its possible for a level 1 novice to kill a level 55 player and he/she will still get in the ladder
  55. // but a level 55 kill a level 1 player will get nothing
  56. // 0 - off this system ( default is 55, pk setting )
  57. set .lvltokill, 145;
  58. // set .lvltokill, 0;
  59.  
  60. // when a player kill another same player <this number> times in a row, the player is warp back to save point.
  61. // and the player's streak and ownage count will deduct accordingly
  62. // 0 - off this system
  63. set .counttopunish, 8;
  64.  
  65.  
  66. // minimum level range to kill another player
  67. // 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.
  68. // but a player with base level 50 kills a level 99 will also get the announcement
  69. // higher base level cannot kill lower level, but lower level can kill higher level
  70. // 0 - off this system
  71. set .minlvlrange, 5;
  72. // set .minlvlrange, 0;
  73.  
  74. // Config ends ------------------------------------------------------------------------------------------
  75.  
  76. // to prevent bug happen
  77. if ( .ownage < 0 || .ownage > 2 ) set .ownage, 0;
  78. if ( .announce < 0 || .announce > 1 ) set .announce,0;
  79. if ( .continue < 1 ) set .continue, 1;
  80. if ( .owncontinue < 1 ) set .owncontinue, 1;
  81. if ( .gmnokill <= 0 ) set .gmnokill, 100;
  82. if ( .lvltokill <= 1 ) set .lvltokill, 0;
  83. if ( .counttopunish <= 1 ) set .counttopunish, 0;
  84. set .maptriggersize, getarraysize(.maptrigger$);
  85. end;
  86.  
  87. // script start
  88. OnPCKillEvent:
  89. if ( getgmlevel() >= .gmnokill ) end;
  90. getmapxy .@map$, .@x, .@y, 0;
  91. if ( .maptrigger$ != "all" ) {
  92. for ( set .@i, 0; .@i < .maptriggersize; set .@i, .@i +1 ) {
  93. if ( .@map$ == .maptrigger$[.@i] ) break;
  94. }
  95. if ( .@i == .maptriggersize ) end;
  96. }
  97. attachrid killedrid;
  98. if ( killerrid != getcharid(3) && ( .msg_die || .msg_kill ) ) {
  99. if ( .msg_die ) message strcharinfo(0),"You have been killed by "+ rid2name(killerrid);
  100. if ( .msg_kill ) message rid2name(killerrid),"You just killed "+ strcharinfo(0);
  101. }
  102. if ( @PlayersKilledStreak >= .holyshit )
  103. set .@streakname$,"Beyond Godlike";
  104. else if ( @PlayersKilledStreak >= .godlike )
  105. set .@streakname$,"Godlike";
  106. else if ( @PlayersKilledStreak >= .monsterkill )
  107. set .@streakname$,"Monster Kill";
  108. else if ( @PlayersKilledStreak >= .wickedsick )
  109. set .@streakname$,"Wicked Sick";
  110. else if ( @PlayersKilledStreak >= .unstoppable )
  111. set .@streakname$,"Unstoppable";
  112. else if ( @PlayersKilledStreak >= .megakill )
  113. set .@streakname$,"Mega-kill";
  114. else if ( @PlayersKilledStreak >= .dominating )
  115. set .@streakname$,"Dominating";
  116. else if ( @PlayersKilledStreak >= .killingspree )
  117. set .@streakname$,"Killing Spree";
  118. if ( @PlayersKilledStreak >= .killingspree && killerrid == getcharid(3) )
  119. announce strcharinfo(0) +" has ended "+( (sex)?"him":"her" )+" own "+ .@streakname$ +"["+ @PlayersKilledStreak +"] streak "+( (.announcemap)?("at "+ .@map$):""),16|.announce;
  120. else if ( @PlayersKilledStreak >= .killingspree )
  121. announce rid2name(killerrid) +" has ended "+ strcharinfo(0) +"'s "+ .@streakname$ +"["+ @PlayersKilledStreak +"] streak "+( (.announcemap)?("at "+ .@map$):""),16|.announce;
  122. else if ( .announcekill && killerrid != getcharid(3) )
  123. announce rid2name(killerrid) +" has pawned "+ strcharinfo(0) +"'s head "+( (.announcemap)?("at "+ .@map$):""),16|.announce;
  124. set @PlayersKilledStreak,0;
  125. set @dota_multikills,0;
  126. if ( .ownage && getcharid(.ownage) ) {
  127. setd ".dotaown_"+ getcharid(.ownage), 0;
  128. set .@killedgroup, getcharid(.ownage);
  129. }
  130. if ( killerrid == getcharid(3) || baselevel < .lvltokill ) end;
  131. if ( .minlvlrange ) set .@killedlvl, baselevel;
  132. attachrid killerrid;
  133. if ( .minlvlrange && .@killedlvl + .minlvlrange < baselevel ) end;
  134. if ( .counttopunish ) {
  135. if ( @sitkillminute != gettime(2) ) {
  136. deletearray @sitkillid, 128;
  137. deletearray @sitkilltimes, 128;
  138. set @sitkillminute, gettime(2);
  139. }
  140. set .@sitkillsize, getarraysize(@sitkillid);
  141. for ( set .@i,0; .@i < .@sitkillsize; set .@i, .@i +1 ) {
  142. if ( @sitkillid[.@i] != killedrid ) continue;
  143. else {
  144. set @sitkilltimes[.@i], @sitkilltimes[.@i] +1 ;
  145. if ( @sitkilltimes[.@i] >= .counttopunish ) {
  146. warp "SavePoint",0,0;
  147. announce strcharinfo(0) +" , Stop killing "+ rid2name(killedrid) + " !!!",0;
  148. debugmes strcharinfo(0) +" is sit-killing "+ rid2name(killedrid) +" for "+ @sitkilltimes[.@i] + " times";
  149. logmes "is sit-killing "+ rid2name(killedrid) +" for "+ @sitkilltimes[.@i] +" times";
  150. set @PlayersKilledStreak, @PlayersKilledStreak +1 - .counttopunish;
  151. set PlayersKilled, PlayersKilled +1 - .counttopunish;
  152. if ( .ownage && getcharid(.ownage) )
  153. setd ".dotaown_"+ getcharid(.ownage), getd(".dotaown_"+ getcharid(.ownage) ) +1 - .counttopunish;
  154. end;
  155. }
  156. break;
  157. }
  158. }
  159. if ( .@i == .@sitkillsize ) {
  160. set @sitkillid[.@i], killedrid;
  161. set @sitkilltimes[.@i], 1;
  162. }
  163. }
  164. set @PlayersKilledStreak, @PlayersKilledStreak + 1;
  165. set PlayersKilled, PlayersKilled + 1;
  166. if ( @PlayersKilledStreak == .killingspree )
  167. setarray .@streakname$,"killingspree.wav","is on a KILLING SPREE","!";
  168. else if ( @PlayersKilledStreak == .dominating )
  169. setarray .@streakname$,"dominating.wav","is DOMINATING","!";
  170. else if ( @PlayersKilledStreak == .megakill )
  171. setarray .@streakname$,"megakill.wav","has a MEGA KILL","!";
  172. else if ( @PlayersKilledStreak == .unstoppable )
  173. setarray .@streakname$,"unstoppable.wav","is UNSTOPPABLE","!!";
  174. else if ( @PlayersKilledStreak == .wickedsick )
  175. setarray .@streakname$,"wickedsick.wav","is WICKED SICK","!!";
  176. else if ( @PlayersKilledStreak == .monsterkill )
  177. setarray .@streakname$,"monsterkill.wav","has a MONSTER KILL","!!";
  178. else if ( @PlayersKilledStreak == .godlike )
  179. setarray .@streakname$,"godlike.wav","is GODLIKE","!!!";
  180. else if ( @PlayersKilledStreak >= .holyshit && ( (@PlayersKilledStreak - .holyshit) % .continue == 0 ) )
  181. setarray .@streakname$,"holyshit.wav","is BEYOND GODLIKE",". Someone KILL "+( (sex)?"HIM":"HER" ) +"!!!!!!";
  182. if ( .@streakname$[1] != "" ) {
  183. announce strcharinfo(0) +" "+ .@streakname$[1] +"["+ @PlayersKilledStreak +"] "+( (.announcemap)?("at "+ .@map$):"") + .@streakname$[2],16|.announce;
  184. if( strcharinfo(3) != "pvp_y_room" ) mapannounce "pvp_y_room",strcharinfo(0) +" "+ .@streakname$[1] +"["+ @PlayersKilledStreak +"] "+( (.announcemap)?("at "+ .@map$):"") + .@streakname$[2],0;
  185. if ( .sound == 1 ) soundeffectall .@streakname$[0],0,.@map$;
  186. else if ( .sound == 2 ) soundeffectall .@streakname$[0],0;
  187. else if ( .sound == 3 ) soundeffect .@streakname$[0],0;
  188. }
  189. set @dota_multikills, @dota_multikills + 1;
  190. deltimer "DOTAPVP::OnStreakReset";
  191. addtimer 18000,"DOTAPVP::OnStreakReset";
  192. if ( .ownage ) {
  193. set .@sideid, getcharid(.ownage);
  194. if ( .@sideid != .@killedgroup ) setd ".dotaown_"+ .@sideid, getd(".dotaown_"+ .@sideid ) + 1;
  195. }
  196. set .@dota_multikills, @dota_multikills;
  197. set .@origin, getcharid(3);
  198. sleep 1500;
  199. if ( .@sideid && .ownage && .@sideid != .@killedgroup && getd(".dotaown_"+ .@sideid) >= .owned && ( ( getd(".dotaown_"+ .@sideid) - .owned ) % .owncontinue == 0 ) ) {
  200. if ( .announce ){
  201. mapannounce .@map$, "The "+( (.ownage == 1)?"party":"guild" )+" ["+( (.ownage == 1)?getpartyname(.@sideid):getguildname(.@sideid) )+"] is OWNING["+ getd(".dotaown_"+ .@sideid) +"] !!!",16;
  202. if( strcharinfo(3) != "pvp_y_room" ) mapannounce "pvp_y_room", "The "+( (.ownage == 1)?"party":"guild" )+" ["+( (.ownage == 1)?getpartyname(.@sideid):getguildname(.@sideid) )+"] is OWNING["+ getd(".dotaown_"+ .@sideid) +"] !!!",16;
  203. }
  204. else announce "The "+( (.ownage == 1)?"party":"guild" )+" ["+( (.ownage == 1)?getpartyname(.@sideid):getguildname(.@sideid) )+"] is OWNING["+ getd(".dotaown_"+ .@sideid) +"] !!!",16;
  205. if ( .sound == 1 ) soundeffectall "ownage.wav",0,.@map$;
  206. else if ( .sound == 2 ) soundeffectall "ownage.wav",0;
  207. else if ( .sound == 3 && attachrid(.@origin) ) soundeffect "ownage.wav",0;
  208. }
  209. sleep 1250;
  210. if ( !attachrid(.@origin) ) end;
  211. if ( .@dota_multikills == 2 ) {
  212. if ( .announce ) mapannounce .@map$, strcharinfo(0) +" just got a Double Kill !",16;
  213. else announce strcharinfo(0) +" just got a Double Kill !",16;
  214. if ( .sound == 1 ) soundeffectall "doublekill.wav",0,.@map$;
  215. else if ( .sound == 2 ) soundeffectall "doublekill.wav",0;
  216. else if ( .sound == 3 ) soundeffect "doublekill.wav",0;
  217. }
  218. else if ( .@dota_multikills == 3 ) {
  219. if ( .announce ) mapannounce .@map$, strcharinfo(0) +" just got a Triple Kill !!!",16;
  220. else announce strcharinfo(0) +" just got a Triple Kill !!!",16;
  221. if ( .sound == 1 ) soundeffectall "triplekill.wav",0,.@map$;
  222. else if ( .sound == 2 ) soundeffectall "triplekill.wav",0;
  223. else if ( .sound == 3 ) soundeffect "triplekill.wav",0;
  224. }
  225. else if ( .@dota_multikills == 4 ) {
  226. if ( .announce ) mapannounce .@map$, strcharinfo(0) +" just got a Ultra Kill !!!",16;
  227. else announce strcharinfo(0) +" just got a Ultra Kill !!!",16;
  228. if ( .sound == 1 ) soundeffectall "ultrakill.wav",0,.@map$;
  229. else if ( .sound == 2 ) soundeffectall "ultrakill.wav",0;
  230. else if ( .sound == 3 ) soundeffect "ultrakill.wav",0;
  231. }
  232. else if ( .@dota_multikills >= 5 ) {
  233. if ( .announce ) mapannounce .@map$, strcharinfo(0) +" is on a Rampage !!!",16;
  234. else announce strcharinfo(0) +" is on a Rampage !!!",16;
  235. if ( .sound == 1 ) soundeffectall "rampage.wav",0,.@map$;
  236. else if ( .sound == 2 ) soundeffectall "rampage.wav",0;
  237. else if ( .sound == 3 ) soundeffect "rampage.wav",0;
  238. }
  239. end;
  240. OnWhisperGlobal:
  241. dispbottom "Your current Streak : "+ @PlayersKilledStreak;
  242. dispbottom "Your total Kills : "+ PlayersKilled;
  243. if ( .ownage && getcharid(.ownage) )
  244. dispbottom "Your "+( (.ownage ==1)?"party":"guild" )+" Own : "+ getd(".dotaown_"+ getcharid(.ownage) );
  245. end;
  246. OnStreakReset:
  247. set @dota_multikills, 0;
  248. end;
  249. }
Advertisement
Add Comment
Please, Sign In to add comment