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-nmm6 (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-nmm6 (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-nmm6 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/showthread.php 195 build_forum_breadcrumb






Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Respawn
Author Message
larmc20
Journeyman
*

Posts: 67
Likes Given: 0
Likes Received: 1 in 1 posts
Joined: May 2013
Reputation: 0



Post: #1
Respawn
Guys. I made animals scripts. it's almost done. But, the problem is when the player DIE the animal goes back to the respawn, where it's killed by the monsters.
I dont want it's going back to respawn. What I have to do?

PHP Code:
[CHARDEF c_poison_mustang]
NAME=Poison Mustang
ID
=c_horse_brown_dk
ICON
=i_pet_horse_brown_dk
ARMOR
=60

DESCRIPTION
=Poison Mustang
SUBSECTION
=Prismas
CATEGORY
=Novos monstros


ON
=@Create
COLOR
=07a5
STR
=60
DEX
=90
INT
=100

Events 
e_hits
SRC
.TAG.SHOWKILLS=1

PARRYING
={20.0 30.0}
MAGICRESISTANCE={30.0 35.0}
TACTICS={35.0 47.0}
WRESTLING={38.0 50.0}
taming=100.0

NPC
=brain_monster

FAME
={9000 10000}
KARMA={-8000 -9999
01-13-2014 03:48 AM
Find all posts by this user Like Post Quote this message in a reply
Alaric
Journeyman
*

Posts: 227
Likes Given: 7
Likes Received: 9 in 4 posts
Joined: Oct 2012
Reputation: 7



Post: #2
RE: Respawn
If you have custom animal taming, then set "HOME" of the pet -1,-1. Right when you tame it.

56b Prerelease does that by default.
(This post was last modified: 01-13-2014 03:51 AM by Alaric.)
01-13-2014 03:49 AM
Find all posts by this user Like Post Quote this message in a reply
XuN
Sphere Developer
*****

Posts: 852
Likes Given: 102
Likes Received: 156 in 119 posts
Joined: Jul 2013
Reputation: 30



Post: #3
RE: Respawn
At first you would have to change src.tag.showkills=1 to tag.showkills=1, if the character is created by another obj (char or item).

And you must show us the event e_hits, the problem must be related to it.
01-13-2014 03:53 AM
Find all posts by this user Like Post Quote this message in a reply
larmc20
Journeyman
*

Posts: 67
Likes Given: 0
Likes Received: 1 in 1 posts
Joined: May 2013
Reputation: 0



Post: #4
RE: Respawn
This event is only a speech
[Events e_hits]

ON=@Click

MESSAGE @0778

I use another Scriptof tame.

PHP Code:
[SKILL 35]
DEFNAME=Skill_Taming
KEY
=Taming
TITLE
=Animal Tamer
PROMPT_MSG
=@0257 Qual animal voce deseja tamar?
DELAY=8.0
STAT_STR
=30
STAT_INT
=40
STAT_DEX
=60
BONUS_STR
=30
BONUS_DEX
=10
BONUS_INT
=60
BONUS_STATS
=20
ADV_RATE
=10.0,200.0,800.0

ON
=@Success
Src
.sfx 0043
src
.events -e_sys_taming

on
=@select

IF !(<SRC.ACTION>=-1)
SRC.sysmessage @0480 Espere.
return 
1
ENDIF
IF <
SRC.FINDLAYER.56>
SRC.sysmessage @0480 Espere.
return 
1
ENDIF

ON=@START

if (<src.targ.karma> <= -800) && (!<src.findid.i_harpa_taming>)
 
SRC.sysmessage @0480 Voce precisa ter o kit Tamingstaff e harpacompleto para tamar este animal.
return 
1
ENDIF

if (<
src.targ.karma> <= -800) && (!<src.findid.I_staff_taming>)
 
SRC.sysmessage @0480 Voce precisa ter o kit Tamingstaff e harpacompleto para tamar este animal.
return 
1
ENDIF

 IF (<
SRC.ACT.ISITEM>)
SRC.SYSMESSAGE @0480 Voce deve domesticar um animal.
return 
1
ENDIF

IF !<
SRC.ACT.TAG.NPC>=0
SRC
.SYSMESSAGE @0480 Voce deve domesticar um animal.
return 
1
ENDIF

IF <
Src.TAMING> < <SRC.ACT.TAMING>
SRC.SYSMESSAGE @0480 Voce nao tem Skill necessaria para tamar esse animal!
return 
1
ENDIF

IF (<eval <
ACT.P.X>+-<SRC.P.X>>>3) || (<eval <SRC.P.X>+-<ACT.P.X>>>3) || (<eval <ACT.P.Y>+-<SRC.P.Y>>>3) || (<eval <SRC.P.Y>+-<ACT.P.Y>>>3)
SRC.SYSMESSAGE @0480 O animal esta muito longe.
RETURN 
1
ENDIF

IF (<
src.targ.MemoryFindType.MEMORY_IPET.LINK>)
SRC.SYSMESSAGE @0480 Este animal ja esta domesticado.
RETURN 
1
ELSE
SRC.CTAG.DOMADOR=<EVAL <SRC.TAMING>/50>+1>
SRC.EVENTS +e_sys_taming
SERV
.NEWITEM i_fix_taming
SERV
.NEW.EQUIP
SERV
.NEW.LINK=<SRC.TARG.SERIAL>
SERV.NEW.TIMER=3
SERV
.NEW.MOREX=<SRC.CTAG.DOMADOR>
DORAND 4
SRC
.SAY @<ACT.ColorBom <src.act.name>
SRC.SAY @<ACT.ColorEu vou cuidar bem de voce
SRC
.SAY @<ACT.ColorEu sempre quiz um <src.act.namecomo voce
SRC
.SAY @<ACT.ColorAqui <src.act.name>
ENDDO
TIMER
=3
RETURN 1
ENDIF

[
EVENTS e_sys_taming]

ON=@SKILLSELECT

ON
=@GETHIT
FINDID
.i_fix_taming.remove
src
.EVENTS -e_sys_taming
    SRC
.SYSMESSAGE @0480 Voce falhou ao tentar domar.

ON=@SPELLEFFECT
FINDID
.i_fix_taming.remove
src
.EVENTS -e_sys_taming
    SRC
.SYSMESSAGE @0480 Voce falhou ao tentar domar.

ON=@USERWARMODE
FINDID
.i_fix_taming.remove
src
.EVENTS -e_sys_taming
    SRC
.SYSMESSAGE @0480 Voce falhou ao tentar domar.


[
ITEMDEF i_fix_taming]
ID=I_MEMORY
NAME
=Tempo Taming
TYPE
=T_EQ_SCRIPT
LAYER
=56

ON
=@TIMER
IF (<MORE1><4)
IF (<eval <
LINK.P.X>+-<CONT.P.X>>>3) || (<eval <CONT.P.X>+-<LINK.P.X>>>3) || (<eval <LINK.P.Y>+-<CONT.P.Y>>>3) || (<eval <CONT.P.Y>+-<LINK.P.Y>>>3)
CONT.SYSMESSAGE @0480 Voce se distanciou muito do animal.
REMOVE
RETURN 1
ENDIF
DORAND 4
Cont
.SAY @<Link.ColorBom <Cont.act.name>
Cont.SAY @<Link.ColorEu vou cuidar bem de voce
Cont
.SAY @<Link.ColorEu sempre desejei um <Cont.act.namecomo voce
Cont
.SAY @<Link.ColorAqui <Cont.act.name>
ENDDO
TIMER
=3
MORE1 
= <MORE1> + 1
RETURN 1
ENDIF
MORE1 0
CONT
.EVENTS -e_sys_taming

if <Eval <Cont.Taming>> < 1000
Cont
.Taming=<Cont.Taming>+0.1
endif

Cont.TAG.CHANCET=<Eval (10-((1000-<Cont.Taming>)/100))+1>
Cont.TAG.PROBABILIDADET=<eval { <Eval <Cont.TAG.CHANCET>> }>


IF (<
CONT.targ.MemoryFindType.MEMORY_IPET.LINK>)
CONT.SYSMESSAGE @0480 Este animal ja esta domesticado.
REMOVE
RETURN 1
ENDIF 

if <Eval <
Cont.TAG0.CHANCET>> == <Eval <Cont.TAG0.PROBABILIDADET>>
SERV.NEWITEM i_memory
NEW.COLOR=042
NEW.LINK=<CONT.UID>
NEW.
CONT=<LINK.UID>
LINK.FLAGS = <LINK.FLAGS> & 08000000
LINK
.ALCHEMY=0
cont
.SYSMESSAGE @0257 Voce conseguiu domesticar <LINK.NAME>.
CONT.CURFOLLOWER += 1
CONT
.TAG.FOLLOW<dCONT.curfollower>=<LINK.UID>
REMOVE
return 1
else
if <Eval <
Cont.Taming>> > <Link.Tag.SKTAMING>
if <Eval <
Cont.TAG0.CHANCET>+1> == <Eval <Cont.TAG0.PROBABILIDADET>>
SERV.NEWITEM i_memory
NEW.COLOR=042
NEW.LINK=<CONT.UID>
NEW.
CONT=<LINK.UID>
LINK.FLAGS = <LINK.FLAGS> & 08000000
LINK
.ALCHEMY=0
cont
.SYSMESSAGE @0257 Voce conseguiu domesticar <LINK.NAME>.
CONT.CURFOLLOWER += 1
CONT
.TAG.FOLLOW<dCONT.curfollower>=<LINK.UID>
REMOVE
return 1
endif
if <Eval <
Cont.TAG0.CHANCET>+2> == <Eval <Cont.TAG0.PROBABILIDADET>>
SERV.NEWITEM i_memory
NEW.COLOR=042
NEW.LINK=<CONT.UID>
NEW.
CONT=<LINK.UID>
LINK.FLAGS = <LINK.FLAGS> & 08000000
LINK
.ALCHEMY=0
cont
.SYSMESSAGE @0257 Voce conseguiu domesticar <LINK.NAME>.
CONT.CURFOLLOWER += 1
CONT
.TAG.FOLLOW<dCONT.curfollower>=<LINK.UID>
REMOVE
return 1
endif
if <Eval <
Cont.TAG0.CHANCET>-1> == <Eval <Cont.TAG0.PROBABILIDADET>>
SERV.NEWITEM i_memory
NEW.COLOR=042
NEW.LINK=<CONT.UID>
NEW.
CONT=<LINK.UID>
LINK.FLAGS = <LINK.FLAGS> & 08000000
LINK
.ALCHEMY=0
cont
.SYSMESSAGE @0257 Voce conseguiu domesticar <LINK.NAME>.
CONT.CURFOLLOWER += 1
CONT
.TAG.FOLLOW<dCONT.curfollower>=<LINK.UID>
REMOVE
return 1
endif
if <Eval <
Cont.TAG0.CHANCET>-2> == <Eval <Cont.TAG0.PROBABILIDADET>>
SERV.NEWITEM i_memory
NEW.COLOR=042
NEW.LINK=<CONT.UID>
NEW.
CONT=<LINK.UID>
LINK.FLAGS = <LINK.FLAGS> & 08000000
LINK
.ALCHEMY=0
cont
.SYSMESSAGE @0257 Voce conseguiu domesticar <LINK.NAME>.
CONT.CURFOLLOWER += 1
CONT
.TAG.FOLLOW<dCONT.curfollower>=<LINK.UID>
REMOVE
return 1
endif
endif
cont.SYSMESSAGE @0480 Voce nao conseguiu domesticar <LINK.NAME>.
CONT.TIMER=-1
CONT
.ACTION=-1
REMOVE
return 1
endif

[Function 
ALTAMING

I don't know setting home..

On=@success
<src.targ.home> = -1,-1

Is this?
(This post was last modified: 01-13-2014 04:05 AM by larmc20.)
01-13-2014 03:55 AM
Find all posts by this user Like Post Quote this message in a reply
XuN
Sphere Developer
*****

Posts: 852
Likes Given: 102
Likes Received: 156 in 119 posts
Joined: Jul 2013
Reputation: 30



Post: #5
RE: Respawn
Then Alaric's anwser would be the solution, check for homedist or home on tamed npcs (LostNPCTeleport in sphere.ini will teleport them to their home if home.dist > LostNPCTeleport)
01-13-2014 04:00 AM
Find all posts by this user Like Post Quote this message in a reply
larmc20
Journeyman
*

Posts: 67
Likes Given: 0
Likes Received: 1 in 1 posts
Joined: May 2013
Reputation: 0



Post: #6
RE: Respawn
Thanks. I'll check.

I could create an event to all players.

Just check for me if the HOME.DIST is ok...

[event e_horseback_fix]
ON=@dismount
<argo.home.dist> == -1,-1
(This post was last modified: 01-13-2014 04:21 AM by larmc20.)
01-13-2014 04:08 AM
Find all posts by this user Like Post Quote this message in a reply
Alaric
Journeyman
*

Posts: 227
Likes Given: 7
Likes Received: 9 in 4 posts
Joined: Oct 2012
Reputation: 7



Post: #7
RE: Respawn
Pet's home is place where the npc sticks around. So, coords.

HOME=coords
HOMEDIST=how far from the home can pet go while wondering

Once you set home to -1,-1 when you tame the npc, you dont have to set it any more. You can also set homedist - I would suggest something around 3 cuz, finding a damn mount when you finally get to your corpse after 20 mins running and then another 10 mins finding your pet which is probably dead, isn't kind of enjoyment.

Code:
on=@success
   src.targ.home=-1,-1

should be ok.

EDIT: Just tried and if home is set -1,-1 then it ignores homedist I guess... NPC goes even further. So, if you don't want them to run away, on=@dismount
argo.home=<argo.p>
argo.homedist=3
(This post was last modified: 01-13-2014 04:49 AM by Alaric.)
01-13-2014 04:40 AM
Find all posts by this user Like Post Quote this message in a reply
larmc20
Journeyman
*

Posts: 67
Likes Given: 0
Likes Received: 1 in 1 posts
Joined: May 2013
Reputation: 0



Post: #8
RE: Respawn
Thanks
01-13-2014 05:13 AM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


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