Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 07-20-2003, 01:23 AM
Chris1Polly Chris1Polly is offline
Registered User
Chris1Polly's Avatar
Join Date: Feb 2002
Location: A place without hate
Posts: 44
Chris1Polly is on a distinguished road
Send a message via AIM to Chris1Polly
Tokens and Strings - A Problem

Well Ive got a doosie of a problem this time. Ive tried everything I can think of to come up with a way to tokenize a string, add another string to a certain token, then putting the string in place again. [its for stackable items in a custom inventory - that bypasses the normal graal inventory] This is what I have, well theres more but this is the part that has the error I think. Am I going about this wrong? Or can it not be done... though I would think it can, considering Ive not slept in a few days I cant think straight ! Thanks in advance to anyone who can help!
NPC Code:

if (created){
setstring this.type,barbedarrow;
setstring this.maxstack,100;
setstring this.stack,100;
setstring this.icon,server-ammotest.gif;
setstring this.pierce,0;
setstring this.slash,0;
setstring this.magic,0;
setstring this.blunt,0;
setstring this.cold,0;
setstring this.shock,0;
setstring this.acid,0;
setstring this.fire,0;
setimgpart #s(this.icon),7,2,31,31;
setstring this.free,1;
}
if (playertouchsme){
tokenize #s(client.ammo(#s(this.free)));
if (strequals(#t(1),#s(this.type))){
setstring this.current,#t(3);
if (strtofloat(#t(3))<strtofloat(#t(2))){
setstring client.ammo#s(this.free),#s(this.icon),#s(this.typ e),#s(this.maxstack),#v(strtofloat(#s(this.current ))+strtofloat(#s(this.stack))),#s(this.pierce),#s( this.slash),#s(this.magic),#s(this.blunt),#s(this. cold),#s(this.shock),#s(this.acid),#s(this.fire);
destroy;
}
}
}

__________________
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 01:34 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.