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






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

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



Post: #1
Teleport
Hi, I began scripting 3 days ago and started with quite hard(for me)script.
It should be a teleport with instant hit.

1.reacts on a command (.teleportation) or reacts on a botton in a spellbook.
2.now some IFs(stamina required and target in sight)
3.the player says something/yells and reduces 20 stam itself.
4.here it checks (if you for example - cast, use skill, the jump wont be finished and sysmessage will say - you interupted jump or whatever.
maybe while cycle get there somehow? and some duration/pause. 2s?
5.and here it should check again if the target is in the sight and jump at it(and @HitTry should be set as TRUE, somehow) and reduce stam by 20.



[ITEMDEF 02254]
defname=asdf //for faster adding, later change
name="Warrior's Book"
weight=0
layer=1

on=@Create
ATTR=attr_newbie
AMOUNT=1
MOREZ=200 //i have no idea why should it be there...I coppied it.

on=@dclick
MOREZ=200 //again, have no idea why
sDIALOG WARBOOK_OPEN

[DIALOG WARBOOK_OPEN]
page 0
gumppic 100 50 02b02
page 1
gumppic 190 125 05302
dtext 188 103 0 War book
dtext 200 195 0 xxxxxxxx
button 320 90 2224 2224 1 2 1
button 320 115 2224 2224 1 0 2
button 320 140 2224 2224 1 0 3
button 320 165 2224 2224 1 0 4
button 320 190 2224 2224 1 0 5
button 320 215 2224 2224 1 0 6
dtext 360 62 0 List
dtext 343 87 0 Teleportation
dtext 343 112 0 2.kouzlo
dtext 343 137 0 3.kouzlo
dtext 343 162 0 4.kouzlo
dtext 343 187 0 5.kouzlo
dtext 343 212 0 6.kouzlo
return


and jump
//-------------------------------------------------------------------------------
[FUNCTION teleportation]
on=@attack //the player attacks
if <src.stam> >= 20 && <src.targ.canseelos>
sound=0512 //or sound=044A
src.emote is about to jump
src.move SRC.TARGP //doesnt work
src.actarg1
src.stam -= 20

elif <src.stam> < 20 //
src.sysmessage Dont have enought stamina for jump

elif //
src.sysmessage Target is not in your sight
return 1
endif

src.sysmessage You arent attacking anybody
return 1
//-------------------------------------------------------------------------------

I'm sorry I want, well, the whole script from you but i rly dont know how to write it and also my English isnt good at all :-/
This script I wrote, is incorrect but these are just my ideas how it shuld work
If somebody could help me, I would be glad.
Alaric
(This post was last modified: 10-28-2012 12:17 AM by Alaric.)
10-28-2012 12:15 AM
Find all posts by this user Like Post Quote this message in a reply
Shaklaban
Master
**

Posts: 378
Likes Given: 0
Likes Received: 1 in 1 posts
Joined: Mar 2012
Reputation: 8

DOT

Post: #2
RE: Teleport
you can't use triggers under functions, it must be under event. also you have some mistakes:
PHP Code:
[events e_teleportation]
on=@attack //@attack trigger, src=attacked character and default= character which is attacking
if (<stam> < 20)
    
sysmessage Dont have enought stamina for jump
elif 
!(<canseelos <src>>) 
    
sysmessage You cant see the target
else
    
sound=0512
    emote is about to jump
    go 
<src.p//go command sends character to specific position, in this case we sending character to position of src
    
stam -= 20     
endif

[function 
teleportation]
if <
isevent.e_teleportation//check is character has the e_teleportation event
    
sysmessage Teleport off
    events 
-e_teleportation  //remove teleportation event from player
else
    
sysmessage Teleport on
    events 
+e_teleportation
endif 
10-28-2012 04:45 AM
Visit this user's website 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: #3
RE: Teleport
Thanks for posting, i'll insipe with that and try to rewrite it.

I need in that events "e_teleportation" one main condition.
Like:
IF (character is attacking)
jump(+ those checkings stam, sight, sound, etc.)
ELSE
sysmessage You arent attacking anybody
ENDIF

I meant a player(plevel 1) writes .teleportation and he/she will teleport on another player or NPC after 2s. But it shouldnt be cast because it interupts HitTry.
Actually I cant use trigger I think because I want the condition (if the player attacks or not). And its a state what is happening and if I use on=@attack(or charattack) the procession jump works only in the moment I switch pease to war mode and attack sbd.
(This post was last modified: 10-28-2012 07:19 AM by Alaric.)
10-28-2012 07:14 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: #4
RE: Teleport
Any ideas how to check if you are attacking sbd?

PHP Code:
[plevel 1]
teleportation

[function teleportation]
IF (
character is attacking)
-
jump-
ELSE
sysmessage You arent attacking anybody
ENDIF 
tried TRIGGER @charattack and then read SRC and I. Is this the right way? If its incorrect, do you know any other one to solve the problem?
(This post was last modified: 10-30-2012 07:40 AM by Alaric.)
10-30-2012 07:39 AM
Find all posts by this user Like Post Quote this message in a reply
Extreme
Grandmaster Poster
***

Posts: 1,141
Likes Given: 217
Likes Received: 90 in 77 posts
Joined: May 2012
Reputation: 20

SphereCommunity

Post: #5
RE: Teleport
Attack you mean is in war mode?

STEPS BEFORE CREATE A THREAD
- Check the revisions log;
- Use the search button and use the keywords of your problem;
- Check the WIKI;
- Create a thread.
10-30-2012 08:31 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: #6
RE: Teleport
(10-30-2012 08:31 AM)Extreme Wrote:  Attack you mean is in war mode?

Yep, in war mod + i have already double clicked npc or player(i'm attacking it)
(This post was last modified: 10-30-2012 08:39 AM by Alaric.)
10-30-2012 08:38 AM
Find all posts by this user Like Post Quote this message in a reply
Extreme
Grandmaster Poster
***

Posts: 1,141
Likes Given: 217
Likes Received: 90 in 77 posts
Joined: May 2012
Reputation: 20

SphereCommunity

Post: #7
RE: Teleport
Hmmm
try this
PHP Code:
IF (<FLAGS>&STATF_WAR) && (<MEMORYFINDTYPE.memory_iaggressor>)
-
jump
ELSE
bla
ENDIF 

STEPS BEFORE CREATE A THREAD
- Check the revisions log;
- Use the search button and use the keywords of your problem;
- Check the WIKI;
- Create a thread.
10-30-2012 10:47 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: #8
RE: Teleport
With "memory_war_targ" it works how i want, thanks.
(This post was last modified: 10-30-2012 11:54 PM by Alaric.)
10-30-2012 11:53 PM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


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