how to write a business paper writing essays for ielts essay on can money buy happiness cosmetology research paper

can an object in a container get the actor.id?

  • hurin
  • Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
More
5 days 17 hours ago #8725 by hurin
So I have an object that when the timer expires it removes variables from the player before it may transform/purge/load something else

Now its easy of course if the object is on a player or carried by a player

if %self.worn_by%
set actor %self.worn_by%
elseif %self.carried_by%
set actor %self.carried_by%

What if the player has the object in a container?
Is there a way to set the actor for something like that
elseif ??self.carried_incontainer_by??

Any help would be appreciated,
Hurin

Please Log in or Create an account to join the conversation.

More
5 days 4 hours ago - 5 days 4 hours ago #8726 by Rumble
Good question, probably more than one way to do this. I would use %has.item% or maybe %has.in%. If that doesn't work try to model the below example. Please let us know the results, looks like I need to update those helpfiles and examples.
Name: 'Mob Checks Player Inventory',  VNum: [   32], RNum: [   32]
Trigger Intended Assignment: Mobiles
Trigger Type: Greet , Numeric Arg: 100, Arg list: None
Commands:
* By Rumble of The Builder Academy    tbamud.com 9091
* This trigger has been replaced by the has_item variable. But this is still a
* good example. if %actor.has_item(1300)% does the same thing.
if %actor.eq(wield)%
  eval wep %actor.eq(wield)%
  if %wep.vnum%==1300
    set has_it 1
  end
end
* Checks the actors inventory if not wielding it.
if !%has_it%
  eval i %actor.inventory%
  while %i%
    set next %i.next_in_list%
    if %i.vnum%==1300
      set has_it 1
      break
    end
    * checks inside containers
    if %i.type% == CONTAINER
      while %i.contents%
        if %i.contents.vnum%==1300
          set has_it 1
          break
        end
      done
    end
    set i %next%
  done
end
*
if %has_it%
  say %actor.name% has that special item.
else
  say %actor.name% doesnt have that crappy item.
end

Rumble
The Builder Academy
tbamud.com 9091
This email address is being protected from spambots. You need JavaScript enabled to view it.
Last edit: 5 days 4 hours ago by Rumble.

Please Log in or Create an account to join the conversation.

Time to create page: 0.162 seconds