The following warnings occurred:
Warning [2] Use of undefined constant SAPI_NAME - assumed 'SAPI_NAME' (this will throw an Error in a future version of PHP) - Line: 3388 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3388 errorHandler->error
/showthread.php 116 build_archive_link
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/inc/functions.php 3324 build_forum_breadcrumb
/showthread.php 195 build_forum_breadcrumb
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/showthread.php 195 build_forum_breadcrumb
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 786 - File: showthread.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/showthread.php 786 errorHandler->error






Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Healing script
Author Message
Leonidas
Master
**

Posts: 277
Likes Given: 3
Likes Received: 13 in 12 posts
Joined: May 2013
Reputation: 1



Post: #1
Healing script
I'm wanting to add a couple of things to my script and it would be awesome if someone could give me a hand with this.

This healing script instantly heals and then there is a delay. I'm wanting the delay to decrease as a player's dex increases.

I'm also needing healing fails added to this.



PHP Code:
[ITEMDEF 0e21
DEFNAME=i_bandage 
TYPE
=t_eq_script 
WEIGHT
=0.1 
DUPELIST
=0ee9
VALUE
=
CATEGORY
=Items by Professions 
SUBSECTION
=Healer 
DESCRIPTION
=Clean Bandages 

ON
=@DClick
IF (<SRC.FINDID.i_heal_timer>)
src.sysmessage You must wait <SRC.FINDID.I_HEAL_TIMER.TIMERbefore you can heal again!
RETURN 
1
ENDIF
IF (<
TOPOBJ.UID>!=<SRC.UID>)
SRC.SYSMESSAGE You do not have any bandages on you!
ELSE
TARGET Who do you want to heal?
ENDIF
RETURN 
1

ON
=@TARGON_CHAR
VAR.HEAL <EVAL <SRC.HEALING>/50>
VAR.
ANAT <EVAL <SRC.ANATOMY>/100>
VAR.
SUA_COLOR=03
IF !(<SRC.TARG.HITS><<SRC.TARG.STR>) && !(<SRC.TARG.FLAGS>&statf_poisoned) && !(<SRC.TARG.FLAGS>&statf_dead)
RETURN 
1
ELSEIF (<SRC.TARG.FLAGS>&statf_poisoned) && (<SRC.HEALING>>30.0)
SRC.TARG.EFFECT 3,i_fx_heal_effect,6,15,1
SRC
.SOUND=SND_SPELL_CUre
SRC
.TARG.SPELLEFFECT s_cure,1000
SRC
.CONSUME i_bandage
SRC
.CONSUME i_bandage_bloody
SRC
.SYSMESSAGEUA You heal <SRC.TARG.NAME>'s poison.
ELSEIF (<SRC.TARG.FLAGS>&statf_dead) && (<SRC.HEALING>>99.9)
SRC.TARG.RESURRECT
SRC.EMOTE ressurect <SRC.TARG.NAME>
ELSEIF !(<SRC.TARG.FLAGS>&statf_poisoned) && !(<SRC.TARG.FLAGS>&statf_dead) && (<SRC.TARG.HITS><<SRC.TARG.STR>)
IF (<EVAL <SRC.TARG.HITS>+<VAR.HEAL>+<VAR.ANAT>>><SRC.TARG.STR>)
SRC.TARG.HITS=<SRC.TARG.STR>
ELSE
SRC.TARG.HITS=<SRC.TARG.HITS>+<VAR.HEAL>+<VAR.ANAT>
SRC.SYSMESSAGE You heal <SRC.TARG.NAME>
ENDIF
ELSE
SRC.SYSMESSAGE You'
re not a good enough healer to cure or resurrect someone
RETURN 1
ENDIF
SRC.CONSUME i_bandage
SRC
.NEWITEM i_bandage_bloody
SRC
.ACT.CONT=<SRC.UID>
SRC.NEWITEM i_heal_timer
SRC
.ACT.TIMER 6
SRC
.ACT.CONT <SRC.UID>
//IF (<SRC.HEALING><100.0) && (RAND(25)==1)
//SRC.HEALING=<SRC.HEALING>+1
//ELSEIF (<SRC.HEALING>>99.9) && (<SRC.HEALING><200.0) && (RAND(50)==1)
//SRC.HEALING=<SRC.HEALING>+1
//ELSEIF (<SRC.HEALING>>199.9) && (<SRC.HEALING><300.0) && (RAND(75)==1)
//SRC.HEALING=<SRC.HEALING>+1
//ELSEIF (<SRC.HEALING>>299.9) && (<SRC.HEALING><400.0) && (RAND(100)==1)
//SRC.HEALING=<SRC.HEALING>+1
//ELSEIF (<SRC.HEALING>>399.9) && (<SRC.HEALING><500.0) && (RAND(150)==1)
//SRC.HEALING=<SRC.HEALING>+1
//ENDIF
RETURN 1

[ITEMDEF i_heal_timer]
ID=i_worldgem_bit
NAME
=Healing Timer
LAYER
=layer_special
TYPE
=t_eq_script

ON
=@CREATE
ATTR
=0c
TIMER
=6

ON
=@TIMER
REMOVE
RETURN 1


////////////////////////
//Bandage Self Function
//By Majesty
////////////////////////

[function bandageself]
if (<
hits> = <str> )||(<hits> > <str> )
sysmessage=You are already fully healed.
return 
1
endif

IF (<
SRC.FINDID.i_heal_timer>)
src.sysmessage You must wait <act.timerseconds before you can heal again!
RETURN 
1
ENDIF
IF (<
TOPOBJ.UID>!=<SRC.UID>)
SRC.SYSMESSAGEUA 0ac 0 1 1 Bandages must be on you.
endif

if (<
findid.i_bandage>)
var.
lasttarget=<targ.uid>
targ=<uid>
findid.i_bandage.trigger=@targon_char
targ
=<var.lasttarget>
var.
lasttarget=
f_clear_sysmessage
return 1
else
sysmessage=You don't have any more Bandages.
return 0
endif


[function f_clear_sysmessage]
sysmessage=
sysmessage=
sysmessage=
sysmessage=
sysmessage=
sysmessage=
sysmessage=
sysmessage=
sysmessage=
sysmessage=
sysmessage=
sysmessage=
sysmessage=
sysmessage=
sysmessage=
sysmessage=
sysmessage=
sysmessage=
sysmessage=
sysmessage=
sysmessage=
sysmessage=
sysmessage=
sysmessage=
sysmessage= 
(This post was last modified: 11-04-2015 02:33 PM by Leonidas.)
11-04-2015 02:32 PM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Messages In This Thread
Healing script - Leonidas - 11-04-2015 02:32 PM

Forum Jump:


User(s) browsing this thread: 1 Guest(s)