Create object storm trident

The place to post your WML questions and answers.

Moderator: Forum Moderators

Forum rules
  • Please use [code] BBCode tags in your posts for embedding WML snippets.
  • To keep your code readable so that others can easily help you, make sure to indent it following our conventions.
vghetto
Posts: 755
Joined: November 2nd, 2019, 5:12 pm

Re: Create object storm trident

Post by vghetto »

The definition of {OBJ_TRIDENT_STORM} limits it to race=merman
You can plug in the following instead of {OBJ_TRIDENT_STORM} to make it pickable by any unit.

Code: Select all

    {PICKUPPABLE_ITEM "trident1" 11 12 (
        #race=merman
        [not]
            [has_attack]
                name="storm trident"
            [/has_attack]
        [/not]
    ) items/storm-trident.png
    _"Should $unit.name pick up the trident?"
    _"storm trident^Take it"
    _"storm trident^Leave it"
    _"$unit.name cannot use this Storm Trident! Let one of the merfolk who can wield it have it." (
        [object]
            name= _ "Storm Trident"
            image=items/storm-trident.png
            duration=forever
            description= _ "This trident gives merfolk the power to throw lightning at their enemies."
            [effect]
                apply_to=new_attack
                name="storm trident"
                description= _ "storm trident"
                icon=attacks/lightning.png
                type=fire
                range=ranged
                [specials]
                    {WEAPON_SPECIAL_MAGICAL}
                [/specials]
                damage=14
                number=2
            [/effect]

            {LIGHTNING_ANIMATION "storm trident" 1}
            {LIGHTNING_ANIMATION "storm trident" 2}
            {LIGHTNING_ANIMATION "storm trident" 3}
        [/object]
    )}


    {PICKUPPABLE_ITEM "trident2" 51 19 (
        #race=merman
        [not]
            [has_attack]
                name="storm trident"
            [/has_attack]
        [/not]
    ) items/storm-trident.png
    _"Should $unit.name pick up the trident?"
    _"storm trident^Take it"
    _"storm trident^Leave it"
    _"$unit.name cannot use this Storm Trident! Let one of the merfolk who can wield it have it." (
        [object]
            name= _ "Storm Trident"
            image=items/storm-trident.png
            duration=forever
            description= _ "This trident gives merfolk the power to throw lightning at their enemies."
            [effect]
                apply_to=new_attack
                name="storm trident"
                description= _ "storm trident"
                icon=attacks/lightning.png
                type=fire
                range=ranged
                [specials]
                    {WEAPON_SPECIAL_MAGICAL}
                [/specials]
                damage=14
                number=2
            [/effect]

            {LIGHTNING_ANIMATION "storm trident" 1}
            {LIGHTNING_ANIMATION "storm trident" 2}
            {LIGHTNING_ANIMATION "storm trident" 3}
        [/object]
    )}
MAXIMR7
Posts: 11
Joined: April 13th, 2021, 2:32 am

Re: Create object storm trident

Post by MAXIMR7 »

I already used that code and it does not work, only the sirenians can use it
vghetto
Posts: 755
Joined: November 2nd, 2019, 5:12 pm

Re: Create object storm trident

Post by vghetto »

I don't know what sirenians are. Is it the merefolk, fish like people?
The code above is different because it comments out race=merman with #
Give it a try anyway, and see if it works :)
Post Reply