| Mirage Source http://miragesource.net/forums/ |
|
| Teleport Spell http://miragesource.net/forums/viewtopic.php?f=210&t=4195 |
Page 1 of 1 |
| Author: | Rian [ Sun Aug 24, 2008 8:46 pm ] |
| Post subject: | Teleport Spell |
This is an old school tutorial. I didn't make it, I just cleaned it up a little. There is still room for cleaning, particularly in the SpellEditorInit Sub and SpellEditorOk Sub, but I'm pretty sure it functions as is. Not sure if this is posted here already, didn't look too hard. 1>open up your client project and open up ModTypes. 2>Search for "Public Const SPELL_TYPE_GIVEITEM = 6" (without quotes) 3> add Code: Public Const SPELL_TYPE_TELEPORT= 7 (or the next number, if you allready added more types) then goto frmSpelleditor and make a frame called "fraWarp" Set the .visible of "fraWarp" to False on there make 3 Horizontal scroll bars. 4> name the first "scrlMapnum", the second "scrlMapX" and the third "scrlMapY". 5> make labels to display each scroll bar's value "Mapnum", "lblMapX" and "lblMapY", in the same order as the scroll bars 6> Paste this into frmSpellEditor Code: Private Sub scrlMapnum_Change() MapNum.Caption = scrlMapnum.Value End Sub Private Sub scrlMapX_Change() lblMapX.Caption = scrlMapX.Value End Sub Private Sub scrlMapY_Change() lblMapY.Caption = scrlMapY.Value End Sub Private Sub Form_Load() scrlMapnum.Max = MAX_MAPS scrlMapX.Max = MAX_MAPX scrlMapY.Max = MAX_MAPY End Sub In the "Private Sub cmbType_Click()" Under: Code: If cmbType.ListIndex <> SPELL_TYPE_GIVEITEM Then fraVitals.Visible = True fraGiveItem.Visible = False Else fraVitals.Visible = False fraGiveItem.Visible = True End If Add: Code: If cmbType.ListIndex <> SPELL_TYPE_WARP Then fraVitals.Visible = True fraWarp.Visible = False Else fraVitals.Visible = False fraWarp.Visible = True End If Then goto the properties window of cmbType and find the "List" property then press the arrow, under "Give item" type "Teleport" 7> open up modGameLogic and find "Public Sub SpellEditorOk()" Under: Code: If Spell(EditorIndex).Type <> SPELL_TYPE_GIVEITEM Then Spell(EditorIndex).Data1 = frmSpellEditor.scrlVitalMod.Value Else Spell(EditorIndex).Data1 = frmSpellEditor.scrlItemNum.Value Spell(EditorIndex).Data2 = frmSpellEditor.scrlItemValue.Value Spell(EditorIndex).Data3 = 0 (the data3 may not be here, but outside the End If) End If Add: Code: If Spell(EditorIndex).Type = SPELL_TYPE_WARP Then Spell(EditorIndex).Data1 = frmSpellEditor.scrlMapnum.Value Spell(EditorIndex).Data2 = frmSpellEditor.scrlMapX.Value Spell(EditorIndex).Data3 = frmSpellEditor.scrlMapY.Value End If 8> then search for "Public Sub Spelleditorinit()" Under: Code: If Spell(EditorIndex).Type <> SPELL_TYPE_GIVEITEM Then frmSpellEditor.fraVitals.Visible = True frmSpellEditor.fraGiveItem.Visible = False frmSpellEditor.scrlVitalMod.Value = Spell(EditorIndex).Data1 Else frmSpellEditor.fraVitals.Visible = False frmSpellEditor.fraGiveItem.Visible = True frmSpellEditor.scrlItemNum.Value = Spell(EditorIndex).Data1 frmSpellEditor.scrlItemValue.Value = Spell(EditorIndex).Data2 End If Add: Code: If Spell(EditorIndex).Type = SPELL_TYPE_WARP Then frmSpellEditor.fraVitals.Visible = False frmSpellEditor.fraGiveItem.Visible = False frmSpellEditor.fraWarp.Visible = True frmSpellEditor.scrlMapnum.Value = Spell(EditorIndex).Data1 frmSpellEditor.scrlMapX.Value = Spell(EditorIndex).Data2 frmSpellEditor.scrlMapY.Value = Spell(EditorIndex).Data3 frmSpellEditor.MapNum.Caption = frmSpellEditor.scrlMapnum.Value frmSpellEditor.lblMapX.Caption = frmSpellEditor.scrlMapX.Value frmSpellEditor.lblMapY.Caption = frmSpellEditor.scrlMapY.Value End If Now you're done for the client side. Now open up your server project and again just like the client side add the type in modTypes Code: Public Const SPELL_TYPE_TELEPORT= 7 Now open modGameLogic, and search for: "If Spell(SpellNum).Type = SPELL_TYPE_GIVEITEM Then" under that add: Code: If Spell(SpellNum).Type = SPELL_TYPE_WARP Then
Dim Moved As Byte n = Player(Index).Target If Player(Index).TargetType = TARGET_TYPE_PLAYER Then If IsPlaying(n) Then Call PlayerWarp(n, Spell(SpellNum).Data1, Spell(SpellNum).Data2, Spell(SpellNum).Data3) Call PlayerMsg(Index, "You have teleported " & GetPlayerName(n), BrightBlue) Call PlayerMsg(n, "You have been teleported by " & GetPlayerName(Index), BrightBlue) Moved = YES Else Call PlayerMsg(Index, GetPlayerName(n) & " is not online", BrightRed) End If Else Call PlayerMsg(Index, "You can't teleport NPC'S", BrightRed) End If Casted = True Exit Sub End If |
|
| Author: | Labmonkey [ Sun Aug 24, 2008 11:27 pm ] |
| Post subject: | Re: Teleport Spell |
why cant we warp npcs? |
|
| Author: | Rian [ Sun Aug 24, 2008 11:28 pm ] |
| Post subject: | Re: Teleport Spell |
Because you touch yourself at night. |
|
| Author: | Robin [ Sun Aug 24, 2008 11:37 pm ] |
| Post subject: | Re: Teleport Spell |
Put your hand up if you want Labmonkey banned. |
|
| Author: | Lea [ Sun Aug 24, 2008 11:43 pm ] |
| Post subject: | Re: Teleport Spell |
-raises hand- |
|
| Author: | Robin [ Sun Aug 24, 2008 11:45 pm ] |
| Post subject: | Re: Teleport Spell |
Good enough reason for me. |
|
| Author: | GIAKEN [ Sun Aug 24, 2008 11:47 pm ] |
| Post subject: | Re: Teleport Spell |
-raises hand- More of a reason! |
|
| Author: | Robin [ Sun Aug 24, 2008 11:57 pm ] |
| Post subject: | Re: Teleport Spell |
Hey, let's go ban him from OGCore as well! Go go go! |
|
| Author: | GIAKEN [ Mon Aug 25, 2008 12:15 am ] |
| Post subject: | Re: Teleport Spell |
DONE! |
|
| Author: | Robin [ Mon Aug 25, 2008 12:18 am ] |
| Post subject: | Re: Teleport Spell |
Yeah, we're awesome! |
|
| Author: | Hikaru [ Mon Aug 25, 2008 2:45 am ] |
| Post subject: | Re: Teleport Spell |
Is he really banned? |
|
| Author: | Lea [ Mon Aug 25, 2008 2:54 am ] |
| Post subject: | Re: Teleport Spell |
we're freee! |
|
| Author: | GIAKEN [ Mon Aug 25, 2008 3:00 am ] |
| Post subject: | Re: Teleport Spell |
Hikaru wrote: Is he really banned? Are you calling me and Robin liars? |
|
| Author: | Acruno [ Mon Aug 25, 2008 10:15 am ] |
| Post subject: | Re: Teleport Spell |
GIAKEN wrote: Are you calling me and Robin liars? Blasphemy. |
|
| Page 1 of 1 | All times are UTC |
| Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |
|