Jump to content

Takuyakii

Members
  • Posts

    129
  • Joined

  • Last visited

Profile Information

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Takuyakii's Achievements

  1. Good day rA, can some one translate this into compatibility of rathena? 1. i want this to be a normal npc daily quest npc. 2. 24 hours cool down Thank you! Here's the code from herc //===== Hercules Script ==================================================================== // Automatic Trivia Event //===== Originally initiated By: =========================================================== // Capuche http://rathena.org/board/user/5984-capuche/ //===== Changed By: ======================================================================== // Habilis //===== Current Version: =================================================================== // 1.5 //===== Compatible With: =================================================================== // Hercules //===== Description: ======================================================================= //- Enhanced version of facts auto event. The Event is announced. The NPC asks 10 random //- questions from a question bank. Players have to write the answer to the main chat. //- Players don't need to worry about CAPITAL letters. //- 1) Question is asked by the NPC. //- 2) If there is no answer after 15 seconds NPC will give a hint. //- 3) IF there is still no answer after a hint, the question is skipped. //- 4) If the right answer is given, player is announced and reward is given //========================================================================================== //=====From eAthena to rAthena to Hercules================================================== //==========Without this original author, this script will never exist====================== //========Original author Credits=========================================================== //=====================================================DONT================================= // ToastOfDoom ================================================REMOVE======================= // RxChris =========================================================THIS================ // Hellflaem ================================================================CREDIT======= //========================================================================================== //========================================================================================== - script Trivia_Auto_Event FAKE_NPC ,{ OnMinute18: //OnEventStart: // Make the NPC appear so that players can begin to gather around // and perhaps read the rules enablenpc "Trivia#main"; [email protected] = 3; // How many times announce event with minute intervals while( [email protected] > 0 ) { announce "The Trivia Event will begin south of Prontera in " + [email protected] + " minute(s).",bc_all | bc_blue; [email protected]; sleep 60000; } announce "The Trivia Event has begun!",bc_all | bc_blue; donpcevent "Trivia#main::OnEventBegin"; end; OnStop: OnEventTimeOut: disablenpc "Trivia#main"; end; OnInit: disablenpc "Trivia#main"; end; } prt_fild08,137,365,6 script Trivia#main 4_F_JOB_ASSASSIN,{ OnTalk: mes "[^0055FF ::: Trivia ::: ^000000]"; mes " "; mes "Very simple event!"; mes " "; mes "I will be asking random questions."; mes " "; mes "All you have to do is shout the answer in the main chat!"; mes " "; mes "Do not worry about the capital letters, I can recognize the right answer, when I see one ;)"; mes "Worry about the spelling though."; close2; end; function DefineQuestion; function GetQuestion; function GetAnswer; function GetHint; OnEventBegin: L_loop: do { [email protected] = rand(.numQuestions); // Randomly picks a fact. } while(.already_asked[[email protected]]); .already_asked[[email protected]] = true; if( !.count ) { npctalk "Please answer all my questions:"; sleep 2000; npctalk "If your answer is correct, you will obtain prizes!"; } .count++; sleep 4000; npctalk "[" + .count + "/" + .max_questions + "] " + GetQuestion([email protected]); defpattern 1, "([^:]+):.*\\s" + GetAnswer( [email protected] ) + "(.*)", "Right"; .Ans$ = GetAnswer( [email protected] ); .Hint$ = GetHint( [email protected] );; activatepset 1; initnpctimer; end; OnTimer15000: npctalk "[Hint] : " + .Hint$; end; OnTimer30000: npctalk "Sorry, You took too long to answer."; callsub L_continue; end; Right: npctalk "Correct, " + strcharinfo(0) + "! The answer is " + .Ans$ + "."; // Winner gets reward in Zeny //Zeny += 1000000; // Alotta bax ;) // Winner gets reward in Item //getitem 607, rand( 1,10 ); // Randomly picks from 1 to 10 607 --Ygg berry~ . // Winner gets reward in Points [email protected] = rand(.minPoints,.maxPoints); #LROEVENTPOINTS = #LROEVENTPOINTS + [email protected]; dispbottom .ServerName$ + " : You won " + [email protected] + " event points."; L_continue: deletepset 1; stopnpctimer; if( .count < .max_questions ) { callsub L_loop; // loop 10 questions } .count = 0; // end of event .Q_session = 0; npctalk "That's all for now. Thanks for participating in this event ^^"; deletearray .already_asked, getarraysize(.already_asked); emotion e_thx; sleep 2000; disablenpc "Trivia#main"; end; function DefineQuestion { [email protected] = .numQuestions % 128; [email protected] = .numQuestions / 128; setd(".question_" + [email protected] + "$[" + [email protected] + "]", getarg(0)); setd(".answer_" + [email protected] + "$[" + [email protected] + "]", getarg(1)); setd(".hint_" + [email protected] + "$[" + [email protected] + "]", getarg(2)); .numQuestions = .numQuestions + 1; return; } function GetQuestion { return getd(".question_" + (getarg(0) % 128) + "$[" + (getarg(0) / 128) + "]"); } function GetAnswer { return getd(".answer_" + (getarg(0) % 128) + "$[" + (getarg(0) / 128) + "]"); } function GetHint { return getd(".hint_" + (getarg(0) % 128) + "$[" + (getarg(0) / 128) + "]"); } OnInit: .ServerName$ = "[Your boring server]"; .minPoints = 10; .maxPoints = 25; .max_questions = 10; // 10 questions if more than 10 questions are defined DefineQuestion("When you create a character in this game, how many primary stats are there?","6", "STR, AGI, VIT, INT, DEX, LUK"); DefineQuestion("Wizard skill Water Ball can only be cast over deluge or ____?", "water", "It is liquid."); DefineQuestion("Which item is required to create a guild?", "emperium", "An Emperial item"); DefineQuestion("which skill is beneficial to the living and damaging to the undead?", "heal", "It restores health."); DefineQuestion("In which town Thieves guild is located?", "morocc", "A town in the sorgat desert."); DefineQuestion("In which town Merchants guild is located?", "alberta", "It's a portuary town."); DefineQuestion("In which town Archers guild is located?", "payon", ""); DefineQuestion("What property do Izlude dungeon monsters possess?", "water", "It is liquid."); DefineQuestion("What status can be inflicted with the Hammer Fall skill?", "stun", "Did I see the stars around your head?"); DefineQuestion("How much Zeny one Jellopy is worth?", "3", "Just get it from a Poring."); DefineQuestion("Which town has the most Dancers?", "comodo", "An island in the warm waters."); DefineQuestion("How many different poring-like monsters you can meet near prontera, including mini bosses?", "9", "poring, drops, poporing, marin, santa poring, mastering, angeling, arcangeling, ghostring"); DefineQuestion("What property counters best the water property?", "wind", "It's Blowing"); DefineQuestion("What property counters best the undead property?", "holy", "Perhaps an acolyte or a priest can tell you?"); DefineQuestion("What kind of food both Vanilmirth and Christmas Goblin like?", "scel", "Yellow jeloppy"); DefineQuestion("How many cities are in Rune-Midgrad kingdom?", "11", "Prontera, Izlude, Jawaii, Geffen, Payon, Morocc, Alberta, Comodo, Umbala, Al De Baran, Lutie"); DefineQuestion("What city is the capital of Rune-Midgrad kingdom?", "prontera", "The most central town of all."); DefineQuestion("Which food is able to fully restore health and mana? _________ _____", "yggdrasil berry", "A berry growing on the most majestic tree!"); DefineQuestion("Which one of those is the fastest weapon type? Sword, Dagger, Staff, Mace", "dagger", "Something that has to do with the length of the blade."); DefineQuestion("Which one of those id the cheapest? Jellopy Large Jellopy Royal Jelly Honey", "jellopy", "Dropped by Porings."); DefineQuestion("Which monster drops a pet taming item to tame Deviruchi?", "joker", "Why so serious?"); if( .numQuestions < .max_questions ) .max_questions = .numQuestions; end; }
  2. Can someone re convert this into new or any compatibility because this is so old files. Please help me Thank you <?php if (!defined('FLUX_ROOT')) exit; $title = Flux::message('ServerStatusTitle'); $cache = FLUX_DATA_DIR.'/tmp/ServerStatus.cache'; if (file_exists($cache) && (time() - filemtime($cache)) < (Flux::config('ServerStatusCache') * 600)) { $serverStatus = unserialize(file_get_contents($cache)); } else { $serverStatus = array(); foreach (Flux::$loginAthenaGroupRegistry as $groupName => $loginAthenaGroup) { if (!array_key_exists($groupName, $serverStatus)) { $serverStatus[$groupName] = array(); } $loginServerUp = $loginAthenaGroup->loginServer->isUp(); foreach ($loginAthenaGroup->athenaServers as $athenaServer) { $serverName = $athenaServer->serverName; $sql = "SELECT COUNT(char_id) AS players_online FROM {$athenaServer->charMapDatabase}.char WHERE online > 0"; $sth = $loginAthenaGroup->connection->getStatement($sql); $sth->execute(); $res = $sth->fetch(); $serverStatus[$groupName][$serverName] = array( 'loginServerUp' => $loginServerUp, 'charServerUp' => $athenaServer->charServer->isUp(), 'mapServerUp' => $athenaServer->mapServer->isUp(), 'playersOnline' => intval($res ? $res->players_online : 0) ); } } $fp = fopen($cache, 'w'); if (is_resource($fp)) { fwrite($fp, serialize($serverStatus)); fclose($fp); } } $online = "<img src='".$this->themePath('img/online.png')."' alt=\"Online\"/>"; $offline = "<img src='".$this->themePath('img/offline.png')."' alt=\"Offline\"/>"; ?> <?php foreach ($serverStatus as $privServerName => $gameServers): ?> <?php foreach ($gameServers as $serverName => $gameServer): ?> <div style="width:100%; height:100%; margin:0 auto;"> <div class="online_count"> <table width="100%" border="0"> <tr> <td align="center"> <p style="font-size:35px; margin-top:0px; font-weight:normal; font-family:'Visitor TT2 BRK'" align="center"> <?php echo $gameServer['playersOnline'] ?> </p> </td> </tr> </table> </div> <div class="online_peak"> <table width="100%" border="0"> <tr> <td align="center"> <font style="font-size:12px; font-weight:normal; font-family:'Visitor TT2 BRK'; color:#00CCFF;"><?php include('highest_peak.php'); ?></font> </td> </tr> </table> </div> <div class="server_time"> <table width="100%" border="0"> <tr> <td align="center"> <font style="font-size:12px; font-weight:normal; font-family:'Visitor TT2 BRK'; color:#CCC;"><?php include('status_time.php'); ?></font> </td> </tr> </table> </div> <div style="position:absolute; margin-left:285px; height:40px; width:200px; border:none;"> <div class="char"><?php if ( $charserver[0] == $online ) { echo $online; } else { echo $offline; } ?></div> <div class="map"><?php if ( $mapserver[0] == $online ) { echo $online; } else { echo $offline; } ?></div> <div class="login"><?php if ( $loginserver[0] == $online ) { echo $online; } else { echo $offline; } ?></div> </div> </div> <?php endforeach ?> <?php endforeach ?>
  3. Solved. please close this threads thank you.
  4. Good day rA, can someone help me to fix this error about query? i already googled some and fix the other error but this error, i can't fix it MYSQLI_FETCH_ARRAY() EXPECT PARAMETER 1 to be MYSQLI_Result object given below is my code <?php if (!defined('FLUX_ROOT')) exit; ?> <?php //SQL Connection function Connection() { $db_host="127.0.0.1"; //insert the IP Address of your website $db_name="rathena"; //insert your database name insid the 2 double quotesS $username="zxc"; //insert the username of your phpmyadmin (SQL username) $password="zxc"; //insert the password of your phpmyadmin (SQL password) $conn = mysqli_connect($db_host,$username,$password); if (!$conn) { echo "Connection failed!"; return false; } mysqli_select_db($conn, $db_name); return $conn; } $conn = Connection(); if ($conn) { $hpsql = mysqli_query($conn, "SELECT * FROM cp_onlinepeak ORDER BY users DESC LIMIT 1"); $hprow = mysqli_fetch_array($conn,$hpsql); echo $hprow['users']; }
  5. can someone help me to show how this work? how to compile this item.
  6. can someone help me with this? thanks!
  7. mind to share your script so we can check?
  8. if(Zeny>Your max zeny{ mes "too much zeny"; } i guess
  9. Can someone help me to make this script have Jackpot prize? or chance to get the rare item? Thank you. - script Wheel_of_Fortune FAKE_NPC ,{ OnInit: disablenpc("Wheel of Fortune#Main"); .EventName$ = "[Wheel Of Fortune]"; end; OnClock0900: OnClock1600: OnClock2200: OnStart: .Start = true; announce(sprintf("%s : The event will begin in 1 minute, near the center of Prontera.", .EventName$), bc_blue | bc_all); initnpctimer(); end; OnTimer60000: // 1 min enablenpc("Wheel of Fortune#Main"); announce(sprintf("%s : Come to Prontera and test your luck", .EventName$), bc_yellow | bc_all); end; OnTimer60500: // 1 mins announce(sprintf("%s : One minute, do your last spin!", .EventName$), bc_yellow | bc_all); end; OnTimer120000: // 2 mins OnStop: .Start = false; stopnpctimer(); disablenpc("Wheel of Fortune#Main"); end; OnCommand: if ([email protected]_numparameters != 1) { dispbottom(sprintf("Usage: %s <start/end>", [email protected]_command$), 0x00FF00); dispbottom(sprintf("%s failed.", [email protected]_command$), 0x00FF00); end; } if ([email protected]_parameters$[0] == "start") { if (!.Start) donpcevent(sprintf("%s::OnStart", strnpcinfo(NPC_NAME))); else { dispbottom("The Wheel of Fortune has already started.", 0x00FF00); dispbottom(sprintf("%s failed.", [email protected]_command$), 0x00FF00); } } else if ([email protected]_parameters$[0] == "end") { if (.Start) donpcevent(sprintf("%s::OnEnd", strnpcinfo(NPC_NAME))); else { dispbottom("The Wheel of Fortune is not active.", 0x00FF00); dispbottom(sprintf("%s failed.", [email protected]_command$), 0x00FF00); } } else { dispbottom(sprintf("Usage: %s <start/end>", [email protected]_command$), 0x00FF00); dispbottom(sprintf("%s failed.", [email protected]_command$), 0x00FF00); } end; } prontera,164,169,1 script Wheel of Fortune#Main 2_SLOT_MACHINE,{ OnTalk: if (Zeny < .Zeny_Cost && #freewheelfortunespin < 0) { mes("[^0055FFLucky Spin^000000]", .EventName$); mes("You are out of Zeny"); mes("and have no more"); mes("free spins. Come back"); mes("next time for more!"); close(); } [email protected]$ = (#freewheelfortunespin > 0) ? sprintf(", but you, my friend, have %d free spin%s!", #freewheelfortunespin, (#freewheelfortunespin == 1) ? "" : "s") : "."; addtimer(1, sprintf("%s::OnEnd", strnpcinfo(NPC_NAME))); mes("[^0055FFLucky Spin^000000]", .EventName$); mes("Do you want to spin the wheel?"); mes("It costs ^FF000050.000 Zeny^000000 to play", [email protected]$); next(); while (true) { if (Zeny < .Zeny_Cost && #freewheelfortunespin < 0) callsub(S_End); switch (select( (#freewheelfortunespin > 0) ? sprintf("Yes! Use free spin! (%d left)", #freewheelfortunespin) : "", (Zeny >= .Zeny_Cost ) ? sprintf("Yes! Use Zeny. (costs %dz)", .Zeny_Cost) : "", "No (Leave)" )) { // pay with free spin case 1: if (#freewheelfortunespin > 0) { if ((#freewheelfortunespin -= 1) < 0) #freewheelfortunespin = 0; callsub(S_Spin); } else callsub(S_End); break; // Pay with zeny case 2: if (Zeny >= .Zeny_Cost) { Zeny -= .Zeny_Cost; callsub(S_Spin); } else { cutin("aca_salim02", 2); mes("[^0055FFLucky Spin^000000]", .EventName$); mes("Awww, you don't have enough to gamble..."); mes(" "); mes("Have you ever heard?"); mes("'Money isn't all that matters' Got it?"); mes("Byeeeeeeeeeeeeee ;)"); callsub(S_End); } break; default: break; } callsub(S_End); } // Wheel spin animation S_Spin: [email protected] = rand(.Sector_Range[0], .Sector_Range[1]); [email protected] = [email protected] * 2 - 1; [email protected] = .Spin_Speed; for ([email protected] = 0; [email protected] < .nbTurns; [email protected]++) { [email protected] = .Cutin_Range[0]; while ([email protected] <= .Cutin_Range[1]) { cutin(sprintf("%s%d", .Cutin$, [email protected]), 4); sleep2([email protected]); [email protected]++; [email protected] += 1; // not ++, because you may want to adjust the stopping +1 +2 +3 } } [email protected] = .Cutin_Range[0]; while ([email protected] < [email protected]) { cutin(sprintf("%s%d", .Cutin$, [email protected]), 4); sleep2([email protected]); [email protected]++; } cutin(sprintf("%s%d", .Cutin$, [email protected]), 4); if (.Prize_ID[[email protected]] == -1) { // Free spin if (.Sound_Effects) soundeffect("wheel_jackpot.wav", 0); announce(sprintf("[%s] : Wow, %dx more Free spins!!!", .EventName$, .Prize_Qty[[email protected]]), bc_blue | bc_self); #freewheelfortunespin = #freewheelfortunespin == 0 ? .Prize_Qty[[email protected]] : #freewheelfortunespin + .Prize_Qty[[email protected]]; } else if (.Prize_ID[[email protected]] == 0) { // Nothing if (.Sound_Effects) soundeffect("wheel_lost.wav", 0); announce(sprintf("[%s] : Awwww, no luck in your gamble, more luck in love...", .EventName$), bc_blue | bc_self); } else { // Item if (.Sound_Effects) soundeffect("wheel_won.wav", 0); announce(sprintf("[%s] : %dx %s - enjoy your prize!", .EventName$, .Prize_Qty[[email protected]], getitemname(.Prize_ID[[email protected]])), bc_blue | bc_self); getitem(.Prize_ID[[email protected]], .Prize_Qty[[email protected]]); } sleep2(1000); if (Zeny < .Zeny_Cost && #freewheelfortunespin < 0) { mes("[^0055FFLucky Spin^000000]", .EventName$); mes("You are out of Zeny"); mes("and have no more"); mes("free spins. Come back"); mes("next time for more!"); close(); } return; S_End: close2(); OnEnd: cutin("", 255); end; OnInit: .EventName$ = "Wheel Of Fortune"; bindatcmd("wheel_of_fortune", "Wheel_of_Fortune::OnCommand", 98,false); .Spin_Speed = 50; // What is the base spin speed? (ms) .nbTurns = 2; // How many times the arrow makes a complete turn, before entering the stopping routine .Zeny_Cost = 50000; // How much zeny does it cost for a spin? .Sound_Effects = true; // Enable sound effects? (true/false) // You must have a total of 10 prizes. DO NOT remove 0 or -1 from the array and do not // change their order. setarray(.Prize_ID[1], -1, 7539, 14345, 7539, 617, 607, 7539, 604, 0, 12214); setarray(.Prize_Qty[1], 2, 3, 1, 1, 3, 3, 1, 3, 0, 1); // Don't touch below .Cutin$ = "WheelOfFortune_"; setarray(.Sector_Range, 1, 10); // Sector range setarray(.Cutin_Range, 0, 19); // Cutin range end; }
  10. what are you using? pre-re or RE? also check your map_cache.dat if that file exist.
  11. use WeemapCache and open your map_cache.dat, after that click FILE on weemapcache then select your izlude.gat, then save, after saving put your map_cache.dat to your trunk, then restart your server PS. DOn't forget to put the izlude file also in your grf.
  12. instead of @changesex use @changecharsex command, to fix this error go to your database and change the Gender of that character manually.
×
×
  • Create New...

Important Information

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