Pastebin
API
tools
faq
paste
Login
Sign up
Please fix the following errors:
New Paste
Syntax Highlighting
-------- Cure Tier Changing Function -------- local cure_mp_cost = {['Cure'] = 8, ['Cure II'] = 24, ['Cure III'] = 46, ['Cure IV'] = 88, ['Cure V'] = 135, ['Cure VI'] = 227} -- Utility function for automatically adjusting the Cure spell being used to match HP needs and MP limits. -- Handle spell changes before attempting any precast stuff. function refine_cure(spell, action, spellMap, eventArgs) -- Only handles single-target cures. -- Get the estimated amount of HP the target of the spell is below max. -- Returns nil for targets outside of alliance (no info available). local missingHP = get_targets_missing_hp(spell) local preferredCure = spell.name -- If we have an estimated missing HP value, we can adjust the preferred spell used. if missingHP then -- Whm has high skill and up to Cure VI if player.main_job == 'WHM' then if missingHP < 150 then preferredCure = 'Cure' elseif missingHP < 350 then preferredCure = 'Cure II' elseif missingHP < 650 then preferredCure = 'Cure III' elseif missingHP < 1000 then preferredCure = 'Cure IV' elseif missingHP < 1600 then preferredCure = 'Cure V' else preferredCure = 'Cure VI' end -- Rdm, Sch and Pld have high skill and up to Cure IV elseif player.main_job == 'RDM' or player.main_job == 'SCH' or player.main_job == 'PLD' then if missingHP < 150 then preferredCure = 'Cure' elseif missingHP < 350 then preferredCure = 'Cure II' elseif missingHP < 650 then preferredCure = 'Cure III' else preferredCure = 'Cure IV' end -- Subbing /whm or /rdm gets you up to Cure IV elseif player.sub_job == 'WHM' or player.sub_job == 'RDM' then if missingHP < 150 then preferredCure = 'Cure' elseif missingHP < 300 then preferredCure = 'Cure II' elseif missingHP < 550 then preferredCure = 'Cure III' else preferredCure = 'Cure IV' end -- Subbing /sch or /pld gets you up to Cure III elseif player.sub_job == 'SCH' or player.sub_job == 'PLD' then if missingHP < 150 then preferredCure = 'Cure' elseif missingHP < 300 then preferredCure = 'Cure II' else preferredCure = 'Cure III' end else -- Not job main or sub that can cast Cure; bail out return end end local mpCost = cure_mp_cost[preferredCure] if buffactive['Light Arts'] or buffactive['Addendum: White'] then mpCost = math.floor(mpCost * 0.9) elseif buffactive['Dark Arts'] or buffactive['Addendum: Black'] then mpCost = math.floor(mpCost * 1.1) end local downgrade_msg -- Downgrade the spell to what we can actually afford if player.mp < mpCost and not (buffactive['Manafont'] or buffactive['Mana Well']) then if player.mp < 8 then add_to_chat(122, 'Insufficient MP ['..tostring(player.mp)..']. Cancelling.') if player.status == 'Engaged' then equip(sets.TP) elseif player.status == 'Resting' then equip(sets.Rest) else equip(sets.Idle) end cancel_spell() return elseif player.mp < 24 then preferredCure = 'Cure' elseif player.mp < 46 then preferredCure = 'Cure II' elseif player.mp < 88 then preferredCure = 'Cure III' elseif player.mp < 135 then preferredCure = 'Cure IV' elseif player.mp < 227 then preferredCure = 'Cure V' end downgrade_msg = 'Insufficient MP ['..tostring(player.mp)..']. Downgrading to '..preferredCure..'.' end if preferredCure ~= spell.name then cancel_spell() send_command('@input /ma "'..preferredCure..'" '..tostring(spell.target.raw)) if downgrade_msg then add_to_chat(122, downgrade_msg) end return end if missingHP and missingHP > 0 then add_to_chat(122,'Trying to cure '..tostring(missingHP)..' HP using '..preferredCure..'.') end end -------- Cure Tier Changing MP DEPENDANT (NOT HP DEPENDANT) Function -------- -- Utility function for automatically adjusting the Cure spell being used to match MP limits. -- Handle spell changes before attempting any precast stuff. function reduce_cure(spell, action, spellMap, eventArgs) -- Only handles single-target cures. local preferredCure = spell.name local mpCost = cure_mp_cost[preferredCure] if buffactive['Light Arts'] or buffactive['Addendum: White'] then mpCost = math.floor(mpCost * 0.9) elseif buffactive['Dark Arts'] or buffactive['Addendum: Black'] then mpCost = math.floor(mpCost * 1.1) end local downgrade_msg -- Downgrade the spell to what we can actually afford if player.mp < mpCost and not (buffactive['Manafont'] or buffactive['Mana Well']) then if player.mp < 8 then add_to_chat(122, 'Insufficient MP ['..tostring(player.mp)..']. Cancelling.') if player.status == 'Engaged' then equip(sets.TP) elseif player.status == 'Resting' then equip(sets.Rest) else equip(sets.Idle) end cancel_spell() return elseif player.mp < 24 then preferredCure = 'Cure' elseif player.mp < 46 then preferredCure = 'Cure II' elseif player.mp < 88 then preferredCure = 'Cure III' elseif player.mp < 135 then preferredCure = 'Cure IV' elseif player.mp < 227 then preferredCure = 'Cure V' end downgrade_msg = 'Insufficient MP ['..tostring(player.mp)..']. Downgrading to '..preferredCure..'.' end if preferredCure ~= spell.name then cancel_spell() send_command('@input /ma "'..preferredCure..'" '..tostring(spell.target.raw)) if downgrade_msg then add_to_chat(122, downgrade_msg) end return end end -------- Waltz Tier Changing Function -------- local waltz_tp_cost = {['Curing Waltz'] = 200, ['Curing Waltz II'] = 350, ['Curing Waltz III'] = 500, ['Curing Waltz IV'] = 650, ['Curing Waltz V'] = 800} -- Utility function for automatically adjusting the waltz spell being used to match HP needs and TP limits. -- Handle spell changes before attempting any precast stuff. function refine_waltz(spell, action, spellMap, eventArgs) -- Only handles single-target waltzes. -- Get the estimated amount of HP the target of the spell is below max. -- Returns nil for targets outside of alliance (no info available). local missingHP = get_targets_missing_hp(spell) local preferredWaltz = spell.name -- If we have an estimated missing HP value, we can adjust the preferred spell used. if missingHP then -- DNC has up to Curing Waltz V if player.main_job == 'DNC' then if missingHP < 230 then preferredWaltz = 'Curing Waltz' elseif missingHP < 420 then preferredWaltz = 'Curing Waltz II' elseif missingHP < 650 then preferredWaltz = 'Curing Waltz III' elseif missingHP < 850 then preferredWaltz = 'Curing Waltz IV' else preferredWaltz = 'Curing Waltz V' end -- Subbing /dnc gets you up to Curing Waltz III elseif player.sub_job == 'DNC' then if missingHP < 180 then preferredWaltz = 'Curing Waltz' elseif missingHP < 345 then preferredWaltz = 'Curing Waltz II' else preferredWaltz = 'Curing Waltz III' end else -- Not dnc main or sub; bail out return end end local tpCost = waltz_tp_cost[preferredWaltz] local downgrade_msg -- Downgrade the spell to what we can actually afford if player.tp < tpCost and not buffactive['Trance'] then if player.tp < 200 then add_to_chat(122, 'Insufficient TP ['..tostring(player.tp)..']. Cancelling.') if player.status == 'Engaged' then equip(sets.TP[TP_Set_Names[TP_Index]]) elseif player.status == 'Resting' then equip(sets.Rest) else equip(sets.Idle[Idle_Set_Names[Idle_Index]]) end cancel_spell() return elseif player.tp < 350 then preferredWaltz = 'Curing Waltz' elseif player.tp < 500 then preferredWaltz = 'Curing Waltz II' elseif player.tp < 650 then preferredWaltz = 'Curing Waltz III' elseif player.tp < 800 then preferredWaltz = 'Curing Waltz IV' end downgrade_msg = 'Insufficient TP ['..tostring(player.tp)..']. Downgrading to '..preferredWaltz..'.' end if preferredWaltz ~= spell.name then cancel_spell() send_command('@input /ja "'..preferredWaltz..'" '..tostring(spell.target.raw)) if downgrade then add_to_chat(122, downgrade_msg) end return end if missingHP and missingHP > 0 then add_to_chat(122,'Trying to waltz '..tostring(missingHP)..' HP using '..preferredWaltz..'.') end end -------- Waltz Tier Changing TP DEPENDANT (NOT HP DEPENDANT) Function -------- -- Utility function for automatically adjusting the Waltz spell being used to match TP limits. -- Handle spell changes before attempting any precast stuff. function reduce_Waltz(spell, action, spellMap, eventArgs) -- Only handles single-target Waltzes. local preferredWaltz = spell.name local tpCost = waltz_tp_cost[preferredWaltz] local downgrade_msg -- Downgrade the spell to what we can actually afford if player.tp < tpCost and not buffactive['Trance'] then if player.tp < 200 then add_to_chat(122, 'Insufficient TP ['..tostring(player.tp)..']. Cancelling.') if player.status == 'Engaged' then equip(sets.TP[TP_Set_Names[TP_Index]]) elseif player.status == 'Resting' then equip(sets.Rest) else equip(sets.Idle[Idle_Set_Names[Idle_Index]]) end cancel_spell() return elseif player.tp < 350 then preferredWaltz = 'Curing Waltz' elseif player.tp < 500 then preferredWaltz = 'Curing Waltz II' elseif player.tp < 650 then preferredWaltz = 'Curing Waltz III' elseif player.tp < 800 then preferredWaltz = 'Curing Waltz IV' end downgrade_msg = 'Insufficient TP ['..tostring(player.tp)..']. Downgrading to '..preferredWaltz..'.' end if preferredWaltz ~= spell.name then cancel_spell() send_command('@input /ja "'..preferredWaltz..'" '..tostring(spell.target.raw)) if downgrade then add_to_chat(122, downgrade_msg) end return end end -------- Miscellaneous Functions -------- function get_targets_missing_hp(spell) local missingHP -- If curing yourself, get our exact missing HP if spell.target.type == "SELF" then missingHP = player.max_hp - player.hp -- If curing someone in our alliance, we can estimate their missing HP elseif spell.target.isallymember then local target = find_player_in_alliance(spell.target.name) local est_max_hp = target.hp / (target.hpp/100) missingHP = math.floor(est_max_hp - target.hp) end return missingHP end function find_player_in_alliance(name) -- Attempt to locate a specified name within the current alliance. for party_index,ally_party in ipairs(alliance) do for player_index,_player in ipairs(ally_party) do if _player.name == name then return _player end end end end
Optional Paste Settings
Category:
None
Cryptocurrency
Cybersecurity
Fixit
Food
Gaming
Haiku
Help
History
Housing
Jokes
Legal
Money
Movies
Music
Pets
Photo
Science
Software
Source Code
Spirit
Sports
Travel
TV
Writing
Tags:
Syntax Highlighting:
None
Bash
C
C#
C++
CSS
HTML
JSON
Java
JavaScript
Lua
Markdown (PRO members only)
Objective C
PHP
Perl
Python
Ruby
Swift
4CS
6502 ACME Cross Assembler
6502 Kick Assembler
6502 TASM/64TASS
ABAP
AIMMS
ALGOL 68
APT Sources
ARM
ASM (NASM)
ASP
ActionScript
ActionScript 3
Ada
Apache Log
AppleScript
Arduino
Asymptote
AutoIt
Autohotkey
Avisynth
Awk
BASCOM AVR
BNF
BOO
Bash
Basic4GL
Batch
BibTeX
Blitz Basic
Blitz3D
BlitzMax
BrainFuck
C
C (WinAPI)
C Intermediate Language
C for Macs
C#
C++
C++ (WinAPI)
C++ (with Qt extensions)
C: Loadrunner
CAD DCL
CAD Lisp
CFDG
CMake
COBOL
CSS
Ceylon
ChaiScript
Chapel
Clojure
Clone C
Clone C++
CoffeeScript
ColdFusion
Cuesheet
D
DCL
DCPU-16
DCS
DIV
DOT
Dart
Delphi
Delphi Prism (Oxygene)
Diff
E
ECMAScript
EPC
Easytrieve
Eiffel
Email
Erlang
Euphoria
F#
FO Language
Falcon
Filemaker
Formula One
Fortran
FreeBasic
FreeSWITCH
GAMBAS
GDB
GDScript
Game Maker
Genero
Genie
GetText
Go
Godot GLSL
Groovy
GwBasic
HQ9 Plus
HTML
HTML 5
Haskell
Haxe
HicEst
IDL
INI file
INTERCAL
IO
ISPF Panel Definition
Icon
Inno Script
J
JCL
JSON
Java
Java 5
JavaScript
Julia
KSP (Kontakt Script)
KiXtart
Kotlin
LDIF
LLVM
LOL Code
LScript
Latex
Liberty BASIC
Linden Scripting
Lisp
Loco Basic
Logtalk
Lotus Formulas
Lotus Script
Lua
M68000 Assembler
MIX Assembler
MK-61/52
MPASM
MXML
MagikSF
Make
MapBasic
Markdown (PRO members only)
MatLab
Mercury
MetaPost
Modula 2
Modula 3
Motorola 68000 HiSoft Dev
MySQL
Nagios
NetRexx
Nginx
Nim
NullSoft Installer
OCaml
OCaml Brief
Oberon 2
Objeck Programming Langua
Objective C
Octave
Open Object Rexx
OpenBSD PACKET FILTER
OpenGL Shading
Openoffice BASIC
Oracle 11
Oracle 8
Oz
PARI/GP
PCRE
PHP
PHP Brief
PL/I
PL/SQL
POV-Ray
ParaSail
Pascal
Pawn
Per
Perl
Perl 6
Phix
Pic 16
Pike
Pixel Bender
PostScript
PostgreSQL
PowerBuilder
PowerShell
ProFTPd
Progress
Prolog
Properties
ProvideX
Puppet
PureBasic
PyCon
Python
Python for S60
QBasic
QML
R
RBScript
REBOL
REG
RPM Spec
Racket
Rails
Rexx
Robots
Roff Manpage
Ruby
Ruby Gnuplot
Rust
SAS
SCL
SPARK
SPARQL
SQF
SQL
SSH Config
Scala
Scheme
Scilab
SdlBasic
Smalltalk
Smarty
StandardML
StoneScript
SuperCollider
Swift
SystemVerilog
T-SQL
TCL
TeXgraph
Tera Term
TypeScript
TypoScript
UPC
Unicon
UnrealScript
Urbi
VB.NET
VBScript
VHDL
VIM
Vala
Vedit
VeriLog
Visual Pro Log
VisualBasic
VisualFoxPro
WHOIS
WhiteSpace
Winbatch
XBasic
XML
XPP
Xojo
Xorg Config
YAML
YARA
Z80 Assembler
ZXBasic
autoconf
jQuery
mIRC
newLISP
q/kdb+
thinBasic
Paste Expiration:
Never
Burn after read
10 Minutes
1 Hour
1 Day
1 Week
2 Weeks
1 Month
6 Months
1 Year
Paste Exposure:
Public
Unlisted
Private
Folder:
(members only)
Password
NEW
Enabled
Disabled
Burn after read
NEW
Paste Name / Title:
Create New Paste
Hello
Guest
Sign Up
or
Login
Sign in with Facebook
Sign in with Twitter
Sign in with Google
You are currently not logged in, this means you can not edit or delete anything you paste.
Sign Up
or
Login
Public Pastes
Google Docs - Exploit
3 min ago | 0.39 KB
Earn money on Changelly
CSS | 17 min ago | 0.39 KB
SwapEngine Bug [build 1.3]
30 min ago | 0.39 KB
Untitled
37 min ago | 1.01 KB
December smells like money
CSS | 43 min ago | 0.39 KB
✅ Changelly.com Exploit
56 min ago | 0.39 KB
coding and writing poetry
7 hours ago | 1.27 KB
UserScript - Hide Umingle video overlays
JavaScript | 9 hours ago | 1.97 KB
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the
Cookies Policy
.
OK, I Understand
Not a member of Pastebin yet?
Sign Up
, it unlocks many cool features!