Eclipse
January 05, 2009, 06:25:56 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 +-
My New Computer! by The BanHammer! [Thor!]
Today at 06:25:05 PM

Disparity Recruiting by The Tribal
Today at 06:24:51 PM

[E++] Fun with sprites! by Simius Cruentus
Today at 06:23:18 PM

Spike's Adminishness! by Spike
Today at 06:23:08 PM

how will the person above die. by The Tribal
Today at 06:20:30 PM

Need forum logos by ʇıunpp ʎqɹıʞ࣭
Today at 06:19:31 PM

Eclipse Traffic by Simius Cruentus
Today at 06:16:37 PM

Color Association by Gwendalin
Today at 06:16:34 PM

Post Your Desktop. by Gwendalin
Today at 06:11:56 PM

New DezireSoft forums by The BanHammer! [Thor!]
Today at 06:05:55 PM

Members Online +-
21 Guests, 17 Users
The Tribal,
grenegg1,
The BanHammer! [Thor!],
Sk3wer,
Gwendalin,
Simius Cruentus,
Hikaru,
Spike,
tiggilyboo,
Peter,
calamity,
ʇıunpp ʎqɹıʞ࣭,
Electrokinesis,
Kreator,
Echo ♥ Pie,
Almighty Wing,
kdjrgej
Pages: [1] 2 3 ... 12
  Print  
Author Topic: BARONS QUEST SUPERSCRIPT  (Read 11897 times)
0 Members and 1 Guest are viewing this topic.
Baron
Lord Of Spleens
Administrator
Teh Uberleet
*
Offline Offline

Posts: 2,735


Genesis CoCreator - Eclipse Evo Developer


View Profile WWW Email
« on: June 10, 2006, 12:06:05 AM »

Ive got ick of all the complaints ive recieved about non functional quest scripts.

Heres one that works and owns. Enjoy all. Baron.

------------------------

INSTALLING

Find the line

Sub scriptedNPC(index, script)

change it to look like below:

Quote


Sub ScriptedNPC(index, Script)
On Error Resume next
Dim status
Dim start_msg
Dim questing_msg
Dim end_msg
Dim completed_msg
Dim has_needed
Dim need_count
Dim give_count
Dim slot
Dim count
Dim found
Dim number
Dim durability
Dim value
Dim experience
Dim name
 
Select Case Script
    Case 0
       
        If getvar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "QUEST", "Start_Msg") <> "" Then
       
           If getvar("scripts\charextras\" & GetPlayerName(index) & ".ini", "QUEST", GetPlayerMap(index) ) < 0 Then
           Call putvar("scripts\charextras\" & GetPlayerName(index) & ".ini", "QUEST", GetPlayerMap(index), 0 )
           End If
       
        status = getvar("scripts\charextras\" & GetPlayerName(index) & ".ini", "QUEST", GetPlayerMap(index))
        name=getvar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "QUEST", "name")
               
        Select Case status
       
           
           
           Case 0
           start_msg=getvar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "QUEST", "Start_Msg")
           Call playermsg(index, name & " : " & start_msg, 15)
           Call putvar("scripts\charextras\" & GetPlayerName(index) & ".ini", "QUEST", GetPlayerMap(index), 1 )
         
            Case 1
           
                need_count=getvar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "QUEST", "need_count")
                count=1      
                slot=1
                has_needed=0
               
                'CHECK FOR ITEMS
                               
                Do While count<=Int(need_count)
                number=getvar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "QUEST", count & "_need_num")
                value=getvar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "QUEST", count & "_need_val")
                slot=1
                               
                   Do While slot < 25    
                      If Int(getplayerinvitemnum(index,slot))=Int(number) Then
                         If Int(getplayerinvitemvalue(index, slot))>=Int(value) Then
                         has_needed=has_needed+1
                         slot=25
                         End If   
                      End If
                   slot=slot+1
                   Loop
                   
                count=count+1
                Loop
               
                'ACTUALLY TAKE ITEMS
               
                If has_needed >= Int(need_count) Then
                has_needed=1
                count=1
               
                   Do While count<=Int(need_count)
                   number=getvar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "QUEST", count & "_need_num")
                   value=getvar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "QUEST", count & "_need_val")
                   slot=1          
                   Do While slot < 25    
                   If Int(getplayerinvitemnum(index,slot))=Int(number) Then
                   If Int(getplayerinvitemvalue(index, slot))>=Int(value) Then
                   Call quest_Take_Item(index, number, value)
                   Call Battlemsg(index, name & " removed an item from your inventory.", 15, 0)
                   slot=25
                   End If   
                   End If
                   slot=slot+1
                   Loop
                   count=count+1
                   Loop
               
                Else
                has_needed=0
                End If
               
                'CHECK IF ITEMS WERE TAKEN
           
               If has_needed = 0 Then
               questing_msg=getvar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "QUEST", "Questing_Msg")
               Call playermsg(index, name & " : " & questing_msg, 15)
               Else
               end_msg=getvar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "QUEST", "end_Msg")
               Call playermsg(index, name & " : " & end_msg, 15)
               Call putvar("scripts\charextras\" & GetPlayerName(index) & ".ini", "QUEST", GetPlayerMap(index), 2 )
               Call scriptedNPC(index, 0)
               End If  
           
           
           
            Case 2
           
            'GIVE THE ITEMS AS REWARD, DONT UNLESS ENOUGH SPACE, IF GIVEN BECOME 3
            'GET NUMBER OF FREE SLOTS
           
            slot=1
            count=0
           
            Do While slot < 25
                 If Int(getplayerinvitemnum(index,slot))=0 Then
                 count=count+1
                 End If            
            slot=slot+1
            Loop  
           
            'CHECK ENOUGH SPACE FOR ITEMS BEING GIVEN
           
            give_count=getvar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "QUEST", "give_count")
           
            If Int(count)>=Int(give_count) Then
           
            'GIVE ITEMS
           
            count=1
           
            Do While Int(count)<=Int(give_count)
            number=getvar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "QUEST", count & "_num")
            value=getvar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "QUEST", count & "_val")
            durability=getvar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "QUEST", count & "_dur")            
            slot=1        
               Do While slot < 25
                    If Int(getplayerinvitemnum(index,slot))=0 Then
                       Call setplayerinvitemdur(index, Int(slot), Int(durability))
                       Call setplayerinvitemvalue(index, Int(slot), Int(value))
                       Call setplayerinvitemnum(index, Int(slot), Int(number))
                       Call sendinventoryupdate(index, slot)
                       slot=25
                       Call Battlemsg(index, name & " gives you an item.", 15, 0)
                    End If            
               slot=slot+1
               Loop
            count=count+1
            Loop
           
            'ADVANCE TO COMPLETELY FINISHED QUEST
           
            Call putvar("scripts\charextras\" & GetPlayerName(index) & ".ini", "QUEST", GetPlayerMap(index), 3)
            experience=getvar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "QUEST", "experience")
            Call battlemsg(index, "Quest Completed! " & experience & " experience gained!", 14, 0)
            experience=experience+GetPlayerExp(index)
            Call SetPlayerExp(index, Int(experience))
            Call sendplayerdata(index)
           
                         
            'MESSAGE FOR NO SPACE
             
            Else
            space_msg=getvar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "QUEST", "space_msg")
            Call playermsg(index, name & " : " & space_msg, 15)
            End If
           
            'MESSAGE FOR COMPLETED QUEST
           
            Case 3
            completed_msg=getvar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "QUEST", "completed_msg")
            Call playermsg(index, name & " : " & completed_msg, 15)      
           
        End Select
           
       
        Else
        'ADD REST OF VARIABLES NEEDED TO QUICK GENERATE INI'S AND CREDIT
       
        Call playermsg(index, "No quest found, generating generic quest sript under server\mapextras\" & GetPlayerMap(index) & ".ini", 14)
        Call playermsg(index, "This script was coded by Baron, http://barony.deviantart.com", 14)
        Call Playermsg(index, "This script is free to use on any server, but this credit must not be removed.", 14)
       
        Call putvar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "QUEST", "Start_Msg", "Bring me item X!")
        Call putvar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "QUEST", "Questing_Msg", "Have item X yet?")
        Call putvar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "QUEST", "End_Msg", "Have item X yet?")      
        Call putvar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "QUEST", "Completed_Msg", "Thanks for item X!")
        Call putvar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "QUEST", "Space_Msg", "Ill hold this item for you until you have more room.")
       
        Call putvar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "QUEST", "Name", "The Quest Baron")
       
        Call putvar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "QUEST", "Experience", 200)  
       
        Call putvar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "QUEST", "need_count", 2)
        Call putvar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "QUEST", "1_need_num", 1)
        Call putvar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "QUEST", "1_need_val", 4)
        Call putvar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "QUEST", "2_need_num", 1)
        Call putvar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "QUEST", "2_need_val", 2)
       
        Call putvar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "QUEST", "give_count", 2)
        Call putvar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "QUEST", "1_num", 1)
        Call putvar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "QUEST", "1_val", 3)
        Call putvar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "QUEST", "1_dur", 0)
        Call putvar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "QUEST", "2_num", 1)
        Call putvar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "QUEST", "2_val", 1)
        Call putvar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "QUEST", "2_dur", 0)
       
        End If      
       
End Select
End Sub



After you have added that, put this on the very bottom of your main.txt

Quote

'********************************
Sub quest_Take_Item(index, number, value)
'********************************

Dim slot
Dim initial
Dim final
Dim taken

slot=1
   Do While Int(slot) < 25
      If taken <> 1 Then            
         If Getplayerinvitemnum(index,Int(slot)) = Int(number) Then
            If Int(getplayerinvitemvalue(index, Int(slot))) >= Int(value) Then
            initial = Int(getplayerinvitemvalue(index, Int(slot) ) )
            final = Int(initial) - Int(value)            
               If Int(final) <= 0 Then               
               Call setplayerinvitemnum(index, Int(slot), Int(0) )
               Call setplayerinvitemvalue(index, Int(slot), Int(0) )
               Call setplayerinvitemdur(index, Int(slot), Int(0) )
               Call SendInventoryUpdate(index, Int(slot))
               taken=1               
               Else            
               Call setplayerinvitemvalue(index, Int(slot), Int(final) )
               Call SendInventoryUpdate(index, Int(slot) )
               taken=1            
               End If
            End If         
         End If
      End If      
   slot = slot + 1
   Loop
End Sub


USING THIS SCRIPT

Create a new NPC and assign them to be type scripted
Assign the script number to be 0
Place the NPC on a map, walk up and attack it
Script will auto generate all the info you need to change
Edit the info in the file scripts/mapextras/ MAPNUMBER .ini
Only one quest per map.

This script has been tested as many ways as I can think of, errors found and fixed. If you find a SCRIPT error, not one of your crappy installing the script errors, then I will modify the code here to reflect necessary changes.

DISCLAIMER

This script is not to be hardcoded into any engine.
Creator: Baron
http://Barony.deviantart.com

AMENDMENTS

When needing items, you MUST understand which item type has a value.

Things like armors, none etc that dont stack will have a value of 0 (keys included) so youd set number as whatever then value as 0 for the item needed.

For currencies or stacks of items i recommend fining yourself a value to take from them.

Im also fairly sure you will need to be using a TE version that includes th scripted NPC feature so it may not be useful for other engines.

You will also need two directories, mapextras and charextras in your servers scripts folder.
Eagle
~ it's called a Hangover ~
Veteran
Member
*
Offline Offline

Posts: 78


~Its physically impossible to lick your own elbow~


View Profile WWW Email
« Reply #1 on: June 10, 2006, 12:10:58 AM »

This is the coolest code I have ever seen Baron!!!!

THANK YOU!!! <BIG HUG> :P

Vickie~ :D
Baron
Lord Of Spleens
Administrator
Teh Uberleet
*
Offline Offline

Posts: 2,735


Genesis CoCreator - Eclipse Evo Developer


View Profile WWW Email
« Reply #2 on: June 10, 2006, 12:14:03 AM »

No problem, my bet is Alanspike rocks up soon to throw worship everywhere. Hes been bothering me for this for months.
Yannick
Guest


Email
« Reply #3 on: June 10, 2006, 02:41:06 AM »

I can't find the Sub scriptedNPC
only Sub scripterTile
help me or add me yannickjolie [at] hotmail.com  :D
Thx,
Baron
Lord Of Spleens
Administrator
Teh Uberleet
*
Offline Offline

Posts: 2,735


Genesis CoCreator - Eclipse Evo Developer


View Profile WWW Email
« Reply #4 on: June 10, 2006, 02:47:31 AM »

If you arent using eclipse you wont have scripted NPC's.

Other then that use a search button, if it still isnt there just add the whole piece of code at the end.
Grim_Reaper
~Suffering~
Active Member
***
Offline Offline

Posts: 438


You dare enter my dominion?


View Profile Email
« Reply #5 on: June 10, 2006, 06:52:51 PM »

wow!!!! :thumbsup
anny44
Suicidal Maniac
Active Member
***
Offline Offline

Posts: 126

Emo...


View Profile WWW Email
« Reply #6 on: June 10, 2006, 07:36:47 PM »

i set the npc it tells me wat to do but the folders arnt there..
Baron
Lord Of Spleens
Administrator
Teh Uberleet
*
Offline Offline

Posts: 2,735


Genesis CoCreator - Eclipse Evo Developer


View Profile WWW Email
« Reply #7 on: June 11, 2006, 12:51:03 AM »

you will need the mapextras and charextras folders in your server/scripts directory.
anny44
Suicidal Maniac
Active Member
***
Offline Offline

Posts: 126

Emo...


View Profile WWW Email
« Reply #8 on: June 11, 2006, 06:26:13 AM »

ooohh..it worx now..thx!!
UberNullx
Active Member
***
Offline Offline

Posts: 142


View Profile Email
« Reply #9 on: June 11, 2006, 08:09:05 AM »

Ok, I couldn't find the Sub ScriptedNPC(index, scripts) so I added it all to the end.

My main.txt now look like;



'********************************
Sub ScriptedNPC(index, Script)  
'********************************
 
On Error Resume next
Dim status
Dim start_msg
Dim questing_msg
Dim end_msg
Dim completed_msg
Dim has_needed
Dim need_count
Dim give_count
Dim slot
Dim count
Dim found
Dim number
Dim durability
Dim value
Dim experience
Dim name

Select Case Script
Case 0

If getvar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "QUEST", "Start_Msg") <> "" Then

If getvar("scripts\charextras\" & GetPlayerName(index) & ".ini", "QUEST", GetPlayerMap(index) ) < 0 Then
Call putvar("scripts\charextras\" & GetPlayerName(index) & ".ini", "QUEST", GetPlayerMap(index), 0 )
End If

status = getvar("scripts\charextras\" & GetPlayerName(index) & ".ini", "QUEST", GetPlayerMap(index))
name=getvar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "QUEST", "name")

Select Case status



Case 0
start_msg=getvar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "QUEST", "Start_Msg")
Call playermsg(index, name & " : " & start_msg, 15)
Call putvar("scripts\charextras\" & GetPlayerName(index) & ".ini", "QUEST", GetPlayerMap(index), 1 )

Case 1

need_count=getvar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "QUEST", "need_count")
count=1
slot=1
has_needed=0

'CHECK FOR ITEMS

Do While count<=Int(need_count)
number=getvar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "QUEST", count & "_need_num")
value=getvar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "QUEST", count & "_need_val")
slot=1

Do While slot < 25
If Int(getplayerinvitemnum(index,slot))=Int(number) Then
If Int(getplayerinvitemvalue(index, slot))>=Int(value) Then
has_needed=has_needed+1
slot=25
End If
End If
slot=slot+1
Loop

count=count+1
Loop

'ACTUALLY TAKE ITEMS

If has_needed >= Int(need_count) Then
has_needed=1
count=1

Do While count<=Int(need_count)
number=getvar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "QUEST", count & "_need_num")
value=getvar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "QUEST", count & "_need_val")
slot=1
Do While slot < 25
If Int(getplayerinvitemnum(index,slot))=Int(number) Then
If Int(getplayerinvitemvalue(index, slot))>=Int(value) Then
Call quest_Take_Item(index, number, value)
Call Battlemsg(index, name & " removed an item from your inventory.", 15, 0)
slot=25
End If
End If
slot=slot+1
Loop
count=count+1
Loop

Else
has_needed=0
End If

'CHECK IF ITEMS WERE TAKEN

If has_needed = 0 Then
questing_msg=getvar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "QUEST", "Questing_Msg")
Call playermsg(index, name & " : " & questing_msg, 15)
Else
end_msg=getvar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "QUEST", "end_Msg")
Call playermsg(index, name & " : " & end_msg, 15)
Call putvar("scripts\charextras\" & GetPlayerName(index) & ".ini", "QUEST", GetPlayerMap(index), 2 )
Call scriptedNPC(index, 0)
End If



Case 2

'GIVE THE ITEMS AS REWARD, DONT UNLESS ENOUGH SPACE, IF GIVEN BECOME 3
'GET NUMBER OF FREE SLOTS

slot=1
count=0

Do While slot < 25
If Int(getplayerinvitemnum(index,slot))=0 Then
count=count+1
End If
slot=slot+1
Loop

'CHECK ENOUGH SPACE FOR ITEMS BEING GIVEN

give_count=getvar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "QUEST", "give_count")

If Int(count)>=Int(give_count) Then

'GIVE ITEMS

count=1

Do While Int(count)<=Int(give_count)
number=getvar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "QUEST", count & "_num")
value=getvar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "QUEST", count & "_val")
durability=getvar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "QUEST", count & "_dur")
slot=1
Do While slot < 25
If Int(getplayerinvitemnum(index,slot))=0 Then
Call setplayerinvitemdur(index, Int(slot), Int(durability))
Call setplayerinvitemvalue(index, Int(slot), Int(value))
Call setplayerinvitemnum(index, Int(slot), Int(number))
Call sendinventoryupdate(index, slot)
slot=25
Call Battlemsg(index, name & " gives you an item.", 15, 0)
End If
slot=slot+1
Loop
count=count+1
Loop

'ADVANCE TO COMPLETELY FINISHED QUEST

Call putvar("scripts\charextras\" & GetPlayerName(index) & ".ini", "QUEST", GetPlayerMap(index), 3)
experience=getvar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "QUEST", "experience")
Call battlemsg(index, "Quest Completed! " & experience & " experience gained!", 14, 0)
experience=experience+GetPlayerExp(index)
Call SetPlayerExp(index, Int(experience))
Call sendplayerdata(index)


'MESSAGE FOR NO SPACE

Else
space_msg=getvar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "QUEST", "space_msg")
Call playermsg(index, name & " : " & space_msg, 15)
End If

'MESSAGE FOR COMPLETED QUEST

Case 3
completed_msg=getvar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "QUEST", "completed_msg")
Call playermsg(index, name & " : " & completed_msg, 15)

End Select


Else
'ADD REST OF VARIABLES NEEDED TO QUICK GENERATE INI'S AND CREDIT

Call playermsg(index, "No quest found, generating generic quest sript under server\mapextras\" & GetPlayerMap(index) & ".ini", 14)
Call playermsg(index, "This script was coded by Baron, http://barony.deviantart.com", 14)
Call Playermsg(index, "This script is free to use on any server, but this credit must not be removed.", 14)

Call putvar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "QUEST", "Start_Msg", "Bring me item X!")
Call putvar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "QUEST", "Questing_Msg", "Have item X yet?")
Call putvar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "QUEST", "End_Msg", "Have item X yet?")
Call putvar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "QUEST", "Completed_Msg", "Thanks for item X!")
Call putvar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "QUEST", "Space_Msg", "Ill hold this item for you until you have more room.")

Call putvar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "QUEST", "Name", "The Quest Baron")

Call putvar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "QUEST", "Experience", 200)

Call putvar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "QUEST", "need_count", 2)
Call putvar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "QUEST", "1_need_num", 1)
Call putvar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "QUEST", "1_need_val", 4)
Call putvar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "QUEST", "2_need_num", 1)
Call putvar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "QUEST", "2_need_val", 2)

Call putvar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "QUEST", "give_count", 2)
Call putvar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "QUEST", "1_num", 1)
Call putvar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "QUEST", "1_val", 3)
Call putvar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "QUEST", "1_dur", 0)
Call putvar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "QUEST", "2_num", 1)
Call putvar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "QUEST", "2_val", 1)
Call putvar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "QUEST", "2_dur", 0)

End If

End Select
End Sub


'********************************
Sub quest_Take_Item(index, number, value)
'********************************

Dim slot
Dim initial
Dim final
Dim taken

slot=1
Do While Int(slot) < 25
If taken <> 1 Then
If Getplayerinvitemnum(index,Int(slot)) = Int(number) Then
If Int(getplayerinvitemvalue(index, Int(slot))) >= Int(value) Then
initial = Int(getplayerinvitemvalue(index, Int(slot) ) )
final = Int(initial) - Int(value)
If Int(final) <= 0 Then
Call setplayerinvitemnum(index, Int(slot), Int(0) )
Call setplayerinvitemvalue(index, Int(slot), Int(0) )
Call setplayerinvitemdur(index, Int(slot), Int(0) )
Call SendInventoryUpdate(index, Int(slot))
taken=1
Else
Call setplayerinvitemvalue(index, Int(slot), Int(final) )
Call SendInventoryUpdate(index, Int(slot) )
taken=1
End If
End If
End If
End If
slot = slot + 1
Loop
End Sub






'********************************
'| INSERT EXTRA SUBS ABOVE HERE |
'********************************

'********************************
Sub testmain(index)            
'********************************

Call Playermsg(index, "All your scripts should be working if you recieved this message", 10)
End Sub

'********************************
'|       END OF SUPER MAIN      |
'|   http://www.barony.deviantart.com  |
'********************************


I am just wondering if that is right, because it says all my scripts are working, but when I attack my NPC nothing happens.
Spike
Veteran
Advanced Eclipser
*
Online Online

Posts: 1,667



View Profile Email
« Reply #10 on: June 11, 2006, 08:53:36 AM »

baron...u were right...*bows down 6000 times then collapses of quest spasms*

PWNAGE THY NAME IS BARON
Rogue
Veteran
Advanced Member
*
Offline Offline

Posts: 670


GARBLE GARBLE


View Profile WWW Email
« Reply #11 on: June 11, 2006, 10:05:01 AM »

okay i got it to work but im stupid

Code: [Select]
[QUEST]
Start_Msg=Bring me a silver key!
Questing_Msg=Have you got a silver key yet!?
End_Msg=Have you got a silver key ye!?
Completed_Msg=You are a brave soul you desrve this...
Space_Msg=Looks like you got your hands full... come back later
Name=Dungon Master
Experience=200
need_count=1
1_need_num=5
1_need_val=1
give_count=1
1_num=1
1_val=30
1_dur=0


i have set the quest item as number 5 and its a key
i have set the amount to one
then he gives me 30 ore - ore being item number 1

and when i have a silver key he just repeats the question message
where am i going wrong?
anny44
Suicidal Maniac
Active Member
***
Offline Offline

Posts: 126

Emo...


View Profile WWW Email
« Reply #12 on: June 11, 2006, 10:28:45 AM »

same 4 me.
Moderob
Active Member
***
Offline Offline

Posts: 322



View Profile Email
« Reply #13 on: June 11, 2006, 11:07:02 AM »

im using ur super main.txt (or whatever you called it) and the scriptedNPC is not in there so i put the Sub for it above the Commands(index)
which is where it is in the normal main.txt (not sure if that matters)
and i have the other part at the bottom

i type /test in server, says it all  works
set my npc to be scripted 0, attack, and nothing happens, i have all the folders and such, this is the only script i cant get to work

most likely im doing something stupidly easy wrong so, any input would be appreciated
unnown
Teh Uberleet
*****
Offline Offline

Posts: 3,659


-Admin-


View Profile Email
« Reply #14 on: June 11, 2006, 11:25:11 AM »

baron
Call playermsg(index, "No quest found, generating generic quest sript under server\mapextras\" & GetPlayerMap(index) & ".ini", 14)

whats a sript?

besides that good script :P
and for the scripted npc...the npc needs to have an attack and hp and stuuf like that to work?(just checking)
Moderob
Active Member
***
Offline Offline

Posts: 322



View Profile Email
« Reply #15 on: June 11, 2006, 11:28:26 AM »

Quote from: unnown
baron
Call playermsg(index, "No quest found, generating generic quest sript under server\mapextras\" & GetPlayerMap(index) & ".ini", 14)

whats a sript?

besides that good script :P
and for the scripted npc...the npc needs to have an attack and hp and stuuf like that to work?(just checking)


im pretty sure it has that, ill check again and let u know if that might fix it
Rogue
Veteran
Advanced Member
*
Offline Offline

Posts: 670


GARBL