[script] n0=;7¹ø° ¹Ù´Ù Roll-and-Keep ´ÙÀ̽º n1=;Á¦ÀÛÀÚ ·ÎÅ°(http://www.lokasenna.pe.kr/rpg/) n2= n3=on *:text:GM:#: { n4= n5= set $+(%,gamemaster.,$chan) $nick n6= n7= msg $chan 14 $+ $nick is the GM for this channel. n8= n9=} n10= n11=on *:text:GM?:#: { n12= n13= if ($($+(%,gamemaster.,$chan),2) == $null) { n14= n15= msg $chan 14 There is no GM for this channel. n16= } n17= n18= else { n19= msg $chan $($+(%,gamemaster.,$chan),2) is the GM for this channel. n20= } n21= n22=} n23= n24=on *:text:*k*:#: { n25= n26= if (k isin $1) { n27= n28= set %kpos $pos($1,k) n29= n30= if (%kpos > 1) { n31= set %roll $left($1, $calc(%kpos - 1)) n32= } n33= if (%kpos < $len($1)) { n34= set %keep $right($1, $calc($len($1) - %kpos)) n35= } n36= n37= if ($count(%roll,r) != 0) { n38= set %roll $remove(%roll,r) n39= } n40= if ($count(%roll,!) != 0) { n41= set %roll $remove(%roll,!) n42= } n43= if ($count(%roll,-) != 0) { n44= set %roll $remove(%roll,-) n45= } n46= if ($count(%roll,_) != 0) { n47= set %roll $remove(%roll,_) n48= } n49= if ($count(%roll,+) != 0) { n50= set %roll $remove(%roll,+) n51= } n52= n53= if ($count(%keep,!) != 0) { n54= set %keep $remove(%keep,!) n55= } n56= if ($count(%keep,-) != 0) { n57= set %keep $remove(%keep,-) n58= } n59= if ($count(%keep,_) != 0) { n60= set %keep $remove(%keep,_) n61= } n62= if ($count(%keep,+) != 0) { n63= set %keep $remove(%keep,+) n64= } n65= n66= if ($count($1,!) != 0) { n67= set %noexplode noexplode n68= } n69= n70= if (%roll == $null) && (%keep != $null) { n71= set %roll %keep n72= } n73= elseif (%roll != $null) && (%keep == $null) { n74= set %keep %roll n75= } n76= n77= if (%keep > %roll) { n78= set %keep %roll n79= } n80= n81= set %num 1 n82= n83= if (%keep isnum) && (%roll isnum) { n84= n85= var %mod = $2- n86= n87= if ($calc($(%mod,2)) isnum) { n88= set %modifier $calc($(%mod,2)) n89= } n90= else { n91= unset %modifier n92= unset %mod n93= } n94= n95= if ($count($1,_) > 0) { n96= set %cheats $count($1,_) n97= set %cheats $calc(%cheats * -10) n98= } n99= if ($count($1,+) > 0) { n100= set %cheats $calc($count($1,+) * 10) n101= } n102= if ($count($1,_) > 0) && ($count($1,+) > 0) { n103= set %cheats $calc(($count($1,+) - $count($1,_)) * 10) n104= } n105= n106= ;debugging n107= ;msg $chan %cheats n108= n109= if (%cheats != $null) { n110= if (%cheats > 0) { n111= set %totalroll $calc(%roll + %cheats) n112= } n113= else { n114= set %totalroll $calc(%roll - %cheats) n115= } n116= } n117= else { n118= set %totalroll %roll n119= } n120= n121= while (%num <= %totalroll) { n122= n123= set %temp $rand(1,10) n124= n125= set $+(%,temp.text.,%num) %temp n126= set $+(%,temp.,%num) %temp n127= n128= if ((%temp == 10) && (%noexplode == $null)) { n129= while (%temp = 10) { n130= set %temp $rand(1,10) n131= n132= set $+(%,temp.text.,%num) $($+(%,temp.text.,%num),2) $+ + $+ %temp n133= set $+(%,temp.,%num) $calc($($+(%,temp.,%num),2) + %temp) n134= } n135= } n136= n137= if (%num == 1) { n138= set %dicetext $($+(%,temp.text.,%num),2) n139= set %dicetextnum $($+(%,temp.,%num),2) n140= } n141= n142= else { n143= set %dicetext %dicetext $+ , $+ $($+(%,temp.text.,%num),2) n144= set %dicetextnum %dicetextnum $+ , $+ $($+(%,temp.,%num),2) n145= } n146= n147= inc %num n148= } n149= ;WHILE LOOP ³¡ n150= n151= if (%cheats != $null) && (%cheats != 0) { n152= if (%cheats > 0) { n153= set %dicetextnum $sorttok(%dicetextnum,44,nr) n154= set %dicetext $sorttok(%dicetextnum,44,nr) n155= } n156= elseif (%cheats < 0) { n157= set %dicetextnum $sorttok(%dicetextnum,44,n) n158= set %dicetext $sorttok(%dicetextnum,44,n) n159= n160= } n161= set %dicetextnumlen $numtok(%dicetextnum,44) n162= n163= while (%dicetextnumlen > %roll) { n164= set %dicetext $deltok(%dicetext,%dicetextnumlen,44) n165= set %dicetextnum $deltok(%dicetextnum,%dicetextnumlen,44) n166= set %dicetextnumlen $numtok(%dicetextnum,44) n167= } n168= n169= } n170= set %sorted $sorttok(%dicetextnum,44,nr) n171= n172= set %num 1 n173= n174= while (%num <= %roll) { n175= n176= set $+(%,temp.,%num) $gettok(%sorted,%num,44) n177= n178= inc %num n179= } n180= n181= set %num 1 n182= n183= while (%num <= %keep) { n184= n185= if (%num == 1) { n186= n187= set %dicetext.new $($+(%,temp.,%num),2) n188= set %total.new $($+(%,temp.,%num),2) n189= n190= } n191= n192= else { n193= n194= set %dicetext.new %dicetext.new $+ + $+ $($+(%,temp.,%num),2) n195= set %total.new $calc(%total.new + $($+(%,temp.,%num),2)) n196= } n197= n198= inc %num n199= } n200= n201= if (%modifier != $null) { n202= set %total.new $calc($($+(%total.new,%mod),2)) n203= } n204= n205= if ($($+(%,dicecolor.,$nick),2) != $null) { n206= set %color $($+(%,dicecolor.,$nick),2) n207= } n208= else { n209= var %colors = 2,3,4,5,6,7,10,12,13 n210= var %num = $rand(1,$numtok(%colors,44)) n211= set %color $gettok(%colors,%num,44) n212= } n213= n214= n215= set %dice.message 14roll is %roll $+ d10( $+ %dicetext $+ ) %mod $+ , the highest %keep dice are %keep $+ d10( $+ %dicetext.new $+ ) %mod $+ = $+ %color %total.new $+ . n216= n217= if ($count($1,-) == 0) { n218= msg $chan  $+ %color $+ $nick $+ 14's %dice.message n219= } n220= else { n221= msg $nick %dice.message n222= } n223= n224= unset %dice.message n225= unset %temp.* n226= unset %noexplode n227= unset %color n228= unset %dicetext* n229= unset %total.new n230= unset %modifier n231= unset %roll n232= unset %keep n233= unset %sorted n234= unset %num n235= unset %cheats n236= n237= } n238= ;%roll, %keep ¼ýÀÚÀÎÁö È®Àγ¡ n239= n240= } n241= ;end if k is in word 1 n242= n243=} n244= n245= n246= n247=;ÆäÀÌÁî ±â´É n248= n249=on *:text:phase*:#: { n250= n251= if ($nick == $($+(%,gamemaster.,$chan),2)) { n252= n253= if ($($+(%,rolls.,$chan),2) == $null) { n254= if ($($+(%,round.,$chan),2) != $null) { n255= msg $chan 14End of Round $($+(%,round.,$chan),2) $+ . n256= } n257= else { n258= msg $chan 14There are no initiative rolls. n259= } n260= } n261= n262= else { n263= n264= if ($($+(%,round.,$chan),2) == $null) { n265= set $+(%,round.,$chan) 0 n266= } n267= n268= if ($($+(%,phase.,$chan),2) == $null) { n269= set $+(%,phase.,$chan) 0 n270= } n271= if ($count($1,~) != 0) { n272= set $+(%,phase.,$chan) 10 n273= } n274= n275= if ($($+(%,phase.,$chan),2) < 10) { n276= n277= if ($($+(%,phase.,$chan),2) == 0) { n278= inc $+(%,round.,$chan),2 n279= } n280= n281= inc $+(%,phase.,$chan) n282= n283= var %num = 1 n284= n285= set $+(%,total.actors.,$chan) 0 n286= n287= while (%num <= $($+(%,rolls.,$chan),2)) { n288= n289= var %number = 1 n290= n291= ;identify the characters that have an action in this phase n292= n293= while (%number <= $numtok( $($+(%,init.,%num,.,$chan), 2), 44) ) { n294= n295= set %temp $gettok($($+(%,init.,%num,.,$chan),2), %number, 44) n296= set $+(%,phase.,$($+(%,phase.,$chan),2),.,%num,.,$chan) 0 n297= n298= if (%temp == $($+(%,phase.,$chan),2)) { n299= n300= ;get the number of times a given actor acts this phase, n301= ;and the total number of actors this phase n302= n303= inc $+(%,phase.,$($+(%,phase.,$chan),2),.,%num,.,$chan) n304= n305= inc $+(%,total.actors.,$chan) n306= n307= ;get the %actors and %totals n308= n309= set $+(%,totals.,$($+(%,total.actors.,$chan),2),.,$chan) $($+(%,init.total.,%num,.,$chan),2) n310= n311= ;msg $chan $($+(%,totals.,$($+(%,total.actors.,$chan),2),.,$chan),2) n312= n313= set $+(%,actors.,$($+(%,total.actors.,$chan),2),.,$chan) $($+(%,char.,%num,.,$chan),2) $+ . $+ $($+(%,init.total.,%num,.,$chan),2) n314= n315= ;decrease the %totals.n.#channel by %phase (DON'T DO THIS AGAIN THIS PHASE) n316= n317= set $+(%,init.total.,%num,.,$chan) $calc($($+(%,init.total.,%num,.,$chan),2) - $($+(%,phase.,$chan),2)) n318= n319= } n320= ;end if there is a match n321= n322= inc %number n323= } n324= ;end nested while n325= n326= inc %num n327= } n328= ;end loop through initiative rolls n329= n330= ;start looping through actors this phase n331= n332= ;¶ó¿îµå Ç¥½Ã n333= if ($($+(%,phase.,$chan),2) == 1) { n334= msg $chan 14Start of Round $($+(%,round.,$chan),2) $+ . n335= } n336= n337= if ($($+(%,total.actors.,$chan),2) > 0) && ($($+(%,total.actors.,$chan),2) != $null) { n338= n339= var %num = 1 n340= n341= while (%num <= $($+(%,total.actors.,$chan),2)) { n342= n343= if (%num == 1) { n344= set $+(%,totals.,$chan) $($+(%,totals.,%num,.,$chan), 2) n345= n346= } n347= else { n348= set $+(%,totals.,$chan) $($+(%,totals.,$chan),2) $+ , $+ $($+(%,totals.,%num,.,$chan), 2) n349= } n350= n351= inc %num n352= } n353= ;end loop through characters acting this phase n354= ;end put initiative totals in a string n355= n356= ;sort totals, from biggest to smallest n357= set $+(%,totals.,$chan) $sorttok($($+(%,totals.,$chan),2),44,nr) n358= n359= var %num = 1 n360= n361= while (%num <= $($+(%,total.actors.,$chan),2)) { n362= n363= ;get name.initiative sets n364= n365= set %person.nom $($+(%,actors.,%num,.,$chan),2) n366= n367= ;divide into name and number n368= n369= set %person $gettok(%person.nom,1,46) n370= ;msg $chan %person n371= set %nom $gettok(%person.nom,2,46) n372= ;msg $chan %nom n373= set %matches 0 n374= n375= var %number = 1 n376= n377= while (%number <= $($+(%,total.actors.,$chan),2)) { n378= n379= if (%matches == 0) { n380= n381= set %temp $gettok($($+(%,totals.,$chan),2),%number,44) n382= n383= if (%nom == %temp) { n384= set %thread %person $+ ( $+ %nom $+ ) n385= set $+(%,totals.,$chan) $puttok($($+(%,totals.,$chan),2),%thread,%number,44) n386= inc %matches n387= } n388= ;end if there is match n389= n390= } n391= ;end loop if there is no match n392= n393= inc %number n394= } n395= ;end loop through %totals n396= n397= inc %num n398= } n399= ;end loop through actors and set in order of initiative totals n400= n401= msg $chan 14Phase $($+(%,phase.,$chan),2) $+ , acting character(s): $($+(%,totals.,$chan),2) $+ . n402= n403= } n404= ;end if there is anyone acting this phase n405= n406= n407= else { n408= n409= msg $chan 14Phase $($+(%,phase.,$chan),2) n410= n411= } n412= n413= } n414= ;ÆäÀÌÁî 10 ÀÌÇÏ È®ÀÎ ³¡ n415= n416= else { n417= unset $+(%,actors.,$chan) n418= unset $+(%,totals.$chan) n419= unset %matches n420= unset $+(%,total.actors.,$chan) n421= unset $+(%,rolls.,$chan) n422= unset $+(%,init.*.,$chan) n423= unset $+(%,phase.,$chan) n424= n425= msg $chan 14End of Round $($+(%,round.,$chan),2) $+ . n426= n427= } n428= } n429= ;¿ì¼±±Ç ±¼¸² ÀÖÀ½ È®ÀÎ n430= } n431= ;°ÔÀÓ¸¶½ºÅÍ È®ÀÎ ³¡ n432= n433=} n434=;ÆäÀÌÁî ±â´É ³¡ n435= n436= n437=;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; n438=/* n439=; GM ÁöÁ¤ - F11 n440= n441=alias setgm { n442= if ($dialog($setgamemaster) == $null) { n443= dialog -m setgamemaster setgamemaster n444= } n445=} n446= n447=alias f11 setgm n448= n449=dialog setgamemaster { n450= title "°ÔÀÓ¸¶½ºÅÍ ÁöÁ¤" n451= size 500 100 100 60 n452= option pixels n453= n454= text "GM ´Ð:", 1, 7 7 40 20 n455= edit %gamemaster, 2, 43 5 45 20, autohs %gamemaster n456= button "OK", 3, 7 30 80 20, ok n457=} n458=*/ n459=;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; n460= n461= n462=;¿ì¼±±Ç ±¼¸² n463= n464=on *:text:Ini*:#:{ n465= n466= var %count = $2 n467= n468= if (%count isnum) { n469= n470= if ($($+(%,rolls.,$chan),2) == $null) { n471= set $+(%,rolls.,$chan) 0 n472= set $+(%,phase.,$chan) 0 n473= } n474= n475= if ($nick == $($+(%,gamemaster.,$chan),2)) { n476= if ($3 != $null) { n477= set $+(%,actor.,$chan) $3- n478= ;GMÀÌ°í NPC À̸§ ÁöÁ¤ ÀÖ´Ù¸é Ç¥½ÃÇÒ À̸§Àº ÁöÁ¤ NPC¸íÀ¸·Î n479= } n480= else { n481= set $+(%,actor.,$chan) $nick n482= ;GMÀÌ°í NPC À̸§ ÁöÁ¤ ¾ø´Ù¸é Ç¥½ÃÇÒ À̸§Àº ´ÐÀ¸·Î n483= } n484= } n485= else { n486= set $+(%,actor.,$chan) $nick n487= ;Ç÷¹À̾î¶ó¸é Ç¥½ÃÇÒ À̸§Àº ´ÐÀ¸·Î n488= } n489= n490= var %number = 1 n491= set %overlap 0 n492= n493= while (%number <= $($+(%,rolls.,$chan),2)) { n494= if ($($+(%,actor.,$chan),2) == $($+(%,char.,%number,.,$chan),2)) { n495= inc %overlap n496= set %overlapping %number n497= } n498= inc %number n499= } n500= ;Áö±Ý±îÁöÀÇ ±¼¸²µéÀ» ·çÇÁÇØ °ãÄ¡´Â À̸§ ÀÖ³ª üũ n501= n502= ;°ãÄ¡Áö ¾Ê´Â´Ù¸é »õ·Î¿î ¹®Ç× ¸¸µé±â n503= n504= if (%overlap == 0) { n505= inc $+(%,rolls.,$chan) n506= n507= ;set $+(%,init.,$($+(%,rolls.,$chan),2),.,$chan) %temp n508= ;set $+(%,init.total.,$($+(%,rolls.,$chan),2),.,$chan) %temp n509= n510= set $+(%,char.,$($+(%,rolls.,$chan),2),.,$chan) $($+(%,actor.,$chan),2) n511= set $+(%,temp.rolls.,$chan) $($+(%,rolls.,$chan),2) n512= } n513= n514= ;°ãÄ£´Ù¸é ÀÌÀü °Í µ¤¾î¾²±â n515= else { n516= ;set $+(%,init.,%overlapping,.,$chan) %temp n517= ;set $+(%,init.total.,%overlapping,.,$chan) %temp n518= n519= set $+(%,char.,%overlapping,.,$chan) $($+(%,actor.,$chan),2) n520= set $+(%,temp.rolls.,$chan) %overlapping n521= } n522= n523= ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; n524= n525= var %num = 1 n526= n527= while (%num <= %count) { n528= n529= set %temp $rand(1,10) n530= n531= if (%num == 1) { n532= n533= set $+(%,init.,$($+(%,temp.rolls.,$chan),2),.,$chan) %temp n534= set $+(%,init.total.,$($+(%,temp.rolls.,$chan),2),.,$chan) %temp n535= } n536= ;end if %num 1 n537= n538= else { n539= set $+(%,init.,$($+(%,temp.rolls.,$chan),2),.,$chan) $($+(%,init.,$($+(%,temp.rolls.,$chan),2),.,$chan),2) $+ , $+ %temp n540= set $+(%,init.total.,$($+(%,temp.rolls.,$chan),2),.,$chan) $calc($($+(%,init.total.,$($+(%,temp.rolls.,$chan),2),.,$chan),2) + %temp) n541= } n542= ;end if %num not 1 n543= n544= inc %num n545= } n546= ;end while n547= n548= set $+(%,init.,$($+(%,temp.rolls.,$chan),2),.,$chan) $sorttok($($+(%,init.,$($+(%,temp.rolls.,$chan),2),.,$chan),2), 44, n) n549= n550= unset %temp n551= unset %actor n552= unset %overlapping n553= unset %overlap n554= n555= msg $chan 14 $+ $($+(%,char.,$($+(%,temp.rolls.,$chan),2),.,$chan),2) n556= msg $chan 14 $+ $($+(%,init.,$($+(%,temp.rolls.,$chan),2),.,$chan),2) ( $+ $($+(%,init.total.,$($+(%,temp.rolls.,$chan),2),.,$chan),2) $+ ) n557= n558= ;msg $chan $($+(%,char.,%temp.rolls),2) $+ ( $+ %temp.rolls $+ )ÀÇ Çൿ´Ü°è´Â $($+(%,init.,%temp.rolls),2) $+ , ¿ì¼±±Ç ÃÑÇÕÀº $($+(%,init.total.,%temp.rolls),2) $+ ÀÔ´Ï´Ù. n559= } n560= ;%count°¡ ¼ýÀÚÀÎÁö È®ÀÎ ³¡ n561=} n562=;¿ì¼±±Ç ±¼¸² ³¡ n563= n564= n565=;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; n566= n567= n568=on *:text:end combat:#: { n569= n570= if ($nick == $($+(%,gamemaster.,$chan),2)) { n571= n572= unset $+(%,phase.,$chan) n573= unset $+(%,round.,$chan) n574= unset $+(%,rolls.,$chan) n575= unset $+(%,char.,*,.,$chan) n576= unset $+(%,init.*,.,$chan) n577= unset $+(%,actors.,*,.,$chan) n578= unset %totals n579= unset $+(%,totals.,*,.,$chan) n580= n581= msg $chan 14The combat is over. n582= n583= } n584= ;°ÔÀÓ¸¶½ºÅÍ È®ÀÎ ³¡ n585= n586= else { n587= msg $nick 14You are not the gamemaster for this channel. Type 2GM14 if you want to be recognized as such. n588= } n589= ;°ÔÀÓ¸¶½ºÅÍ ¾Æ´Ñ °æ¿ì ³¡ n590= n591=} n592=;³¡³»±â ±â´É ³¡ n593= n594=;±ØÁÖ»çÀ§ ±â´É ½ÃÀÛ n595= n596= n597=on *:text:*±Ø*ÁÖ»çÀ§*:#:{ n598= n599= if ($nick == $($+(%,gamemaster.,$chan),2)) { n600= n601= var %num = 1 n602= n603= while (%num <= $nick($chan,0)) { n604= n605= if ($nick($chan,%num) isin $1-) && ($nick($chan,%num) != ÁÖ»çÀ§) { n606= n607= set %receiver $nick($chan,%num) n608= goto givedramadice n609= n610= } n611= n612= inc %num n613= } n614= ;end while n615= n616= goto endfunction n617= n618= } n619= n620= ;end if GM n621= n622= else { n623= set %receiver $nick n624= goto givedramadice n625= } n626= ;end if player n627= n628= :givedramadice n629= n630= ;BEGIN STRIPTONUMBER n631= n632= set %whole.string $1- n633= set %total.letters $len(%whole.string) n634= n635= while (%whole.string != $null) { n636= n637= if ($left(%whole.string,1) isnum) { n638= n639= ;debug n640= ;msg $chan %whole.string n641= n642= if (%diff == $null) { n643= set %diff $left(%whole.string,1) n644= } n645= else { n646= set %diff %diff $+ $left(%whole.string,1) n647= } n648= n649= } n650= ;if number, build number n651= n652= set %whole.string $right(%whole.string, $calc(%total.letters - 1)) n653= set %total.letters $len(%whole.string) n654= n655= } n656= ;end while n657= n658= if (%diff isnum) && (- isin $1-) { n659= set %diff $calc(%diff * -1) n660= } n661= n662= ;END STRIPTONUMBER n663= n664= if ($($+(%,ddice.,%receiver),2) == $null) { n665= set $+(%,ddice.,%receiver) 0 n666= } n667= n668= if (%receiver != $null) { n669= n670= if (%diff isnum) { n671= n672= set $+(%,ddice.,%receiver) $calc($($+(%,ddice.,%receiver),2) + %diff) n673= } n674= ;end if %diff isnum n675= n676= msg $chan 14 $+ %receiver $+ ÀÇ ±ØÁÖ»çÀ§´Â $($+(%,ddice.,%receiver),2) $+ °³ÀÔ´Ï´Ù. n677= n678= } n679= ;end if %receiver not $null n680= n681= :endfunction n682= n683= unset %diff n684= unset %receiver n685=} n686=;±ØÁÖ»çÀ§ ±â´É ³¡ n687= n688= n689=;»óó ±â´É ½ÃÀÛ n690=on *:text:*»óó*:#:{ n691= n692= ;BEGIN STRIPTONUMBER n693= n694= set %whole.string $1- n695= set %total.letters $len(%whole.string) n696= n697= while (%whole.string != $null) { n698= n699= if ($left(%whole.string,1) isnum) { n700= n701= ;debug n702= ;msg $chan %whole.string n703= n704= if (%diff == $null) { n705= set %diff $left(%whole.string,1) n706= } n707= else { n708= set %diff %diff $+ $left(%whole.string,1) n709= } n710= n711= } n712= ;if number, build number n713= n714= set %whole.string $right(%whole.string, $calc(%total.letters - 1)) n715= set %total.letters $len(%whole.string) n716= n717= } n718= ;end while n719= n720= if (%diff isnum) && (- isin $1-) { n721= set %diff $calc(%diff * -1) n722= } n723= n724= ;END STRIPTONUMBER n725= n726= n727= if ($nick == $($+(%,gamemaster.,$chan),2)) { n728= n729= var %num = 1 n730= n731= while (%num <= $nick($chan,0)) { n732= n733= if ($nick($chan,%num) isin $1-) { n734= n735= set %receiver $nick($chan,%num) n736= goto givewounds n737= n738= } n739= n740= inc %num n741= } n742= ;end while n743= n744= n745= if ($($+(%,npc.number.,$chan),2) == $null) { n746= set $+(%,npc.number.,$chan) 0 n747= } n748= n749= ;try to get NPC name n750= n751= var %npc = $remove($1-,»óó) n752= var %npc = $remove(%npc,¿¡°Ô) n753= var %npc = $remove(%npc,%diff) n754= var %npc = $remove(%npc,-) n755= var %npc = $remove(%npc,+) n756= n757= var %temp = $($+(%,npc.number.,$chan),2) n758= n759= var %num = 1 n760= n761= while (%num <= %temp) { n762= n763= if (%npc == $($+(%,npc.,%num,.,$chan),2)) { n764= set %temp %num n765= goto breakloop n766= } n767= n768= inc %num n769= } n770= ;loop through n771= n772= ;no previous matching NPCs -> new NPC name n773= var %temp = $calc(%temp + 1) n774= set $+(%,npc.,%temp,.,$chan) %npc n775= set $+(%,npc.number.,$chan) %temp n776= n777= :breakloop n778= n779= if ($($+(%,npc.wounds.,%temp,.,$chan),2) == $null) { n780= set $+(%,npc.wounds.,%temp,.,$chan) 0 n781= } n782= n783= if (%diff isnum) { n784= set $+(%,npc.wounds.,%temp,.,$chan) $calc($($+(%,npc.wounds.,%temp,.,$chan),2) + %diff) n785= } n786= n787= msg $chan 14 $+ $($+(%,npc.,%temp,.,$chan),2) $+ ÀÇ »óó´Â $($+(%,npc.wounds.,%temp,.,$chan),2) $+ 14°³ÀÔ´Ï´Ù. n788= n789= goto endfunction n790= n791= ;then label them %wound.npc1 etc... n792= ;and also %name.npc1 etc n793= n794= } n795= n796= ;end if GM n797= n798= else { n799= set %receiver $nick n800= goto givewounds n801= } n802= ;end if player n803= n804= :givewounds n805= n806= if (%receiver != $null) { n807= n808= if ($($+(%,wounds.,%receiver),2) == $null) { n809= set $+(%,wounds.,%receiver) 0 n810= } n811= n812= if (%diff isnum) { n813= set $+(%,wounds.,%receiver) $calc($($+(%,wounds.,%receiver),2) + %diff) n814= } n815= n816= msg $chan 14 $+ %receiver $+ ÀÇ »óó´Â $($+(%,wounds.,%receiver),2) $+ 14°³ÀÔ´Ï´Ù. n817= } n818= n819= :endfunction n820= n821= unset %diff n822= unset %receiver n823= n824=} n825=;»óó ±â´É ³¡ n826= n827= n828=;±Ø ºÎ»ó ³Ö´Â ±â´É ½ÃÀÛ n829=on *:text:*ºÎ»ó*:#:{ n830= n831= ;BEGIN STRIPTONUMBER n832= n833= set %whole.string $1- n834= set %total.letters $len(%whole.string) n835= n836= while (%whole.string != $null) { n837= n838= if ($left(%whole.string,1) isnum) { n839= n840= ;debug n841= ;msg $chan %whole.string n842= n843= if (%diff == $null) { n844= set %diff $left(%whole.string,1) n845= } n846= else { n847= set %diff %diff $+ $left(%whole.string,1) n848= } n849= n850= } n851= ;if number, build number n852= n853= set %whole.string $right(%whole.string, $calc(%total.letters - 1)) n854= set %total.letters $len(%whole.string) n855= n856= } n857= ;end while n858= n859= if (%diff isnum) && (- isin $1-) { n860= set %diff $calc(%diff * -1) n861= } n862= n863= ;END STRIPTONUMBER n864= n865= n866= if ($nick == $($+(%,gamemaster.,$chan),2)) { n867= n868= var %num = 1 n869= n870= while (%num <= $nick($chan,0)) { n871= n872= if ($nick($chan,%num) isin $1-) { n873= n874= set %receiver $nick($chan,%num) n875= goto givedwounds n876= n877= } n878= n879= inc %num n880= } n881= ;end while n882= n883= n884= if ($($+(%,npc.number.,$chan),2) == $null) { n885= set $+(%,npc.number.,$chan) 0 n886= } n887= n888= ;try to get NPC name n889= n890= var %npc = $remove($1-,±ØÀû) n891= var %npc = $remove(%npc,ºÎ»ó) n892= var %npc = $remove(%npc,±Ø) n893= var %npc = $remove(%npc,%diff) n894= var %npc = $remove(%npc, -) n895= var %npc = $remove(%npc, +) n896= n897= var %temp = $($+(%,npc.number.,$chan),2) n898= n899= n900= var %num = 1 n901= n902= while (%num <= %temp) { n903= n904= if (%npc == $($+(%,npc.,%num,.,$chan),2)) { n905= set %temp %num n906= goto breakloop n907= } n908= n909= inc %num n910= } n911= ;loop through NPC name list n912= n913= ;no previous matching NPC -> new NPC name n914= var %temp = $calc(%temp + 1) n915= set $+(%,npc.,%temp,.,$chan) %npc n916= set $+(%,npc.number.,$chan) %temp n917= n918= :breakloop n919= n920= if ($($+(%,npc.dwounds.,%temp,.,$chan),2) == $null) { n921= set $+(%,npc.dwounds.,%temp,.,$chan) 0 n922= } n923= n924= if (%diff isnum) { n925= n926= if (%diff > 0) { n927= set $+(%,npc.wounds.,%temp,.,$chan),2) 0 n928= } n929= n930= set $+(%,npc.dwounds.,%temp,.,$chan) $calc($($+(%,npc.dwounds.,%temp,.,$chan),2) + %diff) n931= } n932= n933= msg $chan 14 $+ $($+(%,npc.,%temp,.,$chan),2) $+ ÀÇ ±ØÀû ºÎ»óÀº $($+(%,npc.dwounds.,%temp,.,$chan),2) $+ 14°³ÀÔ´Ï´Ù. n934= n935= goto endfunction n936= n937= ;then label them %wound.npc1 etc... n938= ;and also %name.npc1 etc n939= n940= } n941= n942= ;end if GM n943= n944= else { n945= set %receiver $nick n946= goto givedwounds n947= } n948= ;end if player n949= n950= :givedwounds n951= n952= if (%receiver != $null) { n953= if ($($+(%,dwounds.,%receiver),2) == $null) { n954= set $+(%,dwounds.,%receiver) 0 n955= } n956= n957= if (%diff isnum) { n958= set $+(%,wounds.,%receiver) $calc($($+(%,dwounds.,%receiver),2) + %diff) n959= } n960= n961= msg $chan 14 $+ %receiver $+ ÀÇ ±ØÀû ºÎ»óÀº $($+(%,dwounds.,%receiver),2) $+ 14°³ÀÔ´Ï´Ù. n962= } n963= n964= :endfunction n965= n966= unset %diff n967= unset %receiver n968= unset %npc n969= n970=} n971=;ºÎ»ó ±â´É ³¡ n972= n973= n974= n975=on *:text:*´ë±âÇൿ:#:{ n976= if (%rolls != $null) && (%phase != $null) { n977= n978= if ($nick == %gamemaster) { n979= if ($1 == ´ë±âÇൿ) { n980= set %actor $nick n981= } n982= else { n983= set %actor $1 n984= } n985= } n986= ;GM n987= else { n988= set %actor $nick n989= } n990= ;player n991= n992= set %num 1 n993= n994= while (%num <= $rolls) { n995= n996= if ($($+(%,char.,%num),2) == %actor) { n997= set %hold %num n998= } n999= n1000= inc %num n1001= } n1002= ;end loop through rolls n1003= n1004= if ($($+(%,hold.count.,%hold),2) == $null) { n1005= set $+(%,hold.count.,%hold) 0 n1006= } n1007= n1008= inc $+(%,hold.count.,%hold) n1009= n1010= if ($($+(%,hold.phase.,%hold),2) == $null) { n1011= set $+(%,hold.phase.,%hold) %phase n1012= } n1013= else { n1014= set $+(%,hold.phase.,%hold) $($+(%,hold.phase.,%hold),2) $+ , $+ %phase n1015= } n1016= n1017= ;if ($($+(%,hold.total.,%hold),2) == $null) { n1018= ;set $+(%,hold.total.,%hold) $calc($($+(%,init.total.,%hold),2) + %phase) n1019= ;} n1020= ;else { n1021= ;set $+(%,hold.total.,%hold) $($+(%,hold.total.,%hold),2) $+ , $+ $calc($($+(%,init.total.,%hold),2) + %phase) n1022= ;} n1023= n1024= n1025= if (%hold != $null) { n1026= msg $chan 14 $+ %actor $+ ÀÇ ´ë±âÇൿÀÌ Ãß°¡µÇ¾ú½À´Ï´Ù. n1027= } n1028= ;end if matches a combatant n1029= n1030= unset %hold n1031= } n1032= ;ÀüÅõÁß ¿©ºÎ È®ÀÎ n1033= n1034=} n1035=;´ë±âÇൿ Ãß°¡ ±â´É ³¡ n1036= n1037=on *:text:*´ë±âÇൿ ¼Ò¸ð:#: { n1038= n1039= if ($nick == %gamemaster) { n1040= if ($1 == ´ë±âÇൿ) { n1041= set %actor $nick n1042= } n1043= else { n1044= set %actor $remove($1-,´ë±âÇൿ ¼Ò¸ð) n1045= } n1046= } n1047= ;GM n1048= else { n1049= set %actor $nick n1050= } n1051= ;player n1052= n1053= set %num 1 n1054= n1055= while (%num <= $rolls) { n1056= n1057= if ($($+(%,char.,%num),2) == %actor) { n1058= set %overlapping %num n1059= } n1060= inc %num n1061= } n1062= n1063= if (%overlapping != $null) { n1064= n1065= if ($numtok($($+(%,hold.phase.,%overlapping),2), 44) > 1) { n1066= if ($nick == %gamemaster) && ($4 == $null) { n1067= msg $chan 14´ë±âÇൿÀÌ µÎ°³ ÀÌ»ó ÀÖ½À´Ï´Ù. ( $+ $($+(%,hold.phase.,%overlapping),2) $+ ) n1068= } n1069= elseif ($nick == %gamemaster) && ($4 != $null) { n1070= n1071= n1072= } n1073= } n1074= ;end while n1075= n1076= n1077= } n1078= ;check overlap with combatants n1079= n1080=} n1081=;´ë±âÇൿ ¼Ò¸ð ³¡ n1082= n1083=;Á¦ÀÛÀÚ ·ÎÅ° (lokasenna.pe.kr/rpg/)