HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

JASS Scripting Soul Gems/Enchanting

08-28-2007, 10:14 PM#1
PsykieKILLA
Ok, I am a master of being a noob at JASS. I tried to learn once and it went over my head. SO, I learnt HTML, got really good at it, and started learning PHP because apparently it gets easier to more you know (Plus, I learnt real BASIC and Lingo).

Now, down to the point. I am trying to make a Soul capture, Soul Gem, Enchanting system. Basically, the GUI triggers, if I could make them (because some of the functions I need to make don't seem to be there) would look like this:

Trigger = Capture Soul (generic) (generic) means any name so I don't have to write this out multiple times)

Events - unit obtains item = Soul (generic)
Conditions - (none)
Actions -
if - unit owns item = Soul Gem
then - remove item = Soul (generic)
- remove item = Soul Gem
- add item = (generic) Soul Gem (full)
- show message to triggering player = "You have captured a soul"
else - remove item = Soul (generic)
- show message to triggering player = "You have failed to capture a soul"

Because it would be a big work load if I asked for them all at once, so once someone have figured this out, I will submit the enchanting one.

If it helps, I was also going to make 4 different kinds of Soul:
Common
Grand
Divine
Putrid


Thank you to anyone who figures this out.
08-29-2007, 05:25 PM#2
TaintedReality
What exactly do you want? If that's how you want your trigger to be then why not make it? And, if you want us to help you figure out a better way to make this system you're going to have to explain what you're trying to do. I've encountered completely different soul capture/soul gem concepts in several games so I'm not sure where you're going with it.
08-30-2007, 05:52 AM#3
PsykieKILLA
Well the reason I am unable to make it is because I cant find ways of doing so.

And I did tell you want I need... If you read the trigger, its what I need...
08-31-2007, 12:03 AM#4
Pyrogasm
It's just a loop that checks items in slots and then some If/Then/Else checking; you should be able to figure it out...
09-01-2007, 06:04 AM#5
PsykieKILLA
Well thats the problem, I cant.
09-01-2007, 07:01 AM#6
Pyrogasm
Trigger:
Actions
Custom script: local boolean Exit = false
Set SomeUnit = (Triggering Unit)
Collapse For each (Integer A) from 1 to 6 do (Actions)
Collapse Loop - Actions
Collapse If (All conditions are true) then do (Then actions) else do (Else actions)
Collapse If - Conditions
((Item-type of (Item carried by SomeUnit in slot (Integer A))) equal to Soul Gem)
Collapse Then - Actions
Item - Remove (Item carried by (SomeUnit) in slot (Integer A))
Collapse For each (Integer B) from 1 to 6 do (Actions)
Collapse Loop - Actions
Collapse If (All conditions are true) then do (Then actions) else do (Else actions)
Collapse If - Conditions
((Item-type of (Item carried by SomeUnit in slot (Integer B))) equal to Soul (Generic))
Collapse Then - Actions
Item - Remove (Item carried by (SomeUnit) in slot (Integer B))
Custom script: set Exit = true
Custom script: exitwhen true
Else - Actions
Hero - Create Soul Gem (Full) and give it to (Triggering unit)
Game - Display to (Owner of (SomeUnit)) for 5.00 seconds the text You have captured a soul!
Custom script: exitwhen Exit
Else - Actions
Custom script: if not(Exit) then
Collapse For each (Integer B) from 1 to 6 do (Actions)
Collapse Loop - Actions
Collapse If (All conditions are true) then do (Then actions) else do (Else actions)
Collapse If - Conditions
((Item-type of (Item carried by SomeUnit in slot (Integer B))) equal to Soul (Generic))
Collapse Then - Actions
Item - Remove (Item carried by (SomeUnit) in slot (Integer B))
Custom script: set Exit = true
Custom script: exitwhen true
Else - Actions
Custom script: else
Game - Display to (Owner of (SomeUnit)) for 5.00 seconds the text You have failed to capture a soul!