SHARE
TWEET

Untitled

a guest Dec 14th, 2019 97 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --ProgID: dungeon-71
  2. --Random attacks from Yllianth, fight trigger
  3.  
  4. function getTableKeys(tab)
  5.   local keyset = {}
  6.   for k,v in pairs(tab) do
  7.     keyset[#keyset + 1] = k
  8.   end
  9.   return keyset
  10. end
  11.  
  12. local function dverb(d)
  13.    local verbs = {
  14.    [1]="tickles",
  15.    [3]="bruises",
  16.    [5]="scratches",
  17.    [7]="grazes",
  18.    [9]="nicks",
  19.    [11]="scars",
  20.    [13]="hits",
  21.    [15]="injures",
  22.    [17]="wounds",
  23.    [19]="mauls",
  24.    [21]="maims",
  25.    [23]="mangles",
  26.    [25]="mars",
  27.    [27]="@GLACERATES@w",
  28.    [29]="@BDECIMATES@w",
  29.    [31]="@MDEVASTATES@w",
  30.    [36]="@bERADICATES@w",
  31.    [41]="@WOBLITERATES@w",
  32.    [46]="@gEXTIRPATES@w",
  33.    [51]="@CINCINERATES@w",
  34.    [56]="@CMUTILATES@w",
  35.    [61]="@RDISEMBOWELS@w",
  36.    [66]="@RMASSACRES@w",
  37.    [71]="@BDISMEMBERS@w",
  38.    [76]="@BRENDS@w",
  39.    [81]="@Y- BLASTS -@w",
  40.    [86]="@M-= DEMOLISHES =-@w",
  41.    [91]="@Y** @WSHREDS @Y**@w",
  42.    [96]="@M****@W DESTROYS@M ****@w",
  43.    [101]="@W*****@C PULVERIZES@W *****@w",
  44.    [111]="@B-=- VAPORIZES -=-@w",
  45.    [121]="@M<-==-> @CATOMIZES @M<-==->@w",
  46.    [131]="@C<@W-:-@C> @WASPHYXIATES  @C<@W-:-@C>@w",
  47.    [141]="@W<-*->@C RAVAGES @W<-*->@w",
  48.    [151]="@M<>*<> @CFISSURES  @M<>*<>@w",
  49.    [161]="@Y<*>@R<*> @BLIQUIDATES @R<*>@Y<*>@w",
  50.    [171]="@c<*>@Y<*>@R<*> @GEVAPORATES @R<*>@Y<*>@c<*>@w",
  51.    [181]="@Y<-@Y=-@Y> @RSUNDERS @Y<-@Y=-@Y>@w",
  52.    [191]="@W<=-=><=-=> @GTEARS INTO @W<=-=><=-=>@w",
  53.    [201]="@Y<->@B*@Y<=> @BWASTES @Y<=>@B*@Y<->@w",
  54.    [221]="@R<-+-><-*-> @WCREMATES @R<-*-><-+->@w",
  55.    [241]="@M<*><*>@R<*><*> ANNIHILATES <*><*>@M<*><*>@w",
  56.    [261]="@L<--*--><--*--> @BIMPLODES @L<--*--><--*-->@w",
  57.    [281]="@C<@W-@C><-=-><-> @WEXTERMINATES @C<-><-=-><@W-@C>@w",
  58.    [301]="@R<-==->@G<-==-> @RSHATTERS@G <-==->@R<-==->@w",
  59.    [331]="@G<@W*><-:-><*@G> @YSLAUGHTERS @G<@W*><-:-><*@G>@w",
  60.    [361]="@C<-*->@M<->@C<-*-> @MRUPTURES @C<-*->@M<->@C<-*->@w",
  61.    [400]="@Y<-*->@R<*>@Y<-*-> @GNUKES @Y<-*->@R<*>@Y<-*->@w",
  62.    [450]="@W-<[=-+-=]@B<@W:::<>:::@B>@W GLACIATES @B<@W:::<>:::@B>@W[=-+-=]>-@w",
  63.    [500]="@w<-=->@R<-:-*-:->@w<*--*> @RMETEORITES@w <*--*>@R<-:-*-:->@w<-=->@w",
  64.    [550]="@R<-:-@R>@Y<-:-*-:->@R<-*-> @WSUPERNOVAS @R<-*->@Y<-:-*-:->@R<-:->@w",
  65.    [600]="@Rdoes UNSPEAKABLE things@w",
  66.    [800]="@Rdoes UNTHINKABLE things@w",
  67.    [1200]="@Rdoes UNIMAGINABLE things@w",
  68.    [2000]="@Rdoes UNBELIEVABLE things@w"}
  69.  
  70.    local imatch = 1
  71.    local keys = getTableKeys(verbs)
  72.    table.sort(keys)
  73.    for key,value in ipairs(keys) do
  74.       if d >= value then imatch = value end
  75.    end
  76.    return verbs[imatch]
  77. end
  78.  
  79. local function doDmg(ch,dmin,dmax,msg,lethal)
  80.    --Standard Damage
  81.    local hp = ch.hp
  82.    damage(ch,dmin,dmax,LP_PLRONLY)
  83.    local dmg = hp - ch.hp
  84.    if lethal == true and ch.hp == 1 then dmg = dmg + 1 end
  85.    msg = string.gsub(msg,"DVERB",dverb(dmg).."@R")
  86.    msg = "@R"..msg.." @R["..dmg.."]@w"
  87.    echoat(ch,msg)
  88.    --Finish them off, no further messages after this!
  89.    if lethal == true and ch.hp == 1 then damage(ch,50000,50000,LP_PLRONLY+LP_LETHAL) end
  90. end
  91.  
  92. local function dirDmg(ch,dmin,dmax,msg,lethal)
  93.    --Direct Damage
  94.    local dmg = math.random(dmin,dmax)
  95.    if dmg > ch.hp then dmg = ch.hp - 1 end
  96.    ch.hp = ch.hp - dmg
  97.    if lethal == true and ch.hp == 1 then dmg = dmg + 1 end
  98.    msg = string.gsub(msg,"DVERB",dverb(dmg).."@R")
  99.    msg = "@R"..msg.." @R["..dmg.."]@w"
  100.    echoat(ch,msg)
  101.    --Finish them off, no further messages after this!
  102.    if lethal == true and ch.hp == 1 then damage(ch,50000,50000,LP_PLRONLY+LP_LETHAL) end
  103. end
  104.  
  105.  
  106. echoat(ch,"@cYllianth's eyes narrow and you feel yourself being squeezed!@w")
  107. doDmg(ch,26000,31000,"Yllianth's crushing force DVERB you!@w",true)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top