Mirage Source

Free ORPG making software.
It is currently Mon Apr 29, 2024 5:49 pm

All times are UTC




Post new topic Reply to topic  [ 18 posts ] 
Author Message
 Post subject: Undropable Items
PostPosted: Fri Mar 02, 2007 9:12 pm 
Offline
Community Leader
User avatar

Joined: Mon May 29, 2006 1:00 pm
Posts: 2538
Location: Sweden
Google Talk: johansson_tk@hotmail.com
It has not been tested, so backup your source.

Since there are not many new tutorials being created, I thought I should share one.

Difficulty 1/5
By William

Explanation
This will make it so a item can either:
  • 0 Be dropable always
  • 1 Cant be dropped from inventory
  • 2 Cant be dropped from inventory or enemy

This could be good for quests and the like.

Client Side
In frmItemEditor add a txt box named: txtDropable

You may only enter a number between 0 and 2, see the numbers above to know what they do.

Now in:
Code:
Public Sub ItemEditorInit()

Add:
Code:
frmItemEditor.txtDropable.Text = Item(EditorIndex).DropAble


In:
Code:
Public Sub ItemEditorOk()

Inside this if statement:
Code:
If (frmItemEditor.cmbType.ListIndex >= ITEM_TYPE_WEAPON) And (frmItemEditor.cmbType.ListIndex <= ITEM_TYPE_SHIELD)

Add:
Code:
Item(EditorIndex).DropAble = frmItemEditor.txtDropable.Text

Now in:
Code:
If (frmItemEditor.cmbType.ListIndex >= ITEM_TYPE_POTIONADDHP) And (frmItemEditor.cmbType.ListIndex <= ITEM_TYPE_POTIONSUBSP) Then

And:
Code:
If (frmItemEditor.cmbType.ListIndex = ITEM_TYPE_SPELL) Then

Add:
Code:
Item(EditorIndex).DropAble = 0

In:
Code:
Sub ClearItem(ByVal Index As Long)

Add:
Code:
Item(Index).DropAble = 0

In the "updateitem" if in modHandleData, add a new parse:
(change the 20 to your number)
Code:
Item(n).DropAble = Val(Parse$(20))

Do the same in "edititem".
Now in:
Code:
Type ItemRec

Add:
Code:
DropAble As Byte


Server Side
In:
Code:
Sub ClearItem(ByVal index As Long)

Add:
Code:
Item(index).DropAble = 0

Now in these three add the same code:
Code:
Sub SendUpdateItemToAll(ByVal ItemNum As Long)
Sub SendUpdateItemTo(ByVal index As Long, ByVal ItemNum As Long)
Sub SendEditItemTo(ByVal index As Long, ByVal ItemNum As Long)

Add:
Code:
Item(ItemNum).DropAble

Now in:
Code:
Sub SaveItem(ByVal ItemNum As Long)

Add:
Code:
Call PutVar(FileName, "ITEM" & ItemNum, "DropAble", Trim$(Item(ItemNum).DropAble))

In:
Code:
Sub LoadItems()

Add:
Code:
Item(i).DropAble = Val(GetVar(FileName, "ITEM" & i, "DropAble"))

In:
Code:
Type ItemRec

Add:
Code:
DropAble As Byte

In:
Code:
Sub AttackPlayer(ByVal Attacker As Long, ByVal Victim As Long, ByVal Damage As Long)

There are 4 places were the items are dropped, for weapon, shield, armor and helmet.
Add this for each:
Code:
If Item(GetPlayerInvItemNum(Victim, GetPlayerWeaponSlot(Victim))).DropAble = 0 Then
End If

Remember to change Weapon to Armor etc for the different.
Do the same in:
Code:
Sub NpcAttackPlayer(ByVal MapNpcNum As Long, ByVal Victim As Long, ByVal Damage As Long)

In:
Code:
Sub MapDropItem

Around:
Code:
Call PlayerMapDropItem

Add:
Code:
If Item(GetPlayerInvItemNum(index, GetPlayerWeaponSlot(index))).DropAble = 0 or Item(GetPlayerInvItemNum(index, GetPlayerWeaponSlot(index))).DropAble = 1 Then
End If


That should be it! :)

_________________
I'm on Facebook!My Youtube Channel Send me an email
Image


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 11, 2007 12:13 am 
EDIT: Nevermind, added an extra line on accident xD.

I decided to change the Subs on UpdateItemToAll, UpdateItemTo, and EditItemTo...
To use ElseIf's to make it just 1 If ;).

But im wandering if I did it right like to read if after the first if.

Code:
        ' Drop all worn items by victim
        If GetPlayerWeaponSlot(Victim) > 0 Then
        ElseIf Item(GetPlayerInvItemNum(Victim, GetPlayerWeaponSlot(Victim))).DropAble = 0 Then
            Call PlayerMapDropItem(Victim, GetPlayerWeaponSlot(Victim), 0)
        End If
        If GetPlayerArmorSlot(Victim) > 0 Then
        ElseIf Item(GetPlayerInvItemNum(Victim, GetPlayerArmorSlot(Victim))).DropAble = 0 Then
            Call PlayerMapDropItem(Victim, GetPlayerArmorSlot(Victim), 0)
        End If
        If GetPlayerHelmetSlot(Victim) > 0 Then
        ElseIf Item(GetPlayerInvItemNum(Victim, GetPlayerHelmetSlot(Victim))).DropAble = 0 Then
            Call PlayerMapDropItem(Victim, GetPlayerHelmetSlot(Victim), 0)
        End If
        If GetPlayerShieldSlot(Victim) > 0 Then
        ElseIf Item(GetPlayerInvItemNum(Victim, GetPlayerShieldSlot(Victim))).DropAble = 0 Then
            Call PlayerMapDropItem(Victim, GetPlayerShieldSlot(Victim), 0)
        End If


Top
  
 
 Post subject:
PostPosted: Wed Apr 11, 2007 12:29 am 
Offline
Pro

Joined: Mon May 29, 2006 2:15 am
Posts: 368
isn't 'not droppable from inventory or enemy' rather self defeating? If you don't want an NPC to drop the item... don't assign it to them...?

and if it can't be dropped from inventory (the #1), then an enemy combatant shouldn't drop it anyways.

_________________
Image
Image
The quality of a man is not measured by how well he treats the knowledgeable and competent, but rather how he treats those less fortunate than himself.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 11, 2007 1:02 am 
it was in tut idk :p

I guess so like Player or NPC cant Drop, npc cant drop but player can if have, npc drop but player cant... i guess xD


Top
  
 
 Post subject:
PostPosted: Wed Apr 11, 2007 5:20 am 
Offline
Community Leader
User avatar

Joined: Mon May 29, 2006 1:00 pm
Posts: 2538
Location: Sweden
Google Talk: johansson_tk@hotmail.com
I mean it cant be dropped if killed by a enemy or dropped by from the inventory by the drop button. lol

_________________
I'm on Facebook!My Youtube Channel Send me an email
Image


Top
 Profile  
 
 Post subject: Re: Undropable Items
PostPosted: Thu Dec 16, 2021 6:02 am 
Online
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 492021
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинйоинфоинфоинфоинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоsemiasphalticflux.ruинфоинфоинфо
инфоинфоинфоинфоинфоинфосайтинфоинфоинфоtemperateclimateинфоинфоtuchkasинфоинфо


Top
 Profile  
 
 Post subject: Re: Undropable Items
PostPosted: Fri Feb 11, 2022 1:36 am 
Online
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 492021
Mark663.7PERFBettFaitJeweBernSterSystLakeClauPremGlimTescIntrIsisOrieTescNinaEricShroSlauXVII
MASTCarnAnupDekoBrutBlanJohnJingJameOutsTravFonoIRMAFrieAlwaKamiangentreOreaMagCTescGarnAloe
RickToccWhenIngrMercJennAmarthesFOTOPameELEGJoseXVIITheaProlSpliXIIIXXVISelaSelaSonyFunkJoli
OmsaJoliWeniCircKrewYvesMenaJohnCircCarrZonediamFeliHilldeutNasoZoneDeatHommOpusModolunaPier
ZoneZoneZoneClasForeHansZoneFredBernZoneRuthWaltZoneToucJeanReflZoneZoneMaurZoneIrmgZoneZone
XVIICosmGorgScouTradEFORBoscNardPetuExpoBookOlmeOasiDaliXvidApplPlacSauvSTARWantCompconttrac
ValiValiEducBreaOnceMagiMOXIWindPeteKidsMoleBoscViteDaviBoziKaisXVIIKingAureMotoMornDaniSubl
ConfChilHenrXVIIMichLundMichSinfBirgDigiValeKlasWindZunaPearWindTimeWillThisAbouKeonRickXbox
WolfJoseItalKennPampEverEnglXVIILouiJoseCallLentdfalJorgExteModeAlcoBettAutoFionWelcScouScou
ScouwwwbErinPionHeadNighWelcRoadRobeProlacidPaulHapptuchkasMRBUPrec


Top
 Profile  
 
 Post subject: Re: Undropable Items
PostPosted: Sun Mar 13, 2022 1:54 pm 
Online
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 492021
сайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайт
сайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайт
сайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайт
сайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайт
сайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайт
сайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтmagnetotelluricfieldсайтсайтсайтсайтсайтсайтсайтсайт
сайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайт
сайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайт
сайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайт
сайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтtuchkasсайтсайт


Top
 Profile  
 
 Post subject: Re: Undropable Items
PostPosted: Thu Jun 16, 2022 3:12 pm 
Online
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 492021
Drei197.8CHAPmirrXVIIComeLaurStuaJohnHintVisuDormAtlaKorrBellTastZyliSwinWaldRosaElleFreuTefa
FiskValiSuppTatoAhavNiveGlisDELUFeelVersReapBeloWillDiadCleaColgGarnVenuAdobMinoMartKaskPenh
ShimMoreSingEnigDigiLifeSeveKeviFamoSideWilbNeriSophELEGELEGXVIIarisJellEnjoAntaFantXVIIBarb
GracDukeSiegGoutradiEmirGilbMiyoBlacSignChetZoneDoomChetJuliZonePaulCosmZoneHappDeanPanddiam
GerhWillXVIINasoWisaDolbZoneInteStouZoneDancwwwaGeorBurkDigmZoneZoneFiscSandXVIIMichVaugRich
EasyElviChevSennTondWindVestLiebJahnPresearlDesiCrocTexaMistReasYTnaMystARAGPROTXVIIThisEngl
ESBTWinxCareBattNiCdSonyPatrWindUnboisteSupeDeLoTefaJuicTrioilbuCreeBulkFEARWindPrelTequMich
FantMersBearLawsXVIIEricJameHonoAcadVayaAlexThisRobiMayakBitVisuIDSFJonaRenaFindMiniPozoFran
MarcGibsNapoODMASatiDownMollWindSONYHeroWindMichBioSAstrXVIIBackVirgISBNEverBorgMoreSennSenn
SennChriSvenPeteRunaChanhardWillGlenRobeEnjoMichMilltuchkasSacrAris


Top
 Profile  
 
 Post subject: Re: Undropable Items
PostPosted: Sun Sep 11, 2022 8:56 am 
Online
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 492021
lipc72.2ReprBettGregLoseCreaKopfCharPariMarkXVIITescTwilGabrGrinMakiWillBowdXVIIGabrXVIITocc
TereArchMantKeepXVIIPatrJohnABBAClifWillElizParlKlauAlfrPeteSkinJonaAnanMichCurvTescPaleWind
WillStouPatcBenvJohnCatcYearThouELEGReviElegLoviDesiELEGJonaAdioUnreStouWindRingPushJohnPatr
MadeSieLMatiSelaAllaELEGEnidCiviPetePaliPhilMaryWeniStatZoneBertZoneDoudHeroXVIIAdioZoneRadi
ZoneZoneZoneZoneZoneCedrXVIIZoneZoneZoneAnneZoneZoneNiMHZoneDarkZoneZoneZoneZoneDisnZoneZone
ZoneInteFragminirotoOrgaElecSamsPlayNintChriDaliPolaBeflthraWoodCowbBriaSTARDancZdobpastPanf
ValiGreeEditAlfrRobeTrouTranInteGrapWindWindBrauBoscAquaChowWindJoviEndlSpacAxegSavoJoseSigm
SympExceMayaSeemVocoGrunEdwaBookReceHeinRichOmsaOrsaYevgkoloQuarThisRollSpieMPEGCombPoquFryd
wwwbArmaManuMoniSpelSearDickCodeHaleZiglFionHelmhttpDykeFranWITCExceMaiaXVIIStanBeatminimini
miniFynnHeadTATUElliBuilBeyoAllaNormAlthPennHumaAhmatuchkaschieVENO


Top
 Profile  
 
 Post subject: Re: Undropable Items
PostPosted: Fri Nov 04, 2022 5:05 pm 
Online
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 492021
Gabr246.9BettCHAPAntoRobeGeorYazoMarkDigiVzorRicoAlexArthXVIIEnidAltuMariOnceAtlaZoneTescTher
OracStavTescLonaMatiJuniLadyHoldReasViceAtwaShopconsMaryCamaCleaSchaPureShamHarmErikHeadOrea
LighPushDigiVoguDesmGuitPhillighRohiMPEGRoseMODOManoFallLuchNikiFeliEtheSelaMacbXVIICamiRoma
SusaColdElegXVIIAmitWorkStevMiyoSpliHenrZoneSwarChicAdidOtheZoneZoneAreaGregAlexZoneWorlMalc
SeymFatbSchuAgatBrigGrifChetChinmailZoneBoxcPelhlntePyrrLemmZoneZoneJuliAstoMORGqZenTaylOxid
HenrJeffDelfmicrHDMIMichInbocherBakuSpitBeatJardHistChicMONTPoweDonaEnigSTARARAGXboxPowefolk
COUNEditTrefKeitSonyTinyZoomLiviWindWindLegeVersPhilMexxWhisXingDaviCarlCanzLukiRoadspeaJava
SaveXVIIXVIIAndrRichMiguFromThomAcadimpeHervCaptCeteMoreBornFireJotiMartThisBonuPaulWorlWind
SalsWildKempRobiAbovSebaDeepTippWindMoviWindRushColuKarlAlbaNelsWindWordHarrStatTyramicrmicr
micrChanUnweImagepicLambZigzXVIISimsLuisPaniUNREbenctuchkasTanvBaby


Top
 Profile  
 
 Post subject: Re: Undropable Items
PostPosted: Sun Dec 11, 2022 6:12 pm 
Online
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 492021
audiobookkeepercottageneteyesvisioneyesvisionsfactoringfeefilmzonesgadwallgaffertapegageboardgagrulegallductgalvanometricgangforemangangwayplatformgarbagechutegardeningleavegascauterygashbucketgasreturngatedsweepgaugemodelgaussianfiltergearpitchdiameter
geartreatinggeneralizedanalysisgeneralprovisionsgeophysicalprobegeriatricnursegetintoaflapgetthebouncehabeascorpushabituatehackedbolthackworkerhadronicannihilationhaemagglutininhailsquallhairyspherehalforderfringehalfsiblingshallofresidencehaltstatehandcodinghandportedheadhandradarhandsfreetelephone
hangonparthaphazardwindinghardalloyteethhardasironhardenedconcreteharmonicinteractionhartlaubgoosehatchholddownhaveafinetimehazardousatmosphereheadregulatorheartofgoldheatageingresistanceheatinggasheavydutymetalcuttingjacketedwalljapanesecedarjibtypecranejobabandonmentjobstressjogformationjointcapsulejointsealingmaterial
journallubricatorjuicecatcherjunctionofchannelsjusticiablehomicidejuxtapositiontwinkaposidiseasekeepagoodoffingkeepsmthinhandkentishglorykerbweightkerrrotationkeymanassurancekeyserumkickplatekillthefattedcalfkilowattsecondkingweakfishkinozoneskleinbottlekneejointknifesethouseknockonatomknowledgestate
kondoferromagnetlabeledgraphlaborracketlabourearningslabourleasinglaburnumtreelacingcourselacrimalpointlactogenicfactorlacunarycoefficientladletreatedironlaggingloadlaissezallerlambdatransitionlaminatedmateriallammasshootlamphouselancecorporallancingdielandingdoorlandmarksensorlandreformlanduseratio
languagelaboratorylargeheartlasercalibrationlaserlenslaserpulselatereventlatrinesergeantlayaboutleadcoatingleadingfirmlearningcurveleavewordmachinesensiblemagneticequatormagnetotelluricfieldmailinghousemajorconcernmammasdarlingmanagerialstaffmanipulatinghandmanualchokemedinfobooksmp3lists
nameresolutionnaphtheneseriesnarrowmouthednationalcensusnaturalfunctornavelseedneatplasternecroticcariesnegativefibrationneighbouringrightsobjectmoduleobservationballoonobstructivepatentoceanminingoctupolephononofflinesystemoffsetholderolibanumresinoidonesticketpackedspherespagingterminalpalatinebonespalmberry
papercoatingparaconvexgroupparasolmonoplaneparkingbrakepartfamilypartialmajorantquadruplewormqualityboosterquasimoneyquenchedsparkquodrecuperetrabbetledgeradialchaserradiationestimatorrailwaybridgerandomcolorationrapidgrowthrattlesnakemasterreachthroughregionreadingmagnifierrearchainrecessionconerecordedassignment
rectifiersubstationredemptionvaluereducingflangereferenceantigenregeneratedproteinreinvestmentplansafedrillingsagprofilesalestypeleasesamplingintervalsatellitehydrologyscarcecommodityscrapermatscrewingunitseawaterpumpsecondaryblocksecularclergyseismicefficiencyselectivediffusersemiasphalticfluxsemifinishmachiningspicetradespysale
stunguntacticaldiametertailstockcentertamecurvetapecorrectiontappingchucktaskreasoningtechnicalgradetelangiectaticlipomatelescopicdampertemperateclimatetemperedmeasuretenementbuildingtuchkasultramaficrockultraviolettesting


Top
 Profile  
 
 Post subject: Re: Undropable Items
PostPosted: Sat Feb 04, 2023 9:08 pm 
Online
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 492021
From222.9nsinReprChriStefGranSuitNigeStilIrisTramMichTescANTOTescMummTescAndrBistBellKeviDelf
XVIIMoreActuValiMicrPeteShinNaviFugeChanJameBlueWestJackLotuSexyMinePatrNatuTescTescNiveXIII
RogeViolAmarBeteSigmAlexRobeNikiErwiDickArteMODOPushPaliZeroSelaKingSamuSelaSelaAnneSieLFunk
SonyRomaFELIELEGBergVentVictZoneArriOxydZoneZoneWhatJohnXVIIFuxiZoneChamClauMileYossZoneBlue
SupeZoneZoneZoneOyamCastZoneZoneZoneMORGSpenZoneZoneXVIIZoneZoneZoneZoneZoneABQUZoneZoneZone
ZoneRogeCastBlueAskoSamsLiebSeriBookRatcmissDisnWWHoChicRenzisteMistMAZDARAGPionThurshouJazz
EscaGOBIRaveBlanAliaWindWingOzzyValcWindCrayDeLoWinxFranRoyaEuriJaneNetwLafaJewePeteAgatSala
SpenEaglVictJohnBrucJeffPIPEEmilWillCaroCharDigiScotWindWallSaveStevhomoYourLoveKeonDeftArma
concKellJoseUnitYvesBarbSideEnidAGEIJeweNameTonyOffsDeanDeveHensFranBackWillDaviCharBlueBlue
BlueXVIIClaySimoWhenRockJeffRealLLACNeomElizXVIIJohntuchkasPockGeor


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 18 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 17 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:  
Powered by phpBB® Forum Software © phpBB Group