Jump to content

Habilis

Members
  • Content Count

    225
  • Joined

  • Last visited

  • Days Won

    20

Reputation Activity

  1. Upvote
    Habilis got a reaction from luizragna in Custom Unit HP Bar System   
    There is a small problem some clients cant display it if inside a folder inside /illust
    But works good if  directly inside /illust
    My client won't
    ex:  /illust/hpbar/0.bmp [won't work]
    ex: /illust/0_hpbar.bmp [Works]
  2. Upvote
    Habilis got a reaction from Begin in [Dev's Diary] Minimal $ Ragnarok online server & comunity   
    After the release of the CampFire 
    I decided to make a fishing game.
    In the official game Client there are already nice fishes released.
    So, I gathered all 19 of them.  And renamed them to English.

    There is also a very nice NPC sprite in the official Client

     
     
    I borrowed fishing rod sprites from some other server

    The problem with official fishing rods, is that, they look surprisingly like Whips...
    http://ratemyserver.net/index.php?iname=fishing+rod&page=re_item_db&quick=1&isearch=Search
     
     
    I made them wearable and double handed.

     
     
     
    Then, I found the most interactive fishing game script.
     
     
    Unfortunately, this script is written for rAthena and has major logic issues. But, I managed to make it work on Hercules.
     

     

     
     
     
     
     
    Work In Progress...
     

     
     

     
    Work In Progress...
     
    What is the Ide of Fishing game 
     
    3 different fishing rods
    obtainable by quest
    Wooden, bamboo, metallic fishing rood with different properties
    modifying the fish catching process
    Metallic Fishing Rod can be refined (for better modificators)

     
    there is also a 1% risk of losing the Fishing Rod on failure 
     
    Player can catch 
    Junk  - Common item such as Empty Bottle, Jeloppy, Fluff, etc. Item  - Not common item that can be fished out of the weater Shoes, Boots, Old Blue Box, Etc. Fish  - Very Common (One of the Fishes displayed above) Mermaid - Common , WTF moment, Mermaid will cast a Heal or buff on you and disappear. Fish monster  -  Not Common, Player Fished out of the water an aggressive monster. (Marc, Swordfish) I'm also planning to give Experience.
     
    There will be diffirent fishing spots
    Around prontera - Fishing spots for beginners, require the wooden fishing rod,  lake, river fish can be fished there.
    Alberta / Comodo - Intermediate fishing spots, require Bamboo fishing rod, Ocean, sea fish can be fished there. (Higher chance to fish out fish monster)
    Izlude Island (Turtle island) - Advanced fishing spots require Metalic fishing rod, Giant, Legendary fish can be fished there.
     
               
  3. Upvote
    Habilis got a reaction from Functor in [Dev's Diary] Minimal $ Ragnarok online server & comunity   
    After the release of the CampFire 
    I decided to make a fishing game.
    In the official game Client there are already nice fishes released.
    So, I gathered all 19 of them.  And renamed them to English.

    There is also a very nice NPC sprite in the official Client

     
     
    I borrowed fishing rod sprites from some other server

    The problem with official fishing rods, is that, they look surprisingly like Whips...
    http://ratemyserver.net/index.php?iname=fishing+rod&page=re_item_db&quick=1&isearch=Search
     
     
    I made them wearable and double handed.

     
     
     
    Then, I found the most interactive fishing game script.
     
     
    Unfortunately, this script is written for rAthena and has major logic issues. But, I managed to make it work on Hercules.
     

     

     
     
     
     
     
    Work In Progress...
     

     
     

     
    Work In Progress...
     
    What is the Ide of Fishing game 
     
    3 different fishing rods
    obtainable by quest
    Wooden, bamboo, metallic fishing rood with different properties
    modifying the fish catching process
    Metallic Fishing Rod can be refined (for better modificators)

     
    there is also a 1% risk of losing the Fishing Rod on failure 
     
    Player can catch 
    Junk  - Common item such as Empty Bottle, Jeloppy, Fluff, etc. Item  - Not common item that can be fished out of the weater Shoes, Boots, Old Blue Box, Etc. Fish  - Very Common (One of the Fishes displayed above) Mermaid - Common , WTF moment, Mermaid will cast a Heal or buff on you and disappear. Fish monster  -  Not Common, Player Fished out of the water an aggressive monster. (Marc, Swordfish) I'm also planning to give Experience.
     
    There will be diffirent fishing spots
    Around prontera - Fishing spots for beginners, require the wooden fishing rod,  lake, river fish can be fished there.
    Alberta / Comodo - Intermediate fishing spots, require Bamboo fishing rod, Ocean, sea fish can be fished there. (Higher chance to fish out fish monster)
    Izlude Island (Turtle island) - Advanced fishing spots require Metalic fishing rod, Giant, Legendary fish can be fished there.
     
               
  4. Upvote
    Habilis reacted to bWolfie in [Event] Wheel of fortune   
    I updated the pastebin. There was an error it was pointing to OnEnd instead of OnStop. Thanks.
  5. Upvote
    Habilis got a reaction from w0wZukuBg in Campfire to regenerate HP/SP   
    Here is the pre-releae version.
    anyone, who feel like it,  can contribute!
     
    prt_fild08,138,364,0 script Camp Fire#CF 4_BONFIRE,{ end; OnRefill: getmapxy(.@map$, .@x, .@y, UNITTYPE_PC); getmapxy(.@npc_map$, .@npc_x, .@npc_y, UNITTYPE_NPC); if (.@map$ != .@npc_map$ || distance(.@npc_x, .@npc_y, .@x, .@y) > .refill_distance || !(issit())) { @camp_fire_regen = 0; @camp_fire_tick = 0; end; } if(@camp_fire_regen == 1) { heal(.refillHP_rate, .refillSP_rate); } else { if(@camp_fire_tick >= .camp_fire_delay) { @camp_fire_regen = 1; @camp_fire_tick = 0; dispbottom("You are feeling warm and cozy."); } else { @camp_fire_tick++; } } end; OnTimer500: getmapxy(.@npc_map$, .@npc_x, .@npc_y, UNITTYPE_NPC); .@count = getunits(BL_PC, .@units[0], false, .@npc_map$, (.@npc_x - .refill_distance), (.@npc_y - .refill_distance), (.@npc_x + .refill_distance), (.@npc_y + .refill_distance)); for (.@i = 0; .@i < .@count; ++.@i) { addtimer(rand(.refill_timer), strnpcinfo(NPC_NAME) + "::OnRefill", .@units[.@i]); } initnpctimer(); end; OnRemoveDup: deltimer(strnpcinfo(NPC_NAME) + "::OnRefill"); stopnpctimer(); duplicateremove(strnpcinfo(NPC_NAME)); end; OnInit: .refillHP_rate = 15; // number of HP to give every refill .refillSP_rate = 5; // number of SP to give every refill .refill_distance = 3; // max distance from fire HP/SP regeneration will work .camp_fire_delay = 5; // Skip how many ticks before feel warm ;) .refill_timer = 300; // wait rand(X) ms before refil initnpctimer(); } function script F_CreateCFDup { .@nofire_distance = 5; // How far from other NPCs allowed to make fire. .@fire_duration = 60000; //180000; // 3 minutes (How long will the Camp fire last) .@curr_char_id = getarg(0); attachrid(.@curr_char_id); getmapxy(.@mapname$, .@mapx, .@mapy, UNITTYPE_PC); if(getmapxy(.@dupe_mapname$, .@dupe_mapx, .@dupe_mapy, UNITTYPE_NPC, sprintf("Camp Fire#CF_%d",.@curr_char_id)) == 0) { deltimer(sprintf("Camp Fire#CF_%d::OnRemoveDup", .@curr_char_id)); duplicateremove(sprintf("Camp Fire#CF_%d", .@curr_char_id)); } if(getunits(BL_NPC, .@units[0], false, .@mapname$, (.@mapx - .@nofire_distance),(.@mapy - .@nofire_distance), (.@mapx + .@nofire_distance), (.@mapy + .@nofire_distance)) > 0) { dispbottom("A fire cannot be started here."); } else { soundeffect ("strike-matchstick.wav",0); duplicatenpc("Camp Fire#CF", "Camp Fire", sprintf("CF_%d", .@curr_char_id), .@mapname$, .@mapx, .@mapy, 0); addtimer(.@fire_duration, sprintf("Camp Fire#CF_%d::OnRemoveDup", .@curr_char_id)); } return(); }  
    Here is in the 
    intem_db.conf
     
    { Id: 7035 AegisName: "Matchstick" Name: "Matchstick" Type: 2 Buy: 100 Weight: 10 BuyingStore: true Delay: 15000 Script: <" callfunc("F_CreateCFDup", getcharid(CHAR_ID_CHAR)); "> },  
    There is still some work to be done.
     
  6. Upvote
    Habilis reacted to Emistry in Campfire to regenerate HP/SP   
    Hi Habilis, this is my attempts..
    https://pastebin.com/fksPdpFQ

    Feel free to comment
    -- EDIT
    Updated the campfire:
    - slowly decrease the effectiveness of healing rate and area range every 10 seconds.
    - may use item like wooden block, tree root, to prolong the campfire duration, or increase healing rate and area range too.
    v1.1

     
     
  7. Like
    Habilis got a reaction from jholphoda in [NPC] Campfire to regenerate HP/SP   
    View File [NPC] Campfire to regenerate HP/SP
    Originally:
    There is a nice contribution from meko on that subject,
    Menhir (Big rock that possesses magical powers and able to restore Health and Energy of Seekers resting/meditating nearby)
    Thanks, meko!
    But, I thought to myself, well, that is wonderful, but why not make it portable?
    The Idea:
    An element of role play, a way to add functionality 
    to the item 7035 - Matchstick, To light a Campfire.
    A Campfire is a portable temporary regeneration NPC.
    OW, and it is configurable ;).

    Campfire to restore / regenerate HP & SP.
    When you sit by the Campfire, you start feeling the warmth and the comfort, thus your HP & SP begin to regenerate.
     
    Mechanics : 

    A phosphorus tipped stick that can be used to start a fire. (Now Indeed )
    When you use the item Matchstick in your inventory, it will spawn a duplicate of the NPC called Campfire.
    This will help you when you are in the field, farming, grinding, starting a Campfire will help you rest.

    - You need to sit close to the Campfire (3 cells ) to feel the warmth.
    - Anyone can sit by your Campfire and rest.
    - Campfire lasts 2-3 minutes.
    - Need to sit for at least some time to begin feeling the warmth and comfort.
    - you cannot start a fire within 5 cells of another NPC
    - If you use a match one more time, old Campfire disappears and a new one appears.
     
    I think it will add an element of roleplay and romanticism to the gameplay.
     
     
    Installation : 
    To be able to use this script you need a plugin npc-duplicate.c
    https://github.com/dastgirp/HPM-Plugins/blob/master/src/plugins/npc-duplicate.c
    Install & enable this plugin This script uses a relatively new NPC sprite at the moment of writing this release.
    4_BONFIRE
    Therefore, you may have to edit the Hercules source to allow for this new NPC
    To the /db/constants.conf
    add this line: 4_BONFIRE: 10252 In the /src/map/npc.h
    change this line: #define MAX_NPC_CLASS2_END 10800 This will allow for way more NPCs
    Save and recompile Hercules. In the client, you may not have this NPC
    But luckily for you, I've included with this release a data.zip archive containing the NPC sprite
    and the sound of striking a matchstick.
    Just add it to your GRF or data folder if you use data folder. In the client, Lua Files make sure you have this NPC sprite

    LuaFiles514/Lua Files/Datainfo/NPCIdentity.lub JT_4_BONFIRE = 10252,
    LuaFiles514/Lua Files/Datainfo/jobName.lub
      [jobtbl.JT_4_BONFIRE] = "4_bonfire", In the /db/re/item_db.conf or /db/pre-re/item_db.conf
    find Id: 7035
    and add these 3 attributes Type: 2 Delay: 3000 Script: <" callfunc("F_CreateCFDup"); ">  
    Configuration: 
    It is a configurable script
    All of the parameters are explicitly commented for a better understanding of the rules
    .refillHP_rate = 15; // number of HP to give every refill .refillSP_rate = 5; // number of SP to give every refill .refill_distance = 3; // max distance from fire HP/SP regeneration will work .camp_fire_delay = 5; // Skip how many ticks before feel warm ;) .refill_timer = 300; // wait rand(X) ms before refil Feel free to adjust to your server needs
    .@nofire_distance = 5; // How far from other NPCs allowed to make fire. .@fire_duration = 1000 * 60 * 3;// 3 minutes (How long will the Campfire last, in ms)  
    Submitter Habilis Submitted 06/22/18 Category Utility  
  8. Like
    Habilis got a reaction from ajoope in [NPC] Campfire to regenerate HP/SP   
    View File [NPC] Campfire to regenerate HP/SP
    Originally:
    There is a nice contribution from meko on that subject,
    Menhir (Big rock that possesses magical powers and able to restore Health and Energy of Seekers resting/meditating nearby)
    Thanks, meko!
    But, I thought to myself, well, that is wonderful, but why not make it portable?
    The Idea:
    An element of role play, a way to add functionality 
    to the item 7035 - Matchstick, To light a Campfire.
    A Campfire is a portable temporary regeneration NPC.
    OW, and it is configurable ;).

    Campfire to restore / regenerate HP & SP.
    When you sit by the Campfire, you start feeling the warmth and the comfort, thus your HP & SP begin to regenerate.
     
    Mechanics : 

    A phosphorus tipped stick that can be used to start a fire. (Now Indeed )
    When you use the item Matchstick in your inventory, it will spawn a duplicate of the NPC called Campfire.
    This will help you when you are in the field, farming, grinding, starting a Campfire will help you rest.

    - You need to sit close to the Campfire (3 cells ) to feel the warmth.
    - Anyone can sit by your Campfire and rest.
    - Campfire lasts 2-3 minutes.
    - Need to sit for at least some time to begin feeling the warmth and comfort.
    - you cannot start a fire within 5 cells of another NPC
    - If you use a match one more time, old Campfire disappears and a new one appears.
     
    I think it will add an element of roleplay and romanticism to the gameplay.
     
     
    Installation : 
    To be able to use this script you need a plugin npc-duplicate.c
    https://github.com/dastgirp/HPM-Plugins/blob/master/src/plugins/npc-duplicate.c
    Install & enable this plugin This script uses a relatively new NPC sprite at the moment of writing this release.
    4_BONFIRE
    Therefore, you may have to edit the Hercules source to allow for this new NPC
    To the /db/constants.conf
    add this line: 4_BONFIRE: 10252 In the /src/map/npc.h
    change this line: #define MAX_NPC_CLASS2_END 10800 This will allow for way more NPCs
    Save and recompile Hercules. In the client, you may not have this NPC
    But luckily for you, I've included with this release a data.zip archive containing the NPC sprite
    and the sound of striking a matchstick.
    Just add it to your GRF or data folder if you use data folder. In the client, Lua Files make sure you have this NPC sprite

    LuaFiles514/Lua Files/Datainfo/NPCIdentity.lub JT_4_BONFIRE = 10252,
    LuaFiles514/Lua Files/Datainfo/jobName.lub
      [jobtbl.JT_4_BONFIRE] = "4_bonfire", In the /db/re/item_db.conf or /db/pre-re/item_db.conf
    find Id: 7035
    and add these 3 attributes Type: 2 Delay: 3000 Script: <" callfunc("F_CreateCFDup"); ">  
    Configuration: 
    It is a configurable script
    All of the parameters are explicitly commented for a better understanding of the rules
    .refillHP_rate = 15; // number of HP to give every refill .refillSP_rate = 5; // number of SP to give every refill .refill_distance = 3; // max distance from fire HP/SP regeneration will work .camp_fire_delay = 5; // Skip how many ticks before feel warm ;) .refill_timer = 300; // wait rand(X) ms before refil Feel free to adjust to your server needs
    .@nofire_distance = 5; // How far from other NPCs allowed to make fire. .@fire_duration = 1000 * 60 * 3;// 3 minutes (How long will the Campfire last, in ms)  
    Submitter Habilis Submitted 06/22/18 Category Utility  
  9. Upvote
    Habilis got a reaction from jholphoda in Campfire to regenerate HP/SP   
    Yesterday, after rambles on Discord with Dastgir and Asheraf,
    I've got another Brilliant Idea for a Release from Habilis!
     
    The Idea:
    Camp Fire to restore / regenerate HP & SP.
    When you sit by the Camp fire, you start feeling the warmth and the comfort, so your HP & SP begin to regenerate.

     
     
    There is a nice contribution from Meko on that subject 
    Menhir (Big rock that possesses magical powers and able to restore Health and Energy of Seekers)
    Thanks Meko!
    So, I thought to myself, well, that is wonderful, but why not make it portable?
     
    Because, conveniently, there is this NPC sprite :

    4_BONFIRE
    ID: 10252 (0x280C)
     
    Even more conveniently, there is this item:
     Matchstick    Item ID# 7035 (Matchstick)

    A phosphorus tipped stick that can be used to start a fire.
    http://ratemyserver.net/index.php?page=item_db&item_id=7035
     
    Dastgir, suggested using this plugin to make this possible:
    https://github.com/dastgirp/HPM-Plugins/blob/master/src/plugins/npc-duplicate.c
     
     
    Mechanics : 
    When you use the item   Matchstick   in your inventory, it will spawn a duplicate of the NPC called Camp Fire.
    So that when you are in the field, farming, grinding you could rest.

    - You need to sit close to the Camp Fire  (3 cells ) to feel the warmth.
    - Anyone can sit by your Camp Fire and rest.
    - Camp Fire lasts 2-3 minutes.
    - Need to sit for at least 3 seconds to begin feeling the warmth and comfort.
    - you cannot start a fire within 5 cells of another Camp Fire.
    - If you use a match one more time, old Camp Fire disappears and a new one appears.
     
    I think it will add an element of roleplay and romanticism to the gameplay.
    (Habilis is a soft, sensitive and romantic type ).
     
    Expect the Release sometime soon...
     
     
     
     
     
     
  10. Upvote
    Habilis got a reaction from nana in Campfire to regenerate HP/SP   
    The animated fire is a relatively new NPC sprite.
    I've had a little sprite problem. I will add all the instructions on how to add this sprite if you don't have it
    (Basically instructions how to add a custom NPC, server side & client side)

     
    Note that it says in the chat, 
    You are feeling warm and cozy.
     
     
  11. Upvote
    Habilis got a reaction from KirieZ in Campfire to regenerate HP/SP   
    Yesterday, after rambles on Discord with Dastgir and Asheraf,
    I've got another Brilliant Idea for a Release from Habilis!
     
    The Idea:
    Camp Fire to restore / regenerate HP & SP.
    When you sit by the Camp fire, you start feeling the warmth and the comfort, so your HP & SP begin to regenerate.

     
     
    There is a nice contribution from Meko on that subject 
    Menhir (Big rock that possesses magical powers and able to restore Health and Energy of Seekers)
    Thanks Meko!
    So, I thought to myself, well, that is wonderful, but why not make it portable?
     
    Because, conveniently, there is this NPC sprite :

    4_BONFIRE
    ID: 10252 (0x280C)
     
    Even more conveniently, there is this item:
     Matchstick    Item ID# 7035 (Matchstick)

    A phosphorus tipped stick that can be used to start a fire.
    http://ratemyserver.net/index.php?page=item_db&item_id=7035
     
    Dastgir, suggested using this plugin to make this possible:
    https://github.com/dastgirp/HPM-Plugins/blob/master/src/plugins/npc-duplicate.c
     
     
    Mechanics : 
    When you use the item   Matchstick   in your inventory, it will spawn a duplicate of the NPC called Camp Fire.
    So that when you are in the field, farming, grinding you could rest.

    - You need to sit close to the Camp Fire  (3 cells ) to feel the warmth.
    - Anyone can sit by your Camp Fire and rest.
    - Camp Fire lasts 2-3 minutes.
    - Need to sit for at least 3 seconds to begin feeling the warmth and comfort.
    - you cannot start a fire within 5 cells of another Camp Fire.
    - If you use a match one more time, old Camp Fire disappears and a new one appears.
     
    I think it will add an element of roleplay and romanticism to the gameplay.
    (Habilis is a soft, sensitive and romantic type ).
     
    Expect the Release sometime soon...
     
     
     
     
     
     
  12. Upvote
    Habilis got a reaction from luizragna in Campfire to regenerate HP/SP   
    Yesterday, after rambles on Discord with Dastgir and Asheraf,
    I've got another Brilliant Idea for a Release from Habilis!
     
    The Idea:
    Camp Fire to restore / regenerate HP & SP.
    When you sit by the Camp fire, you start feeling the warmth and the comfort, so your HP & SP begin to regenerate.

     
     
    There is a nice contribution from Meko on that subject 
    Menhir (Big rock that possesses magical powers and able to restore Health and Energy of Seekers)
    Thanks Meko!
    So, I thought to myself, well, that is wonderful, but why not make it portable?
     
    Because, conveniently, there is this NPC sprite :

    4_BONFIRE
    ID: 10252 (0x280C)
     
    Even more conveniently, there is this item:
     Matchstick    Item ID# 7035 (Matchstick)

    A phosphorus tipped stick that can be used to start a fire.
    http://ratemyserver.net/index.php?page=item_db&item_id=7035
     
    Dastgir, suggested using this plugin to make this possible:
    https://github.com/dastgirp/HPM-Plugins/blob/master/src/plugins/npc-duplicate.c
     
     
    Mechanics : 
    When you use the item   Matchstick   in your inventory, it will spawn a duplicate of the NPC called Camp Fire.
    So that when you are in the field, farming, grinding you could rest.

    - You need to sit close to the Camp Fire  (3 cells ) to feel the warmth.
    - Anyone can sit by your Camp Fire and rest.
    - Camp Fire lasts 2-3 minutes.
    - Need to sit for at least 3 seconds to begin feeling the warmth and comfort.
    - you cannot start a fire within 5 cells of another Camp Fire.
    - If you use a match one more time, old Camp Fire disappears and a new one appears.
     
    I think it will add an element of roleplay and romanticism to the gameplay.
    (Habilis is a soft, sensitive and romantic type ).
     
    Expect the Release sometime soon...
     
     
     
     
     
     
  13. Upvote
    Habilis got a reaction from Begin in [Event] Wheel of fortune   
    View File [Event] Wheel of fortune
    Wheel of fortune
    Fun event, this particular version is set to accept Zeny as a payment for gambling.
     
    Would like to thank a lot @Myriad for Improving my code!
     
    Package contains:
    data.zip data folder to put into your GRF file or straight into data folder.
    wheel_of_fortune.txt the script itself.
    WheelOfFortune.psd the Photoshop source file, you can edit the prizes pictures if you like. 
     
    This event can be configured to run automatically 
    OnClock0800: OnClock1200: OnClock1600: OnClock2000: OnClock2200: just change this part of the script,
    at what time you want the script to run.
     
    Or, a GM can start this event by running this command :
     
    @wheel_of_fortune start
     
    As a reference,
    This is a version of the script using event points as a payment (in case you would like to take a look)
    https://pastebin.com/wN6ZjxM0
     
    Submitter Habilis Submitted 06/14/18 Category Events & Games  
  14. Upvote
    Habilis got a reaction from grimmm in [Event] Wheel of fortune   
    View File [Event] Wheel of fortune
    Wheel of fortune
    Fun event, this particular version is set to accept Zeny as a payment for gambling.
     
    Would like to thank a lot @Myriad for Improving my code!
     
    Package contains:
    data.zip data folder to put into your GRF file or straight into data folder.
    wheel_of_fortune.txt the script itself.
    WheelOfFortune.psd the Photoshop source file, you can edit the prizes pictures if you like. 
     
    This event can be configured to run automatically 
    OnClock0800: OnClock1200: OnClock1600: OnClock2000: OnClock2200: just change this part of the script,
    at what time you want the script to run.
     
    Or, a GM can start this event by running this command :
     
    @wheel_of_fortune start
     
    As a reference,
    This is a version of the script using event points as a payment (in case you would like to take a look)
    https://pastebin.com/wN6ZjxM0
     
    Submitter Habilis Submitted 06/14/18 Category Events & Games  
  15. Upvote
    Habilis got a reaction from Maple in [Event] Wheel of fortune   
    View File [Event] Wheel of fortune
    Wheel of fortune
    Fun event, this particular version is set to accept Zeny as a payment for gambling.
     
    Would like to thank a lot @Myriad for Improving my code!
     
    Package contains:
    data.zip data folder to put into your GRF file or straight into data folder.
    wheel_of_fortune.txt the script itself.
    WheelOfFortune.psd the Photoshop source file, you can edit the prizes pictures if you like. 
     
    This event can be configured to run automatically 
    OnClock0800: OnClock1200: OnClock1600: OnClock2000: OnClock2200: just change this part of the script,
    at what time you want the script to run.
     
    Or, a GM can start this event by running this command :
     
    @wheel_of_fortune start
     
    As a reference,
    This is a version of the script using event points as a payment (in case you would like to take a look)
    https://pastebin.com/wN6ZjxM0
     
    Submitter Habilis Submitted 06/14/18 Category Events & Games  
  16. Like
    Habilis got a reaction from IndieRO in [AutoEvent] Trivia   
    Hello, as promised here is a Trivia auto event.
    This script is originally way back from eA, it was adjusted on rA. (All credits in the header)
    And now, I decided to Enhance it.

    - An enhanced version of facts auto event. The Event is announced. The NPC asks 10 random 
    - questions from a question bank. Players have to write the answer to the main chat.
    - Players don't need to worry about CAPITAL letters.
    - 1) Question is asked by the NPC.

    - 2) If there is no answer after 15 seconds NPC will give a hint.

    - 3) IF there is still no answer after a hint, the question is skipped.

    - 4) If the right answer is given, the player is announced and the reward is given

     
    Side notes:
    1) Control
    If you have some kind of AutoEbent Controller, I've included the event control methods
    OnEventStart:
    OnStop:
    OnEventTimeOut:
     
    If you don't have a controller and just want to test this event, just setup the timers, when this event will run ex:
    OnMinute33:
     
    2) Rewards
    I have special Event points, that I'm giving to the winners.
    If you like to give Items or Zeny, I Included the examples in the code
    // Winner gets reward in Zeny //Zeny += 1000000; // Alotta bax ;)  
    3) Questions definition
    To define more questions you need to follow this pattern
    DefineQuestion("<question>", "<answer>", "<hint>");  
    4) Cheating
    I'm aware that this event can be cheated/Automated by players.
    Therefore only a modest reward is given 
     


  17. Upvote
    Habilis got a reaction from Quazi in [Event] Wheel of fortune   
    I've recently got a brilliant idea.
    Why not make my own version of a paid script, sold on rAthena
    and release it to Hercules for free!?

    (Not because I'm banned on rAthena )
     
    I need a peer review before releasing the whole package.
     
    @Myriad Did a nice Peer review of my terribel kode...
    If anyone else would like to contribute, feel free.
    Otherwise, it is soon to be released
     
     
    UPD : I reDrew the cutins, they don't look like stolen from rAthena

     

     
     
     
    1) configuration
    there are 2 arrays
        setarray .prize_id[1],-1,31024,31026,31008,31020,31017,31010,31016,0,31009;
        setarray .prize_qty[1],2,1,1,1,3,3,1,3,0,3;
     
    in prize_id
    if id is > 0, the prize is an item
    if id = 0 , the prize is NOTHING!
    if id = -1, the prizer is free spin (number of free spins set in qty array)
    in array  .prize_qty you setup the quantity won
     
     
    //===== Hercules Script ====================================== //= Wheel of Fortune //===== By =================================================== //= Habilis //= Edited by Myriad //===== Description ========================================== //= Wheel of fortune something. //============================================================ - script Wheel_of_Fortune FAKE_NPC ,{ OnInit: disablenpc("Wheel of Fortune#Main"); disablenpc("Hussein#WOF"); .EventName$ = "[Wheel Of Fortune]"; end; OnMinute39: OnStart: query_sql("DELETE FROM `acc_reg_num_db` WHERE `key`='#freewheelfortunespin';"); announce(sprintf("%s : The event will begin in 1 minute, near the center of Prontera.", .EventName$), bc_blue | bc_all); initnpctimer(); end; OnTimer60000: // 1 min enablenpc("Wheel of Fortune#Main"); enablenpc("Hussein#WOF"); announce(sprintf("%s : Come to Prontera and test your luck, everyone got some free spins!", .EventName$), bc_blue | bc_all); end; OnTimer1800000: // 30 mins announce(sprintf("%s : One more minute, do your last spin!", .EventName$), bc_blue | bc_all); end; OnTimer1860000: // 31 mins OnStop: disablenpc("Wheel of Fortune#Main"); disablenpc("Hussein#WOF"); end; } prontera,159,178,3 script Hussein#WOF 1_M_MERCHANT,{ doevent("Wheel of Fortune#Main::OnTalk"); end; } prontera,155,176,3 script Wheel of Fortune#Main 2_SLOT_MACHINE,{ OnTalk: if (#freewheelfortunespin == 0) #freewheelfortunespin = .Free_Spins; if (getd(.Event_Points_Variable$) < .Points_Cost && #freewheelfortunespin < 0) { mesf("[^0055FF ::: %s ::: ^000000]", .EventName$); mes("You are out of points"); mes("and have no more free"); mes("spins! Come back next"); mes("time for more."); close(); } .@mes$ = (#freewheelfortunespin > 0) ? sprintf(", but you, my friend, have %d free spin%s!", #freewheelfortunespin, (#freewheelfortunespin == 1) ? "" : "s") : "."; cutin("aca_salim02", 2); addtimer(1, sprintf("%s::OnEnd", strnpcinfo(NPC_NAME))); mesf("[^0055FF ::: %s ::: ^000000]", .EventName$); mes("Do you want to spin the wheel?"); mesf("It costs ^FF0000%d Event points^000000 to play%s", .Points_Cost, .@mes$); next(); callsub(S_Loop); S_Loop: .@val = getd(.Event_Points_Variable$); if (.@val < .Points_Cost && #freewheelfortunespin < 0) callsub(S_End); switch (select( (#freewheelfortunespin > 0) ? sprintf("Yes! Use free spin! (%d left)", #freewheelfortunespin) : "", (.@val > 0) ? sprintf("Yes! Use Event Points. (%d remaining)", .@val) : "", "No (Leave)" )) { case 1: callsub(S_Pay, 0); case 2: callsub(S_Pay, 1); default: callsub(S_End); } S_Pay: switch (getarg(0)) { // pay with free spin case 0: if (#freewheelfortunespin > 0) { if ((#freewheelfortunespin -= 1) < 1) #freewheelfortunespin = -1; callsub(S_Gamble); } else callsub(S_End); // Pay with points case 1: default: if ((.@val = getd(.Event_Points_Variable$)) >= .Points_Cost) { setd(.Event_Points_Variable$, (.@val -= .Points_Cost)); dispbottom(sprintf("%s : You now have %d event points.", .ServerName$, .@val)); callsub(S_Gamble); } else { cutin("aca_salim02", 2); mesf("[^0055FF ::: %s ::: ^000000]", .EventName$); mes("Awww, you don't have enough to gamble..."); mes(" "); mes("Have you ever heard?"); mes("'Money isn't all that matters' Got it?"); mes("Byeeeeeeeeeeeeee ;)"); callsub(S_End); } } S_Gamble: // Actual Gambling .@sector = rand(.Sector[0], .Sector[1]); .@displayCutin = (.@sector * 2) - 1; .@Speed = .Spin_Speed; for (.@i = 0; .@i < .nbTurns; .@i++) { .@b = .Cutin[0]; while (.@b <= .Cutin[1]) { cutin(sprintf("%s%d", .cutin$, .@b), 4); sleep2(.@Speed); .@b++; .@Speed++; } } .@b = .Cutin[0]; while (.@b < .@displayCutin) { cutin(sprintf("%s%d", .cutin$, .@b), 4); sleep2(.@Speed); .@b++; } cutin(sprintf("%s%d", .cutin$, .@b), 4); if (.prize_id[.@sector] == -1) { // Free spin if (.Sound_Effects) soundeffect("wheel_jackpot.wav", 0); announce(sprintf("[%s] : Wow, %d more Free spins!!!", .EventName$, .prize_qty[.@sector]), bc_blue | bc_self); #freewheelfortunespin = #freewheelfortunespin == -1 ? .prize_qty[.@sector] : #freewheelfortunespin + .prize_qty[.@sector]; } else if (.prize_id[.@sector] == 0) { // nothing if (.Sound_Effects) soundeffect("wheel_lost.wav", 0); announce(sprintf("[%s] : Awwww, No luck in gamble, more luck in love...", .EventName$), bc_blue | bc_self); } else { // item if (.Sound_Effects) soundeffect("wheel_won.wav", 0); announce(sprintf("[%s] : Enjoy your prize!!!", .EventName$), bc_blue | bc_self); getitem(.prize_id[.@sector], .prize_qty[.@sector]); } sleep2(1000); callsub(S_Loop); end; S_End: close2(); OnEnd: cutin("", 255); end; OnInit: .ServerName$ = "[Your boring server]"; .EventName$ = "Wheel Of Fortune"; .cutin$ = "WheelOfFortune_"; .Event_Points_Variable$ = "#LROEVENTPOINTS"; // The name of your event points variable setarray(.Sector, 1, 10); // Sector range setarray(.Cutin, 0, 19); // Cutin range .Spin_Speed = 50; // What is the base spin speed? (ms) .nbTurns = 2; .Points_Cost = 100; // How many 'points' does it cost for a spin? .Free_Spins = 1; // How many free spins does a player get? .Sound_Effects = true; // Enable sound effects? (true/false) setarray(.prize_id[1], -1, 31024, 31026, 31008, 31020, 31017, 31010, 31016, 0, 31009); setarray(.prize_qty[1], 2, 1, 1, 1, 3, 3, 1, 3, 0, 3); end; }  
  18. Upvote
    Habilis got a reaction from noobzter003 in [Event] Wheel of fortune   
    I've recently got a brilliant idea.
    Why not make my own version of a paid script, sold on rAthena
    and release it to Hercules for free!?

    (Not because I'm banned on rAthena )
     
    I need a peer review before releasing the whole package.
     
    @Myriad Did a nice Peer review of my terribel kode...
    If anyone else would like to contribute, feel free.
    Otherwise, it is soon to be released
     
     
    UPD : I reDrew the cutins, they don't look like stolen from rAthena

     

     
     
     
    1) configuration
    there are 2 arrays
        setarray .prize_id[1],-1,31024,31026,31008,31020,31017,31010,31016,0,31009;
        setarray .prize_qty[1],2,1,1,1,3,3,1,3,0,3;
     
    in prize_id
    if id is > 0, the prize is an item
    if id = 0 , the prize is NOTHING!
    if id = -1, the prizer is free spin (number of free spins set in qty array)
    in array  .prize_qty you setup the quantity won
     
     
    //===== Hercules Script ====================================== //= Wheel of Fortune //===== By =================================================== //= Habilis //= Edited by Myriad //===== Description ========================================== //= Wheel of fortune something. //============================================================ - script Wheel_of_Fortune FAKE_NPC ,{ OnInit: disablenpc("Wheel of Fortune#Main"); disablenpc("Hussein#WOF"); .EventName$ = "[Wheel Of Fortune]"; end; OnMinute39: OnStart: query_sql("DELETE FROM `acc_reg_num_db` WHERE `key`='#freewheelfortunespin';"); announce(sprintf("%s : The event will begin in 1 minute, near the center of Prontera.", .EventName$), bc_blue | bc_all); initnpctimer(); end; OnTimer60000: // 1 min enablenpc("Wheel of Fortune#Main"); enablenpc("Hussein#WOF"); announce(sprintf("%s : Come to Prontera and test your luck, everyone got some free spins!", .EventName$), bc_blue | bc_all); end; OnTimer1800000: // 30 mins announce(sprintf("%s : One more minute, do your last spin!", .EventName$), bc_blue | bc_all); end; OnTimer1860000: // 31 mins OnStop: disablenpc("Wheel of Fortune#Main"); disablenpc("Hussein#WOF"); end; } prontera,159,178,3 script Hussein#WOF 1_M_MERCHANT,{ doevent("Wheel of Fortune#Main::OnTalk"); end; } prontera,155,176,3 script Wheel of Fortune#Main 2_SLOT_MACHINE,{ OnTalk: if (#freewheelfortunespin == 0) #freewheelfortunespin = .Free_Spins; if (getd(.Event_Points_Variable$) < .Points_Cost && #freewheelfortunespin < 0) { mesf("[^0055FF ::: %s ::: ^000000]", .EventName$); mes("You are out of points"); mes("and have no more free"); mes("spins! Come back next"); mes("time for more."); close(); } .@mes$ = (#freewheelfortunespin > 0) ? sprintf(", but you, my friend, have %d free spin%s!", #freewheelfortunespin, (#freewheelfortunespin == 1) ? "" : "s") : "."; cutin("aca_salim02", 2); addtimer(1, sprintf("%s::OnEnd", strnpcinfo(NPC_NAME))); mesf("[^0055FF ::: %s ::: ^000000]", .EventName$); mes("Do you want to spin the wheel?"); mesf("It costs ^FF0000%d Event points^000000 to play%s", .Points_Cost, .@mes$); next(); callsub(S_Loop); S_Loop: .@val = getd(.Event_Points_Variable$); if (.@val < .Points_Cost && #freewheelfortunespin < 0) callsub(S_End); switch (select( (#freewheelfortunespin > 0) ? sprintf("Yes! Use free spin! (%d left)", #freewheelfortunespin) : "", (.@val > 0) ? sprintf("Yes! Use Event Points. (%d remaining)", .@val) : "", "No (Leave)" )) { case 1: callsub(S_Pay, 0); case 2: callsub(S_Pay, 1); default: callsub(S_End); } S_Pay: switch (getarg(0)) { // pay with free spin case 0: if (#freewheelfortunespin > 0) { if ((#freewheelfortunespin -= 1) < 1) #freewheelfortunespin = -1; callsub(S_Gamble); } else callsub(S_End); // Pay with points case 1: default: if ((.@val = getd(.Event_Points_Variable$)) >= .Points_Cost) { setd(.Event_Points_Variable$, (.@val -= .Points_Cost)); dispbottom(sprintf("%s : You now have %d event points.", .ServerName$, .@val)); callsub(S_Gamble); } else { cutin("aca_salim02", 2); mesf("[^0055FF ::: %s ::: ^000000]", .EventName$); mes("Awww, you don't have enough to gamble..."); mes(" "); mes("Have you ever heard?"); mes("'Money isn't all that matters' Got it?"); mes("Byeeeeeeeeeeeeee ;)"); callsub(S_End); } } S_Gamble: // Actual Gambling .@sector = rand(.Sector[0], .Sector[1]); .@displayCutin = (.@sector * 2) - 1; .@Speed = .Spin_Speed; for (.@i = 0; .@i < .nbTurns; .@i++) { .@b = .Cutin[0]; while (.@b <= .Cutin[1]) { cutin(sprintf("%s%d", .cutin$, .@b), 4); sleep2(.@Speed); .@b++; .@Speed++; } } .@b = .Cutin[0]; while (.@b < .@displayCutin) { cutin(sprintf("%s%d", .cutin$, .@b), 4); sleep2(.@Speed); .@b++; } cutin(sprintf("%s%d", .cutin$, .@b), 4); if (.prize_id[.@sector] == -1) { // Free spin if (.Sound_Effects) soundeffect("wheel_jackpot.wav", 0); announce(sprintf("[%s] : Wow, %d more Free spins!!!", .EventName$, .prize_qty[.@sector]), bc_blue | bc_self); #freewheelfortunespin = #freewheelfortunespin == -1 ? .prize_qty[.@sector] : #freewheelfortunespin + .prize_qty[.@sector]; } else if (.prize_id[.@sector] == 0) { // nothing if (.Sound_Effects) soundeffect("wheel_lost.wav", 0); announce(sprintf("[%s] : Awwww, No luck in gamble, more luck in love...", .EventName$), bc_blue | bc_self); } else { // item if (.Sound_Effects) soundeffect("wheel_won.wav", 0); announce(sprintf("[%s] : Enjoy your prize!!!", .EventName$), bc_blue | bc_self); getitem(.prize_id[.@sector], .prize_qty[.@sector]); } sleep2(1000); callsub(S_Loop); end; S_End: close2(); OnEnd: cutin("", 255); end; OnInit: .ServerName$ = "[Your boring server]"; .EventName$ = "Wheel Of Fortune"; .cutin$ = "WheelOfFortune_"; .Event_Points_Variable$ = "#LROEVENTPOINTS"; // The name of your event points variable setarray(.Sector, 1, 10); // Sector range setarray(.Cutin, 0, 19); // Cutin range .Spin_Speed = 50; // What is the base spin speed? (ms) .nbTurns = 2; .Points_Cost = 100; // How many 'points' does it cost for a spin? .Free_Spins = 1; // How many free spins does a player get? .Sound_Effects = true; // Enable sound effects? (true/false) setarray(.prize_id[1], -1, 31024, 31026, 31008, 31020, 31017, 31010, 31016, 0, 31009); setarray(.prize_qty[1], 2, 1, 1, 1, 3, 3, 1, 3, 0, 3); end; }  
  19. Upvote
    Habilis got a reaction from Begin in [Event] Wheel of fortune   
    I've recently got a brilliant idea.
    Why not make my own version of a paid script, sold on rAthena
    and release it to Hercules for free!?

    (Not because I'm banned on rAthena )
     
    I need a peer review before releasing the whole package.
     
    @Myriad Did a nice Peer review of my terribel kode...
    If anyone else would like to contribute, feel free.
    Otherwise, it is soon to be released
     
     
    UPD : I reDrew the cutins, they don't look like stolen from rAthena

     

     
     
     
    1) configuration
    there are 2 arrays
        setarray .prize_id[1],-1,31024,31026,31008,31020,31017,31010,31016,0,31009;
        setarray .prize_qty[1],2,1,1,1,3,3,1,3,0,3;
     
    in prize_id
    if id is > 0, the prize is an item
    if id = 0 , the prize is NOTHING!
    if id = -1, the prizer is free spin (number of free spins set in qty array)
    in array  .prize_qty you setup the quantity won
     
     
    //===== Hercules Script ====================================== //= Wheel of Fortune //===== By =================================================== //= Habilis //= Edited by Myriad //===== Description ========================================== //= Wheel of fortune something. //============================================================ - script Wheel_of_Fortune FAKE_NPC ,{ OnInit: disablenpc("Wheel of Fortune#Main"); disablenpc("Hussein#WOF"); .EventName$ = "[Wheel Of Fortune]"; end; OnMinute39: OnStart: query_sql("DELETE FROM `acc_reg_num_db` WHERE `key`='#freewheelfortunespin';"); announce(sprintf("%s : The event will begin in 1 minute, near the center of Prontera.", .EventName$), bc_blue | bc_all); initnpctimer(); end; OnTimer60000: // 1 min enablenpc("Wheel of Fortune#Main"); enablenpc("Hussein#WOF"); announce(sprintf("%s : Come to Prontera and test your luck, everyone got some free spins!", .EventName$), bc_blue | bc_all); end; OnTimer1800000: // 30 mins announce(sprintf("%s : One more minute, do your last spin!", .EventName$), bc_blue | bc_all); end; OnTimer1860000: // 31 mins OnStop: disablenpc("Wheel of Fortune#Main"); disablenpc("Hussein#WOF"); end; } prontera,159,178,3 script Hussein#WOF 1_M_MERCHANT,{ doevent("Wheel of Fortune#Main::OnTalk"); end; } prontera,155,176,3 script Wheel of Fortune#Main 2_SLOT_MACHINE,{ OnTalk: if (#freewheelfortunespin == 0) #freewheelfortunespin = .Free_Spins; if (getd(.Event_Points_Variable$) < .Points_Cost && #freewheelfortunespin < 0) { mesf("[^0055FF ::: %s ::: ^000000]", .EventName$); mes("You are out of points"); mes("and have no more free"); mes("spins! Come back next"); mes("time for more."); close(); } .@mes$ = (#freewheelfortunespin > 0) ? sprintf(", but you, my friend, have %d free spin%s!", #freewheelfortunespin, (#freewheelfortunespin == 1) ? "" : "s") : "."; cutin("aca_salim02", 2); addtimer(1, sprintf("%s::OnEnd", strnpcinfo(NPC_NAME))); mesf("[^0055FF ::: %s ::: ^000000]", .EventName$); mes("Do you want to spin the wheel?"); mesf("It costs ^FF0000%d Event points^000000 to play%s", .Points_Cost, .@mes$); next(); callsub(S_Loop); S_Loop: .@val = getd(.Event_Points_Variable$); if (.@val < .Points_Cost && #freewheelfortunespin < 0) callsub(S_End); switch (select( (#freewheelfortunespin > 0) ? sprintf("Yes! Use free spin! (%d left)", #freewheelfortunespin) : "", (.@val > 0) ? sprintf("Yes! Use Event Points. (%d remaining)", .@val) : "", "No (Leave)" )) { case 1: callsub(S_Pay, 0); case 2: callsub(S_Pay, 1); default: callsub(S_End); } S_Pay: switch (getarg(0)) { // pay with free spin case 0: if (#freewheelfortunespin > 0) { if ((#freewheelfortunespin -= 1) < 1) #freewheelfortunespin = -1; callsub(S_Gamble); } else callsub(S_End); // Pay with points case 1: default: if ((.@val = getd(.Event_Points_Variable$)) >= .Points_Cost) { setd(.Event_Points_Variable$, (.@val -= .Points_Cost)); dispbottom(sprintf("%s : You now have %d event points.", .ServerName$, .@val)); callsub(S_Gamble); } else { cutin("aca_salim02", 2); mesf("[^0055FF ::: %s ::: ^000000]", .EventName$); mes("Awww, you don't have enough to gamble..."); mes(" "); mes("Have you ever heard?"); mes("'Money isn't all that matters' Got it?"); mes("Byeeeeeeeeeeeeee ;)"); callsub(S_End); } } S_Gamble: // Actual Gambling .@sector = rand(.Sector[0], .Sector[1]); .@displayCutin = (.@sector * 2) - 1; .@Speed = .Spin_Speed; for (.@i = 0; .@i < .nbTurns; .@i++) { .@b = .Cutin[0]; while (.@b <= .Cutin[1]) { cutin(sprintf("%s%d", .cutin$, .@b), 4); sleep2(.@Speed); .@b++; .@Speed++; } } .@b = .Cutin[0]; while (.@b < .@displayCutin) { cutin(sprintf("%s%d", .cutin$, .@b), 4); sleep2(.@Speed); .@b++; } cutin(sprintf("%s%d", .cutin$, .@b), 4); if (.prize_id[.@sector] == -1) { // Free spin if (.Sound_Effects) soundeffect("wheel_jackpot.wav", 0); announce(sprintf("[%s] : Wow, %d more Free spins!!!", .EventName$, .prize_qty[.@sector]), bc_blue | bc_self); #freewheelfortunespin = #freewheelfortunespin == -1 ? .prize_qty[.@sector] : #freewheelfortunespin + .prize_qty[.@sector]; } else if (.prize_id[.@sector] == 0) { // nothing if (.Sound_Effects) soundeffect("wheel_lost.wav", 0); announce(sprintf("[%s] : Awwww, No luck in gamble, more luck in love...", .EventName$), bc_blue | bc_self); } else { // item if (.Sound_Effects) soundeffect("wheel_won.wav", 0); announce(sprintf("[%s] : Enjoy your prize!!!", .EventName$), bc_blue | bc_self); getitem(.prize_id[.@sector], .prize_qty[.@sector]); } sleep2(1000); callsub(S_Loop); end; S_End: close2(); OnEnd: cutin("", 255); end; OnInit: .ServerName$ = "[Your boring server]"; .EventName$ = "Wheel Of Fortune"; .cutin$ = "WheelOfFortune_"; .Event_Points_Variable$ = "#LROEVENTPOINTS"; // The name of your event points variable setarray(.Sector, 1, 10); // Sector range setarray(.Cutin, 0, 19); // Cutin range .Spin_Speed = 50; // What is the base spin speed? (ms) .nbTurns = 2; .Points_Cost = 100; // How many 'points' does it cost for a spin? .Free_Spins = 1; // How many free spins does a player get? .Sound_Effects = true; // Enable sound effects? (true/false) setarray(.prize_id[1], -1, 31024, 31026, 31008, 31020, 31017, 31010, 31016, 0, 31009); setarray(.prize_qty[1], 2, 1, 1, 1, 3, 3, 1, 3, 0, 3); end; }  
  20. Upvote
    Habilis got a reaction from TheReturn in [Event] Wheel of fortune   
    I've recently got a brilliant idea.
    Why not make my own version of a paid script, sold on rAthena
    and release it to Hercules for free!?

    (Not because I'm banned on rAthena )
     
    I need a peer review before releasing the whole package.
     
    @Myriad Did a nice Peer review of my terribel kode...
    If anyone else would like to contribute, feel free.
    Otherwise, it is soon to be released
     
     
    UPD : I reDrew the cutins, they don't look like stolen from rAthena

     

     
     
     
    1) configuration
    there are 2 arrays
        setarray .prize_id[1],-1,31024,31026,31008,31020,31017,31010,31016,0,31009;
        setarray .prize_qty[1],2,1,1,1,3,3,1,3,0,3;
     
    in prize_id
    if id is > 0, the prize is an item
    if id = 0 , the prize is NOTHING!
    if id = -1, the prizer is free spin (number of free spins set in qty array)
    in array  .prize_qty you setup the quantity won
     
     
    //===== Hercules Script ====================================== //= Wheel of Fortune //===== By =================================================== //= Habilis //= Edited by Myriad //===== Description ========================================== //= Wheel of fortune something. //============================================================ - script Wheel_of_Fortune FAKE_NPC ,{ OnInit: disablenpc("Wheel of Fortune#Main"); disablenpc("Hussein#WOF"); .EventName$ = "[Wheel Of Fortune]"; end; OnMinute39: OnStart: query_sql("DELETE FROM `acc_reg_num_db` WHERE `key`='#freewheelfortunespin';"); announce(sprintf("%s : The event will begin in 1 minute, near the center of Prontera.", .EventName$), bc_blue | bc_all); initnpctimer(); end; OnTimer60000: // 1 min enablenpc("Wheel of Fortune#Main"); enablenpc("Hussein#WOF"); announce(sprintf("%s : Come to Prontera and test your luck, everyone got some free spins!", .EventName$), bc_blue | bc_all); end; OnTimer1800000: // 30 mins announce(sprintf("%s : One more minute, do your last spin!", .EventName$), bc_blue | bc_all); end; OnTimer1860000: // 31 mins OnStop: disablenpc("Wheel of Fortune#Main"); disablenpc("Hussein#WOF"); end; } prontera,159,178,3 script Hussein#WOF 1_M_MERCHANT,{ doevent("Wheel of Fortune#Main::OnTalk"); end; } prontera,155,176,3 script Wheel of Fortune#Main 2_SLOT_MACHINE,{ OnTalk: if (#freewheelfortunespin == 0) #freewheelfortunespin = .Free_Spins; if (getd(.Event_Points_Variable$) < .Points_Cost && #freewheelfortunespin < 0) { mesf("[^0055FF ::: %s ::: ^000000]", .EventName$); mes("You are out of points"); mes("and have no more free"); mes("spins! Come back next"); mes("time for more."); close(); } .@mes$ = (#freewheelfortunespin > 0) ? sprintf(", but you, my friend, have %d free spin%s!", #freewheelfortunespin, (#freewheelfortunespin == 1) ? "" : "s") : "."; cutin("aca_salim02", 2); addtimer(1, sprintf("%s::OnEnd", strnpcinfo(NPC_NAME))); mesf("[^0055FF ::: %s ::: ^000000]", .EventName$); mes("Do you want to spin the wheel?"); mesf("It costs ^FF0000%d Event points^000000 to play%s", .Points_Cost, .@mes$); next(); callsub(S_Loop); S_Loop: .@val = getd(.Event_Points_Variable$); if (.@val < .Points_Cost && #freewheelfortunespin < 0) callsub(S_End); switch (select( (#freewheelfortunespin > 0) ? sprintf("Yes! Use free spin! (%d left)", #freewheelfortunespin) : "", (.@val > 0) ? sprintf("Yes! Use Event Points. (%d remaining)", .@val) : "", "No (Leave)" )) { case 1: callsub(S_Pay, 0); case 2: callsub(S_Pay, 1); default: callsub(S_End); } S_Pay: switch (getarg(0)) { // pay with free spin case 0: if (#freewheelfortunespin > 0) { if ((#freewheelfortunespin -= 1) < 1) #freewheelfortunespin = -1; callsub(S_Gamble); } else callsub(S_End); // Pay with points case 1: default: if ((.@val = getd(.Event_Points_Variable$)) >= .Points_Cost) { setd(.Event_Points_Variable$, (.@val -= .Points_Cost)); dispbottom(sprintf("%s : You now have %d event points.", .ServerName$, .@val)); callsub(S_Gamble); } else { cutin("aca_salim02", 2); mesf("[^0055FF ::: %s ::: ^000000]", .EventName$); mes("Awww, you don't have enough to gamble..."); mes(" "); mes("Have you ever heard?"); mes("'Money isn't all that matters' Got it?"); mes("Byeeeeeeeeeeeeee ;)"); callsub(S_End); } } S_Gamble: // Actual Gambling .@sector = rand(.Sector[0], .Sector[1]); .@displayCutin = (.@sector * 2) - 1; .@Speed = .Spin_Speed; for (.@i = 0; .@i < .nbTurns; .@i++) { .@b = .Cutin[0]; while (.@b <= .Cutin[1]) { cutin(sprintf("%s%d", .cutin$, .@b), 4); sleep2(.@Speed); .@b++; .@Speed++; } } .@b = .Cutin[0]; while (.@b < .@displayCutin) { cutin(sprintf("%s%d", .cutin$, .@b), 4); sleep2(.@Speed); .@b++; } cutin(sprintf("%s%d", .cutin$, .@b), 4); if (.prize_id[.@sector] == -1) { // Free spin if (.Sound_Effects) soundeffect("wheel_jackpot.wav", 0); announce(sprintf("[%s] : Wow, %d more Free spins!!!", .EventName$, .prize_qty[.@sector]), bc_blue | bc_self); #freewheelfortunespin = #freewheelfortunespin == -1 ? .prize_qty[.@sector] : #freewheelfortunespin + .prize_qty[.@sector]; } else if (.prize_id[.@sector] == 0) { // nothing if (.Sound_Effects) soundeffect("wheel_lost.wav", 0); announce(sprintf("[%s] : Awwww, No luck in gamble, more luck in love...", .EventName$), bc_blue | bc_self); } else { // item if (.Sound_Effects) soundeffect("wheel_won.wav", 0); announce(sprintf("[%s] : Enjoy your prize!!!", .EventName$), bc_blue | bc_self); getitem(.prize_id[.@sector], .prize_qty[.@sector]); } sleep2(1000); callsub(S_Loop); end; S_End: close2(); OnEnd: cutin("", 255); end; OnInit: .ServerName$ = "[Your boring server]"; .EventName$ = "Wheel Of Fortune"; .cutin$ = "WheelOfFortune_"; .Event_Points_Variable$ = "#LROEVENTPOINTS"; // The name of your event points variable setarray(.Sector, 1, 10); // Sector range setarray(.Cutin, 0, 19); // Cutin range .Spin_Speed = 50; // What is the base spin speed? (ms) .nbTurns = 2; .Points_Cost = 100; // How many 'points' does it cost for a spin? .Free_Spins = 1; // How many free spins does a player get? .Sound_Effects = true; // Enable sound effects? (true/false) setarray(.prize_id[1], -1, 31024, 31026, 31008, 31020, 31017, 31010, 31016, 0, 31009); setarray(.prize_qty[1], 2, 1, 1, 1, 3, 3, 1, 3, 0, 3); end; }  
  21. Upvote
    Habilis got a reaction from Jezu in [Event] Wheel of fortune   
    I've recently got a brilliant idea.
    Why not make my own version of a paid script, sold on rAthena
    and release it to Hercules for free!?

    (Not because I'm banned on rAthena )
     
    I need a peer review before releasing the whole package.
     
    @Myriad Did a nice Peer review of my terribel kode...
    If anyone else would like to contribute, feel free.
    Otherwise, it is soon to be released
     
     
    UPD : I reDrew the cutins, they don't look like stolen from rAthena

     

     
     
     
    1) configuration
    there are 2 arrays
        setarray .prize_id[1],-1,31024,31026,31008,31020,31017,31010,31016,0,31009;
        setarray .prize_qty[1],2,1,1,1,3,3,1,3,0,3;
     
    in prize_id
    if id is > 0, the prize is an item
    if id = 0 , the prize is NOTHING!
    if id = -1, the prizer is free spin (number of free spins set in qty array)
    in array  .prize_qty you setup the quantity won
     
     
    //===== Hercules Script ====================================== //= Wheel of Fortune //===== By =================================================== //= Habilis //= Edited by Myriad //===== Description ========================================== //= Wheel of fortune something. //============================================================ - script Wheel_of_Fortune FAKE_NPC ,{ OnInit: disablenpc("Wheel of Fortune#Main"); disablenpc("Hussein#WOF"); .EventName$ = "[Wheel Of Fortune]"; end; OnMinute39: OnStart: query_sql("DELETE FROM `acc_reg_num_db` WHERE `key`='#freewheelfortunespin';"); announce(sprintf("%s : The event will begin in 1 minute, near the center of Prontera.", .EventName$), bc_blue | bc_all); initnpctimer(); end; OnTimer60000: // 1 min enablenpc("Wheel of Fortune#Main"); enablenpc("Hussein#WOF"); announce(sprintf("%s : Come to Prontera and test your luck, everyone got some free spins!", .EventName$), bc_blue | bc_all); end; OnTimer1800000: // 30 mins announce(sprintf("%s : One more minute, do your last spin!", .EventName$), bc_blue | bc_all); end; OnTimer1860000: // 31 mins OnStop: disablenpc("Wheel of Fortune#Main"); disablenpc("Hussein#WOF"); end; } prontera,159,178,3 script Hussein#WOF 1_M_MERCHANT,{ doevent("Wheel of Fortune#Main::OnTalk"); end; } prontera,155,176,3 script Wheel of Fortune#Main 2_SLOT_MACHINE,{ OnTalk: if (#freewheelfortunespin == 0) #freewheelfortunespin = .Free_Spins; if (getd(.Event_Points_Variable$) < .Points_Cost && #freewheelfortunespin < 0) { mesf("[^0055FF ::: %s ::: ^000000]", .EventName$); mes("You are out of points"); mes("and have no more free"); mes("spins! Come back next"); mes("time for more."); close(); } .@mes$ = (#freewheelfortunespin > 0) ? sprintf(", but you, my friend, have %d free spin%s!", #freewheelfortunespin, (#freewheelfortunespin == 1) ? "" : "s") : "."; cutin("aca_salim02", 2); addtimer(1, sprintf("%s::OnEnd", strnpcinfo(NPC_NAME))); mesf("[^0055FF ::: %s ::: ^000000]", .EventName$); mes("Do you want to spin the wheel?"); mesf("It costs ^FF0000%d Event points^000000 to play%s", .Points_Cost, .@mes$); next(); callsub(S_Loop); S_Loop: .@val = getd(.Event_Points_Variable$); if (.@val < .Points_Cost && #freewheelfortunespin < 0) callsub(S_End); switch (select( (#freewheelfortunespin > 0) ? sprintf("Yes! Use free spin! (%d left)", #freewheelfortunespin) : "", (.@val > 0) ? sprintf("Yes! Use Event Points. (%d remaining)", .@val) : "", "No (Leave)" )) { case 1: callsub(S_Pay, 0); case 2: callsub(S_Pay, 1); default: callsub(S_End); } S_Pay: switch (getarg(0)) { // pay with free spin case 0: if (#freewheelfortunespin > 0) { if ((#freewheelfortunespin -= 1) < 1) #freewheelfortunespin = -1; callsub(S_Gamble); } else callsub(S_End); // Pay with points case 1: default: if ((.@val = getd(.Event_Points_Variable$)) >= .Points_Cost) { setd(.Event_Points_Variable$, (.@val -= .Points_Cost)); dispbottom(sprintf("%s : You now have %d event points.", .ServerName$, .@val)); callsub(S_Gamble); } else { cutin("aca_salim02", 2); mesf("[^0055FF ::: %s ::: ^000000]", .EventName$); mes("Awww, you don't have enough to gamble..."); mes(" "); mes("Have you ever heard?"); mes("'Money isn't all that matters' Got it?"); mes("Byeeeeeeeeeeeeee ;)"); callsub(S_End); } } S_Gamble: // Actual Gambling .@sector = rand(.Sector[0], .Sector[1]); .@displayCutin = (.@sector * 2) - 1; .@Speed = .Spin_Speed; for (.@i = 0; .@i < .nbTurns; .@i++) { .@b = .Cutin[0]; while (.@b <= .Cutin[1]) { cutin(sprintf("%s%d", .cutin$, .@b), 4); sleep2(.@Speed); .@b++; .@Speed++; } } .@b = .Cutin[0]; while (.@b < .@displayCutin) { cutin(sprintf("%s%d", .cutin$, .@b), 4); sleep2(.@Speed); .@b++; } cutin(sprintf("%s%d", .cutin$, .@b), 4); if (.prize_id[.@sector] == -1) { // Free spin if (.Sound_Effects) soundeffect("wheel_jackpot.wav", 0); announce(sprintf("[%s] : Wow, %d more Free spins!!!", .EventName$, .prize_qty[.@sector]), bc_blue | bc_self); #freewheelfortunespin = #freewheelfortunespin == -1 ? .prize_qty[.@sector] : #freewheelfortunespin + .prize_qty[.@sector]; } else if (.prize_id[.@sector] == 0) { // nothing if (.Sound_Effects) soundeffect("wheel_lost.wav", 0); announce(sprintf("[%s] : Awwww, No luck in gamble, more luck in love...", .EventName$), bc_blue | bc_self); } else { // item if (.Sound_Effects) soundeffect("wheel_won.wav", 0); announce(sprintf("[%s] : Enjoy your prize!!!", .EventName$), bc_blue | bc_self); getitem(.prize_id[.@sector], .prize_qty[.@sector]); } sleep2(1000); callsub(S_Loop); end; S_End: close2(); OnEnd: cutin("", 255); end; OnInit: .ServerName$ = "[Your boring server]"; .EventName$ = "Wheel Of Fortune"; .cutin$ = "WheelOfFortune_"; .Event_Points_Variable$ = "#LROEVENTPOINTS"; // The name of your event points variable setarray(.Sector, 1, 10); // Sector range setarray(.Cutin, 0, 19); // Cutin range .Spin_Speed = 50; // What is the base spin speed? (ms) .nbTurns = 2; .Points_Cost = 100; // How many 'points' does it cost for a spin? .Free_Spins = 1; // How many free spins does a player get? .Sound_Effects = true; // Enable sound effects? (true/false) setarray(.prize_id[1], -1, 31024, 31026, 31008, 31020, 31017, 31010, 31016, 0, 31009); setarray(.prize_qty[1], 2, 1, 1, 1, 3, 3, 1, 3, 0, 3); end; }  
  22. Upvote
    Habilis got a reaction from Maple in [Event] Wheel of fortune   
    I've recently got a brilliant idea.
    Why not make my own version of a paid script, sold on rAthena
    and release it to Hercules for free!?

    (Not because I'm banned on rAthena )
     
    I need a peer review before releasing the whole package.
     
    @Myriad Did a nice Peer review of my terribel kode...
    If anyone else would like to contribute, feel free.
    Otherwise, it is soon to be released
     
     
    UPD : I reDrew the cutins, they don't look like stolen from rAthena

     

     
     
     
    1) configuration
    there are 2 arrays
        setarray .prize_id[1],-1,31024,31026,31008,31020,31017,31010,31016,0,31009;
        setarray .prize_qty[1],2,1,1,1,3,3,1,3,0,3;
     
    in prize_id
    if id is > 0, the prize is an item
    if id = 0 , the prize is NOTHING!
    if id = -1, the prizer is free spin (number of free spins set in qty array)
    in array  .prize_qty you setup the quantity won
     
     
    //===== Hercules Script ====================================== //= Wheel of Fortune //===== By =================================================== //= Habilis //= Edited by Myriad //===== Description ========================================== //= Wheel of fortune something. //============================================================ - script Wheel_of_Fortune FAKE_NPC ,{ OnInit: disablenpc("Wheel of Fortune#Main"); disablenpc("Hussein#WOF"); .EventName$ = "[Wheel Of Fortune]"; end; OnMinute39: OnStart: query_sql("DELETE FROM `acc_reg_num_db` WHERE `key`='#freewheelfortunespin';"); announce(sprintf("%s : The event will begin in 1 minute, near the center of Prontera.", .EventName$), bc_blue | bc_all); initnpctimer(); end; OnTimer60000: // 1 min enablenpc("Wheel of Fortune#Main"); enablenpc("Hussein#WOF"); announce(sprintf("%s : Come to Prontera and test your luck, everyone got some free spins!", .EventName$), bc_blue | bc_all); end; OnTimer1800000: // 30 mins announce(sprintf("%s : One more minute, do your last spin!", .EventName$), bc_blue | bc_all); end; OnTimer1860000: // 31 mins OnStop: disablenpc("Wheel of Fortune#Main"); disablenpc("Hussein#WOF"); end; } prontera,159,178,3 script Hussein#WOF 1_M_MERCHANT,{ doevent("Wheel of Fortune#Main::OnTalk"); end; } prontera,155,176,3 script Wheel of Fortune#Main 2_SLOT_MACHINE,{ OnTalk: if (#freewheelfortunespin == 0) #freewheelfortunespin = .Free_Spins; if (getd(.Event_Points_Variable$) < .Points_Cost && #freewheelfortunespin < 0) { mesf("[^0055FF ::: %s ::: ^000000]", .EventName$); mes("You are out of points"); mes("and have no more free"); mes("spins! Come back next"); mes("time for more."); close(); } .@mes$ = (#freewheelfortunespin > 0) ? sprintf(", but you, my friend, have %d free spin%s!", #freewheelfortunespin, (#freewheelfortunespin == 1) ? "" : "s") : "."; cutin("aca_salim02", 2); addtimer(1, sprintf("%s::OnEnd", strnpcinfo(NPC_NAME))); mesf("[^0055FF ::: %s ::: ^000000]", .EventName$); mes("Do you want to spin the wheel?"); mesf("It costs ^FF0000%d Event points^000000 to play%s", .Points_Cost, .@mes$); next(); callsub(S_Loop); S_Loop: .@val = getd(.Event_Points_Variable$); if (.@val < .Points_Cost && #freewheelfortunespin < 0) callsub(S_End); switch (select( (#freewheelfortunespin > 0) ? sprintf("Yes! Use free spin! (%d left)", #freewheelfortunespin) : "", (.@val > 0) ? sprintf("Yes! Use Event Points. (%d remaining)", .@val) : "", "No (Leave)" )) { case 1: callsub(S_Pay, 0); case 2: callsub(S_Pay, 1); default: callsub(S_End); } S_Pay: switch (getarg(0)) { // pay with free spin case 0: if (#freewheelfortunespin > 0) { if ((#freewheelfortunespin -= 1) < 1) #freewheelfortunespin = -1; callsub(S_Gamble); } else callsub(S_End); // Pay with points case 1: default: if ((.@val = getd(.Event_Points_Variable$)) >= .Points_Cost) { setd(.Event_Points_Variable$, (.@val -= .Points_Cost)); dispbottom(sprintf("%s : You now have %d event points.", .ServerName$, .@val)); callsub(S_Gamble); } else { cutin("aca_salim02", 2); mesf("[^0055FF ::: %s ::: ^000000]", .EventName$); mes("Awww, you don't have enough to gamble..."); mes(" "); mes("Have you ever heard?"); mes("'Money isn't all that matters' Got it?"); mes("Byeeeeeeeeeeeeee ;)"); callsub(S_End); } } S_Gamble: // Actual Gambling .@sector = rand(.Sector[0], .Sector[1]); .@displayCutin = (.@sector * 2) - 1; .@Speed = .Spin_Speed; for (.@i = 0; .@i < .nbTurns; .@i++) { .@b = .Cutin[0]; while (.@b <= .Cutin[1]) { cutin(sprintf("%s%d", .cutin$, .@b), 4); sleep2(.@Speed); .@b++; .@Speed++; } } .@b = .Cutin[0]; while (.@b < .@displayCutin) { cutin(sprintf("%s%d", .cutin$, .@b), 4); sleep2(.@Speed); .@b++; } cutin(sprintf("%s%d", .cutin$, .@b), 4); if (.prize_id[.@sector] == -1) { // Free spin if (.Sound_Effects) soundeffect("wheel_jackpot.wav", 0); announce(sprintf("[%s] : Wow, %d more Free spins!!!", .EventName$, .prize_qty[.@sector]), bc_blue | bc_self); #freewheelfortunespin = #freewheelfortunespin == -1 ? .prize_qty[.@sector] : #freewheelfortunespin + .prize_qty[.@sector]; } else if (.prize_id[.@sector] == 0) { // nothing if (.Sound_Effects) soundeffect("wheel_lost.wav", 0); announce(sprintf("[%s] : Awwww, No luck in gamble, more luck in love...", .EventName$), bc_blue | bc_self); } else { // item if (.Sound_Effects) soundeffect("wheel_won.wav", 0); announce(sprintf("[%s] : Enjoy your prize!!!", .EventName$), bc_blue | bc_self); getitem(.prize_id[.@sector], .prize_qty[.@sector]); } sleep2(1000); callsub(S_Loop); end; S_End: close2(); OnEnd: cutin("", 255); end; OnInit: .ServerName$ = "[Your boring server]"; .EventName$ = "Wheel Of Fortune"; .cutin$ = "WheelOfFortune_"; .Event_Points_Variable$ = "#LROEVENTPOINTS"; // The name of your event points variable setarray(.Sector, 1, 10); // Sector range setarray(.Cutin, 0, 19); // Cutin range .Spin_Speed = 50; // What is the base spin speed? (ms) .nbTurns = 2; .Points_Cost = 100; // How many 'points' does it cost for a spin? .Free_Spins = 1; // How many free spins does a player get? .Sound_Effects = true; // Enable sound effects? (true/false) setarray(.prize_id[1], -1, 31024, 31026, 31008, 31020, 31017, 31010, 31016, 0, 31009); setarray(.prize_qty[1], 2, 1, 1, 1, 3, 3, 1, 3, 0, 3); end; }  
  23. Upvote
    Habilis got a reaction from Begin in [AutoEvent] Trivia   
    Hello, as promised here is a Trivia auto event.
    This script is originally way back from eA, it was adjusted on rA. (All credits in the header)
    And now, I decided to Enhance it.

    - An enhanced version of facts auto event. The Event is announced. The NPC asks 10 random 
    - questions from a question bank. Players have to write the answer to the main chat.
    - Players don't need to worry about CAPITAL letters.
    - 1) Question is asked by the NPC.

    - 2) If there is no answer after 15 seconds NPC will give a hint.

    - 3) IF there is still no answer after a hint, the question is skipped.

    - 4) If the right answer is given, the player is announced and the reward is given

     
    Side notes:
    1) Control
    If you have some kind of AutoEbent Controller, I've included the event control methods
    OnEventStart:
    OnStop:
    OnEventTimeOut:
     
    If you don't have a controller and just want to test this event, just setup the timers, when this event will run ex:
    OnMinute33:
     
    2) Rewards
    I have special Event points, that I'm giving to the winners.
    If you like to give Items or Zeny, I Included the examples in the code
    // Winner gets reward in Zeny //Zeny += 1000000; // Alotta bax ;)  
    3) Questions definition
    To define more questions you need to follow this pattern
    DefineQuestion("<question>", "<answer>", "<hint>");  
    4) Cheating
    I'm aware that this event can be cheated/Automated by players.
    Therefore only a modest reward is given 
     


  24. Upvote
    Habilis got a reaction from AnnieRuru in [AutoEvent] Trivia   
    Thanks Annie,
    1 is not me, it is from way back ... eA days
    2 will be redone, I will follow Dastgir`s advice and use an array instead of bit manipulation
    (will make the script easier to understand for beginners)
     
     
    I Already coded it, need to test it
  25. Upvote
    Habilis reacted to AnnieRuru in [AutoEvent] Trivia   
    function GetQuestion { return getd(".question_" + (getarg(0) % 128) + "$[" + (getarg(0) / 128) + "]"); } function GetAnswer { return getd(".answer_" + (getarg(0) % 128) + "$[" + (getarg(0) / 128) + "]"); } function GetHint { return getd(".hint_" + (getarg(0) % 128) + "$[" + (getarg(0) / 128) + "]"); } I believe you made it opposite ?
    assuming that you are still using eathena, when script engine was still 128 elements
    it should be
    return getd(".question_" + (getarg(0) / 128) + "$[" + (getarg(0) % 128) + "]"); although there is no need to do like this anymore because our script engine no longer has such limitation
    2nd thing is ...
    L_loop: do set .@i, rand( .numQuestions ); // Randomly picks a fact. while( .Q_session & 1 << .@i && .Q_session && .count < .numQuestions ); set .Q_session, .Q_session | 1 << .@i;// max 32 questions rather than using a loop, can use shuffle algorithm
     
    EDIT: for below
     
×
×
  • Create New...

Important Information

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