Jump to content

GmOcean

Community Contributors
  • Content Count

    371
  • Joined

  • Last visited

  • Days Won

    8

Posts posted by GmOcean


  1. index.php?app=downloads&module=display&section=screenshot&id=158

    File Name: Slot Machine

    File Submitter: GmOcean

    File Submitted: 14 Sep 2014

    File Category: Events & Games

     

    This script will allow users to spend zeny &/or an item for a chance to win a prize from the slot machine. Currently there are 2 versions. First is a Single Slot Machine, where only 1 slot is rolled. Second is the Triple Slot machine, where 3 slots are rolled. For either version, SUCCESS must be the only thing displayed in order to win.

     

    To add the cutins, just place them in: data/texture/À¯ÀúÀÎÅÍÆäÀ̽º/illust

     

    /* =============================================================

    /* NOTE - If using soundeffects you must add the ".wav" files

    /* provided in the ".rar" file to your: data/wav folder located

    /* in either your: ( Ragnarok folder ) OR ( .grf file )

    /* =============================================================

     

    I've included the PSD file, so you can edit it as you like.

     

    Click here to download this file


  2. This can be simulated using numerous NPCs and just summon them to your location. However, this is a resource heaven way of doing it.

     

    Right now I don't think there is a way of doing what you want. But I've been wrong before.


  3. I thought I replied to this already lol. I must have erased it oh wellz.

    Hours * 3600 * 1000 = Hours in ticks3 * 3600 * 1000 = 10800000 (3 hours in ticks)

    As for reading the format:

    Seconds * 60 = 60seconds(1min) * 60(min) = 3600seconds(1hour) * 1000(ticks) = 3600000ticksSince we know what 1 hour is, we simplify it by doing this:(Hours we want) * 3600(1hour) * 1000(ticks) = hourswewant_in_ticksTo make it cleaner just do this:(Hours we want)  * ( 3600 * 1000 ) = hourswewant_in_ticks3 * ( 3600 * 1000 ) = 10800000

  4. It was stated yesterday that it required HPMHooking, you also said you got it yesterday as well, did you somehow un-add that lol.

    At either rate, this plugin is awesome, it works great as intended.

    Perhaps the only thing you need to do now Annie, to prevent further repeat issues, is to just make a small notation at the First Post, about needing to enable HPMHooking.


  5. @Annieruru - Is it possible to send the client a dummy mob Id? As in, also send a packet to the client saying you clicked on a mob? If not the yeah, cutin is the way to go.

     

    Edit: Okay here is the script with Cutins. I simplified it quite a bit, so there isn't much room for customizations unless you know what your doing =P

    prontera,152,176,4	script	SlotMachine	563,{mes "Do you want to play a game?","It costs: "+ .zeny +" zeny to play.";if( select("YES:NO") == 2 || Zeny < .zeny ){ close; }while( @menu == 1 ){Zeny -= .zeny;.@a = rand(1,100);if( .@a < atoi(.animate$[0]) ){ .@a = 1; } else { .@a = 2; }.@b = 1;while( .@b < atoi(.animate$[.@a]) ) {	cutin .animate$[3] + .@b,4; sleep2 ( ( atoi(.animate$[4]) * 1000 ) / atoi(.animate$[1]) ); .@b++;	}if( .@a == 1 ){ 	cutin .animate$[3] + atoi(.animate$[1]),4;	dispbottom "Failed";	} else {	cutin .animate$[3] + atoi(.animate$[2]),4;	getitem .prize[0], .prize[1];	}if( select("Another Round:I'm done") == 2 || Zeny < .zeny ){ cutin "",255; close; }}end;OnInit://[0] = Fail Rate//[1] = Fail (Do not change)//[2] = Success (Do not change)//[3] = File Name (Do not change)//[4] = Animation Time (Do not change, for best results )setarray .animate$[0],"30","29","33","slot_","3";setarray .prize[0],501,10;.zeny = 100;end;}

     

    And Also, the cutin files: slot_machine.rar

    Just add these to your:  data/texture/À¯ÀúÀÎÅÍÆäÀ̽º/illust folder.


  6. You would need a custom command to send the clif packet of both of those images. Something like slotmachine(<0|1>);

    Where 0 is fail and 1 is pass. Then you can just calculate the random chance by using rand(1,100) and properly telling which version of the command to use.

     

    OR

     

    you could just make a set of images and produce the same effect using cutin animations


  7. Okay, so following what was posted by Annieruru in another topic I added the changes needed to make players able to attack each other if their guild is listed as an antagonist guild for that said enemy. I also made a few changes to this:

     

    /*====================================================* Player sd, asking player tsd a formal enemy relation between their 2 guilds*---------------------------------------------------*/int guild_opposition(struct map_session_data *sd,struct map_session_data *tsd){    struct guild *g, *tg;    int i;    nullpo_ret(sd);    g=sd->guild;    tg=tsd->guild;    if(g==NULL || tsd==NULL)        return 0;    // Prevent creation opposition with same guilds [LuzZza]    if(sd->status.guild_id == tsd->status.guild_id)        return 0;    //Checks to antagonist count returns 0 if max.    if( guild->get_alliance_count(g,1) >= battle_config.max_guild_alliance )    {        clif->guild_oppositionack(sd,1);        return 0;    }    //Checks antagonist count of target guild, returons 0 if max.    if( guild->get_alliance_count(tg,1) >= battle_config.max_guild_alliance )    {        clif->guild_oppositionack(sd,1);        return 0;    }    for (i = 0; i < MAX_GUILDALLIANCE; i++) { // checking relations        if(g->alliance[i].guild_id==tsd->status.guild_id){            if (g->alliance[i].opposition == 1) { // check if not already hostile                clif->guild_oppositionack(sd,2);                return 0;            }            if(map->agit_flag || map->agit2_flag) // Prevent the changing of alliances to oppositions during WoE.                return 0;            //Change alliance to opposition.            intif->guild_alliance(sd->status.guild_id,tsd->status.guild_id,             sd->status.account_id,tsd->status.account_id,8);            //Change alliance to oppostion for Target Guild.            intif->guild_alliance(tsd->status.guild_id,sd->status.guild_id,                 tsd->status.account_id,tsd->status.account_id,8);        }    }    // inform other serv    intif->guild_alliance(sd->status.guild_id,tsd->status.guild_id,     sd->status.account_id,tsd->status.account_id,1);    // inform other serv for target guild    intif->guild_alliance(tsd->status.guild_id,sd->status.guild_id,         tsd->status.account_id,sd->status.account_id,1);    return 0;}

     

    Which promptly checks to see if the "target" guild has a free slot in it's antagonist list, then if both the src & target guild have free slots, it will add them both to each other's antagonist list, and thusly inform each guild as well.

     

    What I need help doing is editing the removal process. I can't seem to figure out how to make it so when Guild A removes Guild B from their list, Guild A needs to be removed from Guild B's list as well. But incidentally this isn't enough for what I need it to do.

    I was trying to write 2 script commands that would do the following:

     

    1. Add each guild to each other's Antagonist list. ( Still haven't figured out the best way of doing this without just directly copy + paste the code into a BUILDIN block ). I keep running into trouble when trying to find the information of the target guild. Especially since I don't know how to code this so it acts like a skill scroll, where you can click the target and it pulls the required information... @.@;

     

    2. Remove each guild from each other's Antagonist list. ( I haven't started on this because I don't know how to do it through a patch yet, also in order for this command to be useful to my needs, I need to disable the possibility of guild leader's being able to remove them on their own ). <-- Is it even possible to remove the deletion option? I would assume I could remove the code block but would the player still have the option of Right Click -> Delete? I think that'd result in a crash D:

     

    I am in need of help from the src masters i've seen recently... spread light on the darkness that clouds my tiny brain !!


  8. @.@ You didn't need to go through all that for this lol. I wasn't really requesting just suggesting, since it'd be nice for the players to see WHY it's down vs just seeing " Server Closed (1) ". But thanks D:, i'll use it lol, since you went ahead and made it xD. As always excellent work. O.o wish I could learn the src code the way you did, for what I can speculate you taught it to yourself from just looking at the code... impossible for me to do xD


  9. XD Yeah, it appears the version i was working on isn't the one I uploaded lol. I had 2 copies open, and copied the wrong one over xD. And, I've never had an issue with weight before, sure i've gone to max, but I was also able to go past max, like 110% weight. So I never really dropped anything, did all that change? God it's been awhile since I looked at the manual for simpler things T.T;

    prontera,150,180,4	script	Stock_NPC	123,{switch( select( "Buy:Sell" ) ) {    case 1:        if( !.amount ){ mes "Sorry out of stock."; close; }        mes "Currently Selling: "+ getitemname(.itemid) +"";        mes "Amount in stock: "+ .amount +"";        mes "Price per: "+ .buy_price +"";        mes "How much would you like to buy?";        input .@purchase,1,.amount;        if ( Zeny < ( .@purchase * .buy_price ) ){ mes "Not enough funds."; close;}		freeloop(1);		while( !checkweight( .itemid, .@purchase ) && .@purchase >= 1 ) { 			.@purchase--; 			if( !.@purchase ){ mes "Sorry, you can't hold this much."; close; }			}		freeloop(0);        Zeny-= ( .@purchase * .buy_price );        getitem .itemid,.@purchase;        .amount -= .@purchase;        $buyback += .@purchase;        next;        mes "Transaction Complete.";        close;    case 2:        if( !$buyback ){ mes "Sorry, I'm currently over stocked."; close; }        mes "Currently Selling: "+ getitemname(.itemid) +"";        mes "Amount I can buy back: "+ $buyback +"";        mes "Sell back price: "+ .sell_price +"";        mes "How much would you like to sell?";        input .@sell,1,$buyback;        if( countitem(.itemid) < .@sell ){ .@sell = countitem(.itemid); }        Zeny += ( .@sell * .sell_price );        delitem .itemid,.@sell;        .amount += .@sell;        $buyback -= .@sell;        next;        mes "Transaction Complete.";        close;}OnInit:.itemid = 501;.amount = 30000 - $buyback;.buy_price = 100;.sell_price = ( .buy_price / 2 );}

    Edit: Okay, this one works as intended, with checkweight, and only 1 perm variable that is only set when making purchases. And it will still regulate that there is only 30,000 items in flotation. (Assuming this is the only way to obtain it). Everyone happy now xD jk lol. It'll also reduce the amount you can buy to max out your weight should you input an incredibly large number like 999999999.


  10. I thought about it, but I figured with a script like this you wouldn't want it to reset if server crashed or went down for any reason. You know, cuz there must be a reason why there is only 30,000 available lol. If I were to use npcvars instead of permglobals then there would be a very likely chance of more floating in circulation upon an abrupt server down time D:


  11. This works great. I changed the timer around my self, to display: Each Minute, 60seconds, 30:20:10seconds, 9->1seconds. Since it is more appealing to me that way. I did notice that you jumbled up your spelling of " maintenance " through out the plugin though. You went from " maintainance " to " maintenance " and vise-versa lol. I always catch myself making that mistake too. Just thought i'd let you know.

     

    Now only thing is, how can we change the display on server select? I know you said, plugin can't attach into any files outside of src/map folder, but how would we apply a patch that searches for your changes so we can display a predetermined selection when it is in maintenance mode. (If this isn't possible or you're just too busy to figure it out, that's fine xD it's not needed).


  12. So, you want a NORMAL npc to sell the item and restock it. But you want it done via Menu options and text.

    prontera,150,180,4    script    Stock_NPC    123,{switch( select( "Buy:Sell" ) ) {    case 1:	    if( !$amount ){ mes "Sorry out of stock."; close; }	    mes "Currently Selling: "+ getitemname($itemid) +"";	    mes "Amount in stock: "+ $amount +"";	    mes "Price per: "+ $price +"";	    mes "How much would you like to buy?";	    input .@purchase,1,$amount;	    if ( zeny < ( .@purchase * $price ) ){ mes "Not enough funds."; close;}	    zeny-= ( .@purchase * $price );	    getitem $itemid,.@purchase;	    $amount -= .@purchase;        $buyback += .@purchase;	    next;	    mes "Transaction Complete.";	    close;    case 2:        if( !$buyback ){ mes "Sorry, I'm currently over stocked."; close; }	    mes "Currently Selling: "+ getitemname($itemid) +"";	    mes "Amount I can buy back: "+ $buyback +"";	    mes "Sell back price: "+ ($price/2) +"";	    mes "How much would you like to sell?";	    input .@sell,1,$buyback;	    if( countitem($itemid) < .@sell ){ .@sell = countitem($itemid); }	    zeny += ( .@sell * ($price/2) );	    delitem $itemid,.@sell;	    $amount += .@sell;        $buyback -= .@sell;	    next;	    mes "Transaction Complete.";	    close;}OnInitOnce:$itemid = 501; //Red Potion.$start_amount = 30000; // Amount available to start with.$price = 100; //Price per item.$buyback = 0; //Amount that can be bought back. Leave at 0.end;}

     

    OR

    Do you want it to work like an actual shop where you can buy the item, and it only restocks when that same item is sold back? (This can be emulated using a dynamic shop npc, bit more difficult but still very easy).


  13. Why not just use Hercules' official restock shop? It allows you to specify an item to sell and how much to sell. Then you can restock it after X amount of time, or after a certain time. Here is the example given with Hercules revisions.

    prontera,150,160,6	trader	HaiMarket	4_F_EDEN_OFFICER,{OnInit:	tradertype(NST_MARKET);	sellitem Red_Potion,-1,49;	end;OnClock0000://resupplies red potions on midnightOnMyResupply:	if( shopcount(Red_Potion) < 20 )		sellitem Red_Potion,-1,49;	end;}

    This sells 49 RedPotions at default price, and then at midnight, restocks those potions back to 49 if there are less than 20 left. So, to change it to your request would be, replace the 49 with 30000 and the 20 with a number less than 30000 so that it can get restocked.

     

    Edit: This can only be used with packetver 20131223 or newer. So make sure your using a compatible client first.

×
×
  • Create New...

Important Information

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