Jump to content

GmOcean

Community Contributors
  • Content Count

    371
  • Joined

  • Last visited

  • Days Won

    8

Everything posted by GmOcean

  1. GmOcean

    Slot machine

    @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.
  2. GmOcean

    Slot machine

    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
  3. 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 !!
  4. O.o I didn't know hercules supported mob names in that fashion. Hmm.... Now I can make my scripts easier to understand D:
  5. @.@ 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
  6. What!? You mean Annieruru started off as a noob!! Blasphemy lol jk. Yeah, this looks to be a simple quest type npc. Nothing too custom really except the context.
  7. GmOcean

    Stock NPC

    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.
  8. GmOcean

    Stock NPC

    Oh, duh lmao. I thought I did change those D: I must spammed ctrl+z too much. I'll change it again when I get home. Lol.
  9. GmOcean

    Stock NPC

    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:
  10. 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).
  11. GmOcean

    Stock NPC

    Updated my post with the script.
  12. GmOcean

    Stock NPC

    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. GmOcean

    Stock NPC

    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.
  14. Lol, @ the fan club xD. But I guess that means I'm the last remaining " member ". At anyrate, yeah, that's what I meant when I was making the suggestion. I didn't know it was limited to src/map.
  15. @Annieruru - If I'm not mistaken, the part that shows Maintenance is set in the config files. So couldn't you just add a check for a variable change? I'd suggest ifdef but, don't think that apply here.
  16. File Name: Effect List File Submitter: GmOcean File Submitted: 09 Sep 2014 File Category: Utility A simple Utility script designed to make searching for effects in game easier. Click here to download this file
  17. You can use just the plugin. The patch is an optional method for those who can't or have trouble installing plugins.
  18. GmOcean

    Effect List

    Version 0.2

    283 downloads

    A simple Utility script designed to make searching for effects in game easier.
  19. I actually wanna bump this topic as it is interesting and something I would like to have xD. (Along with Lilith Faction system, gonna find a topic and bump it or make a new one D:). Edit: I managed to make it cross-check both guilds before adding a target guild as an antagonist, and then add it to both guilds. (Granted I couldn't get it to work with a hook, some error regarding symbol setting....) Now I must ask for something final that I would like to add, would it be possible to set a " time-limit " before either guild removes one another from the antagonist list? I know we can check for WoE/WoE2 but how about putting a short cd of like 24hours or something. Also, I can't seem to figure out how to remove both guilds from each others antagonist list, if one of the guilds does this. (ex: Guild A removes Guild B from list. Then Guild B's list will remove Guild A).
  20. I've always experienced this as being around the target. When using a sniper or any other range class, the target always showed the splash dmg.
  21. GmOcean

    IND please!

    Awesome and Awesomer and sometimes.... AwesomerER!!
  22. Oh? This is a pretty interesting src edit. I can see a few practical uses for this.
  23. First +1 on herc: Sep 06, 2014. Awesome.

  24. O.o I remember those, it used to give people a huge hype about how cool the server was cuz it has gryphons. But now, I just make " duplicate " classes and each duplicate has a different " bird ", so if a player wants it, they can have it without being limited to only using it. But these are good Edit: Like that black one xD
  25. Lol, yea exactly. Again looks good, bu yeah as Dastgir said, that's how I expected them to look lmao.
×
×
  • Create New...

Important Information

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