[PARTIALLY SOLVED] Spell Library Request: Enchanted Mango

edited January 2016 in Support

Coz mangoes are delicious :D

Comments

  • Posts: 858

    ...

    on use AddMana 150

    MAKE CUSTOM GAMES GREAT AGAIN

    Finished-
    kv checker - https://arhowk.github.io
    panorama video series - https://moddota.com/forums/discussion/2021/inclusive-panorama-tutorial-quest-box

    My pet project This Cursed World/Crestfallen (name pending)
    https://moddota.com/forums/discussion/986/this-cursed-world-rpg#latest

  • ^lol dis nub dont understand how deliciouso mangoez is

  • edited January 2016 Posts: 69

    I didn't code the full mango as it is in Dota (in my mod I needed it as an ability) but for those who are still in need for some mangoes you can use this code (just change it to an item):

    "bm_mango"
    {
        "BaseClass"                     "ability_datadriven"
        "AbilityBehavior"               "DOTA_ABILITY_BEHAVIOR_UNIT_TARGET | DOTA_ABILITY_BEHAVIOR_IMMEDIATE"
        "AbilityUnitTargetTeam"         "DOTA_UNIT_TARGET_TEAM_FRIENDLY"   
        "AbilityUnitTargetType"         "DOTA_UNIT_TARGET_BASIC | DOTA_UNIT_TARGET_HERO"
        "AbilityTextureName"            "bm_mango"
        "MaxLevel"                      "1"
    
        "AbilityCastRange"              "400"
        "AbilityCastPoint"              "0.0"
        "AbilityCooldown"               "70.0"
        "AbilityManaCost"               "0"   
    
        "AbilitySpecial"
        {
            "01"
            {
                "var_type"              "FIELD_INTEGER"
                "mana_amount"           "150"
            }
            "02"
            {
                "var_type"              "FIELD_INTEGER"
                "range_tooltip"         "400"
            }        
    
        }
    
        "OnSpellStart"
        {
            "RunScript"
            {
                "Target"        "TARGET"
                "ScriptFile"    "spells/addmana.lua"
                "Function"      "AddMana"
                "mana_amount"   "%mana_amount"
            }
    
            "FireSound"
            {
                "Target"        "CASTER"
                "EffectName"    "DOTA_Item.Mango.Activate"
            }
    
            "FireEffect"
            {
                "Target"            "TARGET"
                "EffectName"        "particles/items3_fx/mango_active.vpcf"
                "EffectAttachType"  "follow_origin"
            }
        }
    }
    

    And the lua script:

    function AddMana( event )
        event.target:GiveMana(event.mana_amount)
        PopupMana(event.target, event.mana_amount)
    end
    
  • Posts: 1,670

    AbilityCastRange & range_tooltip don't make sense there, neither does passing a Target instead of directly using the caster. Apart from that seems good (perhaps get rid of the useless //----------- comment lines lol). Happy new year

    The concept of Modding Community doesn't go well together with Competitive Business
    My Project Page || My GitHub Profile ||

  • Posts: 213

    AbilityCastRange & range_tooltip don't make sense there, neither does passing a Target instead of directly using the caster.

    Well you can cast mangoes on your allies if you hold control, so it kinda makes sense.

  • Posts: 1,670

    Oh it's UNIT_TARGET huh

    Disregard what I said, I need to play doto this year :residentsleeper:

    The concept of Modding Community doesn't go well together with Competitive Business
    My Project Page || My GitHub Profile ||

  • @Noya so much hate for my poor comment lines :P Made the edit n got rid of em!

    And yeah as @vyrus said the mango can be casted on allies - the 400 range and 150mana is the default on the actual Enchanted Mango so I left it that way.