Jump to content

`Azhul

Members
  • Content Count

    14
  • Joined

  • Last visited


Reputation Activity

  1. Like
    `Azhul got a reaction from akbare in Gacha with announce   
    Hello everyone, i have this working gacha script of Capuche
    I want a little modification on it,  npc will announce when a player got the rare item from 1% to 3% chance.
    i hope this is the right place to post this and hope you guys could help me. Thanks in advance
     
    tavern,66,37,3 script Gacha 562,{ mes .npc_name$; mes "Hello, do you want to play the Gatcha??"; next; switch( select( "Play !", "More Informations", "Leave" ) ) { case 1: break; case 2: while( getd(".p"+ .@j ) ) { mes .npc_name$; mes "Item required: ^FFCC00"+ getitemname( getd(".p"+ .@j ) ) +"^000000"; mes "Chance to gain something: ^CC0000"+ getd(".p"+ .@j +"[1]" ) +"%^000000"; mes "Possible gains:"; for( .@i = 3; .@i < getarraysize( getd(".p"+ .@j ) ); .@i += 3 ) mes "^0000FFx"+ getd(".p"+ .@j +"["+ .@i +"]" ) +"^000000 "+ getitemname( getd(".p"+ .@j +"["+ (.@i -1) +"]" ) ) +" (^CC0000"+ getd(".p"+ .@j +"["+ (.@i +1) +"]" ) +"%^000000)"; .@j++; next; } break; case 3: mes .npc_name$; mes "Bye!~"; close; } mes .npc_name$; mes "Which item do you want to use ?"; next; for( .@j = 0; getd(".p"+ .@j ); .@j++ ) { .@size = getarraysize( .@menu$ ); .@menu$[ .@size ] = getitemname( getd(".p"+ .@j ) ); .@sel[ .@size ] = .@j; } .@s = .@sel[ select( implode( .@menu$, ":" ) ) -1 ]; while (1) { if ( countitem( getd(".p"+ .@s ) ) < 1 ) { mes .npc_name$; mes "it seems you have ran out of "+ getitemname( getd(".p"+ .@s ) ); close; } mes .npc_name$; mes "Here we go..."; delitem getd(".p"+ .@s ), 1; if( rand(100) > getd(".p"+ .@s +"[1]" ) )// lose mes "You got nothing"; else { .@rand = rand( getd(".totalchance"+ .@s ) ); .@r = 1; while ( ( .@rand = .@rand - getd( ".p"+ .@s +"["+ (1+ 3 * .@r) +"]" ) ) >= 0 ) .@r++; getitem getd( ".p"+ .@s +"["+ (1+ 3*.@r -2) +"]" ), getd( ".p"+ .@s +"["+( 1+3*.@r -1 )+"]" ); mes "You got ^FF00CC"+ getd( ".p"+ .@s +"["+( 1+3*.@r -1 )+"]" ) +" "+ getitemname( getd( ".p"+ .@s +"["+ (1+ 3*.@r -2) +"]" ) ) +"^000000"; } mes " "; mes "wanna try again ?"; next; if ( select( "Yes", "No" ) == 2 ) close; } close; OnInit: // (item ID need) (chance), (reward 1) (number of reward 1) (chance to gain), (reward 2) (number of reward 2) (chance to gain)... setarray .p0, 32130,100, 31731,1,1, 20255,1,2, 31320,1,3, 6320,1,14, 32044,1,14, 7776,1,14, 32041,1,80, 32091,1,80, 32092,1,80, 32093,1,80, 32040,10,80; // Mithril Coin setarray .p1, 32131,100, 19827,1,1, 5335,1,1, 32041,1,28, 32091,1,28, 32092,1,28, 32093,1,28, 32040,1,28, 7517,1,70; // Gold Coin while ( getd(".p"+ .@j ) ) { for( .@i = 4; .@i < getarraysize( getd(".p"+ .@j ) ); .@i += 3 ) setd ".totalchance"+ .@j, getd(".totalchance"+ .@j ) + getd(".p"+ .@j +"["+ .@i +"]" ); .@j++; } .npc_name$ = "[ "+ strnpcinfo(1) +"]"; end; }  
  2. Like
    `Azhul reacted to Neffletics in Race to 99 Script   
    Update: setarray .@rewardablejobs[0] and change the jobs there to Job_Whitesmith, Job_Creator, Job_Sniper, etc. (reference: doc/const.txt)

    Then change the coordinate of the training grounds NPC.

    P.S. Untested, I just wrote it from my phone. I wrote it in a simple manner, please learn from the changes I made.
    /////////////////////////////////////////////////////// // ___________ _____.__ // \__ ___/__.__.________/ ____\__| ____ ____ // | | < | |\_ __ \ __\| |/ \ / ___\ // | | \___ | | | \/| | | | | \/ /_/ > // |____| / ____| |__| |__| |__|___| /\___ / // \/ Scripts \//_____/ // //===================================================== // Name: Race to Max Level // // Description: // This NPC allows for Game Masters to set a reward to // be given to the first player of each 2nd class that // reaches maximum level (base and class). //===================================================== /////////////////////////////////////////////////////// new_1-1,111,111,4 script Race to 99#reg 58,{ mes "[Race to 99]"; mes "Would you like to join the race to 99 event?"; switch(select("Yes.","Leave him alone.")) { case 1: mes "[Race to 99]"; mes "Okay, you're in!"; set RaceParticipate,1; close; case 2: mes "[Race to 99]"; mes "Okay, that sucks."; close; } } prontera,147,180,5 script Race to Max Level 58,{ set .@gm_level, 99; // GM level required to set the reward set .@maxbase, 99; set .@maxjob, 50; set .@defaultreward, 510; setarray .@rewardablejobs[0], Job_Knight, Job_Alchemist, Job_Assassin, Job_Bard, Job_Blacksmith, Job_Crusader, Job_Dancer, Job_Hunter, Job_Monk, Job_Priest, Job_Rogue, Job_Sage, Job_Wizard; Begin: clear; if (RaceReward == 1) { mes "[ ^0099ccRace to Max Level^000000 ]"; mes "You have already received your reward."; close; } if (RaceParticipate != 1) { mes "[ ^0099ccRace to Max Level^000000 ]"; mes "You're not a participant of this event."; close; } mes "[ ^0099ccRace to Max Level^000000 ]"; mes "Hello, " + ((getgmlevel() >= .@gm_level) ? "master! What do you want to do today?" : "are you here for your reward?"); switch(select(((getgmlevel() >= .@gm_level) ? "Set Reward:Restart Race" : ":") + ":YES!:...Reward?:Who was rewarded?:Cancel")) { case 1: goto SetReward; case 2: goto RestartRace; case 3: goto GetReward; case 4: goto ExplainRace; case 5: goto ShowRewarded; default: end; } SetReward: clear; mes "[ ^0099ccRace to Max Level^000000 ]"; if ($reward == 0) set $reward, .@defaultreward; mes "The reward is " + getitemname($reward) + " (ID: " + $reward + ")."; mes "Do you want to change it?"; if (select("Yes:No") == 1) { clear; mes "[ ^0099ccRace to Max Level^000000 ]"; mes "Please enter the new reward item ID."; input .@rewardid; clear; mes "[ ^0099ccRace to Max Level^000000 ]"; mes "Set " + getitemname(.@rewardid) + " as the reward?"; if(select("Yes:No") == 1) { set $reward, .@rewardid; } } goto Begin; RestartRace: clear; mes "[ ^0099ccRace to Max Level^000000 ]"; mes "Are you sure you want to restart the race?"; if (select("Yes:No") == 1) { for (.@i = 0; .@i < getarraysize(.@rewardablejobs); .@i++) { set $rewarded$[.@rewardablejobs[.@i]], ""; } announce "The Race to Max Level has begun! Claim a reward once you reach " + .@maxbase + " base and " + .@maxjob + " class!", bc_all; } goto Begin; GetReward: mes "Let's see... " + strcharinfo(0) + ", huh?"; if (Upper != 1) { mes "You're not a rebirth class. You're not qualified"; close; } set .@competitioner, 0; for (.@i = 0; .@i < getarraysize(.@rewardablejobs); .@i++) { if (Class == .@rewardablejobs[.@i]) { set .@competitioner, 1; if (BaseLevel < .@maxbase || JobLevel < .@maxjob) { mes "I'm sorry, but you still need to level a bit more."; } else if ($rewarded$[Class] == strcharinfo(0)) { mes "You have already claimed your reward."; } else if ($rewarded$[Class] != "") { mes "Too late!"; mes "The reward for " + jobname(Class) + " was already claimed by " + $rewarded$[Class] + "."; } else goto GiveReward; } } if (.@competitioner == 0) mes "You need to change your job."; close; GiveReward: set $rewarded$[Class], strcharinfo(0); set RaceReward, 1; clear; mes "[ ^0099ccRace to Max Level^000000 ]"; mes "Congratulations! You were the first " + jobname(Class) + " to reach " + .@maxbase + " base and " + .@maxjob + " class!"; getitem $reward, 1; announce strcharinfo(0) + " (" + jobname(Class) + ") reached Max. Level and received " + getitemname($reward) + "!", bc_all; close; ExplainRace: clear; mes "[ ^0099ccRace to Max Level^000000 ]"; mes "Yes! When you reach the maximum level for your class, talk to me and you'll be rewarded with a special item."; next; goto Begin; ShowRewarded: clear; mes "[ ^0099ccRace to Max Level^000000 ]"; for (.@i = 0; .@i < getarraysize(.@rewardablejobs); .@i++) { mes jobname(.@rewardablejobs[.@i]) + ": " + (($rewarded$[.@rewardablejobs[.@i]] != "") ? $rewarded$[.@rewardablejobs[.@i]] : "^ff0000Nobody^000000"); } next; goto Begin; }

     
  3. Like
    `Azhul got a reaction from master@ragna in [Yug-WebDev] Services [Web-Dev] [Server-Dev]   
    This Guy works good looking forward to hire him again.
  4. Like
    `Azhul reacted to Kuya Jeo in Unmanage VPS   
    For me, I used OVH, it easy to manage if you know hos to setup your VPS and easy to contact them
×
×
  • Create New...

Important Information

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