SphereCommunity
[split] 56b - some problems .... - Printable Version

+- SphereCommunity (https://forum.spherecommunity.net)
+-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d)
+--- Forum: Script Help (/Forum-Script-Help)
+--- Thread: [split] 56b - some problems .... (/Thread-split-56b-some-problems)

Pages: 1 2


[split] 56b - some problems .... - an0n!m0use - 03-09-2013 06:39 AM

Another problem ...

Script:
PHP Code:
[ITEMDEF i_restore_bers]
Name=Restoration
ID
=00F09
WEIGHT
=25

On
=@Create
    COLOR
=042c
    morey 
25

on
=@click
message 
<name> (<eval <morey>>)
return 
1
 
On
=@Dclick
 
if !<src.tag0.berserker>)
  
src.message @55 Only Berserker can drink restoration!
  return 

 
endif
 if <
src.hits> >= <src.str>
  return 

 
endif
 if <
src.tag0.berserker>==1
    more1 
= { 15 17 }
 elseif <
src.tag0.berserker>==2
    more1 
= { 17 20 }
 elseif <
src.tag0.berserker>==3
    more1 
= { 20 23 }
 elseif <
src.tag0.berserker>==4
    more1 
= { 23 26 }
 endif
 if 
0<src.findid.i_rest_delay_level1>
  
src.sysmessage @55 You cant drink restoration yet
  
return 
 
else
  if <
morey> > 1
   src
.effect=3,0376a,10,25,10
   src
.hits=<src.hits> + { <more1> }
   
serv.newitem=i_rest_delay_level1
   
new.equip
   morey 
-= 1
  
else
   
remove
  
endif
 endif
  if <
src.hits> > <src.str>)
   
src.hits=<src.str
  endif
return 
1

[ITEMDEF i_rest_delay_level1
Id i_bottle_6 
Name 
Restore Delay level 1 
Weight 

Layer 
30 
Type t_eq_script 

On
=@Create 
    attr 
attr_newbie attr_decay 
 
On
=@Equip 
 
if <src.tag0.berserker>==1
  timer 
5
 
elseif <src.tag0.berserker>==2
  timer 
4
 
elseif <src.tag0.berserker>==3
  timer 
3
 
elseif <src.tag0.berserker>==4
  timer 
3
 
endif

On=@Timer 
 remove 
 
return 

When I try a drink this, I just die ... What's the problem?



And second problem ... After resurrect ... With this script:
PHP Code:
[ITEMDEF i_ress_floor]
id=01822
name
=Resurrect

on
=@create
    attr
=010
    timer
=-1
    color
=0446
    
on
=@click
    message 
<name>
    return 
1
    
on
=@step

    
if ( (<src.body>==c_ghost_man) || (<src.body>==c_ghost_woman) )
        
src.go britain
        src
.resurrect
        src
.update
        src
.consume 1 i_deathshroud
        src
.hits = <src.str>
        
src.mana = <src.int>
        
src.stam = <src.dex>
    else
        
src.sysmessage @55 It is only for ghosts!
        return 
1
    
endif 

I do not know how to explain .... I like a ghost ... Bet, after command ",resend" (Inject) it's all right ...

It's after resurrect ... Floor "Up!" working after, resend ....
[Image: adcfedb88c4f.jpg]


RE: 56b - some problems .... - Crusader - 03-09-2013 07:07 AM

Code:
endif
  if <src.hits> > <src.str>)
   src.hits=<src.str>
  endif
return 1

i see a parentesis that is not opened Tongue

and one more thing, why u use morey first, then more1, then morey again? shouldn't be always morey? (and actually, is better if u use more1, since morey is about coordinates)


i don't get it what about the second problem... but i would do like this:
Code:
on=@step
    if ( (<src.body>==c_ghost_man) || (<src.body>==c_ghost_woman) )
        src.go britain
        src.resurrect
        src.consume 1 i_deathshroud
        src.hits = <src.str>
        src.mana = <src.int>
        src.stam = <src.dex>
        update  
else
        src.sysmessage @55 It is only for ghosts!
        return 1
    endif
Return 0

one personal question: do u play drakensang online?


RE: [split] 56b - some problems .... - Mordaunt - 03-09-2013 09:41 AM

Have split this, please start new threads for new problems so people can identify them more easily.


RE: 56b - some problems .... - an0n!m0use - 03-09-2013 11:01 AM

(03-09-2013 07:07 AM)Crusader Wrote:  and one more thing, why u use morey first, then more1, then morey again? shouldn't be always morey? (and actually, is better if u use more1, since morey is about coordinates)
And how would you do? I do not get ... Tried a hundred variants Sad


(03-09-2013 07:07 AM)Crusader Wrote:  i don't get it what about the second problem... but i would do like this:
Code:
on=@step
   ....
    endif
Return 0
Did not help Sad

(03-09-2013 07:07 AM)Crusader Wrote:  one personal question: do u play drakensang online?
No Veryhappy Why do you think I played there? Smile


RE: [split] 56b - some problems .... - Crusader - 03-09-2013 11:06 PM

the point is that i don't understand what u want to do with ur potion and what u want to do with the ress tile.
u just want that the char with the ress tile is gonna be ressed and updated to avoid particular showing of 'residual' stuff ?
try this:

on=@step
if ( (<src.body>==c_ghost_man) || (<src.body>==c_ghost_woman) )
src.resurrect
src.consume 1 i_deathshroud
src.hits = <src.str>
src.mana = <src.int>
src.stam = <src.dex>
src.go britain
update
else
src.sysmessage @55 It is only for ghosts!
return 1
endif
Return 0


for the potion i don't understand what u want to do, explain.
For the game, coz in that game there is a guy called an0nym0use Big Grin


RE: [split] 56b - some problems .... - an0n!m0use - 03-10-2013 12:12 AM

(03-09-2013 11:06 PM)Crusader Wrote:  the point is that i don't understand what u want to do with ur potion and what u want to do with the ress tile.
u just want that the char with the ress tile is gonna be ressed and updated to avoid particular showing of 'residual' stuff ?
try this:

on=@step
....
endif
Return 0
It's working Woot Thx Tongue

(03-09-2013 11:06 PM)Crusader Wrote:  for the potion i don't understand what u want to do, explain.
For the game, coz in that game there is a guy called an0nym0use Big Grin
I have race Berserker ...
And this race has 3 leveled ...
Level 1 - +15 +17 hits and delay 5 seconds
Level 2 - +17 +20 hits and delay 4 seconds
Level 3 lvl - +20 +23 hits and delay 3 seconds

Importantly, when i drink a bottle ... not knock a swing Smile


RE: [split] 56b - some problems .... - Crusader - 03-10-2013 12:28 AM

so...if i'm a berserk and i drink that potion i will be healed for that points and the delay is that one. ok.

Code:
[ITEMDEF i_restore_bers]
Name=Restoration
ID=00F09
WEIGHT=25

On=@Create
    COLOR=042c
    more2 = 25

on=@click
message <name> (<eval <more2>>)
return 1

ON=@DCLICK
IF !(<SRC.TAG0.BERSERKER>)
SRC.MESSAGE @55 Only Berserker can drink restoration!
RETURN 1
ELSE
    IF (<SRC.TAG0.BERSERKER>==1)
        MORE1={15 17}
    ELIF (<SRC.TAG0.BERSERKER>==2)
        MORE1={17 20}    
    ELIF (<SRC.TAG0.BERSERKER>==3)
        MORE1={20 23}
    ELSE
        MORE1={23 26}
    ENDIF            
ENDIF
IF (<SRC.HITS> >= <SRC.MAXHITS>)
        SRC.MESSAGE @55 You are already at maximum healt!
        RETURN 1
ENDIF
IF (<SRC.FINDID.i_rest_delay_level1>)
        SRC.SYSMESSAGE @55 You can't drink restoration potion yet
        RETURN 1
ENDIF
IF (<EVAL <MORE2>> > 0)
    SRC.EFFECT=3,0376a,10,25,10
    IF (<EVAL <SRC.HITS> + <MORE1>> >= <SRC.MAXHITS>)
        SRC.HITS = <SRC.MAXHITS>
    ELSE
        SRC.HITS += <EVAL <MORE1>>
        ENDIF
    SERV.NEWITEM=i_rest_delay_level1
    NEW.EQUIP <SRC.UID>
    MORE2 -= 1
    SRC.SYSMESSAGE Charges left <EVAL <MORE2>>
ELSE
    SRC.SYSMESSAGE @55 Charges over!
        REMOVE
ENDIF

[ITEMDEF i_rest_delay_level1]
ID=i_memory
Name=Restore Delay level 1
Type=t_eq_script

On=@Create
    attr = attr_newbie | attr_decay

On=@Equip
IF (<SRC.TAG0.BERSERKER>==1)
    TIMER=5
ELIF (<SRC.TAG0.BERSERKER>==2)
    TIMER=4
ELIF (<SRC.TAG0.BERSERKER>==3)
    TIMER=3
ELSE
    TIMER=3
ENDIF    
RETURN 0

ON=@Timer
REMOVE
RETURN 1



RE: [split] 56b - some problems .... - an0n!m0use - 03-10-2013 12:45 AM

(03-10-2013 12:28 AM)Crusader Wrote:  so...if i'm a berserk and i drink that potion i will be healed for that points and the delay is that one. ok.

[ITEMDEF i_restore_bers]
...
Yep Wink Not working ... afrer use die .... Sad


RE: [split] 56b - some problems .... - Crusader - 03-10-2013 12:46 AM

yeah i just put a wrong script, i was editing ^^' try the one i put there


RE: [split] 56b - some problems .... - an0n!m0use - 03-10-2013 12:56 AM

(03-10-2013 12:46 AM)Crusader Wrote:  yeah i just put a wrong script, i was editing ^^' try the one i put there

PHP Code:
....

ON=@DCLICK
IF !(<SRC.TAG0.BERSERKER>)
SRC.MESSAGE @55 Only Berserker can drink restoration!
RETURN 

ELSE    
    
SRC.MESSAGE <MORE1>

..... 


[Image: 717b2cc8a095.jpg]

Checked with command .xshow type - 'type' for 'Restoration' is 't_potion'