Print Page | Close Window

Movement Tiredness

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=199
Printed Date: 20 December 2006 at 5:53pm
Software Version: Web Wiz Forums 8.01 - http://www.webwizforums.com


Topic: Movement Tiredness
Posted By: Sync
Subject: Movement Tiredness
Date Posted: 11 February 2006 at 3:27pm
Difficulty: Easy 2/5

Berserker made htis one, props to him for an excellent code. (one that I used myself ):
Tutorial for adding in movement (tiredness) for when u move and fight. It lowers SP and then regens.

its upto you how u expand on it (eg. u might not want this for walking). Actual combat effectiveness or whatever with low movement
is upto you to do.


Im using the variable SP for movement which is already set up for SP regenning.

Server Side

in ModGameLogic put this in Sub AttackPlayer AND into Sub AttackNpc


Code:

' Drop the SP
If GetPlayerSP(Attacker) > 0 Then
Call SetPlayerSP(Attacker, GetPlayerSP(Attacker) - 1)
Call SendSP(Attacker)
End If



Then (still in ModGameLogic) put this in Sub PlayerMove


Code:

If Moved = YES Then
'reduce SP by 1 when moving
' Drop the SP
If GetPlayerSP(Index) > 0 Then
Call SetPlayerSP(Index, GetPlayerSP(Index) - 1)
Call SendSP(Index)
End If
End If



I hope this is good enough for a tutorial. Apologies if not. I got some help from dave and anthony - so its not totally all mine. although i did good! and all the extra stuff (i didnt put in here - unless ppl request an expansion) is mine wooooooooot!

Ive also added this into casting spells and added a bar under the sprite for movement (tiredness), and movement affects your combat and spell casting power. if you would like to see this code then let me know and ill gladly post it.

works great woot!



Print Page | Close Window

Bulletin Board Software by Web Wiz Forums version 8.01 - http://www.webwizforums.com
Copyright ©2001-2006 Web Wiz Guide - http://www.webwizguide.info