Jump to content

All Activity

This stream auto-updates

  1. Yesterday
  2. Hello everyone, im a noob at scripting rathena scripts and i used grok ai to generate a massive Questguild script with random generated quests and i was able to fix a lot bugs that the ai had built in. Right now i was able to get the script running after hours of hours reading server debug messages and fixing its errors but i have to comment out the following lines because the server gives "[Error]: buildin_rand: range (-1) is too small. No randomness possible." error once these lines are active (after commenting these lines, the server gives no error or debug messages anymore, no matter how i interact with the npcs) ; If i dont comment these lines, the npc window freezes after choosing a quest kind (hunting, killing, collection) After commenting thoose lines it looks like everything works and i can take a quest BUT i dont have to do it, the reward NPC gives me the reward without me doing the quest. So it looks to me like there is also something wrong with the quest requirements check. I fear that it pure luck that anything in this script is working and there might be much more problems and bugs than i can imagine Here is the complete Quest Guild Script (feel free to use it and any part of it if you want): //===== rAthena Script ======================================= //= Adventurers Guild System (Pre-Renewal, Complete) //===== Description ========================================== //= Comprehensive guild with 12 NPCs, 8 quest givers //= Hunting, Killing (20–200 + boss), Collection quests //= Rewards exceed collected item value, pre-renewal friendly //= German dialogue, balanced for 1x rates, <10 players //===== Features ============================================= //= 8 quest givers across 5 tiers, 4 support NPCs //= Special boss monsters for Killing Quests (10x HP, ~2x ATK/DEF) //= Expanded Collection Quests with tiered pre-renewal items //= Lore Keeper and Teleport Agent for immersion //============================================================ //===== Warp Portal to Adventurers Guild ===== prontera,238,42,0 warp AdventurersGuildPortal 2,2,pvp_room,52,26 pvp_room,52,18,0 warp PronteraAdvPortal 2,2,prontera,238,46 //===== Guild Master NPC ===== pvp_room,51,45,4 script Gildenmeister Konrad 48,{ mes "[Gildenmeister Konrad]"; mes "Willkommen in der Abenteurergilde, " + strcharinfo(0) + "!"; mes "Wir sind die Hüter von Ruhm und Ehre, die Helden in die gefährlichsten Winkel Rune-Midgards schicken."; if (!#Guild_Intro) { next; mes "[Gildenmeister Konrad]"; mes "Ein neuer Rekrut! Die Welt braucht Helden wie dich."; mes "Lass mich dir unsere Gilde vorstellen..."; emotion ET_HUK; next; callsub Guild_Info; emotion ET_GO; #Guild_Intro = 1; close; } mes F_Rand( "Dein Ruhm wächst, Held!", "Welche Taten schreibst du heute in die Geschichte?", "Die Welt wartet auf deinen nächsten Schritt!", "Bereit, die Legende zu erweitern?" ); mes "Wie kann die Gilde dir dienen?"; mes " "; mes "^777777~ Du hast " + F_InsertPlural(Mission_Total,"Quest",0,"^0055FF%d^777777 %s") + " abgeschlossen. ~^000000"; next; switch(select(" ~ Gildeninformationen: ~ Missionsshop: ~ Top-Abenteurer: ~ Quest abbrechen: ~ ^777777Abbrechen^000000")) { case 1: callsub Guild_Info; close; case 2: mes "[Gildenmeister Konrad]"; mes "Du hast ^0055FF" + #Mission_Points + "^000000 Missionspunkte."; mes "Nutze sie für wertvolle Belohnungen!"; callshop "guild_shop",1; npcshopattach "guild_shop"; end; case 3: mes "[Gildenmeister Konrad]"; mes "Die Ruhmeshalle der Gilde zeigt unsere Besten:"; query_sql("SELECT char_id AS id, (SELECT `name` FROM `char` WHERE char_id = id),`value` FROM `char_reg_num` WHERE `key` = 'Mission_Total' ORDER BY CAST(`value` AS SIGNED) DESC LIMIT 5", .@id, .@name$, .@val); for (.@i = 0; .@i < 5; .@i++) mes " [Rang " + (.@i+1) + "] " + ((.@name$[.@i] == "") ? "^777777keiner" : "^0055FF" + .@name$[.@i]+"^000000 : ^FF0000" + .@val[.@i] + " Quests^000000"); close; case 4: mes "[Gildenmeister Konrad]"; mes "Willst du deinen aktuellen Quest abbrechen?"; mes "Das kostet " + F_InsertComma(QuestSettings::.Reset) + " Zeny."; next; switch(select(" ~ Quest abbrechen: ~ ^777777Abbrechen^000000")) { case 1: if (Zeny < QuestSettings::.Reset) { mes "Nicht genug Zeny, Held!"; emotion ET_SORRY; close; } Zeny -= QuestSettings::.Reset; if (Quest_Type == 2 && Quest_Monster_GID) { killmonster Quest_Monster_Map$, "QuestMonster::OnQuestMobKilled", Quest_Monster_GID; dispbottom "Der Quest-spezifische Boss wurde entfernt."; } for (.@i = 0; .@i < QuestSettings::.Max_Quests; .@i++) { setd "Quest" + .@i, 0; setd "Quest" + .@i + "_Count", 0; setd "Quest" + .@i + "_Needed", 0; setd "Quest" + .@i + "_Item", 0; setd "Quest" + .@i + "_Item_Needed", 0; } Quest0 = 0; Quest0_Count = 0; Quest0_Needed = 0; Quest_Type = 0; Quest_Difficulty = 0; Quest_Monster_GID = 0; Quest_Monster_Map$ = ""; Quest_Monster_ID = 0; Quest_Monster_Count = 0; mes "Quest abgebrochen. Du bist frei für neue Taten!"; emotion ET_MONEY; close; case 2: mes "Gut, dann weiter im Kampfe!"; emotion ET_SMILE; close; } case 5: mes "[Gildenmeister Konrad]"; mes "Kehre zurück, wenn die Abenteuerlust ruft!"; emotion ET_SCRATCH; close; } Guild_Info: mes "[Gildenmeister Konrad]"; mes "Die Abenteurergilde ist das Herz von Rune-Midgards Helden."; mes "Wir bieten Quests für alle, von Anfängern bis zu Legenden, in fünf Schwierigkeitsstufen."; mes "Sprich mit unseren Aufgabenmeistern, um deine Mission zu wählen!"; next; mes "[Gildenmeister Konrad]"; mes "Jagdquests fordern dich auf, Horden von Monstern zu besiegen."; mes "Tötungsquests stellen dich gegen Schwärme und einen mächtigen Boss."; mes "Sammelquests senden dich auf die Suche nach wertvollen Materialien."; next; mes "[Gildenmeister Konrad]"; mes "Du musst die vorherige Stufe abschließen und das richtige Level haben."; mes "Belohnungen umfassen Missionspunkte, Erfahrung, Zeny und Schätze!"; mes "Neue Quests gibt’s alle " + QuestSettings::.Delay + " Stunden."; mes "Besuche den Großmeister Wolfhart für Geschichten oder den Teleporter für Reisen!"; return; OnBuyItem: .@size = getarraysize(@bought_nameid); for (.@i = 0; .@i < .@size; .@i++) { .@j = inarray(QuestSettings::.Shop, @bought_nameid[.@i]); .@cost += (QuestSettings::.Shop[.@j+1] * @bought_quantity[.@i]); } mes "[Gildenmeister Konrad]"; if (.@cost > #Mission_Points) { mes "Nicht genug Missionspunkte, Held!"; emotion ET_SORRY; } else { for (.@i = 0; .@i < .@size; .@i++) { getitem @bought_nameid[.@i], @bought_quantity[.@i]; dispbottom "Gekauft " + @bought_quantity[.@i] + "x " + getitemname(@bought_nameid[.@i]) + "."; } #Mission_Points -= .@cost; mes "Ein guter Handel! Nutze deine Schätze weise."; emotion ET_MONEY; } deletearray @bought_nameid[0], .@size; deletearray @bought_quantity[0], .@size; close; } //===== Quest Receiver NPC ===== pvp_room,56,45,4 script Schatzmeister Alfred 48,{ mes "[Schatzmeister Alfred]"; mes "Hallo, " + strcharinfo(0) + "! Wie läuft dein Auftrag?"; if (!Quest_Type) { mes "Du hast keinen aktiven Quest. Sprich mit einem Aufgabenmeister!"; emotion ET_THINK; close; } mes F_Rand( "Zeig mir, was du geschafft hast!", "Bist du bereit, deine Beute abzuliefern?", "Was hast du für mich, Held?" ); next; switch(Quest_Difficulty) { case 1: callsub Check_Quest, 1, 20, 0; break; case 2: callsub Check_Quest, 21, 40, 1; break; case 3: callsub Check_Quest, 41, 60, 2; break; case 4: callsub Check_Quest, 61, 80, 3; break; case 5: callsub Check_Quest, 81, 99, 4; break; default: mes "[Schatzmeister Alfred]"; mes "Etwas ist schiefgelaufen. Sprich mit dem Gildenmeister Konrad."; emotion ET_SORRY; close; } close; Check_Quest: mes "[Schatzmeister Alfred]"; mes "Dein Fortschritt:"; if (Quest_Type == 1) { // Hunting for (.@i = 0; .@i < QuestSettings::.Max_Quests; .@i++) { if (getd("Quest" + .@i)) { .@mob = getd("Quest" + .@i); .@count = getd("Quest" + .@i + "_Count"); .@needed = getd("Quest" + .@i + "_Needed"); mes " > " + getmonsterinfo(.@mob, MOB_NAME) + " (" + .@count + "/" + .@needed + ")"; } } } if (Quest_Type == 2) { // Killing .@mob = Quest0; .@count = Quest0_Count; .@needed = Quest0_Needed; mes " > " + getmonsterinfo(.@mob, MOB_NAME) + " (" + .@count + "/" + .@needed + ")"; mes " > Boss " + getmonsterinfo(.@mob, MOB_NAME) + " (" + (Quest_Monster_Count ? "Erlegt" : "Auf " + Quest_Monster_Map$ + "") + ")"; } if (Quest_Type == 3) { // Collection for (.@i = 0; .@i < QuestSettings::.Max_Quests; .@i++) { if (getd("Quest" + .@i + "_Item")) { .@item = getd("Quest" + .@i + "_Item"); .@needed = getd("Quest" + .@i + "_Item_Needed"); mes " > " + getitemname(.@item) + " (" + countitem(.@item) + "/" + .@needed + ")"; } } } .@complete = callsub Check_Completion; if (.@complete) { next; mes "[Schatzmeister Alfred]"; mes "Hervorragend, du hast den Quest gemeistert!"; mes "Die Gilde ist stolz auf dich!"; emotion ET_BEST; specialeffect2 EF_ANGEL; specialeffect2 EF_TRUESIGHT; if (Quest_Type == 2 && Quest_Monster_GID) { killmonster Quest_Monster_Map$, "QuestMonster::OnQuestMobKilled", Quest_Monster_GID; dispbottom "Der Quest-spezifische Boss wurde entfernt."; } .@points = Quest_Difficulty * 2 + rand(1,5); .@exp = Quest_Difficulty * 10000 + rand(5000,15000); .@zeny = Quest_Difficulty * 2000 + rand(1000,4000); .@rare_chance = rand(100); if (.@rare_chance < 1) { // 1% rare item setarray .@rare_items[0], 607, 1201, 1101, 1601, 2301, 2101, 7179; // Ygg Berry, weapons, Old Card Album .@rare_item = .@rare_items[rand(getarraysize(.@rare_items))]; getitem .@rare_item, 1; mes " > Seltener Fund: ^0055FF" + getitemname(.@rare_item) + "^000000!"; } else if (.@rare_chance < 10) { // 9% uncommon item setarray .@uncommon_items[0], 601, 602, 645, 656, 657; // Fly Wing, Butterfly Wing, etc. .@uncommon_item = .@uncommon_items[rand(getarraysize(.@uncommon_items))]; .@qty = rand(1,3); getitem .@uncommon_item, .@qty; mes " > Fund: ^0055FF" + getitemname(.@uncommon_item) + " x" + .@qty + "^000000"; } else { // 90% common item setarray .@common_items[0], 501, 502, 503, 504, 505, 512, 513, 514; // Potions, fruits .@common_item = .@common_items[rand(getarraysize(.@common_items))]; .@qty = rand(3,10); getitem .@common_item, .@qty; mes " > Fund: ^0055FF" + getitemname(.@common_item) + " x" + .@qty + "^000000"; } mes "Belohnungen:"; mes " > Missionspunkte: ^0055FF" + .@points + "^000000"; mes " > Basis-EXP: ^0055FF" + F_InsertComma(.@exp) + "^000000"; mes " > Berufs-EXP: ^0055FF" + F_InsertComma(.@exp) + "^000000"; mes " > Zeny: ^0055FF" + F_InsertComma(.@zeny) + "^000000"; #Mission_Points += .@points; BaseExp += .@exp; JobExp += .@exp; Zeny += .@zeny; for (.@i = 0; .@i < QuestSettings::.Max_Quests; .@i++) { setd "Quest" + .@i, 0; setd "Quest" + .@i + "_Count", 0; setd "Quest" + .@i + "_Needed", 0; if (Quest_Type == 3) { .@item = getd("Quest" + .@i + "_Item"); .@needed = getd("Quest" + .@i + "_Item_Needed"); if (.@item) delitem .@item, .@needed; setd "Quest" + .@i + "_Item", 0; setd "Quest" + .@i + "_Item_Needed", 0; } } Quest0 = 0; Quest0_Count = 0; Quest0_Needed = 0; Quest_Type = 0; Quest_Difficulty = 0; Quest_Monster_GID = 0; Quest_Monster_Map$ = ""; Quest_Monster_ID = 0; Quest_Monster_Count = 0; if (QuestSettings::.Delay) #Quest_Delay = gettimetick(2) + (QuestSettings::.Delay * 3600); Mission_Total++; setd "Quest_Tier" + Quest_Difficulty + "_Progress", getd("Quest_Tier" + Quest_Difficulty + "_Progress") + 1; if (getd("Quest_Tier" + Quest_Difficulty + "_Progress") >= (QuestSettings::.Hunting_Quests + QuestSettings::.Killing_Quests + QuestSettings::.Collection_Quests)) setd "Quest_Tier" + Quest_Difficulty + "_Complete", 1; if (Mission_Total == 1) query_sql("INSERT INTO `char_reg_num` (`char_id`,`key`,`index`,`value`) VALUES (" + getcharid(0) + ",'Mission_Total','0',1)"); else query_sql("UPDATE `char_reg_num` SET `value` = " + Mission_Total + " WHERE `char_id` = " + getcharid(0) + " AND `key` = 'Mission_Total'"); close; } mes "Du bist noch nicht fertig, Held!"; mes F_Rand( "Weiter so, die Gilde zählt auf dich!", "Du bist nah dran, gib nicht auf!", "Ein wenig mehr, und der Ruhm ist dein!" ); emotion ET_SMILE; close; Check_Completion: if (Quest_Type == 1) { // Hunting for (.@i = 0; .@i < QuestSettings::.Max_Quests; .@i++) { if (getd("Quest" + .@i) && getd("Quest" + .@i + "_Count") < getd("Quest" + .@i + "_Needed")) return 0; } return 1; } else if (Quest_Type == 2) { // Killing return (Quest0_Count >= Quest0_Needed && Quest_Monster_Count); } else if (Quest_Type == 3) { // Collection for (.@i = 0; .@i < QuestSettings::.Max_Quests; .@i++) { if (getd("Quest" + .@i + "_Item") && countitem(getd("Quest" + .@i + "_Item")) < getd("Quest" + .@i + "_Item_Needed")) return 0; } return 1; } return 0; OnNPCKillEvent: if (!Quest_Type || (!getcharid(1) || !QuestSettings::.Party)) { if (Quest_Type == 1) { // Hunting for (.@i = 0; .@i < QuestSettings::.Max_Quests; .@i++) { if (getd("Quest" + .@i) && getmonsterinfo(killedrid, MOB_NAME) == getmonsterinfo(getd("Quest" + .@i), MOB_NAME)) { if (getd("Quest" + .@i + "_Count") < getd("Quest" + .@i + "_Needed")) { setd "Quest" + .@i + "_Count", getd("Quest" + .@i + "_Count") + 1; dispbottom "[Quest] Getötet " + getd("Quest" + .@i + "_Count") + " von " + getd("Quest" + .@i + "_Needed") + " " + getmonsterinfo(killedrid, MOB_NAME) + "."; end; } } } } if (Quest_Type == 2 && Quest0 && getmonsterinfo(killedrid, MOB_NAME) == getmonsterinfo(Quest0, MOB_NAME)) { if (Quest0_Count < Quest0_Needed) { Quest0_Count++; dispbottom "[Quest] Getötet " + Quest0_Count + " von " + Quest0_Needed + " " + getmonsterinfo(Quest0, MOB_NAME) + "."; end; } } } else if (QuestSettings::.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 .@Quest_Type, getvar(Quest_Type, $@partymembercid[.@i]); set .@HP, readparam(HP, $@partymembercid[.@i]); if (.@Quest_Type && .@HP > 0) { getmapxy(.@map2$,.@x2,.@y2,BL_PC,rid2name($@partymemberaid[.@i])); if ((.@map1$ == .@map2$ || QuestSettings::.Party == 1) && (distance(.@x1,.@y1,.@x2,.@y2) <= 30 || QuestSettings::.Party < 3)) { if (.@Quest_Type == 1) { for (.@j = 0; .@j < QuestSettings::.Max_Quests; .@j++) { .@my_mob = getvar(getd("Quest" + .@j), $@partymembercid[.@i]); .@my_count = getvar(getd("Quest" + .@j + "_Count"), $@partymembercid[.@i]); .@my_needed = getvar(getd("Quest" + .@j + "_Needed"), $@partymembercid[.@i]); if (.@my_mob && getmonsterinfo(.@mob, MOB_NAME) == getmonsterinfo(.@my_mob, MOB_NAME) && .@my_count < .@my_needed) { setd "Quest" + .@j + "_Count", .@my_count + 1, $@partymembercid[.@i]; dispbottom "[Quest] Getötet " + (.@my_count + 1) + " von " + .@my_needed + " " + getmonsterinfo(.@mob, MOB_NAME) + ".", 0x777777, $@partymembercid[.@i]; break; } } } if (.@Quest_Type == 2) { .@my_mob = getvar(Quest0, $@partymembercid[.@i]); .@my_count = getvar(Quest0_Count, $@partymembercid[.@i]); .@my_needed = getvar(Quest0_Needed, $@partymembercid[.@i]); if (.@my_mob && getmonsterinfo(.@mob, MOB_NAME) == getmonsterinfo(.@my_mob, MOB_NAME) && .@my_count < .@my_needed) { setd "Quest0_Count", .@my_count + 1, $@partymembercid[.@i]; dispbottom "[Quest] Getötet " + (.@my_count + 1) + " von " + .@my_needed + " " + getmonsterinfo(.@mob, MOB_NAME) + ".", 0x777777, $@partymembercid[.@i]; } } } } } } } end; OnPCLogoutEvent: if (Quest_Type == 2 && Quest_Monster_GID) { killmonster Quest_Monster_Map$, "QuestMonster::OnQuestMobKilled", Quest_Monster_GID; Quest_Monster_GID = 0; Quest_Monster_Map$ = ""; Quest_Monster_ID = 0; Quest_Monster_Count = 0; dispbottom "Dein Quest-spezifischer Boss wurde entfernt, da du dich abgemeldet hast."; } end; } //===== Special Boss Monster Label ===== - script QuestMonster -1,{ OnQuestMobKilled: if (Quest_Type == 2 && Quest_Monster_GID == killedgid && Quest0 == Quest_Monster_ID) { if (!getcharid(1) || !QuestSettings::.Party) { Quest_Monster_Count = 1; dispbottom "[Quest] Ziel Boss " + getmonsterinfo(Quest_Monster_ID, MOB_NAME) + " erlegt!"; killmonster Quest_Monster_Map$, "QuestMonster::OnQuestMobKilled", Quest_Monster_GID; Quest_Monster_GID = 0; Quest_Monster_Map$ = ""; Quest_Monster_ID = 0; } else if (QuestSettings::.Party) { 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 .@Quest_Type, getvar(Quest_Type, $@partymembercid[.@i]); set .@HP, readparam(HP, $@partymembercid[.@i]); set .@Quest_GID, getvar(Quest_Monster_GID, $@partymembercid[.@i]); set .@Quest_Mob, getvar(Quest0, $@partymembercid[.@i]); if (.@Quest_Type == 2 && .@HP > 0 && .@Quest_GID == killedgid && .@Quest_Mob == Quest_Monster_ID) { getmapxy(.@map2$,.@x2,.@y2,BL_PC,rid2name($@partymemberaid[.@i])); if ((.@map1$ == .@map2$ || QuestSettings::.Party == 1) && (distance(.@x1,.@y1,.@x2,.@y2) <= 30 || QuestSettings::.Party < 3)) { setd "Quest_Monster_Count", 1, $@partymembercid[.@i]; dispbottom "[Quest] Ziel Boss " + getmonsterinfo(Quest_Monster_ID, MOB_NAME) + " erlegt!", 0x777777, $@partymembercid[.@i]; killmonster Quest_Monster_Map$, "QuestMonster::OnQuestMobKilled", Quest_Monster_GID; setd "Quest_Monster_GID", 0, $@partymembercid[.@i]; setd "Quest_Monster_Map$", "", $@partymembercid[.@i]; setd "Quest_Monster_ID", 0, $@partymembercid[.@i]; break; } } } } } } end; } //===== Lore Keeper NPC ===== pvp_room,48,45,4 script Großmeister Wolfhart 48,{ mes "[Großmeister Wolfhart]"; mes "Willkommen, Wanderer " + strcharinfo(0) + "."; mes "Ich bin der Hüter der Geschichten von Rune-Midgard."; mes "Welche Weisheit suchst du?"; next; switch(select(" ~ Über die Gilde: ~ Über Quests: ~ Über Rune-Midgard: ~ ^777777Abbrechen^000000")) { case 1: mes "[Großmeister Wolfhart]"; mes "Die Abenteurergilde wurde vor Jahrhunderten gegründet, als Helden sich vereinten, um das Land vor Chaos zu schützen."; mes "Unsere Hallen sind voller Taten von Mut und Ruhm."; mes "Sprich mit dem Gildenmeister Konrad, um deinen Platz unter den Legenden zu finden."; emotion ET_THINK; close; case 2: mes "[Großmeister Wolfhart]"; mes "Quests sind die Prüfungen der Gilde. Jage Monster, besiege mächtige Bosse oder sammle seltene Schätze."; mes "Jeder Aufgabenmeister hat seine eigenen Geschichten – höre genau hin, denn sie bergen Hinweise!"; mes "Der Empfänger wird deinen Fortschritt prüfen."; emotion ET_BOOK; close; case 3: mes "[Großmeister Wolfhart]"; mes "Rune-Midgard ist ein Land voller Wunder und Gefahren."; mes "Von den Feldern Pronteras bis zu den Tiefen von Glast Heim lauern Monster und Schätze."; mes "Man sagt, selbst Porings waren einst friedlich, bis ein Fluch sie verdarb..."; emotion ET_DELIGHT; close; case 4: mes "[Großmeister Wolfhart]"; mes "Die Geschichten warten auf dich, wenn du bereit bist."; emotion ET_SMILE; close; } } //===== Teleport Agent NPC ===== pvp_room,59,45,4 script Stallmeister Tobias 48,{ mes "[Stallmeister Tobias]"; mes "Hallo, Abenteurer " + strcharinfo(0) + "!"; mes "Ich kann dich zu den gefährlichsten Orten Rune-Midgards bringen."; mes "Wohin willst du? Es kostet ein wenig Zeny."; next; switch(select(" ~ Tier 1 Gebiete (100 Zeny): ~ Tier 2 Gebiete (200 Zeny): ~ Tier 3 Gebiete (300 Zeny): ~ Tier 4 Gebiete (400 Zeny): ~ Tier 5 Gebiete (500 Zeny): ~ ^777777Abbrechen^000000")) { case 1: callsub Warp_To, 1, 100; break; case 2: callsub Warp_To, 2, 200; break; case 3: callsub Warp_To, 3, 300; break; case 4: callsub Warp_To, 4, 400; break; case 5: callsub Warp_To, 5, 500; break; case 6: mes "[Stallmeister Tobias]"; mes "Kehre zurück, wenn du reisen willst!"; emotion ET_SMILE; close; } Warp_To: .@tier = getarg(0); .@cost = getarg(1); mes "[Stallmeister Tobias]"; if (Zeny < .@cost) { mes "Nicht genug Zeny! Du brauchst " + .@cost + " Zeny."; emotion ET_SORRY; close; } .@map_array$ = getd("QuestSettings::.Maps_Tier" + .@tier + "$"); .@size = getarraysize(.@map_array$); mes "Wähle dein Ziel:"; for (.@i = 0; .@i < .@size; .@i++) mes " ~ " + .@map_array$[.@i]; mes " ~ ^777777Abbrechen^000000"; next; .@select = select( implode(.@map_array$, ":") + ":^777777Abbrechen^000000" ) - 1; if (.@select >= .@size) { mes "[Stallmeister Tobias]"; mes "Kehre zurück, wenn du bereit bist!"; emotion ET_SMILE; close; } Zeny -= .@cost; warp .@map_array$[.@select], 0, 0; mes "[Stallmeister Tobias]"; mes "Viel Glück, Abenteurer!"; emotion ET_GO; close; } //===== Quest Giver NPCs (8 Total) ===== // Tier 1: Melder Kurt pvp_room,30,85,4 script Melder Kurt 48,{ mes "[Melder Kurt]"; mes "Grüß dich, junger Abenteurer " + strcharinfo(0) + "!"; mes "Die Welt von Rune-Midgard braucht Helden wie dich."; if (getarraysize(QuestSubroutines::.Hunting_Stories$) == 0) { mes "Fehler: Quest-Daten nicht geladen. Bitte melde dies dem Admin."; emotion ET_SORRY; close; } if (Quest_Type && Quest_Difficulty != 1) { mes "Du hast einen anderen Quest. Schließe den zuerst ab!"; emotion ET_THINK; close; } if (#Quest_Delay > gettimetick(2)) { mes "Komm zurück nach " + Time2Str(#Quest_Delay) + " für einen neuen Quest."; emotion ET_SWEAT; close; } mes F_Rand( "Die Dörfer rufen nach Hilfe, bist du bereit?", "Kleine Taten machen große Helden!", "Dein Abenteuer beginnt hier, Held!" ); mes "Welche Aufgabe wählst du?"; mes "^777777Level 1–20 Quests^000000"; next; switch(select(" ~ Jagd-Quest: ~ Tötungs-Quest: ~ Sammel-Quest: ~ ^777777Abbrechen^000000")) { case 1: callsub QuestSubroutines::Generate_Hunting_Quest, 1; close; case 2: callsub QuestSubroutines::Generate_Killing_Quest, 1; close; case 3: callsub QuestSubroutines::Gen_Collection_Quest, 1; close; case 4: mes "[Melder Kurt]"; mes "Keine Eile, komm zurück, wenn du bereit bist!"; emotion ET_SMILE; close; } } // Tier 2: Spähtruppführer Rolf pvp_room,38,85,4 script Spähtruppführer Rolf 48,{ mes "[Spähtruppführer Rolf]"; mes "Hallo, mutiger Abenteurer " + strcharinfo(0) + "!"; mes "Du hast deine ersten Taten vollbracht, nun warten größere Prüfungen."; if (getarraysize(QuestSubroutines::.Hunting_Stories$) == 0) { mes "Fehler: Quest-Daten nicht geladen. Bitte melde dies dem Admin."; emotion ET_SORRY; close; } if (BaseLevel < 21 || BaseLevel > 40) { mes "Dein Level passt nicht (21–40)."; emotion ET_NO; close; } if (!Quest_Tier1_Complete) { mes "Du musst erst alle Anfänger-Quests abschließen!"; emotion ET_NO; close; } if (Quest_Type && Quest_Difficulty != 2) { mes "Du hast einen anderen Quest. Schließe den zuerst!"; emotion ET_THINK; close; } if (#Quest_Delay > gettimetick(2)) { mes "Komm nach " + Time2Str(#Quest_Delay) + " zurück."; emotion ET_SWEAT; close; } mes F_Rand( "Dein Name wird in den Tavernen gesungen!", "Die Karawanen brauchen Schutz, bist du bereit?", "Zeit für Ruhm, Held!" ); mes "Welche Aufgabe wählst du?"; mes "^777777Level 21–40 Quests^000000"; next; switch(select(" ~ Jagd-Quest: ~ Tötungs-Quest: ~ Sammel-Quest: ~ ^777777Abbrechen^000000")) { case 1: callsub QuestSubroutines::Generate_Hunting_Quest, 2; close; case 2: callsub QuestSubroutines::Generate_Killing_Quest, 2; close; case 3: callsub QuestSubroutines::Gen_Collection_Quest, 2; close; case 4: mes "[Spähtruppführer Rolf]"; mes "Kehre zurück, wenn der Mut dich treibt!"; emotion ET_SMILE; close; } } // Tier 3: Zugführer Gregor pvp_room,46,85,4 script Zugführer Gregor 48,{ mes "[Zugführer Gregor]"; mes "Sei gegrüßt, tapferer " + strcharinfo(0) + "!"; mes "Deine Taten hallen durch Rune-Midgard."; if (getarraysize(QuestSubroutines::.Hunting_Stories$) == 0) { mes "Fehler: Quest-Daten nicht geladen. Bitte melde dies dem Admin."; emotion ET_SORRY; close; } if (BaseLevel < 41 || BaseLevel > 60) { mes "Dein Level passt nicht (41–60)."; emotion ET_NO; close; } if (!Quest_Tier2_Complete) { mes "Du musst erst alle Novizen-Quests abschließen!"; emotion ET_NO; close; } if (Quest_Type && Quest_Difficulty != 3) { mes "Du hast einen anderen Quest. Schließe den zuerst!"; emotion ET_THINK; close; } if (#Quest_Delay > gettimetick(2)) { mes "Komm nach " + Time2Str(#Quest_Delay) + " zurück."; emotion ET_SWEAT; close; } mes F_Rand( "Die Magiergilde braucht deine Stärke!", "Dein Ruhm wächst, doch die Gefahr auch!", "Bist du bereit für wahre Prüfungen?" ); mes "Welche Aufgabe wählst du?"; mes "^777777Level 41–60 Quests^000000"; next; switch(select(" ~ Jagd-Quest: ~ Tötungs-Quest: ~ Sammel-Quest: ~ ^777777Abbrechen^000000")) { case 1: callsub QuestSubroutines::Generate_Hunting_Quest, 3; close; case 2: callsub QuestSubroutines::Generate_Killing_Quest, 3; close; case 3: callsub QuestSubroutines::Gen_Collection_Quest, 3; close; case 4: mes "[Zugführer Gregor]"; mes "Die Magie der Quests wartet auf dich!"; emotion ET_SMILE; close; } } // Tier 4: Stabsfeldwebel Hagen pvp_room,54,85,4 script Stabsfeldwebel Hagen 48,{ mes "[Stabsfeldwebel Hagen]"; mes "Willkommen, erfahrener " + strcharinfo(0) + "!"; mes "Du bist ein Jäger der Dunkelheit, bereit für große Missionen."; if (getarraysize(QuestSubroutines::.Hunting_Stories$) == 0) { mes "Fehler: Quest-Daten nicht geladen. Bitte melde dies dem Admin."; emotion ET_SORRY; close; } if (BaseLevel < 61 || BaseLevel > 80) { mes "Dein Level passt nicht (61–80)."; emotion ET_NO; close; } if (!Quest_Tier3_Complete) { mes "Du musst erst alle Zwischen-Quests abschließen!"; emotion ET_NO; close; } if (Quest_Type && Quest_Difficulty != 4) { mes "Du hast einen anderen Quest. Schließe den zuerst!"; emotion ET_THINK; close; } if (#Quest_Delay > gettimetick(2)) { mes "Komm nach " + Time2Str(#Quest_Delay) + " zurück."; emotion ET_SWEAT; close; } mes F_Rand( "Die Dunkelheit fürchtet deinen Namen!", "Bist du bereit, die Bestien zu jagen?", "Deine Legende wird in Stein gemeißelt!" ); mes "Welche Aufgabe wählst du?"; mes "^777777Level 61–80 Quests^000000"; next; switch(select(" ~ Jagd-Quest: ~ Tötungs-Quest: ~ Sammel-Quest: ~ ^777777Abbrechen^000000")) { case 1: callsub QuestSubroutines::Generate_Hunting_Quest, 4; close; case 2: callsub QuestSubroutines::Generate_Killing_Quest, 4; close; case 3: callsub QuestSubroutines::Gen_Collection_Quest, 4; close; case 4: mes "[Stabsfeldwebel Hagen]"; mes "Die Beute entkommt nicht ewig, komm zurück!"; emotion ET_SMILE; close; } } // Tier 4: Hauptmann Lothar pvp_room,62,85,4 script Hauptmann Lothar 48,{ mes "[Hauptmann Lothar]"; mes "Grüß dich, " + strcharinfo(0) + ", Schatten der Gilde!"; mes "Nur die Besten bestehen meine Prüfungen."; if (getarraysize(QuestSubroutines::.Hunting_Stories$) == 0) { mes "Fehler: Quest-Daten nicht geladen. Bitte melde dies dem Admin."; emotion ET_SORRY; close; } if (BaseLevel < 61 || BaseLevel > 80) { mes "Dein Level passt nicht (61–80)."; emotion ET_NO; close; } if (!Quest_Tier3_Complete) { mes "Du musst erst alle Zwischen-Quests abschließen!"; emotion ET_NO; close; } if (Quest_Type && Quest_Difficulty != 4) { mes "Du hast einen anderen Quest. Schließe den zuerst!"; emotion ET_THINK; close; } if (#Quest_Delay > gettimetick(2)) { mes "Komm nach " + Time2Str(#Quest_Delay) + " zurück."; emotion ET_SWEAT; close; } mes F_Rand( "Die Nacht ruft nach deinen Klingen!", "Deine Feinde zittern vor deinem Namen!", "Bist du bereit für die Elite?" ); mes "Welche Aufgabe wählst du?"; mes "^777777Level 61–80 Quests^000000"; next; switch(select(" ~ Jagd-Quest: ~ Tötungs-Quest: ~ Sammel-Quest: ~ ^777777Abbrechen^000000")) { case 1: callsub QuestSubroutines::Generate_Hunting_Quest, 4; close; case 2: callsub QuestSubroutines::Generate_Killing_Quest, 4; close; case 3: callsub QuestSubroutines::Gen_Collection_Quest, 4; close; case 4: mes "[Hauptmann Lothar]"; mes "Die Schatten warten auf dich, Held!"; emotion ET_SMILE; close; } } // Tier 5: Oberst Wilfried pvp_room,70,85,4 script Oberst Wilfried 48,{ mes "[Oberst Wilfried]"; mes "Sei’s drum, Legende " + strcharinfo(0) + "!"; mes "Nur die Mächtigsten bestehen die Prüfungen der Gilde."; if (getarraysize(QuestSubroutines::.Hunting_Stories$) == 0) { mes "Fehler: Quest-Daten nicht geladen. Bitte melde dies dem Admin."; emotion ET_SORRY; close; } if (BaseLevel < 81 || BaseLevel > 99) { mes "Dein Level passt nicht (81–99)."; emotion ET_NO; close; } if (!Quest_Tier4_Complete) { mes "Du musst erst alle Fortgeschrittenen-Quests abschließen!"; emotion ET_NO; close; } if (Quest_Type && Quest_Difficulty != 5) { mes "Du hast einen anderen Quest. Schließe den zuerst!"; emotion ET_THINK; close; } if (#Quest_Delay > gettimetick(2)) { mes "Komm nach " + Time2Str(#Quest_Delay) + " zurück."; emotion ET_SWEAT; close; } mes F_Rand( "Deine Taten sind Legende, doch die größte Prüfung wartet!", "Die Götter beobachten dich, Held!", "Bist du bereit, die Dunkelheit zu bannen?" ); mes "Welche Aufgabe wählst du?"; mes "^777777Level 81–99 Quests^000000"; next; switch(select(" ~ Jagd-Quest: ~ Tötungs-Quest: ~ Sammel-Quest: ~ ^777777Abbrechen^000000")) { case 1: callsub QuestSubroutines::Generate_Hunting_Quest, 5; close; case 2: callsub QuestSubroutines::Generate_Killing_Quest, 5; close; case 3: callsub QuestSubroutines::Gen_Collection_Quest, 5; close; case 4: mes "[Oberst Wilfried]"; mes "Selbst Legenden brauchen Pausen. Komm zurück!"; emotion ET_SMILE; close; } } // Tier 5: General Wolfram pvp_room,78,85,4 script General Wolfram 48,{ mes "[General Wolfram]"; mes "Heil dir, " + strcharinfo(0) + ", Licht der Gilde!"; mes "Dein Name ist ein Leuchtfeuer für alle Helden."; if (getarraysize(QuestSubroutines::.Hunting_Stories$) == 0) { mes "Fehler: Quest-Daten nicht geladen. Bitte melde dies dem Admin."; emotion ET_SORRY; close; } if (BaseLevel < 81 || BaseLevel > 99) { mes "Dein Level passt nicht (81–99)."; emotion ET_NO; close; } if (!Quest_Tier4_Complete) { mes "Du musst erst alle Fortgeschrittenen-Quests abschließen!"; emotion ET_NO; close; } if (Quest_Type && Quest_Difficulty != 5) { mes "Du hast einen anderen Quest. Schließe den zuerst!"; emotion ET_THINK; close; } if (#Quest_Delay > gettimetick(2)) { mes "Komm nach " + Time2Str(#Quest_Delay) + " zurück."; emotion ET_SWEAT; close; } mes F_Rand( "Die Welt kniet vor deiner Macht!", "Deine Taten werden in Epen besungen!", "Bist du bereit für die letzte Prüfung?" ); mes "Welche Aufgabe wählst du?"; mes "^777777Level 81–99 Quests^000000"; next; switch(select(" ~ Jagd-Quest: ~ Tötungs-Quest: ~ Sammel-Quest: ~ ^777777Abbrechen^000000")) { case 1: callsub QuestSubroutines::Generate_Hunting_Quest, 5; close; case 2: callsub QuestSubroutines::Generate_Killing_Quest, 5; close; case 3: callsub QuestSubroutines::Gen_Collection_Quest, 5; close; case 4: mes "[General Wolfram]"; mes "Das Licht der Legenden leuchtet weiter!"; emotion ET_SMILE; close; } } // Tier 5: Kriegsminister Gustav pvp_room,86,85,4 script Kriegsminister Gustav 48,{ mes "[Kriegsminister Gustav]"; mes "Ehre sei dir, " + strcharinfo(0) + ", Meister der Gilde!"; mes "Nur die Größten wagen meine Aufgaben."; if (getarraysize(QuestSubroutines::.Hunting_Stories$) == 0) { mes "Fehler: Quest-Daten nicht geladen. Bitte melde dies dem Admin."; emotion ET_SORRY; close; } if (BaseLevel < 81 || BaseLevel > 99) { mes "Dein Level passt nicht (81–99)."; emotion ET_NO; close; } if (!Quest_Tier4_Complete) { mes "Du musst erst alle Fortgeschrittenen-Quests abschließen!"; emotion ET_NO; close; } if (Quest_Type && Quest_Difficulty != 5) { mes "Du hast einen anderen Quest. Schließe den zuerst!"; emotion ET_THINK; close; } if (#Quest_Delay > gettimetick(2)) { mes "Komm nach " + Time2Str(#Quest_Delay) + " zurück."; emotion ET_SWEAT; close; } mes F_Rand( "Deine Stärke ist ohnegleichen!", "Die Welt braucht deinen Mut, Meister!", "Bist du bereit für die ultimative Prüfung?" ); mes "Welche Aufgabe wählst du?"; mes "^777777Level 81–99 Quests^000000"; next; switch(select(" ~ Jagd-Quest: ~ Tötungs-Quest: ~ Sammel-Quest: ~ ^777777Abbrechen^000000")) { case 1: callsub QuestSubroutines::Generate_Hunting_Quest, 5; close; case 2: callsub QuestSubroutines::Generate_Killing_Quest, 5; close; case 3: callsub QuestSubroutines::Gen_Collection_Quest, 5; close; case 4: mes "[Kriegsminister Gustav]"; mes "Die Meisterschaft erwartet dich, Held!"; emotion ET_SMILE; close; } } //===== Quest Generation Subroutines ===== - script QuestSubroutines -1,{ OnInit: // Quest story templates setarray .Hunting_Stories$[0], "Die [Monster1] und ihre Brüder [Monster2] bedrohen die Felder! Jage sie!", "Die Händler klagen über [Monster1] in der Nähe. Erlege sie!", "Ein Rudel [Monster1] und [Monster2] hat die Straßen unsicher gemacht. Säubere sie!", "Die Bauern fürchten die [Monster1]. Bringe Frieden zurück!", "Die [Monster1] und [Monster2] stören die Karawanen. Jage sie!", "Die Wälder sind voller [Monster1]. Zeig deine Stärke!", "Die [Monster1] und ihre Verbündeten [Monster2] bedrohen die Dörfer. Stoppe sie!", "Ein Nest von [Monster1] wurde entdeckt. Vernichte es!", "Die [Monster1] und [Monster2] haben die Händler vertrieben. Jage sie!", "Die Gelehrten bitten um Hilfe gegen [Monster1]. Erlege sie!"; setarray .Killing_Stories$[0], "Die [Monster] bedrohen [Map], angeführt von einem mächtigen Boss [Monster]! Erlege sie alle!", "Ein Schwarm [Monster] und ihr Boss [Monster] haben [Map] übernommen. Säubere das Gebiet!", "Die [Monster] in [Map] folgen einem Boss [Monster]. Besiege sie und ihren Anführer!", "Die Magiergilde meldet [Monster] in [Map], geleitet von einem Boss [Monster]. Stoppe sie!", "Karawanen in [Map] werden von [Monster] und einem Boss [Monster] angegriffen. Rette sie!", "Ein Fluch hat die [Monster] und ihren Boss [Monster] in [Map] erweckt. Beende ihn!", "Die [Monster] in [Map] gehorchen einem Boss [Monster]. Bringe Frieden zurück!", "Ein Boss [Monster] führt die [Monster] in [Map] an. Besiege sie für die Händler!", "Die [Monster] und ihr Boss [Monster] terrorisieren [Map]. Stelle dich ihnen!", "Ein Boss [Monster] und seine [Monster] bedrohen [Map]. Vertreibe sie für die Gelehrten!"; setarray .Collection_Stories$[0], "Die Schmiede benötigen [Item1] und [Item2] für neue Worte. Sammle sie!", "Die Alchemisten bitten um [Item1] für ihre Tränke. Bringe sie!", "Die Händler suchen [Item1] und [Item2] für den Handel. Finde sie!", "Die Magiergilde braucht [Item1] für ein Ritual. Sammle sie!", "Die Bauern benötigen [Item1] und [Item2] für ihre Felder. Hilf ihnen!", "Ein Sammler zahlt gut für [Item1]. Bringe sie ihm!", "Die Gilde braucht [Item1] und [Item2] für Vorräte. Sammle sie!", "Ein Händler sucht [Item1] für seine Karawane. Finde sie!", "Die Gelehrten benötigen [Item1] und [Item2] für Studien. Bringe sie!", "Ein Priester bittet um [Item1] für ein heiliges Ritual. Sammle sie!"; // Debug: Verify array size debugmes "QuestSubroutines: Hunting_Stories$ size: " + getarraysize(.Hunting_Stories$); debugmes "QuestSubroutines: Killing_Stories$ size: " + getarraysize(.Killing_Stories$); debugmes "QuestSubroutines: Collection_Stories$ size: " + getarraysize(.Collection_Stories$); end; Generate_Hunting_Quest: .@difficulty = getarg(0); mes "[Aufgabenmeister]"; .@count = rand(1,3); .@min_level = .@difficulty * 20 - 19; .@max_level = .@difficulty * 20; .@min_count = .@difficulty * 10; .@max_count = .@difficulty * 20; 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 level >= " + .@min_level + " AND level <= " + .@max_level + " AND instr('"+QuestSettings::.Blacklist$+"',ID) = 0 ORDER BY rand() LIMIT " + .@count, .@mobs); //.@story_index = rand(getarraysize(.Hunting_Stories$)); .@story$ = .Hunting_Stories$[.@story_index]; for (.@i = 0; .@i < .@count; .@i++) { .@mob_name$ = getmonsterinfo(.@mobs[.@i], MOB_NAME); .@story$ = replacestr(.@story$, "[Monster" + (.@i+1) + "]", .@mob_name$); } mes .@story$; for (.@i = 0; .@i < .@count; .@i++) { .@needed = rand(.@min_count, .@max_count); setd "Quest" + .@i, .@mobs[.@i]; setd "Quest" + .@i + "_Needed", .@needed; setd "Quest" + .@i + "_Count", 0; mes " > Jage " + .@needed + " " + getmonsterinfo(.@mobs[.@i], MOB_NAME) + "."; } mes "Belohnung: Missionspunkte, Erfahrung, Zeny und vielleicht ein seltener Schatz!"; next; if (select("Annehmen:Abbrechen") == 2) { mes "[Aufgabenmeister]"; mes "Kehre zurück, wenn du bereit bist!"; emotion ET_SMILE; close; } Quest_Type = 1; Quest_Difficulty = .@difficulty; mes "[Aufgabenmeister]"; mes F_Rand( "Los, Held! Zeig ihnen deine Stärke!", "Viel Erfolg! Die Gilde zählt auf dich!", "Die Jagd beginnt, melde dich beim Empfänger!" ); return; Generate_Killing_Quest: .@difficulty = getarg(0); mes "[Aufgabenmeister]"; .@min_level = .@difficulty * 20 - 19; .@max_level = .@difficulty * 20; switch (.@difficulty) { case 1: .@min_count = 20; .@max_count = 50; break; case 2: .@min_count = 50; .@max_count = 80; break; case 3: .@min_count = 80; .@max_count = 120; break; case 4: .@min_count = 120; .@max_count = 160; break; case 5: .@min_count = 160; .@max_count = 200; break; } 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 level >= " + .@min_level + " AND level <= " + .@max_level + " AND instr('"+QuestSettings::.Blacklist$+"',ID) = 0 ORDER BY rand() LIMIT 1", .@mob); .@map_array$ = getd("QuestSettings::.Maps_Tier" + .@difficulty + "$"); .@map$ = .@map_array$[rand(getarraysize(.@map_array$))]; .@needed = rand(.@min_count, .@max_count); //.@story_index = rand(getarraysize(.Killing_Stories$)); .@story$ = .Killing_Stories$[.@story_index]; .@mob_name$ = getmonsterinfo(.@mob[0], MOB_NAME); .@story$ = replacestr(.@story$, "[Monster]", .@mob_name$); .@story$ = replacestr(.@story$, "[Map]", .@map$); mes .@story$; mes " > Erlege " + .@needed + " " + .@mob_name$ + "."; mes " > Besiege 1 Boss " + .@mob_name$ + " auf " + .@map$ + "."; mes "Belohnung: Missionspunkte, Erfahrung, Zeny und vielleicht ein seltener Schatz!"; next; if (select("Annehmen:Abbrechen") == 2) { mes "[Aufgabenmeister]"; mes "Kehre zurück, wenn du bereit bist!"; emotion ET_SMILE; close; } Quest_Type = 2; Quest_Difficulty = .@difficulty; Quest0 = .@mob[0]; Quest0_Count = 0; Quest0_Needed = .@needed; Quest_Monster_ID = .@mob[0]; Quest_Monster_Map$ = .@map$; Quest_Monster_Count = 0; .@hp = getmonsterinfo(.@mob[0], MOB_MAXHP) * 10; Quest_Monster_GID = monster(.@map$, 0, 0, "Boss " + .@mob_name$, .@mob[0], 1, "QuestMonster::OnQuestMobKilled", .@hp); mes "[Aufgabenmeister]"; mes F_Rand( "Ein mächtiger Boss " + .@mob_name$ + " erwartet dich auf " + .@map$ + "!", "Viel Glück, Held! Melde dich beim Empfänger, wenn du fertig bist!", "Dein Ruhm wächst mit diesem Sieg!" ); return; Gen_Collection_Quest: .@difficulty = getarg(0); mes "[Aufgabenmeister]"; .@item_count = rand(1,3); .@min_item = .@difficulty * 5; .@max_item = .@difficulty * 10 + 10; .@items$ = getd("QuestSettings::.Items_Tier" + .@difficulty + "$"); explode(.@item_array$, .@items$, ","); .@size = getarraysize(.@item_array$); .@item_indices = rand(.@size); .@items_selected = min(.@item_count, .@size); for (.@i = 0; .@i < .@items_selected; .@i++) { .@item_list[.@i] = atoi(.@item_array$[(.@item_indices + .@i) % .@size]); } //.@story_index = rand(getarraysize(.Collection_Stories$)); .@story$ = .Collection_Stories$[.@story_index]; for (.@i = 0; .@i < .@items_selected; .@i++) { .@item_name$ = getitemname(.@item_list[.@i]); .@story$ = replacestr(.@story$, "[Item" + (.@i+1) + "]", .@item_name$); } mes .@story$; for (.@i = 0; .@i < .@items_selected; .@i++) { .@item_needed = rand(.@min_item, .@max_item); setd "Quest" + .@i + "_Item", .@item_list[.@i]; setd "Quest" + .@i + "_Item_Needed", .@item_needed; mes " > Sammle " + .@item_needed + " " + getitemname(.@item_list[.@i]) + "."; } mes "Belohnung: Missionspunkte, Erfahrung, Zeny und vielleicht ein seltener Schatz!"; next; if (select("Annehmen:Abbrechen") == 2) { mes "[Aufgabenmeister]"; mes "Kehre zurück, wenn du bereit bist!"; emotion ET_SMILE; close; } Quest_Type = 3; Quest_Difficulty = .@difficulty; mes "[Aufgabenmeister]"; mes F_Rand( "Die Schätze warten auf dich, Held!", "Viel Erfolg! Zum Empfänger, wenn fertig!", "Zeig, dass du ein wahrer Sammler bist!" ); return; } //===== Shop Definition ===== - shop guild_shop -1,611:-1,501:-1,502:-1,503:-1,504:-1,506:-1,645:-1,656:-1,601:-1,602:-1,1065:-1,1750:-1 //===== Quest Settings and Data ===== - script QuestSettings -1,{ OnInit: // Quest settings .Delay = 12; // Quest cooldown in hours .Reset = 5000; // Zeny cost to abandon quests .Max_Quests = 3; // Max simultaneous targets/items .Hunting_Quests = 15; // Number of hunting quests per tier .Killing_Quests = 15; // Number of killing quests per tier .Collection_Quests = 20; // Number of collection quests per tier .Party = 3; // Party support: screen area only // Blacklist of excluded monster IDs (MVPs, problematic) .Blacklist$ = "1003,1006,1012,1014,1015,1021,1022,1027,1043,1050," + "1051,1052,1053,1054,1055,1056,1057,1058,1062,1084," + "1085,1086,1087,1088,1094,1095,1097,1098,1103,1104," + "1105,1106,1110,1111,1112,1118,1121,1122,1123,1124," + "1125,1126,1127,1128,1130,1132,1133,1135,1136,1137," + "1138,1140,1141,1142,1143,1144,1145,1146,1147,1148," + "1149,1150,1151,1152,1153,1154,1155,1156,1157,1158," + "1159,1160,1161,1162,1164,1165,1167,1168,1169,1170," + "1171,1172,1173,1174,1175,1176,1177,1178,1179,1180," + "1181,1182,1183,1184,1185,1186,1187,1188,1189,1190," + "1191,1192,1193,1194,1195,1196,1197,1198,1199,1200," + "1201,1202,1203,1204,1205,1206,1207,1209,1210,1211," + "1212,1213,1214,1215,1216,1217,1218,1220,1221,1222," + "1223,1224,1225,1226,1227,1228,1229,1230,1231,1232," + "1233,1234,1235,1236,1237,1238,1239,1240,1241,1242," + "1243,1244,1245,1246,1247,1249,1250,1251,1252,1253," + "1254,1255,1256,1257,1258,1260,1261,1263,1264,1265," + "1266,1267,1268,1269,1270,1272,1273,1274,1275,1276," + "1277,1278,1279,1280,1281,1282,1283,1284,1285,1286," + "1287,1288,1289,1290,1291,1292,1293,1294,1295,1296," + "1297,1298,1299,1300,1301,1302,1303,1304,1305,1306," + "1307,1308,1309,1310,1311,1312,1313,1314,1315,1316," + "1317,1318,1319,1320,1321,1322,1323,1324,1325,1326," + "1327,1328,1329,1330,1331,1332,1333,1334,1335,1336," + "1337,1338,1339,1340,1341,1342,1343,1344,1345,1346," + "1347,1348,1349,1350,1351,1352,1353,1354,1355,1356," + "1357,1358,1359,1360,1361,1362,1363,1364,1365,1366," + "1367,1368,1369,1370,1371,1372,1373,1374,1375,1376," + "1377,1378,1379,1380,1381,1382,1383,1384,1385,1386," + "1387,1388,1389,1390,1391,1392,1393,1394,1395,1396," + "1397,1398,1399,1400,1401,1402,1403,1404,1405,1406," + "1407,1408,1409,1410,1411,1412,1413,1414,1415,1416"; // Map arrays for each tier setarray .Maps_Tier1$[0], "prt_fild08", "pay_fild04", "moc_fild07", "izlude_dun01", "cmd_fild01"; setarray .Maps_Tier2$[0], "pay_dun00", "moc_fild12", "prt_maze01", "gef_fild07", "cmd_fild03"; setarray .Maps_Tier3$[0], "pay_dun02", "moc_fild16", "gef_fild09", "cmd_fild08", "iz_dun02"; setarray .Maps_Tier4$[0], "pay_dun03", "moc_fild19", "gef_dun01", "cmd_dun02", "gl_sew03"; setarray .Maps_Tier5$[0], "gl_dun02", "gef_dun03", "pay_dun04", "moc_pryd05", "ra_fild01"; // Shop items: ID, mission points cost setarray .Shop[0], 501,2, 502,2, 503,2, 504,5, 505,5, 512,15, 513,15, 514,15, // Potions, fruits 601,30, 602,30, 607,50, 1201,20, 1101,20, 1601,20, 2301,30, 2101,30, 7179,100; // Wings, weapons, Old Card Album // Collection items (pre-renewal, tiered) .Items_Tier1$ = "904,905,906,907,908,909,910,911"; // Jellopy, Fluff, Clover, Feather, etc. .Items_Tier2$ = "912,913,914,915,916,917"; // Sticky Mucus, Scell, Worm Peeling, etc. .Items_Tier3$ = "918,919,920,921,922"; // Animal Skin, Bug Leg, Scale Shell, etc. .Items_Tier4$ = "923,924,925,926,927"; // Cyfar, Brigan, Clam Shell, etc. .Items_Tier5$ = "7152,7170,7171,7172,756"; // Old Blue Box, Gift Box, Gold, etc. // Initialize guild shop npcshopdelitem "guild_shop",501; for (.@i = 0; .@i < getarraysize(.Shop); .@i += 2) npcshopadditem "guild_shop", .Shop[.@i], .Shop[.@i+1]; end; } Maybe someone here has a clue what i can do to fix this, im pretty clueless and the grok ai is not able to find a fix for this sadly (wasted 20 hours on useless solution tries from grok ai). Kind regards kainfx
  3. But why buy from resellers if it's free for the community here?
  4. That's right, sharing for free, but some people are selling them on their pages. It's really funny. It's good that @skylove repacked it, so nothing can be fixed.
  5. maybe the active grf is not read by DATA.INI but the data in the client GRF embedded
  6. Initial release of episode 19 - Walkthrough Conversion https://github.com/rathena/rathena/pull/8527
  7. Hello. Using NoNPC: true will block the copying of all NPCs on the map moc_fild17, including custom ones or those with the OnInstanceInit label (e.g., InstanceSpawner#DD). To enable your custom NPC inside the instance, you must duplicate them manually after the instance is created. *duplicate "<NPC name>","<map>",<x>,<y>{,"<Duplicate NPC name>"{,<sprite>{,<dir>{,<xs>{,<xy>}}}}}; This command will duplicate the NPC with the given <NPC name> on <map> at <x>/<y>. If <Duplicate NPC name>, <sprite>, <dir>, <xs> or <ys> is not provided the value of the original NPC will be used. The Unique name of the new duplicated NPC is returned on success. An empty string is returned on failure. NOTE: Duplicates will always have the same NPC variables as the original NPC. Editing a NPC variable in a duplicate or the original NPC will change it for the others. Example: .@md_name$ = "Phreeoni"; .@id = instance_create(.@md_name$); if (.@id < 0) { mes "Party Name: "+ getpartyname(.@party_id); mes "Party Leader: "+strcharinfo(0); mes "^0000ff"+.@md_name$+" ^000000- Reservation Failed!"; close; } //NPC to duplicate setarray .@npc_name$,"Phreeoni Helper#DD", "InstanceSpawner#DD"; .@m$ = instance_mapname(instance_info(.@md_name$,IIT_ENTER_MAP), .@id); for ( .@i = 0; .@i < getarraysize(.@npc_name$); .@i++ ) { if (getmapxy(.@mapname$, .@mapx, .@mapy, BL_NPC, .@npc_name$[.@i]) == 0) { if (duplicate(.@npc_name$[.@i], .@m$, .@mapx, .@mapy) == "") debugmes "NPC: " + .@npc_name$[.@i] + " not found for duplication."; } } // Instance Controller NPC (Triggers OnInstanceInit) moc_fild17,37,289,0 script InstanceSpawner#DD 1001,10,10,{ end; OnInit: // Hide if outside instance — needed due to NoNpc: true if (countstr(strnpcinfo(4), "#") == 0) disablenpc; end; OnTouch: // Do nothing if outside instance — needed due to NoNpc: true if (countstr(strnpcinfo(4), "#") == 0) end; disablenpc; //disable itself so that it triggers only once // Broadcast to the instance map mapannounce strnpcinfo(4), "[System]: The monsters have arrived!", bc_map; // Spawn mobs in the instance monster strnpcinfo(4), 75, 265, "Phreeoni Minion", 1002, 10; monster strnpcinfo(4), 78, 268, "Phreeoni", 1159, 1; end; } // Instance-Only NPC (initially hidden) moc_fild17,42,292,0 script Phreeoni Helper#DD 100,{ mes "Hello!"; mes "Welcome to the Phreeoni Instance."; close; OnInit: // Hide if not inside instance — needed due to NoNpc: true if (countstr(strnpcinfo(4), "#") == 0) disablenpc; end; } NPCs created using the duplicate command will not trigger OnInstanceInit. It's recommended to use strnpcinfo(3) instead of instance_npcname, and strnpcinfo(4) instead of instance_mapname.
  8. This auto attack is great but the problem is it consumes too much processing in your server that causes lag spikes everytime.
  9. For this issue already solve by transfer all files from my custom grf into en.grf don't know why my custom grf file can't be read for this client.
  10. that's guild storeage npc, are you using renewal mode?
  11. Last week
  12. Sorry that I took so long to answer. I've been trying to make WARP work on Windows 7, but I couldn't, so I resorted to using a modified version of Windows 10 without all the bloatware (called Tiny10 if anyone needs it in the future), and it worked
  13. bro did i missed somethin? i also rebuild the sln. where is that NPC located? i just saw the floating icon.
  14. Thank you very much for your beautiful explanation. Now I understand why even if I load in clif_parse_LoadEndAck, it still doesn't work properly. It's because of that. I understand it much better now thanks to your explanation. Thank you so much. The code you provided is a big help to me. I will just use it and add a confirmation so that the storage with ID: 2 will automatically open via a script for checking in order to initialize it.
  15. The main storage (ID 0) is the only one that's always loaded. Extra storages (IDs 1, 2, 3...) are only loaded when requested, and only one can be loaded at a time. When the code requests storage ID 2, it doesn't load fast enough, so the lines that add the item and close the storage are executed too early. That's why the storage remains open the first time. The same thing happens when the player opens another extra storage, since storage ID 2 gets switched to a different one.
  16. that means u didnt use the grf function at nemo. u need to insert the function name generated.
  17. Now can't hex any more hahahaha Share it for free, but some people sell it. Really bad. Now the file is encrypted. Lol.
  18. @Skylove Whoa, you even dropped the May version nice! Man, seriously appreciate all the work you’re putting in. Noticed the client’s a lot smaller this time any reason for that?
  19. This happened when opening the Client that was encrypted.
  20. Hello, it works, but there are some issues I can't figure out. Here's what's happening: On your first login, if you use AutoStore and pick up loot, Storage ID: 2 opens once but doesn't close. However, the item you picked up goes into your main storage instead of Storage ID: 2. After that, any new loot you pick up correctly goes into Storage ID: 2. But if you relog, the same issue happens again. However, if you open Storage ID: 2 first after relogging, everything works fine. So overall, the system works it’s just that the first opening of the storage causes the issue.
  21. Hello Everyone, I have created an instance with the setting NoNPC: true. This prevents copying NPCs from the source map. How can I enable my custom NPC inside the instance? Even though I have set NoNPC, the script I am using (see below) is not enabling the NPC inside the instance. // Instance Controller NPC (Triggers OnInstanceInit) moc_fild17,37,289,0 script InstanceSpawner#DD 1001,{ end; OnInstanceInit: // Broadcast to the instance map mapannounce instance_mapname("moc_fild17"), "[System]: The monsters have arrived!", bc_map; // Spawn mobs in the instance monster instance_mapname("moc_fild17"), 50, 50, "Phreeoni Minion", 1002, 10; monster instance_mapname("moc_fild17"), 53, 53, "Phreeoni", 1159, 1; // Enable the instance NPC enablenpc instance_npcname("PhreeoniHelper#DD"); end; } // Instance-Only NPC (initially hidden) moc_fild17,42,292,0 script PhreeoniHelper#DD 100,{ mes "Hello!"; mes "Welcome to the Phreeoni Instance."; close; OnInit: // Hide globally — needed due to NoNpc: true hideonnpc strnpcinfo(0); end; } Thank you!!
  22. The NPC shouldn't have a location. Find: prontera,155,177,5 script MVP_vs_MVP 100,{ And replace: - script MVP_vs_MVP 100,{
  23. Hello, change storage to premiumStorage. You can try my changes. I can't test it with just the code provided. // @autostore [Cydh] if (autostoring && sd->state.autostore && !item->expire_time && !id->flag.autoequip && !sd->state.storage_flag && !sd->npc_id) { if ((!sd->autostore_weight || (sd->autostore_weight && get_percentage(sd->weight, sd->max_weight) >= sd->autostore_weight)) && ( (sd->autostore_type&1 && (id->type == IT_HEALING || id->type == IT_USABLE || id->type == IT_DELAYCONSUME || id->type == IT_CASH)) || (sd->autostore_type&2 && (id->type == IT_ARMOR || id->type == IT_WEAPON || id->type == IT_SHADOWGEAR || id->type == IT_PETEGG || id->type == IT_PETARMOR)) || (sd->autostore_type&4 && (id->type == IT_ETC || id->type == IT_AMMO || id->type == IT_UNKNOWN || id->type == IT_UNKNOWN2)) || (sd->autostore_type&8 && id->type == IT_CARD) ) ) { char output[CHAT_SIZE_MAX]; sd->weight += w; clif_updatestatus(*sd, SP_WEIGHT); int32 stor_id = 2; //Storage ID to autostore if (stor_id) storage_premiumStorage_load(sd, stor_id, STOR_MODE_PUT); if (sd->state.storage_flag == 3) { storage_storageadd(sd, &sd->premiumStorage, i, amount); storage_premiumStorage_close(sd); } else { storage_storageadd(sd, &sd->storage, i, amount); storage_storageclose(sd); clif_storageclose(*sd); } sprintf(output, "[ Autostore ] %dx %s", amount, id->ename.c_str()); clif_messagecolor(&sd->bl, color_table[COLOR_LIGHT_GREEN], output, false, SELF); achievement_update_objective(sd, AG_GET_ITEM, 1, id->value_sell); return ADDITEM_SUCCESS; } }
  24. Hi @jasonch35, im interested. i already dm you here and in discord. kindly check my message thank you
  1. Load more activity
×
×
  • Create New...