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
Van Glan Bloom
Journeyman
*

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



Post: #1
Gold Loot
Hello,

I wish you would give me a hand in a script. I'm trying to create a script for the player kills a mob, the money goes directly to the bag of the player.

I have this :

Code:
[EVENTS e_money_collect]

on=@kill
local.tmp=<obj>
obj=<argo.uid>
if (<obj.isevent.e_exp>) || (<obj.baseid>==c_zombie_m)
local.new <new>
loot_corpse
bounce <new>
new=<local.new>
src.sysmessage @09c1 TESTE
return 1
endif

Code:
[FUNCTION loot_corpse]
if (<baseid>==i_gold)
    cont=<src.owner.findlayer.21.uid>
endif
03-09-2015 09:36 AM
Find all posts by this user Like Post Quote this message in a reply
azmanomer
Journeyman
*

Posts: 139
Likes Given: 4
Likes Received: 18 in 16 posts
Joined: Nov 2013
Reputation: 1



Post: #2
RE: Gold Loot
on @kill
if (<argo.isevent.e_exp>) || (<argo.baseid>==c_zombie_m)
newgold 5000
endif
03-09-2015 09:39 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: #3
RE: Gold Loot
Hello azmanomer,

I know how to add the money after killing a mob, my goal is not that. The purpose of the script afther kill the mob the money go automatly for the bag of the player.

Ex: If the mob have 100 gold in the corpse after the dead, this money go automaticly for the player, The player dont need open the corpse for loot the money
03-10-2015 12:59 AM
Find all posts by this user Like Post Quote this message in a reply
azmanomer
Journeyman
*

Posts: 139
Likes Given: 4
Likes Received: 18 in 16 posts
Joined: Nov 2013
Reputation: 1



Post: #4
RE: Gold Loot
oh sorry then this could be help;

on @death
IF (<ATTACKER>)
FOR 0 <EVAL <ATTACKER>-1>
IF (<ATTACKER.<dLOCAL._FOR>.DAM>)
REF1=<ATTACKER.<dLOCAL._FOR>>
IF (<REF1.FLAGS>&STATF_PET)
REF1=<REF1.OWNER>
ENDIF
IF (<REF1.ISPLAYER>)
forcont <findlayer.21> 255
if <baseid>==i_gold
cont=<ref1.findlayer.21>
endif
endfor
endif
endif
enfor
endif


This could be help i cant test it right now
03-10-2015 01:29 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: #5
RE: Gold Loot
I go release all my script and maybe you can help. I dont understand what i make wrong. I fixed some bugs but, if i chance someting in the script the bugs come again =/

Code:
//************* Pet Rabbit **************

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


on=@create
EVENTS=e_no_money_collect
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


[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

ON=@dclick
if ( <TOPOBJ.UID> != <SRC.UID> )
    
SRC.SYSMESSAGE @09c1 You must have the item in your pack.
    
return 1

else
SERV.NEWNPC=<more1>
NEW.P=<SRC.P>
NEW.COLOR=<COLOR>
NEW.NAME=<NAME>
NEW.UPDATE
REMOVE
ENDIF

Code:
[dialog d_pet_configuration]
0,0
PAGE 1

resizepic 79 48 2600 343 380
resizepic 141 111 9200 226 22
resizepic 141 139 9200 226 22
resizepic 201 167 9200 166 22
resizepic 201 195 9200 166 22
resizepic 201 223 9200 166 22
resizepic 201 251 9200 166 22
resizepic 201 278 9200 166 22
resizepic 201 306 9200 166 22
resizepic 141 334 9200 226 22
resizepic 141 362 9200 226 31

gumppic 171 72 2440
gumppic 154 76 216
gumppic 340 76 216
gumppic 117 114 9702
gumppic 117 142 9702
gumppic 117 370 9702
gumppic 217 370 2062
gumppic 316 381 2435

dtext 201 73 205 Pet Configuration
dtext 160 112 2947 Owned by
dtext 160 140 2947 Configuration
dtext 220 168 2947 Armors
dtext 220 196 2947 Bags
dtext 220 224 2947 Gold
dtext 220 252 2947 Potions
dtext 220 279 2947 Scrolls
dtext 220 307 2947 Weapons
dtext 160 335 2947 Shrink
dtext 160 368 2947 Energy :
dtext 258 368 2947 <src.targ.food> %

button 165 173 2361 2362 1 0 1
button 165 201 2361 2362 1 0 2
button 165 229 2361 2362 1 0 3
button 165 257 2361 2362 1 0 4
button 165 284 2361 2362 1 0 5
button 165 312 2361 2362 1 0 6
button 184 173 2360 2362 1 0 7
button 184 201 2360 2362 1 0 8
button 184 229 2360 2362 1 0 9
button 184 257 2360 2362 1 0 10
button 184 284 2360 2362 1 0 11
button 184 312 2360 2362 1 0 12
button 117 337 9702 9703 1 0 13


[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=7
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=8


onbutton=9


onbutton=10



onbutton=11



onbutton=12


onbutton=13
SERV.NEWITEM=<SRC.TARG.ICON>
NEW.NAME=<SRC.ACT.NAME>
NEW.COLOR=<SRC.ACT.COLOR>
SRC.ACT.MORE1=<SRC.ACT.ID>
SRC.ACT.BOUNCE
SRC.TARG.REMOVE
SRC.SYSMESSAGE <SRC.TARG.NAME> is Shrunk and in your Bag!
REMOVE



[dialog d_pet_configuration_2]
0,0
PAGE 1

resizepic 79 48 2600 343 380
resizepic 141 111 9200 226 22
resizepic 141 139 9200 226 22
resizepic 201 167 9200 166 22
resizepic 201 195 9200 166 22
resizepic 201 223 9200 166 22
resizepic 201 251 9200 166 22
resizepic 201 278 9200 166 22
resizepic 201 306 9200 166 22
resizepic 141 334 9200 226 22
resizepic 141 362 9200 226 31

gumppic 171 72 2440
gumppic 154 76 216
gumppic 340 76 216
gumppic 117 114 9702
gumppic 117 142 9702
gumppic 117 370 9702
gumppic 217 370 2061
gumppic 219 381 2435

dtext 201 73 205 Pet Configuration
dtext 160 112 2947 Owned by
dtext 160 140 2947 Configuration
dtext 220 168 2947 Armors
dtext 220 196 2947 Bags
dtext 220 224 2947 Gold
dtext 220 252 2947 Potions
dtext 220 279 2947 Scrolls
dtext 220 307 2947 Weapons
dtext 160 335 2947 Shrink
dtext 160 368 2947 Energy :
dtext 258 368 2947 <src.targ.food> %

button 165 173 2361 2362 1 0 1
button 165 201 2361 2362 1 0 2
button 165 229 2361 2362 1 0 3
button 165 257 2361 2362 1 0 4
button 165 284 2361 2362 1 0 5
button 165 312 2361 2362 1 0 6
button 184 173 2360 2362 1 0 7
button 184 201 2360 2362 1 0 8
button 184 229 2360 2362 1 0 9
button 184 257 2360 2362 1 0 10
button 184 284 2360 2362 1 0 11
button 184 312 2360 2362 1 0 12
button 117 337 9702 9703 1 0 13


[DIALOG d_pet_configuration_2 BUTTON]

onbutton=1
dialog d_pet_change_name

onbutton=2

onbutton=3
shrink
src.act.bounce
src.sysmessage @09c1 You shrink you pet with sucess
return 1

Code:
[EVENTS e_no_money_collect]  // Add in player


[EVENTS e_money_collect]

on=@kill
local.tmp=<obj>
obj=<argo.uid>
if (<obj.isevent.e_exp>)
forcont <findlayer.21> 255
if <baseid>==i_gold
cont=<ref1.findlayer.21>
src.sysmessage @09c1 Mataste um ZOMBIE
endif
endif
03-10-2015 03:26 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: #6
RE: Gold Loot
This should do it faster:

Code:
ON=@Kill
gold +=<argo.gold>
argo.gold=0
03-17-2015 08:42 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: #7
RE: Gold Loot
You have Help me XuN, Thx =) but, now i have a new problem xD
After i kill the mob, the gold is removed, but not going to bag the player, but to the bank = / The intention was that the money was to bag

Code:
[EVENTS e_money_collect]

on=@kill
gold +=<argo.gold>
argo.gold=0
f_money_collect <eval <tag.value>>
src.sysmessage @09c1 Mataste um ZOMBIE
return 0


[function f_money_collect]
if (<eval <argo>> > 65000)
    src.newitem i_gold
            src.act.amount <argo>
        src.act.bounce
    return 0
endif
03-17-2015 11:51 PM
Find all posts by this user Like Post Quote this message in a reply
darksun84
Sir Spamalot
****

Posts: 1,687
Likes Given: 245
Likes Received: 162 in 151 posts
Joined: Mar 2012
Reputation: 35



Post: #8
RE: Gold Loot
TRy with newgold

PHP Code:
ON=@Kill
newgold 
<argo.gold>
argo.gold 
//f_money_collect <eval <tag.value>> You don't need it anymore, newgold already "re-groups" the gold if the  amount is over 65k
return 
03-18-2015 12:13 AM
Find all posts by this user Like Post Quote this message in a reply
[+] 1 user Likes darksun84's post
XuN
Sphere Developer
*****

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



Post: #9
RE: Gold Loot
(03-18-2015 12:13 AM)darksun84 Wrote:  TRy with newgold

That will do it Smile
03-18-2015 06:10 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: #10
RE: Gold Loot
Thx Darksun84 you have decided my problem =)

Now in the same script i have a little bug in shrink the pet. When unshrink the pet, it does not recognize the player as its owner. I creat this :

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= @09c1 To whom do you wish to duel?

ON=@TARGON_CHAR
if (<src.targ.id>==c_system_pet_rabbit)
serv.newitem=i_system_pet_rabbit
new.name=<src.targ.name>
new.color=<src.targ.color>
new.tag.id=<src.targ.baseid>
new.tag.str=<src.targ.str>
new.tag.dex=<src.targ.dex>
new.tag.food=<src.targ.food>
new.tag.dono=<uid>
new.cont=<ref1.uid>
src.new.bounce
new.type=t_pet_rabbit_fix
src.targ.remove
endif
return 1

[TYPEDEF t_pet_rabbit_fix]
ON=@Dclick
if ( <TOPOBJ.UID> != <SRC.UID> )
    
src.sysmessage @09c1 You must have the item in your pack.
    
return 1

else
serv.newnpc=c_system_pet_rabbit
new.color=<color>
new.str=<tag.str>
new.dex=<tag.dex>
new.name=<name>
new.food=<tag.food>
remove
return 1
endif
03-18-2015 11:33 PM
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)