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
Gold Loot
Author Message
XuN
Sphere Developer
*****

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



Post: #11
RE: Gold Loot
Is there any special reason to use a custom Shrink? If not ... I suggest you to do this:

Code:
[function petshrink]
sysmessage=@09c1 To whom do you wish to duel?
targetf _petshrink

[function _petshrink]
if (<argo.id>==c_system_pet_rabbit)
argo.shrink 1 // the 1 will bounce the figurine
act.events +t_pet_rabbit_fix // act is automatically set to the figurine. No need to override the type, just add one event to it.
endif

[typedef t_pet_rabbit_fix]
ON=@DClick
if (<topobj>!=<src>)
src.sysmessage @09c1 You must have the item in your pack.  
return 1 //stop the action, and because you are using one event instead of overriding the type ... default actions (unshrink) will be performed after this.
endif

You are saving some lines of code being executed and stored in memory. You are not removing the pet, so you won't have problems in the future with storing tags/changing skills/properties/whatever because you'll be using the same one.
03-19-2015 05:48 PM
Find all posts by this user Like Post Quote this message in a reply
Van Glan Bloom
Journeyman
*

Posts: 104
Likes Given: 2
Likes Received: 3 in 3 posts
Joined: Jun 2013
Reputation: 0



Post: #12
RE: Gold Loot
Hi again guys,

Once you have solved the problem d shrink and loot gold, a new problem. The system is not working on the players. The active player the gold loot system, but does not get the gold from mobs automatically.

Code:
[EVENTS e_money_collect]
ON=@Kill
if (<obj.isevent.e_exp)
newgold <argo.gold>
argo.gold = 0
return 0
endif


even if you put the system as mentioned last time (example below) it also turns out to not work in players

Code:
ON=@Kill
newgold <argo.gold>
argo.gold = 0
return 0
03-22-2015 08:21 AM
Find all posts by this user Like Post Quote this message in a reply
UltimaAku
Journeyman
*

Posts: 125
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Feb 2013
Reputation: 1



Post: #13
RE: Gold Loot
a little longer, but it might fix it

ON=@Kill
NEWITEM=i_gold
ACT.AMOUNT=<ARGO.GOLD>
ACT.BOUNCE
ARGO.GOLD = 0
return 0
04-28-2015 07:43 PM
Find all posts by this user Like Post Quote this message in a reply
richm
Journeyman
*

Posts: 58
Likes Given: 4
Likes Received: 4 in 3 posts
Joined: Aug 2014
Reputation: 0



Post: #14
RE: Gold Loot
add this event to your NPCS?

[EVENT e_gold]

ON=@DEATH
ACT.NEWGOLD <GOLD>
GOLD
RETURN 0
04-29-2015 08:19 AM
Find all posts by this user Like Post Quote this message in a reply
Van Glan Bloom
Journeyman
*

Posts: 104
Likes Given: 2
Likes Received: 3 in 3 posts
Joined: Jun 2013
Reputation: 0



Post: #15
RE: Gold Loot
thank you for all your help, because this time I can tell where the bug. And I will explain:

If I have my GM invulnerable the script works correctly, but withdraw the GM invulnerable the script crashes, I can not understand why ?! = (

Can solve this problem?
05-03-2015 02:22 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: #16
RE: Gold Loot
Can you refresh here the code you have now? We've posted here so much code to know which did you select Smile
05-03-2015 04:37 AM
Find all posts by this user Like Post Quote this message in a reply
Van Glan Bloom
Journeyman
*

Posts: 104
Likes Given: 2
Likes Received: 3 in 3 posts
Joined: Jun 2013
Reputation: 0



Post: #17
RE: Gold Loot
I'll post the all script because I might be making a mistake somewhere in the script and not be detecting the bug :


Code:
[chardef c_system_pet_rabbit]
name=Rabbit
id=c_rabbit
CAN=MT_WALK|MT_RUN

on=@create
EVENTS +e_system_pet_rabbit
COLOR=0123
FOOD=100
STR=1
DEX=900
FLAGS=008000001

ON=@Click
message @0035 [Pet Rabbit]

on=@dclick
if !(<ismypet>)
      
    SRC.SYSMESSAGE @09c1 The animal must be loyal to you!

return 1

elif (<food> >= 50)
    src.dialog d_pet_configuration
return 1
elif (<food> <= 49 )
    src.dialog d_pet_configuration_2
return 1
endif


ON=@HIT
RETURN 1

ON=@GETHIT
RETURN 1

ON=@DAMAGE
RETURN 1

ON=@ATTACK
return 1

CATEGORY=Isengard Shard
SUBSECTION=World NPCs
DESCRIPTION=Rabbit NPC


[ITEMDEF i_system_pet_rabbit]
id=i_pet_rabbit_2
Name=Rabbit
TYPE=t_figurine

ON=@Create
ATTR=attr_newbie
COLOR=0123
more1=c_system_pet_rabbit



CATEGORY=Isengard Shard
SUBSECTION=Trash Barrel
DESCRIPTION=Rabbit Figurine

Code:
[dialog d_pet_configuration]
0,0
PAGE 1

resizepic 79 48 2600 343 289
resizepic 141 111 9200 226 22
resizepic 141 139 9200 226 22
resizepic 201 167 9200 166 22
resizepic 141 195 9200 226 36
resizepic 141 237 9200 226 22
resizepic 141 265 9200 226 31
resizepic 266 203 9350 92 21


gumppic 171 72 2440
gumppic 154 76 216
gumppic 340 76 216
gumppic 117 114 9703
gumppic 117 142 9703
gumppic 117 207 9703
gumppic 117 273 9703
gumppic 217 273 2062
gumppic 316 284 2435

dtext 201 73 205 Pet Configuration
dtext 160 112 2947 Owned by
dtext 160 140 2947 Configuration
dtext 220 168 2947 Gold Auto-Loot
dtext 160 203 2947 Account Balance
dtext 272 203 2947 <SRC.GOLD>
dtext 160 238 2947 Shrink
dtext 160 271 2947 Energy :
dtext 258 271 2947 <src.targ.food> %

button 165 173 2361 2362 1 0 1
button 184 173 2360 2362 1 0 2
button 117 240 9702 9703 1 0 3


[dialog d_pet_configuration BUTTON]

onbutton=1
if (<src.isevent.e_money_collect>)
    src.sysmessage @09c1 The collector of money already active.
        src.dialog d_pet_configuration
    return 1
elif (<src.isevent.e_no_money_collect>)
    src.events +e_money_collect
        src.events -e_no_money_collect
            src.sysmessage @0044 You active the collector of money.
        src.dialog d_pet_configuration
    return 1
endif

onbutton=2
if (<src.isevent.e_no_money_collect>)
    src.sysmessage @09c1 The collector of money already disabled.
        src.dialog d_pet_configuration
    return 1
elif (<src.isevent.e_money_collect>)
    src.events +e_NO_money_collect
        src.events -e_money_collect
            src.sysmessage @0028 You disabled the collector of money.
        src.dialog d_pet_configuration
    return 1
endif

onbutton=3
src.petshrink
return 1

Code:
[FUNCTION petshrink]
NEWITEM=i_memory_system_pet_rabbit
EQUIP=<ACT>

[ITEMDEF i_memory_system_pet_rabbit]
DEFNAME=i_memory_system_pet_rabbit
NAME=Memory sYSTEM pET rABBIT
ID=i_memory
TYPE=t_eq_script

ON=@CREATE
ATTR=attr_move_never|attr_invis

ON=@EQUIP
TARGET

ON=@TARGON_CHAR
IF (<SRC.TARG.BODY>==c_man) || (<SRC.TARG.BODY>==c_woman) || (<SRC.TARG.NPC>==0)
src.sysmessage @09c1 You can not shrink a human!
return 1
elseif <src.targ.flags>&statf_conjured
src.sysmessage @09c1 You cannot shrink summoned pets!
return 1
elseif <src.targ.ismypet>
src.targ.shrink
src.sysmessage @09c1 Your pet, <src.targ.name>, has been shrunk.
remove
return 0
else
src.sysmessage @09c1 <src.targ.name>, This is not your pet
return 1
endif

[EVENTS e_no_money_collect] // add this too the player


[EVENTS e_money_collect]
ON=@Kill
NEWITEM=i_gold
ACT.AMOUNT=<ARGO.GOLD>
ACT.BOUNCE
ARGO.GOLD = 0
return 0

on=@logout
if (<src.isevent.e_money_collect>)
    src.events +e_no_money_collect
        src.events -e_money_collect
    endif
return 1

[Events e_system_pet_rabbit]
ON=@ItemStep
if !((<act.attr> & attr_static) || (<act.type> == t_corpse) || (<act.attr> & attr_move_never) || (<act.attr> & attr_invis) || (<act.attr> & attr_owned) || (<act.type> == t_blood) || (<act.type> == t_container))
  emote pick up an item for his master
  act.cont=<owner.findlayer.layer_pack.uid>
endif
(This post was last modified: 05-03-2015 08:33 AM by Van Glan Bloom.)
05-03-2015 08:32 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: #18
RE: Gold Loot
This works for me with and without GM mode in latest nightly:
Code:
ON=@Kill
SAY Killed <argo.name> with <argo.gold> gold, I have <gold> [<eval <gold>+<argo.gold>>].
GOLD += <ARGO.GOLD>
ARGO.GOLD = 0
05-03-2015 05:25 PM
Find all posts by this user Like Post Quote this message in a reply
Van Glan Bloom
Journeyman
*

Posts: 104
Likes Given: 2
Likes Received: 3 in 3 posts
Joined: Jun 2013
Reputation: 0



Post: #19
RE: Gold Loot
Still with the same problem. The Script is working properly when the GM is invulnerable mode. But when I remove the invulnerable so it stops working, so does the players = /
05-04-2015 10:34 PM
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: #20
RE: Gold Loot
What build are you using? Can't replicate with any type of account (Player account, owner account with or without gm and invul...).
05-05-2015 04:57 PM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


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