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
|
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 |
|
|
Sum
Apprentice
Posts: 40
Likes Given: 32
Likes Received: 5 in 4 posts
Joined: Feb 2016
Reputation: 0
|
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 and thanks to everyone for your help. I got it working great now
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 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 |
|
|
User(s) browsing this thread: 3 Guest(s)