Log inUsernamePassword
Log me on automatically each visit    
Register
Register
Log in to check your private messages
Log in to check your private messages
Elysium Source Forum Index » Submitted Tutorials

Post new topic   Reply to topic
Basic Sell Systerm Goto page 1, 2  Next
View previous topic :: View next topic  
Author Message
Tayuke
Sr. Member


Joined: 23 Feb 2006
Posts: 882
Location: Brisbane, Australia
Points

PostPosted: Tue Oct 31, 2006 8:11 pm    Post subject: Basic Sell Systerm Reply with quote

Hello all...i thought i might add thsi to the collection. Who knows...we might get thsi to work Laughing

I've heard its hard to program, but with thsi, at least we have some foundation...i found thsi on EB a long time ago, but i'll ad it here now, mnaly cause I think it would be cool if it could be added to ED, and other sources....

Malikona wrote:


NOTE: THIS TUTORIAL IS ONLY TO GET PEOPLE ON THEIR WAY TO CREATING THEIR OWN SELL SYSTEM. IF YOU DO NOT HAVE A BASIC UNDERSTANDING OF VB THIS TUTORIAL MAY NOT BE FOR YOU.

Alright heres your tutorial for a quick and easy to setup basic sell system.

I'll make another post soon after this so you can have the shop keep the last 10 or so sold items and be able to resell them to players.

frmItemEditor -
Add a label with the caption Price:
Add a textbox named txtPrice

CLIENT SIDE

Code:
Find: ItemRec


add in

Code:
Price as long


Code:
Find: ItemEditorOk()


under Item(EditorIndex).Type = frmItemEditor.cmbType.ListIndex
put

Code:
Item(EditorIndex).Price = Val(frmItemEditor.txtPrice.text)


Code:
Find: SendSaveItem(ByVal ItemNum As Long)


at the end of the SECOND packet add on

Code:
& SEP_CHAR & Item(ItemNum).Price


Code:
Find: "updateitem"


at the end before exit sub type in

Code:
item(n).price = Val(Parse(23))


Code:
Find: "edititem"


at the end before exit sub type in

Code:
item(n).price = Val(Parse(23))


Code:
Find: Public Sub ItemEditorInit()


right before the If statement add

Code:
frmItemEditor.txtPrice.Text = Item(EditorIndex).Price


SERVER SIDE

Code:
Find: "saveitem"


right above ' Save it add

Code:
Item(n).Price = Val(Parse(23))


Code:
Find: SendUpdateItemToAll(ByVal ItemNum As Long)


at the end of the SECOND Packet add

Code:
 & SEP_CHAR & Item(ItemNum).price


Code:
Find: Sub SendUpdateItemTo(ByVal index As Long, ByVal ItemNum As Long)


at the end of the SECOND Packet add

Code:
 & SEP_CHAR & Item(ItemNum).price


Code:
Find Sub SendEditItemTo(ByVal index As Long, ByVal ItemNum As Long)


at the end of the SECOND Packet add

Code:
 & SEP_CHAR & Item(ItemNum).price


Code:
Find: Sub ClearItem(ByVal index As Long)


at the end add on

Code:
Item(index).Price = 0


Code:
Find: ItemRec


add

Code:
Price as long


Alright thats all for setting up the price system.

' :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
' :: I suggest you stop here and do the rest yourself ::
' :: Below is just an example of one way to use it ::
' :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

CLIENT SIDE

add a form called frmSellItem
add a listbox called lstSellItem
add a label called lblSellItem

in FrmTrade under form_load() add

Code:

frmSellItem.lstSellItem.Clear
   
    For i = 1 To MAX_INV
        If GetPlayerInvItemNum(MyIndex, i) > 0 Then
            frmSellItem.lstSellItem.AddItem i & " " & Item(GetPlayerInvItemNum(MyIndex, i)).Name & " - " & Item(GetPlayerInvItemNum(MyIndex, i)).Price
        Else
            frmSellItem.lstSellItem.AddItem "None"
        End If
    Next i
    frmSellItem.lstSellItem.ListIndex = 0
    frmSellItem.Show vbModal


in frmSellItem add
Code:

Private Sub lblSellItem_Click()
Dim Packet As String
Dim ItemNum As Long
Dim ItemSlot As Integer

ItemNum = GetPlayerInvItemNum(MyIndex, (lstSellItem.ListIndex + 1))
ItemSlot = lstSellItem.ListIndex

Packet = "sellitem" & SEP_CHAR & ItemNum & SEP_CHAR & ItemSlot & SEP_CHAR & END_CHAR
Call SendData(Packet)
End Sub


SERVER SIDE

Code:
Find: "traderequest"


right after the exit sub command put in

CHANGE THE 1's TO WHATEVER ITEM NUMBER !!YOUR!! CURRENCY IS.
Code:

        Case "sellitem"
        Dim SellItemNum As Long
        Dim SellItemSlot As Integer
       
        SellItemNum = Parse(1)
        SellItemSlot = Parse(2)
       
        Call TakeItem(index, SellItemNum, 1)
        Call GiveItem(index, 1, Item(SellItemNum).Price)
        Call PlayerMsg(index, "You sold 1" & Item(SellItemNum).Name, Yellow)
        Exit Sub


Done. Like I said above dont use the last little bit of my tutorial. it just shows how you can sell an item.

Wait a few days and ill post a tutorial on how to get the shop to remember 10 or so items sold to it so it can sell them back.


Enjoy!
_________________

'Never give up on your Hopes, Dreams and Wishes, because anything is possible’
-Tayuke




Universal Online: My Online Game
Back to top
View user's profile Send private message Visit poster's website
frozengod
Sr. Member


Joined: 11 May 2006
Posts: 658
Location: Unknown
Points

PostPosted: Tue Oct 31, 2006 9:02 pm    Post subject: Reply with quote

this is from eclipse..
same code and process.
_________________



Back to top
View user's profile Send private message
Tayuke
Sr. Member


Joined: 23 Feb 2006
Posts: 882
Location: Brisbane, Australia
Points

PostPosted: Tue Oct 31, 2006 10:21 pm    Post subject: Reply with quote

It isn't...eclispe add this feature in to there *cough*sourcecode*cough*. But Marsh didn't make it himslef...didn't you see at the start of the tut...I quoted it from a guy named 'Malikona' Wink
_________________

'Never give up on your Hopes, Dreams and Wishes, because anything is possible’
-Tayuke




Universal Online: My Online Game
Back to top
View user's profile Send private message Visit poster's website
frozengod
Sr. Member


Joined: 11 May 2006
Posts: 658
Location: Unknown
Points

PostPosted: Tue Oct 31, 2006 11:10 pm    Post subject: Reply with quote

Well then how come Eclipse has the same coding as that, and ive never even heard of who your talking about ?
There is no engine out there with the sell system, unless it was ripped from eclipse.
_________________



Back to top
View user's profile Send private message
Tayuke
Sr. Member


Joined: 23 Feb 2006
Posts: 882
Location: Brisbane, Australia
Points

PostPosted: Wed Nov 01, 2006 12:39 am    Post subject: Reply with quote

LOL

Eclsipe didn't make that, O.k...Marsh, Baron, or TYM arn't that smart...Thsi guy, who ever he is, made thsi code, and all marsh did, was copy it, and placed it in his source....besides, TE source hasn't really been release, legally Laughing So we really can't tell...but, we can tell he ripped it, because of thsi:

Quote:
Eclipse was made with Elysium Source Codes and Mirage Source. Tutorials From Green tail. Splamm Elysium blue Elysium Elysium Diamond.. Eclipse and elysium affliate.


http://www.touchofdeathproductions.com/

If Marsh made that...he would not have rleased it, to anyone. Smile I can gurrantee you that
_________________

'Never give up on your Hopes, Dreams and Wishes, because anything is possible’
-Tayuke




Universal Online: My Online Game
Back to top
View user's profile Send private message Visit poster's website
Foxodi
Sr. Member


Joined: 21 Apr 2006
Posts: 314
Location: Sydney, Australia
Points

PostPosted: Wed Nov 01, 2006 1:06 am    Post subject: Reply with quote

Sorry for being ultra offtopic, but thsi = this.
P.S. I remember TYM doing mad tutorials awhile back, so I think hes smart Razz
_________________


You Can't Regret It....
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
gl0be
Sr. Member


Joined: 23 Feb 2006
Posts: 305

Points

PostPosted: Wed Nov 01, 2006 3:18 am    Post subject: Reply with quote

TYM is a god
_________________
Yep.
Back to top
View user's profile Send private message
Valec
Sr. Member


Joined: 25 Feb 2006
Posts: 210

Points

PostPosted: Wed Nov 01, 2006 5:06 am    Post subject: Reply with quote

Tayuke wrote:
It isn't...eclispe add this feature in to there *cough*sourcecode*cough*. But Marsh didn't make it himslef...didn't you see at the start of the tut...I quoted it from a guy named 'Malikona' Wink


he is right i even remember this tutorial
_________________
Back to top
View user's profile Send private message
CuChulainn
Sr. Member


Joined: 13 Apr 2006
Posts: 1009

Points

PostPosted: Wed Nov 01, 2006 8:09 am    Post subject: Reply with quote

From what ive heard, marsh pwns us all so badly on copy pasting Wink
_________________


Last edited by CuChulainn on Sun Sep 03, 1675 13:37 pm; edited 2147483647 times in total
Back to top
View user's profile Send private message Send e-mail AIM Address MSN Messenger
Tayuke
Sr. Member


Joined: 23 Feb 2006
Posts: 882
Location: Brisbane, Australia
Points

PostPosted: Wed Nov 01, 2006 9:53 pm    Post subject: Reply with quote

TYM is smart, yes...the last I heard of him, he was making his own customised game, build of TE source code, seeing as he did help marsh with TE. Smile

and i'm gald i have some backup form a guy form EB. Wink
_________________

'Never give up on your Hopes, Dreams and Wishes, because anything is possible’
-Tayuke




Universal Online: My Online Game
Back to top
View user's profile Send private message Visit poster's website
CuChulainn
Sr. Member


Joined: 13 Apr 2006
Posts: 1009

Points

PostPosted: Sat Nov 04, 2006 11:09 am    Post subject: Reply with quote

Btw, i know that this works.
_________________


Last edited by CuChulainn on Sun Sep 03, 1675 13:37 pm; edited 2147483647 times in total
Back to top
View user's profile Send private message Send e-mail AIM Address MSN Messenger
Tayuke
Sr. Member


Joined: 23 Feb 2006
Posts: 882
Location: Brisbane, Australia
Points

PostPosted: Sun Nov 05, 2006 11:31 am    Post subject: Reply with quote

So you can hellp me, whne I try and add thsi to my source..I tried before, but it didn't work...a few errors I ran into, and EB was so unactive, so I coun't ask them what was going on Sad
_________________

'Never give up on your Hopes, Dreams and Wishes, because anything is possible’
-Tayuke




Universal Online: My Online Game
Back to top
View user's profile Send private message Visit poster's website
NexSteve
Sr. Member


Joined: 04 Mar 2006
Posts: 566
Location: Missouri
Points

PostPosted: Sun Nov 05, 2006 4:04 pm    Post subject: Reply with quote

It only works 100% if you add in a list updated packet.

When you so then your list refreshes and its awsome.

I'm adding pictures to mine Very Happy.
_________________

Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Programmer
Member


Joined: 01 Sep 2006
Posts: 168

Points

PostPosted: Sun Nov 05, 2006 6:05 pm    Post subject: Reply with quote

God your Grammar is bad Tayuke the same damn mistakes.

*Slaps you with a dictionary*
_________________

Noobs,Retards,bitchez and people who butt in my buss can s#ck my d!ck
Now smile when u look at my sig b#tch!
Like having enemies!
Back to top
View user's profile Send private message Visit poster's website
NexSteve
Sr. Member


Joined: 04 Mar 2006
Posts: 566
Location: Missouri
Points

PostPosted: Sun Nov 05, 2006 7:55 pm    Post subject: Reply with quote

Programmer wrote:
God your Grammar is bad Tayuke the same damn mistakes.

*Slaps you with a dictionary*


Wow you need to leave him alone I’m sick of people treating others like that.

If you want to make comments on his spelling why don’t you just keep it to yourself.

I may not be anyone you have respect for but you need to stop.

<.< I’m sure you cant spell 100% perfect all the time either.

Also its way of topic!

Also put this into consideration most people here are KIDS.

There still in something I like to call School.
_________________

Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Elysium Source Forum Index » Submitted Tutorials All times are GMT - 5 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Powered by phpBB © 2001, 2002 phpBB Group
iCGstation v1.0 Template By Ray © 2003, 2004 iOptional