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
auto loot, search ground for corpse?
Author Message
Sum
Apprentice
*

Posts: 40
Likes Given: 32
Likes Received: 5 in 4 posts
Joined: Feb 2016
Reputation: 0



Post: #1
auto loot, search ground for corpse?
Hello all, I have a auto loot script which is working just fine. My players are asking for a command to auto loot off a corpse on the ground. I have not been able to achieve this as i use the @itemdclick for loot all and @kill for loot gold . I can't find anyway at all to search for a corpse on the ground. Is this even possible?

Here is what i have for my script now for my loot system : using version 56d nightly

Code:
/////////////Auto loot system by Admin Oric 2017 Spawn of Sosaria////////

[PLEVEL 1]
loot

[FUNCTION loot]
src.dialog=d_loot



//////////loot choice dialog//////////

[DIALOG d_loot]
100,100    
PAGE 0                                  // Position
resizepic 50 100 2600 560 300 // Curved Grey background
gumppic 225 132 1418
dtext 200 116 0481  Loot Choice System by Admin Oric V1.0
dtext 195 150 05e7  Hail! <src.name>, Choose Your Loot System.
dtext 90 198 0ffe  Loot = Gold (gold goes directly into your bag, all other looting is standard).
dtext 90 248 0ffe  Loot = All (gives you a loot bag and places loot directly into your loot bag)
dtext 90 298 0ffe  Loot = Normal (normal loot system)
button 72 200 2117 2118 1 0 1
button 72 250 2117 2118 1 0 2
button 72 300 2117 2118 1 0 3





[DIALOG d_loot BUTTON]

ON=0
src.sysmessage @0481 Loot choice cancelled.

ON=1
src.lootgold


ON=2
src.lootall


ON=3
src.lootnormal


////////////Normal loot system

[function lootnormal]
src.events= -e_lootall
src.events= -e_lootgold
src.events= +e_lootnormal
src.sysmessage @0481 Normal loot activated!


///////loot gold only (loots gold only and puts it in players bag)

[function lootgold] ///////loot gold only (loots gold only and puts it in players bag)
src.events= -e_lootall  
src.events= +e_lootgold
src.events= -e_lootnormal
src.sysmessage @0481 Gold loot activated!


////Loots all items on the corPse when opening the corpse

[Function lootall]              
IF (<src.findid.i_loot_bag>)
src.sysmessage @481 You must remove your loot bag before using this again!
return 1
ENDIF
IF !(<src.findid.i_loot_bag>)
src.events= +e_lootall
src.events= -e_lootgold
src.events= -e_lootnormal
src.newitem=i_loot_bag
src.act.bounce
src.sysmessage @0481 You have received a loot bag!
src.sysmessage @0481 All loot activated!
src.update
ENDIF


[events e_lootnormal]
ON=@ITEMDCLICK
IF (<src.act.type> == t_corpse) && !(<src.act.more2> == <src.uid>)
src.sysmessage @0481 You did not slay this monster!
return 1
ENDIF

[events e_lootall]
ON=@ITEMDCLICK
IF (<src.act.type> == t_corpse) && !(<src.act.more2> == <src.uid>)
src.sysmessage @0481 You did not slay this monster!
return 1
ENDIF

IF (<src.act.type> == t_corpse) && <rescount>
forcont <src.act.uid>
cont <src.findid.i_loot_bag>
endfor
ENDIF

IF !(<src.act.type> == t_corpse)
return 0
ENDIF


[events e_lootgold]
ON=@ITEMDCLICK
IF (<src.act.type> == t_corpse) && !(<src.act.more2> == <src.uid>)
src.sysmessage @0481 You did not slay this monster!
return 1
ENDIF

ON=@Kill
IF !(<src.act.isplayer> ==1 )
newgold <argo.gold>
argo.gold = 0
return 0
else
return 1
ENDIF


[ITEMDEF I_loot_bag]
ID=i_bag
NAME=Loot Bag
Weight=0


ON=@CREATE
COLOR=0811






[EOF]
(This post was last modified: 02-24-2017 06:19 PM by Sum.)
02-24-2017 10:34 AM
Find all posts by this user Like Post Quote this message in a reply
zottolo
Journeyman
*

Posts: 87
Likes Given: 8
Likes Received: 12 in 11 posts
Joined: Dec 2015
Reputation: 0



Post: #2
RE: auto loot, search ground for corpse?
foritems 2
if <type> == t_corpse
loot loot loot
endif
endfor

this way you can search corpses on the ground in radius of 2, if i got the question...

...but what if two players are trying to loot the same item at the same time? good luck ^_^
(This post was last modified: 02-25-2017 04:07 AM by zottolo.)
02-25-2017 04:06 AM
Find all posts by this user Like Post Quote this message in a reply
[+] 1 user Likes zottolo's post
Catalan_mistral
Journeyman
*

Posts: 54
Likes Given: 2
Likes Received: 6 in 5 posts
Joined: Jan 2017
Reputation: 0



Post: #3
RE: auto loot, search ground for corpse?
Think he wants to kill an npc and the corpse is automatically looted without having to actually click the corpse.

The One and Only......
02-25-2017 04:10 AM
Find all posts by this user Like Post Quote this message in a reply
[+] 1 user Likes Catalan_mistral's post
Sum
Apprentice
*

Posts: 40
Likes Given: 32
Likes Received: 5 in 4 posts
Joined: Feb 2016
Reputation: 0



Post: #4
RE: auto loot, search ground for corpse?
(02-25-2017 04:10 AM)Catalan_mistral Wrote:  Think he wants to kill an npc and the corpse is automatically looted without having to actually click the corpse.

what Catalan said.I dont want them to have to dclick, i honestly dont see why they cant just dclick like the good old days lol.I use more2 to id the killer so no one else can loot the corpse. but i will try what you have suggested Zotolo and thanks you both for your replies Smile
(This post was last modified: 02-25-2017 05:18 AM by Sum.)
02-25-2017 05:17 AM
Find all posts by this user Like Post Quote this message in a reply
Criminal
Journeyman
*

Posts: 182
Likes Given: 38
Likes Received: 22 in 22 posts
Joined: Jun 2015
Reputation: 0

SantiagoUO.com

Post: #5
RE: auto loot, search ground for corpse?
you can try something like
@kill
if <isevent.e_lootall>
for 0 <eval <argo.rescount>-1>
try uid.<findcont.<eval <argo.rescount>-1>.uid>.cont=<uid>
endfor

[Image: mfqAZnj.png]
Discord: SantiagoUO
Skype:
criminaluo
02-25-2017 07:29 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
[+] 1 user Likes Criminal's post
Sum
Apprentice
*

Posts: 40
Likes Given: 32
Likes Received: 5 in 4 posts
Joined: Feb 2016
Reputation: 0



Post: #6
RE: auto loot, search ground for corpse?
(02-25-2017 04:06 AM)zottolo Wrote:  foritems 2
if <type> == t_corpse
loot loot loot
endif
endfor

this way you can search corpses on the ground in radius of 2, if i got the question...

...but what if two players are trying to loot the same item at the same time? good luck ^_^

thanks for pointing me in the right direction zottolo Smile and thanks to everyone for your help. I got it working great now Big Grin


Code:
[plevel 1]
lootcheck


[FUNCTION lootcheck]
foritems 3
if (<type> == t_corpse )
FORCONT <uid>
CONT <src.findid.i_loot_bag>
ENDFOR
endif
endfor

I Actually found a better way this way will just dclick the corpse and work off the lootall event. this will allow you to loot corpses when other people kills are laying about Big Grin so simple yet so hard lol

[plevel 1]
lootcheck


[FUNCTION lootcheck]
foritems 3
if (<type> == t_corpse )
dclick
endif
(This post was last modified: 02-25-2017 05:29 PM by Sum.)
02-25-2017 05:08 PM
Find all posts by this user Like Post Quote this message in a reply
zottolo
Journeyman
*

Posts: 87
Likes Given: 8
Likes Received: 12 in 11 posts
Joined: Dec 2015
Reputation: 0



Post: #7
RE: auto loot, search ground for corpse?
Its my pleasure!
02-25-2017 11:31 PM
Find all posts by this user Like Post Quote this message in a reply
[+] 1 user Likes zottolo's post
Artyk
Journeyman
*

Posts: 75
Likes Given: 43
Likes Received: 9 in 9 posts
Joined: Sep 2014
Reputation: 0



Post: #8
RE: auto loot, search ground for corpse?
If the point is to automatically give all the loot to the killer, maybe you can place a function under @DeathCorpse
When an npc dies and leave a corpse, bounce all the loot to the killer Smile
02-27-2017 12:07 AM
Find all posts by this user Like Post Quote this message in a reply
[+] 1 user Likes Artyk's post
Post Reply 


Forum Jump:


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