Special Item
Printed From: Mirage Source
Category: Tutorials
Forum Name: Temporary Archive (Read Only)
Forum Discription: Temporary 3.0.3 archive tutorials, will be deleted when converted.
URL: http://ms.shannaracorp.com/backup-forums/forum_posts.asp?TID=178
Printed Date: 20 December 2006 at 5:52pm Software Version: Web Wiz Forums 8.01 - http://www.webwizforums.com
Topic: Special Item
Posted By: Sync
Subject: Special Item
Date Posted: 11 February 2006 at 3:19pm
Difficulty: Medium 3/5
Originaly Posted By: anticreeps
I'm not the creator of this code just posting it the way i got it ------------------------------------------------------------ ------------------------- ok, ever want to make something REALLY special? well here is a small idea of how you can change around some of the variables and such in mirage to get GREAT end effects....
here is the "Amulet of Speed" item....
now, in modGameLogic, up in the Declarations, change Code: ' Speed moving vars Public Const WALK_SPEED = 4 Public Const RUN_SPEED = 8
to
Code: ' Speed moving vars Public WALK_SPEED As Integer Public RUN_SPEED As Integer
and then in modGameLogic, find UpdateInventory, and change it from what you have to this... Code: Public Sub UpdateInventory() Dim i As Long
frmMirage.lstInv.Clear
' Show the inventory For i = 1 To MAX_INV If GetPlayerInvItemNum(MyIndex, i) > 0 And GetPlayerInvItemNum(MyIndex, i) <= MAX_ITEMS Then If Item(GetPlayerInvItemNum(MyIndex, i)).Type = ITEM_TYPE_CURRENCY Then frmMirage.lstInv.AddItem i & ": " & Trim(Item(GetPlayerInvItemNum(MyIndex, i)).Name) & " (" & GetPlayerInvItemValue(MyIndex, i) & ")" Else ' Check if this item is being worn If GetPlayerWeaponSlot(MyIndex) = i Or GetPlayerArmorSlot(MyIndex) = i Or GetPlayerHelmetSlot(MyIndex) = i Or GetPlayerShieldSlot(MyIndex) = i Then frmMirage.lstInv.AddItem i & ": " & Trim(Item(GetPlayerInvItemNum(MyIndex, i)).Name) & " (worn)" Else frmMirage.lstInv.AddItem i & ": " & Trim(Item(GetPlayerInvItemNum(MyIndex, i)).Name)
'check for speed-boosting items If Trim(Item(GetPlayerInvItemNum(MyIndex, i)).Name) = "Amulet of Speed" Then WALK_SPEED = 8 RUN_SPEED = 16 Else WALK_SPEED = 4 RUN_SPEED = 8 End If
End If End If Else frmMirage.lstInv.AddItem "<free inventory slot>" End If Next i
frmMirage.lstInv.ListIndex = 0
well actually all that you have to REALLY do is add in this to the correct place (see above for the correct place) Code: 'check for speed-boosting items If Trim(Item(GetPlayerInvItemNum(MyIndex, i)).Name) = "Amulet of Speed" Then WALK_SPEED = 8 RUN_SPEED = 16 Else WALK_SPEED = 4 RUN_SPEED = 8 End If
now, while in game, do /edititem and edit an item, name it simple "Amulet of Speed", and set it's picture.
and there you go, now just put down the amulet on the map, pick it up, hell, you can avan check the inventory if you wish to, but your speed will be outstanding now.. if your really smart, you can change the code so that it has to be actually WORN before the effect takes place...
|
|