Jump to content

[Share][GuIdE]MaKiNg ReCipEs-ItEmS + [JASS Function] (OTRS) Recipe Items


Recommended Posts

Posted

                            ALL CREDITS FOR THIS GOES TO : ORC_TAMER

 

recipetutorialdr5pp3.png

 

Here a basic script using structs and methods to combine items into 1.

 

Changelog:

Version: 2.0 (Added New Function Arguments and Optimized Coding)

Version: 1.0 (Fixed minor bug)

 

Jass:

 

//===========================================================================
//  OTRS (Orc_Tamer's Recipe System)
//  Recipe System that allows you to make recipe items for you easier.
//  Author: Orc_Tamer
//  Date: 01.December.2007
//
//  How to implement:
//  Requires JASS NewGen World Editor
//  Just copy this trigger to your map.
//===========================================================================
library RecipeFunction

struct RecipeItems
    integer item0_id  
    integer item1_id  
    integer item2_id 
    integer item3_id  
    integer item4_id
    integer item5_id
    integer item6_id
    integer item7_id
    unit u
    item item1 = null
    item item2 = null 
    item item3 = null 
    item item4 = null
    item item5 = null
    item item6 = null
    
    method CheckItems2 takes nothing returns nothing
        local integer this_id
        local integer i = 0 
        loop
        set this_id = GetItemTypeId(UnitItemInSlot(.u, i)) 
        if this_id == .item0_id then 
            set .item1 = UnitItemInSlot(.u, i) 
        elseif this_id == .item1_id then 
            set .item2 = UnitItemInSlot(.u, i) 
        endif
        set i = i + 1
        exitwhen i >= bj_MAX_INVENTORY
        endloop
        if .item1 != null and .item2 != null then 
            call RemoveItem(.item1)
            call RemoveItem(.item2) 
            call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Items\\AIem\\AIemTarget.mdl",.u,"overhead"))
            call UnitAddItemById(.u, .item2_id)
            set .item1 = null 
            set .item2 = null
            set .u = null
        endif
    endmethod
    
    method CheckItems3 takes nothing returns nothing
        local integer this_id 
        local integer i = 0 
        loop
        set this_id = GetItemTypeId(UnitItemInSlot(.u, i)) 
        if this_id == .item0_id then 
            set .item1 = UnitItemInSlot(.u, i)
        elseif this_id == .item1_id then 
            set .item2 = UnitItemInSlot(.u, i) 
        elseif this_id == .item2_id then 
            set .item3 = UnitItemInSlot(.u, i) 
        endif
        set i = i + 1 
        exitwhen i >= bj_MAX_INVENTORY 
        endloop
        if .item1 != null and .item2 != null and .item3 != null then
            call RemoveItem(.item1) 
            call RemoveItem(.item2)
            call RemoveItem(.item3) 
            call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Items\\AIem\\AIemTarget.mdl",.u,"overhead")) //adds a special effect
            call UnitAddItemById(.u, .item3_id)
            set .item1 = null 
            set .item2 = null 
            set .item3 = null 
            set .u = null
        endif
    endmethod
    
    method CheckItems4 takes nothing returns nothing
        local integer this_id 
        local integer i = 0
        loop
        set this_id = GetItemTypeId(UnitItemInSlot(.u, i))
        if this_id == .item0_id then 
            set .item1 = UnitItemInSlot(.u, i)
        elseif this_id == .item1_id then 
            set .item2 = UnitItemInSlot(.u, i)
        elseif this_id == .item2_id then 
            set .item3 = UnitItemInSlot(.u, i)
        elseif this_id == .item3_id then
            set .item4 = UnitItemInSlot(.u, i)
        endif
        set i = i + 1 
        exitwhen i >= bj_MAX_INVENTORY 
        endloop
        if .item1 != null and .item2 != null and .item3 != null and .item4 != null then 
            call RemoveItem(.item1) 
            call RemoveItem(.item2) 
            call RemoveItem(.item3)
            call RemoveItem(.item4)
            call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Items\\AIem\\AIemTarget.mdl",.u,"overhead")) 
            call UnitAddItemById(.u, .item4_id)
            set .item1 = null 
            set .item2 = null 
            set .item3 = null 
            set .item4 = null
            set .u = null 
        endif
    endmethod
    
    method CheckItems5 takes nothing returns nothing
        local integer this_id 
        local integer i = 0
        loop
        set this_id = GetItemTypeId(UnitItemInSlot(.u, i))
        if this_id == .item0_id then 
            set .item1 = UnitItemInSlot(.u, i)
        elseif this_id == .item1_id then 
            set .item2 = UnitItemInSlot(.u, i)
        elseif this_id == .item2_id then 
            set .item3 = UnitItemInSlot(.u, i)
        elseif this_id == .item3_id then
            set .item4 = UnitItemInSlot(.u, i)
        elseif this_id == .item4_id then
            set .item5 = UnitItemInSlot(.u, i)
        endif
        set i = i + 1 
        exitwhen i >= bj_MAX_INVENTORY 
        endloop
        if .item1 != null and .item2 != null and .item3 != null and .item4 != null and .item5 != null then 
            call RemoveItem(.item1) 
            call RemoveItem(.item2) 
            call RemoveItem(.item3)
            call RemoveItem(.item4)
            call RemoveItem(.item5)
            call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Items\\AIem\\AIemTarget.mdl",.u,"overhead")) 
            call UnitAddItemById(.u, .item5_id)
            set .item1 = null 
            set .item2 = null 
            set .item3 = null 
            set .item4 = null
            set .item5 = null
            set .u = null 
        endif
    endmethod
    
    method CheckItems6 takes nothing returns nothing
        local integer this_id 
        local integer i = 0
        loop
        set this_id = GetItemTypeId(UnitItemInSlot(.u, i))
        if this_id == .item0_id then 
            set .item1 = UnitItemInSlot(.u, i)
        elseif this_id == .item1_id then 
            set .item2 = UnitItemInSlot(.u, i)
        elseif this_id == .item2_id then 
            set .item3 = UnitItemInSlot(.u, i)
        elseif this_id == .item3_id then
            set .item4 = UnitItemInSlot(.u, i)
        elseif this_id == .item4_id then
            set .item5 = UnitItemInSlot(.u, i)
        elseif this_id == .item5_id then
            set .item6 = UnitItemInSlot(.u, i)
        endif
        set i = i + 1 
        exitwhen i >= bj_MAX_INVENTORY 
        endloop
        if .item1 != null and .item2 != null and .item3 != null and .item4 != null and .item5 != null and .item6 != null then 
            call RemoveItem(.item1) 
            call RemoveItem(.item2) 
            call RemoveItem(.item3)
            call RemoveItem(.item4)
            call RemoveItem(.item5)
            call RemoveItem(.item6)
            call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Items\\AIem\\AIemTarget.mdl",.u,"overhead")) 
            call UnitAddItemById(.u, .item6_id)
            set .item1 = null 
            set .item2 = null 
            set .item3 = null 
            set .item4 = null
            set .item5 = null
            set .item6 = null
            set .u = null 
        endif
    endmethod
endstruct

function Recipe2 takes unit hero, integer i1, integer i2, integer ni returns nothing
    local RecipeItems IS=RecipeItems.create() 
    set IS.item0_id = i1 
    set IS.item1_id = i2 
    set IS.item2_id = ni 
    set IS.u = hero 
    call IS.CheckItems2() 
    call IS.destroy() 
endfunction

function Recipe3 takes unit hero, integer i1, integer i2, integer i3, integer ni returns nothing
    local RecipeItems IS=RecipeItems.create()
    set IS.item0_id = i1 
    set IS.item1_id = i2 
    set IS.item2_id = i3 
    set IS.item3_id = ni 
    set IS.u = hero 
    call IS.CheckItems3() 
    call IS.destroy()
endfunction

function Recipe4 takes unit hero, integer i1, integer i2, integer i3, integer i4, integer ni returns nothing
    local RecipeItems IS=RecipeItems.create()
    set IS.item0_id = i1 
    set IS.item1_id = i2 
    set IS.item2_id = i3 
    set IS.item3_id = i4 
    set IS.item4_id = ni
    set IS.u = hero 
    call IS.CheckItems4() 
    call IS.destroy()
endfunction

function Recipe5 takes unit hero, integer i1, integer i2, integer i3, integer i4, integer i5, integer ni returns nothing
    local RecipeItems IS=RecipeItems.create()
    set IS.item0_id = i1 
    set IS.item1_id = i2 
    set IS.item2_id = i3 
    set IS.item3_id = i4
    set IS.item4_id = i5
    set IS.item5_id = ni
    set IS.u = hero 
    call IS.CheckItems5() 
    call IS.destroy()
endfunction

function Recipe6 takes unit hero, integer i1, integer i2, integer i3, integer i4, integer i5, integer i6, integer ni returns nothing
    local RecipeItems IS=RecipeItems.create()
    set IS.item0_id = i1 
    set IS.item1_id = i2 
    set IS.item2_id = i3 
    set IS.item3_id = i4
    set IS.item4_id = i5
    set IS.item5_id = i6
    set IS.item6_id = ni
    set IS.u = hero 
    call IS.CheckItems6() 
    call IS.destroy()
endfunction

endlibrary

 

 

This is an example you can use:

GUI:

 

RecipeGUI
    Events
        Unit - A unit Acquires an item
    Conditions
    Actions
        Custom script:   call Recipe2(GetTriggerUnit(),'rde1','rde2','rde3')
        Custom script:   call Recipe3(GetTriggerUnit(),'afac','spsh','ajen','bgst')
        Custom script:   call Recipe4(GetTriggerUnit(),'ratc','rat6','rat9','bspd','modt')
        Custom script:   call Recipe5(GetTriggerUnit(),'ofro','olig','oven','ocor','oslo','sor9')
        Custom script:   call Recipe6(GetTriggerUnit(),'pghe','pgma','pdiv','pomn','pres','pnvu','infs')

 

JASS:

function Trig_RecipeChecking_Actions takes nothing returns nothing
    call Recipe2(GetTriggerUnit(),'rde1','rde2','rde3')
    call Recipe3(GetTriggerUnit(),'afac','spsh','ajen','bgst')
    call Recipe4(GetTriggerUnit(),'ratc','rat6','rat9','bspd','modt')
    call Recipe5(GetTriggerUnit(),'ofro','olig','oven','ocor','oslo','sor9')
    call Recipe6(GetTriggerUnit(),'pghe','pgma','pdiv','pomn','pres','pnvu','infs')
endfunction

function InitTrig_RecipeJASS takes nothing returns nothing
    local trigger t = CreateTrigger()
    call TriggerRegisterAnyUnitEventBJ( t, EVENT_PLAYER_UNIT_PICKUP_ITEM )
    call TriggerAddAction( t, function Trig_RecipeChecking_Actions )
endfunction

 

 

EnJoY. cOmMeNtT pLLeAzEe :-)

Some DeMo MapS :)

Recipe System.w3x + Recipe System2.w3x

  • 3 weeks later...
  • 1 year later...
Guest
This topic is now closed to further replies.


  • Posts

    • This post originally appeared on MmoGah. As the global release of Aion 2 draws near, players are eagerly preparing to dive into this highly anticipated MMORPG. One of the most important decisions you’ll make is choosing the right class, as it will define your experience in both solo and group content. Aion 2 introduces eight distinct classes, each with unique gameplay mechanics, strengths, and roles. Whether you’re a seasoned veteran or a newcomer, understanding these classes is essential to finding the one that suits your preferred playstyle. This guide provides a comprehensive overview of all eight classes, tips for selecting your ideal role, and recommendations for different types of players. Aion 2’s class system offers a variety of options across tanks, damage dealers, healers, and hybrid supports. Here’s a quick breakdown of the roles: - Tank Classes: Templar - Physical DPS Classes: Gladiator, Assassin, Ranger - Magical DPS Classes: Sorcerer - Hybrid Classes: Spiritmaster, Chanter - Healer Class: Cleric Each class has been carefully designed to excel in specific scenarios, whether it’s PvP, PvE, solo leveling, or large-scale faction battles. Pro Tip: As you embark on your journey, remember that having Aion 2 Kinah can greatly enhance your experience, so consider acquiring it to make the most of your adventure.   Class Breakdown Templar – The Indomitable Tank The Templar is the quintessential tank, specializing in defense and crowd control. With high durability and reliable aggro management, this class is invaluable in group content and large-scale battles. Strengths: - Exceptional survivability  - Top-tier aggro control  - Disruption tools for PvP  Playstyle: Templars thrive on the frontlines, soaking up damage and protecting allies. They are perfect for players who enjoy leading the charge and maintaining battlefield control. Gladiator – The Melee Powerhouse The Gladiator strikes a balance between offense and defense, offering strong AoE damage and decent survivability. This class excels in fast-paced melee combat and open-world PvP. Strengths: - High AoE damage  - Lifesteal-style abilities for sustain  - Versatile in both PvE and PvP  Playstyle:  Gladiators are ideal for players who enjoy dynamic melee combat with a mix of durability and damage. Assassin – The Stealthy Burst Specialist Assassins are masters of stealth and mobility. Known for their high single-target burst damage, they dominate in duels and small-scale PvP encounters. Strengths: - Exceptional burst damage  - Stealth mechanics for ambushes  - High mobility for quick disengagement Playstyle: This class is perfect for players who prefer fast-paced, tactical gameplay with an emphasis on sneaky kills. Ranger – The Precision Archer Rangers excel at dealing consistent physical damage from a distance. With excellent crowd control abilities and strong kiting potential, they are a solid choice for both PvE and PvP. Strengths:  - Safe ranged damage  - Strong crowd control tools  - Great for solo play  Playstyle: Rangers suit players who enjoy staying at range, controlling enemies, and executing precise attacks. Sorcerer – The Magical Artillery Sorcerers are pure magic damage dealers with devastating AoE spells and crowd control abilities. They are capable of turning the tide of battle with their massive burst potential. Strengths: - Highest magical burst damage  - Excellent AoE capabilities  - Crowd control via slows and immobilizes  Playstyle: Sorcerers are perfect for players who enjoy dealing immense magical damage while controlling enemies from a distance. Spiritmaster – The Tactical Summoner The Spiritmaster brings strategic depth to combat by combining summons, debuffs, and utility spells. This class is highly versatile and excels in both solo and group settings. Strengths: - Elemental summons with unique abilities  - Strong debuffs for PvP dominance  - Great solo leveling potential  Playstyle: Spiritmasters are best suited for players who enjoy strategic gameplay and multitasking in battle. Cleric – The Essential Healer The Cleric is the backbone of any group, providing powerful healing, cleansing, and defensive buffs. This class is indispensable in dungeons and raids. Strengths: - Reliable direct and AoE healing  - Cleansing abilities to remove debuffs  - Vital for group survival  Playstyle: Clerics are ideal for players who take pride in supporting their team and ensuring everyone stays alive. Chanter – The Hybrid Support The Chanter blends melee combat with healing and party-wide buffs. This versatile class can fill multiple roles in a group, making it a valuable addition to any team. Strengths: - Strong party buffs  - Solid healing capabilities  - Decent melee damage Playstyle: Chanters are perfect for players who want to contribute both offensively and defensively while supporting their team.   Choosing the Right Class What’s Your Playstyle? To help narrow down your choice, consider what you enjoy most in an MMORPG: • If you like tanking and leading the charge, choose Templar. • If you like melee combat with high durability, choose Gladiator.  • If you like stealthy gameplay with burst damage, choose Assassin.  • If you like ranged combat with precision, choose Ranger.   • If you like Massive magical damage, choose Sorcerer. • If you like tactical utility with summons, choose Spiritmaster. • If you like healing and supporting teammates, choose Cleric.  • If you like hybrid support with melee combat, choose Chanter. Beginner-Friendly Classes If you’re new to MMORPGs or unsure where to start, these classes offer straightforward mechanics: 1. Templar – Durable, beginner-friendly tank. 2. Cleric – Essential healer with clear roles in group content. Solo vs. Group Play Some classes excel in solo play, while others shine in groups: - Best Solo Classes: Gladiator, Ranger, Spiritmaster (good sustain and flexibility). - Best Group Classes: Templar (tank), Cleric (healer), Chanter (support). PvP Recommendations For competitive players who enjoy PvP: - 1v1/Small-Scale PvP: Assassin (stealth burst) or Sorcerer (burst + CC).  - Large-Scale PvP: Spiritmaster (debuffs) or Templar (frontline disruption). Team Composition Tips Building a balanced party is crucial in Aion 2. Consider these combinations for optimal synergy: - Tank + DPS + Healer: Templar + Sorcerer + Cleric (classic setup).  - Buff-Oriented Group: Gladiator + Chanter + Cleric (durability + support).    Final Thoughts Aion 2 offers a rich variety of classes tailored to different playstyles. Whether you prefer tanking, dealing damage, or supporting your team, there’s a class that fits your preferences. To summarize: - For beginners: Start with Templar or Cleric. - For high damage: Choose Gladiator, Assassin, or Sorcerer. - For strategic gameplay: Go with Spiritmaster. - For support roles: Opt for Cleric or Chanter. Still undecided? Share your preferred playstyle—solo adventuring, competitive PvP, or cooperative group play—and you’ll find the perfect class to begin your journey in Aion 2!  
    • Prepare for OBT (Open Beta Test)! https://www.l2ertheia.eu/news:open-beta-test-obt/
    • What the actual fuck? HEY Maxtor, gay of the season, time to do some work. Banning required.
    • Hello there, sorry for the late response, (nobody cares anyway). I remember you, yes you did tried something, but sucked at it. Not a little lick, but sucked hard. No surprise you couldn't handle a single event, not to mention a long term event schedule. Section is long gone. And after all these years, you are still dumb enough to not even try to use a google translator.
    • I'm sorry for the graveyard digging.. As a good mate, I just had to copy/paste a message, remember I'm just the messenger, NOT ADMIN, NOT GM, and quickly to the topic: - project is in it's final stages - staff recruitment shall begin shortly (non fluent english speakers fuck off) - thank you for the understanding The end.
  • Topics

×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock