-
Posts
1702 -
Joined
-
Last visited
-
Days Won
19
Content Type
Profiles
Forums
Downloads
Jobs Available
Server Database
Third-Party Services
Top Guides
Store
Crowdfunding
Everything posted by Patskie
-
Change DATE_ADD(NOW(), INTERVAL 7 DAY) To COALESCE(DATE_ADD(`expiration_date`, INTERVAL 7 DAY), DATE_ADD(NOW(), INTERVAL 7 DAY))
-
Paano po gawin random ang end time ng KOE?
Patskie replied to ihuskie's topic in Tulong para sa Script at Database
L_start: OnClock2000: // everyday 8pm starts if ( .start ) end; gvgon "guild_vs1"; announce "The King of Emperium Hill has begun!", bc_all; .start = true; enablenpc "The King#KoE"; disablenpc "Exit#KoE"; $koegid = 0; donpcevent "::OnRevKoE"; maprespawnguildid "guild_vs1", $koegid, 3; killmonster "guild_vs1", "KoE::OnEmpDead"; monster "guild_vs1",49,49, "EMPERIUM", 1288, 1, "KoE::OnEmpDead"; sleep rand(60,120) * 60 * 1000; // random 60 to 120 minutes goto L_end; end; L_end: //OnClock2030: // everyday 8:30pm ends gvgoff "guild_vs1"; announce "The King of Emperium Hill is over!", bc_all; .start = 0; enablenpc "Exit#KoE"; disablenpc "The King#KoE"; killmonster "guild_vs1", "KoE::OnEmpDead"; // maprespawnguildid "guild_vs1", $koegid, 2; // uncomment this line to kick non-owner off the map when event ends end; -
You can check out @Skorm post here
-
@Capuche Yeah right i always remember setunitdata and getunitdata for their main attributes only and tend to forget the UMOB_X and UMOB_Y constants as part of it ?
-
There should be no issues if you are using latest rAthena (C++ version)
-
getitem will give the item directly to your inventory, if you want the monster to drop an item "on top" of their natural drops then you can do like below // 1. Go to your src/map/script.cpp // 2. Add below code before "case BL_PC: //Get Character Position" // case BL_MOB: // if (script_hasdata(st,6)) // bl = map_id2bl(script_getnum(st,6)); // break; // 3. Recompile your server // 4. Add below script - script CustomDrop FAKE_NPC,{ OnNPCKillEvent: for (.@i = 0; .@i < .size; .@i += 4) { if (killedrid == .data[.@i]) { if (rand(10000) < .data[.@i + 3]) { getmapxy .@map$, .@x, .@y, BL_MOB, killedgid; .@amt = .data[.@i + 2]; while (.@amt) { makeitem .data[.@i + 1], 1, .@map$, .@x, .@y; .@amt--; } } } } end; OnInit: // <mob_id>, <item_id>, <item_amount>, <chance> // Chance ======================== // 10000 = 100% // 1000 = 10% // 100 = 1% // 99 = 0.99% // 50 = 0.50% // 1 = 0.01% // =============================== setarray .data[0], 1002, 607, 2, 10000, // poring will drop 2 ygg berries on the floor with 100% chance 1002, 608, 3, 10000; // poring will drop 3 ygg seeds on the floor with 100% chance .size = getarraysize(.data); end; }
-
You can try below and let me know if it works for you prontera,130,215,5 script Lottery 76,{ function ShowNumbers; function GenerateNumbers; function MatchCount; function GenerateID; function GenerateID { $LWID = $LID; $LID = rand(100000, 999999); return; } function MatchCount { .@cnt = 0; for (.@i = 0; .@i < .combinations; .@i++) { if (inarray($LW, #LW[.@i]) != -1) .@cnt++; } return .@cnt; } function ShowNumbers { switch (getarg(0)) { default: case 0: .@color$ = "^FF0000"; .@prefix$ = "#LW"; break; case 1: .@color$ = "^0000FF"; .@prefix$ = "$LW"; break; case 2: .@color$ = "^006600"; .@prefix$ = "$LR"; break; } if (getarg(1, 0)) .@color$ = ""; .@mes$ = .@color$; for (.@i = 0; .@i < .combinations; .@i++) .@mes$ = .@mes$ + "[" + getd(.@prefix$+"["+.@i+"]") + "] "; if (!getarg(1, 0)) .@mes$ = .@mes$ + "^000000"; return .@mes$; } function GenerateNumbers { .@a = 0; deletearray getarg(0); while (.@a < .combinations) { do { .@i = rand(1, 40); } while (inarray(getarg(0), .@i) != -1); set getelementofarray(getarg(0), .@a), .@i; .@a++; } return; } mes .npc$; mes "Winning Lotto Numbers ("+$LWID+"):"; mes ShowNumbers(1, 0); mes "Your Ticket ("+#LID+"):"; mes ShowNumbers(0, 0); mes "Next Draw-ID: ^FF0000" + $LID + "^000000."; next; switch(select((#LID == $LWID ? "Claim Prize" : ""), "Buy New Ticket", (getgmlevel() < .gm_level ? "" : "^FF0000[GM]^000000 Do Draw Now"), (getgmlevel() < .gm_level ? "" : "^FF0000[GM]^000000 Rig the Lottery"), "Cancel")) { default: break; // Claim Prize case 1: .@match_count = MatchCount(); if (.@match_count != .combinations) { mes .npc$; mes "Bad luck, it appears you do not hold a winning ticket."; next; mes .npc$; mes "Better luck next time!."; close; } mes .npc$; mes "You have matched all " + .combinations + " numbers!"; mes "Jackpot!"; mes "You've won ^0000FF" + F_InsertComma(.jackpot_zeny) + "^000000z & " + .jackpot_items[1] + " " + getitemname(.jackpot_items[0]) + "!"; Zeny = (Zeny + .jackpot_zeny) > 2147483647 ? 2147483647 : (Zeny + .jackpot_zeny); getitem .jackpot_items[0], .jackpot_items[1]; announce "Lottery: " + strcharinfo(0) + " has won the JACKPOT of " + F_InsertComma(.jackpot_zeny) + "z & " + .jackpot_items[1] + " " + getitemname(.jackpot_items[0]) + "!", 0; #LID = 0; break; // Buy New Ticket case 2: if (#LW && #LID == $LID) { mes .npc$; mes "It appears that you already have a ticket for today."; mes "You may only purchase one ticket per draw."; close; } mes .npc$; mes "Tickets cost ^0000FF" + F_InsertComma(.ticket_price) + "^000000z."; mes "The Jackpot is ^FF0000" + F_InsertComma(.jackpot_zeny) + "^000000z & " + .jackpot_items[1] + " " + getitemname(.jackpot_items[0]) + "!"; next; if (Zeny < .ticket_price) { mes .npc$; mes "You can't afford a lottery ticket."; close; } mes .npc$; mes "Would you like your numbers hand picked or computer generated?"; next; switch(select("Computer Generated", "Hand Picked")) { case 1: while (true) { mes .npc$; mes "The computer has selected the following numbers:"; GenerateNumbers(#LW); mes ShowNumbers(0, 0); next; if (select("Re-Generate", "Confirm") & 2) break; } break; case 2: while (true) { mes .npc$; mes "Please pick your numbers (1-40):"; .@a = 0; .@j = 0; deletearray #LW; while (.@a < .combinations) { if (getarraysize(#LW)) { mes "PICK " + .@a + ": ^0000FF" + #LW[.@j] + "^000000"; .@j++; } do { input @pick; } while (@pick < 1 || @pick > 40 || inarray(#LW, @pick) != -1); #LW[getarraysize(#LW)] = @pick; .@a++; } mes "PICK " + .@a + ": ^0000FF" + #LW[.@j] + "^000000"; next; mes .npc$; mes "Your numbers are:"; mes ShowNumbers(0, 0); next; if (select("Confirm", "Re-Pick") == 1) break; } break; } Zeny -= .ticket_price; #LID = $LID; mes .npc$; mes "The live broadcasted draw is at 9pm."; mes "You can claim your ticket between then and the next draw."; next; mes .npc$; mes "Good luck!"; break; // Do Draw Now case 3: deletearray $LW; if (!$LR) GenerateNumbers($LW); else copyarray $LW, $LR, getarraysize($LR); close2; announce "Lottery: Welcome to the special GM's lotto draw!", 0; sleep 3000; announce "The numbers are as follows: " + ShowNumbers(1, 1), 0; sleep 3000; announce "Congratulations to the winners!", 0; GenerateID(); deletearray $LR; end; // Rig the Lottery case 4: while (true) { mes .npc$; mes "Please pick your numbers (1-40):"; .@a = 0; .@j = 0; deletearray $LR; while (.@a < .combinations) { if (getarraysize($LR)) { mes "PICK " + .@a + ": ^0000FF" + $LR[.@j] + "^000000"; .@j++; } do { input @pick; } while (@pick < 1 || @pick > 40 || inarray($LR, @pick) != -1); $LR[getarraysize($LR)] = @pick; .@a++; } mes "PICK " + .@a + ": ^0000FF" + $LR[.@j] + "^000000"; next; mes .npc$; mes "Your rigged numbers are:"; mes ShowNumbers(2, 0); next; if (select("Confirm", "Re-Pick") == 1) break; } mes .npc$; mes "Lottery rigged for next draw."; break; } close; // Automatic Draw OnClock0200: OnClock0400: OnClock0600: OnClock0800: OnClock1000: OnClock1200: OnClock1600: OnClock1800: OnClock2000: OnClock2006: OnClock2007: OnClock2200: deletearray $LW; if (!$LR) GenerateNumbers($LW); else copyarray $LW, $LR, getarraysize($LR); announce "Lottery: This hour's draw is worth " + F_InsertComma(.jackpot_zeny) + " Zeny and " + .jackpot_items[1] + " " + getitemname(.jackpot_items[0]) + "!!", 0; sleep 3000; announce "The numbers are as follows: " + ShowNumbers(1, 1), 0; sleep 3000; announce "Congratulations to the winners of tonight!", 0; GenerateID(); deletearray $LR; end; OnInit: .npc$ = "[Lottery]"; .gm_level = 99; .combinations = 3; .ticket_price = 100000; .jackpot_zeny = 2000000000; setarray .jackpot_items[0], 501, 20; if (!$LID) GenerateID(); waitingroom "Hourly Lottery",0; end; } You can set below configs as per your desire .gm_level .combinations .ticket_price .jackpot_zeny .jackpot_items
-
Perhaps along with your code you can tell us how you want it to be implemented? ?
-
Freebies NPC that adds 7 days of premium users in sql
Patskie replied to Kudo's question in Script Requests
query_sql("INSERT INTO table VALUES (20000046, 23456, 100, 0, DATE_ADD(NOW(), INTERVAL 7 DAY))"); -
Try below // if you want to use card trader where you can put multiple cards if u have them in inventory then use below prontera,150,150,6 script Sample 100,{ getinventorylist; for (.@i = 0; .@i < @inventorylist_count; .@i++) { if (getiteminfo(@inventorylist_id[.@i], 2) == 6) { .@menu$ = .@menu$ + getitemname(@inventorylist_id[.@i]) + ":"; .@cards[getarraysize(.@cards)] = @inventorylist_id[.@i]; .@qt[getarraysize(.@qt)] = @inventorylist_amount[.@i]; } } .@i = 0; mes "Please select 3 cards..."; while (.@i < 3) { if (getarraysize(.@c)) { mes "> 1x " + getitemname(.@c[.@j]); .@j++; } .@s = select(.@menu$) - 1; .@c[getarraysize(.@c)] = .@cards[.@s]; cleararray .@qt[.@s], (.@qt[.@s] < 1 ? 0 : (.@qt[.@s]-1)), 1; if (!.@qt[.@s]) .@menu$ = replacestr(.@menu$, getitemname(.@cards[.@s]), ""); .@i++; } .@size = getarraysize(.@c); mes "> 1x " + getitemname(.@c[.@j]); next; mes "Are you sure you want to trade these cards?"; if (select("~ Yes:~ No") & 2) end; for (.@i = 0; .@i < .@size; .@i++) delitem .@c[.@i], 1; getitem rand(4001,4699), 1; close; } // if you want to use distinct card trader, means even if u have 2x poring card you can only trade 1 of them use below prontera,153,153,6 script Sample1 100,{ getinventorylist; for (.@i = 0; .@i < @inventorylist_count; .@i++) { if (getiteminfo(@inventorylist_id[.@i], 2) == 6) { .@cards[getarraysize(.@cards)] = @inventorylist_id[.@i]; .@menu$ = .@menu$ + getitemname(@inventorylist_id[.@i]) + ":"; } } .@i = 0; mes "Please select 3 cards..."; while (.@i < 3) { if (getarraysize(.@c)) { mes "> 1x " + getitemname(.@c[.@j]); .@j++; } .@s = select(.@menu$) - 1; .@c[getarraysize(.@c)] = .@cards[.@s]; .@menu$ = replacestr(.@menu$, getitemname(.@cards[.@s]), ""); .@i++; } .@size = getarraysize(.@c); mes "> 1x " + getitemname(.@c[.@j]); next; mes "Are you sure you want to trade these cards?"; for (.@i = 0; .@i < .@size; .@i++) mes "> " + getitemname(.@c[.@i]); if (select("~ Yes:~ No") & 2) end; for (.@i = 0; .@i < .@size; .@i++) delitem .@c[.@i], 1; getitem rand(4001,4699), 1; close; }
-
Equal Item Drop Chance for each member in a party
Patskie replied to Vinisk's question in Scripting Support
Not tested - script Sample -1,{ OnNPCKillEvent: if (!getcharid(1)) end; getmobdrops(killedrid); .@mc = $@MobDrop_count; copyarray .@mi, $@MobDrop_item, .@mc; copyarray .@mr, $@MobDrop_rate, .@mc; .@random = rand(10000); for (.@i = 0; .@i < .@mc; .@i++) { if (.@random < .@mr[.@i]) .@items[getarraysize(.@items)] = .@mi[.@i]; } .@d = getarraysize(.@items); if (.@d) { getmapxy(.@map$, .@x, .@y, BL_PC); getpartymember getcharid(1), 1; getpartymember getcharid(1), 2; .@cnt = $@partymembercount; for (.@i = 0; .@i < .@cnt; .@i++) { if (isloggedin($@partymemberaid[.@i], $@partymembercid[.@i])) { if (attachrid($@partymemberaid[.@i])) { getmapxy(@map$, @x, @y, BL_PC); if (@map$ == .@map$ && distance(.@x, .@y, @x, @y) < 15) { for (.@j = 0; .@j < .@d; .@j++) getitem .@items[.@j], 1; } } } } } end; } -
Cash Points as payment for Card Seller?
Patskie replied to AyenPanda's question in Scripting Support
Change shop to cashshop - shop card_mob#A -1,501:1000 - shop card_mob#B -1,501:1000 - shop card_mob#C -1,501:1000 - shop card_mob#D -1,501:1000 - shop card_mob#E -1,501:1000 - shop card_mob#F -1,501:1000 - shop card_mob#G -1,501:1000 - shop card_mob#H -1,501:1000 - shop card_mob#I -1,501:1000 - shop card_mob#J -1,501:1000 - shop card_mob#K -1,501:1000 - shop card_mob#L -1,501:1000 - shop card_mob#M -1,501:1000 - shop card_mob#N -1,501:1000 - shop card_mob#O -1,501:1000 - shop card_mob#P -1,501:1000 - shop card_mob#Q -1,501:1000 - shop card_mob#R -1,501:1000 - shop card_mob#S -1,501:1000 - shop card_mob#T -1,501:1000 - shop card_mob#U -1,501:1000 - shop card_mob#V -1,501:1000 - shop card_mob#W -1,501:1000 - shop card_mob#X -1,501:1000 - shop card_mob#Y -1,501:1000 - shop card_mob#Z -1,501:1000 -
Rent item to change group id until it expires
Patskie replied to SorryV2's question in Database Requests
Then you have to check first if the person who will wear the item is a VIP or not before adjusting their group *vip_status(<type>,{"<character name>"}) Returns various information about a player's VIP status. Valid types: VIP_STATUS_ACTIVE - VIP status: true if the player is a VIP or false if not VIP_STATUS_EXPIRE - VIP expire timestamp if the player is VIP or 0 if not VIP_STATUS_REMAINING - VIP time remaining in seconds NOTE: This command is only available if the VIP System is enabled. -
SCRIPT DELAY STROM GUST, VERMILION, METEOR STROM PROBLEM
Patskie replied to petra077's question in Database Support
If you are using latest rAthena then you can configure it in skill_db.yml. Storm Gust : https://github.com/rathena/rathena/blob/5112f8e2d8a6eca1df88d1700de61f07e93de6f2/db/re/skill_db.yml#L3715 LOV : https://github.com/rathena/rathena/blob/5112f8e2d8a6eca1df88d1700de61f07e93de6f2/db/re/skill_db.yml#L3381 Meteor Storm : https://github.com/rathena/rathena/blob/5112f8e2d8a6eca1df88d1700de61f07e93de6f2/db/re/skill_db.yml#L3167- 1 reply
-
- 1
-
-
Ano ba considered "malupit" sayo? HAHAHA
-
[Crowdsourcing] Ragnarok Server Suggestions
Patskie replied to Patskie's topic in PEENOISE CLUB's Topics
Thanks sa mga sumagot at sa mga sasagot pa! ? -
By default the time limit for ET is 4 hours and if you are idle for 5 minutes you will be kicked out of the instance # - Id Instance ID. # Name Instance Name. # TimeLimit Total lifetime of instance in seconds. (Default: 3600) # IdleTimeOut Time before an idle instance is destroyed in seconds. (Default: 300) # Enter: Instance entrance coordinates. # Map Map Name where players start. # X X Coordinate where players start. # Y Y Coordinate where players start. # AdditionalMaps: List of maps that are part of an instance. (Optional)
-
NPC getitem 1 per account every 4hours
Patskie replied to celeron0134's question in Scripting Support
It's because you are using character variables You can replace wait_time to #wait_time -
I scrutinized both OVH and DO Asia servers for quite some time in terms of their latency. I would prefer DigitalOcean with 40$+ package. though OVH is good as well but personally i think DO is better ?
-
Can you post the exact item db entry on which you are facing the issue.
-
Hello Peenoise Team, Ask ko lang any tips ano magandang buoin na server? Low, Mid, High Rate? and why? ? Thanks sa sasagot!
-
I replied based on what you have described in this topic. Its too vague for me
-
Try below prontera,155,181,5 script Sample#goldroom 4_F_KAFRA1,{ doevent "gold_room_main::OnTalk"; } // warp portal back prontera ordeal_3-2,123,123,0 warp gold_room_back_prt 1,1,prontera,155,181 // peco peco summon ordeal_3-2,0,0,0,0 monster Peco Peco 1019,200,60000,0,"gold_room_main::OnKill" - script gold_room_main -1,{ OnInit: // gold room map .map$ = "ordeal_3-2"; // entrance fee .zeny_cost = 200000; // rate to get gold .rate = 100; // gold random amount setarray .gold_amount,1,5; setmapflag .map$,mf_noteleport; setmapflag .map$,mf_pvp; setmapflag .map$,mf_pvp_noguild; setmapflag .map$,mf_pvp_noparty; setmapflag .map$,mf_nobranch; setmapflag .map$,mf_nosave; setmapflag .map$,mf_nomemo; setmapflag .map$,mf_noreturn; setmapflag .map$,mf_nowarp; setmapflag .map$,mf_nowarpto; end; OnTalk: mes "Enter Gold Room ?"; if ( .zeny_cost ) mes F_InsertComma( .zeny_cost ) + " Zeny"; switch ( select( "Enter Gold Room", "Exchange Gold Point", "Cancel" )) { case 1: if ( Zeny < .zeny_cost ) { mes "Not enough Zeny."; } else { Zeny -= .zeny_cost; warp .map$,0,0; } break; case 2: mes "You got "+F_InsertComma( #GOLDPOINTS )+" Points"; input .@value,0,#GOLDPOINTS; if ( checkweight( 969, .@value ) ) { #GOLDPOINTS -= .@value; getitem 969,.@value; mes "Gained "+.@value+" Gold."; } else { mes "You overweight."; } default: break; } close; OnKill: if ( .rate > rand( 100 ) ) { .@point = rand( .gold_amount[0],.gold_amount[1] ); #GOLDPOINTS += .@point; dispbottom "Gained "+.@point+" Point. You got "+F_InsertComma( #GOLDPOINTS )+" Points now."; } end; OnPCDieEvent: .@killerrid = killerrid; if ( strcharinfo(3) == .map$ && .@killerrid != getcharid(3) && getmonsterinfo( .@killerrid,MOB_NAME ) != "null" ) { #GOLDPOINTS = 0; dispbottom "You died, you lost all the point."; } end; }
-
prontera,150,150,6 script Sample 100,{ getinventorylist; for (.@i = 0; .@i < @inventorylist_count; .@i++) { if (getiteminfo(@inventorylist_id[.@i], 2) == 6) { .@menu$ = .@menu$ + "- " + getitemname(@inventorylist_id[.@i]) + ":"; .@cards[getarraysize(.@cards)] = @inventorylist_id[.@i]; } } .@i = 0; mes "Please select 3 cards..."; while (.@i < 3) { if (getarraysize(.@c)) { mes "> 1x " + getitemname(.@c[.@j]); .@j++; } .@s = select(.@menu$) - 1; .@c[getarraysize(.@c)] = .@cards[.@s]; .@i++; } mes "> 1x " + getitemname(.@c[.@j]); next; mes "Are you sure you want to trade these cards?"; if (select("~ Yes:~ No") & 2) end; for (.@i = 0; .@i < getarraysize(.@c); .@i++) delitem .@c[.@i], 1; getitem rand(4001,4699), 1; close; } Try something like this