yuhsing

Untitled

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