Random Item Dropping?

General talk about editing, cheating, and deprotecting maps.

Moderator: Cheaters

Olreich
Junior Member
Posts: 30
Joined: June 24th, 2007, 10:32 pm

Random Item Dropping?

Post by Olreich »

I'm not sure exactly what this is, but it has random stuff and Item Dropping. I ask for a breakdown of what Mp MR and Mn do (As specific as possible please).

Code: Select all

function Mn takes unit MN,integer Mo returns item
    local item MO
    if(Mo==-1)then
        return null
    endif
    set MO=CreateItem(Mo,GetUnitX(MN)+GetRandomReal(-32,32),GetUnitY(MN)+GetRandomReal(-32,32))
    call SetItemDropID(MO,GetUnitTypeId(MN))
    call UpdateStockAvailability(MO)
    set LK=MO
    set MO=null
    return LK
endfunction

function Mp takes nothing returns nothing
    local widget MP=null
    local unit Mq=null
    local integer MQ=0
    local boolean Mr=true
    set MP=bj_lastDyingWidget
    if(MP==null)then
        set Mq=GetTriggerUnit()
    endif
    if(Mq!=null)then
        set Mr=not IsUnitHidden(Mq)
        if(Mr and GetChangingUnit()!=null)then
            set Mr=(GetChangingUnitPrevOwner()==Player(12))
        endif
    endif
    if(Mr)then
        call RandomDistReset()
        call RandomDistAddItem('I01W',10)
        call RandomDistAddItem(-1,90)
        set MQ=RandomDistChoose()
        if(Mq!=null)then
            call Mn(Mq,MQ)
        else
            call WidgetDropItem(MP,MQ)
        endif
    endif
    set bj_lastDyingWidget=null
    call DestroyTrigger(GetTriggeringTrigger())
endfunction

function MR takes nothing returns nothing
    local widget MP=null
    local unit Mq=null
    local integer MQ=0
    local boolean Mr=true
    set MP=bj_lastDyingWidget
    if(MP==null)then
        set Mq=GetTriggerUnit()
    endif
    if(Mq!=null)then
        set Mr=not IsUnitHidden(Mq)
        if(Mr and GetChangingUnit()!=null)then
            set Mr=(GetChangingUnitPrevOwner()==Player(12))
        endif
    endif
    if(Mr)then
        call RandomDistReset()
        call RandomDistAddItem('I047','d')
        set MQ=RandomDistChoose()
        if(Mq!=null)then
            call Mn(Mq,MQ)
        else
            call WidgetDropItem(MP,MQ)
        endif
    endif
    set bj_lastDyingWidget=null
    call DestroyTrigger(GetTriggeringTrigger())
endfunction


I tried to make the code as easy to view as I know how, hope it helps.
GhettoChild
Old Wrinkly Member
Posts: 272
Joined: January 27th, 2007, 4:46 pm
Title: OxyContin
Location: Denver, Colorado

Re: Random Item Dropping?

Post by GhettoChild »

You should join the chatroom, I am in it now. Would probably be easier than replying all the time in this thread.
You know why the Yankees always win, Frank?
'Cause they have Mickey Mantle?
No, it's 'cause the other teams can't stop staring at those damn pinstripes.
Olreich
Junior Member
Posts: 30
Joined: June 24th, 2007, 10:32 pm

Re: Random Item Dropping?

Post by Olreich »

Why would it be more beneficial to join that? The same question remains of "What does this code mean?" and I'm pretty sure that one long synopsis would be a better medium than many short, slightly dis-jointed synopses.
Bartimaeus²

Re: Random Item Dropping?

Post by Bartimaeus² »

Olreich wrote:Why would it be more beneficial to join that? The same question remains of "What does this code mean?" and I'm pretty sure that one long synopsis would be a better medium than many short, slightly dis-jointed synopses.

Use your simple minded brain, you might know big words, but you sure as hell don't use them for the right reason. Think, "Why would I go to a chat room that instant messages instead of 1 per day messages..." Oh, I don't know, maybe it's faster, I never thought of that!
And yes, I do know what those "big words" mean, if you think I don't.
Now, I'm not trying to be mean, but if you know what all that means, you'd think you'd know why would you join a chat room where there's instant messages instead of 1 per day messages.
Olreich
Junior Member
Posts: 30
Joined: June 24th, 2007, 10:32 pm

Re: Random Item Dropping?

Post by Olreich »

Use your simple minded brain, you might know big words, but you sure as hell don't use them for the right reason. Think, "Why would I go to a chat room that instant messages instead of 1 per day messages..." Oh, I don't know, maybe it's faster, I never thought of that!
And yes, I do know what those "big words" mean, if you think I don't.
Now, I'm not trying to be mean, but if you know what all that means, you'd think you'd know why would you join a chat room where there's instant messages instead of 1 per day messages.


You apparently don't know what the big words mean. Instant, no, maybe faster on response time, but slow on answer time. If someone would be kind enough to just run through the above an look at it, I'm pretty sure they can answer it cohesively in a single post.

Why would it be more beneficial to join that? The same question remains of "What does this code mean?" and I'm pretty sure that one long synopsis would be a better medium than many short, slightly dis-jointed synopses.


The jist of what you seem to have skipped is in sentence 3, in which I state that in a situation such as this, when a long explanation is required, it is better to have all of it out and clarified in a single post, thus eliminating the problems of Chat, which include having chopped up language and not being as cohesive because you cannot quote.

In even simpler terms: 1 Long Post > Many Short Sentences

Funny Tidbit: I post a question. Instead of an answer, I get a philosophical argument between the merits of Chat Rooms and Forum Threads.
User avatar
weirdone2
Forum Staff
Posts: 926
Joined: June 3rd, 2007, 8:03 pm

Re: Random Item Dropping?

Post by weirdone2 »

Olreich wrote:
Use your simple minded brain, you might know big words, but you sure as hell don't use them for the right reason. Think, "Why would I go to a chat room that instant messages instead of 1 per day messages..." Oh, I don't know, maybe it's faster, I never thought of that!
And yes, I do know what those "big words" mean, if you think I don't.
Now, I'm not trying to be mean, but if you know what all that means, you'd think you'd know why would you join a chat room where there's instant messages instead of 1 per day messages.


You apparently don't know what the big words mean. Instant, no, maybe faster on response time, but slow on answer time. If someone would be kind enough to just run through the above an look at it, I'm pretty sure they can answer it cohesively in a single post.

Why would it be more beneficial to join that? The same question remains of "What does this code mean?" and I'm pretty sure that one long synopsis would be a better medium than many short, slightly dis-jointed synopses.


The jist of what you seem to have skipped is in sentence 3, in which I state that in a situation such as this, when a long explanation is required, it is better to have all of it out and clarified in a single post, thus eliminating the problems of Chat, which include having chopped up language and not being as cohesive because you cannot quote.

In even simpler terms: 1 Long Post > Many Short Sentences

Funny Tidbit: I post a question. Instead of an answer, I get a philosophical argument between the merits of Chat Rooms and Forum Threads.



Actually beart was just aguing as to why you would want to join chat which you did ask. And as to that chat is better since a long post mite not answer everything your looking for and then you'd have to ask again, going back and fourth in a forum isn't as grand as going back and fourth in a chat room, bottom like you shoulda took ghetto up on his offer.
Olreich
Junior Member
Posts: 30
Joined: June 24th, 2007, 10:32 pm

Re: Random Item Dropping?

Post by Olreich »

That's peachy... w/e, I suppose I'll go try to figure it out for a longer period of time, though I don't think I'm getting anywhere...
GhettoChild
Old Wrinkly Member
Posts: 272
Joined: January 27th, 2007, 4:46 pm
Title: OxyContin
Location: Denver, Colorado

Re: Random Item Dropping?

Post by GhettoChild »

Well, a widget can either be a unit, item or destructable. In this case it looks to be an item that we are dealing with by the looks of it. I'm not the best at JASS or anything but I will give it my best shot. Lets start with this line:

function Mn takes unit MN,integer Mo returns item

function Mn is obviously the optimized function name... whereas unit MN seems to be the triggering unit. Since the function says:

if(Mo==-1)then
return null

This means that if Mo is equal to negative one, then basically do nothing. You want it broken down in this ammount of detail how so?
You know why the Yankees always win, Frank?
'Cause they have Mickey Mantle?
No, it's 'cause the other teams can't stop staring at those damn pinstripes.
User avatar
nevo
Old Wrinkly Member
Posts: 233
Joined: June 20th, 2007, 8:53 pm
Title: Nevo
Location: Canada

Re: Random Item Dropping?

Post by nevo »

Olreich, you asked for these guys advice and they told you to go to the chat, then you start going off about you'd be better off asking it here. No offense but why the hell would you ask them in the first place?
My Favorite Rule:
- No excessive BBCode, (colors, flashing text, spoilers, etc.), using; don't use it for every single word you're typing, only use it make a word(s) stand out.
GhettoChild
Old Wrinkly Member
Posts: 272
Joined: January 27th, 2007, 4:46 pm
Title: OxyContin
Location: Denver, Colorado

Re: Random Item Dropping?

Post by GhettoChild »

Its fine with me if that is what he/she wants, some people just prefer different things thats all. The only reason I brought it up was because Olreich was online when I posted my reply and I was in chat so I thought maybe it would be more convenient. Anyways Olreich refer to my post above nevo's.
You know why the Yankees always win, Frank?
'Cause they have Mickey Mantle?
No, it's 'cause the other teams can't stop staring at those damn pinstripes.