Jump to content

Capuche

Developer
  • Posts

    2,407
  • Joined

  • Last visited

  • Days Won

    49

Everything posted by Capuche

  1. md->bl.id to retrieve the game id of the killed monster.
  2. Use constant name instead if int for getequipcardid https://rathena.org/board/topic/105842-eqi-constant-refactor/ getequipcardid(5... -> getequipcardid(EQI_GARMENT...
  3. It's a core issue, readparam read [email protected] like const [email protected] = 13; dispbottom bStr;// is 13 dispbottom readparam([email protected]);// return 13 dispbottom readparam(13);// return str value
  4. Your character is warped on the 'main' map [email protected], not in the instance map. [email protected],54,28,0 script #gp3warp WARPNPC,1,1,{ if ( instance_id() < 0 ) end; if( !'gp5 && instance_mapname("[email protected]") != "" ) warp instance_mapname("[email protected]"),218,186; else { if (checkquest(40024) == -1) setquest 40024; warp "dali",49,127; } end; }
  5. Capuche

    Npc Talk

    https://rathena.org/wiki/Timers_(Scripting)#Use_Number_3:_Deny_Usage
  6. It could be optimized but the query seems correct. However the correct value of the variable for players online may differ from the sql variable value. You need to check the variable value for players offline differently from players online.
  7. prontera,160,160,4 script mob 857,{ mes [email protected]$;// unset (see oninit) mes "Hello "+ strcharinfo(0)+"."; mes "I can give Poring Coin"; mes "in return you have to kill all the monsters that tell you"; next; [email protected] = query_sql( "SELECT `ID`,`iName` FROM `mob_db` ORDER BY RAND(ID) LIMIT 500",[email protected],[email protected]$ );// it should be rand() for( [email protected] = 0; [email protected] < [email protected]; [email protected]++ ){// unused the loop stop after the close copyarray [email protected][0],[email protected][[email protected]],500;// you can take 1 random monster with sql (rand() limit 1) copyarray [email protected]$[0],[email protected]$,500; setarray [email protected][0],100,200,300; set [email protected],rand(0,500); set [email protected],rand(0,2); mes [email protected]$; mes "Today you need kill :"[email protected]$[[email protected]]+" x "[email protected][[email protected]]; close; } //-----------------------------------------------------------------------// //OnNPCKIllEvent Label //-----------------------------------------------------------------------// OnNPCKillEvent: if(killedrid == [email protected][[email protected]]){ mes "You have kill "[email protected]$[[email protected]]; close; } end; //-----------------------------------------------------------------------// //OnInit Label //-----------------------------------------------------------------------// OnInit: waitingroom "Kill Mob for Coin",0; set [email protected]$,"[Mob Kills]";// everytime the script end the [email protected] are cleared } I didn't test : prontera,160,160,4 script mob 857,{ [email protected]$ = "[Mob Kills]"; mes [email protected]$; mes "Hello "+ strcharinfo(0) +"."; mes "I can give Poring Coin"; mes "in return you have to kill all the monsters that tell you."; next; if (date_event != gettime(8)) { mob_count_event = 0; // clear the previous count kill date_event = gettime(8); // save the date rankill_event = rand(1,3) *100; // save the number to kill query_sql( "select `ID` from mob_db where `EXP` > 0 and (`Drop1id` > 0 or `Drop2id` > 0 or `Drop3id` > 0 or `Drop4id` > 0 or `Drop5id` > 0 or `Drop6id` > 0 or `Drop7id` > 0 or `Drop8id` > 0 or "+ "`Drop9id` > 0 or DropCardid > 0 ) ORDER BY RAND() LIMIT 1", mob_id_event );// not an event mob mes [email protected]$; mes "Today you need kill: "+ getmonsterinfo( mob_id_event,MOB_NAME ) +" x"+ rankill_event; } else if (mob_count_event < rankill_event) mes "You have killed "+ mob_count_event +"/"+ rankill_event +" "+ getmonsterinfo( mob_id_event,MOB_NAME ); else { mes "Congrat you killed all the monsters."; getitem 501,1; } close; OnNPCKillEvent: if (killedrid == mob_id_event && mob_count_event < rankill_event) { mob_count_event++; message strcharinfo(0), "You have killed "+ mob_count_event +"/"+ rankill_event +" "+ getmonsterinfo( mob_id_event,MOB_NAME ); } end; OnInit: waitingroom "Kill Mob for Coin",0; end; }
  8. Here is what you write Here is what the doc say
  9. http://www.petefreitag.com/item/466.cfm
  10. Something like if ([email protected]$ == "pvp_n_1-3" && .enabled == 0) { enablenpc "PoringWarp1"; .enabled = 1; sleep 120000; .enabled = 0; disablenpc "PoringWarp1"; end; }
  11. pvp_n_1-3,83,116,5 script PoringSpawner1 139,{ end; OnNPCKillEvent: if (killedrid == 1296) { /* - if player kill several monsters in few seconds, spam of enable/disable Set a variable when timer start then clear when end */ getmapxy([email protected]$,[email protected],[email protected],0); if ([email protected]$ == "pvp_n_1-3") { enablenpc "PoringWarp1"; sleep 120000; disablenpc "PoringWarp1"; end; } } // <- add end to stop the script here otherwise if players kill another monster than 1296 or 1296 on another map than pvp_n_1-3, the warp is disabled //Disable the warp when the server starts. OnInit: disablenpc "PoringWarp1"; end; } //My Example //Warp NPC pvp_n_1-3,100,140,0 warp PoringWarp1 1,1,aldebaran,143,57
  12. Ha ok btw you did the same event under the others label, what about group them ? - script TreasureBoxSummonerCoin -1,{ OnClock1500: OnClock1600: OnClock2400: set [email protected], rand(1,9);// use [email protected] (temporary variable only attached to this npc) instead of [email protected] /* - what about an array ? setarray [email protected]$[1], "hugel", "yuno", "comodo", "aldebaran", "izlude", "payon", "geffen", "morocc", "prontera"; - Then save you map name into a .variable$ (npc variable) .map_name$ = [email protected]$[[email protected]]; */ if ([email protected] == 9) set [email protected]$,"hugel"; if ([email protected] == 8) set [email protected]$,"yuno"; if ([email protected] == 7) set [email protected]$,"comodo"; if ([email protected] == 6) set [email protected]$,"aldebaran"; if ([email protected] == 5) set [email protected]$,"izlude"; if ([email protected] == 4) set [email protected]$,"payon"; if ([email protected] == 3) set [email protected]$,"geffen"; if ([email protected] == 2) set [email protected]$,"morocc"; if ([email protected] == 1) set [email protected]$,"prontera"; announce "A rare Treasure Box will be spawned in "+ [email protected]$ +".",bc_all|bc_npc; monster [email protected]$,0,0,"Treasure Box Coin",1845,5,"TreasureBoxSummonerCoin::OnCoinBoxKilled"; initnpctimer; end; OnTimer1800000: //30min announce "All treasure in "+ [email protected]$ +" are destroyed",bc_all|bc_npc; killmonster [email protected]$,"TreasureBoxSummonerCoin::OnCoinBoxKilled";// TreasureBoxSummonerCoin unknown NPC stopnpctimer; end; OnCoinBoxKilled: announce "The rare Treasure Box has been found and destroyed by "+strcharinfo(0)+"!", bc_all; getitem 7539,1; // Change your prize here 7539 Poring Coin end; } and yes moik is right (I got screwed by the "A rare"), there is 5 box. You should stop the timer if someone kill all the box to avoid to display the message after 30mins (just make a count like moik suggested but with npc var)
  13. You have an error when you load this NPC ? dup label means you used a same label name in the npc (like OnTimer1000: twice or OnCoinBoxKilled: twice). Please post a ss of the error displayed by mapserv And : OnCoinBoxKilled: announce "The rare Treasure Box has been found and destroyed by "+strcharinfo(0)+"!", bc_all; getitem 7539,1; // Change your prize here 7539 Poring Coin stopnpctimer;// <-- add this end;
  14. - script Trasure Coin -1,{ OnClock0300: OnClock1600: OnClock2400: announce "A rare Treasure Box will be spawned in Prontera",0; /* - you miss a comma after ,0,0 - TreasureBoxSummonerCoin unknown NPC */ monster "prontera",0,0"Treasure Box Coin",1845,5,"TreasureBoxSummonerCoin::OnCoinBoxKilled"; startnpctimer;// better to use initnpctimer; end; OnTimer1000: announce "All treasure in Prontera are destroyed",0; killmonster "prontera","TreasureBoxSummonerCoin::OnCoinBoxKilled";// TreasureBoxSummonerCoin unknown NPC setnpctimer,0;// Typo error ; It's better to use stopnpctimer; end; OnCoinBoxKilled: announce "The rare Treasure Box has been found and destroyed by "+strcharinfo(0)+"!", bc_all; getitem 7539,1; // Change your prize here 7539 Poring Coin end; }
  15. Check if your emu is younger than 31 Aug 2015 (so you got this update). Before the commit 6295c77 the maximum array size for npc script was 128 that's why Euphy used the condition to check if you can add more session. if (.Size > 127) { (.Size is the size of $WOE_CONTROL used to store the session data) For one session he saved 4 values within the same array. setarray $WOE_CONTROL[[email protected]], [email protected], [email protected], [email protected], [email protected]; So for 32 sessions -> 128 values in the array (maximum size). After the commit 6295c77 the max array size become 2147483647 ; you can now save ( 2,147,483,647 / 4 ) = 536,870,911 sessions.
  16. If you're using a version older younger than 6295c77 you can remove the limit of the session.
  17. Bindatcmd use the equivalent of gm level in parameter, not the group *bindatcmd "<command>","<NPC object name>::<event label>"{,<atcommand level>,<charcommand level>}; Check the gm level of your GM group and maybe raise it
  18. A addtimer should do it OnPCLoginEvent: addtimer 3600000, strnpcinfo(3)+"::OnEvent"; end; OnEvent: // your script
  19. You got this warning because addrid and the dialog box. Not sure what you want to do, this ? izlude,0,0,0 script NPC -1,{ // OnClock1645: OnInit: for ( [email protected] = 5; [email protected] > 0; [email protected] ) { mapannounce "izlude", [email protected] +"!.",0; sleep 1000; } donpcevent strnpcinfo(0) +"::OnEvent"; for ( [email protected] = 5; [email protected] > 0; [email protected] ) { mapannounce "izlude", "Message 2: "+ [email protected] +"!.",0; sleep 1000; } end; OnEvent: addrid(1); mes " FIRST RESULT "; sleep2 5000;// wait until the end of message 2 mes " SECOND RESULT "; close; }
  20. Sorry. Where ? It's the variables of the player attached to the script ?
×
×
  • Create New...

Important Information

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