Author Topic: [Module | Unit] Casting  (Read 5814 times)

0 Members and 1 Guest are viewing this topic.

Offline Crome969Topic starter

  • Moderator
  • *
  • *****
  • Posts: 2098
  • Activity:
    0%
  • Reputation Power: 25
  • Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.
  • Gender: Male
  • UO Enthusiast
  • Respect: +211
  • Referrals: 10
    • View Profile
    • ScriptSDK
[Module | Unit] Casting
« on: January 03, 2013, 07:52:46 AM »
0
Unit Casting

Header
Spoiler: show

[code]=================================================================
 Script Name: Crome's Casting Unit
 Author: Crome969 AKA Jan Siems
 Version: 1
 Shard OSI / FS: OSI
 Revision Dates: 01\03\2013
 Public Release: 01\03\2013
 Purpose: Unit to handle Casting
 Credits: Endless Night & Trailmyx for Licence

=================================================================
 (c) 2005-2013 Crome696 - All Rights Reserved
  Please respect my property rights.. :)
=================================================================
 Disclaimer:  By downloading, copying, running or otherwise using
 this script, you accept the contents of this limited personal use
 licence agreement.
 This script is only authorized to be distributed on www.Scriptuo.com.
 If you purchase this script, or acquire it from any other source, it
 is not considered an authorized copy and should be deleted immediately.
 Crome969 AKA Jan Siems(Author) provides no warranty for use, function,
 or safe interaction with any software or hardware. User downloads and
 runs this script at his-her own risk. User shall hold Author and the
 distribution site www.scriptuo.com harmless for any loss of items,
 accounts, money, virtual currency or items associated with the use of
 this script. User shall hold the author harmless for any consequences
 that may result from the use of this script as intended.  Furthermore,
 you promise not to distribute or sell this script to anyone without
 the express permission of the author, Crome696 AKA Jan Siems.
 Violation of this agreement will result in one or more of the following:
 litigation, www.scriptuo.com account termination, bad karma for your
 next life, and most definitely causing a black mark placed on your soul.

 This Script will never become by any definition of the words "Abandon ware",
 this script will always remain the property of the author unless
 rights are transfered by auther in writing (not email Writing).

 I worked very hard to bring this script to you, so please use it
 responisibily and respectfully.  If you have any questions, please
 reach me at jsiems87@googlemail.com

 (c) 2005-2013 Crome696 - All Rights Reserved
 Please respect my property rights.. :)
===================================================================
 Additional Licence to Use Agreement: You are free to use this script for not
 for profit personal UO gameplay. You are *NOT* free to repost,
 modify and repost, post on other websites, post as part of a script
 or work you yourself have created, email or transfer to another
 person by any method, or otherwise distribute without written
 permision from the author. This Applies to the script as a whole and
 any given part of the script.
 This license to use can be changed at any time for any reason.
 If in doubt dont do it contact the author.

 Commercial usage of any kind requires written permission from the author.

 (c) 2005-2013 Crome696 - All Rights Reserved
 Please respect my property rights.. :)
===================================================================
===================================================================
 NOTE: My scripts or any derivative of them are *not* for use in other players script!
 EXCEPTION : This Unit can be used to handle & support your own Scripts.
             Modifying this Unit is probhited without written permission from Author!
===================================================================
===================================================================
[/code]

Introduction
Spoiler: show

Today i want to publish my small Unit to handle Casting. Who not camed into Situation in past to try to perform a rtc critical casting.
These Functions and its members has been tested through PVP related casting & Writing Casting Trainers..
If you find any Issues , Bugs please feel free to report it to me...

Variables
Spoiler: show

[code]Const CastInterruptMessages[/code]
Containing Constant Interrupt Message for Casting Function in Combination of Journalhandling
[code] var CanCast:TDateTime;[/code]
Containing Date and Time when next Cast will be allowed. This Variable is calculated by FCR Computating

Functions
Spoiler: show

[code]Function ComputateFCR(FCR:Integer):Integer;[/code]
Returns the timespan until you will be able to recast. Calculated by your given amount of FCR.
[code]Function ComputateFC(BaseDelay:Integer;FC:Integer;IsProthed:Boolean):Integer;[/code]
Returns the timespan until you should be done with casting. Calculated by your CastDelay in ms - Delay Shortening is Calculated by FC & Protection State.
[code]Function ComputateLMC(CurMana,LMC:Integer):Integer;[/code]
Returns Amount of Mana after calculated with LMC.
[code]Function Cast2Object(SpellName:String;TargetID,Delay,FC,FCR,LMC,ReqMana:Integer;IsProth:Boolean):Boolean;[/code]
This Function will Cast a spell , wait until you got a TargetCursor or fizzled Casting. Then Target an Object (Player , Item ). Computating Manausage\Delay Timers with ComputateFCR and ComputateLMC. This will be your friend if you use Spells like Fireball or Magic Arrow or other Targetbased Spells....
Always returns if you suceed or not..
[code]Function Cast2Tile(SpellName:String;X,Y,Z,Delay,FC,FCR,LMC,ReqMana:Integer;IsProth:Boolean):Boolean;[/code]
Same Functionality like Cast2Object but for targeting Tile Positions. Your friend when using Teleport or Energy Field or such Spells..
Always returns if you suceed or not..
[code]Function Cast2Wait(SpellName:String;Delay,FC,FCR,LMC,ReqMana:Integer;IsProth:Boolean):Boolean;[/code]
Similar Functionality like Cast2Tile or Cast2Object. Used for Spells were Timespan to Cast can be X but no TargetCursor will appear. Will Computate Max CastDelay and Check if you suceed or not.
Always returns if you suceed or not..

Samples
Spoiler: show

[code]Cast2Wait('Wraith Form',1150,0,0,8,17,False);[/code]
Trying to Cast Wraith Form on yourself.Without Targeting
[code]Cast2Object('Heal',Self,500,0,0,8,4,False);[/code]
Trying to Cast Mini Heal on yourself. With Targeting..
[code]Cast2Tile('Blade Spirits',GetX(Self),GetY(Self),GetZ(Self),500,0,0,8,4,False);[/code]
Try to Cast Blade Spirits , Target Ground you Stay.With Targeting..

Howto Use
Spoiler: show

1) Save the Attachment [b]Casting.pas[/b] Into Your Stealth Folder\Scripts
2) Open your Script and below of your Programmname add :
[code]Uses Casting;[/code]
3) Enjoy using my Unit :)


Update Version 3
Hotfix on CanCast  Time Calculation to prevent "Years" delay instead of "Milisecond" delay..
Should now work on Cast2Object and Cast2Tile like on Cast2Wait

Update Version 2
  • Hotfix in Calculate LMC -> Correcting Math issue

There are 1 attachment(s) in this post. You must register and post an acceptable introduction to download
Casting.pas
« Last Edit: January 03, 2013, 03:40:31 PM by Crome969 »

Offline Endless Night

  • Global Moderator
  • *
  • *
  • Posts: 5467
  • Activity:
    0%
  • Reputation Power: 62
  • Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!
  • Respect: +393
  • Referrals: 1
    • View Profile
Re: [Module | Unit] Casting
« Reply #1 on: January 07, 2013, 08:19:09 AM »
0
looks nice chrome
Outlaw Josey Wales - "Manwink, A Long Gone Scripty, and Endless are always teasing us with their private sections lol. What there realy saying is scripters rule and users drool."
Briza - "Your a living breathing vortex of usefulness."

Tags: