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

How do i actually make my character fight?


dannyboy
 Share

Recommended Posts

your luckey. i just refreshed my page. lol. so anyways. defender requested for a script and sb soul and mikey replyed to it.

its a script that goes over the on attack sub command
@[SB:

> Soul link=topic=54976.msg583194#msg583194 date=1260229266]
> Bleh, that won't work Mikey, that means it lasts like .00001 seconds.
>
> Here's one that lasts 1 second.
>
> ```
> ' Executes when a player presses the CONTROL key.
> Sub OnAttack(Index, Damage)
>   Dim Target
>
>   If Int(Damage) > 0 Then
>       If Int(GetPlayerTarget(Index)) > 0 Then
>         Target = GetPlayerTarget(Index)
>         Call DamagePlayer(Index, Target, Damage)
>       Else
>         Target = GetPlayerTargetNpc(Index)
>         Call DamageNPC(Index, Target, Damage)
>       End If
>   End If
>   Call SetTimer("SpriteReturn " & index & ", " & GetPlayerSprite(index), 1000)
> Select Case GetPlayerSprite(index)
> Case 1
> Call SetPlayerSprite(index, 10)
> Case 2
> Call SetPlayerSprite(index, 20)
> End Select
> Call SendPlayerData(index)
> End Sub
>
> Sub OnArrowHit(Index, Damage)
>   Dim Target
>
>   If Int(Damage) > 0 Then
>       If Int(GetPlayerTarget(Index)) > 0 Then
>         Target = GetPlayerTarget(Index)
>         Call DamagePlayer(Index, Target, Damage)
>       Else
>         Target = GetPlayerTargetNpc(Index)
>         Call DamageNPC(Index, Target, Damage)
>       End If
>   End If
>   Call SetTimer("SpriteReturn " & index & ", " & GetPlayerSprite(index), 1000)
> Select Case GetPlayerSprite(index)
> Case 1
> Call SetPlayerSprite(index, 10)
> Case 2
> Call SetPlayerSprite(index, 20)
> End Select
> Call SendPlayerData(index)
> End Sub
>
> ```
> Adding more, just add a new case.
>
> Like if the player sprite is 10, and you want to change it to 50, then do this:
>
> Case 10
> Call SetPlayerSprite(index, 50)
>
> Before the End Select
>
> Bottom of main
> ```
> Sub SpriteReturn(index, Sprite)
> Call SetPlayerSprite(index, Sprite)
> Call SendPlayerData(index)
> Call RemoveTimer("SpriteReturn " & index & ", " & GetPlayerSprite(index))
> End Sub
>
> ```

all you have to do is say that if your sprite number is 1, and you want it to be 2, you just switch the numbers of change sprite.

all it does is give you battle animations like a slash down.
http://www.touchofdeathforums.com/smf/index.php/topic,54976.0.html
Link to comment
Share on other sites

and to use a spell..well create one and learn it by making an item to learn the spell, click on the spell in the spell menu, target the npc you want to attack with the spell (if it's an attacking one) and press insert. VOILA
there are some tutorials about all the buttons somewhere, browse the forum a bit
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...