Brutalia2
ForumZinglordos cucclimuccli › [Cmud] Item

[Cmud] Item

Mclod Jatekos
#1
M
Mclod
Jatekos
<?xml version="1.0" encoding="ISO-8859-1" ?>
<cmud>
  <alias name="item" parsearg="false">
    <value><![CDATA[#IF (!%params(0)) {
// HELPINFO
row = %sql(targylista, %concat("SELECT COUNT('"_row_id"') FROM items"))
#print %crlf<C dodgerblue>%repeat("=",32)Targylista[ @row.Data() db]%repeat("=",23)</C>
#print %crlf<C orangered>%repeat(" ",30)Hasznalat: item [nev] </C>
#print %crlf<C dodgerblue>%repeat("=",35)%repeat("=",40)</C>
} {
#IF (%params(1)) {
  #VA ItemSearchName {%lower(%params(1))}
//fut az sql
#SQLDB targylista
row = %sql(targylista, %concat("SELECT * FROM items WHERE name = '"@ItemSearchName"'"))
#IF (@row.RecordCount() == 1) {
    #IF (!%pos("filter:",%params(1)))
    {
      #SHOW %ansi(15)%repeat("=",80)%ansi(7)     
      //azonositas rajz
      #SHOW %repeat(" ",30)%repeat(" ",%eval(10-%len(@row.Item("name"))))%ansi(5)@row.Item("name")%ansi(7)
      #SHOW %repeat(" ",30)%repeat(" ",%eval(10-%len(@row.Item("type"))))%ansi(11)~(@row.Item("type")~)%ansi(7)     
      #SHOW %repeat(" ",30)%ansi(2)Gyakorisaga%ansi(7)%repeat(" ",2)%ansi(12)@row.Item("rarity")%ansi(7)
      #IF ( !%null(@row.Item("i_set"))) {
        #SHOW %repeat(" ",30-%len(@row.Item("i_set")))%ansi(11)Ez a targy a %repeat(" ",1)@row.Item("i_set") kollkcio tagja%ansi(7)
        }
      #IF (!%null(@row.Item("varazslat"))) {
      #SHOW %ansi(6)%repeat("-",80)%ansi(7)
      #SHOW %repeat(" ",42-%len(@row.Item("varazslat")))%ansi(3)Varazslata %ansi(7)~[%ansi(11)@row.Item("varazslat")%ansi(7)~]%ansi(7)}
      #SHOW %ansi(6)%repeat("-",80)%ansi(7)
      #SHOW %repeat(" ",1)%ansi(3)Minimum szint%ansi(7) [%ansi(15)@row.Item("min_szint")%ansi(7)] %repeat(" ",%eval(%len(@row.Item("min_szint"))+2))%ansi(3)Erteke%ansi(7) [%ansi(15)@row.Item("amount")%ansi(7)] %ansi(14)arany%ansi(7)%repeat(" ",%eval(10-%len(@row.Item("amount"))))%ansi(3)Tomege%ansi(7) [%ansi(15)@row.Item("weight")%ansi(7)] deka
      #SHOW %repeat(" ",1)%if(!%null(@row.Item("subtype")),%ansi(3)Tipusa%ansi(7) [%ansi(15)@row.Item("subtype")%ansi(7)],"")%repeat(" ",%eval(14-%len(@row.Item("subtype"))))%if(!%null(@row.Item("dam")),%ansi(3)Sebzes%ansi(7) [%ansi(15)%subregex(@row.Item("dam"),"\s\s+","")%ansi(7)][%ansi(15)max: %dicemax(@row.Item("dam"))%ansi(7)],%ansi(3)Pancel%ansi(7) [%ansi(15)@row.Item("ac")%ansi(7)])           
      #SHOW %ansi(6)%repeat("~",80)%ansi(7)
      #SHOW %repeat(" ",1)%ansi(5)A targy bonuszai%ansi(7)
      #SHOW %repeat(" ",1)%ansi(3)Magiaimmunitas%ansi(7) ~[%if(@row.Item("mai")>0,"+"%ansi(15)@row.Item("mai")%ansi(7),"-")~]%repeat(" ",2-%len(@row.Item("mai")))%ansi(3)Meregimmunitas%ansi(7) ~[%if(@row.Item("mei")>0,"+"%ansi(15)@row.Item("mei")%ansi(7),"-")~]%repeat(" ",2-%len(@row.Item("mei")))%ansi(3)Talalatbonusz%ansi(7) ~[%if(@row.Item("tb")>0,"+"%ansi(15)@row.Item("tb")%ansi(7),"-")~]%repeat(" ",2-%len(@row.Item("tb")))%ansi(3)Sebzesbonusz%ansi(7) ~[%if(@row.Item("sb")>0,"+"%ansi(15)@row.Item("sb")%ansi(7),"-")~]
      #SHOW %repeat(" ",1)%if(@row.Item("magia")!=0,%ansi(3)Magia%ansi(7) [%ansi(15)@row.item("magia")%ansi(7)],"")%repeat(" ",%if(@row.Item("magia")<>0,11-%len(@row.Item("eletero"))),"")%if(@row.Item("eletero")!=0,%ansi(3)Eletero%ansi(7) [%ansi(15)@row.Item("eletero")%ansi(7)],"")%repeat(" ",%len(@row.Item("elet"))-8)
      #SHOW %repeat(" ",1)%if(@row.Item("allokepesseg")!=0,%ansi(3)Allokepesseg%ansi(7) [%ansi(15)@row.Item("allokepesseg")%ansi(7)],"")%repeat(" ",10-%len(@row.Item("bolcsesseg")))%if(@row.Item("bolcsesseg")!=0,%ansi(3)Bolcsesseg%ansi(7) [%ansi(15)@row.Item("bolcsesseg")%ansi(7)],"")%repeat(" ",10-%len(@row.Item("ero")))%if(@row.Item("ero")!=0,%ansi(3)Ero%ansi(7) [%ansi(15)@row.Item("ero")%ansi(7)],"")%repeat(" ",10-%len(@row.Item("iq")))%if(@row.Item("iq")!=0,%ansi(3)Intelligencia%ansi(7) [%ansi(15)@row.Item("iq")%ansi(7)],"")%repeat(" ",10-%len(@row.Item("karizma")))%if(@row.Item("karizma")!=0,%ansi(3)Karizma%ansi(7) [%ansi(15)@row.Item("karizma")%ansi(7)],"")%repeat(" ",10-%len(@row.Item("ugyesseg")))%if(@row.Item("ugyesseg")!=0,%ansi(3)Ugyesseg%ansi(7) [%ansi(15)@row.Item("ugyesseg")%ansi(7)],"")
      #IF (!%null(@row.Item("spell"))) {#SHOW %ansi(5)A targy altal adott varazslat %ansi(7)~[%ansi(13)@row.Item("spell")%ansi(7)~]%ansi(7).}     
      #SHOW %ansi(6)%repeat("~",80)%ansi(7)
      #SHOW %repeat(" ",19)%ansi(6)A kovetkezo osztalyok tagjai hasznalhatjak%ansi(7)
     
      #LOCAL $classes,$jellemek,$kiir
      #VA $classes {@row.Item("classes")}     
      #FORALL $classes {#SHOWP %repeat(" ",3) %if( %mod(%ismember(%i,$classes),5)=0 ,%i [%ansi(10)~+%ansi(7)]%char(10) ,%i [%ansi(10)~+%ansi(7)]%repeat(" ",5) ) }
      #sh %crlf
      #SHOW %repeat("-",80)
      $jellemek = @row.Item("jellemek")
      #IF (%pos("Jo",$jellemek)) {#ADDITEM $kiir {%ansi(15)Jo%ansi(7) ~[%ansi(10)~+%ansi(7)~]} }
      #IF (%pos("Se",$jellemek)) {#ADDITEM $kiir {%ansi(10)Se%ansi(7) ~[%ansi(10)~+%ansi(7)~]} }
      #IF (%pos("Go",$jellemek)) {#ADDITEM $kiir {%ansi(8)Go%ansi(7) ~[%ansi(10)~+%ansi(7)~]} }     
      $kiir = %replace($kiir,"|",%repeat(" ",10))
      #SHOW %repeat(" ",1)%ansi(3)Jellemek%ansi(reset)%repeat(" ",28)$kiir
      $kiir = %null
      #SHOW %ansi(6)%repeat("~",80)%ansi(7)
      #IF (!%null(@row.Item("i_viseli"))) {
        #SHOW %repeat(" ",1)%ansi(3)Viseli %ansi(7)%crlf
        #SHOW %repeat(" ",15)%ansi(14)%replace(@row.Item("i_viseli"),"|",%crlf%repeat(" ",15))%ansi(7)
      }
    #SHOW %ansi(15)%repeat("=",%eval(53-%len(@character)))%ansi(7)%ansi(147)[@character targylista]%ansi(7)%ansi(15)%repeat("=",14)%ansi(8)
    #CALL @row.Next
    } {
      //filter
    #SHOW %ansi(198) @row.Item("name")%crlf %repeat(" ",2)@ItemSearchFilterName %ansi(7)%crlf
    #CALL @row.Next
    }   
  } {
    //tobb item talalatakor listazzuk ki mindet
      #IF (@row.RecordCount() > 1) {
        row = %sql(targylista, %concat("SELECT * FROM items WHERE name LIKE '"@ItemSearchName"%'"))
        #SHOW %ansi(47) [@row.RecordCount()] db talalat van a listan! %ansi(7)
        #WHILE (!@row.Eof()) {
          #SHOW %ansi(198) @row.Item("name")%repeat(" ",2)Szint=@row.Item("min_szint")%repeat(" ",2)Gyakorisag=@row.Item("rarity")%repeat(" ",2)Tipus=@row.Item("type")%repeat(" ",2)Altipus=@row.Item("subtype")%repeat(" ",2)Suly=@row.Item("weight") %ansi(7)
          #CALL @row.Next     
        }
      }
      #IF (@row.RecordCount() < 1) {#SAY Nincs ilyen item [@ItemSearchName] meg a listadon!}
    }
  }
valtozo_urites
}
#SQLCLOSE]]></value>
    <notes><![CDATA[#IF (!%params(0)) {
// HELPINFO
#print %crlf<C dodgerblue>%repeat("=",20)Targylista%repeat("=",20)</C>
#print %crlf<C Chocolate>Filterek:</C>
#print %crlf<C ForestGreen>%repeat(" ",2)[_row_id|name|rarity|i_set|type|min_szint</C>
#print %crlf<C ForestGreen>%repeat(" ",2)amount|weight|subtype|dam|mai|mei|tb|sb</C>
#print %crlf<C ForestGreen>%repeat(" ",2)magia|hp|spell|classes|jellemek|varazslat</C>
#print %crlf<C ForestGreen>%repeat(" ",2)eletero|allokepesseg|ero|ugyesseg|bolcsesseg</C>
#print %crlf<C ForestGreen>%repeat(" ",2)stamina|iq|karizma|kozelharc|ac|viseli|arusitja] </C>
#print %crlf<C orangered>%repeat("",7)item [nev] </C>
#print <C orangered>%repeat("",7)item filter:[f1,f2,f3...] [nev]</C>
#print %crlf<C dodgerblue>%repeat("=",30)%repeat("=",20)</C>
} {
#IF (%params(1)) {
  //filterezes
  #IF (%pos("filter:",%params(1))) {
    #VA ItemSearchName {%lower(%params(2))}
    #IF (%pos("lathatatlan",@i_name)) {#VA i_name %replace(@i_name,"lathatatlan","")}
    #IF (%pos("magikus",@ItemSearchName)) {#VA ItemSearchName %replace(ItemSearchName,"magikus","")}
    #IF (%pos("mergezett",@ItemSearchName)) {#VA ItemSearchName %replace(@ItemSearchName,"mergezett","")}
    #IF (%pos("fertozott",@ItemSearchName)) {#VA ItemSearchName %replace(ItemSearchName,"fertozott","")}
    #IF (%pos("ragyog",@ItemSearchName)) {#VA ItemSearchName %replace(ItemSearchName,"ragyog","")}
    #IF (%pos("latatlan",@ItemSearchName)) {#VA ItemSearchName %replace(@ItemSearchName,"latatlan","")}
    #IF (%pos("(",@ItemSearchName)) {#VA ItemSearchName %replace(@ItemSearchName,"(","")}
    #IF (%pos(")",@ItemSearchName)) {#VA ItemSearchName %replace(@ItemSearchName,")","")}
    #IF (%pos("+",@ItemSearchName)) {#VA ItemSearchName %replace(@ItemSearchName,"+","")}
    #IF (%pos("'",@ItemSearchName)) {#VA ItemSearchName {%replace( @ItemSearchName, "'" , "" )}}
    #VA ItemSearchName {%subregex(  @ItemSearchName, "(\d+)", "")}
    #VA ItemSearchName %subregex(@ItemSearchName,"\s\s+","")
    #VA ItemSearchName {%lower(@ItemSearchName)}

    #VA ItemSearchFilter {%replace(%param(1),"filter:","")}
    #VA ItemSearchFilter {%replace(@ItemSearchFilter,",","|")}   
    ItemSearchFilterNum = 1
    #WHILE (%numitems(@ItemSearchFilter) >= @ItemSearchFilterNum) {
      #ADDITEM ItemSearchFilterName %concat(%item(@ItemSearchFilter,@ItemSearchFilterNum) %char(61) @row.Item(%item(@ItemSearchFilter,@ItemSearchFilterNum))|)
      #ADD ItemSearchFilterNum 1
    }
    #ADDKEY row_search %concat(@row.Item("name") @ItemSearchFilterName)   
  }
  #IF ( !%pos("filter:",%params(1)) ) {#VA ItemSearchName {%lower(%params(1))}}

//fut az sql
#SQLDB targylista
row = %sql(targylista, %concat("SELECT * FROM items WHERE name = '"@ItemSearchName"'"))
#IF (@row.RecordCount() == 1) {
    #IF (!%pos("filter:",%params(1)))
    {
      #SHOW %ansi(15)%repeat("=",%eval(48-%len(@character)))%ansi(7)%ansi(147)[@character targylista]%ansi(7)%ansi(15)%repeat("=",14)%ansi(8)   
      #SHOW %repeat(" ",5)%ansi(11)Nev:%ansi(7) %repeat(" ",%eval(10-%len(@row.Item("name"))))%ansi(78)@row.Item("name")%ansi(7)%crlf   
      #SHOW %repeat(" ",5)%ansi(10)Tipus%repeat(" ",15)Altipus%repeat(" ",9)Szint%repeat(" ",9)Rarity%ansi(7)
      #SHOW %repeat(" ",5)%repeat("-",68)
   
      #SHOW %repeat(" ",5)%ansi(14)@row.Item("type")%repeat(" ",%eval(19-%len(@row.Item("type")))) @row.Item("subtype")%repeat(" ",%eval(19-%len(@row.Item("subtype"))))@row.Item("min_szint")%repeat(" ",%eval(19-%len(@row.Item("rarity"))))@row.Item("rarity")%repeat(" ",9)%crlf
      #SHOW %repeat(" ",5)%ansi(10)Viseli:%ansi(7)%crlf
      #SHOW %repeat(" ",25)%ansi(14)%replace(@row.Item("i_viseli"),"|",%crlf%repeat(" ",25))%ansi(7)
      #SHOW %ansi(15)%repeat("=",75)%ansi(8)
    #CALL @row.Next
    } {
      //filter
    #SHOW %ansi(198) @row.Item("name")%crlf %repeat(" ",2)@ItemSearchFilterName %ansi(7)%crlf
    #CALL @row.Next     
    }
   
  } {
    //tobb item talalatakor listazzuk ki mindet
      #IF (@row.RecordCount() > 1) {
        row = %sql(targylista, %concat("SELECT * FROM items WHERE name LIKE '"@ItemSearchName"%'"))
        #SHOW %ansi(47) [@row.RecordCount()] db talalat van a listan! %ansi(7)
        #WHILE (!@row.Eof()) {
          #SHOW %ansi(198) @row.Item("name")%repeat(" ",2)Szint=@row.Item("min_szint")%repeat(" ",2)Gyakorisag=@row.Item("rarity")%repeat(" ",2)Tipus=@row.Item("type")%repeat(" ",2)Altipus=@row.Item("subtype")%repeat(" ",2)Suly=@row.Item("weight") %ansi(7)
          #CALL @row.Next     
        }
      }
      #IF (@row.RecordCount() < 1) {#SAY Nincs ilyen item [@ItemSearchName] meg a listadon!}
    }
  }
valtozo_urites
}

#SQLCLOSE]]></notes>
  </alias>
</cmud>
Lepj be a hozzaszolashoz!
Stílus