Jump to content

Racaae

Members
  • Posts

    113
  • Joined

  • Last visited

  • Days Won

    12

Racaae last won the day on March 15

Racaae had the most liked content!

2 Followers

Profile Information

  • Gender
    Male
  • Location
    Brasil

Recent Profile Visitors

2314 profile views

Racaae's Achievements

Metaling

Metaling (6/15)

  • Reacting Well
  • Problem Solver Rare
  • Dedicated
  • First Post
  • Collaborator

Recent Badges

47

Reputation

24

Community Answers

  1. Hello //============================================================ //= Last Standing (try your luck guessing O or X) by Racaae //============================================================ //= https://rathena.org/board/topic/141331-r-mini-game-last-man-standing/ //============================================================ prontera,147,150,0 script Evento Last Standing PORTAL,{ emotion F_Rand(ET_O,ET_X), getnpcid(0); mes "[" + strnpcinfo(1) + "]"; if ($@laststanding == 1) { mes "Quer participar do evento?"; if (select("Sim", "Não") == 2) { clear; if (checkweight(1119,3) == 0) { mes "- Você tem muitos itens."; mes "Organize seu inventário e tente novamente. -"; close; } mes "[" + strnpcinfo(1) + "]"; mes "Até mais."; close; } warp "quiz_02",249,385; end; } mes "O evento começa sempre aos 45 minutos de cada hora."; mes "Por exemplo, 10:45 12:45 18:45"; if (getgroupid() >= 99) mes " ", "^0000ffDigite @LastStanding para acessar o menu GM^000000"; close; OnMinute45: if ($@laststanding != 0) end; OnOpen: cloakonnpc "O#luckyevent"; cloakonnpc "X#luckyevent"; cloakonnpc "O#luckyevent2"; cloakonnpc "X#luckyevent2"; waitingroom "Venha Participar!", 0; announce "Last Standing : O portal para o evento se abriu em Prontera!! 5 minutos até que ele se feche!",0; $@laststanding = 1; sleep 120000; if ($@laststanding != 1) end; announce "Last Standing : O portal para o evento fechará em 3 minutos!",0; sleep 60000; if ($@laststanding != 1) end; announce "Last Standing : O portal para o evento fechará em 1 minuto!",0; sleep 60000; if ($@laststanding != 1) end; announce "Last Standing : O portal para o evento se fechou!",0; donpcevent strnpcinfo(0) + "::OnStart"; end; OnStart: $@laststanding = 2; delwaitingroom; sleep 3000; areaannounce "quiz_02",220,330,280,395,"Bem vindos ao evento Last Standing. O ou X será escolhido aleatoriamente.",bc_blue; sleep 4000; areaannounce "quiz_02",220,330,280,395,"Tudo que você precisa fazer é ir até a área que você acha que foi escolhida.",bc_blue; sleep 4000; areaannounce "quiz_02",220,330,280,395,"Exemplo, se eu escolher X, todos os aventureiros que estiverem em O perdem.",bc_blue; sleep 4000; areaannounce "quiz_02",220,330,280,395,"Faremos isso de novo e de novo até termos 1 aventureiro sobrevivente.",bc_blue; sleep 4000; areaannounce "quiz_02",220,330,280,395,"Antes que eu esqueça, você deve entrar em uma das áreas! Qualquer um do lado de fora será automaticamente desclassificado!",bc_blue; sleep 4000; areaannounce "quiz_02",220,330,280,395,"É isso... Agora vamos começar!",bc_blue; sleep 4000; .@num = getareaunits(BL_PC,"quiz_02",220,330,280,395,$@ls_players$[0]); if (.@num == 0) { $@laststanding = 0; end; } goto L_start; L_start: if ($@laststanding != 2) end; cloakoffnpc "O#luckyevent"; cloakoffnpc "X#luckyevent"; cloakoffnpc "O#luckyevent2"; cloakoffnpc "X#luckyevent2"; areaannounce "quiz_02",220,330,280,395,"Por favor, vá até uma das áreas desejadas Vai! Vai! Vai!",bc_blue; sleep 10000; if ($@laststanding != 2) end; areaannounce "quiz_02",220,330,280,395,"5",bc_blue; sleep 1500; if ($@laststanding != 2) end; areaannounce "quiz_02",220,330,280,395,"4",bc_blue; sleep 1500; if ($@laststanding != 2) end; areaannounce "quiz_02",220,330,280,395,"3",bc_blue; sleep 1500; if ($@laststanding != 2) end; areaannounce "quiz_02",220,330,280,395,"2",bc_blue; sleep 1500; if ($@laststanding != 2) end; areaannounce "quiz_02",220,330,280,395,"1",bc_blue; sleep 1000; if ($@laststanding != 2) end; cloakonnpc "O#luckyevent"; cloakonnpc "X#luckyevent"; cloakonnpc "O#luckyevent2"; cloakonnpc "X#luckyevent2"; sleep 500; .@w = rand(2); areaannounce "quiz_02",220,330,280,395,"E o escolhido foi " + (.@w?"X":"O") + "!",bc_blue; .@num_e = getareaunits(BL_PC,"quiz_02",220,330,280,395,.@emote[0]); for (.@i = 0; .@i < .@num_e; .@i++) emotion (.@w?ET_X:ET_O), .@emote[.@i]; sleep 1500; if ($@laststanding != 2) end; deletearray $@ls_players, getarraysize($@ls_players); if (.@w) { // X choosen areawarp "quiz_02",220,330,248,358,"quiz_02",241,364,258,375; .@num = getareaunits(BL_PC,"quiz_02",250,330,275,358,$@ls_players[0]); } else { // O choosen areawarp "quiz_02",250,330,275,358,"quiz_02",241,364,258,375; .@num = getareaunits(BL_PC,"quiz_02",220,330,248,358,$@ls_players[0]); } if (.@num == 0) { announce "Last Standing : Ninguém venceu o evento.",bc_all; sleep 3000; donpcevent strnpcinfo(0) + "::OnEnd"; } if (.@num == 1) { donpcevent strnpcinfo(0) + "::OnWinner"; end; } areaannounce "quiz_02",220,330,280,395,.@num + " aventureiros acertaram! Preparem-se para outra rodada.",bc_blue; sleep 4000; callsub L_start; OnWinner: announce "Last Standing : " + convertpcinfo($@ls_players[0],CPC_NAME) + " ganhou o evento!",bc_all; getitem 607,10,$@ls_players[0]; // prêmio do vencedor specialeffect2 EF_MVP, AREA, convertpcinfo($@ls_players[0],CPC_NAME); sleep 3000; if ($@laststanding != 2) end; areaannounce "quiz_02",220,330,280,395,"Obrigado por psrticipar! Você será teleportado em 10 segundos.",bc_blue; sleep 10000; if ($@laststanding != 2) end; donpcevent strnpcinfo(0) + "::OnEnd"; end; OnEnd: if ($@laststanding == 1) announce "Last Standing : O evento foi cancelado.",0; delwaitingroom; $@laststanding = 0; areawarp "quiz_02",220,330,280,395,"prontera",150,150; end; OnInit: bindatcmd "laststanding",strnpcinfo(3)+"::OnAtcommand",99,99; $@laststanding = 0; end; OnAtcommand: message strcharinfo(0), "Controle GM do evento Last Standing"; switch(select("Cancelar", "^0000FFComeçar evento^000000", "^0000FFTerminar evento^000000", "Ir para o mapa")) { case 1: end; case 2: if ($@laststanding == 0) { donpcevent strnpcinfo(0) + "::OnOpen"; message strcharinfo(0), "Ação confirmada!"; end; } if ($@laststanding == 1) { mes "O portal do evento já está aberto para jogadores irem entrando."; mes "Quer fechar o portal e iniciar o evento agora?"; if (select("Manter portal aberto", "^0000FFFechar portal e iniciar^000000") == 1) close; if ($@laststanding == 1) { donpcevent strnpcinfo(0) + "::OnStart"; message strcharinfo(0), "Ação confirmada!"; } close; } message strcharinfo(0), "Evento já está em andamento"; end; case 3: if ($@laststanding != 0) { donpcevent strnpcinfo(0) + "::OnEnd"; message strcharinfo(0), "Ação confirmada!"; end; } message strcharinfo(0), "Evento não foi iniciado."; end; case 4: warp "quiz_02",249,385; end; } end; } quiz_02,255,384,3 script SAÍDA#laststanding PORTAL,{ npctalk "Quer sair do evento?", strnpcinfo(0), bc_self; if (select("Ficar aqui", "^FF0000Sair do evento^000000") == 2) warp "prontera",150,150; end; } quiz_02,237,365,0 script O#luckyevent 1_SHADOW_NPC,14,7,{ if ($@ls_players[0] && inarray($@ls_players, getcharid(3)) == -1) npctalk "Você não está mais participando.", strnpcinfo(0), bc_self; else warp "quiz_02",237,345; end; OnTouch: npctalk "Clique aqui se escolhe O", strnpcinfo(0), bc_self; emotion ET_O, getnpcid(0); end; } quiz_02,262,365,0 script X#luckyevent 1_SHADOW_NPC,14,7,{ if ($@ls_players[0] && inarray($@ls_players, getcharid(3)) == -1) npctalk "Você não está mais participando.", strnpcinfo(0), bc_self; else warp "quiz_02",262,345; end; OnTouch: npctalk "Clique aqui se escolhe X", strnpcinfo(0), bc_self; emotion ET_X, getnpcid(0); end; } quiz_02,237,357,0 warp O#luckyevent2 1,1,quiz_02,250,366 quiz_02,262,357,0 warp X#luckyevent2 1,1,quiz_02,249,366 quiz_02 mapflag nowarp quiz_02 mapflag nowarpto quiz_02 mapflag noskill quiz_02 mapflag noteleport quiz_02 mapflag nomemo quiz_02 mapflag nosave SavePoint quiz_02 mapflag noicewall quiz_02 mapflag noloot
  2. Hi. "cooking" is a script command. You can't use it as a variable name. Just rename the variable to something else.
  3. Hello. Using getunitdata inside a if statement is causing the error. Don't know why. Try: - script cashpoints -1,{ OnInit: setarray .champions$,"Elusive","Furious","Ringleader","Solid","Swift"; end; OnNPCKillEvent: .@exists = getunitdata(killedgid, .@data); if ( .@exists != -1 ){ .@mode = .@data[UMOB_MODE]; if(.@mode & MD_MVP){ if ( getmonsterinfo( killedrid, MOB_LV ) < 71 ) #CASHPOINTS += rand( 5, 10 ); else #CASHPOINTS += rand( 10, 15 ); //MVP } else if(.@mode & MD_STATUSIMMUNE){ if ( getmonsterinfo( killedrid, MOB_LV ) < 71 ) #CASHPOINTS += rand( 3, 8 ); else #CASHPOINTS += rand( 8, 13 ); //miniboss }else { for(.@i = 0; .@i < getarraysize(.champions$); .@i++){ if(compare(.@mobname$,.champions$[.@i])){ if ( getmonsterinfo( killedrid, MOB_LV ) < 71 ) #CASHPOINTS += rand( 1, 3 ); else #CASHPOINTS += rand( 3, 6 ); //cashpoints break; } } //Champion tests } } end; }
  4. //===== rAthena Script ======================================= //= Reset NPC //===== Description: ========================================= //= Resets skills, stats, or both. //===== Additional Comments: ================================= //= 1.0 First Version //= 1.1 Optimized for the greater good. [Kisuka] //= 1.2 Cleaning [Euphy] //= 1.3 All statuses removed upon skill reset. [Euphy] //= 1.4 Compressed Script, Added limit use option [Stolao] //= Changed set -> setarray, Improved text with F_InsertPlural //= 1.5 Added sc_end_class to reset related status changes [sader1992] //============================================================ // https://rathena.org/board/topic/141328-requesting-for-custom-reset-girl/ //============================================================ prontera,150,193,4 script Custom Reset Girl 124,{ // 1st, 2nd, 3rd, Limit setarray .@Reset, 0, 3000000, 5000000, 0; mes "[Reset Girl]"; if(.@Reset[3] && reset_limit > .@Reset[3]) { mes "Sorry you can only reset "+callfunc("F_InsertPlural",.@Reset[3],"time")+" in your life."; close; } mes "I am the Reset Girl."; mes "Please select the service you want:"; if (.@Reset[3]) mes "You may only reset "+callfunc("F_InsertPlural",.@Reset[3],"time")+", so use "+((.@Reset[3]>1)?"them":"it")+" wisely."; mes " "; mes "1st reset: " + (.@Reset[0]?F_InsertComma(.@Reset[0])+"z":"free"); mes "2nd reset: " + F_InsertComma(.@Reset[1]) +"z"; mes "3rd onwards: " + F_InsertComma(.@Reset[2]) +"z"; next; set .@i,(select("^FF3355Reset Skills:Reset Stats:Reset Both^000000:Cancel")); if(.@i > 3) close; .@z = .@Reset[(reset_limit>2?2:reset_limit)]; mes "[Reset Girl]"; if (Zeny < .@z) { mes "Sorry, you don't have enough Zeny."; close; } if(.@Reset[3]){ mes "You can only reset "+callfunc("F_InsertPlural",.@Reset[3],"time")+" in your life, are you sure?"; if(select("Let me think:That's fine") == 1) close; } Zeny -= .@z; if(.@i&1){ sc_end_class; ResetSkill; } if(.@i&2) ResetStatus; mes "There you go!"; reset_limit++; close; }
  5. Hi //===== rAthena Script ======================================= //= Reset NPC //===== Description: ========================================= //= Resets skills, stats, or both. //===== Additional Comments: ================================= //= 1.0 First Version //= 1.1 Optimized for the greater good. [Kisuka] //= 1.2 Cleaning [Euphy] //= 1.3 All statuses removed upon skill reset. [Euphy] //= 1.4 Compressed Script, Added limit use option [Stolao] //= Changed set -> setarray, Improved text with F_InsertPlural //= 1.5 Added sc_end_class to reset related status changes [sader1992] //============================================================ prontera,150,193,4 script Custom Reset Girl 124,{ // Skills, Stats, Both, Limit setarray .@Reset, 1000000, 1000000, 1000000, 0; mes "[Reset Girl]"; if(.@Reset[3] && reset_limit > .@Reset[3]) { mes "Sorry you can only reset "+callfunc("F_InsertPlural",.@Reset[3],"time")+" in your life."; close; } mes "I am the Reset Girl."; mes "Each time you reset the price of the next reset will increase by " + F_InsertComma(.@Reset[2]) + "z."; if (reset_limit) { .@Reset[0] *= reset_limit; .@Reset[1] *= reset_limit; .@Reset[2] *= reset_limit; mes "Reset Stats: "+ callfunc("F_InsertComma",.@Reset[1]) +"z"; mes "Reset Skills: "+ callfunc("F_InsertComma",.@Reset[0]) +"z"; mes "Reset Both: "+ callfunc("F_InsertComma",.@Reset[2]) +"z"; } else mes "Since it's your 1st time, the reset is free!"; if (.@Reset[3]) mes "You may only reset "+callfunc("F_InsertPlural",.@Reset[3],"time")+", so use "+((.@Reset[3]>1)?"them":"it")+" wisely."; mes "Please select the service you want:"; next; set .@i,(select("^FF3355Reset Skills:Reset Stats:Reset Both^000000:Cancel")); if(.@i > 3) close; if (!reset_limit) .@Reset[.@i-1] = 0; mes "[Reset Girl]"; if (Zeny < .@Reset[.@i-1]) { mes "Sorry, you don't have enough Zeny."; close; } if(.@Reset[3]){ mes "You can only reset "+callfunc("F_InsertPlural",.@Reset[3],"time")+" in your life, are you sure?"; if(select("Let me think:That's fine") == 1) close; } set Zeny, Zeny-.@Reset[.@i-1]; if(.@i&1){ sc_end_class; ResetSkill; } if(.@i&2) ResetStatus; mes "There you go!"; reset_limit++; close; }
  6. EXAMPLE Open a text editor program and paste the whole card seller script. Click the save option, save it in your server folder /npc/ and name it carloscardseller.txt Now on npc/scripts_custom, add a empty new line at the end of the file and add: If you are using rAthena: npc: npc/carloscardseller.txt Just like this, if you are using Hercules: // Custom "npc/custom/support_me.txt", "npc/carloscardseller.txt", All NPCs in the server comes from txt files. Each line is a different file. So you're adding your file with your NPC so the server knows where it is, simple.
  7. Hi. From rAthena wiki: New scripts must be saved as a text file first. The file may be located anywhere in the rAthena directory, but is in the npc folder by default. So create a .txt file and paste the script in it. For an NPC to be loaded, it needs to be added to a .conf file. This is typically npc/scripts_custom.conf. Add a line, and enter your NPC file in the following format: npc: npc/path/to/your_card_seller_script.txt After adding the script, it must be loaded before the script contents take effect in game. There are a few ways to do this. The map server can be rebooted. This is generally the safest route though not the most convenient for active servers. The GM command @reloadscript maybe used in game, though this may cause monster spawn bugs.
  8. Hi. Update your rAthena or find all lines with enablenpc(); / disablenpc(); and add strnpcinfo(0) between the round brackets. Example: enablenpc(); disablenpc(); To: enablenpc(strnpcinfo(0)); disablenpc(strnpcinfo(0));
  9. Hi. Yeah, giving custom points to things like Blacksmith' weapon forging, or Alchemist's potion creation is not possible with default scripting. But if it's "crafting" using NPCs, its simple using variables. "custom_points" is not the same as "@custom_points". @variables are lost when the player logout. Just remove the @ and the points will stay. More here: (from \doc\script_commands.txt) mes "Click me to gain points"; next; switch(select("- Get Points:- Cancel")){ case 1: mes "(script get points) +1 custom points"; // Increase the value by 1. Basically gives 1 point to the player custom_points += 1; close; case 2: mes "Cancel"; close; } More Examples: mes "You got 3 points"; custom_points += 3; mes "You made the potion You got 1 point"; custom_points++; mes "You crafted the armor. You got 98346 points"; custom_points += 98346; mes "You did my task. You got 100 temporary points."; mes "You will lose them when you logout"; mes "They are unrelated to others points."; @custom_points += 100; mes "You crafted all the armors."; mes "You got 50 account points. Every character you have can spend them."; mes "They are unrelated to others points."; #custom_points += 50; Spending means losing, so just decrease the variable. Examples: mes "Ok. I will give you the Emperium for 5 points"; custom_points -= 5; getitem "EMPELIUM", 1; mes "Ok. I will give you the 15 Apples for 1 point"; custom_points--; getitem "APPLE", 15; mes "Ok. I will give you the this special buff effect. You spent 8151 points for it."; custom_points -= 8151; sc_start SC_GLORIA,300000,5; mes "OK. You spent 100 points to unlock +10 DMG weapons chance."; weapon_points -= 100; unlocked_10_dmg = true;
  10. Oi, acha essa linha: getmapxy(.M$,.x,.y,1,strnpcinfo(0)); E substitui por: getmapxy(.M$,.x,.y,BL_NPC);
  11. Hello. Useable Item function example: - Id: 12000000 AegisName: Task_Book Name: Task Book Type: DelayConsume Script: | callfunc "F_custom_points_item"; function script F_custom_points_item { mes "You have ^0055FF" + @custom_points + "^000000 Points."; close; } //===== rAthena Script ======================================= //= Hunting Missions //===== By: ================================================== //= Euphy //===== Current Version: ===================================== //= 1.4 //===== Compatible With: ===================================== //= rAthena Project //===== Description: ========================================= //= Random hunting missions. //= Rewards are based on quest difficulty. //= //= NOTE: Requires SQL mob database. //===== Additional Comments: ================================= //= 1.0 Initial script. //= 1.1 Small improvements and fixes. //= 1.2 Added party support and replaced blacklists with an //= SQL query, both thanks to AnnieRuru. //= 1.3 Re-added a blacklist adapted for the SQL query. //= 1.3a Added mission reset options. //= 1.3b Function updates. //= 1.4 Check for deleted characters, thanks to AnnieRuru. //= Syntax updates and style cleaning. //============================================================ yuno,160,85,3 script Hunting Tasks 4_F_EDEN_MASTER,{ function Chk; cutin "arquien_n_atnad01", 2; mes "[Hunting Tasks]"; mes "Hello, " + strcharinfo(0) + "!"; if (!#Task_Delay) { next; mes "[Hunting Tasks]"; mes "I can't find any records..."; mes "You must be new here!"; emotion ET_HUK; next; callsub Task_Info; emotion ET_GO; #Task_Delay = 1; close3; } mes F_Rand("Working hard, as always...", "Not slacking, I hope..."); mes "Is there anything I can help"; mes "you with?"; mes " "; mes "^777777~ You've completed " + F_InsertPlural(Task_Total,"task",0,"^0055FF%d^777777 %s") + ". ~^000000"; next; switch(select( ((!Task0) ? " ~ New Task::" : ": ~ Task Status: ~ Abandon Task") + ": ~ Information: ~ Task Shop: ~ View Top Hunters: ~ ^777777Cancel^000000" )) { case 1: mes "[Hunting Tasks]"; if (#Task_Count) { mes "You've started a task"; mes "on another character."; if (!@hm_char_del_check) { // check for deleted character query_sql("SELECT 1 FROM `char_reg_num` WHERE `key` = 'Task0' AND `char_id` IN(SELECT `char_id` FROM `char` WHERE `account_id` = " + getcharid(3) + ")", .@i); if (!.@i) { next; mes "[Hunting Tasks]"; mes "I can't seem to find any records"; mes "for that character, though..."; mes "One moment, please."; emotion ET_SCRATCH; #Task_Count = 0; } @hm_char_del_check = true; } close3; } if (#Task_Delay > gettimetick(2) && .Delay) { mes "I'm afraid you'll have to wait " + Time2Str(#Task_Delay) + " before taking another task."; close3; } mes "You must hunt:"; if (.no_sql) { for (.@i = 0; .@i < .Quests; .@i++) { do { .@id = getrandmobid(MOBG_BRANCH_OF_DEAD_TREE, RMF_ALL, BaseLevel+15); } while (countinarray(.@mob, .@id) || (BaseLevel<=99 && strmobinfo(3,.@id) < BaseLevel-20) || (BaseLevel>99 && strmobinfo(3,.@id) < 90)); setarray .@mob[.@i],.@id; } } else query_sql("SELECT ID FROM `" + .mob_db$ + "` WHERE left(name_aegis, 4) != 'meta' AND left(name_aegis, 2) != 'E_' AND base_exp > 0 AND job_exp > 0 AND (class != 'boss' OR class is null) AND (drop3_item like '%_card' OR drop4_item like '%_card' OR drop5_item like '%_card' OR drop6_item like '%_card' OR drop7_item like '%_card' OR drop8_item like '%_card' OR drop9_item like '%_card' OR drop10_item like '%_card') AND ID < 2000 AND instr('"+.Blacklist$+"',ID) = 0 ORDER BY rand() LIMIT " + .Quests, .@mob); for (.@i = 0; .@i < .Quests; .@i++) { setd "Task" + .@i, .@mob[.@i]; setd "Task" + .@i +"_", 0; } #Task_Count = rand(.Count[0], .Count[1]); callsub Task_Status; next; mes "[Hunting Tasks]"; mes "Report back when"; mes "you've finished."; mes "Good luck!"; close3; case 2: mes "[Hunting Tasks]"; mes "Task status:"; callsub Task_Status; close3; case 3: mes "[Hunting Tasks]"; mes "Do you really want to"; mes "abandon your task?"; if (.Reset < 0 && .Delay) mes "Your delay time will not be reset."; else if (.Reset > 0) mes "It will cost " + F_InsertComma(.Reset) + " Zeny."; next; switch(select(" ~ Abandon...: ~ ^777777Cancel^000000")) { case 1: if (.Reset > 0) { if (Zeny < .Reset) { mes "[Hunting Tasks]"; mes "You don't have enough"; mes "Zeny to drop this task."; emotion ET_SORRY; close3; } Zeny -= .Reset; emotion ET_MONEY; } mes "[Hunting Tasks]"; mes "Alright, I've dropped"; mes "your current task."; specialeffect2 EF_STORMKICK4; for (.@i = 0; .@i < .Quests; .@i++) { setd "Task"+.@i, 0; setd "Task"+.@i+"_", 0; } #Task_Count = 0; if (.Reset < 0 && .Delay) #Task_Delay = gettimetick(2) + (.Delay * 3600); close3; case 2: mes "[Hunting Tasks]"; mes "I knew you were kidding!"; mes "Keep up the good work."; emotion ET_SMILE; close3; } case 4: callsub Task_Info; close3; case 5: mes "[Hunting Tasks]"; mes "You have ^0055FF" + @custom_points + "^000000 Task Points."; mes "Use them well!"; callshop "task_shop",1; npcshopattach "task_shop"; end; case 6: mes "[Hunting Tasks]"; mes "The top hunters are:"; query_sql("SELECT char_id AS id, (SELECT `name` FROM `char` WHERE char_id = id),`value` FROM `char_reg_num` WHERE `key` = 'Task_Total' ORDER BY CAST(`value` AS SIGNED) DESC LIMIT 5", .@id, .@name$, .@val); for (.@i = 0; .@i < 5; .@i++) mes " [Rank " + (.@i+1) + "] " + ((.@name$[.@i] == "") ? "^777777none" : "^0055FF" + .@name$[.@i]+"^000000 : ^FF0000" + .@val[.@i] + " pt.") + "^000000"; close3; case 7: mes "[Hunting Tasks]"; mes "Nothing? Okay..."; emotion ET_SCRATCH; close3; } end; Task_Status: @f = false; deletearray .@j[0], getarraysize(.@j); for (.@i = 0; .@i < .Quests; .@i++) { .@j[.@i] = getd("Task" + .@i); .@j[.Quests] = .@j[.Quests] + strmobinfo(3,.@j[.@i]); .@j[.Quests+1] = .@j[.Quests+1] + (strmobinfo(6,.@j[.@i]) / (getbattleflag("base_exp_rate") / 100) * .Modifier[0]); .@j[.Quests+2] = .@j[.Quests+2] + (strmobinfo(7,.@j[.@i]) / (getbattleflag("job_exp_rate") / 100) * .Modifier[1]); mes " > "+Chk(getd("Task"+.@i+"_"),#Task_Count) + strmobinfo(1,.@j[.@i]) + " (" + getd("Task"+.@i+"_") + "/" + #Task_Count + ")^000000"; } // Reward formulas: .@Task_Points = 3 + (.@j[.Quests] / .Quests / 6); .@Base_Exp = #Task_Count * .@j[.Quests+1] / 5; .@Job_Exp = #Task_Count * .@j[.Quests+2] / 5; .@Zeny = #Task_Count * .Quests * .@j[.@i] * .Modifier[2]; next; mes "[Hunting Tasks]"; mes "Task rewards:"; mes " > Task Points: ^0055FF" + .@Task_Points + "^000000"; if (.Modifier[0]) mes " > Base Experience: ^0055FF" + F_InsertComma(.@Base_Exp) + "^000000"; if (.Modifier[1]) mes " > Job Experience: ^0055FF" + F_InsertComma(.@Job_Exp) + "^000000"; if (.Modifier[2]) mes " > Zeny: ^0055FF" + F_InsertComma(.@Zeny) + "^000000"; if (@f) { @f = false; return; } next; mes "[Hunting Tasks]"; mes "Oh, you're done!"; mes "Good work."; mes "Here's your reward."; emotion ET_BEST; specialeffect2 EF_ANGEL; specialeffect2 EF_TRUESIGHT; @custom_points += .@Task_Points; BaseExp += .@Base_Exp; JobExp += .@Job_Exp; Zeny += .@Zeny; for (.@i = 0; .@i < .Quests; .@i++) { setd "Task" + .@i, 0; setd "Task" + .@i+"_", 0; } #Task_Count = 0; if (.Delay) #Task_Delay = gettimetick(2) + (.Delay * 3600); Task_Total++; if (Task_Total == 1) query_sql("INSERT INTO `char_reg_num` (`char_id`,`key`,`index`,`value`) VALUES (" + getcharid(0) + ",'Task_Total','0',1)"); else query_sql("UPDATE `char_reg_num` SET `value` = " + Task_Total + " WHERE `char_id` = " + getcharid(0) + " AND `key` = 'Task_Total'"); close3; Task_Info: mes "[Hunting Tasks]"; mes "If you so choose, I can assign"; mes "you a random hunting quest."; mes "Some are easier than others, but"; mes "the rewards increase with difficulty."; next; mes "[Hunting Tasks]"; mes "Tasks points are shared"; mes "amongst all your characters."; if (.Delay) mes "Delay time is, too."; mes "You can't take tasks on"; mes "multiple characters at once."; next; mes "[Hunting Tasks]"; mes "You can start a quest"; mes (.Delay ? "every " + ((.Delay == 1) ? "hour." : .Delay + " hours.") : "whenever you want."); mes "That's everything~"; return; function Chk { if (getarg(0) < getarg(1)) { @f = true; return "^FF0000"; } else return "^00FF00"; } OnBuyItem: .@size = getarraysize(@bought_nameid); for (.@i = 0; .@i < .@size; .@i++) { .@j = inarray(.Shop, @bought_nameid[.@i]); .@cost += (.Shop[.@j+1] * @bought_quantity[.@i]); } mes "[Hunting Tasks]"; if (.@cost > @custom_points) mes "You don't have enough Task Points."; else { for (.@i = 0; .@i < .@size; .@i++) { getitem @bought_nameid[.@i], @bought_quantity[.@i]; dispbottom "Purchased " + @bought_quantity[.@i] + "x " + getitemname(@bought_nameid[.@i]) + "."; } @custom_points -= .@cost; mes "Deal completed."; emotion ET_MONEY; } deletearray @bought_nameid[0], .@size; deletearray @bought_quantity[0], .@size; close3; OnNPCKillEvent: if (!getcharid(1) || !.Party) { if (!#Task_Count || !Task0) end; for (.@i = 0; .@i < .Quests; .@i++) { if (strmobinfo(1,killedrid) == strmobinfo(1,getd("Task" + .@i))) { if (getd("Task" + .@i + "_") < #Task_Count) { dispbottom "[Hunting Task] Killed " + (set(getd("Task" + .@i + "_"),getd("Task" + .@i + "_") + 1)) + " of " + #Task_Count + " " + strmobinfo(1,killedrid) + "."; end; } } } } else if (.Party) { .@mob = killedrid; getmapxy(.@map1$,.@x1,.@y1); getpartymember getcharid(1),1; getpartymember getcharid(1),2; for (.@i = 0; .@i < $@partymembercount; .@i++) { if (isloggedin($@partymemberaid[.@i], $@partymembercid[.@i])) { set .@Task_Count, getvar(#Task_Count, $@partymembercid[.@i]); set .@Task0, getvar(Task0, $@partymembercid[.@i]); set .@HP, readparam(HP, $@partymembercid[.@i]); if (.@Task_Count && .@Task0 && .@HP > 0) { getmapxy(.@map2$,.@x2,.@y2,BL_PC,rid2name($@partymemberaid[.@i])); if ((.@map1$ == .@map2$ || .Party == 1) && (distance(.@x1,.@y1,.@x2,.@y2) <= 30 || .Party < 3)) { for (.@j = 0; .@j < .Quests; .@j++) { .@my_mob_id = getvar( getd("Task"+.@j),$@partymembercid[.@i] ); .@my_count = getvar( getd("Task"+.@j+"_"), $@partymembercid[.@i] ); if (strmobinfo(1,.@mob) == strmobinfo(1,.@my_mob_id)) { if (.@my_count < .@Task_Count) { setd "Task"+.@j+"_", (.@my_count+1), $@partymembercid[.@i]; dispbottom "[Hunting Task] Killed " + (.@my_count+1) + " of " + .@Task_Count + " " + strmobinfo(1,.@mob) + ".", 0x777777, $@partymembercid[.@i]; break; } } } } } } } } end; OnInit: .Delay = 1; // Quest delay, in hours (0 to disable). .Quests = 3; // Number of subquests per task (increases rewards). .Party = 3; // Party options: 0 (exclude party kills), 1 (include party kills), 2 (same map only), 3 (screen area only) .Reset = 0; // Reset options: -1 (abandoning task sets delay time), 0 (no delay time), [Zeny] (cost to abandon task, no delay time) setarray .Count[0], // Min and max monsters per subquest (increases rewards). 20,50; setarray .Modifier[0], // Multipliers for Base Exp, Job Exp, and Zeny rewards. 0,0,0; .mob_db$ = // Table name of SQL mob database (checkre(0))?"mob_db_re":"mob_db"; setarray .Shop[0], // Reward items: <ID>,<point cost> (about 10~20 points per hunt). 512,1,513,1,514,1,538,5,539,5,558,10,561,10; .Blacklist$ = // Blacklisted mob IDs. "1062,1088,1183,1186,1200,1212,1220,1221,1234,1235,"+ "1244,1245,1250,1268,1290,1293,1294,1296,1298,1299,"+ "1300,1301,1303,1304,1305,1306,1308,1309,1311,1313,"+ "1515,1588,1618,1676,1677,1678,1679,1796,1797,1974,"+ "1975,1976,1977,1978,1979"; .no_sql = 1; // Ignore sql mob database npcshopdelitem "task_shop",512; for (.@i = 0; .@i < getarraysize(.Shop); .@i += 2) npcshopadditem "task_shop", .Shop[.@i], .Shop[.@i+1]; end; } - shop task_shop -1,no,512:-1
  12. Hi yuno,160,80,3 script 3D Printer 4_MACHINE_DEVICE,{ .@custom_coin_ID = 675451; .@custom_coin_qty = 3; if (countitem(.@custom_coin_ID) < .@custom_coin_qty) { npctalk "You need " + .@custom_coin_qty + " " + getitemname(.@custom_coin_ID) + " to generate a item.", strnpcinfo(0), bc_self; end; } npctalk "Type the ID of the item to generate.", strnpcinfo(0), bc_self; input .@item_id; if (getitemname(.@item_id) == "null") { npctalk "ID is invalid / item not found.", strnpcinfo(0), bc_self; end; } mes "[" + strnpcinfo(1) + "]"; mes "Confirm generation of"; mes "<ITEM>" + getitemname(.@item_id) + "<INFO>" + .@item_id + "</INFO></ITEM>?"; next; if (select("Cancel", "Confirm") == 1) close; mes "[" + strnpcinfo(1) + "]"; mes "Starting..."; close2; if (countitem(.@custom_coin_ID) < .@custom_coin_qty) { npctalk "You need " + .@custom_coin_qty + " " + getitemname(.@custom_coin_ID) + " to generate a item.", strnpcinfo(0), bc_self; end; } if (checkweight(.@item_id,1) == 0) { npctalk "Overweight detected. You cannot proceed.", strnpcinfo(0), bc_self; end; } delitem .@custom_coin_ID, .@custom_coin_qty; getitem .@item_id, 1; npctalk "Generated.", strnpcinfo(0), bc_self; specialeffect EF_OVERTHRUST; end; }
  13. yuno,165,80,3 script Entrance Guard#guild 4_M_UNCLEKNIGHT,{ if (getgroupid() >= 90) callsub S_Control; mes "[" + strnpcinfo(1) + "]"; mes "I can take you to the area if you're in a registered guild."; next; switch(select("Enter area", "Finish conversation")) { case 1: if (!getcharid(2)) { mes "[" + strnpcinfo(1) + "]"; mes "You are not in a guild."; close; } if (inarray($registered_guilds, getcharid(2)) < 0) { mes "[" + strnpcinfo(1) + "]"; mes "Your guild did not register."; close; } mes "[" + strnpcinfo(1) + "]"; mes "You're with the ^895818" + strcharinfo(2) + "^000000, correct?"; mes "I will send you there."; close2; warp "que_qsch05",346,32; end; case 2: mes "[" + strnpcinfo(1) + "]"; mes F_Bye; close; } S_Control: if(select("Default NPC", "^0000FFGM Control^000000") == 1) return; switch(select("Register guild", "Remove all guilds", "Cancel")) { case 1: switch(select("Enter guild member name", "Enter guild name")) { case 1: input .@playername$; query_sql "SELECT `name`,`guild_id` FROM `char` WHERE `name` like '%"+.@playername$+"%'",.@p_name$,.@GID; query_sql "SELECT `name`,`guild_lv` FROM `guild` WHERE `guild_id` = "+.@GID,.@NAME$,.@GLVL; if (getarraysize(.@p_name$) > 1) { mes "[" + strnpcinfo(1) + "]"; mes "More than one player with this name was found."; mes "Type again. Be more specific, please!"; close; } if (.@p_name$ == "") { mes "[" + strnpcinfo(1) + "]"; mes "I didn't find anything. Check for typos. You don't need to input the whole name."; close; } if (!.@GID) { mes "[" + strnpcinfo(1) + "]"; mes "" + .@p_name$ + " does not have a guild."; close; } break; case 2: input .@guildname$; query_sql "SELECT `guild_id`,`name`,`guild_lv` FROM `guild` WHERE `name` like '%"+.@guildname$+"%'",.@GID,.@NAME$,.@GLVL; if (getarraysize(.@GID) > 1) { mes "[" + strnpcinfo(1) + "]"; mes "More than one guild with this name was found."; mes "Type again. Be more specific, please!"; close; } if (!.@GID) { mes "[" + strnpcinfo(1) + "]"; mes "I didn't find anything. Check for typos. You don't need to input the whole name."; close; } break; } getguildmember .@GID, 1; getguildmember .@GID, 2; .@QTM = $@guildmembercount; for(.@i=0; .@i < $@guildmembercount; .@i++) if (isloggedin($@guildmemberaid[.@i],$@guildmembercid[.@i])) .@online++; mes "[" + strnpcinfo(1) + "]"; if (.@p_name$ != "" && .@p_name$ != getguildmaster(.@GID)) mes "" + .@p_name$ + "'s guild"; mes "Name: ^0000FF" + .@NAME$ + "^000000 (Lv " + .@GLVL + ")"; mes "Master: " + getguildmaster(.@GID); mes "Members: "+.@QTM+" / Online: "+.@online; mes " "; if (inarray($registered_guilds, .@GID) >= 0) { mes "Guild registered already."; close; } mes "Are you sure you want to register this guild?"; next; if(select("No", "Yes, register guild") == 1) close; .@i = getarraysize($registered_guilds); setarray $registered_guilds[.@i], .@GID; mes "[" + strnpcinfo(1) + "]"; mes "Guild ^895818" + getguildname(.@GID) + "^000000 registered!"; mes "Guild members can now enter."; close; case 2: mes "[" + strnpcinfo(1) + "]"; mes "Are you sure you want to remove all registered guilds?"; mes "^FF0000THIS CANNOT BE UNDONE.^000000"; next; if(select("On second thought, no.", "I'm aware, go on.") == 1) close; deletearray $registered_guilds, getarraysize($registered_guilds); mes "[" + strnpcinfo(1) + "]"; mes "Done."; close; case 3: end; } }
  14. Hello. There's a missing ; (semicolon) Find: .@reussite = 100; .@prix = 50000} Change to: .@reussite = 100; .@prix = 50000;}
×
×
  • Create New...