Spell Shop - How can I remove the dummy item after the hero gains the spell?

Zerox

Ultra Cool Member
Reaction score
28
Edit: I fixed it myself. Turns out it was something stupid after all. Just had to set it to be used automatically in Object Editor. Sorry, mods may delete this thread.









Hello, I used the hero spell shop system found here: http://www.thehelper.net/forums/showthread.php/95188-Buying-Spells-From-a-Shop

The problem is that my hero still retains the bought spell item in their inventory after the spell is received.

How can I make the items disappear like tomes do without adding any stats the the hero?

Here's my triggers:

Trigger:
  • Spell Set
    • Events
      • Time - Elapsed game time is 0.50 seconds
    • Conditions
    • Actions
      • Set spellItemId[0] = Dark Aura
      • Set spellItemId[1] = Negative X
      • Set spellItemId[2] = Crucial Hit
      • Set spellItemId[3] = Dark Thundaga
      • Set spellItemId[4] = Thundaga
      • Set spellItemId[5] = Touch of Darkness
      • Set spellItemId[6] = Lucky Hit
      • Set spellItemId[7] = Evenings End
      • Set spellItemId[8] = Curaga
      • Set spellItemId[9] = Keyblade Training
      • -------- The 'buyable' spells and 'real' spells must be listed correspondingly. --------
      • Set realSpellId[0] = Dark Aura
      • Set realSpellId[1] = Negative X
      • Set realSpellId[2] = Crucial Hit
      • Set realSpellId[3] = Dark Thundaga
      • Set realSpellId[4] = Thundaga
      • Set realSpellId[5] = Touch of Darkness
      • Set realSpellId[6] = Lucky Hit
      • Set realSpellId[7] = Evenings End
      • Set realSpellId[8] = Curaga
      • Set realSpellId[9] = Keyblade Training


Trigger:
  • Hero Buys Spell
    • Events
      • Unit - A unit Sells an item (from shop)
    • Conditions
    • Actions
      • Set tmpItem = (Sold Item)
      • Set tmpUnit = (Buying unit)
      • -------- Lets determine which spell was bought. --------
      • For each (Integer A) from 0 to 3, do (Actions)
        • Loop - Actions
          • Set tmpInt = (Integer A)
          • -------- Custom script to exit the loop when the right 'spell' was found. --------
          • Custom script: exitwhen (GetItemTypeId(udg_tmpItem) == udg_spellItemId[udg_tmpInt])
      • -------- The right sold spells is found. --------
      • -------- Now lets determine whether the buying hero already has this spells learnt or not. --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of realSpellId[tmpInt] for tmpUnit) Equal to 0
        • Then - Actions
          • -------- The hero does not have this spell. Lets 'learn' the spell. --------
          • Unit - Add realSpellId[tmpInt] to tmpUnit
          • Item - Remove (Item being manipulated)
        • Else - Actions
          • -------- The hero has this spell. --------
          • -------- We have to determine whether it's an one level ultimate or a regular spell. --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • realSpellId[tmpInt] Equal to Storm, Earth, And Fire
            • Then - Actions
              • -------- The spell was an ultimate. As it's a one level spell, we have to refund the gold. --------
              • Player - Add 450 to (Owner of tmpUnit) Current gold
              • Item - Remove (Item being manipulated)
            • Else - Actions
              • -------- The spell was not an ultimate. --------
              • -------- We have to determine whether the normal spell is maxed out or not. --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Level of realSpellId[tmpInt] for tmpUnit) Equal to 3
                • Then - Actions
                  • -------- The spell is maxed out. Give gold back. --------
                  • Player - Add 150 to (Owner of tmpUnit) Current gold
                  • Item - Remove (Item being manipulated)
                • Else - Actions
                  • -------- The spell is not maxed out. Increase the level of the spell. --------
                  • Unit - Increase level of realSpellId[tmpInt] for tmpUnit
                  • Item - Remove (Item being manipulated)


Is it something I can/should add to the trigger somewhere or something I need to fix in Object Editor? I'm sure it's something easy I'm just overlooking. :cool:

Any help is highly appreciated.:thup: + Rep to those who help.

Thanks.
 

Syndrome

You can change this now in User CP.
Reaction score
126
Make the item have one charge, set it automatically use when acquired, and also make it perishable.
Done deal.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top