Jump to content

Guih

Members
  • Posts

    40
  • Joined

  • Last visited

Everything posted by Guih

  1. Thanks for answering Emistry, I changed the script as you suggested: - script dualclientkicker -1,{ OnPCLoadMapEvent: set [email protected]$, strcharinfo(3); if(!compare(.tmp$,[email protected]$)) end; set [email protected], query_sql("select account_id from `char` right join login on login.account_id = `char`.account_id where `char`.online = 1 and login.last_mac = '"+ getcharmac() +"'",[email protected] ); //Annieruru Addition. if([email protected]) { for(set([email protected],0);[email protected]<[email protected];set([email protected],[email protected]+1)) { getmapxy([email protected]$,[email protected],[email protected],0,rid2name([email protected][[email protected]])); if([email protected][email protected]$&&rid2name([email protected][[email protected]])!=strcharinfo(0)) { dispbottom "Dual Client não disponível nesse mapa."; warp "vilasyn",91,54; } } } end; OnInit: setarray .maps$ , "aldeg_cas01", "gefg_cas01", "payg_cas01", "prtg_cas01", "guild_vs3"; set .lens , getarraysize(.maps$) ; for(set(.a,0);.a<.lens;set(.a,.a+1)) { setmapflag .maps$[.a], mf_loadevent ; set .tmp$ ,.tmp$+.maps$[.a]+","; } } But now I got this error: parse_callfunc: expected ')' to close argument list On this line and function: set [email protected], query_sql("select account_id from `char` right join login on login.account_id = `char`.account_id where `char`.online = 1 and login.last_mac = '"+ getcharmac() +"'",[email protected] ); //Annieruru Addition. getcharmac() So i guess I'll have to use the other method you told me about, but how can I insert it into this NPC? Thanks.
  2. Hello guys! So, i got this script from here and I need to do a few modifications that I've tried, but no success. This is the original script: - script dualclientkicker -1,{ OnPCLoadMapEvent: set [email protected]$, strcharinfo(3); if(!compare(.tmp$,[email protected]$)) end; set [email protected], query_sql("select account_id from `char` right join login on login.account_id = `char`.account_id where `char`.online = 1 and login.last_ip = '"+ getcharip() +"'",[email protected] ); //Annieruru Addition. if([email protected]) { for(set([email protected],0);[email protected]<[email protected];set([email protected],[email protected]+1)) { getmapxy([email protected]$,[email protected],[email protected],0,rid2name([email protected][[email protected]])); if([email protected][email protected]$&&rid2name([email protected][[email protected]])!=strcharinfo(0)) { dispbottom "Dual Client não disponível nesse mapa."; warp "vilasyn",91,54; } } } end; OnInit: setarray .maps$ , "aldeg_cas01", "gefg_cas01", "payg_cas01", "prtg_cas01", "guild_vs3"; set .lens , getarraysize(.maps$) ; for(set(.a,0);.a<.lens;set(.a,.a+1)) { setmapflag .maps$[.a], mf_loadevent ; set .tmp$ ,.tmp$+.maps$[.a]+","; } } I'd like to make it look after the last_mac field instead of the last_ip field. And also, I have a separated login database, I tried this: query_sql("select account_id from DB1.`char` right join DB2.login on login.account_id = `char`.account_id where `char`.online = 1 and login.last_ip = '"+ getcharip() +"'",[email protected] ); But no success. Could anyone help me in these two situations? Thanks in advance!
  3. Hello guys, need help with this script by Loki. It's working perfectly, except the verification part. It's logging two achievements for the same player, take a look: //===== Athena Script ===================================== //= Achievement System //===== By ================================================ //= Loki1991 //===== Version =========================================== //= 1.0 - First release //= 1.0.1 - Small hotfix for older rathena/eathena systems //===== Description ======================================= //= A full working Achivement System without any source edit! //= A well guide about this script can be found in rathena! //========================================================= - script achievementSystem -1,{ OnInit: //config start set $a_cache_expire,120; set $a_effect_id,908; set $a_cutin_delay,8000; //config end. Don't change anything below if you don't know what ya doing set $a_cached,0; end; //Cache achivements for [email protected]_expire secounds OnPCLoginEvent: if(gettimetick(2)-$a_cached <= $a_cache_expire && $a_cached != 0) goto InventoryChecker; query_sql("SELECT * FROM achievement",[email protected],[email protected]$,[email protected]$,[email protected],[email protected]$,[email protected]$,[email protected],[email protected]_val,[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected]); set [email protected],0; set $a_mode_other,0; set $a_mode_item,0; set $a_mode_mob,0; set $a_mode_mvp,0; set $a_mode_pvp,0; set $a_mode_lvl,0; set $a_mode_jlvl,0; while([email protected] < getarraysize([email protected])) { setd("$a_name_"[email protected][[email protected]]+"$",[email protected]$[[email protected]]); setd("$a_desc_"[email protected][[email protected]]+"$",[email protected]$[[email protected]]); setd("$a_mode_"[email protected][[email protected]],[email protected][[email protected]]); setd("$a_del_"[email protected][[email protected]]+"$",[email protected]$[[email protected]]); setd("$a_cutin_"[email protected][[email protected]]+"$",[email protected]$[[email protected]]); setd("$a_points_"[email protected][[email protected]],[email protected][[email protected]]); setd("$a_val1_"[email protected][[email protected]],[email protected][[email protected]]); setd("$a_val1a_"[email protected][[email protected]],[email protected][[email protected]]); setd("$a_val2_"[email protected][[email protected]],[email protected][[email protected]]); setd("$a_val2a_"[email protected][[email protected]],[email protected][[email protected]]); setd("$a_val3_"[email protected][[email protected]],[email protected][[email protected]]); setd("$a_val3a_"[email protected][[email protected]],[email protected][[email protected]]); setd("$a_val4_"[email protected][[email protected]],[email protected][[email protected]]); setd("$a_val4a_"[email protected][[email protected]],[email protected][[email protected]]); setd("$a_val5_"[email protected][[email protected]],[email protected][[email protected]]); setd("$a_val5a_"[email protected][[email protected]],[email protected][[email protected]]); setd("$a_val6_"[email protected][[email protected]],[email protected][[email protected]]); setd("$a_val6a_"[email protected][[email protected]],[email protected][[email protected]]); setd("$a_val7_"[email protected][[email protected]],[email protected][[email protected]]); setd("$a_val7a_"[email protected][[email protected]],[email protected][[email protected]]); setd("$a_val8_"[email protected][[email protected]],[email protected][[email protected]]); setd("$a_val8a_"[email protected][[email protected]],[email protected][[email protected]]); setd("$a_val9_"[email protected][[email protected]],[email protected][[email protected]]); setd("$a_val9a_"[email protected][[email protected]],[email protected][[email protected]]); setd("$a_sval_"[email protected][[email protected]],[email protected]_val[[email protected]]); switch([email protected][[email protected]]) { default: set $a_mode_other,$a_mode_other+1; break; case 1: set $a_mode_item,$a_mode_item+1; break; case 2: set $a_mode_mob,$a_mode_mob+1; break; case 3: set $a_mode_mvp,$a_mode_mvp+1; break; case 4: set $a_mode_pvp,$a_mode_pvp+1; break; case 5: set $a_mode_lvl,$a_mode_lvl+1; break; case 6: set $a_mode_jlvl,$a_mode_jlvl+1; break; } set [email protected],[email protected]+1; } set $achive_amount, [email protected]; set $a_cached,gettimetick(2); end; //Monsterkills (mode mob,mvp) OnNPCKillEvent: //killedrid if($a_mode_mob>0 || $a_mode_mvp>0) { set [email protected],0; while([email protected] < $achive_amount) { set [email protected],[email protected]+1; if((getd("$a_mode_"[email protected])!=2 && getd("$a_mode_"[email protected])!=3) || getd("a_done_"[email protected])==1 || getd("$a_del_"[email protected]+"$")=="y") continue; if(getd("$a_mode_"[email protected])==2 && $a_mode_mob > 0 && achieve_mob < $a_mode_mob) { set [email protected],0; set [email protected],0; while([email protected] < 9) { set [email protected],[email protected]+1; if(getd("$a_val"[email protected]+"_"[email protected])==0 || getd("$a_val"[email protected]+"a_"[email protected])==0) { set [email protected],[email protected]+1; continue; } //Skip trash or empty if(killedrid == getd("$a_val"[email protected]+"_"[email protected])) setd("a_state_"[email protected]+"_"[email protected],getd("a_state_"[email protected]+"_"[email protected]) + 1); if(getd("a_state_"[email protected]+"_"[email protected]) == getd("$a_val"[email protected]+"a_"[email protected])) set [email protected],[email protected]+1; } if([email protected] == 9) callfunc "achieve",[email protected]; } else if(getd("$a_mode_"[email protected])==3 && $a_mode_mvp > 0 && achieve_mvp < $a_mode_mvp) { switch(killedrid) { default: break; case 1511: case 1647: case 1785: case 1630: case 1929: case 1039: case 1874: case 1272: case 1719: case 1046: case 1389: case 1112: case 1115: case 1957: case 1418: case 1871: case 1252: case 1768: case 1086: case 1649: case 1651: case 1832: case 1492: case 1734: case 1251: case 1779: case 1688: case 1646: case 1373: case 1147: case 1059: case 1150: case 1956: case 1087: case 1190: case 1038: case 1157: case 1159: case 1502: case 1623: case 1650: case 1583: case 1708: case 1312: case 1751: case 1685: case 1648: case 1917: case 1658: case 1885: case 2068: case 2238: case 2240: case 2236: case 2241: case 1980: case 2156: case 2022: case 2235: case 2237: case 2087: case 2165: case 2239: setd("a_state_"[email protected],getd("a_state_"[email protected]) + 1); if(getd("a_state_"[email protected]) >= getd("$a_sval_"[email protected])) callfunc "achieve",[email protected]; break; } } } } goto InventoryChecker; end; //PvP (mode pvp) OnPCKillEvent: if($a_mode_pvp==0 || achieve_pvp==$a_mode_pvp) end; set pvp_counter,pvp_counter+1; set [email protected],0; while([email protected] < $achive_amount) { set [email protected],[email protected]+1; if(getd("$a_mode_"[email protected])!=4 || getd("a_done_"[email protected])==1 || getd("$a_del_"[email protected]+"$")=="y") continue; if(pvp_counter >= getd("$a_sval_"[email protected])) callfunc "achieve",[email protected]; } end; //LevelUP (mode lvl) OnPCBaseLvUpEvent: if($a_mode_lvl==0 || achieve_lvl==$a_mode_lvl) end; set [email protected],0; while([email protected] < $achive_amount) { setd("a_done_"[email protected],0); set [email protected],[email protected]+1; if(getd("$a_mode_"[email protected]) !=5 || getd("a_done_"[email protected])==1 || getd("$a_del_"[email protected]+"$")=="y") continue; dispbottom "" + getd("$a_sval_"[email protected]); if(BaseLevel >= getd("$a_sval_"[email protected])) callfunc "achieve",[email protected]; } end; //JobLevelUP (mode jlvl) OnPCJobLvUpEvent: if($a_mode_jlvl==0 || achieve_jlvl==$a_mode_jlvl) end; set [email protected],0; while([email protected] < $achive_amount) { set [email protected],[email protected]+1; if(getd("$a_mode_"[email protected])!=6 || getd("a_done_"[email protected])==1 || getd("$a_del_"[email protected]+"$")=="y") continue; if(JobLevel >= getd("$a_sval_"[email protected])) callfunc "achieve",[email protected]; } end; //Get X Amount of Items in your inventar (mode item) //will be called after mob kill or map change InventoryChecker: if($a_mode_item==0 || achieve_item==$a_mode_item) end; set [email protected],0; while([email protected] < $achive_amount) { set [email protected],[email protected]+1; if(getd("$a_mode_"[email protected]) !=1 || getd("a_done_"[email protected])==1 || getd("$a_del_"[email protected]+"$")=="y") continue; set [email protected],0; set [email protected],0; while([email protected] < 9) { set [email protected],[email protected]+1; if(getd("$a_val"[email protected]+"_"[email protected])==0 || getd("$a_val"[email protected]+"a_"[email protected])==0) { set [email protected],[email protected]+1; continue; } //Skip trash or empty if(countitem(getd("$a_val"[email protected]+"_"[email protected])) >= getd("$a_val"[email protected]+"a_"[email protected])) set [email protected],[email protected]+1; } if([email protected] == 9) callfunc "achieve",[email protected]; } end; //special (mode special) //No script. Just place 'callfunc "achieve",<<yourAchievementId>>;' anywhere in your script (below). } function script achieve { set [email protected],getarg(0); if([email protected] <= 0) end; //Param missing. WTF query_sql("SELECT id FROM achievement_log WHERE ach_id='"[email protected]+"' AND char_id='"[email protected]+"'",[email protected]); if([email protected]>0) { setd("a_done_"[email protected],1); end; } //User already got this achievement... Strange //Everything looks fine, lets do it query_sql("INSERT INTO achievement_log(ach_id,char_id,crdate) VALUES('"[email protected]+"','"+getcharid(0)+"','"+gettimetick(2)+"')"); switch(getd("$a_mode_"[email protected])) { default: set achieve_other,achieve_other+1; break; case 1: set achieve_item,achieve_item+1; break; case 2: set achieve_mob,achieve_mob+1; break; case 3: set achieve_mvp,achieve_mvp+1; break; case 4: set achieve_pvp,achieve_pvp+1; break; case 5: set achieve_lvl,achieve_lvl+1; break; case 6: set achieve_jlvl,achieve_jlvl+1; break; } if($a_effect_id>0) { specialeffect2 $a_effect_id; } announce strcharinfo(0)+" conseguiu a Conquista ["+getd("$a_name_"[email protected]+"$")+"]!",0; setd("a_done_"[email protected],1); query_sql("UPDATE `char` SET achievement_points=achievement_points+"+getd("$a_points_"[email protected])+" WHERE char_id="+getcharid(0)); if(getd("$a_cutin_"[email protected]+"$") != "") { cutin getd("$a_cutin_"[email protected]+"$"),4; sleep2 $a_cutin_delay; cutin "",255; } end; } function script getMonsterNameById { if(getarg(0)<=0) end; query_sql("SELECT iName FROM mob_db WHERE ID="+getarg(0)+" UNION SELECT iName FROM mob_db2 WHERE ID="+getarg(0),[email protected]$); return [email protected]$; } vilasyn,130,71,4 script Quadro de Conquistas 4_BOARD3,{ //Bob Config Params set [email protected]$,"[^FF0000Quadro de Conquistas^000000]"; //set [email protected]$,"sc_vicente01"; set [email protected],99; set [email protected]_gmMenu$,"Olá GM. Que tipo de menu você quer visualizar?"; set [email protected]_startInfo$,"Eu tenho todas as informações sobre as Conquistas que estão ativadas nesse servidor."; set [email protected]_category$,"Por favor, selecione a categoria."; set [email protected]_whichAch$,"Para qual conquista você quer obter detalhes?"; set [email protected]_points$,"Você têm essa quantidade de Pontos de Conquista:"; set [email protected]_close$,"Não estou interessado(a)."; set [email protected]_worth$,"Vale:"; set [email protected]_getPoints$,"pontos"; set [email protected]_bye$,"Tenha um ótimo dia!"; set [email protected]_kill$,"Cace"; set [email protected]_mvp$,"qualquer tipo de MvP"; set [email protected]_pvp$,"qualquer jogador"; set [email protected]_lvl$,"Alcance o nível de base"; set [email protected]_jlvl$,"Alcance o nível de classe"; set [email protected]_mode_item$,"Conquistas de Itens"; set [email protected]_mode_mob$,"Conquistas de Monstros"; set [email protected]_mode_mvp$,"Conquistas de MvP"; set [email protected]_mode_pvp$,"Conquistas de PvP"; set [email protected]_mode_lvl$,"Conquistas de Nível de Base"; set [email protected]_mode_jlvl$,"Conquistas de Nível de Classe"; set [email protected]_mode_other$,"Outras Conquistas"; query_sql("SELECT achievement_points FROM `char` WHERE char_id="+getcharid(0),[email protected]); //Check if a gm has set the player to a force action query_sql("SELECT ach_id, mode FROM achievement_force WHERE done='n' AND char_id="+getcharid(0),[email protected]_id,[email protected]$); if(getarraysize([email protected]_id) > 0) { set [email protected],0; while([email protected] < getarraysize([email protected]_id)) { //Clear log before there is to much trash inside query_sql("SELECT id FROM achievement_log WHERE ach_id="[email protected]_id[[email protected]]+" AND char_id="+getcharid(0),[email protected]_id); query_sql("UPDATE achievement_force SET done='y' WHERE done='n' AND ach_id="[email protected]_id[[email protected]]+" AND char_id="+getcharid(0)); if([email protected]_id > 0) query_sql("DELETE FROM achievement_log WHERE id="[email protected]_id); if([email protected]$=="add") { if(getd("a_done_"[email protected]_id[[email protected]]) == 1) { query_sql("UPDATE `char` SET achievement_points=achievement_points-"+getd("$a_points_"[email protected]_id[[email protected]])+" WHERE char_id="+getcharid(0)); } setd("a_done_"[email protected]_id[[email protected]],0); callfunc "achieve",[email protected]_id[[email protected]]; } else { query_sql("SELECT mode FROM achievement WHERE id="[email protected]_id[[email protected]],[email protected]); if([email protected] == 2) { set [email protected],0; while([email protected] < 9) { set [email protected],[email protected]+1; setd("a_state_"[email protected]_id[[email protected]]+"_"[email protected],0); } } else if([email protected] == 3) { setd("a_state_"[email protected]_id[[email protected]],0); } if(getd("a_done_"[email protected]_id[[email protected]]) == 1) { query_sql("UPDATE `char` SET achievement_points=achievement_points-"+getd("$a_points_"[email protected]_id[[email protected]])+" WHERE char_id="+getcharid(0)); } setd("a_done_"[email protected]_id[[email protected]],0); dispbottom "A Conquista "+getd("$a_name_"[email protected]_id[[email protected]]+"$")+" foi removida!"; } set [email protected],[email protected]+1; } } //Start the true script //cutin [email protected]$,2; //If a gm talks to this npc, call the gm menu, else the normal script if(getgmlevel() >= [email protected]) { mes [email protected]$; mes [email protected]_gmMenu$; next; menu "Menu do GM",L_GM,"Menu do Jogador",-,[email protected]_close$,L_End; } mes [email protected]$; mes [email protected]_startInfo$; next; mes [email protected]$; mes [email protected]_points$+" ^00AA00"[email protected]+"^000000"; mes [email protected]_category$; next; set [email protected],0; if($a_mode_other > 0) { set [email protected]$,[email protected][email protected]_mode_other$+":"; setarray [email protected][[email protected]],0; set [email protected],[email protected]+1; } if($a_mode_item > 0) { set [email protected]$,[email protected][email protected]_mode_item$+":"; setarray [email protected][[email protected]],1; set [email protected],[email protected]+1; } if($a_mode_mob > 0) { set [email protected]$,[email protected][email protected]_mode_mob$+":"; setarray [email protected][[email protected]],2; set [email protected],[email protected]+1; } if($a_mode_mvp > 0) { set [email protected]$,[email protected][email protected]_mode_mvp$+":"; setarray [email protected][[email protected]],3; set [email protected],[email protected]+1; } if($a_mode_pvp > 0) { set [email protected]$,[email protected][email protected]_mode_pvp$+":"; setarray [email protected][[email protected]],4; set [email protected],[email protected]+1; } if($a_mode_lvl > 0) { set [email protected]$,[email protected][email protected]_mode_lvl$+":"; setarray [email protected][[email protected]],5; set [email protected],[email protected]+1; } if($a_mode_jlvl > 0) { set [email protected]$,[email protected][email protected]_mode_jlvl$+":"; setarray [email protected][[email protected]],6; set [email protected],[email protected]+1; } if([email protected] == 0) { mes [email protected]$; mes "Ops! Não encontrei nenhuma Conquista =/"; //cutin "",255; close; } set [email protected]$,[email protected][email protected]_close$; set [email protected],select([email protected]$); set [email protected],[email protected]; if( [email protected] == [email protected]) goto L_End; next; mes [email protected]$; mes [email protected]_whichAch$; set [email protected],0; set [email protected],0; set [email protected]$,""; while([email protected] < $achive_amount) { set [email protected],[email protected]+1; if(getd("$a_mode_"[email protected]) != [email protected][[email protected]] || getd("$a_del_"[email protected]+"$")=="y") continue; if(getd("a_done_"[email protected]) == 1) { set [email protected]$,[email protected]$+"^00AA00"; } else { set [email protected]$,[email protected]$+"^FF0000"; } set [email protected]$,[email protected]$+getd("$a_name_"[email protected]+"$")+" ["+getd("$a_points_"[email protected])+"]^000000"+":"; setarray [email protected][[email protected]],[email protected]; set [email protected],[email protected]+1; } set [email protected]$,[email protected][email protected]_close$; set [email protected],select([email protected]$); set [email protected],[email protected]; if( [email protected] == [email protected]) { next; goto L_End; } next; mes [email protected]$; if(getd("$a_desc_"[email protected][[email protected]]+"$") != "") { mes getd("$a_desc_"[email protected][[email protected]]+"$"); next; mes [email protected]$; } mes "^0000AA"[email protected]_worth$+" "+getd("$a_points_"[email protected][[email protected]])+" "[email protected]_getPoints$+"^000000"; if([email protected][[email protected]] > 0) { if([email protected][[email protected]] == 1 || [email protected][[email protected]] == 2) { set [email protected],0; while([email protected] < 9) { set [email protected],[email protected]+1; if(getd("$a_val"[email protected]+"_"[email protected][[email protected]])>0 && getd("$a_val"[email protected]+"a_"[email protected][[email protected]])>0) { if([email protected][[email protected]] == 1) { mes "^0000AA"+getitemname(getd("$a_val"[email protected]+"_"[email protected][[email protected]]))+" ["+countitem(getd("$a_val"[email protected]+"_"[email protected][[email protected]]))+"/"+getd("$a_val"[email protected]+"a_"[email protected][[email protected]])+"]^000000"; } else { mes "^0000AA"[email protected]_kill$+" "+callfunc("getMonsterNameById",getd("$a_val"[email protected]+"_"[email protected][[email protected]]))+" ["+getd("a_state_"[email protected][[email protected]]+"_"[email protected])+"/"+getd("$a_val"[email protected]+"a_"[email protected][[email protected]])+"]^000000"; } } } } else { if([email protected][[email protected]] == 3) mes "^0000AA"[email protected]_kill$+" "+getd("$a_sval_"[email protected][[email protected]])+" "[email protected]_mvp$+" ["+getd("a_state_"[email protected][[email protected]])+"/"+getd("$a_sval_"[email protected][[email protected]])+"]^000000"; if([email protected][[email protected]] == 4) mes "^0000AA"[email protected]_kill$+" "+getd("$a_sval_"[email protected][[email protected]])+" "[email protected]_pvp$+" ["+pvp_counter+"/"+getd("$a_sval_"[email protected][[email protected]])+"]^000000"; if([email protected][[email protected]] == 5) mes "^0000AA"[email protected]_lvl$+" "+getd("$a_sval_"[email protected][[email protected]])+" ["+BaseLevel+"/"+getd("$a_sval_"[email protected][[email protected]])+"]^000000"; if([email protected][[email protected]] == 6) mes "^0000AA"[email protected]_jlvl$+" "+getd("$a_sval_"[email protected][[email protected]])+" ["+JobLevel+"/"+getd("$a_sval_"[email protected][[email protected]])+"]^000000"; } } next; goto L_End; L_GM: mes [email protected]$; mes [email protected]_category$; next; switch(select("Forçar Conquista ao Jogador","Habilitar/Desabilitar Conquistas","Limpar o cache","Comparar o Log com os Pontos de Conquista",[email protected]_close$)) { case 1: mes [email protected]$; mes "Se o jogador que você indiciar aqui falar comigo, você pode setar algumas ações que acontecerão, por exemplo, dar uma conquista, ou retirá-la."; mes "Qual o nome do jogador?"; next; input [email protected]_name$; next; mes [email protected]$; query_sql("SELECT char_id FROM `char` WHERE name='"[email protected]_name$+"'",[email protected]_id); if([email protected]_id > 0) { mes "Qual conquista?"; next; set [email protected],0; set [email protected],0; set [email protected]$,""; while([email protected] < $achive_amount) { set [email protected],[email protected]+1; if(getd("$a_del_"[email protected]+"$") == "y") continue; set [email protected]$,[email protected]$+getd("$a_name_"[email protected]+"$")+":"; set [email protected],[email protected]+1; setarray [email protected][[email protected]],[email protected]; } set [email protected]$,[email protected][email protected]_close$; set [email protected],select([email protected]$); if( [email protected] == [email protected]+1) goto L_GM; next; mes [email protected]$; mes "Adicionando ou removendo essa conquista?"; next; switch(select("Adicionar","Remover",[email protected]_close$)) { case 1: set [email protected]$,"add"; break; case 2: set [email protected]$,"del"; break; case 3: goto L_GM; break; } next; mes [email protected]$; mes "Jogador: "[email protected]_name$; mes "Conquista: "+getd("$a_name_"[email protected][[email protected]]+"$")+" (id="[email protected][[email protected]]+")"; mes "Modo: "[email protected]$; mes "Tem certeza?"; next; menu "Sim!",-,"Não",L_GM; mes [email protected]$; query_sql("INSERT INTO achievement_force(ach_id,char_id,mode) VALUES('"[email protected][[email protected]]+"','"[email protected]_id+"','"[email protected]$+"')"); if([email protected]$=="del") { switch(getd("$a_mode_"[email protected][[email protected]])) { default: set achieve_other,achieve_other-1; break; case 1: set achieve_item,achieve_item-1; break; case 2: set achieve_mob,achieve_mob-1; break; case 3: set achieve_mvp,achieve_mvp-1; break; case 4: set achieve_pvp,achieve_pvp-1; break; case 5: set achieve_lvl,achieve_lvl-1; break; case 6: set achieve_jlvl,achieve_jlvl-1; break; } } mes "Ação inserida! "[email protected]_name$+" deve falar comigo agora!"; next; } else { mes "Jogador não encontrado!"; next; } goto L_GM; break; case 2: mes [email protected]$; mes "Vermelho = desabilitada | Verde = habilitada."; mes "Be carefull on your achivements you added without triggers (mode 0). If you don't check there if the achivement is deleted, it may cause problems"; set [email protected],0; set [email protected]$,""; while([email protected] < $achive_amount) { set [email protected],[email protected]+1; if(getd("$a_del_"[email protected]+"$") == "n") { set [email protected]$,[email protected]$+"^00AA00"; } else { set [email protected]$,[email protected]$+"^FF0000"; } set [email protected]$,[email protected]$+getd("$a_name_"[email protected]+"$")+"^000000:"; } set [email protected]$,[email protected][email protected]_close$; next; set [email protected],select([email protected]$); if([email protected] <= [email protected]) { if(getd("$a_del_"[email protected]+"$") == "n") { set [email protected]$,"y"; } else { set [email protected]$,"n"; } query_sql("UPDATE achievement SET deleted='"[email protected]$+"' WHERE id="[email protected]); dispbottom "Achivement "+getd("$a_name_"[email protected]+"$")+" updated to deleted='"[email protected]$+"'!"; dispbottom "Clear Cache to see any effects!!!"; goto L_GM; } break; case 3: set $a_cached,0; dispbottom "Cache remove Flag has been set. When the next player login, the cache will be cleared"; goto L_GM; break; case 4: //if you build in something like "For 100 achivement points get 1 Cookie", this function would be buggy! query_sql("SELECT char_id,achievement_points,name FROM `char`",[email protected]_id,[email protected]_points,[email protected]_name$); set [email protected],0; dispbottom "Sync started!"; while([email protected] < getarraysize([email protected]_id)) { cleararray [email protected]_id[0],0,getarraysize([email protected]_id); query_sql("SELECT ach_id FROM achievement_log WHERE char_id="[email protected]_id[[email protected]],[email protected]_id); set [email protected],0; set [email protected],0; while([email protected] < getarraysize([email protected]_id)) { set [email protected],[email protected]+getd("$a_points_"[email protected]_id[[email protected]]); set [email protected],[email protected]+1; } if([email protected]_points[[email protected]] != [email protected]) { query_sql("UPDATE `char` SET achievement_points="[email protected]+" WHERE char_id="[email protected]_id[[email protected]]); dispbottom [email protected]_name$[[email protected]]+" had "[email protected]_points[[email protected]]+" points, but should have "[email protected]+" points. Fixed!"; } set [email protected],[email protected]+1; } dispbottom "Sync done!"; goto L_GM; break; case 5: break; } goto L_End; L_End: mes [email protected]$; mes [email protected]_bye$; close2; //cutin "",255; end; } I believe there's something wrong in this part: query_sql("SELECT id FROM achievement_log WHERE ach_id='"[email protected]+"' AND char_id='"[email protected]+"'",[email protected]); if([email protected]>0) { setd("a_done_"[email protected],1); end; } //User already got this achievement... Strange Could anyone help me? Thanks!
  4. Hello guys, I'm having problem setting up FluxCP for multi servers. I have 3 servers, each one of them use a different database. The only thing in common is that they use the same login database (which is one of the 3 servers). So I need FluxCP to register only in one DB. How can I add them to FluxCP? Thanks!
  5. @Ai4rei Thanks for the amazing tool! Is there anyway to make different buttons for different clients? For example, I have 3 different clients, I'd like to make 3 start buttons, one for each client on the same tool, is that possible?
  6. Hello everyone! How can I disable the channel system while woe is happening? Something with OnAgitStart maybe? And then at the end enable it back. Is that possible? Thanks!
  7. Guih

    Apple Tree

    Thank you Emistry, it worked perfectly!
  8. Guih

    Apple Tree

    will work without problem I tried it, but it didn't work =/ It seems that the duplicates also get the variable of the main NPC, so I can't get the apples in the duplicates
  9. Guih

    Apple Tree

    Okay, that worked, thanks Skorm! But I need to duplicate it to a lot of maps, and with this script of yours I can't use the NPC on the other map if I've used it already... How can I make it usable per map? Thanks ;D
  10. Guih

    Apple Tree

    Hello everyone, I'd like to have an NPC where I could collect about 20 Apples per day and only one time independent of the person who collected. Is that possible? Thanks in advance!
  11. just add timer in script Onclock or Onminute Sorry, i'm not good with script... How's that supposed to make it spawn in all maps loaded in the server?
  12. Hey guys, about this script, is there anyway I can make it spawn in all maps automatically? Instead of putting all maps manually in the array... Thanks
  13. Hello everyone! I'm having a problem with the Item Shop in FluxCP. When I go to the Purchase section of it, the items don't show up. It gives me this message: There are currently no items for sale. When I activate the debug and error modes, the following error is shown up: Here are the files: modules/purchase/index.php: <?php if (!defined('FLUX_ROOT')) exit; $title = 'Loja de Itens'; require_once 'Flux/ItemShop.php'; $category = $params->get('category'); $categories = Flux::config("ShopCategories")->toArray(); $categoryName = Flux::config("ShopCategories.$category"); $categoryCount = array(); $shop = new Flux_ItemShop($server); $sql = sprintf("SELECT COUNT(id) AS total FROM %s.%s WHERE category = ?", $server->charMapDatabase, Flux::config('FluxTables.ItemShopTable')); $sql2 = sprintf("SELECT COUNT(id) AS total FROM %s.%s", $server->charMapDatabase, Flux::config('FluxTables.ItemShopTable')); $sth = $server->connection->getStatement($sql); $sth2 = $server->connection->getStatement($sql2); $sth2->execute(); $total = $sth2->fetch()->total; foreach ($categories as $catID => $catName) { $sth->execute(array($catID)); $categoryCount[$catID] = $sth->fetch()->total; } $categoryTotal = isset($category) ? $categoryCount[$category] : $total; $perPage = Flux::config("ItemShopItemPerPage"); $paginator = $this->getPaginator($categoryTotal, array('perPage' => $perPage)); $items = $shop->getItems($paginator, $category); ?> lib/Flux/ItemShop.php <?php require_once 'Flux/TemporaryTable.php'; require_once 'Flux/ItemExistsError.php'; class Flux_ItemShop { /** * @access public * @var Flux_Athena */ public $server; public function __construct(Flux_Athena $server) { $this->server = $server; } /** * Add an item to the shop. */ public function add($itemID, $categoryID, $cost, $quantity, $info, $useExisting = 0) { $db = $this->server->charMapDatabase; $table = Flux::config('FluxTables.ItemShopTable'); $sql = "INSERT INTO $db.$table (nameid, category, quantity, cost, info, use_existing, create_date) VALUES (?, ?, ?, ?, ?, ?, NOW())"; $sth = $this->server->connection->getStatement($sql); $res = $sth->execute(array($itemID, $categoryID, $quantity, $cost, $info, $useExisting)); $sth2 = $this->server->connection->getStatement('SELECT LAST_INSERT_ID() AS insID'); $res2 = $sth2->execute(); if ($res && $res2 && ($insertID=$sth2->fetch()->insID)) { return $insertID; } else { return false; } } /** * Modify item info in the shop. */ public function edit($shopItemID, $categoryID = null, $cost = null, $quantity = null, $info = null, $useExisting = null) { $catQ = ''; $crdQ = ''; $qtyQ = ''; $infQ = ''; $imgQ = ''; $bind = array(); if (!is_null($categoryID)) { $catQ = "category = ? "; $bind[] = (int)$categoryID; } if (!is_null($cost)) { if ($catQ) { $crdQ = ", cost = ? "; } else { $crdQ = "cost = ? "; } $bind[] = (int)$cost; } if (!is_null($quantity)) { if ($crdQ) { $qtyQ = ', quantity = ? '; } else { $qtyQ = "quantity = ? "; } $bind[] = (int)$quantity; } if (!is_null($info)) { if ($qtyQ) { $infQ = ', info = ? '; } else { $infQ = "info = ? "; } $bind[] = trim($info); } if (!is_null($useExisting)) { if ($infQ) { $imgQ = ', use_existing = ? '; } else { $imgQ = "use_existing = ? "; } $bind[] = (int)$useExisting; } if (empty($bind)) { return false; } $db = $this->server->charMapDatabase; $table = Flux::config('FluxTables.ItemShopTable'); $sql = "UPDATE $db.$table SET $catQ $crdQ $qtyQ $infQ $imgQ WHERE id = ?"; $sth = $this->server->connection->getStatement($sql); $bind[] = $shopItemID; return $sth->execute($bind); } /** * */ public function delete($shopItemID) { $db = $this->server->charMapDatabase; $table = Flux::config('FluxTables.ItemShopTable'); $sql = "DELETE FROM $db.$table WHERE id = ?"; $sth = $this->server->connection->getStatement($sql); return $sth->execute(array($shopItemID)); } /** * */ public function buy(Flux_DataObject $account, $shopItemID) { } /** * */ public function getItem($shopItemID) { $db = $this->server->charMapDatabase; if($this->server->isRenewal) { $fromTables = array("$db.item_db_re", "$db.item_db2"); } else { $fromTables = array("$db.item_db", "$db.item_db2"); } $temp = new Flux_TemporaryTable($this->server->connection, "$db.items", $fromTables); $shop = Flux::config('FluxTables.ItemShopTable'); $col = "$shop.id AS shop_item_id, $shop.category AS shop_item_category, $shop.cost AS shop_item_cost, $shop.quantity AS shop_item_qty, $shop.use_existing AS shop_item_use_existing, "; $col .= "$shop.nameid AS shop_item_nameid, $shop.info AS shop_item_info, items.name_japanese AS shop_item_name"; $sql = "SELECT $col FROM $db.$shop LEFT OUTER JOIN $db.items ON items.id = $shop.nameid WHERE $shop.id = ?"; $sth = $this->server->connection->getStatement($sql); if ($sth->execute(array($shopItemID))) { return $sth->fetch(); } else { return false; } } /** * */ public function getItems($paginator, $categoryID = null) { $sqlpartial = ""; $bind = array(); $db = $this->server->charMapDatabase; if($this->server->isRenewal) { $fromTables = array("$db.item_db_re", "$db.item_db2"); } else { $fromTables = array("$db.item_db", "$db.item_db2"); } $temp = new Flux_TemporaryTable($this->server->connection, "$db.items", $fromTables); $shop = Flux::config('FluxTables.ItemShopTable'); $col = "$shop.id AS shop_item_id, $shop.cost AS shop_item_cost, $shop.quantity AS shop_item_qty, $shop.use_existing AS shop_item_use_existing, "; $col .= "$shop.nameid AS shop_item_nameid, $shop.info AS shop_item_info, items.name_japanese AS shop_item_name"; if (!is_null($categoryID)) { $sqlpartial = " WHERE $shop.category = ?"; $bind[] = $categoryID; } $sql = $paginator->getSQL("SELECT $col FROM $db.$shop LEFT OUTER JOIN $db.items ON items.id = $shop.nameid $sqlpartial"); $sth = $this->server->connection->getStatement($sql); if ($sth->execute($bind)) { return $sth->fetchAll(); } else { return false; } } /** * */ public function deleteShopItemImage($shopItemID) { $serverName = $this->server->loginAthenaGroup->serverName; $athenaServerName = $this->server->serverName; $dir = FLUX_DATA_DIR."/itemshop/$serverName/$athenaServerName"; $files = glob("$dir/$shopItemID.*"); foreach ($files as $file) { unlink($file); } return true; } /** * */ public function uploadShopItemImage($shopItemID, Flux_Config $file) { if ($file->get('error')) { return false; } $validexts = array_map('strtolower', Flux::config('ShopImageExtensions')->toArray()); $extension = strtolower(pathinfo($file->get('name'), PATHINFO_EXTENSION)); if (!in_array($extension, $validexts)) { return false; } $serverName = $this->server->loginAthenaGroup->serverName; $athenaServerName = $this->server->serverName; $dir = FLUX_DATA_DIR."/itemshop/$serverName/$athenaServerName"; if (!is_dir(FLUX_DATA_DIR."/itemshop/$serverName")) { mkdir(FLUX_DATA_DIR."/itemshop/$serverName"); } if (!is_dir($dir)) { mkdir($dir); } $this->deleteShopItemImage($shopItemID); if (move_uploaded_file($file->get('tmp_name'), "$dir/$shopItemID.$extension")) { return true; } else { return false; } } } ?> Could anyone help me fixing it? Thanks in advance
  14. Hello guys! Is there a tool like that for rAthena? https://github.com/HerculesWS/StaffPlugins/tree/master/Haru/naviluagenerator If not, is it easy to convert? I don't know a lot about programming =/ Thanks ;D
  15. Hello everyone! I need help with making a script of a monster that can spawn it in all maps (in the interval of 1 hour when is killed). Is that possible? Thanks!
  16. I already worked it out using if statements. Thanks
  17. Yeah it was a typo, sorry. I can't change that value. If i change it to 10,15,20... The emulator reads it as 0.10, 0.15, 0.20x...
  18. Oh thanks, but that one doesn't change the rates randomly. I'm going to try this one, thanks to both of you! Okay, it's working perfectly. I had to modify it for: - script FloatingExp -1,{ OnMinute00: if ( gettime( 3 ) % 2 ) end; setarray [email protected][ 0 ], 1000, 1500, 2000, 2500, 3000, 3500, 4000; [email protected] = [email protected][ rand( getarraysize( [email protected] ) ) ]; setbattleflag "base_exp_rate", [email protected]; setbattleflag "job_exp_rate", [email protected]; announce "Floating Rate: The base and job rates were changed to "[email protected]+"x/"[email protected]+"x! Enjoy it!",bc_all,0xCC33B3; end; } The only problem now is that the announcement gives me, e.g.: "2000x/2000x", is that any way I can change it to show 20x?
  19. Hello everyone! I'd like to request a script that can change the base and job rates every 2 hours. But that change would be random. My current rates are 10x/10x and I'd like that rate to be changed to 10x/10x (keep current rate), 15x/15x, 20x/20x, 25x/25x, 30x/30x, 35x/35x and 40x/40x. The value would be random every two hours. Is that possible? Thank you very much!
  20. Having problem when showing Ladder: Infinity Loop on those functions: FRank: set [email protected],query_sql("SELECT `name`, `flvl`, `fexp`, `fpts`, `fcot` FROM `fishing_system` ORDER BY flvl DESC LIMIT 20",[email protected]$,[email protected],[email protected],[email protected],[email protected]); mes "Hall da Fama: Ranking Normal"; mes "^ff0000Nome^000000:^ff5500[ FL ]^000000:^005500[ FE ]^000000:^55007f[ FP ]^000000:^55ffff[ FC ]^000000"; //cutin [email protected]$,3; for(set [email protected],1; [email protected] <= [email protected]; set [email protected],[email protected]++) { mes [email protected]+". ["[email protected]$[0]+"] ("[email protected][0]+") ("[email protected][0]+") ("[email protected][0]+") ("[email protected][0]+")"; } next; menu "^005500[ Retornar ]^000000",MainMenu; close; FExpe: set [email protected],query_sql("SELECT `name`, `fsuc`, `ffail`, `fenc`, `fmom` FROM `fishing_system` ORDER BY fsuc DESC LIMIT 20",[email protected]$,[email protected],[email protected],[email protected],[email protected]); mes "Hall da Fama: Ranking Expedição"; if([email protected] == 0 ) { mes "^ff0000Nome^000000:^005500[ FS ]^000000:^55aa00[ FF ]^000000:^ff5500[ FN ]^000000:^55ffff[ FM ]^000000"; } if([email protected] == 1 ) { mes "^ff0000Nome^000000:^005500[ FS ]^000000:^55aa00[ FF ]^000000:^ff5500"; } for(set [email protected],1; [email protected] <= [email protected]; set [email protected],[email protected]++){ if([email protected] == 0 ) { mes [email protected]+". ["[email protected]$[0]+"] ("[email protected][0]+") ("[email protected][0]+") ("[email protected][0]+") ("[email protected][0]+")"; } if([email protected] == 1 ) { mes [email protected]+". ["[email protected]$[0]+"] ("[email protected][0]+") ("[email protected][0]+")"; } } //cutin [email protected]$,3; next; menu "^005500[ Retornar ]^000000",MainMenu; close; end; } Could anybody help me fixing?
  21. Mine is: (12/28/2014 16:36:21) [ Error ] : run_script: infinity loop ! (12/28/2014 16:36:21) [ Debug ] : Source (NPC): queueBK (invisible/not on map) (12/28/2014 19:05:10) [ Error ] : run_script: infinity loop ! (12/28/2014 19:05:10) [ Debug ] : Source (NPC): JailCounter (invisible/not on map) (12/28/2014 19:06:04) [ Error ] : run_script: infinity loop ! (12/28/2014 19:06:04) [ Debug ] : Source (NPC): BKTriggers (invisible/not on map) So when my players go to the prison, they can't get out, the NPC get stuck when it asks for password.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.