Jump to content

Terces

Members
  • Posts

    91
  • Joined

  • Last visited

  • Days Won

    1

Terces last won the day on June 12 2020

Terces had the most liked content!

5 Followers

Profile Information

  • Gender
    Male
  • Location
    Germany

Recent Profile Visitors

3334 profile views

Terces's Achievements

Poring

Poring (1/15)

25

Reputation

1

Community Answers

  1. yes, you'll need to add the column 'char_name'
  2. Ah yes...change mes (.@i+1) +". "+ .@cname[.@i]) +" ~ "+ .@count[.@i] +" breaks."; to mes (.@i+1) +". "+ .@cname[.@i] +" ~ "+ .@count[.@i] +" breaks."; There was a stray ")" in there. The SQL error is because you already had the script running once so there already is an "breaker_ladder" table. You will have to either delete the table or add the "char_name" field manually.
  3. The script uses a lot of 'sleep2', even though there is no player attached to the script. All the 'sleep2' in the 'OnReady' labe for example will fail, because calling a script event drops the attached player. That is also mentioned in the script command documentation: I replaced all except for the first one with 'sleep'. Try if that works now: turbo_room,106,105,5 script Emperium Breaker 1288,{ // What Map will be used set .Map$,"job3_arch01"; // How many Top Breaker will be Recorded set .TopRank,5; // Message to Inform Players while inside the Room setarray .Instruction$[0], "You need a guild to be able to hit the Emperium, create one with the Emperium i have you if you don't have any. Please read carefully.", "This room is to test how quick you can break an Emperium.", "So get prepared, the Emperium will spawn in a few seconds.", "When you enter there, you rill recieve Butterfly Wings so you can return when you finish, be prepared."; while( 1 ){ mes "Emperium Breaker Room to test how quick you destroy it."; mes "You can compare too the records of other players."; next; switch( select( ( getmapusers( .Map$ ) )?"^FF0000No available":"^0000FFAvailable^000000", "Top ^FF0000"+.TopRank+"^000000 Record", ( getgmlevel() < 90 )?"":"^FF0000[GM]^000000 Reset Room", ( getgmlevel() < 90 )?"":"^FF0000[GM]^000000 Reset Ladder" )){ Case 1: if( getmapusers( .Map$ ) ){ mes "There is another player, please wait until the player ends."; next; break; } warp .Map$,0,0; getitem 714,1; // Emperium if they don't have a guild they can easly create one and test on the Emperium Room killmonster .Map$,"All"; // removemapflag .Map$,mf_noskill; donpcevent strnpcinfo(0)+"::OnReady"; end; Case 2: mes "^ED1ADCBest Record^000000 : "+LatestRecord/1000+"."+LatestRecord%1000+" Seconds."; for( set .@i,0; .@i < .TopRank; set .@i,.@i + 1 ){ if( !$TopRankTime[.@i] ) break; mes "^FF0000Top "+( .@i + 1 )+" : ^0000FF"+$TopName$[.@i]+" "; mes "^FF0000Time : ^ED1ADC[ "+$TopRankTime[.@i]/1000+"."+$TopRankTime[.@i]%1000+" Sec. ]^000000 "; } next; break; Case 3: mapannounce .Map$,"El GM reinicio los record del Emperium Breaker.",0,0x00FF00; killmonster .Map$,"All"; sleep2 3000; mapwarp .Map$,"izlude",103,142; mes "Listo, los jugadores que estaban adentro son enviados a fuera."; next; break; Case 4: switch( select( "^0000FFAll Player^000000:^FF0000One Player^000000" ) ){ Case 1: deletearray $TopRankTime[0],getarraysize( $TopRankTime ); deletearray $TopName$[0],getarraysize( $TopName$ ); mes "RESETED WHOLE LADDER."; break; Case 2: mes "Please input the ^FF0000EXACT NAME^000000 of player you want to delete."; input .Name$; for( set .@i,0; .@i < .TopRank; set .@i,.@i + 1 ){ if( .Name$ == $TopName$[.@i] ){ deletearray $TopName$[.@i],1; deletearray $TopRankTime[.@i],1; mes "Removed ^FF0000"+.Name$+"^000000 from the List."; } } } next; break; } } OnReady: sleep 3000; for( set .@i,0; .@i < getarraysize( .Instruction$ ); set .@i,.@i + 1 ){ mapannounce .Map$,.Instruction$[.@i],0,0x00FF00; sleep 2500; } for( set .@i,5; .@i > 0; set .@i,.@i - 1 ){ mapannounce .Map$," : "+.@i+" seconds left.",0,0x00FF00; sleep 1000; } //mapannounce .Map$,"Hit the Emperium Now and Skills Disabled.",0,0x00FF00; setmapflag .Map$,mf_noskill; monster .Map$,29,27,"Breaker Test",1288,1,strnpcinfo(0)+"::OnBreaked"; set .Record,0; sleep 500; initnpctimer; end; OnTimer600000: if( !mobcount( .Map$,strnpcinfo(0)+"::OnBreaked" ) ) end; mapannounce .Map$,"You spent too much time. i think you are AFK , so you are out.",0,0xED1ADC; sleep 3000; mapwarp .Map$,"izlude",103,142; stopnpctimer; end; OnBreaked: set .Time,getnpctimer(0); copyarray .@tempName$[0],$TopName$[0],getarraysize( $TopName$ ); copyarray .@tempRecord[0],$TopRankTime[0],getarraysize( $TopRankTime[0] ); set LatestRecord,.Time; for( set .@i,0; .@i < .TopRank; set .@i,.@i + 1 ){ if( .Time < $TopRankTime[.@i] || !$TopRankTime[.@i] ){ set $TopRankTime[.@i],.Time; set $TopName$[.@i],strcharinfo(0); copyarray $TopRankTime[.@i + 1],.@tempRecord[0],getarraysize( .@tempRecord ); copyarray $TopName$[.@i + 1],.@tempName$[0],getarraysize( .@tempName$ ); announce "[ "+strcharinfo(0)+" ] Got the Ranking "+( .@i + 1 )+" on the Emperium Breaker Room with a record of "+.Time/1000+"."+.Time%1000+" seconds !!!",bc_all,0xED1ADC; break; } } stopnpctimer; announce "Time tooked : "+.Time/1000+"."+.Time%1000+" Seconds. ",bc_self,0xED1ADC; // removemapflag .Map$,mf_noskill; sleep 5000; mapwarp .Map$,"izlude",103,142; //here is the place of the npc end; } job3_arch01 mapflag nocommand 50 job3_arch01 mapflag gvg on job3_arch01 mapflag gvg_castle job3_arch01 mapflag monster_noteleport job3_arch01 mapflag nosave SavePoint
  4. My guess is that strcharinfo() only works on logged in players. One "could" leverage the power of SQL and use the char-id to find the actual player, but that is a bit more complicated. Instead I simply added a field to the table that contains the name. Instead of just saving the players ID, I also save the name. I haven't tested this, but maybe it will give you an idea how you could solve it: //===== rAthena Script ======================================= //= Emperium Breaker Ladder + Points + Shop //===== By: ================================================== //= Mabuhay //===== Description: ========================================= // title says it all // ============================================================ /* // For WoE First Edition // open npc/guild/agit_main.txt --------------------------------------------- Look for this part: --------------------------------------------- // The Emperium has been broken. OnAgitBreak: set .@GID,getcharid(2); // Show and log error if an unguilded player breaks the Emperium. (Should NEVER happen) if (.@GID <= 0) { set .@notice$,"Character "+strcharinfo(0)+" ("+getcharid(0)+") broke the Emperium in Castle: "+strnpcinfo(2)+" while guildless. No data will be saved and Emperium respawned."; logmes .@notice$; debugmes .@notice$; donpcevent "Agit#"+strnpcinfo(2)+"::OnStartArena"; end; } --------------------------------------------- Add these below.. --------------------------------------------- query_sql("INSERT INTO `breaker_ladder` SET `char_id` = '"+getcharid(0)+"', `char_name` = '"+strcharinfo(0)+"', `count` = '1' ON DUPLICATE KEY UPDATE `count` = `count`+1"); #EMPBREAKERPTS += $@empbreakpoints; // For WoE Second Edition // open npc/guild2/agit_main_se.txt --------------------------------------------- Look for this part: --------------------------------------------- OnStartArena: set .@GID,getcharid(2); set .@region$, (compare(strnpcinfo(4),"arug"))?"Valfreyja":"Nithafjoll"; // Lower castle Economy set .@Economy,getcastledata(strnpcinfo(4),CD_CURRENT_ECONOMY)-5; if (.@Economy < 0) set .@Economy, 0; setcastledata strnpcinfo(4),CD_CURRENT_ECONOMY,.@Economy; // Lower Castle Defence set .@Defence,getcastledata(strnpcinfo(4),CD_CURRENT_DEFENSE)-5; if (.@Defence < 0) set .@Defence, 0; setcastledata strnpcinfo(4),CD_CURRENT_DEFENSE,.@Defence; // Set new owner setcastledata strnpcinfo(4),CD_GUILD_ID,.@GID; // Clear castle's data. for(set .@i,CD_INVESTED_ECONOMY; .@i<CD_ENABLED_GUARDIAN00; set .@i,.@i+1) setcastledata strnpcinfo(4),.@i,0; // Disable Kafra disablenpc "Kafra Employee#"+strnpcinfo(2); --------------------------------------------- Add these below.. --------------------------------------------- query_sql("INSERT INTO `breaker_ladder` SET `char_id` = '"+getcharid(0)+"', `char_name` = '"+strcharinfo(0)+"', `count` = '1' ON DUPLICATE KEY UPDATE `count` = `count`+1"); #EMPBREAKERPTS += $@empbreakpoints; */ // ============================================================ prontera,158,176,6 script Emp Breaker Ladder 4_BOARD3,{ query_sql("SELECT `count` FROM `breaker_ladder` WHERE `char_id` = "+ getcharid(0), .@count); mes "You currently have ^ff0000"+.@count+"^000000 emp breaks."; mes "And "+#EMPBREAKERPTS+" Emp Break Points."; mes " "; mes "What would you like to do?"; next; switch(select("~ View Top 10 Emp Breakers","~ Open Emp Breaker Point Shop",(getgmlevel()> 60) ? "~ [GM MENU] Reset data":"")) { case 1: mes "Top 10 Emperium Breaker"; if(!(.@nb = query_sql("SELECT `char_id`, `char_name`, `count` FROM `breaker_ladder` ORDER BY `count` DESC LIMIT 10", .@cid, .@cname, .@count))) { mes "No data found."; close; } for ( .@i = 0; .@i < .@nb; .@i++ ) mes (.@i+1) +". "+ .@cname[.@i]) +" ~ "+ .@count[.@i] +" breaks."; close; case 2: callshop "EmpBreakerShop", 4; mes "You currenlty have ^ff0000"+((#EMPBREAKERPTS) ? #EMPBREAKERPTS:"no" )+" Emp Breaker Points^000000 to purchase from this shop."; end; case 3: mes "Are you sure you want to delete all Emp Breaker Ladder data?"; next; select("Yes"); message strcharinfo(0), "Deleting..."; progressbar "", 5; query_sql("TRUNCATE TABLE `breaker_ladder`"); mes "Deleting complete.."; close; } end; OnInit: // how much points gained per emp break? $@empbreakpoints = 1; query_sql("CREATE TABLE IF NOT EXISTS `breaker_ladder` (`char_id` int(11) unsigned NOT NULL, `char_name` varchar(255) NOT NULL DEFAULT 'unknown', `count` int(11) NOT NULL DEFAULT '0', PRIMARY KEY ( `char_id` )) ENGINE=InnoDB"); } // Emp Breaker Point Shop Data // Edit the points here.. "#EMPBREAKERPTS" currently set to '#EMPBREAKERPTS' // Also edit the items for sale here... - pointshop EmpBreakerShop FAKE_NPC,#EMPBREAKERPTS,901:2,903:1,904:5
  5. The changes I mentioned in my answer actually do just that. They set the delay from a '+rand(2,3)' to just '+1'.
  6. In this case it would make sense to think about some sort of progression method. What is the spawn-chance based on? Even in @Haruka Mayumi's solution you would have to explicitly define every mobs spawn chance. My solution isn't much better, as it simply uses the mob level to calculate a spawn chance. A better solution would be to create an array that contains mob level ranges and their spawn chances. Something like "all mobs with level 1-10 have a 100% spawn chance". Such a system will always work, even when new mobs get added, but sadly you lose some control over the actual spawn rate of specific mobs. You could also create a tiered system like "normal mobs use algorithm, mini-bosses always have 5% chance and bosses have 1% chance". - script TFRSummoner -1,{ end; OnNPCKillEvent: // only summon the mob if we actually get useful information if (getmonsterinfo(killedrid,MOB_LV)) { // calculate the chance of the monster spawning based on mob level // higher level = lower spawn chance if (rand(1,100) >= ((getmonsterinfo(killedrid,MOB_LV) / 160) * 100)) { atcommand "@summon "+killedrid+" 60"; } } end; }
  7. Change //add time delay penalty. You can get another quest after 2 - 3 hours. [Lupus] set #THQ_DELAY, (GetTime(DT_YEAR)*12*31*24+GetTime(DT_MONTH)*31*24+GetTime(DT_DAYOFMONTH)*24+GetTime(DT_HOUR)+rand(2,3)); to //add time delay penalty. You can get another quest after 2 - 3 hours. [Lupus] //changed it down to 1 hour across the board [Terces] set #THQ_DELAY, (GetTime(DT_YEAR)*12*31*24+GetTime(DT_MONTH)*31*24+GetTime(DT_DAYOFMONTH)*24+GetTime(DT_HOUR)+1); Getting a new Quest always adds a delay of 1 hour. Quitting the quest by paying money results in a delay of 2 or 3 hours. So...you always can start a new quest after 1 hour already. Only when you cancel your quest you will have to wait longer.
  8. We all do....I used them until they were broken....
  9. Please, do NOT include my PVP-Ladder. It is old, it is bugged and there are better alternatives. Weird to say that to my own script, but that's just the truth
  10. JMAN, YOU'RE OOOOLLLDDDDDDDDDDDDDDDD Happy birthday
  11. would it be possible to make it so that channels are based on the region? Like I have a GameMasters Room and when a GM enters it, he automatically chats in the #GM channel of irc. So all conversation is posted in irc and of course the other way around, everything that is said in the channel is posted ingame.
  12. This should be a discussion thread about the development of the client, not about whether open source is better than closed source or not. If you want to discuss that, take it to the offtopic area.
  13. could you explain "what" isn't working? Does it show up? Do you get any error messages in your mapserver?
  14. Well....I did find quite a few mistakes there....no wonder it didn't work very well! one thing I noticed is the price calculation: set @itemcost,(.IMAGINE_ITEMS[(@j+1)]*@bought_quantity[@i]); is the price for the item really just a multiplication of its ID? you aso had a lot of wrong variable names. I'm not too sure but I think that might have had something to do with it. I also changed the price-calculation. ayothaya,151,171,3 script Drops Trader 403,{ mes .name$; mes "You currently have "+countitem(.Imagine_item)+" Mithril coin/s."; mes "Would you like to look at the shop?"; next; if(select("Yes:No") == 1) close; close2; callshop "Imagine_SHOP",1; npcshopattach "Imagine_SHOP"; dispbottom "You currently have "+countitem(.Imagine_item)+" Mithril coin/s."; end; OnBuyItem: for(set @i,0; @i < getarraysize(@bought_nameid); set @i,@i+1) { for(set @j,0; @j < getarraysize(.IMAGINE_ITEMS); set @j,@j+2) { if(.IMAGINE_ITEMS[@j] == @bought_nameid[@i]) { set @itemcost,(getiteminfo(.IMAGINE_ITEMS[(@j+1)],1)*@bought_quantity[@i]); set @totalcost,(@totalcost+@itemcost); break; } } } if(@totalcost > countitem(.Imagine_item)) { dispbottom "You don't have enough coin."; } else { for(set @i,0; @i < getarraysize(@bought_nameid); set @i,@i+1) { getitem @bought_nameid[@i],@bought_quantity[@i]; } delitem .Imagine_item,@totalcost; dispbottom "Thank you for shopping."; dispbottom "You now have "+countitem(.Imagine_item)+" Mithril coin left."; } set @totalcost,0; deletearray @bought_nameid[0],128; deletearray @bought_quantity[0],128; end; OnInit: npcshopdelitem "Imagine_SHOP",909; // Leave this alone set .name$,"[DropsTrader]"; set .Imagine_item,674; // Input TCG ID setarray .IMAGINE_ITEMS[0],7086,2,7090,2,7091,2,7077,2,7076,2; // Input as many items as you want (item::price) for(set .@i,0; .@i < getarraysize(.IMAGINE_ITEMS); set .@i,.@i+2) { npcshopadditem "Imagine_SHOP",.IMAGINE_ITEMS[.@i],.IMAGINE_ITEMS[(.@i+1)]; } } - shop Imagine_SHOP 139,909:1 As a little sidenote: try to use more concise, descriptive variable names. Here you use ".IMAGINE_ITEMS" and "Imagine_item" for the "Imagine_SHOP"....
×
×
  • Create New...