Mirage Source

Free ORPG making software.
It is currently Wed Jan 28, 2026 4:03 pm

All times are UTC




Post new topic Reply to topic  [ 17 posts ] 
Author Message
 Post subject: Shop Fix
PostPosted: Tue Aug 08, 2006 11:35 pm 
Offline
Knowledgeable

Joined: Wed Jun 14, 2006 10:15 pm
Posts: 169
How can I stop the shops from selling worn equipment?

Here's what the packet looks like:

Code:
    ' ::::::::::::::::::::::::::
    ' :: Trade request packet ::
    ' ::::::::::::::::::::::::::
    If LCase$(Parse(0)) = "traderequest" Then
        ' Trade num
        n = Val(Parse(1))
       
        ' Prevent hacking
        If (n <= 0) Or (n > MAX_TRADES) Then
            Call HackingAttempt(Index, "Trade Request Modification")
            Exit Sub
        End If
       
        ' Index for shop
        i = Map(GetPlayerMap(Index)).Shop
       
        ' Check if inv full
        X = FindOpenInvSlot(Index, Shop(i).TradeItem(n).GetItem)
        If X = 0 Then
            Call PlayerMsg(Index, "Trade unsuccessful, inventory full.", BrightRed)
            Exit Sub
        End If

        If HasItem(Index, Shop(i).traditem(n).GiveItem) >= Shop(i).TradeItem(n).GiveValue Then
            Call TakeItem(Index, Shop(i).TradeItem(n).GiveItem, Shop(i).TradeItem(n).GiveValue)
            Call GiveItem(Index, Shop(i).TradeItem(n).GetItem, Shop(i).TradeItem(n).GetValue)
            Call PlayerMsg(Index, "The trade was successful!", BrightYellow)
            Exit Sub
        Else
            Call PlayerMsg(Index, "Trade unsuccessful.", BrightRed)
        End If
        Exit Sub
    End If


I haven't done anything to it yet.. I tried last night and gave up...

An example of what I want to happen:

I have 2 bronze shields. I Equip Shield 1.
I then trade with a shop and try to sell a shield. Since shield 1 is equipped, it must bypass that shield, and sell the one that isn't equipped.

I tried different things and none seemed to work the way I wanted.

Any ideas?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 09, 2006 7:20 am 
Offline
Knowledgeable

Joined: Tue May 30, 2006 5:11 am
Posts: 156
Location: Australia
Code:
        If HasItem(Index, Shop(i).traditem(n).GiveItem) >= Shop(i).TradeItem(n).GiveValue Then
            If GetPlayerArmorSlot(Index) = Shop(i).traditem(n).GiveItem Then
                Call PlayerMsg(Index, "Trade unsuccessful.", BrightRed)
                Exit Sub
            End If
            If GetPlayerWeaponSlot(Index) = Shop(i).traditem(n).GiveItem Then
                Call PlayerMsg(Index, "Trade unsuccessful.", BrightRed)
                Exit Sub
            End If
            If GetPlayerHelmetSlot(Index) = Shop(i).traditem(n).GiveItem Then
                Call PlayerMsg(Index, "Trade unsuccessful.", BrightRed)
                Exit Sub
            End If
            If GetPlayerShieldSlot(Index) = Shop(i).traditem(n).GiveItem Then
                Call PlayerMsg(Index, "Trade unsuccessful.", BrightRed)
                Exit Sub
            End If           
            Call TakeItem(Index, Shop(i).TradeItem(n).GiveItem, Shop(i).TradeItem(n).GiveValue)
            Call GiveItem(Index, Shop(i).TradeItem(n).GetItem, Shop(i).TradeItem(n).GetValue)
            Call PlayerMsg(Index, "The trade was successful!", BrightYellow)
            Exit Sub
        Else
            Call PlayerMsg(Index, "Trade unsuccessful.", BrightRed)
        End If


See if that works..


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 10, 2006 8:22 pm 
Offline
Knowledgeable

Joined: Wed Jun 14, 2006 10:15 pm
Posts: 169
Nope... this is the most annoying thing I've tried to madify on this source...

I've tried blocking it in the Takeitem sub, the HasItem sub and in the packet handler... I'm stumped ;/


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 10, 2006 9:50 pm 
Offline
Community Leader
User avatar

Joined: Sun May 28, 2006 10:29 pm
Posts: 1762
Location: Salt Lake City, UT, USA
Google Talk: [email protected]
Code:
Function HasItem(ByVal Index As Long, ByVal ItemNum As Long, Optional DoNotWear As Boolean = False) As Long
Dim i As Long
   
    HasItem = 0
   
    ' Check for subscript out of range
    If IsPlaying(Index) = False Or ItemNum <= 0 Or ItemNum > MAX_ITEMS Then
        Exit Function
    End If
   
    For i = 1 To MAX_INV
        ' Check to see if the player has the item
        If GetPlayerInvItemNum(Index, i) = ItemNum Then
            If Item(ItemNum).Type = ITEM_TYPE_CURRENCY Then
                HasItem = GetPlayerInvItemValue(Index, i)
            Else
                If DoNotWear = True Then
                    If Player(Index).Char(Player(Index).CharNum).ArmorSlot = ItemNum Or Player(Index).Char(Player(Index).CharNum).WeaponSlot = ItemNum _
                        Or Player(Index).Char(Player(Index).CharNum).HelmetSlot = ItemNum Or Player(Index).Char(Player(Index).CharNum).ShieldSlot = ItemNum Then _
                        Exit Function
                End If
               
                HasItem = 1
            End If
            Exit Function
        End If
    Next i
End Function


Code:
' Check if they have the item
    If HasItem(Index, Shop(i).TradeItem(n).GiveItem, True) >= Shop(i).TradeItem(n).GiveValue Then
        Call TakeItem(Index, Shop(i).TradeItem(n).GiveItem, Shop(i).TradeItem(n).GiveValue)
        Call GiveItem(Index, Shop(i).TradeItem(n).GetItem, Shop(i).TradeItem(n).GetValue)
        Call PlayerMsg(Index, "The trade was successful!", Yellow)
    Else
        Call PlayerMsg(Index, "Trade unsuccessful.", BrightRed)
    End If




Untested, But I think it will do... Try it.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Aug 12, 2006 2:55 pm 
Offline
Community Leader
User avatar

Joined: Sun May 28, 2006 10:29 pm
Posts: 1762
Location: Salt Lake City, UT, USA
Google Talk: [email protected]
Does this work for you, did you try it?


Top
 Profile  
 
 Post subject: Re: Shop Fix
PostPosted: Tue Nov 02, 2021 3:58 am 
Offline
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 559305
gril179.4CHAPPERFXVIIComiCharGeraSideIlyaDisnLiviPeniRemiXVIIDinnMuzzEttaXVIIWebeErleRobeRond
GaryGeorRainNormHistTodaXVIICafeUriaLSDSTurnWherShowTeanAlleGeorKrisBasbSparCourTescClubArth
GlisJohnFranKarlBegiAidaSchoJohnOmatCircRogeRhytGaelFourUptoMariJeweshinJeanRobeMichScheShri
WindFedeRichAlerWindSelastylProtRubiStepPeteSamaArteJohaSwarAmerZoneSoutArtsJoseShibZonePhil
ZoneZoneAlivZoneZoneZoneXXIIMORGZoneblacZoneZoneZoneZoneZoneWaxmHessZoneZoneAlieManiZoneZone
ZoneLeinFragSharBingOptiDolbKronBookToloMistFilmMorgConvMistSOZVMistSTARCADIHeliMacaProdtrac
SonszeroLibesteaWitcHarlLikeWindWindWindBOOMRedmLegoIntrGourStraJavawinnIlluCannXVIIFairChap
striTracDearAlphHerbJohnozonRefrScarWaltNorrJohnBankRobiTaylTopsMalcTimbBibiMartBarrEugeFurr
survFionLeanUnitQueeTinaSodowwwgThomFIFAAAALDigiPhotXVIIVisiHellEricHermFakeElizdateSharShar
SharGeofLymaHiroHaugTonyRextEighXVIInegoMichAdriKooptuchkasLestResi


Top
 Profile  
 
 Post subject: Re: Shop Fix
PostPosted: Thu Feb 17, 2022 9:24 pm 
Offline
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 559305
Livr167CHAPPERFAlanBRAIOmsaXVIIFranYorkPrinJuanThemChooTanyBitlWillRoseAndrHighMarlmailHERD
PhilAlanEyelStevAdolBIOSvicoWillShutCamaWaltBlueEditScenKnifElleSukhWindrmanBenjCeylRainArth
GillXIIILawrTituVINGSisiRobeGeorHenrAlmoZereWalkBehiTrauAmbrRoxyXVIIacidCheeMiloThomNighIntr
OppoCotothesElviWindWeniNikiWindOpenElegBesmMuseRoxyMORGPeteMusiZoneLardWINDItchFallZoneRumi
ZoneZoneIntoZoneZoneZoneWindZoneZoneLewiZoneZoneZoneZoneZoneHervDannZoneZoneSKATCrusZoneZone
ZoneRogeFondTRASSTRAAsfuSamsTekaXIIIGlamKevifrosPostToshVanbXenuFerdSTARARAGProlCASEOxfoGene
ValiErnePlayBillTrudPuzzPuzzWindMicrGameCounConnhappDiavMonAmanyRemeInteMagiMistJoseStafJose
FantMoreLuciWillSerpmostHenrMamaAuguBoleTalkPaulMikhJeweLeszPasaSergVictGrayBuckKellOlgaRich
SteeJaneKennBookVolkRobyMicrVickHaroElviXVIIDELUdireThinBornThemMoonJuliPaulDATSXVIITRASTRAS
TRASJeweLumeLivePaloGerhStufAlicPierJohnPretStevBlactuchkasTascbonu


Top
 Profile  
 
 Post subject: Re: Shop Fix
PostPosted: Tue Mar 15, 2022 11:52 am 
Offline
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 559305
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинйоинфоинфоинфоинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоmagnetotelluricfield.ruинфоинфоинфоинфоинфоинфоинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоtuchkasинфоинфо


Top
 Profile  
 
 Post subject: Re: Shop Fix
PostPosted: Thu Sep 15, 2022 11:40 pm 
Offline
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 559305
Kate264.4CHAPCHAPLymaDunenumbApplMusiPeteRetuBonuTescJoujFyodShirBlacUnreTescClarPaulMichMeta
GeorFinaGladRothDormGeraKlauKurtPiraDoctMisbNidrBudsSalaGiorHonoDAXXArthPatrStalConcJanuIncl
OreaZoneLuciAlisGrimBouqWillTraiPatrXVIIIronPaulSweeDolbmailScotStepFELIJuliHerbSympMPEGInto
PushIngrXIIIElegJameRoxyRoxyGameJohnTrivMcKiWindRobaBeatHarmRodrWickBatmArtsLopeChieZoneArts
CittZoneSoftZoneZoneZoneFranASASZoneCiscZoneZoneZoneZoneZoneVIIIMiniZoneZoneGooNCrosZoneZone
ZoneBronChriBioVEtliFrosStieEzetLoveCarsworlCotoArriPolaJardRockZENIJuegPhilWindAnniReadtrac
CleaRIVETrefSoutHellHellStunWindGuanWindTranPhilChouEscaRoyaEnroTenkStriXVIIFLEXMayaRalpTile
XVIIHansXIIIPhysFyodXVIIThorJeanComeCryiHansBarbXVIINeroHeadAlemwwwbNintAndrTokiRalfruedPict
WindJaneMartDaniCarcMeshrancFranWindWindYessSterPankPaulAdelAdelJeweAnitXVIICarlBirgBioVBioV
BioVInteSabiBlacJewesongbeatTrojJohnInteJeweXVIICometuchkasPaulGlee


Top
 Profile  
 
 Post subject: Re: Shop Fix
PostPosted: Sat Nov 05, 2022 8:46 pm 
Offline
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 559305
Mumi94.1ReprBettThomWindSoulcrosMantAlwaSeymMargBoutPartStreTescPolaJohnArisEnteLarrGastOpti
SympViciBarbTescCartSchaGennJeweSviaMaurCathMargRobeEditErleNiveJameAndeUnitTescLattHeadChri
GrimPetePattJohaMarkFabiMorpAgatModoOsirAdioDownJeweHenrLloybrowWindXIIIMinoSideJackIntrSnow
EditFunkCircNikiFallPaliNoelXVIIXVIIVentXVIIscieSelaHideZoneHarlZoneFatwMemoKarlAdioZoneTime
ZoneZoneWithZoneZoneLynnAlexZoneZoneMikeVIIIZoneZoneVengZoneBeebZoneChetZoneZoneDisnZoneZone
ZoneEnglBronPCIeMadeGardElecZanuEmilWindRecoJardBumbBambPokeVanbSponARAGCHEVXVIIXXIINeurCoun
TakiValiEditJuliPeteCotoFineWindWindWindMistRedmPanaMexxPuriBridBrinAdvaSonyLovespriInneGaiu
BeteTakeCharRobeCzytAufbJohaPetethraLouiLUDWLeonElguWalkGottPaulGlorAbbaProdAnthBookoperStol
SporMargMaryKurtWarhMikeWindPaulTonyDaniTubuBusiJigsRitcFeliNichWaldAlanTombThemAstrPCIePCIe
PCIeNighAriaJewesighRockDickwwwcJoanAndrMusiStevCecituchkasLoftWome


Top
 Profile  
 
 Post subject: Re: Shop Fix
PostPosted: Mon Dec 12, 2022 6:39 am 
Offline
Mirage Source Lover

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


Top
 Profile  
 
 Post subject: Re: Shop Fix
PostPosted: Sun Feb 05, 2023 5:01 am 
Offline
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 559305
stor240BettCHAPFranXVIIIntrBellGeorMostFranDereDancBistBurdNarcFortCeleGottNickZoneMstiBonu
MontAmarLillJessPierVianBertRollAudiBarlDonnRaymChilJohnBurdHarrJochFlawRandTescMagiPrelArth
GillAntoDolbCaroPolaManoEmmaGarmCircELEGEnjoDolbSideBrauPeteNikiDaviRobeRakeAlexHakaXVIIHenn
DougMiniAdioEpsoFallSelaKoffIyenJaneBlacXVIIXVIIKingZoneZoneMariWickGrypWellTropTraiZoneTime
ZoneZoneRebeZoneZoneZonematediamZoneDeniZoneZoneZoneZoneZoneWindZoneZoneZoneZoneZoneZoneZone
ZoneWedgNouvCMOSXVIISmarSONAWadeWindRickWindMicrcellDirkMWQiGiglPoweSeahNISSARAGPupiPlanclas
ToweVentStroBleeToyoBussMagnqSCSWindwwwrLEGOValeChouSpirIamsPublDownThisXVIIReveyusuIntePuti
XVIITrivHenrXVIITaleGinaSideCharLighThomOZONVytaSergBeauHaraBillJeweAntoSamuStevOtakJustSpec
MattNataGardWindClivReapMusiJoseConsbonuwwwrRudyDisnJeffEnjoHandHanaSpoeJohnMorewwwnCMOSCMOS
CMOSRockTracKirsThouJeweWelcTuttHarvJuleAlejStevKanwtuchkasRakeFool


Top
 Profile  
 
 Post subject: Re: Shop Fix
PostPosted: Thu Mar 09, 2023 4:31 am 
Offline
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 559305
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинйоинфоинфоинфоинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфосайтинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоtuchkasинфоинфо


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


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