It is currently Fri Nov 21, 2008 7:39 pm

All times are UTC - 8 hours




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Stable Master
PostPosted: Sat Aug 19, 2006 10:47 am 
Offline

Joined: Fri Apr 14, 2006 9:36 am
Posts: 240
In stablemaster.src(AI) If i change

Quote:
if(GetObjProperty(ticket, "StableMaster") != me.serial)
PrintTextAbovePrivate(me, "This doesnt seem to be one of my tickets, please take it to the stable master who issued it.", player);
MoveItemToContainer(ticket, player.backpack);
return;
elseif(!canclaim(player,GetObjProperty(ticket, "pettemplate")))
say("You have no chance of controlling that!");
return;
endif


to


Quote:
if(GetObjProperty(ticket, "StableMaster") != me.serial)
say("One moment please...");
elseif(!canclaim(player,GetObjProperty(ticket, "pettemplate")))
say("You have no chance of controlling that!");
return;
endif



Would that remove the part that makes it so you can only take it to that specific stable master?


Top
 Profile  
 
 Post subject:
PostPosted: Sat Aug 19, 2006 1:40 pm 
Offline
Packet Maintainer

Joined: Thu Feb 02, 2006 8:33 am
Posts: 319
I don't know your scripting, but it seems that the stablemaster serial, where the pet is stabled is stored as CProp "StableMaster" on the ticket.
If you don't won't that you can ignore that ticket cprop, or better don't save it on the ticket.

If it is on the ticket you can save script performance time if you use:

Code:
if(!canclaim(player,GetObjProperty(ticket, "pettemplate")))
say("You have no chance of controlling that!");
return;
endif


If that's what you want, you should remove the saving of the serial of the stablemaster on the ticket. Because in this case it is useless.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Aug 19, 2006 2:41 pm 
Offline

Joined: Fri Apr 14, 2006 9:36 am
Posts: 240
Eh ok new problemo..
Uhm, it tells me he doesnt have this pet... any ideas on how i could fix this? Maybe write a whole new simple script..

Ok i did this
Code:
    if(!pet)
CreateNpcFromTemplate( pet, player.x, player.y, player.z );
    endif


and got an error(in game) it said "take care of error text = "Object does not support members" be sure to feed it!

entire function:

Code:
function Load_Ticket_Data(player, ticket)
    if(!canclaim(player,GetObjProperty(ticket, "pettemplate")))
    say("You have no chance of controlling that!");
    return;
  endif
  var tempdata := 0;
  var newpet := 0;
  var pet;
  if(ticket.objtype == 0x14f0)
    tempdata := GetObjProperty(ticket, "petserial");
    say("Oh, let me find your pet for you. One moment, please.");
    sleep(1);
    var petserial := GetObjProperty(ticket, "petserial");
    mystorage := GetObjProperty(me, "Pets");
    if(petserial in mystorage)
      pet := SystemFindObjectBySerial(petserial);
    endif
    if(!pet)
CreateNpcFromTemplate( pet, player.x, player.y, player.z );
    endif
    SetObjProperty(pet, "master", player.serial);
    SetObjProperty(pet, "prevtamed", 1);
    EraseObjProperty(pet,"stabled");
    EraseObjProperty(pet,"days");
   pet.script := "tamed";
    RestartScript(pet);
    RevokePrivilege(pet, "invul");
    MoveCharacterToLocation(pet, player.x, player.y, player.z, MOVECHAR_FORCELOCATION);
    var holder := array;
    mystorage := GetObjProperty(me, "Pets");
    foreach thing in mystorage
      if(thing != pet.serial)
        holder.append(thing);
      endif
    endforeach
    mystorage := holder;
    SetObjProperty(me, "Pets", mystorage);
    EraseObjProperty(pet, "NextCounter");
    say("Take care of " + pet.name + " and be sure to feed it!");
    DestroyItem(ticket);
  else
    TakeItem(player, ticket);
  endif
endfunction


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 21, 2006 1:56 pm 
Offline

Joined: Fri Apr 14, 2006 9:36 am
Posts: 240
Bump... As to the post above, it does not creat the pet either.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 24, 2006 1:09 pm 
Offline

Joined: Fri Apr 14, 2006 9:36 am
Posts: 240
bump, please help my shard is growing and this is becoming increasingly a problem... And school just started so i dont have as much time to script..


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 8 hours


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Style based on FI Subice by phpBBservice.nl