Eclipse
January 05, 2009, 08:56:45 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News:
 
   Home   Chat Help Rules Arcade Search Calendar Gallery Login Register  
 
 
 
Recent Topics +-
Dreadlord Online v1.2 Beta - Need Moderators and Trustworthy Mappers! by Kreator
Today at 08:55:16 PM

The New Eclipse Raid on Runscape by Kreator
Today at 08:53:50 PM

[$$] Paying Paypal - GFX artists [$$] by The Tribal
Today at 08:51:19 PM

THE Cult by The Tribal
Today at 08:49:34 PM

SnowCap by Ninja-Tech
Today at 08:45:29 PM

Teh Cult by Simius Cruentus
Today at 08:44:15 PM

Disparity Recruiting by Peter
Today at 08:44:05 PM

Makai Realms by kira423
Today at 08:41:25 PM

My Game by Kreator
Today at 08:40:25 PM

Server Status by westin444
Today at 08:27:23 PM

Members Online +-
16 Guests, 12 Users
ralir,
‪‫‬‭‮‪‫‬‭The Admiral,
Kreator,
kira423,
The Tribal,
Peter,
The Troy,
Baron,
The Roujo,
Ninja-Tech,
westin444,
Simius Cruentus
Pages: [1] 2
  Print  
Author Topic: Stealing Script: Difficulty (2/5)  (Read 3066 times)
0 Members and 1 Guest are viewing this topic.
SwiftDeathSK
Owner of SK Interactive
Advanced Member
****
Offline Offline

Posts: 591


I have returned... WITH COOKIES!


View Profile WWW Email
« on: December 04, 2006, 09:56:59 AM »



add this to the bottom of your main.txt

Code: [Select]
'***Script by SwiftDeathSK***
Sub Stealing(index, itemnum, minvalue, maxvalue)
'*************************************
Dim Target
Dim chance
Dim x
Dim y
Dim z
Dim value
Target = getplayertarget(index)

If getplayertarget(index) < 1 Then
    Exit Sub
End If

If GetPlayerX(index) = (GetPlayerX(Target) + 1) Or (GetPlayerX(Target) - 1) Then
    If GetPlayerY(index) = (GetPlayerY(Target) + 1) Or (GetPlayerY(Target) - 1) Then
        x = 0
        Do While x <= 24
            If GetPlayerInvItemNum(index, x) = 0 Or itemnum Then
                y = "True"
                x = 26
            End If
                x = x + 1
        Loop
       
          If y = "True" Then
                x = 0
                Do While x <= 24
                    If GetPlayerInvItemNum(getplayertarget(index), x) = itemnum Then
                        z = "True"
                        x = 26
                    End If
                        x = x + 1
                Loop
       
                If z = "True" Then
                    Call PlayerMsg(index, "You attempt to pickpocket " & Target & "...", 15)
                    chance = rand(1, 100)
                        If chance >= 50 Then
                            value = rand(minvalue, maxvalue)
                            Call PlayerMsg(index, "You successfully steal " & value & " Gold from " & Target & "!", 15)
                            x = 0
                                Do While x <= 24
                                      If GetPlayerInvItemNum(index, x) = itemnum Then
                                            Call SetPlayerInvItemValue(index, x, (GetPlayerInvItemValue(index, x) + value))
                                      Else
                                            If GetPlayerInvItemNum(index, x) = 0 Then
                                                Call SetPlayerInvItemNum(index, x, itemnum)
                                                Call SetPlayerInvItemValue(index, x, value)
                                            End If
                                      End If
                                    x = x + 1
                                Loop
                            x = 0
                            Do While x <= 24
                                If GetPlayerInvItemNum(Target, x) = itemnum Then
                                    Call SetPlayerInvItemValue(Target, x, (GetPlayerInvItemValue(Target, x) - value))
                                        If GetPlayerInvItemValue(Target, x) <= 0 Then
                                            Call SetPlayerInvItemNum(Target, x, 0)
                                        End If
                                End If
                                x = x + 1
                            Loop
                           
                            Call SendInventory(index)
                            Call SendInventory(Target)
                        Else
                          Call PlayerMsg(index, "You are caught while stealing!", 15)
                          Call SetPlayerPK(index, 1)
                        End If
                End If
                        Call PlayerMsg(index, "Your inventory is full, you cant steal anything!", 15)
                        Exit Sub
            End If
                        Call PlayerMsg(index, "Your inventory is full, you cant steal anything!", 15)
                        Exit Sub
    Else
        Call PlayerMsg(index, "That target is too far away!", 15)
        Exit Sub
    End If
Else
    Call PlayerMsg(index, "That target is too far away!", 15)
End If

Use this line to run the script:
Code: [Select]
Call Stealing(index, itemnum, minvalue, maxvalue)-itemnum: the number of the item being stolen; must be a currency item
-minvalue: the minimum amount stolen
-maxvalue: the maximum amount stolen

NOTES
To use this script, just use the command Call Stealing(index, itemnum, minvalue, maxvalue).
The item being stolen must be a currency item.
The amount of that item being stolen is selected randomly between the values of the minvalue and maxvalue variables.
The target must be a single step away from the player.
Target cannot be an NPC.
This only works with EE.


If you use this script, please give me credit :)

edit - fixed the getplayertarget and inventory things
unnown
Teh Uberleet
*****
Offline Offline

Posts: 3,659


-Admin-


View Profile Email
« Reply #1 on: December 04, 2006, 10:10:51 AM »

      If GetPlayerInvItemNum(index, x) <> 0 or itemnum Then
        Call PlayerMsg(index, "Your inventory is full, you cant steal anything!", 15)
        Exit Sub

that would cause it to stop if you have an item in your inventory..(without the inventory being full)
and you should add an check if the player has targeted somebody:)

besides that great script
~.:Lidnel:.~
Active Member
***
Offline Offline

Posts: 366

The truth is out there...


View Profile WWW Email
« Reply #2 on: December 04, 2006, 10:35:11 AM »

Thnx man, you are the best!   :)
SwiftDeathSK
Owner of SK Interactive
Advanced Member
****
Offline Offline

Posts: 591


I have returned... WITH COOKIES!


View Profile WWW Email
« Reply #3 on: December 04, 2006, 10:43:20 AM »

      If GetPlayerInvItemNum(index, x) <> 0 or itemnum Then
        Call PlayerMsg(index, "Your inventory is full, you cant steal anything!", 15)
        Exit Sub

that would cause it to stop if you have an item in your inventory..(without the inventory being full)
and you should add an check if the player has targeted somebody:)

besides that great script

k ill try to fix that, ill let you know when ive updated the main code ;)


EDIT: Updated, someone please run it to check to make sure i fixed it ;)
unnown
Teh Uberleet
*****
Offline Offline

Posts: 3,659


-Admin-


View Profile Email
« Reply #4 on: December 04, 2006, 10:49:39 AM »

(check the edit...  ;D )
SwiftDeathSK
Owner of SK Interactive
Advanced Member
****
Offline Offline

Posts: 591


I have returned... WITH COOKIES!


View Profile WWW Email
« Reply #5 on: December 04, 2006, 10:53:53 AM »

(check the edit...  ;D )

ah :P thanks unnown! it works now :) just be sure to follow the notes and it should work :)

you could add this to a hotscript, or maybe a spell, hell, if you figure a way to do it, you might even be able to use it as an item (maybe like pickpocketing gloves that you need to equip to be able to steal :P)

hey unnown, if they use this in a script NPC, would it still work? or does the GetPlayerTarget command not work with npc's? i wasnt entirely sure about that...
unnown
Teh Uberleet
*****
Offline Offline

Posts: 3,659


-Admin-


View Profile Email
« Reply #6 on: December 04, 2006, 11:51:21 AM »

getplayertarget doesn't work on npc...(you can use GetPlayerTargetNpc(index) for that)
Axeon
Newb
*
Offline Offline

Posts: 18

What net??


View Profile WWW Email
« Reply #7 on: December 06, 2006, 05:04:37 AM »

Hey when I add this I cant start the server`..  :o
SwiftDeathSK
Owner of SK Interactive
Advanced Member
****
Offline Offline

Posts: 591


I have returned... WITH COOKIES!


View Profile WWW Email
« Reply #8 on: December 06, 2006, 10:29:01 AM »

Hey when I add this I cant start the server`..  :o

are you using Eclipse Evolution? because this script will not work with total eclipse... what is the run time error number and message you get with it?
~.:Lidnel:.~
Active Member
***
Offline Offline

Posts: 366

The truth is out there...


View Profile WWW Email
« Reply #9 on: December 06, 2006, 10:41:36 AM »

It works with TE 2.0...
*Tested*
Axeon
Newb
*
Offline Offline

Posts: 18

What net??


View Profile WWW Email
« Reply #10 on: December 06, 2006, 12:33:15 PM »

I´m using EE. But I don´t get any errors. It just stops loading the server..
unnown
Teh Uberleet
*****
Offline Offline

Posts: 3,659


-Admin-


View Profile Email
« Reply #11 on: December 06, 2006, 03:47:03 PM »

getplayertarget(index) = 1 means you targetet the player with indexnumber 1...you...
Timus
Custom GFX'erer
Global Moderator
Advanced Eclipser
*
Offline Offline

Posts: 1,287



View Profile Email
« Reply #12 on: December 06, 2006, 06:15:39 PM »

Nice Swift! Should add in like custom menus or something so people dont have to go: Call stealing bla bla bla...
Chrono917
Active Member
***
Offline Offline

Posts: 138



View Profile Email
« Reply #13 on: March 01, 2007, 05:09:39 PM »

And how do you actually use this after you put in the script?
vicho815
OMFG IM SOO COOL
Active Member
***
Offline Offline

Posts: 112



View Profile Email
« Reply #14 on: March 01, 2007, 05:15:56 PM »

casting the spell? xD
Chrono917
Active Member
***
Offline Offline

Posts: 138



View Profile Email
« Reply #15 on: March 02, 2007, 06:46:18 PM »

That didn't help at all -.- If it can't help, THEN DON'T SAY IT
Heytherejake
Eclipse Evolution Dev
Active Member
***
Offline Offline

Posts: 426

Currently working on C++ 3D


View Profile WWW Email
« Reply #16 on: March 02, 2007, 07:29:17 PM »

Add the call Stealing command under a sub :P
SwiftDeathSK
Owner of SK Interactive
Advanced Member
****
Offline Offline

Posts: 591


I have returned... WITH COOKIES!


View Profile WWW Email
« Reply #17 on: March 15, 2007, 10:43:13 AM »

yeah, there isnt a set way to use this script, you can add to to a hotkey, a spell, a command, etc. it's up to you.
BuddhaWrath
Newb
*
Offline Offline

Posts: 3


View Profile Email
« Reply #18 on: October 24, 2008, 02:16:35 PM »

Hi there, cool script. Quick question, this script only allows the player to steal "Money" then? Is there a way to set up so they can steal actual items (weps, armor, potions, etc)? Thanks!
naruto1289
Active Member
***
Offline Offline

Posts: 125


View Profile Email
« Reply #19 on: October 25, 2008, 10:51:44 AM »

so you can only steal from other players? what thing on the keyboard do I press to steal?
Pages: [1] 2
  Print  
 
 

Powered by EzPortal
Powered by MySQL Powered by PHP Powered by SMF 2.0 Beta 4 | SMF © 2006–2008, Simple Machines LLC | Sitemap Valid XHTML 1.0! Valid CSS!
Page created in 0.32 seconds with 32 queries.