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

Help (script additions)


Jiaman
 Share

Recommended Posts

Ok,I got scripts and everything like that..how do i enter them to the game?
do i paste them at the bottom of main.ini?
Also how do i put them into the game then? and what does that case# mean? (i mean what does case mean not the hash key)
People say if the case is 5 then i when i go into the game use script 5…i've tried but doesnt work, anyhelp?

Edited post title; please use more descriptive topic names than just "Help"
Link to comment
Share on other sites

TIP: read scripting turtials.

i had just the same problems as you at the begin :P but with thanks to godlord, he helped me.
you just have to search the right place to put it, sometimes its hard, i know, i got the same problem ;)
just try it:

if you want to place a scripted spell you do something like this:

Case 1
      ' Home tele
      if GetPlayerMP( Index) > 19 then
            Call PlayerWarp( Index, 1, 9, 6)
            Call PlayerMsg( Index, "Teleported Home", 14)
            Call SetPlayerMP( Index, GetPlayerMP( Index) - 20)
            Call SendMP( Index)
        Else
            Call BattleMsg( index, "Not enough mana!", 12, 0)
        End If

this is an teleport spell, just do in ur main ctr + f and search for 'scripted spell'
then you will find case's the cases says the #number wort.
start always at 1, not what you do 5.

just change the case #5 to #1 ;)

and dont do #1 #3 #2 #5 # 4, but do: #1 #2 #3 #4 #5.
well, i hope this helped you a bit but just use the turtials.. ;)
Link to comment
Share on other sites

@Jiaman:

> Ok,I got scripts and everything like that..how do i enter them to the game?
> do i paste them at the bottom of main.ini?
> Also how do i put them into the game then? and what does that case# mean? (i mean what does case mean not the hash key)
> People say if the case is 5 then i when i go into the game use script 5…i've tried but doesnt work, anyhelp?

Scripts are placed under the corresponding sub listed with the script you're trying to use(Sub ScriptedNpc(Index), ect.), on an open case #, before end sub, when applied to scripted NPCs, scripted tiles, scripted items, and scripted spells.

@teh:

> Sub ScriptedSpell(Index, Script)
> Select Case Script
> Case 0
> Call PlayerMsg(Index, "This scripted spell has no apparent use.", WHITE)
>
> Exit Sub
>
> Case 1
>       ' Home tele
>       if GetPlayerMP( Index) > 19 then
>             Call PlayerWarp( Index, 1, 9, 6)
>             Call PlayerMsg( Index, "Teleported Home", 14)
>             Call SetPlayerMP( Index, GetPlayerMP( Index) - 20)
>             Call SendMP( Index)
>         Else
>             Call BattleMsg( index, "Not enough mana!", 12, 0)
>         End If
>
> Case Else
> Call PlayerMsg(Index, "No spell script found. Please contact an admin to solve this problem.", WHITE)
>
> Exit Sub
> End Select
> End Sub

        = The script you're trying to implement, in this case, a scripted spell.

If you're implementing scripts that are pre-made, they'll list which sub you need to place the script under. In most cases, it will be after Sub blahblah(Index), and before Exit Sub, unless you're adding an entirely new function to it(Ex. Godlord's inventory script).

If you're looking to start making scripts yourself, you'll need to look into sad script, tutorials and a list of functions of which can be found under scripting on the forum.
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...