Mirage Source

Free ORPG making software.
It is currently Fri Mar 29, 2024 1:30 pm

All times are UTC


Forum rules


Make sure your tutorials are kept up to date with the latest MS4 releases.



Post new topic Reply to topic  [ 1409 posts ]  Go to page 1, 2, 3, 4, 5 ... 57  Next
Author Message
PostPosted: Sat Nov 22, 2008 5:14 pm 
Offline
Knowledgeable
User avatar

Joined: Tue May 30, 2006 1:42 am
Posts: 346
Location: Florida
Ok the server side works in MS4 but I had to leave for work so I wasn't able to test out the client side, but I installed it, and it does work in MS3.0.3, and MSEbuild1 so, here's the code. And yes I think someone else did one of these tutorials on the old forums but, I did not see it posted on here.

Server Side
Add this to SendEditNpcTo after the other drop chances
Code:
& SEP_CHAR & Npc(NpcNum).DropChance2 & SEP_CHAR & Npc(NpcNum).DropItem2 & SEP_CHAR & Npc(NpcNum).DropItemValue2 & SEP_CHAR & Npc(NpcNum).DropChance3 & SEP_CHAR & Npc(NpcNum).DropItem3 & SEP_CHAR & Npc(NpcNum).DropItemValue3 & SEP_CHAR & Npc(NpcNum).DropChance4 & SEP_CHAR & Npc(NpcNum).DropItem4 & SEP_CHAR & Npc(NpcNum).DropItemValue4 & SEP_CHAR & Npc(NpcNum).DropChance5 & SEP_CHAR & Npc(NpcNum).DropItem5 & SEP_CHAR & Npc(NpcNum).DropItemValue5

then add this to the npc rec
Code:
DropChance2 As Integer
    DropItem2 As Byte
    DropItemValue2 As Integer
    DropChance3 As Integer
    DropItem3 As Byte
    DropItemValue3 As Integer
    DropChance4 As Integer
    DropItem4 As Byte
    DropItemValue4 As Integer
    DropChance5 As Integer
    DropItem5 As Byte
    DropItemValue5 As Integer

then add to HandleSaveNpc
Code:
       Npc(n).DropChance2 = Val(Parse(11))
        Npc(n).DropItem2 = Val(Parse(12))
        Npc(n).DropItemValue2 = Val(Parse(13))
        Npc(n).DropChance3 = Val(Parse(14))
        Npc(n).DropItem3 = Val(Parse(15))
        Npc(n).DropItemValue3 = Val(Parse(16))
        Npc(n).DropChance4 = Val(Parse(17))
        Npc(n).DropItem4 = Val(Parse(18))
        Npc(n).DropItemValue4 = Val(Parse(19))
        Npc(n).DropChance5 = Val(Parse(20))
        Npc(n).DropItem5 = Val(Parse(21))
        Npc(n).DropItemValue5 = Val(Parse(22))

Add this to attacknpc
Code:
' Drop the goods if they get it
n = Int(Rnd * Npc(NpcNum).DropChance2) + 1
If n = 1 Then
Call SpawnItem(Npc(NpcNum).DropItem2, Npc(NpcNum).DropItemValue2, MapNum, MapNpc(MapNum, MapNpcNum).x, MapNpc(MapNum, MapNpcNum).y)
End If
' Drop the goods if they get it
n = Int(Rnd * Npc(NpcNum).DropChance3) + 1
If n = 1 Then
Call SpawnItem(Npc(NpcNum).DropItem3, Npc(NpcNum).DropItemValue3, MapNum, MapNpc(MapNum, MapNpcNum).x, MapNpc(MapNum, MapNpcNum).y)
End If
' Drop the goods if they get it
n = Int(Rnd * Npc(NpcNum).DropChance4) + 1
If n = 1 Then
Call SpawnItem(Npc(NpcNum).DropItem4, Npc(NpcNum).DropItemValue4, MapNum, MapNpc(MapNum, MapNpcNum).x, MapNpc(MapNum, MapNpcNum).y)
End If
' Drop the goods if they get it
n = Int(Rnd * Npc(NpcNum).DropChance5) + 1
If n = 1 Then
Call SpawnItem(Npc(NpcNum).DropItem5, Npc(NpcNum).DropItemValue5, MapNum, MapNpc(MapNum, MapNpcNum).x, MapNpc(MapNum, MapNpcNum).y)
End If

Thats all server side
Now to the Client Side

Add this to handleupdatenpc
Code:
     Npc(n).DropChance2 = 0
        Npc(n).DropItem2 = 0
        Npc(n).DropItemValue2 = 0
        Npc(n).DropChance3 = 0
        Npc(n).DropItem3 = 0
        Npc(n).DropItemValue3 = 0
        Npc(n).DropChance4 = 0
        Npc(n).DropItem4 = 0
        Npc(n).DropItemValue4 = 0
        Npc(n).DropChance5 = 0
        Npc(n).DropItem5 = 0
        Npc(n).DropItemValue5 = 0

Then add this to handleeditnpc
Code:
       Npc(n).DropChance2 = Val(Parse(11))
        Npc(n).DropItem2 = Val(Parse(12))
        Npc(n).DropItemValue2 = Val(Parse(13))
        Npc(n).DropChance3 = Val(Parse(14))
        Npc(n).DropItem3 = Val(Parse(15))
        Npc(n).DropItemValue3 = Val(Parse(16))
        Npc(n).DropChance4 = Val(Parse(17))
        Npc(n).DropItem4 = Val(Parse(18))
        Npc(n).DropItemValue4 = Val(Parse(19))
        Npc(n).DropChance5 = Val(Parse(20))
        Npc(n).DropItem5 = Val(Parse(21))
        Npc(n).DropItemValue5 = Val(Parse(22))

Add this to sendsavenpc
Code:
& SEP_CHAR & Npc(NpcNum).DropChance2 & SEP_CHAR & Npc(NpcNum).DropItem2 & SEP_CHAR & Npc(NpcNum).DropItemValue2 & SEP_CHAR & Npc(NpcNum).DropChance3 & SEP_CHAR & Npc(NpcNum).DropItem3 & SEP_CHAR & Npc(NpcNum).DropItemValue3 & SEP_CHAR & Npc(NpcNum).DropChance4 & SEP_CHAR & Npc(NpcNum).DropItem4 & SEP_CHAR & Npc(NpcNum).DropItemValue4 & SEP_CHAR & Npc(NpcNum).DropChance5 & SEP_CHAR & Npc(NpcNum).DropItem5 & SEP_CHAR & Npc(NpcNum).DropItemValue5

Add this to NpcRec
Code:
    DropChance2 As Integer
    DropItem2 As Byte
    DropItemValue2 As Integer
    DropChance3 As Integer
    DropItem3 As Byte
    DropItemValue3 As Integer
    DropChance4 As Integer
    DropItem4 As Byte
    DropItemValue4 As Integer
    DropChance5 As Integer
    DropItem5 As Byte
    DropItemValue5 As Integer

Add this to Npceditorinit
Code:
    frmNpcEditor.txtChance2.Text = Str(Npc(EditorIndex).DropChance2)
    frmNpcEditor.scrlNum2.Value = Npc(EditorIndex).DropItem2
    frmNpcEditor.scrlValue2.Value = Npc(EditorIndex).DropItemValue2
    frmNpcEditor.txtChance3.Text = Str(Npc(EditorIndex).DropChance3)
    frmNpcEditor.scrlNum3.Value = Npc(EditorIndex).DropItem3
    frmNpcEditor.scrlValue3.Value = Npc(EditorIndex).DropItemValue3
    frmNpcEditor.txtChance4.Text = Str(Npc(EditorIndex).DropChance4)
    frmNpcEditor.scrlNum4.Value = Npc(EditorIndex).DropItem4
    frmNpcEditor.scrlValue4.Value = Npc(EditorIndex).DropItemValue4
    frmNpcEditor.txtChance5.Text = Str(Npc(EditorIndex).DropChance5)
    frmNpcEditor.scrlNum5.Value = Npc(EditorIndex).DropItem5
    frmNpcEditor.scrlValue5.Value = Npc(EditorIndex).DropItemValue5

Add this to npceditorok
Code:
    Npc(EditorIndex).DropChance2 = Val(frmNpcEditor.txtChance2.Text)
    Npc(EditorIndex).DropItem2 = frmNpcEditor.scrlNum2.Value
    Npc(EditorIndex).DropItemValue2 = frmNpcEditor.scrlValue2.Value
    Npc(EditorIndex).DropChance3 = Val(frmNpcEditor.txtChance3.Text)
    Npc(EditorIndex).DropItem3 = frmNpcEditor.scrlNum3.Value
    Npc(EditorIndex).DropItemValue3 = frmNpcEditor.scrlValue3.Value
    Npc(EditorIndex).DropChance4 = Val(frmNpcEditor.txtChance4.Text)
    Npc(EditorIndex).DropItem4 = frmNpcEditor.scrlNum4.Value
    Npc(EditorIndex).DropItemValue4 = frmNpcEditor.scrlValue4.Value
    Npc(EditorIndex).DropChance5 = Val(frmNpcEditor.txtChance5.Text)
    Npc(EditorIndex).DropItem5 = frmNpcEditor.scrlNum5.Value
    Npc(EditorIndex).DropItemValue5 = frmNpcEditor.scrlValue5.Value

Then make duplicates of each of the drop things in the npceditor.
Now this makes it so that if any of the items that are on the same chance # like item 1 & 2 are set to chance 1 out of 2 and then 3, 4, 5 are set to a diffrent number it will drop the 2 at the number it gets first, so some updating might need to be done to it a little later on.
hope this works if not let me know and I'll try to figure it out.
To make this work for MSE and 3.0.3 just copy and change the save and load code in save and loadnpc.

_________________
shut your manpleaser
http://www.kazmostech.com


Top
 Profile  
 
PostPosted: Sun Nov 23, 2008 5:40 pm 
You should do this with an array. It'd be much more optimized.


Top
  
 
PostPosted: Sun Nov 23, 2008 6:47 pm 
Offline
Knowledgeable
User avatar

Joined: Tue May 30, 2006 1:42 am
Posts: 346
Location: Florida
I am not sure how to work with arrays but I am going to convert it to use with's when I get home to speed it up a little.

_________________
shut your manpleaser
http://www.kazmostech.com


Top
 Profile  
 
PostPosted: Sun Nov 23, 2008 7:12 pm 
Just learn to use an array.

DropItem(1 to 3) as byte

(I think..)


Top
  
 
PostPosted: Sun Nov 23, 2008 8:58 pm 
Offline
Knowledgeable
User avatar

Joined: Tue May 30, 2006 1:42 am
Posts: 346
Location: Florida
I googled it and here's what I came up with is that what your thinking of?
http://visualbasic.freetutes.com/learn-vb6/lesson6.html

_________________
shut your manpleaser
http://www.kazmostech.com


Top
 Profile  
 
PostPosted: Sun Nov 23, 2008 9:33 pm 
Offline
Submit-Happy
User avatar

Joined: Fri Jun 16, 2006 7:01 am
Posts: 2768
Location: Yorkshire, UK
DarkX wrote:
I googled it and here's what I came up with is that what your thinking of?
http://visualbasic.freetutes.com/learn-vb6/lesson6.html


Obviously.

_________________
Quote:
Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?


Image


Top
 Profile  
 
PostPosted: Sun Nov 23, 2008 10:30 pm 
Offline
Knowledgeable
User avatar

Joined: Tue May 30, 2006 1:42 am
Posts: 346
Location: Florida
I'll get to working on it tonight, and try to convert to arrays

_________________
shut your manpleaser
http://www.kazmostech.com


Top
 Profile  
 
PostPosted: Mon Jan 19, 2009 3:34 pm 
Offline
Regular

Joined: Sat Sep 13, 2008 1:41 am
Posts: 97
Did this ever get update to arrays and is it still usable with the new ms4


Top
 Profile  
 
PostPosted: Mon Jan 19, 2009 9:30 pm 
Offline
Regular

Joined: Wed Jan 16, 2008 8:50 pm
Posts: 60
This is all serverside, but it looks like it should still work with MS4. All it does is create a bunch of new values in the NPC file, so if you use this you'll either have to put something in to add in those blank values, or delete all your NPC files. You'll also have to do clientside, which shouldn't be too hard. It would mainly just be adding in a bunch of scrollbars, etc, to the NPC editor, then having the values sent to the server when you save then NPC.


Top
 Profile  
 
PostPosted: Wed Dec 01, 2021 8:17 am 
Offline
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 456192
http://audiobookkeeper.ruhttp://cottagenet.ruhttp://eyesvision.ruhttp://eyesvisions.comhttp://factoringfee.ruhttp://filmzones.ruhttp://gadwall.ruhttp://gaffertape.ruhttp://gageboard.ruhttp://gagrule.ruhttp://gallduct.ruhttp://galvanometric.ruhttp://gangforeman.ruhttp://gangwayplatform.ruhttp://garbagechute.ruhttp://gardeningleave.ruhttp://gascautery.ruhttp://gashbucket.ruhttp://gasreturn.ruhttp://gatedsweep.ruhttp://gaugemodel.ruhttp://gaussianfilter.ruhttp://gearpitchdiameter.ru
http://geartreating.ruhttp://generalizedanalysis.ruhttp://generalprovisions.ruhttp://geophysicalprobe.ruhttp://geriatricnurse.ruhttp://getintoaflap.ruhttp://getthebounce.ruhttp://habeascorpus.ruhttp://habituate.ruhttp://hackedbolt.ruhttp://hackworker.ruhttp://hadronicannihilation.ruhttp://haemagglutinin.ruhttp://hailsquall.ruhttp://hairysphere.ruhttp://halforderfringe.ruhttp://halfsiblings.ruhttp://hallofresidence.ruhttp://haltstate.ruhttp://handcoding.ruhttp://handportedhead.ruhttp://handradar.ruhttp://handsfreetelephone.ru
http://hangonpart.ruhttp://haphazardwinding.ruhttp://hardalloyteeth.ruhttp://hardasiron.ruhttp://hardenedconcrete.ruhttp://harmonicinteraction.ruhttp://hartlaubgoose.ruhttp://hatchholddown.ruhttp://haveafinetime.ruhttp://hazardousatmosphere.ruhttp://headregulator.ruhttp://heartofgold.ruhttp://heatageingresistance.ruhttp://heatinggas.ruhttp://heavydutymetalcutting.ruhttp://jacketedwall.ruhttp://japanesecedar.ruhttp://jibtypecrane.ruhttp://jobabandonment.ruhttp://jobstress.ruhttp://jogformation.ruhttp://jointcapsule.ruhttp://jointsealingmaterial.ru
http://journallubricator.ruhttp://juicecatcher.ruhttp://junctionofchannels.ruhttp://justiciablehomicide.ruhttp://juxtapositiontwin.ruhttp://kaposidisease.ruhttp://keepagoodoffing.ruhttp://keepsmthinhand.ruhttp://kentishglory.ruhttp://kerbweight.ruhttp://kerrrotation.ruhttp://keymanassurance.ruhttp://keyserum.ruhttp://kickplate.ruhttp://killthefattedcalf.ruhttp://kilowattsecond.ruhttp://kingweakfish.ruhttp://kinozones.ruhttp://kleinbottle.ruhttp://kneejoint.ruhttp://knifesethouse.ruhttp://knockonatom.ruhttp://knowledgestate.ru
http://kondoferromagnet.ruhttp://labeledgraph.ruhttp://laborracket.ruhttp://labourearnings.ruhttp://labourleasing.ruhttp://laburnumtree.ruhttp://lacingcourse.ruhttp://lacrimalpoint.ruhttp://lactogenicfactor.ruhttp://lacunarycoefficient.ruhttp://ladletreatediron.ruhttp://laggingload.ruhttp://laissezaller.ruhttp://lambdatransition.ruhttp://laminatedmaterial.ruhttp://lammasshoot.ruhttp://lamphouse.ruhttp://lancecorporal.ruhttp://lancingdie.ruhttp://landingdoor.ruhttp://landmarksensor.ruhttp://landreform.ruhttp://landuseratio.ru
http://languagelaboratory.ruhttp://largeheart.ruhttp://lasercalibration.ruhttp://laserlens.ruhttp://laserpulse.ruhttp://laterevent.ruhttp://latrinesergeant.ruhttp://layabout.ruhttp://leadcoating.ruhttp://leadingfirm.ruhttp://learningcurve.ruhttp://leaveword.ruhttp://machinesensible.ruhttp://magneticequator.ruhttp://magnetotelluricfield.ruhttp://mailinghouse.ruhttp://majorconcern.ruhttp://mammasdarling.ruhttp://managerialstaff.ruhttp://manipulatinghand.ruhttp://manualchoke.ruhttp://medinfobooks.ruhttp://mp3lists.ru
http://nameresolution.ruhttp://naphtheneseries.ruhttp://narrowmouthed.ruhttp://nationalcensus.ruhttp://naturalfunctor.ruhttp://navelseed.ruhttp://neatplaster.ruhttp://necroticcaries.ruhttp://negativefibration.ruhttp://neighbouringrights.ruhttp://objectmodule.ruhttp://observationballoon.ruhttp://obstructivepatent.ruhttp://oceanmining.ruhttp://octupolephonon.ruhttp://offlinesystem.ruhttp://offsetholder.ruhttp://olibanumresinoid.ruhttp://onesticket.ruhttp://packedspheres.ruhttp://pagingterminal.ruhttp://palatinebones.ruhttp://palmberry.ru
http://papercoating.ruhttp://paraconvexgroup.ruhttp://parasolmonoplane.ruhttp://parkingbrake.ruhttp://partfamily.ruhttp://partialmajorant.ruhttp://quadrupleworm.ruhttp://qualitybooster.ruhttp://quasimoney.ruhttp://quenchedspark.ruhttp://quodrecuperet.ruhttp://rabbetledge.ruhttp://radialchaser.ruhttp://radiationestimator.ruhttp://railwaybridge.ruhttp://randomcoloration.ruhttp://rapidgrowth.ruhttp://rattlesnakemaster.ruhttp://reachthroughregion.ruhttp://readingmagnifier.ruhttp://rearchain.ruhttp://recessioncone.ruhttp://recordedassignment.ru
http://rectifiersubstation.ruhttp://redemptionvalue.ruhttp://reducingflange.ruhttp://referenceantigen.ruhttp://regeneratedprotein.ruhttp://reinvestmentplan.ruhttp://safedrilling.ruhttp://sagprofile.ruhttp://salestypelease.ruhttp://samplinginterval.ruhttp://satellitehydrology.ruhttp://scarcecommodity.ruhttp://scrapermat.ruhttp://screwingunit.ruhttp://seawaterpump.ruhttp://secondaryblock.ruhttp://secularclergy.ruhttp://seismicefficiency.ruhttp://selectivediffuser.ruинфоhttp://semifinishmachining.ruhttp://spicetrade.ruhttp://spysale.ru
http://stungun.ruhttp://tacticaldiameter.ruhttp://tailstockcenter.ruhttp://tamecurve.ruhttp://tapecorrection.ruhttp://tappingchuck.rutaskreasoning.ruhttp://technicalgrade.ruhttp://telangiectaticlipoma.ruhttp://telescopicdamper.ruсайтhttp://temperedmeasure.ruhttp://tenementbuilding.rutuchkashttp://ultramaficrock.ruhttp://ultraviolettesting.ru


Top
 Profile  
 
PostPosted: Fri Dec 31, 2021 7:24 am 
Offline
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 456192
XVII


Top
 Profile  
 
PostPosted: Fri Dec 31, 2021 7:25 am 
Offline
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 456192
69.4


Top
 Profile  
 
PostPosted: Fri Dec 31, 2021 7:26 am 
Offline
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 456192
Bett


Top
 Profile  
 
PostPosted: Fri Dec 31, 2021 7:27 am 
Offline
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 456192
Bett


Top
 Profile  
 
PostPosted: Fri Dec 31, 2021 7:28 am 
Offline
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 456192
Jack


Top
 Profile  
 
PostPosted: Fri Dec 31, 2021 7:29 am 
Offline
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 456192
Cent


Top
 Profile  
 
PostPosted: Fri Dec 31, 2021 7:31 am 
Offline
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 456192
Line


Top
 Profile  
 
PostPosted: Fri Dec 31, 2021 7:32 am 
Offline
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 456192
XVII


Top
 Profile  
 
PostPosted: Fri Dec 31, 2021 7:33 am 
Offline
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 456192
Paul


Top
 Profile  
 
PostPosted: Fri Dec 31, 2021 7:34 am 
Offline
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 456192
Gold


Top
 Profile  
 
PostPosted: Fri Dec 31, 2021 7:35 am 
Offline
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 456192
Stor


Top
 Profile  
 
PostPosted: Fri Dec 31, 2021 7:36 am 
Offline
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 456192
Atla


Top
 Profile  
 
PostPosted: Fri Dec 31, 2021 7:37 am 
Offline
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 456192
Tesc


Top
 Profile  
 
PostPosted: Fri Dec 31, 2021 7:38 am 
Offline
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 456192
Luck


Top
 Profile  
 
PostPosted: Fri Dec 31, 2021 7:39 am 
Offline
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 456192
Fisk


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1409 posts ]  Go to page 1, 2, 3, 4, 5 ... 57  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 21 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group