| 09-28-2008, 08:42 AM | #1 |
hey all, i've had this crazy idea in my head for awhile and ive been playing around with it on WE but i just cant seem to make it work. What i'd like to know is, is it possible to make shops sell spells which they will cast. For example, Goblin Laboratory sells reveal and it casts it. No problem there. But is there a way to make it cast Holy light on my hero for a fee? ive tried changing reveal as the base spell but i just cant get it to charge my hero gold for the spell. Does anyone know how i could do this? |
| 09-28-2008, 09:34 AM | #2 |
1. Make a dummy item and when shop sells this dummy remove it from player (not sure if you have to drop remove it or just remove it). 2. Make a dummy caster (no model, max stats, invuln ) somewhere in the edge of a map. Dummy caster has all spells the spell shop sells. 3. Give control over dummy caster to player who bought it and open up appropriate spell targeting (AoE, single target, etc.). 4. When dummy caster casts a spell, return control to your hero and kill the dummy caster (just make sure he finished the spell). This is basic really. For something more enhanced wait for the others to reply. |
| 09-28-2008, 09:58 AM | #3 |
the problem with that is, youre not able to select where you want the spell to be cast. I'm actually making a hire assassin system for my map, but so far ive only managed to make the assassin cast inferno at the targeted area but the shop doesnt ask for money. im liking how well it works at the moment but if i can just make it so you have to pay to nuke someone id be over the moon. |
| 09-28-2008, 11:20 AM | #4 |
Unfortunately, we can't make spells cost resources like gold and lumber (other than a select few spells like Reveal). For spells without targets, the easy workaround is with items and triggered dummy casters that get created to cast the spell when someone buys one of those items, but I'm not sure there is a solution as simple for targetting spells. |
| 09-28-2008, 03:54 PM | #5 |
ahhh thats a shame =/. Well as a work around is there anyway i can trigger it so i can prevent my "shop"/assassin from casting the nuke if the unit doesn't have the right amount of gold on them? im pretty sure thats doable yes? |
| 09-28-2008, 07:29 PM | #6 |
I'd say it is, assuming there's a way to get the player who ordered the ability to be cast; I'm not quite sure how that would be done, though. |
| 09-28-2008, 11:52 PM | #7 |
If made the shop sell units instead of items you could get the unit's owner easily. Alternatively, you might be able to get the owner by having 12 identical shops and just hiding 11 of them for each player with a GetLocalPlayer if-block. That is... if buying an item from a locally hidden shop doesn't desync the game. |
| 09-29-2008, 12:19 AM | #8 |
that sounds confusing . if i made local shops sell units and instead of items means i wont be able to select points on the map where i would like to cast spells.Seeing as its pretty darn impossible to have a shop sell spells i think its gunna require me to trigger it instead thanks for the feedback though guys very handy and its clarified for me that it cant be done by using just object editor and changing values =/. |
| 09-29-2008, 02:11 AM | #10 | |
Quote:
|
| 09-29-2008, 02:18 AM | #11 |
ive never played missile war so i dont know what youre talking about sorry =/. but im a little confused im not sure if everyone misunderstood what i meant by selling a spell. What i meant was the shop charges the player a fee for it to cast a spell such as heal or blizzard. if you look at the trigger i posted in my previous post i tried making my "shop" to move to the point location where the ability reveal was used but ive had no luck with that. It won't even create a dummy unit there which i dont understand why it should be working right but its not. ---EDIT--- ok i played around with my trigger a bit and found that the problem was the target point of ability being casted. For some unknown reason, the game wouldn't register the point location where i casted reveal. so my dummy unit wouldnt appear and the shop wouldnt move at the chosen location. ---2nd EDIT--- after some searching its not possible at all. GG blizz =/. Reveal doesn't return a point value hence why i could never make my shop move to the location where reveal was casted. I had the same problem as http://hilton.vs.oiccam.com/showthre...point+location it seems |
| 09-29-2008, 07:56 PM | #12 |
^^ JASS:scope Test initializer Init private function Conditions takes nothing returns boolean return GetIssuedOrderId() == 852023 endfunction private function Actions takes nothing returns nothing local location l = GetOrderPointLoc() call BJDebugMsg( "X:" + R2S( GetLocationX( l ) ) ) call BJDebugMsg( "Y:" + R2S( GetLocationY( l ) ) ) call RemoveLocation( l ) set l = null endfunction private function Init takes nothing returns nothing local trigger t = CreateTrigger() call TriggerAddAction( t, function Actions ) call TriggerAddAction( t, Condition( function Conditions ) ) call TriggerRegisterAnyUnitEventBJ( t, EVENT_PLAYER_UNIT_ISSUED_POINT_ORDER ) endfunction endscope |
| 09-30-2008, 01:17 AM | #13 |
no way.... are you serious bobo? does that actually work and if it does.. do you think you could make a GUI version of it? im not particularly good with JASS however i understand some of it for the most part. I don't know how to change the rest though to integrate it with my other triggers could you explain what parts i need to change. ^^; P.S. what i dont understand is how? i thought reveal doesnt return a location... |
| 09-30-2008, 04:53 AM | #14 |
its not returning point of ability its returning point of an order i think its in the gui under unit issued order targeting a point |
