Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Still sailing… please?


Pasketi
 Share

Recommended Posts

Okay, now my sailing script is:

```
Sub ScriptedTile(Index, Script)
Select Case Script
Case 0
Call PlayerMsg(Index, "This scripted tile has no apparent use.", WHITE)
Exit Sub
Case 2
  If CanTake(Index, 3, 1) = False Then
      Call PlayerMsg(index, "You have not permissions to board the ship! You need a ship!", 4)
  Call PlayerWarp(index, 1, 3, 17)
  Else
    If int(GetPlayerSprite(index)) <> 80 Then
      Call PutVar("accounts\" & GetPlayerLogin(index) &".ini", "CHAR" & GetPlayerCharNum(index), "noboat", GetPlayerSprite(index))
      Call SetPlayerSprite(index, 80)
      Call PlayerMsg(index, "You begin to set sail from isle Gordas.", 2)     
      Call PlayerWarp(index, 10, 25, 15)
      Call SetPlayerSTR(Index, GetPlayerSTR(Index) + 50)
      Call SetPlayerDEF(Index, GetPlayerDEF(Index) + 50)
      Call SendPlayerData(index)   
                End If
  End If
Case 3 
  Dim Sprite
  Sprite = int(GetVar("accounts\" & GetPlayerLogin(index) &".ini", "CHAR" & GetPlayerCharNum(index), "noboat"))
  If int(GetPlayerSprite(index)) = 80 Then
      Call SetPlayerSprite(index, Sprite)
      Call PlayerMsg(index, "You have docked to Isle Gordas.", 2)
      Call PlayerWarp(index, 1, 1, 17)
      Call SetPlayerSTR(Index, GetPlayerSTR(Index) - 50)
      Call SetPlayerDEF(Index, GetPlayerDEF(Index) - 50)
      Call SendPlayerData(index)
  Else
      Call PlayerMsg(index, "Step onto the water to begin sailing", 2)
  End If

Case 4
  If CanTake(Index, 3, 1) = False Then
      Call PlayerMsg(index, "You have not permissions to board the ship! You need a ship!", 4)
  Call PlayerWarp(index, 1, 3, 17)
  Else
    If int(GetPlayerSprite(index)) <> 80 Then
      Call PutVar("accounts\" & GetPlayerLogin(index) &".ini", "CHAR" & GetPlayerCharNum(index), "noboat", GetPlayerSprite(index))
      Call SetPlayerSprite(index, 80)
      Call PlayerMsg(index, "You begin to set sail from Savage Isle.", 2)     
      Call PlayerWarp(index, 10, 18, 13)
      Call SetPlayerSTR(Index, GetPlayerSTR(Index) + 50)
      Call SetPlayerDEF(Index, GetPlayerDEF(Index) + 50)
      Call SendPlayerData(index)   
                End If
  End If
Case 5 
  Sprite = int(GetVar("accounts\" & GetPlayerLogin(index) &".ini", "CHAR" & GetPlayerCharNum(index), "noboat"))
  If int(GetPlayerSprite(index)) = 80 Then
      Call SetPlayerSprite(index, Sprite)
      Call PlayerMsg(index, "You have docked to Savage Isle.", 2)
      Call PlayerWarp(index, 25, 15, 27)
      Call SetPlayerSTR(Index, GetPlayerSTR(Index) - 50)
      Call SetPlayerDEF(Index, GetPlayerDEF(Index) - 50)
      Call SendPlayerData(index)
  Else
      Call PlayerMsg(index, "Step onto the water to begin sailing", 2)
  End If
Case Else
Call PlayerMsg(Index, "No tile script found. Please contact an admin to solve this problem.", WHITE)
Exit Sub     

End Select
End Sub
```
And:

```
Sub OnDeath(Index)
Dim MapNum
Dim ClassID
Dim X
Dim Y 
Dim Sprite
    Sprite = int(GetVar("accounts\" & GetPlayerLogin(index) &".ini", "CHAR" & GetPlayerCharNum(index), "noboat"))

    If GetPlayerMap(Index)=10 then
    Call SetPlayerSTR(Index, GetPlayerSTR(Index) - 50)
    Call SetPlayerDEF(Index, GetPlayerDEF(Index) - 50)
  If int(GetPlayerSprite(index)) = 80 Then
      Call SetPlayerSprite(index, Sprite)
      Call PlayerMsg(index, "Your ship sunk and you have been washed to the sore.", 2)
Else
End If
End If
If GetMapBootMap(Index) > 0 Then
Call PlayerWarp(Index, GetMapBootMap(Index), GetMapBootX(Index), GetMapBootY(Index))
Else
ClassID = GetPlayerClass(Index)

MapNum = GetVar("Classes\Class" & ClassID & ".ini", "CLASS", "Map")

X = GetVar("Classes\Class" & ClassID & ".ini", "CLASS", "x")
Y = GetVar("Classes\Class" & ClassID & ".ini", "CLASS", "y")

Call PlayerWarp(Index, MapNum, X, Y)
End If
End Sub
```
Now i'd like to remove players equipment and prevent him to put them back on at sea (map nr 10) Except the cannon (hmm… let's say item number 30, prevented on land, allowed on map number 10=sea). I'd like also to prevent all spells except "Explode ammo" (It would be prevented to cast on land how? spell number... 10)

How would you do it? I got the inventoryscript installed...

EDIT: also it would be much appreciated, if someone told me how i can use more than one ship.

Advanced:

Select Case
'Light Sloop
Case 1
If Can_take(Index,  3, 1) then
*Sailing script

'Galleon
Case 2
If Can_take(Index, 50, 1) then
*Modified sailing script

So how can i get Galleon above the other ship? If i got both boarding permissions but i want to only use the better one, how should i do it.

All should be in Sub ScriptedTile
Link to comment
Share on other sites

For the multiple ships thing, you can just do this:
Case 1
If [the player has permissions for galleon] Then
'modified sailing script
ElseIf [the player has permissions for light sloop] Then
'sailing script
End If

You only need 1 case to make it work.  Also, note ElseIf is one word.

For items, you can just take everything away from the player's inventory (remember to save it to a .ini file), except the cannon, and give it back when the player steps onto land.  For spells, you could do something similar. 

I'll leave it to you to figure out the exact code, since you seem competent.
Link to comment
Share on other sites

Is there a up to date tutorial? How can i add buttons there and what are the value for them? Is it easy to do a custom menu? 1-5? please details! I'm… 2-3/5, can i do it in... let's say... 3-4 hours?
EDIT: Don't forget my first request:
@Pasketi:

> Now i'd like to remove players equipment and prevent him to put them back on at sea (map nr 10) Except the cannon (hmm… let's say item number 30, prevented on land, allowed on map number 10=sea). I'd like also to prevent all spells except "Explode ammo" (It would be prevented to cast on land how? spell number... 10)
>
> How would you do it? I got the inventoryscript installed...
Link to comment
Share on other sites

:huh: When?? and can you give me the links, because i don't know what i'm looking for in english?

And i'll try with that tutorial… I'll post if i screw something up :)

EDIT: Dear, i'm blind!!
But... well i'll try first  :icon_crap:
Link to comment
Share on other sites

Instead of asking a tonne of questions like so:@Pasketi:

> Is there a up to date tutorial? How can i add buttons there and what are the value for them? Is it easy to do a custom menu? 1-5? please details! I'm… 2-3/5, can i do it in... let's say... 3-4 hours?
> EDIT: Don't forget my first request:

Ask one question. When you finish it, ask another question, NO ONE will really help if they just see onslaught after onslaught of questions…
i know i wouldnt.
Link to comment
Share on other sites

Ok…. But i got it now. FREAKING MUCH CODE FOR 9 BOATS °__° I need to make a template for future islands  :lipsrsealed:

But the first question is still open. @DarkMazer:

> For items, you can just take everything away from the player's inventory **(remember to save it to a .ini file)**, except the cannon, and give it back when the player steps onto land.  For spells, you could do something similar. 
>
> I'll leave it to you to figure out the exact code, since you seem competent.

The problem here is i haven't got a clue how would i do it. Yes, inventory is good, but the enemy ships drop items/currency, so they…. wait, can i make a secondary bag for sailing-items? or do i need to know VB for that? I need details, or i can't do it.

Please....

Questions open:
Item equip prevention on particular maps
Spell usage prevention on particular maps

Questions solved:
More ships/custom Menu
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...