Advertisement
Guest User

Untitled

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